diff options
| author | Christopher Schmidt | 2013-02-01 17:46:46 +0100 |
|---|---|---|
| committer | Christopher Schmidt | 2013-02-01 17:46:46 +0100 |
| commit | 7b6d5ecf80c1dd407bc7201242eb01e3be6d02c5 (patch) | |
| tree | d5d7df9b533588338525bb3bd519603bbeae1ede | |
| parent | 686d9fb678108be1a599e800c7070008b3ce9169 (diff) | |
| download | emacs-7b6d5ecf80c1dd407bc7201242eb01e3be6d02c5.tar.gz emacs-7b6d5ecf80c1dd407bc7201242eb01e3be6d02c5.zip | |
* info.el (Info-next-reference, Info-prev-reference): Add numeric
prefix argument. (Bug#11656)
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/info.el | 98 |
2 files changed, 61 insertions, 42 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1b4e35ef76e..e42b513baea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-02-01 Christopher Schmidt <christopher@ch.ristopher.com> | ||
| 2 | |||
| 3 | * info.el (Info-next-reference, Info-prev-reference): Add numeric | ||
| 4 | prefix argument. (Bug#11656) | ||
| 5 | |||
| 1 | 2013-02-01 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2013-02-01 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * help-fns.el (help-split-fundoc): Don't insert byte-compiled body. | 8 | * help-fns.el (help-split-fundoc): Don't insert byte-compiled body. |
diff --git a/lisp/info.el b/lisp/info.el index e230ed0f82c..c276420fb7d 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -3063,48 +3063,62 @@ See `Info-scroll-down'." | |||
| 3063 | (select-window (posn-window (event-start e)))) | 3063 | (select-window (posn-window (event-start e)))) |
| 3064 | (Info-scroll-down))) | 3064 | (Info-scroll-down))) |
| 3065 | 3065 | ||
| 3066 | (defun Info-next-reference (&optional recur) | 3066 | (defun Info-next-reference (&optional recur count) |
| 3067 | "Move cursor to the next cross-reference or menu item in the node." | 3067 | "Move cursor to the next cross-reference or menu item in the node. |
| 3068 | (interactive) | 3068 | If COUNT is non-nil (interactively with a prefix arg), jump over |
| 3069 | (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") | 3069 | COUNT cross-references." |
| 3070 | (old-pt (point)) | 3070 | (interactive "i\np") |
| 3071 | (case-fold-search t)) | 3071 | (unless count |
| 3072 | (or (eobp) (forward-char 1)) | 3072 | (setq count 1)) |
| 3073 | (or (re-search-forward pat nil t) | 3073 | (if (< count 0) |
| 3074 | (progn | 3074 | (Info-prev-reference recur (- count)) |
| 3075 | (goto-char (point-min)) | 3075 | (while (unless (zerop count) (setq count (1- count))) |
| 3076 | (or (re-search-forward pat nil t) | 3076 | (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") |
| 3077 | (progn | 3077 | (old-pt (point)) |
| 3078 | (goto-char old-pt) | 3078 | (case-fold-search t)) |
| 3079 | (user-error "No cross references in this node"))))) | 3079 | (or (eobp) (forward-char 1)) |
| 3080 | (goto-char (or (match-beginning 1) (match-beginning 0))) | 3080 | (or (re-search-forward pat nil t) |
| 3081 | (if (looking-at "\\* Menu:") | 3081 | (progn |
| 3082 | (if recur | 3082 | (goto-char (point-min)) |
| 3083 | (user-error "No cross references in this node") | 3083 | (or (re-search-forward pat nil t) |
| 3084 | (Info-next-reference t)) | 3084 | (progn |
| 3085 | (if (looking-at "^\\* ") | 3085 | (goto-char old-pt) |
| 3086 | (forward-char 2))))) | 3086 | (user-error "No cross references in this node"))))) |
| 3087 | 3087 | (goto-char (or (match-beginning 1) (match-beginning 0))) | |
| 3088 | (defun Info-prev-reference (&optional recur) | 3088 | (if (looking-at "\\* Menu:") |
| 3089 | "Move cursor to the previous cross-reference or menu item in the node." | 3089 | (if recur |
| 3090 | (interactive) | 3090 | (user-error "No cross references in this node") |
| 3091 | (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") | 3091 | (Info-next-reference t)) |
| 3092 | (old-pt (point)) | 3092 | (if (looking-at "^\\* ") |
| 3093 | (case-fold-search t)) | 3093 | (forward-char 2))))))) |
| 3094 | (or (re-search-backward pat nil t) | 3094 | |
| 3095 | (progn | 3095 | (defun Info-prev-reference (&optional recur count) |
| 3096 | (goto-char (point-max)) | 3096 | "Move cursor to the previous cross-reference or menu item in the node. |
| 3097 | (or (re-search-backward pat nil t) | 3097 | If COUNT is non-nil (interactively with a prefix arg), jump over |
| 3098 | (progn | 3098 | COUNT cross-references." |
| 3099 | (goto-char old-pt) | 3099 | (interactive "i\np") |
| 3100 | (user-error "No cross references in this node"))))) | 3100 | (unless count |
| 3101 | (goto-char (or (match-beginning 1) (match-beginning 0))) | 3101 | (setq count 1)) |
| 3102 | (if (looking-at "\\* Menu:") | 3102 | (if (< count 0) |
| 3103 | (if recur | 3103 | (Info-next-reference recur (- count)) |
| 3104 | (user-error "No cross references in this node") | 3104 | (while (unless (zerop count) (setq count (1- count))) |
| 3105 | (Info-prev-reference t)) | 3105 | (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") |
| 3106 | (if (looking-at "^\\* ") | 3106 | (old-pt (point)) |
| 3107 | (forward-char 2))))) | 3107 | (case-fold-search t)) |
| 3108 | (or (re-search-backward pat nil t) | ||
| 3109 | (progn | ||
| 3110 | (goto-char (point-max)) | ||
| 3111 | (or (re-search-backward pat nil t) | ||
| 3112 | (progn | ||
| 3113 | (goto-char old-pt) | ||
| 3114 | (user-error "No cross references in this node"))))) | ||
| 3115 | (goto-char (or (match-beginning 1) (match-beginning 0))) | ||
| 3116 | (if (looking-at "\\* Menu:") | ||
| 3117 | (if recur | ||
| 3118 | (user-error "No cross references in this node") | ||
| 3119 | (Info-prev-reference t)) | ||
| 3120 | (if (looking-at "^\\* ") | ||
| 3121 | (forward-char 2))))))) | ||
| 3108 | 3122 | ||
| 3109 | (defun Info-index-nodes (&optional file) | 3123 | (defun Info-index-nodes (&optional file) |
| 3110 | "Return a list of names of all index nodes in Info FILE. | 3124 | "Return a list of names of all index nodes in Info FILE. |