aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-06-13 20:34:26 +0000
committerStefan Monnier2008-06-13 20:34:26 +0000
commitfdeb777a1d88efa9112d2b75aa4415c7659ba522 (patch)
tree9767ad26a776584583fa222e8a3a505c934c0fed
parentee128870d861ef4fc8fd47dfe60667a3ff9b854e (diff)
downloademacs-fdeb777a1d88efa9112d2b75aa4415c7659ba522.tar.gz
emacs-fdeb777a1d88efa9112d2b75aa4415c7659ba522.zip
(Info-breadcrumbs-depth): New var.
(Info-insert-breadcrumbs): New function. (Info-fontify-node): Use it. (Info-mode-map): Move initialization into declaration.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog30
-rw-r--r--lisp/info.el179
3 files changed, 137 insertions, 75 deletions
diff --git a/etc/NEWS b/etc/NEWS
index f06adf69f5d..db7835884ac 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -64,6 +64,9 @@ default toolkit, but you can use --with-x-toolkit=gtk if necessary.
64 64
65* Changes in Emacs 23.1 65* Changes in Emacs 23.1
66 66
67** Info displays breadcrumbs in the header of the page.
68See Info-breadcrumbs-depth to control it.
69
67** Emacs now supports serial port access on GNU/Linux, Unix, and 70** Emacs now supports serial port access on GNU/Linux, Unix, and
68Windows. `serial-term' starts an interactive terminal, 71Windows. `serial-term' starts an interactive terminal,
69`make-serial-process' and `serial-process-configure' provide a Lisp 72`make-serial-process' and `serial-process-configure' provide a Lisp
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e941d0f1312..0b49bd9363a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,16 +1,24 @@
12008-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
2 Drew Adams <drew.adams@oracle.com>
3
4 * info.el (Info-breadcrumbs-depth): New var.
5 (Info-insert-breadcrumbs): New function.
6 (Info-fontify-node): Use it.
7 (Info-mode-map): Move initialization into declaration.
8
12008-06-13 Ulf Jasper <ulf.jasper@web.de> 92008-06-13 Ulf Jasper <ulf.jasper@web.de>
2 10
3 * net/newsticker.el: Renamed net/newsticker-*.el to net/newst-*.el. 11 Rename net/newsticker-*.el to net/newst-*.el.
4 * net/newst-backend.el: New. Renamed from net/newsticker-backend.el. 12 * net/newst-backend.el: Rename from net/newsticker-backend.el.
5 * net/newst-plainview.el: New. Renamed from net/newsticker-plainview.el. 13 * net/newst-plainview.el: Rename from net/newsticker-plainview.el.
6 * net/newst-reader.el: New. Renamed from net/newsticker-reader.el. 14 * net/newst-reader.el: Rename from net/newsticker-reader.el.
7 * net/newst-ticker.el: New. Renamed from net/newsticker-ticker.el. 15 * net/newst-ticker.el: Rename from net/newsticker-ticker.el.
8 * net/newst-treeview.el: New. Renamed from net/newsticker-treeview.el. 16 * net/newst-treeview.el: Rename from net/newsticker-treeview.el.
9 * net/newsticker-backend.el: Removed. Renamed to net/newst-backend.el. 17 * net/newsticker-backend.el: Rename to net/newst-backend.el.
10 * net/newsticker-plainview.el: Removed. Renamed to net/newst-plainview.el. 18 * net/newsticker-plainview.el: Rename to net/newst-plainview.el.
11 * net/newsticker-reader.el: Removed. Renamed to net/newst-reader.el. 19 * net/newsticker-reader.el: Rename to net/newst-reader.el.
12 * net/newsticker-ticker.el: Removed. Renamed to net/newst-ticker.el. 20 * net/newsticker-ticker.el: Rename to net/newst-ticker.el.
13 * net/newsticker-treeview.el: Removed. Renamed to net/newst-treeview.el. 21 * net/newsticker-treeview.el: Rename to net/newst-treeview.el.
14 22
152008-06-13 Stefan Monnier <monnier@iro.umontreal.ca> 232008-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
16 24
diff --git a/lisp/info.el b/lisp/info.el
index 57a791f3e27..ae62e9dd3f6 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3121,66 +3121,65 @@ If FORK is non-nil, it i spassed to `Info-goto-node'."
3121 (Info-goto-node node fork))) 3121 (Info-goto-node node fork)))
3122 node)) 3122 node))
3123 3123
3124(defvar Info-mode-map nil 3124(defvar Info-mode-map
3125 (let ((map (make-keymap)))
3126 (suppress-keymap map)
3127 (define-key map "." 'beginning-of-buffer)
3128 (define-key map " " 'Info-scroll-up)
3129 (define-key map "\C-m" 'Info-follow-nearest-node)
3130 (define-key map "\t" 'Info-next-reference)
3131 (define-key map "\e\t" 'Info-prev-reference)
3132 (define-key map [(shift tab)] 'Info-prev-reference)
3133 (define-key map [backtab] 'Info-prev-reference)
3134 (define-key map "1" 'Info-nth-menu-item)
3135 (define-key map "2" 'Info-nth-menu-item)
3136 (define-key map "3" 'Info-nth-menu-item)
3137 (define-key map "4" 'Info-nth-menu-item)
3138 (define-key map "5" 'Info-nth-menu-item)
3139 (define-key map "6" 'Info-nth-menu-item)
3140 (define-key map "7" 'Info-nth-menu-item)
3141 (define-key map "8" 'Info-nth-menu-item)
3142 (define-key map "9" 'Info-nth-menu-item)
3143 (define-key map "0" 'undefined)
3144 (define-key map "?" 'Info-summary)
3145 (define-key map "]" 'Info-forward-node)
3146 (define-key map "[" 'Info-backward-node)
3147 (define-key map "<" 'Info-top-node)
3148 (define-key map ">" 'Info-final-node)
3149 (define-key map "b" 'beginning-of-buffer)
3150 (define-key map "d" 'Info-directory)
3151 (define-key map "e" 'Info-edit)
3152 (define-key map "f" 'Info-follow-reference)
3153 (define-key map "g" 'Info-goto-node)
3154 (define-key map "h" 'Info-help)
3155 (define-key map "i" 'Info-index)
3156 (define-key map "l" 'Info-history-back)
3157 (define-key map "L" 'Info-history)
3158 (define-key map "m" 'Info-menu)
3159 (define-key map "n" 'Info-next)
3160 (define-key map "p" 'Info-prev)
3161 (define-key map "q" 'Info-exit)
3162 (define-key map "r" 'Info-history-forward)
3163 (define-key map "s" 'Info-search)
3164 (define-key map "S" 'Info-search-case-sensitively)
3165 ;; For consistency with Rmail.
3166 (define-key map "\M-s" 'Info-search)
3167 (define-key map "\M-n" 'clone-buffer)
3168 (define-key map "t" 'Info-top-node)
3169 (define-key map "T" 'Info-toc)
3170 (define-key map "u" 'Info-up)
3171 ;; `w' for consistency with `dired-copy-filename-as-kill'.
3172 (define-key map "w" 'Info-copy-current-node-name)
3173 (define-key map "c" 'Info-copy-current-node-name)
3174 ;; `^' for consistency with `dired-up-directory'.
3175 (define-key map "^" 'Info-up)
3176 (define-key map "," 'Info-index-next)
3177 (define-key map "\177" 'Info-scroll-down)
3178 (define-key map [mouse-2] 'Info-mouse-follow-nearest-node)
3179 (define-key map [follow-link] 'mouse-face)
3180 map)
3125 "Keymap containing Info commands.") 3181 "Keymap containing Info commands.")
3126(if Info-mode-map 3182
3127 nil
3128 (setq Info-mode-map (make-keymap))
3129 (suppress-keymap Info-mode-map)
3130 (define-key Info-mode-map "." 'beginning-of-buffer)
3131 (define-key Info-mode-map " " 'Info-scroll-up)
3132 (define-key Info-mode-map "\C-m" 'Info-follow-nearest-node)
3133 (define-key Info-mode-map "\t" 'Info-next-reference)
3134 (define-key Info-mode-map "\e\t" 'Info-prev-reference)
3135 (define-key Info-mode-map [(shift tab)] 'Info-prev-reference)
3136 (define-key Info-mode-map [backtab] 'Info-prev-reference)
3137 (define-key Info-mode-map "1" 'Info-nth-menu-item)
3138 (define-key Info-mode-map "2" 'Info-nth-menu-item)
3139 (define-key Info-mode-map "3" 'Info-nth-menu-item)
3140 (define-key Info-mode-map "4" 'Info-nth-menu-item)
3141 (define-key Info-mode-map "5" 'Info-nth-menu-item)
3142 (define-key Info-mode-map "6" 'Info-nth-menu-item)
3143 (define-key Info-mode-map "7" 'Info-nth-menu-item)
3144 (define-key Info-mode-map "8" 'Info-nth-menu-item)
3145 (define-key Info-mode-map "9" 'Info-nth-menu-item)
3146 (define-key Info-mode-map "0" 'undefined)
3147 (define-key Info-mode-map "?" 'Info-summary)
3148 (define-key Info-mode-map "]" 'Info-forward-node)
3149 (define-key Info-mode-map "[" 'Info-backward-node)
3150 (define-key Info-mode-map "<" 'Info-top-node)
3151 (define-key Info-mode-map ">" 'Info-final-node)
3152 (define-key Info-mode-map "b" 'beginning-of-buffer)
3153 (define-key Info-mode-map "d" 'Info-directory)
3154 (define-key Info-mode-map "e" 'Info-edit)
3155 (define-key Info-mode-map "f" 'Info-follow-reference)
3156 (define-key Info-mode-map "g" 'Info-goto-node)
3157 (define-key Info-mode-map "h" 'Info-help)
3158 (define-key Info-mode-map "i" 'Info-index)
3159 (define-key Info-mode-map "l" 'Info-history-back)
3160 (define-key Info-mode-map "L" 'Info-history)
3161 (define-key Info-mode-map "m" 'Info-menu)
3162 (define-key Info-mode-map "n" 'Info-next)
3163 (define-key Info-mode-map "p" 'Info-prev)
3164 (define-key Info-mode-map "q" 'Info-exit)
3165 (define-key Info-mode-map "r" 'Info-history-forward)
3166 (define-key Info-mode-map "s" 'Info-search)
3167 (define-key Info-mode-map "S" 'Info-search-case-sensitively)
3168 ;; For consistency with Rmail.
3169 (define-key Info-mode-map "\M-s" 'Info-search)
3170 (define-key Info-mode-map "\M-n" 'clone-buffer)
3171 (define-key Info-mode-map "t" 'Info-top-node)
3172 (define-key Info-mode-map "T" 'Info-toc)
3173 (define-key Info-mode-map "u" 'Info-up)
3174 ;; `w' for consistency with `dired-copy-filename-as-kill'.
3175 (define-key Info-mode-map "w" 'Info-copy-current-node-name)
3176 (define-key Info-mode-map "c" 'Info-copy-current-node-name)
3177 ;; `^' for consistency with `dired-up-directory'.
3178 (define-key Info-mode-map "^" 'Info-up)
3179 (define-key Info-mode-map "," 'Info-index-next)
3180 (define-key Info-mode-map "\177" 'Info-scroll-down)
3181 (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
3182 (define-key Info-mode-map [follow-link] 'mouse-face)
3183 )
3184 3183
3185(defun Info-check-pointer (item) 3184(defun Info-check-pointer (item)
3186 "Non-nil if ITEM is present in this node." 3185 "Non-nil if ITEM is present in this node."
@@ -3712,6 +3711,49 @@ the variable `Info-file-list-for-emacs'."
3712 keymap) 3711 keymap)
3713 "Keymap to put on the Up link in the text or the header line.") 3712 "Keymap to put on the Up link in the text or the header line.")
3714 3713
3714(defcustom Info-breadcrumbs-depth 3
3715 "Depth of breadcrumbs to display.
37160 means do not display breadcrumbs."
3717 :type 'integer)
3718
3719(defun Info-insert-breadcrumbs ()
3720 (let ((onode Info-current-node)
3721 (crumbs ())
3722 (depth Info-breadcrumbs-depth)
3723 (Info-fontify-maximum-menu-size nil)) ; Prevent infinite recursion.
3724 (unwind-protect
3725 (while (and (not (equal "Top" Info-current-node)) (> depth 0))
3726 (let ((up (Info-extract-pointer "up")))
3727 (push up crumbs)
3728 (setq depth (1- depth))
3729 (Info-goto-node up)))
3730 (Info-goto-node onode)
3731 ;; Add bottom node.
3732 (when Info-use-header-line
3733 ;; Let it disappear if crumbs is nil.
3734 (nconc crumbs (list Info-current-node)))
3735 (when (or Info-use-header-line crumbs)
3736 ;; Add top node (and continuation if needed).
3737 (setq crumbs
3738 (cons "Top" (if (member (pop crumbs) '(nil "Top"))
3739 crumbs (cons nil crumbs))))
3740 ;; Eliminate duplicate.
3741 (forward-line 1)
3742 (dolist (node crumbs)
3743 (let ((text
3744 (if (not (equal node "Top")) node
3745 (format "(%s)Top"
3746 (file-name-nondirectory Info-current-file)))))
3747 (insert (if (bolp) "> " " > ")
3748 (cond
3749 ((null node) "...")
3750 ((equal node Info-current-node)
3751 ;; No point linking to ourselves.
3752 (propertize text 'font-lock-face 'info-header-node))
3753 (t
3754 (concat "*Note " text "::"))))))
3755 (insert "\n")))))
3756
3715(defun Info-fontify-node () 3757(defun Info-fontify-node ()
3716 "Fontify the node." 3758 "Fontify the node."
3717 (save-excursion 3759 (save-excursion
@@ -3756,6 +3798,11 @@ the variable `Info-file-list-for-emacs'."
3756 ((string-equal (downcase tag) "prev") Info-prev-link-keymap) 3798 ((string-equal (downcase tag) "prev") Info-prev-link-keymap)
3757 ((string-equal (downcase tag) "next") Info-next-link-keymap) 3799 ((string-equal (downcase tag) "next") Info-next-link-keymap)
3758 ((string-equal (downcase tag) "up" ) Info-up-link-keymap)))))) 3800 ((string-equal (downcase tag) "up" ) Info-up-link-keymap))))))
3801
3802 (when (> Info-breadcrumbs-depth 0)
3803 (Info-insert-breadcrumbs))
3804
3805 ;; Treat header line.
3759 (when Info-use-header-line 3806 (when Info-use-header-line
3760 (goto-char (point-min)) 3807 (goto-char (point-min))
3761 (let* ((header-end (line-end-position)) 3808 (let* ((header-end (line-end-position))
@@ -3783,10 +3830,13 @@ the variable `Info-file-list-for-emacs'."
3783 (lambda (s) (concat s s)) header)) 3830 (lambda (s) (concat s s)) header))
3784 ;; Hide the part of the first line 3831 ;; Hide the part of the first line
3785 ;; that is in the header, if it is just part. 3832 ;; that is in the header, if it is just part.
3786 (unless (bobp) 3833 (cond
3834 ((> Info-breadcrumbs-depth 0)
3835 (put-text-property (point-min) (1+ header-end) 'invisible t))
3836 ((not (bobp))
3787 ;; Hide the punctuation at the end, too. 3837 ;; Hide the punctuation at the end, too.
3788 (skip-chars-backward " \t,") 3838 (skip-chars-backward " \t,")
3789 (put-text-property (point) header-end 'invisible t))))) 3839 (put-text-property (point) header-end 'invisible t))))))
3790 3840
3791 ;; Fontify titles 3841 ;; Fontify titles
3792 (goto-char (point-min)) 3842 (goto-char (point-min))
@@ -3823,7 +3873,8 @@ the variable `Info-file-list-for-emacs'."
3823 other-tag) 3873 other-tag)
3824 (when not-fontified-p 3874 (when not-fontified-p
3825 (when Info-hide-note-references 3875 (when Info-hide-note-references
3826 (when (not (eq Info-hide-note-references 'hide)) 3876 (when (and (not (eq Info-hide-note-references 'hide))
3877 (> (line-number-at-pos) 4)) ; Skip breadcrumbs
3827 ;; *Note is often used where *note should have been 3878 ;; *Note is often used where *note should have been
3828 (goto-char start) 3879 (goto-char start)
3829 (skip-syntax-backward " ") 3880 (skip-syntax-backward " ")
@@ -4070,8 +4121,8 @@ the variable `Info-file-list-for-emacs'."
4070 nil t) 4121 nil t)
4071 (add-text-properties (match-beginning 0) (match-end 0) 4122 (add-text-properties (match-beginning 0) (match-end 0)
4072 '(font-lock-face info-xref 4123 '(font-lock-face info-xref
4073 mouse-face highlight 4124 mouse-face highlight
4074 help-echo "mouse-2: go to this URL")))) 4125 help-echo "mouse-2: go to this URL"))))
4075 4126
4076 (set-buffer-modified-p nil)))) 4127 (set-buffer-modified-p nil))))
4077 4128