From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: add-change-log-entry
Date: Sat, 21 Jul 2007 11:09:27 +0200 [thread overview]
Message-ID: <46A1CD47.7070802@gmx.at> (raw)
In-Reply-To: <jwvfy3jys91.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
Stefan Monnier wrote:
> Please move it into its own function and then call it from there.
Look at the attached patch (maybe you wanted to suggest a better name).
BTW, may I defvar c-beginning-of-defun and c-end-of-defun here, they
are driving me mad.
Richard Stallman wrote:
> This is a better way to write the big comment:
Applied.
[-- Attachment #2: add-log.patch --]
[-- Type: text/plain, Size: 2365 bytes --]
*** add-log.el Sat Jul 21 10:16:58 2007
--- add-log.el Sat Jul 21 10:45:10 2007
***************
*** 659,667 ****
--- 659,703 ----
(add-change-log-entry whoami file-name t))
;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
+
(defvar change-log-indent-text 0)
+ (defun change-log-fill-parenthesized-list ()
+ ;; Fill parenthesized lists of names according to GNU standards.
+ ;; * file-name.ext (very-long-foo, very-long-bar, very-long-foobar):
+ ;; should be filled as
+ ;; * file-name.ext (very-long-foo, very-long-bar)
+ ;; (very-long-foobar):
+ (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.
+ (= (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)))))
+
(defun change-log-indent ()
+ (change-log-fill-parenthesized-list)
(let* ((indent
(save-excursion
(beginning-of-line)
***************
*** 729,735 ****
(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))
\f
--- 765,775 ----
(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
! ;; 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))
\f
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2007-07-21 9:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-16 19:09 add-change-log-entry Paul Pogonyshev
2007-07-17 15:05 ` add-change-log-entry Richard Stallman
2007-07-18 9:02 ` add-change-log-entry martin rudalics
2007-07-18 13:54 ` add-change-log-entry Sam Steingold
2007-07-18 14:32 ` add-change-log-entry martin rudalics
2007-07-18 18:58 ` add-change-log-entry Stefan Monnier
2007-07-18 21:32 ` add-change-log-entry martin rudalics
2007-07-19 21:20 ` add-change-log-entry Richard Stallman
2007-07-20 8:27 ` add-change-log-entry martin rudalics
2007-07-20 16:07 ` add-change-log-entry Stefan Monnier
2007-07-21 9:09 ` martin rudalics [this message]
2007-07-22 1:49 ` add-change-log-entry Richard Stallman
2007-07-22 8:44 ` add-change-log-entry martin rudalics
2007-07-22 9:02 ` add-change-log-entry Andreas Schwab
2007-07-22 9:31 ` add-change-log-entry martin rudalics
2007-07-22 13:24 ` add-change-log-entry Alan Mackenzie
2007-07-22 21:00 ` add-change-log-entry martin rudalics
2007-07-23 3:22 ` add-change-log-entry Stefan Monnier
2007-07-23 4:28 ` add-change-log-entry Richard Stallman
2007-07-23 15:38 ` add-change-log-entry Alan Mackenzie
2007-07-23 22:31 ` add-change-log-entry Richard Stallman
2007-07-24 8:19 ` add-change-log-entry Alan Mackenzie
2007-07-19 12:23 ` add-change-log-entry Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46A1CD47.7070802@gmx.at \
--to=rudalics@gmx.at \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).