[Top][All Lists]
[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: |
Wed, 24 Nov 2004 22:15:42 -0500 |
Index: emacs/lisp/imenu.el
diff -c emacs/lisp/imenu.el:1.104 emacs/lisp/imenu.el:1.105
*** emacs/lisp/imenu.el:1.104 Sat Nov 20 23:31:34 2004
--- emacs/lisp/imenu.el Thu Nov 25 02:57:47 2004
***************
*** 62,69 ****
;;; Code:
- (require 'newcomment)
-
(eval-when-compile (require 'cl))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- 62,67 ----
***************
*** 745,752 ****
;;;###autoload
(make-variable-buffer-local 'imenu-case-fold-search)
! ;; Originally "Built on some ideas that Erik Naggum <address@hidden>
! ;; once posted to comp.emacs" but since substantially re-written.
(defun imenu--generic-function (patterns)
"Return an index of the current buffer as an alist.
--- 743,750 ----
;;;###autoload
(make-variable-buffer-local 'imenu-case-fold-search)
! ;; This function can be called with quitting disabled,
! ;; so it needs to be careful never to loop!
(defun imenu--generic-function (patterns)
"Return an index of the current buffer as an alist.
***************
*** 800,805 ****
--- 798,806 ----
(unwind-protect ; for syntax table
(save-match-data
(set-syntax-table table)
+ (if (or comment-start comment-start-skip)
+ (comment-normalize-vars))
+
;; map over the elements of imenu-generic-expression
;; (typically functions, variables ...)
(dolist (pat patterns)
***************
*** 812,823 ****
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)
--- 813,828 ----
cs)
;; Go backwards for convenience of adding items in order.
(goto-char (point-max))
! (while (and (re-search-backward regexp nil t)
! ;; Exit the loop if we get an empty match,
! ;; 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))
! (setq cs (and (or comment-start 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)