From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: adaptive-fill-mode and auto-fill-mode Date: Mon, 09 Oct 2006 12:45:34 -0400 Message-ID: References: <4527F569.2030007@gmx.at> <4528D303.3080903@gmx.at> <45294B77.5030202@gmx.at> <452A4213.8080106@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1160412443 25416 80.91.229.2 (9 Oct 2006 16:47:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Oct 2006 16:47:23 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 09 18:47:16 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GWyGF-0004G0-7p for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2006 18:45:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GWyGE-0006mc-Oa for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2006 12:45:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GWyG4-0006lo-Dk for emacs-devel@gnu.org; Mon, 09 Oct 2006 12:45:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GWyG2-0006l3-T3 for emacs-devel@gnu.org; Mon, 09 Oct 2006 12:45:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GWyG2-0006km-OQ for emacs-devel@gnu.org; Mon, 09 Oct 2006 12:45:38 -0400 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GWyNb-0001QB-BG for emacs-devel@gnu.org; Mon, 09 Oct 2006 12:53:27 -0400 Original-Received: from pastel.home ([70.53.194.105]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20061009164535.VCKC13653.tomts36-srv.bellnexxia.net@pastel.home> for ; Mon, 9 Oct 2006 12:45:35 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D3D3280A8; Mon, 9 Oct 2006 12:45:34 -0400 (EDT) Original-To: martin rudalics In-Reply-To: <452A4213.8080106@gmx.at> (martin rudalics's message of "Mon\, 09 Oct 2006 14\:35\:31 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60547 Archived-At: >>> I fail to understand you here. If the comment at compos doesn't match >>> the prefix why should I want to insert the prefix on the next line? >> Why not? > Your own patch might impede you. If you manually change the > comment-start sequence at compos or the whitespace preceding it, the > prefix won't match the comment at compos any more and hence won't be > used. I'm not sure what you're referring to. Of course, if the comment-start is different, I want to reject the prefix, and if the leading whitespace is of different length, I also want to reject it. Both of these are pretty clear signs that the prefix was built from some other unrelated comment. Of course, one can never be sure, but one has to guess. > ! (save-excursion > ! (goto-char compos) > ! ;; The comstart marker is the same. > ! (and (looking-at comment-start-skip) > ! (string-equal > ! prefix-comstart > ! (comment-string-strip (match-string 0) nil t)) AFAICT this is the only spot where you changed my suggested code. What was the scenario where this change is needed? BTW comment-start-skip can't be used like that in `looking-at' because it may need to match some chars *before* the actual comment start. This is typically the case when it starts with "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)" as in elisp. So you need to either narrow so as to pretend that compos is at BOL, or match from BOL and prepend something like ".*". Instead I just did (looking-at (regexp-quote prefix-comstart)) which I thought should work just as well. Stefan