GNU bug report logs - #41905
Small change: In Customize, display name with with spaces, but keep symbol name underneath.

Previous Next

Package: emacs;

Reported by: ej32u <at> protonmail.com

Date: Wed, 17 Jun 2020 04:17:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.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 41905 in the body.
You can then email your comments to 41905 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#41905; Package emacs. (Wed, 17 Jun 2020 04:17:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to ej32u <at> protonmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 17 Jun 2020 04:17:03 GMT) Full text and rfc822 format available.

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

From: ej32u <at> protonmail.com
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Small change: In Customize, display name with with spaces,
 but keep symbol name underneath.
Date: Wed, 17 Jun 2020 03:23:30 +0000
[Message part 1 (text/plain, inline)]
Hello,

This patch changes custom-unlispify-menu-entry to display symbols names with the "display" text property, but to keep the symbol name underneath. This is good when using try-expand-dabbrev-all-buffers, such as when writing the init file.

Thank you.
[Message part 2 (text/html, inline)]
[diff.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Wed, 17 Jun 2020 21:26:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: ej32u--- via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs <at> gnu.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Thu, 18 Jun 2020 00:20:15 +0300
> This patch changes custom-unlispify-menu-entry to display symbols names
> with the "display" text property, but to keep the symbol name underneath.
> This is good when using try-expand-dabbrev-all-buffers, such as when
> writing the init file.

Thanks, this is a nice idea.  Your patch allows to copy the symbol by M-w
and paste into a program as a symbol.  The same idea should be used
in 'describe-mode' (C-h m) as well where mode names should be symbols
underneath displayed capitalized strings.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Wed, 17 Jun 2020 21:26:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Thu, 18 Jun 2020 22:54:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: 41905 <at> debbugs.gnu.org
Cc: ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Fri, 19 Jun 2020 01:44:10 +0300
>> This patch changes custom-unlispify-menu-entry to display symbols names
>> with the "display" text property, but to keep the symbol name underneath.
>> This is good when using try-expand-dabbrev-all-buffers, such as when
>> writing the init file.
>
> Thanks, this is a nice idea.  Your patch allows to copy the symbol by M-w
> and paste into a program as a symbol.

But what happens when a variable name is expanded in the customization buffer?
(expanded in the sense that the down arrow is displayed before it)
It seems the name displayed as a symbol, not as a human-readable string.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 12:02:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 09:00:45 -0300
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:

>>> This patch changes custom-unlispify-menu-entry to display symbols names
>>> with the "display" text property, but to keep the symbol name
underneath.
>>> This is good when using try-expand-dabbrev-all-buffers, such as when
>>> writing the init file.
>>
>> Thanks, this is a nice idea.  Your patch allows to copy the symbol by M-w
>> and paste into a program as a symbol.
>
> But what happens when a variable name is expanded in the customization
buffer?
> (expanded in the sense that the down arrow is displayed before it)
> It seems the name displayed as a symbol, not as a human-readable string.

Hello Juri.

I think the problem you see is easily fixed with the attached patch.
[Message part 2 (text/html, inline)]
[0001-Improve-call-to-widget-create-child-and-convert-in-c.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 12:13:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ej32u <at> protonmail.com
Cc: 41905 <at> debbugs.gnu.org
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 14:12:38 +0200
ej32u <at> protonmail.com writes:

> This patch changes custom-unlispify-menu-entry to display symbols
> names with the "display" text property, but to keep the symbol name
> underneath. This is good when using try-expand-dabbrev-all-buffers,
> such as when writing the init file.

Makes sense to me, so I've applied this to Emacs 28.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 12:14:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 14:13:18 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> I think the problem you see is easily fixed with the attached patch.

Thanks; applied to Emacs 28.

-- 
(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. (Sat, 05 Sep 2020 12:14:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 41905 <at> debbugs.gnu.org and ej32u <at> protonmail.com Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 05 Sep 2020 12:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 12:52:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 09:50:46 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> ej32u <at> protonmail.com writes:
>
>> This patch changes custom-unlispify-menu-entry to display symbols
>> names with the "display" text property, but to keep the symbol name
>> underneath. This is good when using try-expand-dabbrev-all-buffers,
>> such as when writing the init file.
>
> Makes sense to me, so I've applied this to Emacs 28.

I think this change broke `C-h S' in Custom buffers:
emacs -Q
M-x customize-option RET fill-column
Put point in Fill Column
C-h S
You get prompted with: Describe symbol (default Hide-fill-column), which
is of course undocumented.
Before, the prompt was:
Describe symbol (default Fill-Column), and typing RET would open an Info
buffer without problems.

I'm not saying the change is bad.  I was just trying to see if this
change will fulfill the request in Bug#400, and I guess it does: C-h v
seems to work just fine, but I guess info-lookup-guess-custom-symbol
wasn't ready for the change.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 12:57:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 14:56:20 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

>>> This patch changes custom-unlispify-menu-entry to display symbols
>>> names with the "display" text property, but to keep the symbol name
>>> underneath. This is good when using try-expand-dabbrev-all-buffers,
>>> such as when writing the init file.
>>
>> Makes sense to me, so I've applied this to Emacs 28.
>
> I think this change broke `C-h S' in Custom buffers:

[...]

> I'm not saying the change is bad.  I was just trying to see if this
> change will fulfill the request in Bug#400, and I guess it does: C-h v
> seems to work just fine, but I guess info-lookup-guess-custom-symbol
> wasn't ready for the change.

Nope.  Would fixing info-lookup-guess-custom-symbol here be a lot of work?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 13:10:01 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 10:08:44 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Mauro Aranda <maurooaranda <at> gmail.com> writes:

>> I'm not saying the change is bad.  I was just trying to see if this
>> change will fulfill the request in Bug#400, and I guess it does: C-h v
>> seems to work just fine, but I guess info-lookup-guess-custom-symbol
>> wasn't ready for the change.
>
> Nope.  Would fixing info-lookup-guess-custom-symbol here be a lot of work?

I'm guessing no, because it shouldn't have to guess anymore...but I'm
not familiar with it.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 13:13:01 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 10:12:21 -0300
[Message part 1 (text/plain, inline)]
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>
>>> I'm not saying the change is bad.  I was just trying to see if this
>>> change will fulfill the request in Bug#400, and I guess it does: C-h v
>>> seems to work just fine, but I guess info-lookup-guess-custom-symbol
>>> wasn't ready for the change.
>>
>> Nope.  Would fixing info-lookup-guess-custom-symbol here be a lot of
work?
>
> I'm guessing no, because it shouldn't have to guess anymore...but I'm
> not familiar with it.

I did the obvious: commented out the :parse-rule line in
info-lookup-maybe-add-help for the :mode 'Custom-mode, and looks like
its working again.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 13:25:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 15:24:27 +0200
[Message part 1 (text/plain, inline)]
Mauro Aranda <maurooaranda <at> gmail.com> writes:

>> Nope.  Would fixing info-lookup-guess-custom-symbol here be a lot of work?
>
> I'm guessing no, because it shouldn't have to guess anymore...but I'm
> not familiar with it.

Actually...  Is this a regression?  I just tried this in Emacs 27, and
`C-h S' on "Fill Column" there asks me:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
Which doesn't exist.

After the patch, it says "Hide-fill-column", which doesn't exist either,
but which is basically the same bug -- which is that there's an
invisible string "Hide" before the "Fill Column".

Hm...  Oh!  If I move point into "Fill Column", then it guesses
correctly, but if point is at the "F", then it includes the invisible
"Hide".

The design choices taken in the library here are pretty odd --
transforming symbols to readable forms and then "guessing" to transform
them back, instead of just stashing the real data for easy retrieval...

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 13:49:01 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 10:48:20 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> After the patch, it says "Hide-fill-column", which doesn't exist either,
> but which is basically the same bug -- which is that there's an
> invisible string "Hide" before the "Fill Column".
>
> Hm...  Oh!  If I move point into "Fill Column", then it guesses
> correctly, but if point is at the "F", then it includes the invisible
> "Hide".

You are right.  So this patch didn't break `C-h S' at all, it just made
the bug a lot more visible.

Anyway, my lightly testing shows that perhaps relying on the :regexp and
not providing :parse-rule could be enough.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 13:53:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 15:52:33 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> You are right.  So this patch didn't break `C-h S' at all, it just made
> the bug a lot more visible.
>
> Anyway, my lightly testing shows that perhaps relying on the :regexp and
> not providing :parse-rule could be enough.

Could you whip up a patch for that?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 14:17:01 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 11:16:05 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>
>> You are right.  So this patch didn't break `C-h S' at all, it just made
>> the bug a lot more visible.
>>
>> Anyway, my lightly testing shows that perhaps relying on the :regexp and
>> not providing :parse-rule could be enough.
>
> Could you whip up a patch for that?

Sure, here is the patch I'm running with
[Message part 2 (text/html, inline)]
[0001-info-lookup-symbol-Fix-the-suggested-default-value-i.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 14:38:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 16:36:47 +0200
[Message part 1 (text/plain, inline)]
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> Sure, here is the patch I'm running with

Thanks, that makes C-h S use the correct string.  However, the prompt is
confusing:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
Because it's using the string from the buffer...  including the 'display
text property.  Perhaps it should strip all text properties before being
used?

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 14:59:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 11:58:29 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>
>> Sure, here is the patch I'm running with
>
> Thanks, that makes C-h S use the correct string.  However, the prompt is
> confusing:

[...]

> Because it's using the string from the buffer...  including the 'display
> text property.  Perhaps it should strip all text properties before being
> used?

Then I guess we must change info-lookup-interactive-arguments to do that.
[Message part 2 (text/html, inline)]
[0001-info-lookup-symbol-Fix-the-suggested-default-value-i.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 15:09:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Mauro Aranda <maurooaranda <at> gmail.com>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: RE: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 08:07:56 -0700 (PDT)
> Sure, here is the patch I'm running with

Isn't this comment part of the patch wrong?

+;; We don't need this anymore, because now Custom inserts the unlispified name
+;; in the buffer.  (Bug#41905)


Isn't the fix that it now inserts the _lispified_ name?

____


Anyway, thanks to all for working on this bug.

  - OP for bug #400




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 15:10:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 17:08:48 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> Then I guess we must change info-lookup-interactive-arguments to do that.

Thanks; applied to Emacs 28 with one small change:

> -		     (format "Describe %s (default %s): " topic default)
> +                     (progn (set-text-properties 0 (length default) nil default)
> +		            (format "Describe %s (default %s): " topic default))

I changed this to use substring-no-properties instead of
set-text-properties.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 15:21:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 17:20:18 +0200
After all that work, I think we'll have to revert this, anyway.  The
string returned here isn't just used in the buffers themselves, but also
in the buffer names, so this fails:

(ert-deftest so-long-tests-customize ()
  "Test the `so-long-customize' command."
  (so-long-customize)
  (should (string= (buffer-name) "*Customize Group: So Long*")))

*sigh*

Or...  we could work some more on this to fix these use cases.

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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 15:28:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 17:27:03 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Or...  we could work some more on this to fix these use cases.

Looking more at this, I think returning a 'display string here is just
wrong in most use cases, so I've reverted the patch (and Mauro's
follow-up patch that fixed some issues with the patch).

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 15:33:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 41905 <at> debbugs.gnu.org,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 5 Sep 2020 12:31:52 -0300
[Message part 1 (text/plain, inline)]
Drew Adams <drew.adams <at> oracle.com> writes:

>> Sure, here is the patch I'm running with
>
> Isn't this comment part of the patch wrong?
>
> +;; We don't need this anymore, because now Custom inserts the
unlispified name
> +;; in the buffer.  (Bug#41905)
>
>
> Isn't the fix that it now inserts the _lispified_ name?
>

Yes, it was wrong, thank you.  But this was reverted, so it's all moot now.

>
> Anyway, thanks to all for working on this bug.
>
>   - OP for bug #400

Looks like we're back to where we started, though :-(
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sat, 05 Sep 2020 16:38:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sat, 05 Sep 2020 18:37:43 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> Looks like we're back to where we started, though :-(

Yup.

I think the solution here is to stash the data needed somewhere so that
we don't need to guessing round trip.

The most obvious place to stash the data is in the string itself, so
custom-unlispify-tag-name should just put a 'data text property on the
unlispified string (with the symbol), and then the relevant functions
should use that instead of looking at the buffer text.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sun, 06 Sep 2020 12:18:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sun, 06 Sep 2020 14:17:28 +0200
I've now taken another whack at this (but storing the actual symbol), and
`C-h S' now works better than before, and no tests are failing.  I'm not
quite sure whether the change here will spill over into Emacs Lisp mode,
but some testing seems to say that it won't...

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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sun, 06 Sep 2020 12:36:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sun, 6 Sep 2020 09:35:18 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I've now taken another whack at this (but storing the actual symbol), and
> `C-h S' now works better than before, and no tests are failing.  I'm not
> quite sure whether the change here will spill over into Emacs Lisp mode,
> but some testing seems to say that it won't...

What I liked about the 'display approach is that it didn't seem to
require changes in the describe-* commands to work...

So I thought we could perhaps limit the places where we propertize the
string, and I came up with the attached patch.  But if you still think
it is the wrong way to do it, or if you like your changes better, I
promise I won't insist.

Note that with my patch, we'd still need the info-lookup patch from
yesterday.
[Message part 2 (text/html, inline)]
[0001-Show-tag-of-options-and-groups-unlispified-keep-lisp.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sun, 06 Sep 2020 12:40:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sun, 06 Sep 2020 14:39:02 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> What I liked about the 'display approach is that it didn't seem to
> require changes in the describe-* commands to work...

That is a good point, and it would make C-h v make work automatically.
But 'display properties are kinda awkward -- for one, the cursor moves
over them in a single skip, so they're a bit confusing in that respect.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sun, 06 Sep 2020 12:56:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, ej32u <at> protonmail.com,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sun, 6 Sep 2020 09:54:45 -0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>
>> What I liked about the 'display approach is that it didn't seem to
>> require changes in the describe-* commands to work...
>
> That is a good point, and it would make C-h v make work automatically.
> But 'display properties are kinda awkward -- for one, the cursor moves
> over them in a single skip, so they're a bit confusing in that respect.

Yes, that's true.  So...perhaps it's better to just ditch that idea.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Sun, 06 Sep 2020 19:10:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 41905 <at> debbugs.gnu.org,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Sun, 06 Sep 2020 21:40:36 +0300
>>> What I liked about the 'display approach is that it didn't seem to
>>> require changes in the describe-* commands to work...
>>
>> That is a good point, and it would make C-h v make work automatically.
>> But 'display properties are kinda awkward -- for one, the cursor moves
>> over them in a single skip, so they're a bit confusing in that respect.
>
> Yes, that's true.  So...perhaps it's better to just ditch that idea.

Just display spaces over every '-' character (and upper-case letters
at word beginnings):

(concat (propertize "f" 'display "F")
        "ill"
        (propertize "-" 'display " ")
        (propertize "c" 'display "C")
        "olumn")




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Mon, 07 Sep 2020 18:37:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 41905 <at> debbugs.gnu.org,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Mon, 07 Sep 2020 21:22:08 +0300
>>>> What I liked about the 'display approach is that it didn't seem to
>>>> require changes in the describe-* commands to work...
>>>
>>> That is a good point, and it would make C-h v make work automatically.
>>> But 'display properties are kinda awkward -- for one, the cursor moves
>>> over them in a single skip, so they're a bit confusing in that respect.
>>
>> Yes, that's true.  So...perhaps it's better to just ditch that idea.
>
> Just display spaces over every '-' character (and upper-case letters
> at word beginnings):
>
> (concat (propertize "f" 'display "F")
>         "ill"
>         (propertize "-" 'display " ")
>         (propertize "c" 'display "C")
>         "olumn")

Actually I meant not concat, but set-text-properties:

(let ((name "fill-column"))
 (set-text-properties 0 1 '(display "F") name)
 (set-text-properties 4 5 '(display " ") name)
 (set-text-properties 5 6 '(display "C") name)
 (insert name))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Mon, 07 Sep 2020 19:46:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 41905 <at> debbugs.gnu.org,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Mon, 7 Sep 2020 16:44:47 -0300
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:

>>>>> What I liked about the 'display approach is that it didn't seem to
>>>>> require changes in the describe-* commands to work...
>>>>
>>>> That is a good point, and it would make C-h v make work automatically.
>>>> But 'display properties are kinda awkward -- for one, the cursor moves
>>>> over them in a single skip, so they're a bit confusing in that respect.
>>>
>>> Yes, that's true.  So...perhaps it's better to just ditch that idea.
>>
>> Just display spaces over every '-' character (and upper-case letters
>> at word beginnings):
>>
>> (concat (propertize "f" 'display "F")
>>         "ill"
>>         (propertize "-" 'display " ")
>>         (propertize "c" 'display "C")
>>         "olumn")
>
> Actually I meant not concat, but set-text-properties:
>
> (let ((name "fill-column"))
>  (set-text-properties 0 1 '(display "F") name)
>  (set-text-properties 4 5 '(display " ") name)
>  (set-text-properties 5 6 '(display "C") name)
>  (insert name))

I think that's a good idea.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Mon, 07 Sep 2020 20:29:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 41905 <at> debbugs.gnu.org, Mauro Aranda <maurooaranda <at> gmail.com>,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Mon, 07 Sep 2020 22:28:29 +0200
Juri Linkov <juri <at> linkov.net> writes:

>> (concat (propertize "f" 'display "F")
>>         "ill"
>>         (propertize "-" 'display " ")
>>         (propertize "c" 'display "C")
>>         "olumn")
>
> Actually I meant not concat, but set-text-properties:
>
> (let ((name "fill-column"))
>  (set-text-properties 0 1 '(display "F") name)
>  (set-text-properties 4 5 '(display " ") name)
>  (set-text-properties 5 6 '(display "C") name)
>  (insert name))

Why not concat?  I think the end result is the same?

Anyway, it's an intriguing idea.  It's perhaps possibly slightly
confusing, but it avoids the problems with a longer display string, and
it fixes the `C-h v' problem.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Tue, 08 Sep 2020 18:47:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, Mauro Aranda <maurooaranda <at> gmail.com>,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Tue, 08 Sep 2020 21:33:24 +0300
>>> (concat (propertize "f" 'display "F")
>>>         "ill"
>>>         (propertize "-" 'display " ")
>>>         (propertize "c" 'display "C")
>>>         "olumn")
>>
>> Actually I meant not concat, but set-text-properties:
>>
>> (let ((name "fill-column"))
>>  (set-text-properties 0 1 '(display "F") name)
>>  (set-text-properties 4 5 '(display " ") name)
>>  (set-text-properties 5 6 '(display "C") name)
>>  (insert name))
>
> Why not concat?  I think the end result is the same?

No difference, indeed :)  But set-text-properties is cleaner:
we have a string and add properties to it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Tue, 08 Sep 2020 19:13:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41905 <at> debbugs.gnu.org, Mauro Aranda <maurooaranda <at> gmail.com>,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Tue, 08 Sep 2020 22:09:06 +0300
>>> (concat (propertize "f" 'display "F")
>>>         "ill"
>>>         (propertize "-" 'display " ")
>>>         (propertize "c" 'display "C")
>>>         "olumn")
>>
>> Actually I meant not concat, but set-text-properties:
>>
>> (let ((name "fill-column"))
>>  (set-text-properties 0 1 '(display "F") name)
>>  (set-text-properties 4 5 '(display " ") name)
>>  (set-text-properties 5 6 '(display "C") name)
>>  (insert name))
>
> Why not concat?  I think the end result is the same?

Actually, you are right - destructive construction of strings is simpler:

(let* ((name (symbol-name 'fill-column))
       (text (replace-regexp-in-string
              "\\b[a-z]"
              (lambda (c) (propertize c 'display (upcase c)))
              (replace-regexp-in-string
	       "[-:/]+"
               (lambda (c) (propertize c 'display " "))
               name))))
  (insert text))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Tue, 08 Sep 2020 20:52:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 41905 <at> debbugs.gnu.org, Mauro Aranda <maurooaranda <at> gmail.com>,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Tue, 08 Sep 2020 22:50:52 +0200
Juri Linkov <juri <at> linkov.net> writes:

>>>> (concat (propertize "f" 'display "F")
>>>>         "ill"
>>>>         (propertize "-" 'display " ")
>>>>         (propertize "c" 'display "C")
>>>>         "olumn")
>>>
>>> Actually I meant not concat, but set-text-properties:
>>>
>>> (let ((name "fill-column"))
>>>  (set-text-properties 0 1 '(display "F") name)
>>>  (set-text-properties 4 5 '(display " ") name)
>>>  (set-text-properties 5 6 '(display "C") name)
>>>  (insert name))
>>
>> Why not concat?  I think the end result is the same?
>
> No difference, indeed :)  But set-text-properties is cleaner:
> we have a string and add properties to it.

Yeah, but that's what propertize does, too.  Only less verbosely.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41905; Package emacs. (Tue, 08 Sep 2020 20:54:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 41905 <at> debbugs.gnu.org, Mauro Aranda <maurooaranda <at> gmail.com>,
 ej32u <at> protonmail.com
Subject: Re: bug#41905: Small change: In Customize, display name with with
 spaces, but keep symbol name underneath.
Date: Tue, 08 Sep 2020 22:52:55 +0200
Juri Linkov <juri <at> linkov.net> writes:

> Actually, you are right - destructive construction of strings is simpler:
>
> (let* ((name (symbol-name 'fill-column))
>        (text (replace-regexp-in-string
>               "\\b[a-z]"
>               (lambda (c) (propertize c 'display (upcase c)))
>               (replace-regexp-in-string
> 	       "[-:/]+"
>                (lambda (c) (propertize c 'display " "))
>                name))))
>   (insert text))

Makes sense to me.  Perhaps we should back out the fix I made here, and
add this one...  hm...  on the other hand, I think perhaps just doing
both is even better.  That is, do this to the prettified string, but
still add the 'data property.  So this would be a fix for bug#400.

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 07 Oct 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 200 days ago.

Previous Next


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