unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nix <nix@esperi.org.uk>
To: Alan Mackenzie <acm@muc.de>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation
Date: Fri, 05 Aug 2011 15:14:36 +0100	[thread overview]
Message-ID: <87pqkkndwz.fsf@spindle.srvr.nix> (raw)
In-Reply-To: <20110605150624.GA3740@acm.acm> (Alan Mackenzie's message of "Sun, 5 Jun 2011 15:06:24 +0000")

On 5 Jun 2011, Alan Mackenzie said:

> Hi, Nix.
>
> On Thu, Jun 02, 2011 at 10:43:06PM +0100, Nix wrote:
>> On 2 Jun 2011, Alan Mackenzie stated:
>
>> > On Thu, Jun 02, 2011 at 05:47:16PM +0100, Nix wrote:
>> >> On 2 Jun 2011, Alan Mackenzie told this:
>
>> >> and have a patch, which works for me, at least... but it's rather ugly,
>> >> so if there is a better way which would still allow setting of styles on
>> >> file-by-file and directory-(class)-by-directory-(class) basis, then I'm
>> >> glad to try that instead!
>
> OK.  Would you please try this patch and let me know how it works.  It's
> a bit less ugly than your one (-:

Sorry for the insane delay, a big system update meant that restarting
Emacs was inadvisable for a few weeks until I'd crushed some (non-Emacs)
bugs. Thankfully there were no power cuts in this period :)

Your fix (in the form you committed it, since I delayed so long) seems
to work, though despite a lot of looking at it I'm not quite sure how!
God knows it's less grotesque than the 'pile things in then filter them
out again' approach I was employing.

>> Then it gets called again in `c-before-hack-hook' with dont-override
>> set to 't' iff the only c-file-style was in the directory local
>> variable. (The rationale for this remains opaque to me, but since the
>> underlying bug in my case was in the first part I didn't investigate
>> that bit too closely. The style doesn't end up set to the directory-
>> local style: it ends up set to the default!)
>
> It was an attempt to prevent .dir-local variables from overriding more
> specifically set variables (e.g. set in a hook function).  It didn't work
> very well.  :-(

Yeah. There are arguments on both sides for whether hook functions
should override dir-local (and for that matter file-local) variables.
I'm not sure which way the priorities should run, but I'm fairly sure it
should be consistent for all of Emacs, not just cc-mode, which implies
that we need some sort of helper that everyone can call to disambiguate
these cases.

> 2. Be VERY wary about sending "streams of consciousness"; they can
> sometimes be difficult to make sense of.  Reading them the morning after
> can be helpful.

Yeah, sorry about that. It wasn't actually a stream of consciousness:
it was a victim of repeated over-editing for 'clarity' (for which read
incomprehensibility).

> 3. Don't assume the grizzled senile maintainer can simply follow a patch;
> explain it!  Often the bug submitter, having just spent several hours on
> it, knows the piece of code better than the maintainer.

OK. I've been castigated for over-explaining patches on other lists, and
even for commenting code: nice to know this list is a 'please explain
yourself' list, I much prefer that.

> 4. In Emacs, the standard diff format is contextual (-c), but unified
> (-u) is OK too.

I still don't understand how anyone can read context diffs. :) but then
other poeple find unified diffs impossible to read as well. Obviously
we should use the UK government standard format and send things around
as PDF files with the old text blacked out by inserting a black box
above it. ;}

> So, let me know if the patch works, then we can close this bug.

It works!

-- 
NULL && (void)



  parent reply	other threads:[~2011-08-05 14:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 23:21 [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation Nix
2011-05-18  0:17 ` Stefan Monnier
2011-05-18 20:28   ` Nix
2011-05-18 21:08     ` ERT indentation testing (was: [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation) Ted Zlatanov
2011-05-18 22:19       ` ERT indentation testing Stefan Monnier
2011-05-19 10:33         ` Ted Zlatanov
2011-05-19 11:56           ` Stefan Monnier
2011-06-01 21:30             ` Ted Zlatanov
2011-06-02 18:43               ` Ted Zlatanov
2011-06-03  0:04                 ` Stefan Monnier
2011-06-03 11:33                   ` Ted Zlatanov
2011-06-03 12:12                     ` martin rudalics
2011-06-03 15:06                       ` extra-interactive functions (was: ERT indentation testing) Ted Zlatanov
2011-06-03 15:27                         ` extra-interactive functions martin rudalics
2011-06-03 16:11                           ` Ted Zlatanov
2011-06-03 18:59                             ` martin rudalics
2011-06-03 19:10                               ` Ted Zlatanov
2011-06-03 20:54                                 ` martin rudalics
2011-06-08 10:44                 ` ERT indentation testing Ted Zlatanov
2011-06-08 15:24                   ` Stefan Monnier
2011-06-09 16:05                     ` Ted Zlatanov
2011-06-10 20:41                       ` Stefan Monnier
2011-06-01 14:31   ` [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation Nix
2011-06-02 12:24     ` Alan Mackenzie
2011-06-02 13:35       ` Stefan Monnier
2011-06-02 16:47       ` Nix
2011-06-02 21:15         ` Alan Mackenzie
2011-06-02 21:43           ` Nix
2011-06-05 15:06             ` Alan Mackenzie
2011-07-24 10:07               ` Kan-Ru Chen
2011-08-05 14:14               ` Nix [this message]
2011-05-18  3:27 ` Glenn Morris
2011-05-18 11:02   ` Juanma Barranquero

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=87pqkkndwz.fsf@spindle.srvr.nix \
    --to=nix@esperi.org.uk \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).