Function: Info--record-tag-table

Info--record-tag-table is a byte-compiled function defined in info.el.gz.

Signature

(Info--record-tag-table NODENAME)

Documentation

If the current Info file has a tag table, record its location for NODENAME.

This creates a tag-table buffer, sets Info-tag-table-buffer to name that buffer, and records the buffer and the tag table in the marker Info-tag-table-buffer. If the Info file has no tag table, or if NODENAME is "*", the function sets the marker to nil to indicate the tag table is not available/relevant.

The function assumes that the Info buffer is widened, and does not preserve point.

Source Code

;; Defined in /usr/src/emacs/lisp/info.el.gz
(defun Info--record-tag-table (nodename)
  "If the current Info file has a tag table, record its location for NODENAME.

This creates a tag-table buffer, sets `Info-tag-table-buffer' to
name that buffer, and records the buffer and the tag table in
the marker `Info-tag-table-buffer'.  If the Info file has no
tag table, or if NODENAME is \"*\", the function sets the marker
to nil to indicate the tag table is not available/relevant.

The function assumes that the Info buffer is widened, and does
not preserve point."
  (goto-char (point-max))
  (forward-line -8)
  ;; Use string-equal, not equal, to ignore text props.
  (if (not (or (string-equal nodename "*")
	       (not
		(search-forward "\^_\nEnd tag table\n" nil t))))
      (let (pos)
	;; We have a tag table.  Find its beginning.
	;; Is this an indirect file?
	(search-backward "\nTag table:\n")
	(setq pos (point))
	(if (save-excursion
	      (forward-line 2)
	      (looking-at "(Indirect)\n"))
	    ;; It is indirect.  Copy it to another buffer
	    ;; and record that the tag table is in that buffer.
	    (let ((buf (current-buffer))
		  (tagbuf
		   (or Info-tag-table-buffer
		       (generate-new-buffer " *info tag table*"))))
	      (setq Info-tag-table-buffer tagbuf)
	      (with-current-buffer tagbuf
		(buffer-disable-undo (current-buffer))
		(setq case-fold-search t)
		(erase-buffer)
		(insert-buffer-substring buf))
	      (set-marker Info-tag-table-marker
			  (match-end 0) tagbuf))
	  (set-marker Info-tag-table-marker pos)))
    (set-marker Info-tag-table-marker nil)))