where DEFUN... is a list of function names found in FILE."
(save-excursion
(goto-char (point-min))
- (let ((defuns nil)
- (hunk-end nil)
- (hunk-mismatch-files nil)
- (make-defun-context-follower
- (lambda (goline)
- (let ((eodefun nil)
- (defname nil))
- (list
- (lambda () ;; Check for end of current defun.
- (when (and eodefun
- (funcall goline)
- (>= (point) eodefun))
- (setq defname nil)
- (setq eodefun nil)))
- (lambda (&optional get-current) ;; Check for new defun.
- (if get-current
- defname
- (when-let* ((def (and (not eodefun)
- (funcall goline)
- (add-log-current-defun)))
- (eof (save-excursion (end-of-defun) (point))))
- (setq eodefun eof)
- (setq defname def)))))))))
+ (let* ((defuns nil)
+ (hunk-end nil)
+ (hunk-mismatch-files nil)
+ (make-defun-context-follower
+ (lambda (goline)
+ (let ((eodefun nil)
+ (defname nil))
+ (list
+ (lambda () ;; Check for end of current defun.
+ (when (and eodefun
+ (funcall goline)
+ (>= (point) eodefun))
+ (setq defname nil)
+ (setq eodefun nil)))
+ (lambda (&optional get-current) ;; Check for new defun.
+ (if get-current
+ defname
+ (when-let* ((def (and (not eodefun)
+ (funcall goline)
+ (add-log-current-defun)))
+ (eof (save-excursion
+ (condition-case ()
+ (progn (end-of-defun) (point))
+ (scan-error hunk-end)))))
+ (setq eodefun eof)
+ (setq defname def)))))))))
(while
;; Might need to skip over file headers between diff
;; hunks (e.g., "diff --git ..." etc).
functions. You can then add a description where needed, and use
\\[fill-paragraph] to join consecutive function names."
(interactive)
- (let* ((diff-buf nil)
- ;; Unfortunately, `log-edit-show-diff' doesn't have a NO-SHOW
- ;; option, so we try to work around it via display-buffer
- ;; machinery.
- (display-buffer-overriding-action
- `(,(lambda (buf alist)
- (setq diff-buf buf)
- (display-buffer-no-window buf alist))
- . ((allow-no-window . t)))))
- (change-log-insert-entries
- (with-current-buffer (progn (log-edit-show-diff) diff-buf)
- (diff-add-log-current-defuns)))))
+ (change-log-insert-entries
+ (with-current-buffer
+ (let* ((diff-buf nil)
+ ;; Unfortunately, `log-edit-show-diff' doesn't have a
+ ;; NO-SHOW option, so we try to work around it via
+ ;; display-buffer machinery.
+ (display-buffer-overriding-action
+ `(,(lambda (buf alist)
+ (setq diff-buf buf)
+ (display-buffer-no-window buf alist))
+ . ((allow-no-window . t)))))
+ (log-edit-show-diff)
+ diff-buf)
+ (diff-add-log-current-defuns))))
(defun log-edit-insert-changelog (&optional use-first)
"Insert a log message by looking at the ChangeLog.