From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: imenu--generic-function broken for imenu-syntax-alist Date: Tue, 20 Aug 2002 21:06:01 +0100 Sender: emacs-devel-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1029874044 6977 127.0.0.1 (20 Aug 2002 20:07:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 20 Aug 2002 20:07:24 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17hFHe-0001oQ-00 for ; Tue, 20 Aug 2002 22:07:22 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17hFji-0004s2-00 for ; Tue, 20 Aug 2002 22:36:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17hFIk-0000nI-00; Tue, 20 Aug 2002 16:08:30 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17hFGR-0000hq-00 for emacs-devel@gnu.org; Tue, 20 Aug 2002 16:06:07 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17hFGP-0000hb-00 for emacs-devel@gnu.org; Tue, 20 Aug 2002 16:06:07 -0400 Original-Received: from maroon.csi.cam.ac.uk ([131.111.8.2]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17hFGO-0000hV-00 for emacs-devel@gnu.org; Tue, 20 Aug 2002 16:06:04 -0400 Original-Received: from cass41.ast.cam.ac.uk ([131.111.69.186]) by maroon.csi.cam.ac.uk with esmtp (Exim 4.10) id 17hFGN-0006cP-00; Tue, 20 Aug 2002 21:06:03 +0100 Original-Received: from xalph6.ast.cam.ac.uk (xalph6 [131.111.68.34]) by cass41.ast.cam.ac.uk (8.11.6+Sun/8.11.6) with ESMTP id g7KK63220481; Tue, 20 Aug 2002 21:06:03 +0100 (BST) Original-Received: from xpc21.ast.cam.ac.uk (IDENT:tHMQrhYz0ficXHvgj7fiiKimcKFSw7ms@xpc21.ast.cam.ac.uk [131.111.69.55]) by xalph6.ast.cam.ac.uk (8.10.0/8.10.0) with ESMTP id g7KK62p27415; Tue, 20 Aug 2002 21:06:03 +0100 (BST) Original-To: monnier+gnu/emacs@rum.cs.yale.edu X-Attribution: GM Mail-Followup-To: monnier+gnu/emacs@rum.cs.yale.edu, emacs-devel@gnu.org Original-Lines: 87 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2.90 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6685 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6685 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 * 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 * 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