emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/imenu.el


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/imenu.el
Date: Sat, 20 Nov 2004 18:37:20 -0500

Index: emacs/lisp/imenu.el
diff -c emacs/lisp/imenu.el:1.103 emacs/lisp/imenu.el:1.104
*** emacs/lisp/imenu.el:1.103   Thu Nov  4 10:00:53 2004
--- emacs/lisp/imenu.el Sat Nov 20 23:31:34 2004
***************
*** 808,821 ****
                  (index (nth 2 pat))
                  (function (nth 3 pat))
                  (rest (nthcdr 4 pat))
                  cs)
              ;; Go backwards for convenience of adding items in order.
              (goto-char (point-max))
              (while (re-search-backward regexp nil t)
                (goto-char (match-end index))
                (setq beg (match-beginning index))
!               (if (setq cs (save-match-data (comment-beginning)))
!                   (goto-char cs)      ; skip this one, it's in a comment
                  (goto-char beg)
                  (imenu-progress-message prev-pos nil t)
                  ;; Add this sort of submenu only when we've found an
--- 808,825 ----
                  (index (nth 2 pat))
                  (function (nth 3 pat))
                  (rest (nthcdr 4 pat))
+                 start
                  cs)
              ;; Go backwards for convenience of adding items in order.
              (goto-char (point-max))
              (while (re-search-backward regexp nil t)
+               (setq start (point))
                (goto-char (match-end index))
                (setq beg (match-beginning index))
!               (setq cs (and comment-start-skip
!                             (save-match-data (comment-beginning))))
!               (if cs
!                   (goto-char (min cs beg)) ; skip this one, it's in a comment
                  (goto-char beg)
                  (imenu-progress-message prev-pos nil t)
                  ;; Add this sort of submenu only when we've found an
***************
*** 837,843 ****
                    ;; Insert the item unless it is already present.
                    (unless (member item (cdr menu))
                      (setcdr menu
!                             (cons item (cdr menu)))))))))
          (set-syntax-table old-table)))
      (imenu-progress-message prev-pos 100 t)
      ;; Sort each submenu by position.
--- 841,851 ----
                    ;; Insert the item unless it is already present.
                    (unless (member item (cdr menu))
                      (setcdr menu
!                             (cons item (cdr menu)))))
!                 ;; Move to the start of the entire match,
!                 ;; to ensure we keep moving backwards
!                 ;; as long as the match is nonempty.
!                 (goto-char start)))))
          (set-syntax-table old-table)))
      (imenu-progress-message prev-pos 100 t)
      ;; Sort each submenu by position.




reply via email to

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