From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jack Duthen Newsgroups: gmane.emacs.bugs Subject: bug#11476: 23.1; which-func-cleanup-function call and documentation mismatch Date: Tue, 15 May 2012 17:07:13 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1337094568 25372 80.91.229.3 (15 May 2012 15:09:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 May 2012 15:09:28 +0000 (UTC) To: 11476@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 15 17:09:24 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SUJNI-0005kA-Vf for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 May 2012 17:09:21 +0200 Original-Received: from localhost ([::1]:43166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJNI-0005YY-8h for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 May 2012 11:09:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJN7-0005SS-2e for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUJMw-0007LU-KO for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJMw-0007LM-FN for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:08:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SUJN0-0005Ol-Ix for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:09:02 -0400 X-Loop: help-debbugs@gnu.org 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:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11476 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133709449320689 (code B ref -1); Tue, 15 May 2012 15:09:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 May 2012 15:08:13 +0000 Original-Received: from localhost ([127.0.0.1]:56171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUJMC-0005Nd-AK for submit@debbugs.gnu.org; Tue, 15 May 2012 11:08:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38632) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUJMA-0005NR-Ac for submit@debbugs.gnu.org; Tue, 15 May 2012 11:08:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUJLu-0007AP-9b for submit@debbugs.gnu.org; Tue, 15 May 2012 11:08:00 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:52600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJLu-0007AJ-3f for submit@debbugs.gnu.org; Tue, 15 May 2012 11:07:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJLn-0004fo-4A for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:07:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUJLc-000716-DQ for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:07:46 -0400 Original-Received: from mail-ob0-f169.google.com ([209.85.214.169]:41179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUJLc-00070y-3n for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 11:07:36 -0400 Original-Received: by obbwd18 with SMTP id wd18so11230261obb.0 for ; Tue, 15 May 2012 08:07:33 -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=HDNE59FCSz1bcUDngY6sA28LvMZdUJlGEl9gY89AL7Y=; b=YG/qS8Yrn6WF2vfIcBSJtObB4vGzCJRrpuv3kstVneWuyQGTsJAhlzbn7DDc8NM9SH EKBRTdMP3MuOX3SKXM3KPSXu8vfqI+Yl/2YT+ihn28H/oo/JRZV94HbC7rfl2z8YsHE+ 3WaDjPMZRHLStVAqJ+Vm6idRa4ZGTAV/xsyDifW/iIFS0zu/tFhHx5AjjUFuxPt0NDlr dEDhQBL9d04QLy+n7pZ57kCZPJFBRoJUYa2I3NGN74U+nzbJk8EcwHOfFdd/6IkD0lbJ wJx2t20V9nI7NL3V0PRSY/uGobwuMsuZqMaGYF1hPqezfaR1kCe6BCtAjF1IWCv+X9b4 06RA== Original-Received: by 10.182.16.1 with SMTP id b1mr3115141obd.31.1337094453558; Tue, 15 May 2012 08:07:33 -0700 (PDT) Original-Received: by 10.182.182.99 with HTTP; Tue, 15 May 2012 08:07:13 -0700 (PDT) X-Google-Sender-Auth: 4cGZdYNFxwwn3Vcp8sg13Pv9buI 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:60025 Archived-At: --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 using "which-func" and I find it very convenient! I tried to use a customized "which-func-cleanup-function" and found that its doc string says: "Function to transform a string before displaying it in the mode line. The function is called with one argument, the string to display..." It seems that the argument given to "which-func-cleanup-function" can also be a list with one string. Using this test function: ;;; ------------------- ;;; To help see the bug (defun jd-test-which-func-cleanup-function (fun-name) (message "Type of fun-name '%s' is %s" fun-name (type-of fun-name)) (when (consp fun-name) (message "Type of (car fun-name) '%s' is %s" (car fun-name) (type-of (car fun-name)))) (setq jd-ielm-fun-name fun-name) ; to explore it using ielm fun-name) ;;; (setq which-func-cleanup-function 'jd-test-which-func-cleanup-function) ;;; (setq which-func-cleanup-function ()) ;;; ------------------- I got the messages (while editing the file "which-func.el"): Type of fun-name '(which-function)' is cons Type of (car fun-name) 'which-function' is string So, either the doc string of "which-func-cleanup-function" is wrong, either "which-function" should return the "car" of the value it returns. Since the code of "which-function" is not that simple, I can't clearly and surely tell which one is wrong and fix the bug by myself. I noticed that the function "which-function" contains the following lines: ;; Try using add-log support. (when (null name) (setq name (add-log-current-defun))) And it seems that "add-log-current-defun" returns a string. So, maybe, "which-function" should return the "car" of "name" when it is a list. Can you fix it? )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.