bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers


From: Lucas Werkmeister
Subject: bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers
Date: Sat, 5 Sep 2020 15:11:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 05.09.20 12:42, Stefan Kangas wrote:
> Lucas Werkmeister <mail@lucaswerkmeister.de> writes:
> 
>> * lisp/textmodes/sgml-mode.el (sgml-basic-offset): Add :safe.
>> ---
>>  lisp/textmodes/sgml-mode.el | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
>> index 1672dce4f2..04f1dddf5f 100644
>> --- a/lisp/textmodes/sgml-mode.el
>> +++ b/lisp/textmodes/sgml-mode.el
>> @@ -46,7 +46,8 @@ sgml
>>
>>  (defcustom sgml-basic-offset 2
>>    "Specifies the basic indentation level for `sgml-indent-line'."
>> -  :type 'integer)
>> +  :type 'integer
>> +  :safe #'integerp)
> 
> Thanks for the patch.
> 
> Could you explain a bit about the rationale for this change, why it is
> needed and how to test it?
> 

The patch lets users customize the sgml-basic-offset variable (which
controls indentation of sgml-mode and derived modes like (m)html-mode).
To test it, you can set the variable to an integer value, for example:

    ; .dir-locals.el
    ((sgml-mode . ((sgml-basic-offset . 4))))

Then try to edit an HTML file in the same directory. Without this patch,
Emacs will ask if the local variable should be applied or not, because
it can’t be determined to be safe. This patch fixes that.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]