emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111654: * info.el (Info-next-referen


From: Christopher Schmidt
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111654: * info.el (Info-next-reference, Info-prev-reference): Add numeric
Date: Fri, 01 Feb 2013 17:46:46 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111654
fixes bug: http://debbugs.gnu.org/11656
committer: Christopher Schmidt <address@hidden>
branch nick: trunk
timestamp: Fri 2013-02-01 17:46:46 +0100
message:
  * info.el (Info-next-reference, Info-prev-reference): Add numeric
  prefix argument.  (Bug#11656)
modified:
  lisp/ChangeLog
  lisp/info.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-02-01 15:56:22 +0000
+++ b/lisp/ChangeLog    2013-02-01 16:46:46 +0000
@@ -1,3 +1,8 @@
+2012-02-01  Christopher Schmidt  <address@hidden>
+
+       * info.el (Info-next-reference, Info-prev-reference): Add numeric
+       prefix argument.  (Bug#11656)
+
 2013-02-01  Stefan Monnier  <address@hidden>
 
        * help-fns.el (help-split-fundoc): Don't insert byte-compiled body.

=== modified file 'lisp/info.el'
--- a/lisp/info.el      2013-01-11 23:08:55 +0000
+++ b/lisp/info.el      2013-02-01 16:46:46 +0000
@@ -3063,48 +3063,62 @@
        (select-window (posn-window (event-start e))))
     (Info-scroll-down)))
 
-(defun Info-next-reference (&optional recur)
-  "Move cursor to the next cross-reference or menu item in the node."
-  (interactive)
-  (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
-       (old-pt (point))
-       (case-fold-search t))
-    (or (eobp) (forward-char 1))
-    (or (re-search-forward pat nil t)
-       (progn
-         (goto-char (point-min))
-         (or (re-search-forward pat nil t)
-             (progn
-               (goto-char old-pt)
-               (user-error "No cross references in this node")))))
-    (goto-char (or (match-beginning 1) (match-beginning 0)))
-    (if (looking-at "\\* Menu:")
-       (if recur
-           (user-error "No cross references in this node")
-         (Info-next-reference t))
-      (if (looking-at "^\\* ")
-         (forward-char 2)))))
+(defun Info-next-reference (&optional recur count)
+  "Move cursor to the next cross-reference or menu item in the node.
+If COUNT is non-nil (interactively with a prefix arg), jump over
+COUNT cross-references."
+  (interactive "i\np")
+  (unless count
+    (setq count 1))
+  (if (< count 0)
+      (Info-prev-reference recur (- count))
+    (while (unless (zerop count) (setq count (1- count)))
+      (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
+           (old-pt (point))
+           (case-fold-search t))
+       (or (eobp) (forward-char 1))
+       (or (re-search-forward pat nil t)
+           (progn
+             (goto-char (point-min))
+             (or (re-search-forward pat nil t)
+                 (progn
+                   (goto-char old-pt)
+                   (user-error "No cross references in this node")))))
+       (goto-char (or (match-beginning 1) (match-beginning 0)))
+       (if (looking-at "\\* Menu:")
+           (if recur
+               (user-error "No cross references in this node")
+             (Info-next-reference t))
+         (if (looking-at "^\\* ")
+             (forward-char 2)))))))
 
-(defun Info-prev-reference (&optional recur)
-  "Move cursor to the previous cross-reference or menu item in the node."
-  (interactive)
-  (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
-       (old-pt (point))
-       (case-fold-search t))
-    (or (re-search-backward pat nil t)
-       (progn
-         (goto-char (point-max))
-         (or (re-search-backward pat nil t)
-             (progn
-               (goto-char old-pt)
-               (user-error "No cross references in this node")))))
-    (goto-char (or (match-beginning 1) (match-beginning 0)))
-    (if (looking-at "\\* Menu:")
-       (if recur
-           (user-error "No cross references in this node")
-         (Info-prev-reference t))
-      (if (looking-at "^\\* ")
-         (forward-char 2)))))
+(defun Info-prev-reference (&optional recur count)
+  "Move cursor to the previous cross-reference or menu item in the node.
+If COUNT is non-nil (interactively with a prefix arg), jump over
+COUNT cross-references."
+  (interactive "i\np")
+  (unless count
+    (setq count 1))
+  (if (< count 0)
+      (Info-next-reference recur (- count))
+    (while (unless (zerop count) (setq count (1- count)))
+      (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
+           (old-pt (point))
+           (case-fold-search t))
+       (or (re-search-backward pat nil t)
+           (progn
+             (goto-char (point-max))
+             (or (re-search-backward pat nil t)
+                 (progn
+                   (goto-char old-pt)
+                   (user-error "No cross references in this node")))))
+       (goto-char (or (match-beginning 1) (match-beginning 0)))
+       (if (looking-at "\\* Menu:")
+           (if recur
+               (user-error "No cross references in this node")
+             (Info-prev-reference t))
+         (if (looking-at "^\\* ")
+             (forward-char 2)))))))
 
 (defun Info-index-nodes (&optional file)
   "Return a list of names of all index nodes in Info FILE.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]