(defvar Info-directory-list
(let ((path (getenv "INFOPATH"))
- (sep (if (eq system-type 'ms-dos) ";" ":"))
+ (sep (if (or (eq system-type 'ms-dos)
+ (eq system-type 'windows-nt))
+ ";" ":"))
(sibling (expand-file-name "../info/" (invocation-directory))))
(if path
(let ((list nil)
(nreverse list))
(if (or (member sibling Info-default-directory-list)
(not (file-exists-p sibling))
- ;; On MS-DOS, we use movable executables always,
+ ;; On DOS/NT, we use movable executables always,
;; and we must always find the Info dir at run time.
- (if (eq system-type 'ms-dos)
+ (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
nil
;; Use invocation-directory for Info only if we used it for
;; exec-directory also.
(setq tail (cdr tail)))
(setq fullname (concat filename (car (car tail)))
decoder (cdr (car tail)))
- ;; check for conflict with jka-compr
- (if (and (featurep 'jka-compr)
- (jka-compr-installed-p)
- (jka-compr-get-compression-info (concat filename
- (car (car tail)))))
- (setq decoder nil))
(or tail
(error "Can't find %s or any compressed version of it!" filename)))
+ ;; check for conflict with jka-compr
+ (if (and (featurep 'jka-compr)
+ (jka-compr-installed-p)
+ (jka-compr-get-compression-info fullname))
+ (setq decoder nil))
(insert-file-contents fullname visit)
(if decoder
(let ((buffer-read-only nil))
;; If specified name starts with `./'
;; then just try current directory.
'("./")
- (if Info-additional-directory-list
- (append Info-directory-list
- Info-additional-directory-list)
- Info-directory-list))))
+ (if (file-name-absolute-p filename)
+ ;; No point in searching for an
+ ;; absolute file name
+ '(nil)
+ (if Info-additional-directory-list
+ (append Info-directory-list
+ Info-additional-directory-list)
+ Info-directory-list)))))
;; Search the directory list for file FILENAME.
(while (and dirs (not found))
(setq temp (expand-file-name filename (car dirs)))
nil t)
(progn
(search-forward "\n\^_" nil 'move)
- (beginning-of-line))
+ (beginning-of-line)
+ (insert "\n"))
;; If none exists, add one.
(goto-char (point-max))
(insert "\^_\nFile: dir\tNode: " nodename "\n\n* Menu:\n\n"))
;; Merge the text from the other buffer's menu
;; into the menu in the like-named node in the main buffer.
- (apply 'insert-buffer-substring (cdr (car nodes)))
- (insert "\n"))
+ (apply 'insert-buffer-substring (cdr (car nodes))))
(setq nodes (cdr nodes)))
;; Kill all the buffers we just made.
(while buffers
(list (if (equal input "")
default input)))
(error "No cross-references in this node"))))
- (let (target beg i (str (concat "\\*note " footnotename)))
+ (let (target beg i (str (concat "\\*note " (regexp-quote footnotename))))
(while (setq i (string-match " " str i))
(setq str (concat (substring str 0 i) "[ \t\n]+" (substring str (1+ i))))
(setq i (+ i 6)))
(t (error "No previous nodes"))))
(defun Info-scroll-up ()
- "Read the next screen. If end of buffer is visible, go to next entry."
+ "Scroll one screenful forward in Info, considering all nodes as one sequence.
+Once you scroll far enough in a node that its menu appears on the screen,
+the next scroll moves into its first subnode. When you scroll past
+the end of a node, that goes back to the parent node."
(interactive)
(if (or (< (window-start) (point-min))
(> (window-start) (point-max)))
(scroll-up))))
(defun Info-scroll-down ()
- "Read the previous screen. If start of buffer is visible, go to last entry."
+ "Scroll one screenful back in Info, considering all nodes as one sequence.
+If you are within the menu of a node, this follows the previous
+menu item, so that you scroll through all the subnodes, ordered
+as if they appeared in place of the menu. When you scroll past
+the beginning of a node, that goes back to the parent node."
(interactive)
(if (or (< (window-start) (point-min))
(> (window-start) (point-max)))
(switch-to-buffer "*Help*")
(erase-buffer)
(insert (documentation 'Info-mode))
+ (help-mode)
(goto-char (point-min))
(let (ch flag)
(while (progn (setq flag (not (pos-visible-in-window-p (point-max))))
(define-key Info-mode-map "p" 'Info-prev)
(define-key Info-mode-map "q" 'Info-exit)
(define-key Info-mode-map "s" 'Info-search)
+ ;; For consistency with Rmail.
+ (define-key Info-mode-map "\M-s" 'Info-search)
(define-key Info-mode-map "t" 'Info-top-node)
(define-key Info-mode-map "u" 'Info-up)
(define-key Info-mode-map "," 'Info-index-next)
(make-local-variable 'Info-tag-table-marker)
(make-local-variable 'Info-history)
(make-local-variable 'Info-index-alternatives)
- (if (fboundp 'make-face)
+ (if (memq (framep (selected-frame)) '(x pc))
(progn
(make-face 'info-node)
(make-face 'info-menu-5)
Like text mode with the addition of `Info-cease-edit'
which returns to Info mode for browsing.
\\{Info-edit-map}"
- )
-
-(defun Info-edit ()
- "Edit the contents of this Info node.
-Allowed only if variable `Info-enable-edit' is non-nil."
- (interactive)
- (or Info-enable-edit
- (error "Editing info nodes is not enabled"))
(use-local-map Info-edit-map)
(setq major-mode 'Info-edit-mode)
(setq mode-name "Info Edit")
(setq buffer-read-only nil)
;; Make mode line update.
(set-buffer-modified-p (buffer-modified-p))
+ (buffer-enable-undo (current-buffer))
+ (run-hooks 'Info-edit-mode-hook))
+
+(defun Info-edit ()
+ "Edit the contents of this Info node.
+Allowed only if variable `Info-enable-edit' is non-nil."
+ (interactive)
+ (or Info-enable-edit
+ (error "Editing info nodes is not enabled"))
+ (Info-edit-mode)
(message (substitute-command-keys
- "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info")))
+ "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info")))
(defun Info-cease-edit ()
"Finish editing Info node; switch back to Info proper."