[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#21033: 25.0.50; `local-map' property inside `:eval' sexp in mode-lin
From: |
Drew Adams |
Subject: |
bug#21033: 25.0.50; `local-map' property inside `:eval' sexp in mode-line |
Date: |
Fri, 10 Jul 2015 14:01:26 -0700 (PDT) |
This might not be a bug, but I cannot seem to figure it out.
If it is not, please let me know what I'm missing.
This code puts string "abcdefg" in the mode-line with text property
`local-map', which has a single key binding to command `foo' for
`mouse-2'.
(setq global-mode-string
'(:eval (let* ((map (make-sparse-keymap))
(str "abcdefg"))
(define-key map [mouse-2] 'foo)
(add-text-properties 0 (1- (length str))
`(local-map ,map) str)
str)))
(defun foo (ev)
(interactive "e")
(message "@@@@@@@@@@@@@"))
I've fiddled with umpteen variations, but I cannot seem to get the
`local-map' property (or the `keymap' property) to have any effect
within an `:eval' form.
It is perhaps the case that this is simply not supported? I don't see
anything in the doc saying that. I'm hoping that I'm just missing
something, and there is a simple way to accomplish this.
In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
of 2015-07-03 on LEG570
Repository revision: 2b848fadd51e805b2f46da64c5958ea7f009048a
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --host=i686-pc-mingw32 --enable-checking=yes,glyphs'
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS
Important settings:
value of $LANG: ENU
locale-coding-system: cp1252
- bug#21033: 25.0.50; `local-map' property inside `:eval' sexp in mode-line,
Drew Adams <=