diff options
| author | Richard M. Stallman | 2004-11-20 23:31:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-11-20 23:31:55 +0000 |
| commit | 58b00d475bebd1402eb44f4de4a3a0a972bd647e (patch) | |
| tree | d6a390055af011919270738f2bfdb39c5e558f3d | |
| parent | 36baf3b70ed00000fe4dafe2fed72575cfd93dbd (diff) | |
| download | emacs-58b00d475bebd1402eb44f4de4a3a0a972bd647e.tar.gz emacs-58b00d475bebd1402eb44f4de4a3a0a972bd647e.zip | |
(imenu--generic-function):
Ensure we keep moving backward even if BEG isn't further back.
| -rw-r--r-- | lisp/ChangeLog | 20 | ||||
| -rw-r--r-- | lisp/imenu.el | 14 |
2 files changed, 31 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d239a9269e..d00baddbf56 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,25 @@ | |||
| 1 | 2004-11-20 Richard M. Stallman <rms@gnu.org> | 1 | 2004-11-20 Richard M. Stallman <rms@gnu.org> |
| 2 | 2 | ||
| 3 | * imenu.el (imenu--generic-function): | ||
| 4 | Ensure we keep moving backward even if BEG isn't further back. | ||
| 5 | |||
| 6 | * replace.el (query-replace-read-to, query-replace-read-from): | ||
| 7 | Specify t for KEEP-ALL in read-from-minibuffer. | ||
| 8 | |||
| 9 | * progmodes/python.el (python-switch-to-python): | ||
| 10 | If Python isn't running, start it. | ||
| 11 | Don't alter debug-ignored-errors. | ||
| 12 | |||
| 13 | * progmodes/cperl-mode.el (cperl-indent-region): | ||
| 14 | Don't mind imenu-scanning-message. | ||
| 15 | |||
| 16 | * bindings.el (global-map): Bind C-e to move-end-of-line. | ||
| 17 | |||
| 18 | * simple.el (line-move-finish): New arg FORWARD. | ||
| 19 | Ignore invisible newlines, not intangible ones. | ||
| 20 | Conditions for acceptable stopping positions depend on FORWARD. | ||
| 21 | (line-move): Pass FORWARD arg to line-move-finish. | ||
| 22 | |||
| 3 | * buff-menu.el (list-buffers-noselect): Eliminate space at the start | 23 | * buff-menu.el (list-buffers-noselect): Eliminate space at the start |
| 4 | of HEADER. Compensate for this change in the code to add display | 24 | of HEADER. Compensate for this change in the code to add display |
| 5 | properties. Don't make the first line intangible. | 25 | properties. Don't make the first line intangible. |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 16116025fb8..d20dc4bccb8 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -808,14 +808,18 @@ depending on PATTERNS." | |||
| 808 | (index (nth 2 pat)) | 808 | (index (nth 2 pat)) |
| 809 | (function (nth 3 pat)) | 809 | (function (nth 3 pat)) |
| 810 | (rest (nthcdr 4 pat)) | 810 | (rest (nthcdr 4 pat)) |
| 811 | start | ||
| 811 | cs) | 812 | cs) |
| 812 | ;; Go backwards for convenience of adding items in order. | 813 | ;; Go backwards for convenience of adding items in order. |
| 813 | (goto-char (point-max)) | 814 | (goto-char (point-max)) |
| 814 | (while (re-search-backward regexp nil t) | 815 | (while (re-search-backward regexp nil t) |
| 816 | (setq start (point)) | ||
| 815 | (goto-char (match-end index)) | 817 | (goto-char (match-end index)) |
| 816 | (setq beg (match-beginning index)) | 818 | (setq beg (match-beginning index)) |
| 817 | (if (setq cs (save-match-data (comment-beginning))) | 819 | (setq cs (and comment-start-skip |
| 818 | (goto-char cs) ; skip this one, it's in a comment | 820 | (save-match-data (comment-beginning)))) |
| 821 | (if cs | ||
| 822 | (goto-char (min cs beg)) ; skip this one, it's in a comment | ||
| 819 | (goto-char beg) | 823 | (goto-char beg) |
| 820 | (imenu-progress-message prev-pos nil t) | 824 | (imenu-progress-message prev-pos nil t) |
| 821 | ;; Add this sort of submenu only when we've found an | 825 | ;; Add this sort of submenu only when we've found an |
| @@ -837,7 +841,11 @@ depending on PATTERNS." | |||
| 837 | ;; Insert the item unless it is already present. | 841 | ;; Insert the item unless it is already present. |
| 838 | (unless (member item (cdr menu)) | 842 | (unless (member item (cdr menu)) |
| 839 | (setcdr menu | 843 | (setcdr menu |
| 840 | (cons item (cdr menu))))))))) | 844 | (cons item (cdr menu))))) |
| 845 | ;; Move to the start of the entire match, | ||
| 846 | ;; to ensure we keep moving backwards | ||
| 847 | ;; as long as the match is nonempty. | ||
| 848 | (goto-char start))))) | ||
| 841 | (set-syntax-table old-table))) | 849 | (set-syntax-table old-table))) |
| 842 | (imenu-progress-message prev-pos 100 t) | 850 | (imenu-progress-message prev-pos 100 t) |
| 843 | ;; Sort each submenu by position. | 851 | ;; Sort each submenu by position. |