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#385: [PATCH] comment-indent doesn't respect comment-indent-function Date: Wed, 11 Jun 2008 14:04:57 -0400 Message-ID: References: <20080611171102.7261.qmail@byte.local> Reply-To: Stefan Monnier , 385@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 1213208873 3446 80.91.229.12 (11 Jun 2008 18:27:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 18:27:53 +0000 (UTC) Cc: 385@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org To: "Christopher J. Madsen" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 11 20:28:34 2008 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 1K6V3g-0005Rj-8B for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jun 2008 20:28:32 +0200 Original-Received: from localhost ([127.0.0.1]:37712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6V2s-0000c9-N3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jun 2008 14:27:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6V2N-0000K5-EY for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:27:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6V2L-0000JM-NU for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:27:11 -0400 Original-Received: from [199.232.76.173] (port=38284 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6V2L-0000JF-J7 for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:27:09 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:50699) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K6V2L-0005vl-I0 for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:27:09 -0400 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 m5BIR7wG018618; Wed, 11 Jun 2008 11:27:07 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m5BIF3A7015222; Wed, 11 Jun 2008 11:15:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 11 Jun 2008 18:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 385 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121320751613506 (code B ref -1); Wed, 11 Jun 2008 18:15:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 11 Jun 2008 18:05:16 +0000 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 m5BI5CEv013352 for ; Wed, 11 Jun 2008 11:05:14 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6Uh6-0004LX-E5 for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:05:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6Uh5-0004L9-R0 for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:05:12 -0400 Original-Received: from [199.232.76.173] (port=49404 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6Uh5-0004Kw-KP for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:05:11 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:48451) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K6Uh5-0002QT-JO for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:05:11 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id EBD712CFE75; Wed, 11 Jun 2008 14:05:10 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id CE2E03FE1; Wed, 11 Jun 2008 14:04:57 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id B370841BEC; Wed, 11 Jun 2008 14:04:57 -0400 (EDT) In-Reply-To: <20080611171102.7261.qmail@byte.local> (Christopher J. Madsen's message of "11 Jun 2008 17:11:02 -0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-CrossAssassin-Score: 2 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Wed, 11 Jun 2008 14:27:11 -0400 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:18333 Archived-At: > It appears that comment-indent changed in 22.1. It gained some code Indeed, and it changed further in 22.2. > to attempt to align the comment with those on surrounding lines. > Unfortunately, this made it impossible to do certain things with > comment-indent-function. > For example, I had a custom indent function that placed comments > immediately after a closing brace. However, in Emacs 22, I'd see this: > while (1) { > while (2) { > } # end 2 <-- this comment placed correctly > } # end 1 <-- this comment was aligned with the previous one > instead of this: > while (1) { > while (2) { > } # end 2 > } # end 1 <-- here's where comment-indent-function placed it I'm not sure I understand. Are you saying that you don't want comments to be aligned in that case? If you need more control over the placement, rather than a variable comment-indent-fixed, maybe we should just say that if comment-indent-function returns a list of a single integer, it should be taken as the indentation position and not second-guessed. Or it could return a cons cell (MIN . MAX) to say "anywhere between MIN and MAX". Stefan