From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: add-change-log-entry Date: Fri, 20 Jul 2007 10:27:44 +0200 Message-ID: <46A07200.6010103@gmx.at> References: <200707162209.30895.pogonyshev@gmx.net> <469DD72C.1080909@gmx.at> <469E1BAA.8090407@gnu.org> <469E248F.1050604@gmx.at> <469E8702.5000204@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020007020602000302060800" X-Trace: sea.gmane.org 1184920301 5290 80.91.229.12 (20 Jul 2007 08:31:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Jul 2007 08:31:41 +0000 (UTC) Cc: sds@gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 20 10:31:39 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IBnti-0006aN-QR for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2007 10:31:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IBnti-0000iu-5b for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2007 04:31:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IBntd-0000gB-NR for emacs-devel@gnu.org; Fri, 20 Jul 2007 04:31:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IBntc-0000fz-UA for emacs-devel@gnu.org; Fri, 20 Jul 2007 04:31:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IBntc-0000fw-Qe for emacs-devel@gnu.org; Fri, 20 Jul 2007 04:31:32 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1IBntc-0000Uk-4X for emacs-devel@gnu.org; Fri, 20 Jul 2007 04:31:32 -0400 Original-Received: (qmail invoked by alias); 20 Jul 2007 08:31:31 -0000 Original-Received: from N806P020.adsl.highway.telekom.at (EHLO [62.47.44.180]) [62.47.44.180] by mail.gmx.net (mp033) with SMTP; 20 Jul 2007 10:31:31 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+rt0k+XharA9RuPA4BOwIxvcVsrGXtD+khrRkDhx 7cjTFDu5WJUESP User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:75158 Archived-At: This is a multi-part message in MIME format. --------------020007020602000302060800 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > It is not clean to make this work in font-lock mode only. Agreed. > It is worth a bit more complexity to make the code work in > all cases. And it is also more modular not to depend on > what font-lock does for this mode. I moved the stuff away from `after-change-functions' _and_ font-lock mode. Could people please try whether it works as intended. --------------020007020602000302060800 Content-Type: text/plain; name="add-log.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="add-log.patch" *** add-log.el Wed Jul 18 20:19:46 2007 --- add-log.el Fri Jul 20 10:26:14 2007 *************** *** 665,670 **** --- 665,713 ---- (defvar change-log-indent-text 0) =20 (defun change-log-indent () + ;; The following form is an attempt to split parenthesized lists + ;; correctly with (auto-)filling. For example, an overlong line + ;; + ;; * file-name.ext (very-long-foo, very-long-bar, very-long-foobar): + ;; + ;; should be now broken as + ;; + ;; * file-name.ext (very-long-foo, very-long-bar) + ;; (very-long-foobar): + ;; + ;; instead of + ;;=20 + ;; * file-name.ext (very-long-foo, very-long-bar, + ;; very-long-foobar): + ;; + ;; because fontification doesn't like the latter. + (save-excursion + (end-of-line 0) + (skip-chars-backward " \t") + (when (and (equal (char-before) ?\,) + (> (point) (1+ (point-min)))) + (condition-case nil + (when (save-excursion + (and (prog2 + (up-list -1) + (equal (char-after) ?\() + (skip-chars-backward " \t")) + (or (bolp) + ;; Skip everything but a whitespace or asterisk. + (and (not (zerop (skip-chars-backward "^ \t\n*"))) + (skip-chars-backward " \t") + ;; We want one asterisk here. + (=3D (skip-chars-backward "*") -1) + (skip-chars-backward " \t") + (bolp))))) + ;; Delete the comma. + (delete-char -1) + ;; Close list on previous line. + (insert ")") + (skip-chars-forward " \t\n") + ;; Start list on new line. + (insert-before-markers "(")) + (error nil)))) (let* ((indent (save-excursion (beginning-of-line) *************** *** 681,687 **** (pos (save-excursion (indent-line-to indent) (point)))) (if (> pos (point)) (goto-char pos)))) =20 -=20 (defvar smerge-resolve-function) =20 ;;;###autoload --- 724,729 ---- *************** *** 732,738 **** (interactive "P") (let ((end (progn (forward-paragraph) (point))) (beg (progn (backward-paragraph) (point))) ! (paragraph-start (concat paragraph-start "\\|\\s *\\s("))) (fill-region beg end justify) t)) =0C --- 774,783 ---- (interactive "P") (let ((end (progn (forward-paragraph) (point))) (beg (progn (backward-paragraph) (point))) ! ;; Added lines starting with asterisk. ! (paragraph-start (concat paragraph-start "\\|\\s *\\(?:\\s(\\|\\*\\)")= ) ! ;; Make sure we call `change-log-indent'. ! (fill-indent-according-to-mode t)) (fill-region beg end justify) t)) =0C --------------020007020602000302060800 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------020007020602000302060800--