From unknown Wed Jun 25 03:57:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11477: 23.1; which-func-cleanup-function should be local Resent-From: Jack Duthen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 May 2012 15:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11477 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 11477@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.133709458920841 (code B ref -1); Tue, 15 May 2012 15:10:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 May 2012 15:09:49 +0000 Received: from localhost ([127.0.0.1]:56176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUJNl-0005Q5-2q for submit@debbugs.gnu.org; Tue, 15 May 2012 11:09:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39081) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUJNi-0005Pq-41 for submit@debbugs.gnu.org; Tue, 15 May 2012 11:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUJNS-0007d5-0n for submit@debbugs.gnu.org; Tue, 15 May 2012 11:09:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:52893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJNR-0007cG-RT for submit@debbugs.gnu.org; Tue, 15 May 2012 11:09:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJNH-0005Y6-EI for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUJN6-0007N3-6H for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:18 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:41068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJN5-0007Mq-Tl for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:08 -0400 Received: by obbwd18 with SMTP id wd18so11232246obb.0 for ; Tue, 15 May 2012 08:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=kurN3gm8A9M9DooUC6m1Q1kmZOAGivO8h9MH9dVVlrI=; b=ghBYgjNRkLNkEFASzBRkpJSxV1vc3VhZJvZLER4zu3JbnsK9ID43vwWxZoIQAD5fnO lowSbVNvuXYHgVwS9CeHdxrcJDPv7LX5D8H/MeVML/ZgFfOawKGorqk5ZUQ+bK3kLHdq jL4rS3iTu4bSeQfazj8SojTn+ye65+JEg4AJeqDFBAl5wGjuYrJFmN9IVx+j8uyuHRdf Crrsxwar1Jqc4BV1fPkpiylpZFeUktr3wFI2SvtX4b8sV2TY3gwknf6bARhMzipfDKJ3 IMStpkjAVoGaBarn0KGEWLO4HlmuXg+JYUom0UtkuxiYerT6WV/rtPxGOW3la/5Jv5ex 0j+w== Received: by 10.182.16.1 with SMTP id b1mr3122898obd.31.1337094546153; Tue, 15 May 2012 08:09:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.182.99 with HTTP; Tue, 15 May 2012 08:08:46 -0700 (PDT) From: Jack Duthen Date: Tue, 15 May 2012 17:08:46 +0200 X-Google-Sender-Auth: -r6OfuxVBbroFwsRznVF33-Nz_E Message-ID: Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --text follows this line-- Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: Hi! I'm still using "which-func" and still find it very convenient! I'm using "sh-mode" with a customized "imenu-prev-index-position-function" and a customized "imenu-extract-index-name-function" to generate my own imenu items. So, I put into "which-func-cleanup-function" a personal function (which deals with a parameter being a string or a list of strings) to clean up the function name returned by my "imenu-extract-index-name-function". As this function relies on variables specific to this mode, I found that it did NOT work correctly when editing a file in another mode (like emacs-lisp code, for example). So, as the function name contained in the variable "which-func-cleanup-function" can be mode-dependent, I think that "which-func-cleanup-function" should be declared as buffer local. I put the following in my .emacs: ;;; ---------------- (defun jd-sh-imenu-set-which-func-cleanup-function () (unless (local-variable-p 'which-func-cleanup-function) (make-local-variable 'which-func-cleanup-function)) (setq which-func-cleanup-function 'jd-sh-imenu-which-func-cleanup-function)) (add-hook 'sh-set-shell-hook 'jd-sh-imenu-set-which-func-cleanup-function) ;;; ---------------- and it works ok. But I'm wondering whether "which-func-cleanup-function" shouldn't be declared permanently local in the file "which-func.el" itself? )jack( If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/share/emacs/23.1/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.22.0) of 2011-03-04 on roseapple, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10900000 configured using `configure '--build=i686-linux-gnu' '--host=i686-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i686-linux-gnu' 'host_alias=i686-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: fr_FR.utf8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: diff-auto-refine-mode: t eldoc-mode: t which-function-mode: t show-paren-mode: t recentf-mode: t desktop-save-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: (only . t) Recent input: C-v C-u C-v C-u C-v C-x b M-x b u r r C-x b j M-p C-s C-w C-w C-w C-w C-x o C-s C-s C-s C-s C-w C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r C-u C-u M-v C-h f M-w M-: C-y C-x C-e C-x C-e C-x b C-x b j M-p M-d e x p l o r e M-f M-f u s i n g SPC h e l p C-x C-s C-p - - - - - C-x C-s C-h f M-w C-v C-v C-v C-v C-v M-: C-y C-u M-v C-u M-v M-: M-p C-x o C-x C-g M-x M-p C-x o q C-M-x C-M-b C-M-SPC M-w C-x o M-: C-y M-: M-p C-e C-b C-M-b C-b C-k ( ) ) C-s C-w C-x o C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-a Recent messages: uncompressing add-log.el.gz...done Note: file is write protected jd-test-which-func-cleanup-function Mark set jd-test-which-func-cleanup-function Type of fun-name '(which-function)' is cons Type of (car fun-name) 'which-function' is string nil Mark saved where search started [2 times] /usr/bin/mail is not an executable. Setting mail-interactive to t. From unknown Wed Jun 25 03:57:52 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jack Duthen Subject: bug#11477: closed (Re: bug#11477: 23.1; which-func-cleanup-function should be local) Message-ID: References: X-Gnu-PR-Message: they-closed 11477 X-Gnu-PR-Package: emacs Reply-To: 11477@debbugs.gnu.org Date: Tue, 15 May 2012 15:47:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1337096822-24321-1" This is a multi-part message in MIME format... ------------=_1337096822-24321-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #11477: 23.1; which-func-cleanup-function should be local which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 11477@debbugs.gnu.org. --=20 11477: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11477 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1337096822-24321-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 11477-done) by debbugs.gnu.org; 15 May 2012 15:46:30 +0000 Received: from localhost ([127.0.0.1]:56240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUJxG-0006Jc-C8 for submit@debbugs.gnu.org; Tue, 15 May 2012 11:46:30 -0400 Received: from relais.videotron.ca ([24.201.245.36]:46013) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUJxE-0006JU-FM for 11477-done@debbugs.gnu.org; Tue, 15 May 2012 11:46:28 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from fmsmemgm.homelinux.net ([24.201.208.110]) by VL-VM-MR006.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0M4200FK8MHBRVF0@VL-VM-MR006.ip.videotron.ca> for 11477-done@debbugs.gnu.org; Tue, 15 May 2012 11:46:23 -0400 (EDT) Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 087E6AE233; Tue, 15 May 2012 11:46:22 -0400 (EDT) From: Stefan Monnier To: Jack Duthen Subject: Re: bug#11477: 23.1; which-func-cleanup-function should be local Message-id: References: Date: Tue, 15 May 2012 11:46:22 -0400 In-reply-to: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11477-done Cc: 11477-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > So, as the function name contained in the variable > "which-func-cleanup-function" can be mode-dependent, > I think that "which-func-cleanup-function" should be declared > as buffer local. locality does not have to be a global property of a variable. If you only want your cleanup function to be used in a particular mode/buffer, then set it with (set (make-local-variable ') ) (now available as `setq-local') rather than with `setq'. Stefan ------------=_1337096822-24321-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 May 2012 15:09:49 +0000 Received: from localhost ([127.0.0.1]:56176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUJNl-0005Q5-2q for submit@debbugs.gnu.org; Tue, 15 May 2012 11:09:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39081) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUJNi-0005Pq-41 for submit@debbugs.gnu.org; Tue, 15 May 2012 11:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUJNS-0007d5-0n for submit@debbugs.gnu.org; Tue, 15 May 2012 11:09:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:52893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJNR-0007cG-RT for submit@debbugs.gnu.org; Tue, 15 May 2012 11:09:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJNH-0005Y6-EI for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUJN6-0007N3-6H for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:18 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:41068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJN5-0007Mq-Tl for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:08 -0400 Received: by obbwd18 with SMTP id wd18so11232246obb.0 for ; Tue, 15 May 2012 08:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=kurN3gm8A9M9DooUC6m1Q1kmZOAGivO8h9MH9dVVlrI=; b=ghBYgjNRkLNkEFASzBRkpJSxV1vc3VhZJvZLER4zu3JbnsK9ID43vwWxZoIQAD5fnO lowSbVNvuXYHgVwS9CeHdxrcJDPv7LX5D8H/MeVML/ZgFfOawKGorqk5ZUQ+bK3kLHdq jL4rS3iTu4bSeQfazj8SojTn+ye65+JEg4AJeqDFBAl5wGjuYrJFmN9IVx+j8uyuHRdf Crrsxwar1Jqc4BV1fPkpiylpZFeUktr3wFI2SvtX4b8sV2TY3gwknf6bARhMzipfDKJ3 IMStpkjAVoGaBarn0KGEWLO4HlmuXg+JYUom0UtkuxiYerT6WV/rtPxGOW3la/5Jv5ex 0j+w== Received: by 10.182.16.1 with SMTP id b1mr3122898obd.31.1337094546153; Tue, 15 May 2012 08:09:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.182.99 with HTTP; Tue, 15 May 2012 08:08:46 -0700 (PDT) From: Jack Duthen Date: Tue, 15 May 2012 17:08:46 +0200 X-Google-Sender-Auth: -r6OfuxVBbroFwsRznVF33-Nz_E Message-ID: Subject: 23.1; which-func-cleanup-function should be local To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --text follows this line-- Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: Hi! I'm still using "which-func" and still find it very convenient! I'm using "sh-mode" with a customized "imenu-prev-index-position-function" and a customized "imenu-extract-index-name-function" to generate my own imenu items. So, I put into "which-func-cleanup-function" a personal function (which deals with a parameter being a string or a list of strings) to clean up the function name returned by my "imenu-extract-index-name-function". As this function relies on variables specific to this mode, I found that it did NOT work correctly when editing a file in another mode (like emacs-lisp code, for example). So, as the function name contained in the variable "which-func-cleanup-function" can be mode-dependent, I think that "which-func-cleanup-function" should be declared as buffer local. I put the following in my .emacs: ;;; ---------------- (defun jd-sh-imenu-set-which-func-cleanup-function () (unless (local-variable-p 'which-func-cleanup-function) (make-local-variable 'which-func-cleanup-function)) (setq which-func-cleanup-function 'jd-sh-imenu-which-func-cleanup-function)) (add-hook 'sh-set-shell-hook 'jd-sh-imenu-set-which-func-cleanup-function) ;;; ---------------- and it works ok. But I'm wondering whether "which-func-cleanup-function" shouldn't be declared permanently local in the file "which-func.el" itself? )jack( If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/share/emacs/23.1/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.22.0) of 2011-03-04 on roseapple, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10900000 configured using `configure '--build=i686-linux-gnu' '--host=i686-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i686-linux-gnu' 'host_alias=i686-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: fr_FR.utf8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: diff-auto-refine-mode: t eldoc-mode: t which-function-mode: t show-paren-mode: t recentf-mode: t desktop-save-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: (only . t) Recent input: C-v C-u C-v C-u C-v C-x b M-x b u r r C-x b j M-p C-s C-w C-w C-w C-w C-x o C-s C-s C-s C-s C-w C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r C-u C-u M-v C-h f M-w M-: C-y C-x C-e C-x C-e C-x b C-x b j M-p M-d e x p l o r e M-f M-f u s i n g SPC h e l p C-x C-s C-p - - - - - C-x C-s C-h f M-w C-v C-v C-v C-v C-v M-: C-y C-u M-v C-u M-v M-: M-p C-x o C-x C-g M-x M-p C-x o q C-M-x C-M-b C-M-SPC M-w C-x o M-: C-y M-: M-p C-e C-b C-M-b C-b C-k ( ) ) C-s C-w C-x o C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-a Recent messages: uncompressing add-log.el.gz...done Note: file is write protected jd-test-which-func-cleanup-function Mark set jd-test-which-func-cleanup-function Type of fun-name '(which-function)' is cons Type of (car fun-name) 'which-function' is string nil Mark saved where search started [2 times] /usr/bin/mail is not an executable. Setting mail-interactive to t. ------------=_1337096822-24321-1--