From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#7509: 24.0.50; doc for `comment-style' and `comment-styles' Date: Fri, 03 Dec 2010 18:16:24 -0500 Message-ID: References: <9166F5772B0D414D84ECE3808ECD3964@us.oracle.com> <27E6B536A09248629C372671995E7E97@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291419929 11299 80.91.229.12 (3 Dec 2010 23:45:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Dec 2010 23:45:29 +0000 (UTC) Cc: 7509@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 04 00:45:24 2010 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.69) (envelope-from ) id 1POfJb-0001jv-5o for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Dec 2010 00:45:23 +0100 Original-Received: from localhost ([127.0.0.1]:56605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POfJa-0006Jb-IL for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Dec 2010 18:45:22 -0500 Original-Received: from [140.186.70.92] (port=52984 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POfJT-0006Ip-BP for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2010 18:45:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POfJS-000675-1A for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2010 18:45:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POfJR-00066z-UM for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2010 18:45:13 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1POemM-0005sy-Cz; Fri, 03 Dec 2010 18:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Dec 2010 23:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7509 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7509-submit@debbugs.gnu.org id=B7509.129141784422599 (code B ref 7509); Fri, 03 Dec 2010 23:11:02 +0000 Original-Received: (at 7509) by debbugs.gnu.org; 3 Dec 2010 23:10:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1POem4-0005sS-5A for submit@debbugs.gnu.org; Fri, 03 Dec 2010 18:10:44 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1POem2-0005sF-55 for 7509@debbugs.gnu.org; Fri, 03 Dec 2010 18:10:42 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id oB3NGPCM004371; Fri, 3 Dec 2010 18:16:25 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id BBBE3A8364; Fri, 3 Dec 2010 18:16:24 -0500 (EST) In-Reply-To: (Drew Adams's message of "Tue, 30 Nov 2010 20:10:36 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3698=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 03 Dec 2010 18:11:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org 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:42132 Archived-At: > You're welcome. Thanks for making the changes. I've installed the patch below, which I hope addresses your concerns without offending my sense of modularity. Stefan --- lisp/newcomment.el 2010-10-21 20:12:38 +0000 +++ lisp/newcomment.el 2010-12-03 23:11:10 +0000 @@ -187,21 +187,58 @@ it is 1 so that regions are commented with two or three semi-colons.") (defconst comment-styles - '((plain . (nil nil nil nil)) - (indent . (nil nil nil t)) - (indent-or-triple - . (nil nil nil multi-char)) - (aligned . (nil t nil t)) - (multi-line . (t nil nil t)) - (extra-line . (t nil t t)) - (box . (nil t t t)) - (box-multi . (t t t t))) - "Comment region styles of the form (STYLE . (MULTI ALIGN EXTRA INDENT)). + '((plain nil nil nil nil + "Start in column 0 (do not indent), as in Emacs-20") + (indent-or-triple nil nil nil multi-char + "Start in column 0, but only for single-char starters") + (indent nil nil nil t + "Full comment per line, ends not aligned") + (aligned nil t nil t + "Full comment per line, ends aligned") + (box nil t t t + "Full comment per line, ends aligned, + top and bottom") + (extra-line t nil t t + "One comment for all lines, end on a line by itself") + (multi-line t nil nil t + "One comment for all lines, end on last commented line") + (box-multi t t t t + "One comment for all lines, + top and bottom")) + "Comment region style definitions. +Each style is defined with a form (STYLE . (MULTI ALIGN EXTRA INDENT DOC)). +DOC should succinctly describe the style. STYLE should be a mnemonic symbol. MULTI specifies that comments are allowed to span multiple lines. + e.g. in C it comments regions as + /* blabla + * bli */ + rather than + /* blabla */ + /* bli */ + if `comment-end' is empty, this has no effect. + ALIGN specifies that the `comment-end' markers should be aligned. + e.g. in C it comments regions as + /* blabla */ + /* bli */ + rather than + /* blabla */ + /* bli */ + if `comment-end' is empty, this has no effect, unless EXTRA is also set, + in which case the comment gets wrapped in a box. + EXTRA specifies that an extra line should be used before and after the region to comment (to put the `comment-end' and `comment-start'). + e.g. in C it comments regions as + /* + * blabla + * bli + */ + rather than + /* blabla + * bli */ + if the comment style is not multi line, this has no effect, unless ALIGN + is also set, in which case the comment gets wrapped in a box. + INDENT specifies that the `comment-start' markers should not be put at the left margin but at the current indentation of the region to comment. If INDENT is `multi-char', that means indent multi-character @@ -212,7 +249,10 @@ "Style to be used for `comment-region'. See `comment-styles' for a list of available styles." :type (if (boundp 'comment-styles) - `(choice ,@(mapcar (lambda (s) `(const ,(car s))) + `(choice + ,@(mapcar (lambda (s) + `(const :tag ,(format "%s: %s" (car s) (nth 5 s)) + ,(car s))) comment-styles)) 'symbol) :version "23.1"