unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Teemu Likonen <tlikonen@iki.fi>
Cc: bug-gnu-emacs@gnu.org, 1756@emacsbugs.donarmstrong.com
Subject: bug#1756: awk-mode: An empty line is not a paragraph separator (should be)
Date: Tue, 6 Jan 2009 16:15:41 +0000	[thread overview]
Message-ID: <20090106161541.GB5612@muc.de> (raw)
In-Reply-To: <87hc4dbnua.fsf@iki.fi>

Hi, Teemu!

On Mon, Jan 05, 2009 at 08:38:05PM +0200, Teemu Likonen wrote:
> Alan Mackenzie (2009-01-05 18:35 +0000) wrote:

> > Can you give me precise recipe to reproduce this, please.  It worked OK
> > for me when I tried it.  When I did the following:
> >
> > (i) M-: (setcdr (cadr c-comment-prefix-regexp) "#*") ; Changes the entry
> >           ; from (awk . "#+") to (awk . "#*")
> > (ii) C-c . <CR> awk  ; from within an AWK buffer
>
> I have your previous patch applied so there is this additional
> subexpression level "\(...\)?" too. >
> > , M-: paragraph-start gave me "[ \t]*\\(#*\\)[ \t]*$\\|^\f"
> >                                         ^^
> > which has incorporated the new value from c-comment-prefix-regexp.

> I can reproduce it by setting c-comment-prefix-regexp through the
> customize system:

>     M-x customize-option RET c-comment-prefix-regexp RET

> Select "Override style settings" and "Mode-specific regexps". Type #* to
> the AWK string and save the settings. Now, when I do "M-x awk-mode" I
> get this paragraph-start:

>     "[ \t]*\\(#*\\)[ \t]*$\\|^\f"
                ^^

Which is expected and correct - the awk bit of the global value of
c-comment-prefix-regexp, "#*", has been incorporated into
paragraph-start.

> After "C-c . awk RET" it changes to this:

>     "[ \t]*\\(\\(#+\\)[ \t]*\\)?$\\|^\f"
                   ^^

> Even though I chose to override the style settings "#*" changes to "#+".

I don't think this is a bug.  You asked for "awk" style to be set on the
buffer, and this is exactly what you got.  Customizing
c-comment-prefix-regexp has set the global value of this variable (which
was previously the symbol 'set-from-style); it hasn't changed the value
in any style.

I agree this is confusing, very confusing, and would very much like to
make it less confusing.  I am guessing that the cause is in the fine CC
Mode manual, page "Config Basics", in this bit:

    If you make conflicting settings in several of these ways, the way
    that takes precedence is the one that appears latest in this list:

        Style
        Top-level command or "customization interface"
        Hook
        File Style

This sentence only applies when initialising the mode, so perhaps it
would be better if amended something like this:

    When you initialize the buffer, the settings are made in the
    following order.  So if you make conflicting settings in several of
    these ways, the way that takes precedence is the one that appears
    latest in the list(2):

        Style
        Top-level command or "customization interface"
        Hook
        File Style

    ....
    ....

    ---------- Footnotes ----------
    (2) If you later call `c-set-style' (C-c .), all the style variables
    will get set to the style you select.
 
What do you think?

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).







  reply	other threads:[~2009-01-06 16:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-01  8:27 bug#1756: awk-mode: An empty line is not a paragraph separator (should be) Teemu Likonen
2009-01-05 16:12 ` Alan Mackenzie
2009-01-05 17:53   ` Teemu Likonen
2009-01-05 18:35 ` Alan Mackenzie
2009-01-05 18:38   ` Teemu Likonen
2009-01-06 16:15     ` Alan Mackenzie [this message]
2009-01-07 16:32       ` Teemu Likonen
2009-01-08 16:25         ` Alan Mackenzie

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=20090106161541.GB5612@muc.de \
    --to=acm@muc.de \
    --cc=1756@emacsbugs.donarmstrong.com \
    --cc=bug-cc-mode@gnu.org \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=tlikonen@iki.fi \
    /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).