unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lucas Werkmeister <mail@lucaswerkmeister.de>
To: Stefan Kangas <stefan@marxist.se>
Cc: 43215@debbugs.gnu.org
Subject: bug#43215: [PATCH] Mark sgml-basic-offset as safe for integers
Date: Sat, 5 Sep 2020 15:11:06 +0200	[thread overview]
Message-ID: <1bd8c36a-516f-14cd-115e-53f26542dafe@lucaswerkmeister.de> (raw)
In-Reply-To: <CADwFkmn9KcGCngCCXFP00KxcFDZjASNgFimhZ6rcXQi1B4k8tw@mail.gmail.com>

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	other threads:[~2020-09-05 13:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-09-05 15:03     ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bd8c36a-516f-14cd-115e-53f26542dafe@lucaswerkmeister.de \
    --to=mail@lucaswerkmeister.de \
    --cc=43215@debbugs.gnu.org \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).