From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#1756: awk-mode: An empty line is not a paragraph separator (should be) Date: Tue, 6 Jan 2009 16:15:41 +0000 Message-ID: <20090106161541.GB5612@muc.de> References: <87sko35t3u.fsf@iki.fi> <20090105183502.GC2501@muc.de> <87hc4dbnua.fsf@iki.fi> Reply-To: bug-cc-mode@gnu.org, 1756@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1231259020 17727 80.91.229.12 (6 Jan 2009 16:23:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2009 16:23:40 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, 1756@emacsbugs.donarmstrong.com To: Teemu Likonen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 06 17:24:51 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LKEjZ-0005Mr-Nd for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Jan 2009 17:24:50 +0100 Original-Received: from localhost ([127.0.0.1]:43122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKEiJ-0005eQ-Q3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Jan 2009 11:23:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKEiG-0005dr-5G for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 11:23:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKEiF-0005dX-FH for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 11:23:27 -0500 Original-Received: from [199.232.76.173] (port=57580 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKEiF-0005dN-76 for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 11:23:27 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42219) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LKEiE-0008J6-JI for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 11:23:26 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n06GNOec001277; Tue, 6 Jan 2009 08:23:25 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n06G56GW028970; Tue, 6 Jan 2009 08:05:06 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Alan Mackenzie Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Tue, 06 Jan 2009 16:05:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1756 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123125754526811 (code B ref -1); Tue, 06 Jan 2009 16:05:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 6 Jan 2009 15:59:05 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n06Fx11v026799 for ; Tue, 6 Jan 2009 07:59:02 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKEKa-00063H-GU for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 10:59:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKEKZ-00062z-BD for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 10:59:00 -0500 Original-Received: from [199.232.76.173] (port=38562 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKEKZ-00062w-6D for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 10:58:59 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:1778 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LKEKY-0005KE-H8 for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 10:58:58 -0500 Original-Received: (qmail 60396 invoked by uid 3782); 6 Jan 2009 15:58:55 -0000 Original-Received: from acm.muc.de (pD9E23985.dip.t-dialin.net [217.226.57.133]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 06 Jan 2009 16:58:51 +0100 Original-Received: (qmail 7309 invoked by uid 1000); 6 Jan 2009 16:15:41 -0000 Content-Disposition: inline In-Reply-To: <87hc4dbnua.fsf@iki.fi> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-CrossAssassin-Score: 2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 06 Jan 2009 11:23:27 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:23827 Archived-At: 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 . 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).