From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#14694: 24.3; format-mode-line failing with :eval form via a variable in a conditional construct Date: Sun, 23 Jun 2013 17:11:57 +1200 Message-ID: <51C6839D.9070909@orcon.net.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1371964390 5320 80.91.229.3 (23 Jun 2013 05:13:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Jun 2013 05:13:10 +0000 (UTC) To: 14694@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 23 07:13:10 2013 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 1Uqcbu-0006Su-C6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2013 07:13:10 +0200 Original-Received: from localhost ([::1]:47226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uqcbt-0006x3-Ez for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2013 01:13:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uqcbp-0006wg-KA for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 01:13:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uqcbm-00076V-N1 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 01:13:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uqcbm-00076Q-Ie for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 01:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Uqcbm-0003U9-6o for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 01:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2013 05:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14694 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.137196435913290 (code B ref -1); Sun, 23 Jun 2013 05:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Jun 2013 05:12:39 +0000 Original-Received: from localhost ([127.0.0.1]:35699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UqcbO-0003SH-Cr for submit@debbugs.gnu.org; Sun, 23 Jun 2013 01:12:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45259) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UqcbJ-0003Rz-Mg for submit@debbugs.gnu.org; Sun, 23 Jun 2013 01:12:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqcbD-000717-8H for submit@debbugs.gnu.org; Sun, 23 Jun 2013 01:12:28 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:46548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqcbD-000713-4u for submit@debbugs.gnu.org; Sun, 23 Jun 2013 01:12:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqcbB-0006vB-KX for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 01:12:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqcbA-00070a-BT for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 01:12:25 -0400 Original-Received: from nctlincom01.orcon.net.nz ([60.234.4.69]:47557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uqcb9-0006zO-Qp for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 01:12:24 -0400 Original-Received: from mx5.orcon.net.nz (mx5.orcon.net.nz [219.88.242.55]) by nctlincom01.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id r5N5QJgg019499 for ; Sun, 23 Jun 2013 17:26:19 +1200 Original-Received: from Debian-exim by mx5.orcon.net.nz with local (Exim 4.69) (envelope-from ) id 1Uqcaz-0000xV-BQ for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 17:12:13 +1200 Original-Received: from [121.99.89.166] (helo=[10.1.1.3]) by mx5.orcon.net.nz with esmtpa (Exim 4.69) (envelope-from ) id 1Uqcaz-0000xN-3b for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 17:12:13 +1200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 X-DSPAM-Check: by mx5.orcon.net.nz on Sun, 23 Jun 2013 17:12:13 +1200 X-DSPAM-Result: Innocent X-DSPAM-Processed: Sun Jun 23 17:12:13 2013 X-DSPAM-Confidence: 0.5161 X-DSPAM-Probability: 0.0000 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, default) X-CanIt-Geo: ip=121.99.89.166; country=NZ; region=E7; city=Auckland; latitude=-36.8667; longitude=174.7667; http://maps.google.com/maps?q=-36.8667,174.7667&z=6 X-CanItPRO-Stream: base:default X-Canit-Stats-ID: 06JPFqjuA - aa02f29d14d0 - 20130623 X-Scanned-By: CanIt (www . roaringpenguin . com) on 172.16.100.174 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:75467 Archived-At: From emacs -Q the following returns an empty string, which seems like a bug: ELISP> (setq indirect-eval '(:eval "indirect eval")) ELISP> (format-mode-line '(t indirect-eval "else")) "" Other tests have worked as expected: ELISP> (format-mode-line '(t "then" "else")) "then" ELISP> (setq indirect-string "indirect string") ELISP> (format-mode-line '(t indirect-string "else")) "indirect string" ELISP> (format-mode-line '(:eval "direct eval")) "direct eval" ELISP> (format-mode-line '(t (:eval "direct eval") "else")) "direct eval" ELISP> (setq indirect-eval '(:eval "indirect eval")) ELISP> (format-mode-line indirect-eval) "indirect eval" It just seems to be the combination of the (:eval) form as the value of a variable in a conditional form which is failing. And a related question, if I may: Other than wrapping advice around format-mode-line to let-bind a variable, is there any way for me to ascertain whether a mode line construct is being processed for an actual mode line redraw (in which case format-mode-line is not called), as opposed to some other situation (e.g. describe-mode) in which format-mode-line will be used? My goal is to use the conditional construct to display the original value when calling format-mode-line, but an alternative value in the mode line itself, with the two values being stored in buffer local variables. At the moment I'm using advice to supply the condition (and of course I found the above bug when testing that my code worked for the different types of construct). thanks, -Phil In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2013-06-23 on xerxes Windowing system distributor `The X.Org Foundation', version 11.0.11300000 System Description: Ubuntu 12.04.2 LTS Important settings: value of $LANG: en_NZ.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x r e p o r t - e m a Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: Beginning of history; no preceding item Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)