🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189437

Re: info search path

#189437
From: Michelangelo Grigni
Date: Tue, 19 Feb 1991 17:50
56 lines
2652 bytes
It is not as easy as it should be.  Appended is my info.el patch file,
it defines a function that will visit an info file in whatever
directory.  If the info file does not have a "Top" node, it visits the
first node.  You will need to modify the (load ...) line to get this
to work at your site.

--- snip ---
;; Mic's modified info.el

;; Get default library first:
(load "default/info" nil t)

;; Info-mode sets case-fold-search to t, so "top" = "Top".

;; This function is very convenient to call from dired:
(defun info-file (filename)
  "Visit FILE in info mode, either at \"top\" or first node."
  (interactive "fVisit Info file: ")
  (require 'info)
  ;; save old info node we are leaving
  (if (and Info-current-file Info-current-node)
      (setq Info-history
	    (cons (list Info-current-file Info-current-node (point))
		  Info-history)))
  ;; first try to find the "top" node
  (condition-case error
      ;; no-going-back = t, so we stay in file filename
      ;; even if it has no "top" node
      (Info-find-node (expand-file-name filename) "top" t)
    (error
     (cond
      ((equal error '(error "No such node: \"top\""))
       ;; try instead to find the first node
       (goto-char (point-min))
       (if (search-forward "\^_\n" nil t)
	   (Info-select-node)
	 (error "No info node found in this file.")))
      (t 
       ;; an unexpected error (eg file not found)
       ;; first try to back up Info-history
       (if Info-history
	   (let ((hist (car Info-history)))
	     (Info-find-node (nth 0 hist) (nth 1 hist) t)
	     (setq Info-history (cdr Info-history))
	     (goto-char (nth 2 hist))))
       ;; now signal the error
       (error (car (cdr error)))))
     )))

(setq Info-enable-edit t		; allow info file editing
      Info-enable-active-nodes nil)	; info trojan paranoia :O

;; end of file.
--- snip ---
--
Michelangelo Grigni  253-1365  NE43-346
Technical Details
Message-ID: <1991Feb19.175035.28057@mintaka.lcs.mit.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!spool.mu.edu!think.com!mintaka!mintaka!mic
References: <2143@fornax.UUCP>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,9f16ab14059249a
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-02-20 08:25:08 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!spool.mu.edu!think.com!mintaka!mintaka!mic
From: mic@theory.lcs.mit.edu (Michelangelo Grigni)
Newsgroups: gnu.emacs.help
Subject: Re: info search path
Message-ID: <1991Feb19.175035.28057@mintaka.lcs.mit.edu>
Date: 19 Feb 91 17:50:35 GMT
References: <2143@fornax.UUCP>
Sender: daemon@mintaka.lcs.mit.edu (Lucifer Maleficius)
Distribution: gnu
Organization: MIT Lab for Computer Science
Lines: 56
Posted: Tue Feb 19 11:50:35 1991
In-Reply-To: bremner@fornax.UUCP's message of 19 Feb 91 05:57:20 GMT