From: Phil Sainty <psainty@orcon.net.nz>
To: 14694@debbugs.gnu.org
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 [thread overview]
Message-ID: <51C6839D.9070909@orcon.net.nz> (raw)
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 <up> r e p o r t - e m a <tab> <return>
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)
next reply other threads:[~2013-06-23 5:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-23 5:11 Phil Sainty [this message]
2013-06-23 15:26 ` bug#14694: 24.3; format-mode-line failing with :eval form via a variable in a conditional construct Eli Zaretskii
2013-06-23 16:45 ` Stefan Monnier
2013-06-23 17:48 ` Phil Sainty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51C6839D.9070909@orcon.net.nz \
--to=psainty@orcon.net.nz \
--cc=14694@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.