unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: markusffm@fn.de
Cc: 48030@debbugs.gnu.org
Subject: bug#48030: 28.0.50; syntax evaluation in strings
Date: Mon, 26 Apr 2021 09:20:09 +0000	[thread overview]
Message-ID: <770e3441228cb3a50883@heytings.org> (raw)
In-Reply-To: <8ff0f114e95d3119ecdddc04e474dbb9@api.mail.freenet.de>


> 
> defining a function:
> (defun xxx-insert()
> "anything"
> (interactive)
> (insert "# Local Variables:\n")
> (insert "# mode: org\n")
> (insert "# End:\n")
> )

> will cause Emacs to disregard the Emacs-lisp-mode after re-opening the 
> file, hence no syntax evaluation anymore Changing (insert "# Local 
> Variables:\n") to (insert "# Local Bariables:\n") will 'solve' the 
> problem.
>

Thanks for your bug report.  As far as I can see, this is not a bug, when 
enable-local-variables is t (the default), Emacs searches for the the 
string "Local Variables" string near the end of the buffer, and interprets 
what follows as file-local variable settings.

This is not what you want if "Local Variables" is inside a literal string, 
but detecting that specific case would be cumbersome I think.  I would 
suggest that you replace (insert "# Local Variables:\n") by (insert "# 
Local " "Variables:\n"), with two additional quotation marks between Local 
and Variables.





  reply	other threads:[~2021-04-26  9:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  8:56 bug#48030: 28.0.50; syntax evaluation in strings markusffm
2021-04-26  9:20 ` Gregory Heytings [this message]
2021-04-27  4:10   ` Lars Ingebrigtsen

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=770e3441228cb3a50883@heytings.org \
    --to=gregory@heytings.org \
    --cc=48030@debbugs.gnu.org \
    --cc=markusffm@fn.de \
    /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).