all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers
@ 2020-09-05  9:44 Lucas Werkmeister
       [not found] ` <handler.43215.B.159929910128536.ack@debbugs.gnu.org>
  2020-09-05 10:42 ` bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers Stefan Kangas
  0 siblings, 2 replies; 5+ messages in thread
From: Lucas Werkmeister @ 2020-09-05  9:44 UTC (permalink / raw
  To: 43215; +Cc: Lucas Werkmeister

* 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)
 
 (defcustom sgml-attribute-offset 0
   "Specifies a delta for attribute indentation in `sgml-indent-line'.
-- 
2.28.0






^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#43215: Acknowledgement ([PATCH] Mark sgml-basic-offset as safe for integers)
       [not found] ` <handler.43215.B.159929910128536.ack@debbugs.gnu.org>
@ 2020-09-05  9:55   ` Lucas Werkmeister
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Werkmeister @ 2020-09-05  9:55 UTC (permalink / raw
  To: 43215

(My copyright assignment should still be on file from bug#31498.)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers
  2020-09-05  9:44 bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers Lucas Werkmeister
       [not found] ` <handler.43215.B.159929910128536.ack@debbugs.gnu.org>
@ 2020-09-05 10:42 ` Stefan Kangas
  2020-09-05 13:11   ` Lucas Werkmeister
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2020-09-05 10:42 UTC (permalink / raw
  To: Lucas Werkmeister; +Cc: 43215

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?





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers
  2020-09-05 10:42 ` bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers Stefan Kangas
@ 2020-09-05 13:11   ` Lucas Werkmeister
  2020-09-05 15:03     ` Stefan Kangas
  0 siblings, 1 reply; 5+ messages in thread
From: Lucas Werkmeister @ 2020-09-05 13:11 UTC (permalink / raw
  To: Stefan Kangas; +Cc: 43215

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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers
  2020-09-05 13:11   ` Lucas Werkmeister
@ 2020-09-05 15:03     ` Stefan Kangas
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2020-09-05 15:03 UTC (permalink / raw
  To: Lucas Werkmeister; +Cc: 43215

close 43215 28.1
thanks

Lucas Werkmeister <mail@lucaswerkmeister.de> writes:

> The patch lets users customize the sgml-basic-offset variable (which
> controls indentation of sgml-mode and derived modes like (m)html-mode).

Makes sense.  Now pushed to master as commit e9a08956d1.

Thanks for the patch!

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-05 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-05  9:44 bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers Lucas Werkmeister
     [not found] ` <handler.43215.B.159929910128536.ack@debbugs.gnu.org>
2020-09-05  9:55   ` bug#43215: Acknowledgement ([PATCH] Mark sgml-basic-offset as safe for integers) Lucas Werkmeister
2020-09-05 10:42 ` bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers Stefan Kangas
2020-09-05 13:11   ` Lucas Werkmeister
2020-09-05 15:03     ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.