aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2007-07-22 08:32:16 +0000
committerMartin Rudalics2007-07-22 08:32:16 +0000
commit6dbf6147284c906f9d1c8ff7317ab5aabb4f9b82 (patch)
tree686deae43fd8efbafbfb3c5e097459d098623e21
parent178b8bafc21e226d1a81df50ec50616a04fb93a1 (diff)
downloademacs-6dbf6147284c906f9d1c8ff7317ab5aabb4f9b82.tar.gz
emacs-6dbf6147284c906f9d1c8ff7317ab5aabb4f9b82.zip
(change-log-fill-parenthesized-list): New function.
(change-log-indent): Call change-log-fill-parenthesized-list. (change-log-fill-paragraph): Bind fill-indent-according-to-mode to t. Have lines with leading asterisk start a paragraph.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/add-log.el42
-rw-r--r--src/ChangeLog5
3 files changed, 48 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c0748aa82c1..3548af3cc9c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12007-07-22 Martin Rudalics <rudalics@gmx.at>
2
3 * add-log.el (change-log-fill-parenthesized-list): New function.
4 (change-log-indent): Call change-log-fill-parenthesized-list.
5 (change-log-fill-paragraph): Bind fill-indent-according-to-mode to
6 t. Have lines with leading asterisk start a paragraph.
7
12007-07-21 Jay Belanger <jay.p.belanger@gmail.com> 82007-07-21 Jay Belanger <jay.p.belanger@gmail.com>
2 9
3 * calc/calc-math.el (math-emacs-precision) 10 * calc/calc-math.el (math-emacs-precision)
diff --git a/lisp/add-log.el b/lisp/add-log.el
index caea921d25f..906e747cac5 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -659,9 +659,45 @@ the change log file in another window."
659 (add-change-log-entry whoami file-name t)) 659 (add-change-log-entry whoami file-name t))
660;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) 660;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
661 661
662
662(defvar change-log-indent-text 0) 663(defvar change-log-indent-text 0)
663 664
665(defun change-log-fill-parenthesized-list ()
666 ;; Fill parenthesized lists of names according to GNU standards.
667 ;; * file-name.ext (very-long-foo, very-long-bar, very-long-foobar):
668 ;; should be filled as
669 ;; * file-name.ext (very-long-foo, very-long-bar)
670 ;; (very-long-foobar):
671 (save-excursion
672 (end-of-line 0)
673 (skip-chars-backward " \t")
674 (when (and (equal (char-before) ?\,)
675 (> (point) (1+ (point-min))))
676 (condition-case nil
677 (when (save-excursion
678 (and (prog2
679 (up-list -1)
680 (equal (char-after) ?\()
681 (skip-chars-backward " \t"))
682 (or (bolp)
683 ;; Skip everything but a whitespace or asterisk.
684 (and (not (zerop (skip-chars-backward "^ \t\n*")))
685 (skip-chars-backward " \t")
686 ;; We want one asterisk here.
687 (= (skip-chars-backward "*") -1)
688 (skip-chars-backward " \t")
689 (bolp)))))
690 ;; Delete the comma.
691 (delete-char -1)
692 ;; Close list on previous line.
693 (insert ")")
694 (skip-chars-forward " \t\n")
695 ;; Start list on new line.
696 (insert-before-markers "("))
697 (error nil)))))
698
664(defun change-log-indent () 699(defun change-log-indent ()
700 (change-log-fill-parenthesized-list)
665 (let* ((indent 701 (let* ((indent
666 (save-excursion 702 (save-excursion
667 (beginning-of-line) 703 (beginning-of-line)
@@ -729,7 +765,11 @@ Prefix arg means justify as well."
729 (interactive "P") 765 (interactive "P")
730 (let ((end (progn (forward-paragraph) (point))) 766 (let ((end (progn (forward-paragraph) (point)))
731 (beg (progn (backward-paragraph) (point))) 767 (beg (progn (backward-paragraph) (point)))
732 (paragraph-start (concat paragraph-start "\\|\\s *\\s("))) 768 ;; Add lines starting with whitespace followed by a left paren or an
769 ;; asterisk.
770 (paragraph-start (concat paragraph-start "\\|\\s *\\(?:\\s(\\|\\*\\)"))
771 ;; Make sure we call `change-log-indent'.
772 (fill-indent-according-to-mode t))
733 (fill-region beg end justify) 773 (fill-region beg end justify)
734 t)) 774 t))
735 775
diff --git a/src/ChangeLog b/src/ChangeLog
index e2d1452a8df..2c14c0e8eaf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,3 @@
12007-07-19 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (top-level): Fix typo in final comment introduced
4 with last change.
5
62007-07-18 Richard Stallman <rms@gnu.org> 12007-07-18 Richard Stallman <rms@gnu.org>
7 2
8 * data.c (Fsetq_default): Doc fix. 3 * data.c (Fsetq_default): Doc fix.