From: Eli Zaretskii <eliz@gnu.org>
To: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Cc: 68692-done@debbugs.gnu.org
Subject: bug#68692: 29.1; File-local variable storage for strings with newlines
Date: Fri, 26 Jan 2024 10:03:34 +0200 [thread overview]
Message-ID: <86a5osbjxl.fsf@gnu.org> (raw)
In-Reply-To: <877cjw3hwc.fsf@gmail.com> (message from Karthik Chikmagalur on Thu, 25 Jan 2024 19:14:43 -0800)
[Please use Reply All when replying, to have the bug tracker CC'ed.]
> From: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
> Date: Thu, 25 Jan 2024 19:14:43 -0800
>
> Hello Eli,
>
> Please close this bug, I read the local variables section of the elisp
> manual but missed the Emacs one.
I'm therefore closing this bug.
> However, I have a question now.
>
> > The manual says a little after the above:
> >
> > If you want to split a
> > long string value across multiple lines of the file, you can use
> > backslash-newline, which is ignored in Lisp string constants; you should
> > put the prefix and suffix on each line, even lines that start or end
> > within the string, as they will be stripped off when processing the
> > list. Here is an example:
> >
> > # Local Variables:
> > # compile-command: "cc foo.c -Dfoo=bar -Dhack=whatever \
> > # -Dmumble=blaah"
> > # End:
> >
> > Which I believe is what you are looking for.
> >
> > I don't think there's a bug in Emacs here.
>
> Is there a programmatic way (using elisp) to insert a local variable
> value that is a string that extends over multiple lines, as in my
> original example? I can write a helper function to replace newlines
> with backslash-newlines, but determining the right suffix to add at the
> end of each line is tricky.
We have add-file-local-variable and modify-file-local-variable -- did
you try any of them? If they don't handle this case, we need to fix
them so they do.
> I am addressing this right now by let-binding `print-escape-newlines' to
> t around calls to `add-file-local-variable', but perhaps there is a
> better way.
next prev parent reply other threads:[~2024-01-26 8:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 17:21 bug#68692: 29.1; File-local variable storage for strings with newlines Karthik Chikmagalur
2024-01-24 17:31 ` Eli Zaretskii
[not found] ` <877cjw3hwc.fsf@gmail.com>
2024-01-26 8:03 ` Eli Zaretskii [this message]
2024-01-26 19:49 ` Karthik Chikmagalur
2024-01-26 20:16 ` Eli Zaretskii
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=86a5osbjxl.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=68692-done@debbugs.gnu.org \
--cc=karthikchikmagalur@gmail.com \
/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).