emacs-devel
[Top][All Lists]
Advanced

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

imenu--generic-function broken for imenu-syntax-alist


From: Glenn Morris
Subject: imenu--generic-function broken for imenu-syntax-alist
Date: Tue, 20 Aug 2002 21:06:01 +0100
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2.90 (i686-pc-linux-gnu)

imenu is currently (in the trunk) broken for modes that define a value of
imenu-syntax-alist. For example, Fortran mode, Scheme mode.

The problem seems to be caused by this change:

2001-11-19  Stefan Monnier  <address@hidden>

        * imenu.el 
        [...]
        (imenu--generic-function): Use dolist.


===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/imenu.el,v
retrieving revision 1.86
retrieving revision 1.87
diff -c -r1.86 -r1.87

[...]

*** 797,810 ****
          (table (copy-syntax-table (syntax-table)))
          (slist imenu-syntax-alist))
      ;; Modify the syntax table used while matching regexps.
!     (while slist
        ;; The character(s) to modify may be a single char or a string.
!       (if (numberp (caar slist))
!         (modify-syntax-entry (caar slist) (cdar slist) table)
!       (mapc (lambda (c)
!               (modify-syntax-entry c (cdar slist) table))
!             (caar slist)))
!       (setq slist (cdr slist)))
      (goto-char (point-max))
      (imenu-progress-message prev-pos 0 t)
      (unwind-protect                   ; for syntax table
--- 775,786 ----
          (table (copy-syntax-table (syntax-table)))
          (slist imenu-syntax-alist))
      ;; Modify the syntax table used while matching regexps.
!     (dolist (syn slist)
        ;; The character(s) to modify may be a single char or a string.
!       (if (numberp (car syn))
!         (modify-syntax-entry (car syn) (cdr syn) table)
!       (dolist (c (car syn))
!         (modify-syntax-entry c (cdr syn) table))))
      (goto-char (point-max))
      (imenu-progress-message prev-pos 0 t)
      (unwind-protect                   ; for syntax table



(dolist (c (car syn)) breaks because (car syn) is a string, not a list.

Any objections to reverting to mapc for this bit?

2002-08-20  Glenn Morris  <address@hidden>

        * imenu.el (imenu--generic-function): Use mapc.


===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/imenu.el,v
retrieving revision 1.90
diff -c -r1.90 imenu.el
*** imenu.el    15 Aug 2002 00:11:15 -0000      1.90
--- imenu.el    20 Aug 2002 19:59:24 -0000
***************
*** 788,795 ****
        ;; The character(s) to modify may be a single char or a string.
        (if (numberp (car syn))
          (modify-syntax-entry (car syn) (cdr syn) table)
!       (dolist (c (car syn))
!         (modify-syntax-entry c (cdr syn) table))))
      (goto-char (point-max))
      (imenu-progress-message prev-pos 0 t)
      (unwind-protect                   ; for syntax table
--- 788,796 ----
        ;; The character(s) to modify may be a single char or a string.
        (if (numberp (car syn))
          (modify-syntax-entry (car syn) (cdr syn) table)
!         (mapc (lambda (c)
!                 (modify-syntax-entry c (cdr syn) table))
!               (car syn))))
      (goto-char (point-max))
      (imenu-progress-message prev-pos 0 t)
      (unwind-protect                   ; for syntax table





reply via email to

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