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.

Full log


View this message in rfc822 format

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: 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))




This bug report was last modified 4 years and 340 days ago.

Previous Next


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