emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog add-log.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog add-log.el
Date: Tue, 22 Sep 2009 15:39:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/09/22 15:39:06

Modified files:
        lisp           : ChangeLog add-log.el 

Log message:
        (change-log-fill-forward-paragraph): New function.
        (change-log-mode): Use it so fill-region DTRT.
        Set fill-indent-according-to-mode here rather than in
        change-log-fill-paragraph.
        (change-log-fill-paragraph): Remove.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16231&r2=1.16232
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/add-log.el?cvsroot=emacs&r1=1.230&r2=1.231

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16231
retrieving revision 1.16232
diff -u -b -r1.16231 -r1.16232
--- ChangeLog   22 Sep 2009 08:44:16 -0000      1.16231
+++ ChangeLog   22 Sep 2009 15:39:02 -0000      1.16232
@@ -1,3 +1,11 @@
+2009-09-22  Stefan Monnier  <address@hidden>
+
+       * add-log.el (change-log-fill-forward-paragraph): New function.
+       (change-log-mode): Use it so fill-region DTRT.
+       Set fill-indent-according-to-mode here rather than in
+       change-log-fill-paragraph.
+       (change-log-fill-paragraph): Remove.
+
 2009-09-22  Juanma Barranquero  <address@hidden>
 
        * info.el (Info-try-follow-nearest-node): Use the URL extracted by

Index: add-log.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/add-log.el,v
retrieving revision 1.230
retrieving revision 1.231
diff -u -b -r1.230 -r1.231
--- add-log.el  1 Sep 2009 07:24:18 -0000       1.230
+++ add-log.el  22 Sep 2009 15:39:06 -0000      1.231
@@ -1029,8 +1029,10 @@
        indent-tabs-mode t
        tab-width 8
        show-trailing-whitespace t)
-  (set (make-local-variable 'fill-paragraph-function)
-       'change-log-fill-paragraph)
+  (set (make-local-variable 'fill-forward-paragraph-function)
+       'change-log-fill-forward-paragraph)
+  ;; Make sure we call `change-log-indent' when filling.
+  (set (make-local-variable 'fill-indent-according-to-mode) t)
   ;; Avoid that filling leaves behind a single "*" on a line.
   (add-hook 'fill-nobreak-predicate
            '(lambda ()
@@ -1086,23 +1088,12 @@
        (cadr (member (file-name-nondirectory (buffer-file-name buffer))
                     files))))))
 
-;; It might be nice to have a general feature to replace this.  The idea I
-;; have is a variable giving a regexp matching text which should not be
-;; moved from bol by filling.  change-log-mode would set this to "^\\s *\\s(".
-;; But I don't feel up to implementing that today.
-(defun change-log-fill-paragraph (&optional justify)
-  "Fill the paragraph, but preserve open parentheses at beginning of lines.
-Prefix arg means justify as well."
-  (interactive "P")
-  (let ((end (progn (forward-paragraph) (point)))
-       (beg (progn (backward-paragraph) (point)))
-       ;; Add lines starting with whitespace followed by a left paren or an
+(defun change-log-fill-forward-paragraph (n)
+  "Cut paragraphs so filling preserves open parentheses at beginning of lines."
+  (let (;; Add lines starting with whitespace followed by a left paren or an
        ;; 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))
+       (paragraph-start (concat paragraph-start "\\|\\s *\\(?:\\s(\\|\\*\\)")))
+    (forward-paragraph n)))
 
 (defcustom add-log-current-defun-header-regexp
   "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]