]> git.eshelyaron.com Git - emacs.git/commitdiff
(help-make-xrefs): Clean up the loop that scans
authorRichard M. Stallman <rms@gnu.org>
Thu, 24 Apr 2003 01:56:55 +0000 (01:56 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 24 Apr 2003 01:56:55 +0000 (01:56 +0000)
over a keymap inserted by \\{...}; it now stops at end of buffer.

lisp/help-mode.el

index 03a711115dbcaee5118e78c43b95af129eeef392..6e8ab0e34a21771f719c7fff9a15e43ba66f84b9 100644 (file)
@@ -386,23 +386,27 @@ that."
                (goto-char (point-min))
                 ;; Find a header and the column at which the command
                 ;; name will be found.
+
+               ;; If the keymap substitution isn't the last thing in
+               ;; the doc string, and if there is anything on the
+               ;; same line after it, this code won't recognize the end of it.
                 (while (re-search-forward "^key +binding\n\\(-+ +\\)-+\n\n"
                                           nil t)
                   (let ((col (- (match-end 1) (match-beginning 1))))
                     (while
-                        ;; Ignore single blank lines in table, but not
-                        ;; double ones, which should terminate it.
-                        (and (not (looking-at "\n\\s-*\n"))
-                             (progn
-                              (and (eolp) (forward-line))
-                              (end-of-line)
-                              (skip-chars-backward "^\t\n")
-                               (if (and (>= (current-column) col)
-                                       (looking-at "\\(\\sw\\|-\\)+$"))
-                                   (let ((sym (intern-soft (match-string 0))))
-                                     (if (fboundp sym)
-                                         (help-xref-button 0 'help-function sym))))
-                              (zerop (forward-line)))))))))
+                        (and (not (eobp))
+                            ;; Stop at a pair of blank lines.
+                            (not (looking-at "\n\\s-*\n")))
+                     ;; Skip a single blank line.
+                     (and (eolp) (forward-line))
+                     (end-of-line)
+                     (skip-chars-backward "^\t\n")
+                     (if (and (>= (current-column) col)
+                              (looking-at "\\(\\sw\\|-\\)+$"))
+                         (let ((sym (intern-soft (match-string 0))))
+                           (if (fboundp sym)
+                               (help-xref-button 0 'help-function sym))))
+                     (forward-line)))))))
           (set-syntax-table stab))
        ;; Delete extraneous newlines at the end of the docstring
        (goto-char (point-max))