Commit 35d2d241 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Info-fontify-node): For menu items, use info-xref font.

Use info-node font for the node's own name,
and do not make it mouse-sensitive.

(Info-find-node): Update Info-history after switching buffer.
(info): If no arg, and *info* buffer exists, just go to it and don't alter it.
parent d7c0adec
...@@ -286,10 +286,12 @@ The top-level Info directory is made by combining all the files named `dir' ...@@ -286,10 +286,12 @@ The top-level Info directory is made by combining all the files named `dir'
in all the directories in that path." in all the directories in that path."
(interactive (if current-prefix-arg (interactive (if current-prefix-arg
(list (read-file-name "Info file name: " nil nil t)))) (list (read-file-name "Info file name: " nil nil t))))
(pop-to-buffer "*info*")
(if file (if file
(Info-goto-node (concat "(" file ")")) (progn (pop-to-buffer "*info*")
(Info-directory))) (Info-goto-node (concat "(" file ")")))
(if (get-buffer "*info*")
(pop-to-buffer "*info*")
(Info-directory))))
;;;###autoload ;;;###autoload
(defun info-standalone () (defun info-standalone ()
...@@ -353,16 +355,16 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -353,16 +355,16 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(if found (if found
(setq filename found) (setq filename found)
(error "Info file %s does not exist" filename)))) (error "Info file %s does not exist" filename))))
;; Record the node we are leaving.
(if (and Info-current-file (not no-going-back))
(setq Info-history
(cons (list Info-current-file Info-current-node (point))
Info-history)))
;; Go into info buffer. ;; Go into info buffer.
(or (eq major-mode 'Info-mode) (pop-to-buffer "*info*")) (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
(buffer-disable-undo (current-buffer)) (buffer-disable-undo (current-buffer))
(or (eq major-mode 'Info-mode) (or (eq major-mode 'Info-mode)
(Info-mode)) (Info-mode))
;; Record the node we are leaving.
(if (and Info-current-file (not no-going-back))
(setq Info-history
(cons (list Info-current-file Info-current-node (point))
Info-history)))
(widen) (widen)
(setq Info-current-node nil) (setq Info-current-node nil)
(unwind-protect (unwind-protect
...@@ -1997,16 +1999,20 @@ The alist key is the character the title is underlined with (?*, ?= or ?-)." ...@@ -1997,16 +1999,20 @@ The alist key is the character the title is underlined with (?*, ?= or ?-)."
(save-excursion (save-excursion
(let ((buffer-read-only nil)) (let ((buffer-read-only nil))
(goto-char (point-min)) (goto-char (point-min))
(if (looking-at "^File: [^,: \t]+,?[ \t]+") (when (looking-at "^File: [^,: \t]+,?[ \t]+")
(progn (goto-char (match-end 0))
(goto-char (match-end 0)) (while
(while (looking-at "[ \t]*\\([^:, \t\n]+\\):[ \t]+\\([^:,\t\n]+\\),?")
(looking-at "[ \t]*[^:, \t\n]+:[ \t]+\\([^:,\t\n]+\\),?") (goto-char (match-end 0))
(goto-char (match-end 0)) (if (save-excursion
(put-text-property (match-beginning 1) (match-end 1) (goto-char (match-beginning 1))
'face 'info-xref) (save-match-data (looking-at "Node:")))
(put-text-property (match-beginning 1) (match-end 1) (put-text-property (match-beginning 2) (match-end 2)
'mouse-face 'highlight)))) 'face 'info-node)
(put-text-property (match-beginning 2) (match-end 2)
'face 'info-xref)
(put-text-property (match-beginning 2) (match-end 2)
'mouse-face 'highlight))))
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\)$" (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\)$"
nil t) nil t)
...@@ -2040,7 +2046,7 @@ The alist key is the character the title is underlined with (?*, ?= or ?-)." ...@@ -2040,7 +2046,7 @@ The alist key is the character the title is underlined with (?*, ?= or ?-)."
(1+ (match-beginning 0)) (1+ (match-beginning 0))
'face 'info-menu-5)) 'face 'info-menu-5))
(put-text-property (match-beginning 1) (match-end 1) (put-text-property (match-beginning 1) (match-end 1)
'face 'info-node) 'face 'info-xref)
(put-text-property (match-beginning 1) (match-end 1) (put-text-property (match-beginning 1) (match-end 1)
'mouse-face 'highlight)))) 'mouse-face 'highlight))))
(set-buffer-modified-p nil)))) (set-buffer-modified-p nil))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment