GNU bug report logs - #12377
24.2.50; `minibuffer-prompt-properties' should respect existing faces in prompt string

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 7 Sep 2012 16:33:02 UTC

Severity: wishlist

Tags: fixed

Merged with 16136

Found in versions 24.2.50, 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 12377 in the body.
You can then email your comments to 12377 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Fri, 07 Sep 2012 16:33: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, 07 Sep 2012 16:33:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.2.50;
	`minibuffer-prompt-properties' should respect existing faces in
	prompt string
Date: Fri, 7 Sep 2012 09:31:27 -0700
`minibuffer-prompt-properties', via `minibuffer-prompt' face, overrides
a `face' property that might exist on certain parts of the prompt
string.  This is not good.  Emacs should be less overbearing and more
respectful of prompt strings, respecting existing properties, particular
`face', that might be present.

In GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600)
 of 2012-09-02 on MARVIN
Bzr revision: 109861 eggert <at> cs.ucla.edu-20120902171035-7mzihil3xd6bjfiy
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.6) --no-opt --enable-checking --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Sun, 09 Feb 2014 03:13:02 GMT) Full text and rfc822 format available.

Message #8 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 12377 <at> debbugs.gnu.org
Subject: Re: bug#12377: 24.2.50;
 `minibuffer-prompt-properties' should respect existing faces in
 prompt string
Date: Sat, 08 Feb 2014 19:11:27 -0800
"Drew Adams" <drew.adams <at> oracle.com> writes:

> `minibuffer-prompt-properties', via `minibuffer-prompt' face, overrides
> a `face' property that might exist on certain parts of the prompt
> string.  This is not good.  Emacs should be less overbearing and more
> respectful of prompt strings, respecting existing properties, particular
> `face', that might be present.

Yeah.  Perhaps it should use `add-face-text-property' instead of
overwriting the text properties?  Any objections?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Mon, 10 Feb 2014 22:37:02 GMT) Full text and rfc822 format available.

Message #11 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 12377 <at> debbugs.gnu.org
Subject: RE: bug#12377: 24.2.50; `minibuffer-prompt-properties' should respect
 existing faces in prompt string
Date: Mon, 10 Feb 2014 14:36:46 -0800 (PST)
> Yeah.  Perhaps it should use `add-face-text-property' instead of
> overwriting the text properties?  Any objections?

Yes.  If the prompt already has a `face' text property then assume
that is because the user or some other code wants to use that face.

Do not replace or add any `face' property to a prompt that already
has a `face' property.  This should be a no-brainer, IMO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Thu, 28 Apr 2016 16:24:02 GMT) Full text and rfc822 format available.

Message #14 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 12377 <at> debbugs.gnu.org
Subject: Re: bug#12377: 24.2.50;
 `minibuffer-prompt-properties' should respect existing faces in
 prompt string
Date: Thu, 28 Apr 2016 18:23:02 +0200
"Drew Adams" <drew.adams <at> oracle.com> writes:

> `minibuffer-prompt-properties', via `minibuffer-prompt' face, overrides
> a `face' property that might exist on certain parts of the prompt
> string.  This is not good.  Emacs should be less overbearing and more
> respectful of prompt strings, respecting existing properties, particular
> `face', that might be present.

Do you have a recipe that exhibits this bug?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Thu, 28 Apr 2016 16:39:01 GMT) Full text and rfc822 format available.

Message #17 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 12377 <at> debbugs.gnu.org
Subject: RE: bug#12377: 24.2.50; `minibuffer-prompt-properties' should respect
 existing faces in prompt string
Date: Thu, 28 Apr 2016 09:38:07 -0700 (PDT)
> Do you have a recipe that exhibits this bug?

C'mon Lars.  Please read the bug thread, including your own
contribution to it.  This should be a no-brainer.

emacs -Q

(completing-read (propertize "My prompt:" 'face 'highlight) '(a b c d))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Thu, 28 Apr 2016 16:55:01 GMT) Full text and rfc822 format available.

Message #20 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 12377 <at> debbugs.gnu.org
Subject: Re: bug#12377: 24.2.50;
 `minibuffer-prompt-properties' should respect existing faces in
 prompt string
Date: Thu, 28 Apr 2016 18:54:31 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> (completing-read (propertize "My prompt:" 'face 'highlight) '(a b c d))

See, it's easy to create test cases if you just try.  Well done.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Thu, 28 Apr 2016 17:07:01 GMT) Full text and rfc822 format available.

Message #23 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 12377 <at> debbugs.gnu.org
Subject: Re: bug#12377: 24.2.50;
 `minibuffer-prompt-properties' should respect existing faces in
 prompt string
Date: Thu, 28 Apr 2016 19:06:53 +0200
It's unfortunate that read_minibuf uses this way to apply the minibuf
text properties:

	Fadd_text_properties (make_number (BEG), make_number (PT),
			      Vminibuffer_prompt_properties, Qnil);

Or rather, the design of minibuffer-prompt-properties.  It includes one
property that's pretty important for the prompt, namely `read-only', and
one that's for display only, namely `face'.  And the latter is something
that you'd want to be able to override by saying `propertize' on the
prompt, definitely.

I'm inclined to think that if the user has set any `face' properties on
the prompt, then read_minibuf should avoid setting it.  We could just
loop over the minibuffer-prompt-properties list and apply the ones that
aren't set any place in the string already?  Does that sound OK to
everybody?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Fri, 29 Apr 2016 00:22:02 GMT) Full text and rfc822 format available.

Message #26 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 12377 <at> debbugs.gnu.org
Subject: RE: bug#12377: 24.2.50; `minibuffer-prompt-properties' should respect
 existing faces in prompt string
Date: Thu, 28 Apr 2016 17:21:36 -0700 (PDT)
Dunno why this needs to be done in C code anyway.

It is OK for Emacs to make the prompt read-only, I guess (i.e., to not let user code make it writable), though I would prefer that it just do that by default.

It is OK for Emacs to apply face `minibuffer-prompt' or whatever, by default.

It is not OK for Emacs to overwrite any text properties.

In general, user code should be allowed to do anything it wants to the prompt text. But Emacs should provide, by default, a read-only prompt with its standard face.

And it should be done in Lisp, preferably, so users can easily modify it at will.  This is Emacs.  There is nothing critical for performance about setting up the minibuffer prompt string.




Forcibly Merged 12377 16136. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 29 Apr 2016 14:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Sun, 01 May 2016 14:55:02 GMT) Full text and rfc822 format available.

Message #31 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 12377 <at> debbugs.gnu.org
Subject: Re: bug#12377: 24.2.50;
 `minibuffer-prompt-properties' should respect existing faces in
 prompt string
Date: Sun, 01 May 2016 16:54:39 +0200
I've now implemented this on the trunk -- the faces are merged with the
face specified by -prompt-properties (which are at the end), as
suggested by Stefan.

-- 
(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. (Sun, 01 May 2016 14:55:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.2, send any further explanations to 12377 <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. (Sun, 01 May 2016 14:55: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. (Mon, 30 May 2016 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Drew Adams <drew.adams <at> oracle.com> to control <at> debbugs.gnu.org. (Fri, 24 Jun 2016 16:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Fri, 24 Jun 2016 16:34:01 GMT) Full text and rfc822 format available.

Message #42 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: 12377 <at> debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: RE: bug#12377: 24.2.50; `minibuffer-prompt-properties' should respect
 existing faces in prompt string
Date: Fri, 24 Jun 2016 09:33:50 -0700 (PDT)
> I've now implemented this on the trunk -- the faces are merged with the
> face specified by -prompt-properties (which are at the end), as
> suggested by Stefan.

There was nothing posted to this bug thread by Stefan.  Likewise
for the other bug, #16136, with which this one was merged.

The above post by Lars was in reply to this:

>> Do you have a recipe that exhibits this bug?
> emacs -Q
> (completing-read (propertize "My prompt:" 'face 'highlight) '(a b c d))

Please reopen this bug.  It is NOT fixed.  At least not in this
build from 5/25, which is long after the "fix" was implemented:

In GNU Emacs 25.0.94.1 (x86_64-w64-mingw32)
 of 2016-05-25 built on KAEL
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --prefix=/tmp/emacs --without-imagemagick
 --enable-checking=yes,glyphs --enable-check-lisp-object-type
 'CFLAGS=-Og -gdwarf-4 -g3''

You still cannot do what was requested, including the obvious
as illustrated by the above `completing-read' test case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Fri, 24 Jun 2016 17:14:02 GMT) Full text and rfc822 format available.

Message #45 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 12377 <at> debbugs.gnu.org
Subject: Re: bug#12377: 24.2.50; `minibuffer-prompt-properties' should respect
 existing faces in prompt string
Date: Fri, 24 Jun 2016 13:13:32 -0400
[Message part 1 (text/plain, inline)]
On Fri, Jun 24, 2016 at 12:33 PM, Drew Adams <drew.adams <at> oracle.com> wrote:
>> I've now implemented this on the trunk -- the faces are merged with the
>> face specified by -prompt-properties (which are at the end)
[...]
> The above post by Lars was in reply to this:
>
>>> Do you have a recipe that exhibits this bug?
>> emacs -Q
>> (completing-read (propertize "My prompt:" 'face 'highlight) '(a b c d))
>
> Please reopen this bug.  It is NOT fixed.  At least not in this
> build from 5/25, which is long after the "fix" was implemented:
>
> In GNU Emacs 25.0.94.1 (x86_64-w64-mingw32)
>  of 2016-05-25 built on KAEL

It's fixed in master (the git equivalent of "trunk"), which
corresponds to versions 25.1.50+, see attached screenshot.
[propertized-prompt.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12377; Package emacs. (Fri, 24 Jun 2016 18:58:02 GMT) Full text and rfc822 format available.

Message #48 received at 12377 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 12377 <at> debbugs.gnu.org
Subject: RE: bug#12377: 24.2.50; `minibuffer-prompt-properties' should respect
 existing faces in prompt string
Date: Fri, 24 Jun 2016 11:57:48 -0700 (PDT)
> It's fixed in master (the git equivalent of "trunk"), which
> corresponds to versions 25.1.50+, see attached screenshot.

OK, good to know; thanks.  That May 25 pretest build is the latest
I have.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 23 Jul 2016 11:24:03 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:03 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:03 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:03 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:13 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 229 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.