[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49274: [PATCH] lisp/cus-theme: retain documentation string when cust
From: |
Christopher League |
Subject: |
bug#49274: [PATCH] lisp/cus-theme: retain documentation string when customizing theme |
Date: |
Tue, 29 Jun 2021 19:54:04 -0400 |
User-agent: |
Roundcube Webmail/1.4.11 |
On 2021-06-29 18:38, Mauro Aranda wrote:
I think this is a good change.
Thanks!
*Implementation details:* we had to move the chunk marked "Load the
theme settings" earlier in the function `customize-create-theme`. Then
the `custom-theme-description` widget was made an `editable-field`
whose value comes from `theme-documentation` if available, else
`format-time-string`. The rest of the patch is reindentation due to
the larger scope of the let that holds the theme settings.
Why change the widget from a text widget to an editable-field
widget? I think a text widget is better here, since a docstring usually
would have more than one line, and the editable-field keymap remaps RET
while the text keymap doesn't.
Interesting. I'm not that familiar with the widget types, but the reason
I
chose 'editable-field is because 'text seems to *duplicate* the content,
which is much more annoying for a multi-line doc string than a short
name.
I'll attach a screen-shot -- this is the effect when it's
(widget-create 'text ...). [Or maybe this is a widget bug? I'm using git
master from earlier today.]
When it's 'editable-field as in my patch, you are correct that RET
leaves
the field, but C-j or M-j will insert a newline, and M-q actually seems
to
work too (though it doesn't preserve the first line of the doc string
like
it would in a doc string in elisp mode).
If there's a fix for duplicating the string with a text widget, I'll be
happy with it! Thanks.
--
CL
2021-06-29_19-43.png
Description: PNG image