Ar an deichiú lá de mí Eanair, scríobh Didier Verna:
Norbert Koch <viteno(a)xemacs.org> wrote:
> 2011-01-08 Aidan Kehoe <kehoea(a)parhasard.net>
>
> * add-log.el (patch-to-change-log):
> Use defun*, not cl-parsing-keywords, now the latter is gone from
> 21.5. Isn't it a shame the diff command doesn't understand Lisp
> indentation.
what do you mean by that ?
I deleted a call to the macro cl-parsing-keywords, which wrapped most of a
function body. This also necessitated renaming some variables used within
the function body; so the diff without whitespace changes looked like the
below. The diff once the indentation had been corrected looked much as if I
had rewritten the entire function, which wasn’t a close reflection of what I
did.
(This isn’t directly Patcher’s issue, and a general solution to it would
probably go beyond Lisp, and would be included in the diff command. But I’m
not aware of any such general solution or any prospects of one.)
--- add-log.el 2009-02-09 16:44:17.000000000 +0000
+++ add-log.el 2011-01-11 12:38:29.000000000 +0000
@@ -1056,7 +1056,11 @@
(insert-buffer-substring other-buf start)))))))
;;;###autoload
-(defun patch-to-change-log (devdir &rest cl-keys)
+(defun* patch-to-change-log (devdir &key (my-email (or add-log-mailing-address
+ (user-mail-address)))
+ (my-name (or add-log-full-name (user-full-name)))
+ dry-run keep-source-files extent-property
+ extent-property-value)
"Convert the unified diff in the current buffer into a ChangeLog.
DEVDIR (queried interactively) specifies the directory the diff was
made relative to. The ChangeLog entries are added to the appropriate
@@ -1088,12 +1092,9 @@
specify a value for the extent property
(defaults to nil)."
(interactive "DBase directory of patch: ")
- (cl-parsing-keywords
- ((:my-name (or add-log-full-name (user-full-name)))
- (:my-email (or add-log-mailing-address (user-mail-address)))
-:dry-run :keep-source-files :extent-property :extent-property-value)
- ()
- (let* ((old-font-lock-auto-fontify font-lock-auto-fontify)
+ (let* ((my-name (or my-name add-log-full-name (user-full-name)))
+ (my-email (or my-email add-log-mailing-address (user-mail-address)))
+ (old-font-lock-auto-fontify font-lock-auto-fontify)
(font-lock-auto-fontify nil)
(file-re1 "^Index: \\([^\n]*\\)")
(file-re2 "^\\+\\+\\+ \\([^\t]*\\)")
@@ -1156,7 +1157,7 @@
(finish-up-change-log-buffer
()
(push change-log-buffer change-log-buffers)
- (unless cl-dry-run
+ (unless dry-run
(add-change-log-string "\n"))
(with-current-buffer change-log-buffer
(goto-char (point-min)))))
@@ -1192,16 +1193,16 @@
(find-change-log)))))
(setq change-log-directory
(with-current-buffer change-log-buffer default-directory))
- (unless cl-dry-run
- (when cl-extent-property
+ (unless dry-run
+ (when extent-property
(with-current-buffer change-log-buffer
(set-extent-properties
(make-extent (point-min) (point-min))
(list 'end-open nil
- cl-extent-property cl-extent-property-value))))
+ extent-property extent-property-value))))
(setq insertion-marker (point-min-marker change-log-buffer))
(add-change-log-string
- (format (concat "%s " cl-my-name " <" cl-my-email
+ (format (concat "%s " my-name " <" my-email
">\n\n")
(iso8601-time-string)))))
;; APA: Standardize on / in ChangeLog entry paths.
@@ -1209,7 +1210,7 @@
(setq basename
(file-relative-name absfile change-log-directory)))
;; now do each hunk in turn.
- (unless cl-dry-run
+ (unless dry-run
(while (re-search-forward hunk-re limit t)
(let* ((hunk-start-line (line-num))
(first-file-line (string-to-int (match-string 1)))
@@ -1339,7 +1340,7 @@
"\t* %s (%s):\n" "\t* %s:\n")
basename current-defun)))
trylines)
- (unless (or already-visiting-p cl-keep-source-files)
+ (unless (or already-visiting-p keep-source-files)
(kill-buffer (current-buffer))))))))
(flush-change-log-entries))
))
@@ -1347,7 +1348,7 @@
(if change-log-buffer
(finish-up-change-log-buffer))
;; return the list of ChangeLog buffers
- change-log-buffers))))
+ change-log-buffers)))
;;;###autoload
(defun change-log-redate ()
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta