From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Christopher J. Madsen" Newsgroups: gmane.emacs.bugs Subject: bug#385: [PATCH] comment-indent doesn't respect comment-indent-function Date: Wed, 11 Jun 2008 13:59:01 -0500 (CDT) Message-ID: <21310.75.39.61.37.1213210741.squirrel@cjm.myvnc.com> References: <20080611171102.7261.qmail@byte.local> Reply-To: "Christopher J. Madsen" , 385@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1213211271 11717 80.91.229.12 (11 Jun 2008 19:07:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 19:07:51 +0000 (UTC) Cc: 385@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org To: "Stefan Monnier" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 11 21:08:32 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 1K6VgK-0004eQ-Dy for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jun 2008 21:08:28 +0200 Original-Received: from localhost ([127.0.0.1]:45661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6VfW-0007J9-UH for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jun 2008 15:07:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6Vf5-0006pI-5g for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 15:07:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6Vf4-0006oQ-BH for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 15:07:10 -0400 Original-Received: from [199.232.76.173] (port=40008 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6Vf4-0006o0-4n for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 15:07:10 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:50933) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K6Vf3-0004dx-VI for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 15:07:10 -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 m5BJ77hM028770; Wed, 11 Jun 2008 12:07:07 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m5BJ55Kc027730; Wed, 11 Jun 2008 12:05:05 -0700 X-Loop: don@donarmstrong.com Resent-From: "Christopher J. Madsen" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 11 Jun 2008 19:05:05 +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.121321075525687 (code B ref -1); Wed, 11 Jun 2008 19:05:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 11 Jun 2008 18:59:15 +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 m5BIxAGj025678 for ; Wed, 11 Jun 2008 11:59:11 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6VXK-0001eQ-AB for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:59:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6VXJ-0001dH-4G for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:59:09 -0400 Original-Received: from [199.232.76.173] (port=40192 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6VXI-0001cz-PL for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:59:08 -0400 Original-Received: from a-sasl-quonix.sasl.smtp.pobox.com ([208.72.237.25]:62351 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K6VXI-00037Z-QU for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2008 14:59:08 -0400 Original-Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTP id B72253172 for ; Wed, 11 Jun 2008 14:59:04 -0400 (EDT) Original-Received: from orthanc.cjmweb.net (cpe-24-175-86-179.tx.res.rr.com [24.175.86.179]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 7A3B03171 for ; Wed, 11 Jun 2008 14:59:02 -0400 (EDT) Original-Received: (qmail 8228 invoked from network); 11 Jun 2008 18:59:01 -0000 Original-Received: from localhost (HELO cjm.myvnc.com) (127.0.0.1) by localhost with SMTP; 11 Jun 2008 18:59:01 -0000 Original-Received: from 75.39.61.37 (SquirrelMail authenticated user cjm) by cjm.myvnc.com with HTTP; Wed, 11 Jun 2008 13:59:01 -0500 (CDT) In-Reply-To: User-Agent: SquirrelMail/1.4.10a X-Priority: 3 (Normal) Importance: Normal X-Pobox-Relay-ID: 7648AFEC-37E8-11DD-8FDA-B8BFEAD4C077-09214675!a-sasl-quonix.pobox.com X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Wed, 11 Jun 2008 15:07:10 -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:18336 Archived-At: On Wed, June 11, 2008 1:04 pm, Stefan Monnier wrote: >> It appears that comment-indent changed in 22.1. It gained some code >> 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? Yes. I want the comment one space after the closing brace. Period. In Emacs 22, there's no way for the comment-indent-function to say "Put it here and don't second guess me." > 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 b= e > 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". I thought about something like that. The problem is that current version= s of Emacs would have no idea what to do with a return value that's not an integer. I use a variety of Emacs versions on a number of machines. The indent function would have to check emacs-version and change the return value accordingly. That's always a mess. The advantage of my approach is that you can use the same indent function on any version of Emacs. Older versions just won't pay any attention to comment-indent-fixed. Otherwise, I'd go with returning a list. --=20 Chris Madsen cjm cjmweb.net -------------------- http://www.cjmweb.net --------------------