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: Mon, 24 Jun 2013 05:48:23 +1200 Message-ID: <51C734E7.5010303@orcon.net.nz> References: <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 1372009753 9888 80.91.229.3 (23 Jun 2013 17:49:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Jun 2013 17:49:13 +0000 (UTC) Cc: 14694@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 23 19:49:11 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 1UqoPV-0003bz-0J for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2013 19:49:09 +0200 Original-Received: from localhost ([::1]:45029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqoPU-0004EQ-GV for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2013 13:49:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqoPP-0004EK-Nm for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 13:49:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqoPO-0007Fc-ON for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 13:49:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqoPO-0007FY-Kx for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 13:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UqoPO-0000K5-1w for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2013 13:49: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 17:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14694-submit@debbugs.gnu.org id=B14694.13720097311223 (code B ref 14694); Sun, 23 Jun 2013 17:49:02 +0000 Original-Received: (at 14694) by debbugs.gnu.org; 23 Jun 2013 17:48:51 +0000 Original-Received: from localhost ([127.0.0.1]:36787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UqoPC-0000Jc-O8 for submit@debbugs.gnu.org; Sun, 23 Jun 2013 13:48:51 -0400 Original-Received: from nctlincom02.orcon.net.nz ([60.234.4.76]:50202) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UqoP9-0000JQ-DI for 14694@debbugs.gnu.org; Sun, 23 Jun 2013 13:48:48 -0400 Original-Received: from mx5.orcon.net.nz (mx5.orcon.net.nz [219.88.242.55]) by nctlincom02.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id r5NHmh9v030237 for <14694@debbugs.gnu.org>; Mon, 24 Jun 2013 05:48:43 +1200 Original-Received: from Debian-exim by mx5.orcon.net.nz with local (Exim 4.69) (envelope-from ) id 1UqoP5-0002u6-6V for 14694@debbugs.gnu.org; Mon, 24 Jun 2013 05:48:43 +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 1UqoP4-0002tN-T8; Mon, 24 Jun 2013 05:48:42 +1200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: X-DSPAM-Check: by mx5.orcon.net.nz on Mon, 24 Jun 2013 05:48:43 +1200 X-DSPAM-Result: Innocent X-DSPAM-Processed: Mon Jun 24 05:48:43 2013 X-DSPAM-Confidence: 0.5470 X-DSPAM-Probability: 0.0016 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: 05JPRMHG1 - aa2b1365dbd5 - 20130624 X-Scanned-By: CanIt (www . roaringpenguin . com) on 172.16.100.175 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:75479 Archived-At: On 24/06/2013 04:45, Stefan Monnier wrote: > ELISP> (setq indirect-eval '(:eval "indirect eval")) > ELISP> (format-mode-line '(t indirect-eval "else")) >> "" > > You need (put 'indirect-eval 'risky-local-variable t) Argh, I see that in the documentation now. Thank you Stefan (and Eli). I'm afraid I made an embarrassing rookie mistake in checking the result of (format-mode-line indirect-eval) instead of (format-mode-line 'indirect-eval), and thinking that I was seeing an inconsistency when there was none. Otherwise I'd no doubt have spotted the information about that property. My apologies; please close. Eli asked: > And anyway, why would you need format-mode-line to produce a > different value? The specific goal was to enable customisation of the display of `mode-name' in the mode line (generally to abbreviate it and reduce the space used) *without* also affecting what is displayed when that variable is processed in other contexts (such as by `describe-mode'), in which cases `format-mode-line' will be called. Advising `format-mode-line' to provide an indicator variable to use in a conditional construct does facilitate this. I just wanted check that I wasn't missing another approach which didn't require the advice. -Phil