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#11090: 24.0.94; Allow customization of inline-comment offset Date: Sun, 25 Mar 2012 14:41:27 -0400 Message-ID: References: <87ehsgmxm4.fsf@nzebook.haselwarter.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332700924 21844 80.91.229.3 (25 Mar 2012 18:42:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 25 Mar 2012 18:42:04 +0000 (UTC) Cc: 11090-done@debbugs.gnu.org To: Philipp Haselwarter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 25 20:42:03 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SBsOB-0002Ft-Co for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Mar 2012 20:42:03 +0200 Original-Received: from localhost ([::1]:45214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBsOA-0002ST-GP for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Mar 2012 14:42:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBsO7-0002S3-4f for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2012 14:42:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBsO5-0005FU-DB for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2012 14:41:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBsO5-0005Ep-9X for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2012 14:41:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SBss9-0001fn-UM for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2012 15:13:01 -0400 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Mar 2012 19:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 11090 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 11090@debbugs.gnu.org, monnier@iro.umontreal.ca Original-Received: via spool by 11090-done@debbugs.gnu.org id=D11090.13327027806414 (code D ref 11090); Sun, 25 Mar 2012 19:13:01 +0000 Original-Received: (at 11090-done) by debbugs.gnu.org; 25 Mar 2012 19:13:00 +0000 Original-Received: from localhost ([127.0.0.1]:38561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBss7-0001fJ-AA for submit@debbugs.gnu.org; Sun, 25 Mar 2012 15:12:59 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:62984) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBsrh-0001ej-GX for 11090-done@debbugs.gnu.org; Sun, 25 Mar 2012 15:12:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9FpYqr/2dsb2JhbACBX5x7eYhwnhmGGQSbGYQJ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="170026256" Original-Received: from 69-165-138-171.dsl.teksavvy.com (HELO pastel.home) ([69.165.138.171]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 25 Mar 2012 14:41:27 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 71D1A58F52; Sun, 25 Mar 2012 14:41:27 -0400 (EDT) In-Reply-To: <87ehsgmxm4.fsf@nzebook.haselwarter.org> (Philipp Haselwarter's message of "Sun, 25 Mar 2012 18:52:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58137 Archived-At: > The attached patch allows for `comment-indent' to configure that offset, > that is currently hard-coded to one space, by introducing the new > variable `comment-inline-offset'. I think it's a good idea, thank you. Installed in the `pending' branch, for 24.2. I also installed the following patch on top of it. Stefan === modified file 'lisp/newcomment.el' --- lisp/newcomment.el 2012-03-25 18:37:24 +0000 +++ lisp/newcomment.el 2012-03-25 18:38:46 +0000 @@ -268,7 +268,6 @@ :type '(choice string integer (const nil)) :group 'comment) -;;;###autoload (defcustom comment-inline-offset 1 "Inline comments have to be preceded by at least this many spaces. This is usefull when style-conventions require a certain minimal offset. @@ -598,7 +597,7 @@ (save-excursion (end-of-line) (current-column))))) (other nil) (min (save-excursion (skip-chars-backward " \t") - (1+ (current-column))))) + (+ comment-inline-offset (current-column))))) ;; Fix up the range. (if (< max min) (setq max min)) ;; Don't move past the fill column. @@ -698,7 +697,8 @@ (save-excursion (skip-chars-backward " \t") (unless (bolp) - (setq indent (max indent (+ (current-column) comment-inline-offset))))) + (setq indent (max indent + (+ (current-column) comment-inline-offset))))) ;; If that's different from comment's current position, change it. (unless (= (current-column) indent) (delete-region (point) (progn (skip-chars-backward " \t") (point)))