From: Glenn Morris <gmorris+mail@ast.cam.ac.uk>
Cc: emacs-devel@gnu.org
Subject: imenu--generic-function broken for imenu-syntax-alist
Date: Tue, 20 Aug 2002 21:06:01 +0100 [thread overview]
Message-ID: <yebd6sdthw6.fsf@xpc21.ast.cam.ac.uk> (raw)
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 <monnier@cs.yale.edu>
* 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 <gmorris@ast.cam.ac.uk>
* 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
next reply other threads:[~2002-08-20 20:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-20 20:06 Glenn Morris [this message]
2002-08-20 20:11 ` imenu--generic-function broken for imenu-syntax-alist Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yebd6sdthw6.fsf@xpc21.ast.cam.ac.uk \
--to=gmorris+mail@ast.cam.ac.uk \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).