From: martin rudalics <rudalics@gmx.at>
To: rms@gnu.org
Cc: sds@gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: add-change-log-entry
Date: Fri, 20 Jul 2007 10:27:44 +0200 [thread overview]
Message-ID: <46A07200.6010103@gmx.at> (raw)
In-Reply-To: <E1IBdQ0-0002nU-CI@fencepost.gnu.org>
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
> 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.
[-- Attachment #2: add-log.patch --]
[-- Type: text/plain, Size: 2590 bytes --]
*** 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)
(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
+ ;;
+ ;; * 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.
+ (= (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))))
-
(defvar smerge-resolve-function)
;;;###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))
\f
--- 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))
\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-20 8:27 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 ` martin rudalics [this message]
2007-07-20 16:07 ` add-change-log-entry Stefan Monnier
2007-07-21 9:09 ` add-change-log-entry martin rudalics
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46A07200.6010103@gmx.at \
--to=rudalics@gmx.at \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=rms@gnu.org \
--cc=sds@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.