all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Alan Mackenzie <acm@muc.de>
Cc: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org,
	347@emacsbugs.donarmstrong.com
Subject: bug#347: C mode asks twice about local variables
Date: Tue, 03 Jun 2008 02:40:29 -0400	[thread overview]
Message-ID: <jwvfxrvt49x.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <20080601172143.GA5899@muc.de> (Alan Mackenzie's message of "Sun,  1 Jun 2008 17:21:44 +0000")

> Yes.  This needs fixing, somehow.

> The way this happens is that in a C file's local variables list, there
> are two "special" variables, e.g. `c-file-style'.

> When 

>     c-basic-offset: 11
>     c-file-style: "k&r"

> occurs in the local variable list, this triggers a hook function which
> calls (c-set-style "k&r").  The hook is hack-local-variables-hook.  The
> problem is that this c-set-style call will overwrite the explicit value
> for c-basic-offset.  The explicit value MUST take precedence here.

Can you try and call `c-file-style' with some extra "don't override"
(when called from that hack-local-variables-hook) argument so that any
variable that already has a buffer-local binding will not be overridden?

> My solution was to call hack-local-variables a second time from within
> the hook function, first having deleted any occurrences of `mode',
> `c-file-style' etc. from the Local Variables.  This kludge worked
> reasonably well until the handling of safe/dangerous-local-variables was
> changed for Emacs 22.

How 'bout wrapping the call inside (let ((enable-local-variables :safe))?

> If Emacs were not to rebind the do-you-want-to-apply-it variable inside
> hack-local-variables, that would allow the kludge to work.

I don't know what you're referring to here.


        Stefan






  reply	other threads:[~2008-06-03  6:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <871w1aywbx.fsf@stupidchicken.com>
2008-05-31 22:51 ` bug#343: C mode asks twice about local variables Glenn Morris
2008-06-01 17:21   ` Alan Mackenzie
2008-06-03  6:40     ` Stefan Monnier [this message]
2008-06-09 14:36       ` bug#347: " Alan Mackenzie
2008-06-09 15:18         ` Stefan Monnier
2008-06-09 19:07           ` Alan Mackenzie
2008-06-11 14:41             ` Stefan Monnier
2008-06-11 16:37               ` Glenn Morris
2008-06-11 17:51                 ` Stefan Monnier
2008-06-15 22:04               ` Alan Mackenzie
2008-07-26 10:44                 ` Alan Mackenzie
2008-07-26 15:05                   ` Chong Yidong
2008-07-26 15:58                     ` Chong Yidong
2008-07-28 18:11                     ` Johan Bockgård
2008-07-31  1:37                   ` Chong Yidong
2008-07-31 14:20     ` bug#347: marked as done (C mode asks twice about local variables) Emacs bug Tracking System
2008-07-31 14:20   ` bug#343: " Emacs bug Tracking System

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=jwvfxrvt49x.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=347@emacsbugs.donarmstrong.com \
    --cc=acm@muc.de \
    --cc=bug-cc-mode@gnu.org \
    --cc=bug-gnu-emacs@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.