all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Re: [christopher.ian.moore@gmail.com: Emacs very slow opening file]
Date: Sun, 02 Oct 2005 23:22:43 +0300	[thread overview]
Message-ID: <87y85bzvdo.fsf@jurta.org> (raw)
In-Reply-To: <20050930074317.GA6249@kenny.sha-bang.local> (Sascha Wilde's message of "Fri, 30 Sep 2005 09:43:17 +0200")

>> One idea is to restrict what strings can be used as the "prefix"
>> in a local variables list, so that local variables lists in diff output
>> are not obeyed.
>
> I'm afraid it won't be that easy.  Typical prefix chars in diffs are
> "-", "+" and "!" most (all?) of them are used for comments in some
> languages (eg. Ada, Postscript).  Even worse: context lines aren't
> prefixed at all.

One quite reliable solution is to store the original values of
prefix/suffix strings in the Local Variables section by adding new
variables `local-variables-prefix' and `local-variables-suffix', e.g.:

-/* Local Variables: */
-/* local-variables-prefix:"/* " */
-/* local-variables-suffix:" */" */
-/* mode:c */
-/* eval:(load-library "time-stamp") */
-/* eval:(make-local-variable 'write-file-hooks) */
-/* eval:(add-hook 'write-file-hooks 'time-stamp) */
-/* End: */

That way `hack-local-variables' could treat these variables specially:
by extracting their values from the Local Variables section, and testing
if they match the real prefix and suffix around the `Local Variables:'.

So the Local Variables section in the example above wouldn't be
interpreted, because the value of `local-variables-prefix' ("/* ")
is not the same as the prefix "-/* " in the diff file.

Of course, this wouldn't work with existing Local-Variables sections,
but for new sections adding these special variables would be easy
with a new command (from etc/TODO) that will make a local variables
section and write the values of `local-variables-prefix' and
`local-variables-suffix' automatically.

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2005-10-02 20:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-28 17:11 [christopher.ian.moore@gmail.com: Emacs very slow opening file] Richard M. Stallman
2005-09-29  9:51 ` Sascha Wilde
2005-09-29 12:24   ` Kenichi Handa
2005-09-29 12:38     ` Sascha Wilde
2005-09-29 19:44       ` Stefan Monnier
2005-09-29 20:55         ` Juri Linkov
2005-09-30 17:33           ` Richard M. Stallman
2005-09-29 21:03         ` Andreas Schwab
2005-09-29 23:31   ` Richard M. Stallman
2005-09-30  6:39     ` David Kastrup
2005-09-30  7:58       ` Sascha Wilde
2005-09-30 23:50       ` Richard M. Stallman
2005-10-02 14:48         ` Stefan Monnier
2005-09-30  7:43     ` Sascha Wilde
2005-10-02 20:22       ` Juri Linkov [this message]
2005-10-03 15:35         ` Richard M. Stallman

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

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

  git send-email \
    --in-reply-to=87y85bzvdo.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    /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 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.