From tlikonen@iki.fi Thu Jan 1 00:27:30 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 1 Jan 2009 08:27:30 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.0 required=4.0 tests=IMPRONONCABLE_2 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 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 n018RQk9002026 for ; Thu, 1 Jan 2009 00:27:28 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LIItq-0007Vp-2n for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 03:27:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LIIto-0007Vd-OU for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 03:27:25 -0500 Received: from [199.232.76.173] (port=57414 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LIIto-0007Va-Es for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 03:27:24 -0500 Received: from mta-out.inet.fi ([195.156.147.13]:35318 helo=jenni1.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LIItn-0002oM-Qi for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 03:27:24 -0500 Received: from mithlond.arda.local (80.220.180.181) by jenni1.inet.fi (8.5.014) id 48FC59C70333947E for bug-gnu-emacs@gnu.org; Thu, 1 Jan 2009 10:27:22 +0200 Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1LIIth-0000uU-Vn for bug-gnu-emacs@gnu.org; Thu, 01 Jan 2009 10:27:18 +0200 To: bug-gnu-emacs@gnu.org Subject: awk-mode: An empty line is not a paragraph separator (should be) From: Teemu Likonen Date: Thu, 01 Jan 2009 10:27:17 +0200 Message-ID: <87sko35t3u.fsf@iki.fi> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) In awk-mode an empty line is not considered a paragraph separator, only lines containing whitespace and "#" character(s) are. After running the command "M-x awk-mode" the value of both paragraph-start and paragraph-separate are set as follows: "[ \t]*\\(#+\\)[ \t]*$\\|^\f" ^^ See, at least one # is required. I think better default would be #* so that empty lines or lines with only whitespace would be paragraph separators too. I suggest doing the following change: diff --git i/lisp/progmodes/cc-vars.el w/lisp/progmodes/cc-vars.el index 18f314c..62c85f0 100644 --- i/lisp/progmodes/cc-vars.el +++ w/lisp/progmodes/cc-vars.el @@ -483,7 +483,7 @@ style comments." (defcustom-c-stylevar c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") - (awk-mode . "#+") + (awk-mode . "#*") (other . "//+\\|\\**")) "*Regexp to match the line prefix inside comments. This regexp is used to recognize the fill prefix inside comments for (pike-mode and "other" have a comment prefix regexp which matches a zero number of comment prefix characters: \**) There is another and related bug. It is possible to configure the comment prefix regexp with the option c-comment-prefix-regexp. But the problem is that the option only takes effect when awk-mode is turned on. If user later changes indentation style with the command c-set-style (bound to C-c .) then it seems that the hard-coded default (#+) takes preference over user's c-comment-prefix-regexp settings. From rgm@gnu.org Sat Jan 3 18:08:04 2009 Received: (at control) by emacsbugs.donarmstrong.com; 4 Jan 2009 02:08:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.7 required=4.0 tests=MISSING_SUBJECT,NOSUBJECT, VALID_BTS_CONTROL,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n04281Al027408 for ; Sat, 3 Jan 2009 18:08:02 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LJIOD-0008IO-Nf; Sat, 03 Jan 2009 21:06:53 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18784.6589.638899.56291@fencepost.gnu.org> Date: Sat, 3 Jan 2009 21:06:53 -0500 From: Glenn Morris To: control X-Debbugs-No-Ack: yes reassign 1778 spam reassign 1777 spam reassign 1774 spam reassign 1773 spam reassign 1772 spam severity 1771 wishlist reassign 1769 spam reassign 1760 spam reassign 1759 spam reassign 1758 spam reassign 1663 emacs,ns reassign 1677 emacs,gnus reassign 1687 emacs,ns reassign 1693 emacs,gnus close 1698 tags 1702 moreinfo reassign 1729 emacs,cc-mode tags 1731 notabug severity 1750 wishlist reassign 1756 emacs,cc-mode From acm@muc.de Mon Jan 5 07:55:42 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 5 Jan 2009 15:55:42 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 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 n05FtYg6018759 for ; Mon, 5 Jan 2009 07:55:35 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJrnh-0004pn-MY for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 10:55:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJrne-0004ol-SZ for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 10:55:33 -0500 Received: from [199.232.76.173] (port=45047 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJrne-0004of-Lq for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 10:55:30 -0500 Received: from colin.muc.de ([193.149.48.1]:4844 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 1LJrnd-0000X4-TH for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 10:55:30 -0500 Received: (qmail 96961 invoked by uid 3782); 5 Jan 2009 15:55:27 -0000 Received: from acm.muc.de (pD9E515A5.dip.t-dialin.net [217.229.21.165]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 05 Jan 2009 16:55:24 +0100 Received: (qmail 7678 invoked by uid 1000); 5 Jan 2009 16:12:09 -0000 Date: Mon, 5 Jan 2009 16:12:09 +0000 To: Teemu Likonen , 1756@debbugs.gnu.org Cc: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Subject: Re: bug#1756: awk-mode: An empty line is not a paragraph separator (should be) Message-ID: <20090105161209.GB2501@muc.de> References: <87sko35t3u.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sko35t3u.fsf@iki.fi> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-CrossAssassin-Score: 2 Hi, Teemu! On Thu, Jan 01, 2009 at 10:27:17AM +0200, Teemu Likonen wrote: > In awk-mode an empty line is not considered a paragraph separator, only > lines containing whitespace and "#" character(s) are. After running the > command "M-x awk-mode" the value of both paragraph-start and > paragraph-separate are set as follows: > "[ \t]*\\(#+\\)[ \t]*$\\|^\f" > ^^ > See, at least one # is required. I think better default would be #* so > that empty lines or lines with only whitespace would be paragraph > separators too. Agreed. Thanks for the report. > I suggest doing the following change: > [ Tweaking the definition of c-comment-prefix-regexp. ] I'd rather not do it this way, because although c-comment-prefix-regexp isn't currently used anywhere else, it might be in the future. A blank line cannot be a comment prefix in AWK. > (pike-mode and "other" have a comment prefix regexp which matches a zero > number of comment prefix characters: \**) Can you please try the following patch (it might be a few lines offset from the given line numbers). It checks whether the comment prefix matches a blank line, and fixes paragraph-s{tart,eparate} if it doesn't. ######################################################################### *** orig/cc-styles.el 2009-01-05 11:49:10.753657960 +0000 --- cc-styles.el 2009-01-05 15:29:34.569332408 +0000 *************** *** 512,525 **** (assoc 'other c-comment-prefix-regexp))) c-comment-prefix-regexp)) ! (let ((comment-line-prefix ! (concat "[ \t]*\\(" c-current-comment-prefix "\\)[ \t]*"))) ! (setq paragraph-start (concat comment-line-prefix c-paragraph-start "\\|" page-delimiter) ! paragraph-separate (concat comment-line-prefix c-paragraph-separate "\\|" page-delimiter) --- 512,532 ---- (assoc 'other c-comment-prefix-regexp))) c-comment-prefix-regexp)) ! (let* ((empty-is-prefix (string-match c-current-comment-prefix "")) ! (nonws-comment-line-prefix ! (concat "\\(" c-current-comment-prefix "\\)[ \t]*")) ! (comment-line-prefix (concat "[ \t]*" nonws-comment-line-prefix)) ! (blank-or-comment-line-prefix ! (concat "[ \t]*" ! (if empty-is-prefix "" "\\(") ! nonws-comment-line-prefix ! (if empty-is-prefix "" "\\)?")))) ! (setq paragraph-start (concat blank-or-comment-line-prefix c-paragraph-start "\\|" page-delimiter) ! paragraph-separate (concat blank-or-comment-line-prefix c-paragraph-separate "\\|" page-delimiter) ######################################################################### > There is another and related bug. It is possible to configure the > comment prefix regexp with the option c-comment-prefix-regexp. But the > problem is that the option only takes effect when awk-mode is turned on. > If user later changes indentation style with the command c-set-style > (bound to C-c .) then it seems that the hard-coded default (#+) takes > preference over user's c-comment-prefix-regexp settings. I'll get back to you on this one. Thanks again for the bug report. -- Alan Mackenzie (Nuremberg, Germany). From tlikonen@iki.fi Mon Jan 5 09:54:18 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 5 Jan 2009 17:54:18 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 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 n05HsE0h015029 for ; Mon, 5 Jan 2009 09:54:16 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJteY-0006Oo-BO for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 12:54:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJteW-0006Oc-Pj for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 12:54:13 -0500 Received: from [199.232.76.173] (port=55984 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJteW-0006OZ-Lp for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 12:54:12 -0500 Received: from mta-out.inet.fi ([195.156.147.13]:56465 helo=kirsi1.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJteT-0004Ml-8G; Mon, 05 Jan 2009 12:54:09 -0500 Received: from mithlond.arda.local (80.220.180.181) by kirsi1.inet.fi (8.5.014) id 48FC5AC9035460BA; Mon, 5 Jan 2009 19:53:46 +0200 Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1LJte2-0003HO-M7; Mon, 05 Jan 2009 19:53:42 +0200 To: Alan Mackenzie Cc: 1756@debbugs.gnu.org, bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Subject: Re: bug#1756: awk-mode: An empty line is not a paragraph separator (should be) In-Reply-To: <20090105161209.GB2501@muc.de> (Alan Mackenzie's message of "Mon\, 5 Jan 2009 16\:12\:09 +0000") References: <87sko35t3u.fsf@iki.fi> <20090105161209.GB2501@muc.de> From: Teemu Likonen Date: Mon, 05 Jan 2009 19:53:42 +0200 Message-ID: <87ljtpbpw9.fsf@iki.fi> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-CrossAssassin-Score: 2 Alan Mackenzie (2009-01-05 16:12 +0000) wrote: > Can you please try the following patch (it might be a few lines offset > from the given line numbers). It checks whether the comment prefix > matches a blank line, and fixes paragraph-s{tart,eparate} if it > doesn't. I tried it and it seems to work nicely. I'm not competent enough to critically review the actual code changes you introduced but, well, so far I think it works. :-) From acm@muc.de Mon Jan 5 10:18:34 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 5 Jan 2009 18:18:34 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 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 n05IIVxj021743 for ; Mon, 5 Jan 2009 10:18:32 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJu22-0003bP-2I for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 13:18:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJu1z-0003al-Ct for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 13:18:28 -0500 Received: from [199.232.76.173] (port=60893 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJu1z-0003ai-4O for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 13:18:27 -0500 Received: from colin.muc.de ([193.149.48.1]:2817 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 1LJu1y-0007YI-L1 for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 13:18:27 -0500 Received: (qmail 38383 invoked by uid 3782); 5 Jan 2009 18:18:20 -0000 Received: from acm.muc.de (pD9E515A5.dip.t-dialin.net [217.229.21.165]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 05 Jan 2009 19:18:17 +0100 Received: (qmail 9486 invoked by uid 1000); 5 Jan 2009 18:35:02 -0000 Date: Mon, 5 Jan 2009 18:35:02 +0000 To: Teemu Likonen , 1756@debbugs.gnu.org Cc: bug-gnu-emacs@gnu.org Subject: Re: bug#1756: awk-mode: An empty line is not a paragraph separator (should be) Message-ID: <20090105183502.GC2501@muc.de> References: <87sko35t3u.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sko35t3u.fsf@iki.fi> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hi again, Teemu! On Thu, Jan 01, 2009 at 10:27:17AM +0200, Teemu Likonen wrote: [ .... ] > There is another and related bug. It is possible to configure the > comment prefix regexp with the option c-comment-prefix-regexp. But the > problem is that the option only takes effect when awk-mode is turned > on. If user later changes indentation style with the command > c-set-style (bound to C-c .) then it seems that the hard-coded default > (#+) takes preference over user's c-comment-prefix-regexp settings. 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 , M-: paragraph-start gave me "[ \t]*\\(#*\\)[ \t]*$\\|^\f" ^^ which has incorporated the new value from c-comment-prefix-regexp. -- Alan Mackenzie (Nuremberg, Germany). From tlikonen@iki.fi Mon Jan 5 10:40:00 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 5 Jan 2009 18:40:00 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 n05IdvpF026507 for ; Mon, 5 Jan 2009 10:39:58 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJuMn-0000mt-2Y for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 13:39:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJuMk-0000iw-Mi for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 13:39:56 -0500 Received: from [199.232.76.173] (port=42956 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJuMk-0000it-Gc for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 13:39:54 -0500 Received: from mta-out.inet.fi ([195.156.147.13]:57433 helo=jenni2.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJuMj-0001VZ-Vk for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 13:39:54 -0500 Received: from mithlond.arda.local (80.220.180.181) by jenni2.inet.fi (8.5.014) id 48FC5A880355BC94; Mon, 5 Jan 2009 20:38:52 +0200 Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1LJuKz-0003Mz-9K; Mon, 05 Jan 2009 20:38:05 +0200 To: Alan Mackenzie Cc: 1756@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#1756: awk-mode: An empty line is not a paragraph separator (should be) In-Reply-To: <20090105183502.GC2501@muc.de> (Alan Mackenzie's message of "Mon\, 5 Jan 2009 18\:35\:02 +0000") References: <87sko35t3u.fsf@iki.fi> <20090105183502.GC2501@muc.de> From: Teemu Likonen Date: Mon, 05 Jan 2009 20:38:05 +0200 Message-ID: <87hc4dbnua.fsf@iki.fi> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-CrossAssassin-Score: 2 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 > > , 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" After "C-c . awk RET" it changes to this: "[ \t]*\\(\\(#+\\)[ \t]*\\)?$\\|^\f" Even though I chose to override the style settings "#*" changes to "#+". I have your previous patch applied so there is this additional subexpression level "\(...\)?" too. From acm@muc.de Tue Jan 6 07:59:05 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Jan 2009 15:59:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 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 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 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 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 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 Received: (qmail 60396 invoked by uid 3782); 6 Jan 2009 15:58:55 -0000 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 Received: (qmail 7309 invoked by uid 1000); 6 Jan 2009 16:15:41 -0000 Date: Tue, 6 Jan 2009 16:15:41 +0000 To: Teemu Likonen Cc: 1756@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#1756: awk-mode: An empty line is not a paragraph separator (should be) Message-ID: <20090106161541.GB5612@muc.de> Reply-To: bug-cc-mode@gnu.org References: <87sko35t3u.fsf@iki.fi> <20090105183502.GC2501@muc.de> <87hc4dbnua.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87hc4dbnua.fsf@iki.fi> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-CrossAssassin-Score: 2 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). From tlikonen@iki.fi Wed Jan 7 08:33:24 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 7 Jan 2009 16:33:24 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 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 n07GXL3v011502 for ; Wed, 7 Jan 2009 08:33:22 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKbLM-00033I-5z for bug-gnu-emacs@gnu.org; Wed, 07 Jan 2009 11:33:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKbLK-00030Z-0A for bug-gnu-emacs@gnu.org; Wed, 07 Jan 2009 11:33:19 -0500 Received: from [199.232.76.173] (port=57473 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKbLJ-00030E-RD for bug-gnu-emacs@gnu.org; Wed, 07 Jan 2009 11:33:17 -0500 Received: from mta-out.inet.fi ([195.156.147.13]:36515 helo=jenni2.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKbLG-0005W3-Ut; Wed, 07 Jan 2009 11:33:15 -0500 Received: from mithlond.arda.local (80.220.180.181) by jenni2.inet.fi (8.5.014) id 48FC5A88036C4565; Wed, 7 Jan 2009 18:32:59 +0200 Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1LKbKy-00041i-KR; Wed, 07 Jan 2009 18:32:56 +0200 To: bug-cc-mode@gnu.org Cc: 1756@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#1756: awk-mode: An empty line is not a paragraph separator (should be) In-Reply-To: <20090106161541.GB5612@muc.de> (Alan Mackenzie's message of "Tue\, 6 Jan 2009 16\:15\:41 +0000") References: <87sko35t3u.fsf@iki.fi> <20090105183502.GC2501@muc.de> <87hc4dbnua.fsf@iki.fi> <20090106161541.GB5612@muc.de> From: Teemu Likonen Date: Wed, 07 Jan 2009 18:32:56 +0200 Message-ID: <87fxjvt6tj.fsf@iki.fi> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-CrossAssassin-Score: 2 Alan Mackenzie (2009-01-06 16:15 +0000) wrote: >> 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. Well, I asked that, but I had also explicitly asked to override style settings (through the customize interface). My opinion is that the current behavior is so confusing that it's either a bug or simply wrong design decision. I don't mean to complain too loudly, though. See below. > I am guessing that the cause is in the fine CC Mode manual, [...] > [...] 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? Well, my real opinion first: User's explicit "override style settings" setting should just do that: override style settings no matter what style changes the user does while editing the buffer. For example, user may want to choose certain custom comment prefix settings and, while editing the code, she may want to experiment with different style settings or convert the code from one style to another. Logically, if she wants to get comment prefix settings from a pre-defined style she chooses "Use style settings" (c-comment-prefix-regexp). If she wants to use her own comment prefix she chooses "Override style settings". I think this is the most intuitive behaviour. Currently user can only override style settings for the initial style state. But if you choose to maintain the current behaviour anyway, then I'd say that the changes you suggested for the documentation are very good. I'd also suggest to change the documentation of c-comment-prefix-regexp variable so that it tells how the variable effects in the practice. Anyway, the empty-line bug is the main thing. If that bug in Awk mode gets fixed (you already did with that patch) then there shouldn't be much need for changing comment prefixes in the first place. So I'm really more on the "thank you" side than on "complaining" side. :-) From acm@muc.de Thu Jan 8 08:09:06 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Jan 2009 16:09:06 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 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 n08G93UU013533 for ; Thu, 8 Jan 2009 08:09:04 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKxRO-0002G8-On for bug-gnu-emacs@gnu.org; Thu, 08 Jan 2009 11:09:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKxRO-0002Ft-5h for bug-gnu-emacs@gnu.org; Thu, 08 Jan 2009 11:09:02 -0500 Received: from [199.232.76.173] (port=60242 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKxRN-0002Fg-P8 for bug-gnu-emacs@gnu.org; Thu, 08 Jan 2009 11:09:01 -0500 Received: from colin.muc.de ([193.149.48.1]:3185 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 1LKxRM-0006qn-Aa for bug-gnu-emacs@gnu.org; Thu, 08 Jan 2009 11:09:00 -0500 Received: (qmail 67169 invoked by uid 3782); 8 Jan 2009 16:08:57 -0000 Received: from acm.muc.de (pD9E23A4C.dip.t-dialin.net [217.226.58.76]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 08 Jan 2009 17:08:48 +0100 Received: (qmail 8194 invoked by uid 1000); 8 Jan 2009 16:25:51 -0000 Date: Thu, 8 Jan 2009 16:25:51 +0000 To: Teemu Likonen Cc: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org, 1756@debbugs.gnu.org Subject: Re: bug#1756: awk-mode: An empty line is not a paragraph separator (should be) Message-ID: <20090108162551.GB5284@muc.de> References: <87sko35t3u.fsf@iki.fi> <20090105183502.GC2501@muc.de> <87hc4dbnua.fsf@iki.fi> <20090106161541.GB5612@muc.de> <87fxjvt6tj.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fxjvt6tj.fsf@iki.fi> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-CrossAssassin-Score: 2 Hi, Teemu, On Wed, Jan 07, 2009 at 06:32:56PM +0200, Teemu Likonen wrote: > Alan Mackenzie (2009-01-06 16:15 +0000) wrote: > >> 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. > Well, I asked that, but I had also explicitly asked to override style > settings (through the customize interface). My opinion is that the > current behavior is so confusing that it's either a bug or simply wrong > design decision. It's very confusing. I get confused, even though I maintain it and I wrote the bit of the manual that describes it. I honestly believe the current functionality is "over-engineered", simply too feature-rich for the job it does. However, it's there and (?lots of) people would complain loudly if any features were abolished. The style-variables each have a global default, a value in the current style and a buffer local value in each buffer (which could be either of the two previous values). In turn, the style is either an explicitly selected style or the default style. Additionally, this all interacts with the customisation facility, which has no notion of buffer local variables. I admit, starting from scratch, nobody would design it this way. The other thing, I don't think it matters too much exactly how the style system works. What is bad is when it confuses people, or creates expectations which won't be satisfied. (See below.) > I don't mean to complain too loudly, though. See below. Complaining loudly is OK on this mailing list. :-) > > I am guessing that the cause is in the fine CC Mode manual, [...] > > [...] 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? > Well, my real opinion first: User's explicit "override style settings" > setting should just do that: override style settings no matter what > style changes the user does while editing the buffer. OK, this is the text in the M-x customize-variable screen. > For example, user may want to choose certain custom comment prefix > settings and, while editing the code, she may want to experiment with > different style settings or convert the code from one style to another. > Logically, if she wants to get comment prefix settings from a > pre-defined style she chooses "Use style settings" > (c-comment-prefix-regexp). If she wants to use her own comment prefix > she chooses "Override style settings". I think this is the most > intuitive behaviour. Currently user can only override style settings > for the initial style state. This could be implemented in `c-set-style', [by looking at the global value of c-comment-prefix-regexp, and using this value rather than the style's value if the global value isn't 'set-from-style]. Feel free to ignore the bit in the brackets if it doesn't make much sense! But this would mean that c-set-style would not do exactly what it says. With all due respect, I think this would be at least as un-intuitive as the current mechanism. Of course, I could create a new option saying which of these is to be preferred, but that would add even more confusion into the mix. > But if you choose to maintain the current behaviour anyway, then I'd say > that the changes you suggested for the documentation are very good. I'd > also suggest to change the documentation of c-comment-prefix-regexp > variable so that it tells how the variable effects in the practice. Agreed. This also applies to the other style variables. What I think is buggy at the moment is that: o - `customize-variable' doesn't say "Global default value" anywhere. o - "Override style settings" is confusing. Maybe "Set explicit value" would be better. > Anyway, the empty-line bug is the main thing. If that bug in Awk mode > gets fixed (you already did with that patch) then there shouldn't be > much need for changing comment prefixes in the first place. So I'm > really more on the "thank you" side than on "complaining" side. :-) Cheers! I've committed the patch to the Emacs repostory (which will become the future Emacs-23). But it would still be nice to get `customize-variable' working nicely with CC Mode. -- Alan Mackenzie (Nuremberg, Germany). From rgm@gnu.org Thu Jan 15 15:38:28 2009 Received: (at control) by emacsbugs.donarmstrong.com; 15 Jan 2009 23:38:28 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: ** X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=2.3 required=4.0 tests=MISSING_SUBJECT,NOSUBJECT, VALID_BTS_CONTROL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0FNcPDO030885 for ; Thu, 15 Jan 2009 15:38:27 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LNblm-0003kP-P8; Thu, 15 Jan 2009 18:37:02 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18799.51358.725326.185170@fencepost.gnu.org> Date: Thu, 15 Jan 2009 18:37:02 -0500 From: Glenn Morris To: control severity 1305 wishlist severity 1303 minor severity 1250 minor severity 1367 wishlist severity 1405 minor severity 1457 wishlist severity 1555 minor severity 1569 minor severity 1688 minor close 1705 severity 1731 minor close 1756 severity 1768 minor severity 1779 minor tags 1798 moreinfo reassign 1860 notemacs reassign 1902 emacs,ns reassign 1924 spam reassign 1926 notemacs stop From unknown Mon Aug 18 17:58:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Fri, 13 Feb 2009 15:24:11 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator