GNU bug report logs -
#15909
24.3.50; please fix `read-face-name' brain-dead PROMPT handling
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Fri, 15 Nov 2013 22:14:02 UTC
Severity: minor
Tags: fixed
Found in version 24.3.50
Fixed in version 26.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15909 in the body.
You can then email your comments to 15909 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15909
; Package
emacs
.
(Fri, 15 Nov 2013 22:14:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Drew Adams <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 15 Nov 2013 22:14:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In Emacs 20, the PROMPT arg was just passed to `completing-read'. So
you used ": " at the end. As usual in Emacs. Simple. Sure. No
nonsense.
In Emacs 22, `read-face-name' decided to become "smart": It required
callers NOT to end the PROMPT with a space. Dumb.
In Emacs 24, `read-face-name' decided to become even "smarter": It
requires callers NOT to end the PROMPT with EITHER a space or a colon.
It systematically adds ": " to PROMPT. Dumber.
This is silly. It means that any 3rd-party code that passes a prompt to
`read-face-name' has to fiddle with it to get the desired result for
different Emacs versions. To what end? What good is accomplished by
this silliness?
Please add some code similar to the following to `read-face-name', so it
DTRT.
(when (save-match-data (string-match ": $" prompt))
(setq prompt (substring prompt 0 -2)))
Feel free to make this code even smarter - make it accommodate prompts
of all sorts, adding ": " or ":" or " " ONLY AS NEEDED, not
systematically. After a decade or so of silliness, we should be able to
get this right finally.
If there were no silly history, the right approach would of course be to
have callers include ": " in the PROMPT arg, as usual in Emacs.
`read-face-name' (or some utility function it calls) could massage the
prompt to fiddle with default values or whatever.
It's not too late to make that the new interface. But we still need to
fix the problem of callers that must work across Emacs versions.
So please update the behavior (and the doc string) to expect PROMPT to
have its own ": ", but still accommodate PROMPTs that do not have it by
adding ": ", ":", or " " as needed. Yes, this is a mess. And a
gratuitous one, to boot.
In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
of 2013-11-12 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15909
; Package
emacs
.
(Fri, 15 Nov 2013 22:50:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 15909 <at> debbugs.gnu.org (full text, mbox):
> Please add some code similar to the following to `read-face-name',
> so it DTRT.
> (when (save-match-data (string-match ": $" prompt))
> (setq prompt (substring prompt 0 -2)))
To be clearer about that part. Below is code I use to counteract
the current `read-face-name' behavior. Incorporating a reasonable
fix into `read-face-name' would do something akin to the opposite.
(defun my-read-face-name (prompt)
"Read a face name using completion. Return its face symbol.
Accommodate vanilla Emacs PROMPT arg across Emacs versions."
(save-match-data
(when (and (> emacs-major-version 21)
(string-match "\\(:\\s *$\\|:?\\s +$\\)" prompt))
(setq prompt
(substring prompt 0
(- (length (match-string 0 prompt)))))))
(read-face-name prompt))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15909
; Package
emacs
.
(Sat, 08 Feb 2014 03:17:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 15909 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
> In Emacs 20, the PROMPT arg was just passed to `completing-read'. So
> you used ": " at the end. As usual in Emacs. Simple. Sure. No
> nonsense.
>
> In Emacs 22, `read-face-name' decided to become "smart": It required
> callers NOT to end the PROMPT with a space. Dumb.
>
> In Emacs 24, `read-face-name' decided to become even "smarter": It
> requires callers NOT to end the PROMPT with EITHER a space or a colon.
> It systematically adds ": " to PROMPT. Dumber.
>
> This is silly. It means that any 3rd-party code that passes a prompt to
> `read-face-name' has to fiddle with it to get the desired result for
> different Emacs versions. To what end? What good is accomplished by
> this silliness?
Is there any third-party code that calls that function?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15909
; Package
emacs
.
(Sat, 08 Feb 2014 23:10:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 15909 <at> debbugs.gnu.org (full text, mbox):
> Is there any third-party code that calls that function?
Of course. Why wouldn't there be? Take a look:
http://lmgtfy.com/?q=%22read-face-name%22+-debbugs+-bug-gnu-emacs
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15909
; Package
emacs
.
(Fri, 29 Apr 2016 14:43:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 15909 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
> In Emacs 20, the PROMPT arg was just passed to `completing-read'. So
> you used ": " at the end. As usual in Emacs. Simple. Sure. No
> nonsense.
>
> In Emacs 22, `read-face-name' decided to become "smart": It required
> callers NOT to end the PROMPT with a space. Dumb.
>
> In Emacs 24, `read-face-name' decided to become even "smarter": It
> requires callers NOT to end the PROMPT with EITHER a space or a colon.
> It systematically adds ": " to PROMPT. Dumber.
>
> This is silly. It means that any 3rd-party code that passes a prompt to
> `read-face-name' has to fiddle with it to get the desired result for
> different Emacs versions. To what end? What good is accomplished by
> this silliness?
I've now pushed a fix for this to the trunk.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 29 Apr 2016 14:43:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.2, send any further explanations to
15909 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 29 Apr 2016 14:43:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 28 May 2016 11:24:05 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:04 GMT)
Full text and
rfc822 format available.
bug Marked as fixed in versions 26.1.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:04 GMT)
Full text and
rfc822 format available.
bug No longer marked as fixed in versions 25.2.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:04 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 01 Jan 2017 12:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 228 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.