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, 23 Apr 2005 12:43:30 -0400

Index: emacs/lisp/imenu.el
diff -c emacs/lisp/imenu.el:1.108 emacs/lisp/imenu.el:1.109
*** emacs/lisp/imenu.el:1.108   Wed Feb  9 15:50:42 2005
--- emacs/lisp/imenu.el Sat Apr 23 16:43:30 2005
***************
*** 777,783 ****
  depending on PATTERNS."
  
    (let ((index-alist (list 'dummy))
!       prev-pos beg
          (case-fold-search (if (or (local-variable-p 'imenu-case-fold-search)
                                  (not (local-variable-p 'font-lock-defaults)))
                              imenu-case-fold-search
--- 777,783 ----
  depending on PATTERNS."
  
    (let ((index-alist (list 'dummy))
!       prev-pos
          (case-fold-search (if (or (local-variable-p 'imenu-case-fold-search)
                                  (not (local-variable-p 'font-lock-defaults)))
                              imenu-case-fold-search
***************
*** 807,813 ****
                  (index (nth 2 pat))
                  (function (nth 3 pat))
                  (rest (nthcdr 4 pat))
!                 start)
              ;; Go backwards for convenience of adding items in order.
              (goto-char (point-max))
              (while (and (re-search-backward regexp nil t)
--- 807,813 ----
                  (index (nth 2 pat))
                  (function (nth 3 pat))
                  (rest (nthcdr 4 pat))
!                 start beg)
              ;; Go backwards for convenience of adding items in order.
              (goto-char (point-max))
              (while (and (re-search-backward regexp nil t)
***************
*** 815,846 ****
                          ;; because it means a bad regexp was specified.
                          (not (= (match-beginning 0) (match-end 0))))
                (setq start (point))
!               (goto-char (match-end index))
!               (setq beg (match-beginning index))
!               ;; Go to the start of the match.
                ;; That's the official position of this definition.
!               (goto-char start)
                (imenu-progress-message prev-pos nil t)
                ;; Add this sort of submenu only when we've found an
                ;; item for it, avoiding empty, duff menus.
                (unless (assoc menu-title index-alist)
                  (push (list menu-title) index-alist))
                (if imenu-use-markers
!                   (setq start (copy-marker start)))
                (let ((item
                       (if function
                           (nconc (list (match-string-no-properties index)
!                                       start function)
                                  rest)
                         (cons (match-string-no-properties index)
!                              start)))
                      ;; This is the desired submenu,
                      ;; starting with its title (or nil).
                      (menu (assoc menu-title index-alist)))
                  ;; 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.
--- 815,849 ----
                          ;; because it means a bad regexp was specified.
                          (not (= (match-beginning 0) (match-end 0))))
                (setq start (point))
!               ;; Record the start of the line in which the match starts.
                ;; That's the official position of this definition.
!               (goto-char (match-beginning index))
!               (beginning-of-line)
!               (setq beg (point))
                (imenu-progress-message prev-pos nil t)
                ;; Add this sort of submenu only when we've found an
                ;; item for it, avoiding empty, duff menus.
                (unless (assoc menu-title index-alist)
                  (push (list menu-title) index-alist))
                (if imenu-use-markers
!                   (setq beg (copy-marker beg)))
                (let ((item
                       (if function
                           (nconc (list (match-string-no-properties index)
!                                       beg function)
                                  rest)
                         (cons (match-string-no-properties index)
!                              beg)))
                      ;; This is the desired submenu,
                      ;; starting with its title (or nil).
                      (menu (assoc menu-title index-alist)))
                  ;; Insert the item unless it is already present.
                  (unless (member item (cdr menu))
                    (setcdr menu
!                           (cons item (cdr menu)))))
!               ;; Go to the start of the match, to make sure we
!               ;; keep making progress backwards.
!               (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]