Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 102135. ------------------------------------------------------------ revno: 102135 committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2010-10-28 06:37:35 +0000 message: gnus-art.el: Improve MIME part functions. gnus-art.el (gnus-article-jump-to-part): Error on no part; fix prompt. (gnus-mime-copy-part): Check coding system, not charset. (gnus-mime-view-part-externally): Never remove part. (gnus-mime-view-part-internally): Don't remove part here. (gnus-article-part-wrapper): Make sure MIME tag is visible. (gnus-article-goto-part): Go to displayed or preferred subpart if it is multipart/alternative. mm-decode.el (mm-display-part): Take optional arg `force'. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-27 22:08:36 +0000 +++ lisp/gnus/ChangeLog 2010-10-28 06:37:35 +0000 @@ -1,3 +1,15 @@ +2010-10-28 Katsumi Yamaoka + + * gnus-art.el (gnus-article-jump-to-part): Error on no part; fix prompt. + (gnus-mime-copy-part): Check coding system, not charset. + (gnus-mime-view-part-externally): Never remove part. + (gnus-mime-view-part-internally): Don't remove part here. + (gnus-article-part-wrapper): Make sure MIME tag is visible. + (gnus-article-goto-part): Go to displayed or preferred subpart if it is + multipart/alternative. + + * mm-decode.el (mm-display-part): Take optional arg `force'. + 2010-10-26 Julien Danjou * gnus-group.el (gnus-group-default-list-level): Add this function to === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-10-20 22:29:38 +0000 +++ lisp/gnus/gnus-art.el 2010-10-28 06:37:35 +0000 @@ -4811,11 +4811,17 @@ (defun gnus-article-jump-to-part (n) "Jump to MIME part N." (interactive "P") - (pop-to-buffer gnus-article-buffer) - ;; FIXME: why is it necessary? - (sit-for 0) - (let ((parts (length gnus-article-mime-handle-alist))) - (or n (setq n (read-number (format "Jump to part (2..%s): " parts)))) + (let ((parts (with-current-buffer gnus-article-buffer + (length gnus-article-mime-handle-alist)))) + (when (zerop parts) + (error "No such part")) + (pop-to-buffer gnus-article-buffer) + ;; FIXME: why is it necessary? + (sit-for 0) + (or n + (setq n (if (= parts 1) + 1 + (read-number (format "Jump to part (1..%s): " parts))))) (unless (and (integerp n) (<= n parts) (>= n 1)) (setq n (progn @@ -5115,7 +5121,7 @@ (if (or coding-system (and charset (setq coding-system (mm-charset-to-coding-system charset)) - (not (eq charset 'ascii)))) + (not (eq coding-system 'ascii)))) (progn (mm-enable-multibyte) (insert (mm-decode-coding-string contents coding-system)) @@ -5290,9 +5296,7 @@ (gnus-mime-view-part-as-type nil (lambda (type) (stringp (mailcap-mime-info type)))) (when handle - (if (mm-handle-undisplayer handle) - (mm-remove-part handle) - (mm-display-part handle)))))) + (mm-display-part handle nil t))))) (defun gnus-mime-view-part-internally (&optional handle) "View the MIME part under point with an internal viewer. @@ -5311,9 +5315,7 @@ (gnus-mime-view-part-as-type nil (lambda (type) (mm-inlinable-p handle type))) (when handle - (if (mm-handle-undisplayer handle) - (mm-remove-part handle) - (gnus-bind-safe-url-regexp (mm-display-part handle))))))) + (gnus-bind-safe-url-regexp (mm-display-part handle)))))) (defun gnus-mime-action-on-part (&optional action) "Do something with the MIME attachment at \(point\)." @@ -5376,6 +5378,10 @@ (when (gnus-article-goto-part n) ;; We point the cursor and the arrow at the MIME button ;; when the `function' prompt the user for something. + (unless (and (pos-visible-in-window-p) + (> (count-lines (point) (window-end)) + (/ (1- (window-height)) 3))) + (recenter (/ (1- (window-height)) 3))) (let ((cursor-in-non-selected-windows t) (overlay-arrow-string "=>") (overlay-arrow-position (point-marker))) @@ -5387,11 +5393,10 @@ (funcall function)) (interactive (call-interactively - function - (cdr (assq n gnus-article-mime-handle-alist)))) + function (get-text-property (point) 'gnus-data))) (t (funcall function - (cdr (assq n gnus-article-mime-handle-alist))))) + (get-text-property (point) 'gnus-data)))) (set-marker overlay-arrow-position nil) (unless gnus-auto-select-part (gnus-select-frame-set-input-focus frame) @@ -5556,7 +5561,35 @@ (defun gnus-article-goto-part (n) "Go to MIME part N." - (gnus-goto-char (text-property-any (point-min) (point-max) 'gnus-part n))) + (let ((start (text-property-any (point-min) (point-max) 'gnus-part n)) + part handle end next handles) + (when start + (goto-char start) + (if (setq handle (get-text-property start 'gnus-data)) + start + ;; Go to the displayed subpart, assuming this is multipart/alternative. + (setq part start + end (point-at-eol)) + (while (and (not handle) + part + (< part end) + (setq next (text-property-not-all part end + 'gnus-data nil))) + (setq part next + handle (get-text-property part 'gnus-data)) + (push (cons handle part) handles) + (unless (mm-handle-displayed-p handle) + (setq handle nil + part (text-property-any part end 'gnus-data nil)))) + (unless handle + ;; No subpart is displayed, so we find preferred one. + (setq part + (cdr (assq (mm-preferred-alternative + (nreverse (mapcar 'car handles))) + handles)))) + (if part + (goto-char (1+ part)) + start))))) (defun gnus-insert-mime-button (handle gnus-tmp-id &optional displayed) (let ((gnus-tmp-name === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2010-10-27 03:59:59 +0000 +++ lisp/gnus/mm-decode.el 2010-10-28 06:37:35 +0000 @@ -696,13 +696,14 @@ (autoload 'mailcap-parse-mailcaps "mailcap") (autoload 'mailcap-mime-info "mailcap") -(defun mm-display-part (handle &optional no-default) +(defun mm-display-part (handle &optional no-default force) "Display the MIME part represented by HANDLE. Returns nil if the part is removed; inline if displayed inline; external if displayed external." (save-excursion (mailcap-parse-mailcaps) - (if (mm-handle-displayed-p handle) + (if (and (not force) + (mm-handle-displayed-p handle)) (mm-remove-part handle) (let* ((ehandle (if (equal (mm-handle-media-type handle) "message/external-body") ------------------------------------------------------------ revno: 102134 committer: Glenn Morris branch nick: trunk timestamp: Wed 2010-10-27 20:49:40 -0700 message: * lisp/simple.el (x-selection-owner-p): Remove unused declaration. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-28 02:22:29 +0000 +++ lisp/ChangeLog 2010-10-28 03:49:40 +0000 @@ -1,3 +1,7 @@ +2010-10-28 Glenn Morris + + * simple.el (x-selection-owner-p): Remove unused declaration. + 2010-10-28 Stefan Monnier * minibuffer.el (completion-cycling): New var (bug#7266). === modified file 'lisp/simple.el' --- lisp/simple.el 2010-10-19 15:43:27 +0000 +++ lisp/simple.el 2010-10-28 03:49:40 +0000 @@ -3685,8 +3685,6 @@ (marker-position (mark-marker)) (signal 'mark-inactive nil))) -(declare-function x-selection-owner-p "xselect.c" (&optional selection)) - (defsubst deactivate-mark (&optional force) "Deactivate the mark by setting `mark-active' to nil. Unless FORCE is non-nil, this function does nothing if Transient @@ -6764,5 +6762,4 @@ (provide 'simple) -;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd ;;; simple.el ends here ------------------------------------------------------------ revno: 102133 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-10-27 22:22:29 -0400 message: * lisp/minibuffer.el (completion-cycling): New var. (minibuffer-complete, completion--do-completion): Use completion--flush-all-sorted-completions. (minibuffer-complete): Only cycle if completion-cycling is set. (completion--flush-all-sorted-completions): Unset completion-cycling. (minibuffer-force-complete): Set completion-cycling. (completion-all-sorted-completions): Move declaration before first use. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-28 01:30:01 +0000 +++ lisp/ChangeLog 2010-10-28 02:22:29 +0000 @@ -1,3 +1,13 @@ +2010-10-28 Stefan Monnier + + * minibuffer.el (completion-cycling): New var (bug#7266). + (minibuffer-complete, completion--do-completion): + Use completion--flush-all-sorted-completions. + (minibuffer-complete): Only cycle if completion-cycling is set. + (completion--flush-all-sorted-completions): Unset completion-cycling. + (minibuffer-force-complete): Set completion-cycling. + (completion-all-sorted-completions): Move declaration before first use. + 2010-10-28 Leo * iswitchb.el (iswitchb-kill-buffer): Avoid `iswitchb-make-buflist' === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2010-10-19 11:44:07 +0000 +++ lisp/minibuffer.el 2010-10-28 02:22:29 +0000 @@ -526,6 +526,10 @@ (const :tag "Always cycle" t) (integer :tag "Threshold"))) +(defvar completion-all-sorted-completions nil) +(make-variable-buffer-local 'completion-all-sorted-completions) +(defvar completion-cycling nil) + (defun completion--do-completion (&optional try-completion-function) "Do the completion and return a summary of what happened. M = completion was performed, the text was Modified. @@ -558,7 +562,7 @@ ((eq t comp) (minibuffer-hide-completions) (goto-char (field-end)) - (minibuffer--bitset nil nil t)) ;Exact and unique match. + (minibuffer--bitset nil nil t)) ;Exact and unique match. (t ;; `completed' should be t if some completion was done, which doesn't ;; include simply changing the case of the entered string. However, @@ -578,11 +582,11 @@ (forward-char (- comp-pos (length completion))) (if (not (or unchanged completed)) - ;; The case of the string changed, but that's all. We're not sure - ;; whether this is a unique completion or not, so try again using - ;; the real case (this shouldn't recurse again, because the next - ;; time try-completion will return either t or the exact string). - (completion--do-completion try-completion-function) + ;; The case of the string changed, but that's all. We're not sure + ;; whether this is a unique completion or not, so try again using + ;; the real case (this shouldn't recurse again, because the next + ;; time try-completion will return either t or the exact string). + (completion--do-completion try-completion-function) ;; It did find a match. Do we match some possibility exactly now? (let ((exact (test-completion completion @@ -605,35 +609,34 @@ "")) comp-pos))) (completion-all-sorted-completions)))) - (setq completion-all-sorted-completions nil) + (completion--flush-all-sorted-completions) (cond - ((and (not (ignore-errors + ((and (consp (cdr comps)) ;; There's something to cycle. + (not (ignore-errors ;; This signal an (intended) error if comps is too ;; short or if completion-cycle-threshold is t. - (consp (nthcdr completion-cycle-threshold comps)))) - ;; More than 1, so there's something to cycle. - (consp (cdr comps))) + (consp (nthcdr completion-cycle-threshold comps))))) ;; Fewer than completion-cycle-threshold remaining ;; completions: let's cycle. (setq completed t exact t) (setq completion-all-sorted-completions comps) (minibuffer-force-complete)) (completed - ;; We could also decide to refresh the completions, - ;; if they're displayed (and assuming there are - ;; completions left). + ;; We could also decide to refresh the completions, + ;; if they're displayed (and assuming there are + ;; completions left). (minibuffer-hide-completions)) - ;; Show the completion table, if requested. - ((not exact) - (if (case completion-auto-help - (lazy (eq this-command last-command)) - (t completion-auto-help)) - (minibuffer-completion-help) - (minibuffer-message "Next char not unique"))) - ;; If the last exact completion and this one were the same, it - ;; means we've already given a "Next char not unique" message - ;; and the user's hit TAB again, so now we give him help. - ((eq this-command last-command) + ;; Show the completion table, if requested. + ((not exact) + (if (case completion-auto-help + (lazy (eq this-command last-command)) + (t completion-auto-help)) + (minibuffer-completion-help) + (minibuffer-message "Next char not unique"))) + ;; If the last exact completion and this one were the same, it + ;; means we've already given a "Next char not unique" message + ;; and the user's hit TAB again, so now we give him help. + ((eq this-command last-command) (if completion-auto-help (minibuffer-completion-help)))) (minibuffer--bitset completed t exact)))))))) @@ -648,7 +651,7 @@ ;; If the previous command was not this, ;; mark the completion buffer obsolete. (unless (eq this-command last-command) - (setq completion-all-sorted-completions nil) + (completion--flush-all-sorted-completions) (setq minibuffer-scroll-window nil)) (cond @@ -664,7 +667,7 @@ (scroll-other-window)) nil))) ;; If we're cycling, keep on cycling. - (completion-all-sorted-completions + ((and completion-cycling completion-all-sorted-completions) (minibuffer-force-complete) t) (t (case (completion--do-completion) @@ -675,10 +678,8 @@ t) (t t))))) -(defvar completion-all-sorted-completions nil) -(make-variable-buffer-local 'completion-all-sorted-completions) - (defun completion--flush-all-sorted-completions (&rest ignore) + (setq completion-cycling nil) (setq completion-all-sorted-completions nil)) (defun completion-all-sorted-completions () @@ -720,6 +721,7 @@ (all (completion-all-sorted-completions))) (if (not (consp all)) (minibuffer-message (if all "No more completions" "No completions")) + (setq completion-cycling t) (goto-char end) (insert (car all)) (delete-region (+ start (cdr (last all))) end) ------------------------------------------------------------ revno: 102132 author: Leo committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-10-27 21:30:01 -0400 message: * lisp/iswitchb.el (iswitchb-kill-buffer): Avoid `iswitchb-make-buflist' which changes the order of matches seen by users. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-28 01:10:22 +0000 +++ lisp/ChangeLog 2010-10-28 01:30:01 +0000 @@ -1,4 +1,9 @@ -2010-10-28 Jes Bodi Klinke +2010-10-28 Leo + + * iswitchb.el (iswitchb-kill-buffer): Avoid `iswitchb-make-buflist' + which changes the order of matches seen by users (bug#7231). + +2010-10-28 Jes Bodi Klinke (tiny change) * progmodes/compile.el (compilation-mode-font-lock-keywords): Don't confuse -omega as "-o mega". === modified file 'lisp/iswitchb.el' --- lisp/iswitchb.el 2010-10-02 02:46:13 +0000 +++ lisp/iswitchb.el 2010-10-28 01:30:01 +0000 @@ -1033,7 +1033,9 @@ (setq buf (car iswitchb-matches)) ;; check to see if buf is non-nil. (if buf - (progn + (let ((bufobjs (mapcar (lambda (name) + (or (get-buffer name) name)) + iswitchb-buflist))) (kill-buffer buf) ;; Check if buffer exists. XEmacs gnuserv.el makes alias @@ -1044,8 +1046,13 @@ (setq iswitchb-rescan t) ;; Else `kill-buffer' succeeds so re-make the buffer list ;; taking into account packages like uniquify may rename - ;; buffers - (iswitchb-make-buflist iswitchb-default)))))) + ;; buffers, and try to preserve the ordering of buffers. + (setq iswitchb-buflist + (delq nil (mapcar (lambda (b) + (if (bufferp b) + (buffer-name b) + b)) + bufobjs)))))))) ;;; VISIT CHOSEN BUFFER (defun iswitchb-visit-buffer (buffer) ------------------------------------------------------------ revno: 102131 author: Jes Bodi Klinke committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-10-27 21:10:22 -0400 message: * lisp/progmodes/compile.el (compilation-mode-font-lock-keywords): Don't confuse -omega as "-o mega". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-27 21:47:09 +0000 +++ lisp/ChangeLog 2010-10-28 01:10:22 +0000 @@ -1,3 +1,8 @@ +2010-10-28 Jes Bodi Klinke + + * progmodes/compile.el (compilation-mode-font-lock-keywords): + Don't confuse -omega as "-o mega". + 2010-10-27 Stefan Monnier * vc/log-edit.el (log-edit-rewrite-fixes): New var. === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2010-09-24 03:06:33 +0000 +++ lisp/progmodes/compile.el 2010-10-28 01:10:22 +0000 @@ -543,7 +543,7 @@ ;; Command output lines. Recognize `make[n]:' lines too. ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" (1 font-lock-function-name-face) (3 compilation-line-face nil t)) - (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1) + (" -\\(?:o[= ]?\\|-\\(?:outfile\\|output\\)[= ]\\)\\(\\S +\\)" . 1) ("^Compilation \\(finished\\).*" (0 '(face nil message nil help-echo nil mouse-face nil) t) (1 compilation-info-face)) ------------------------------------------------------------ revno: 102130 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2010-10-27 22:08:36 +0000 message: gnus-group.el: Make gnus-group-default-list-level possibly a function. diff: === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-10-24 21:36:09 +0000 +++ doc/misc/gnus.texi 2010-10-27 22:08:36 +0000 @@ -2415,6 +2415,9 @@ All groups with a level less than or equal to @code{gnus-group-default-list-level} will be listed in the group buffer by default. +This variable can also be a function. In that case, that function will +be called and the result will be used as value. + @vindex gnus-group-list-inactive-groups If @code{gnus-group-list-inactive-groups} is non-@code{nil}, non-active === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-27 03:59:59 +0000 +++ lisp/gnus/ChangeLog 2010-10-27 22:08:36 +0000 @@ -1,3 +1,9 @@ +2010-10-26 Julien Danjou + + * gnus-group.el (gnus-group-default-list-level): Add this function to + compute the default list level. + (gnus-group-default-list-level): Add possibility to use a function. + 2010-10-27 Katsumi Yamaoka * mm-decode.el (mm-shr): Add undisplayer to MIME handle. === modified file 'lisp/gnus/gnus-group.el' --- lisp/gnus/gnus-group.el 2010-10-27 01:09:11 +0000 +++ lisp/gnus/gnus-group.el 2010-10-27 22:08:36 +0000 @@ -119,10 +119,11 @@ :type 'boolean) (defcustom gnus-group-default-list-level gnus-level-subscribed - "*Default listing level. + "Default listing level. Ignored if `gnus-group-use-permanent-levels' is non-nil." :group 'gnus-group-listing - :type 'integer) + :type '(choice (integer :tag "Level") + (function :tag "Function returning level"))) (defcustom gnus-group-list-inactive-groups t "*If non-nil, inactive groups will be listed." @@ -1169,6 +1170,12 @@ (mouse-set-point e) (gnus-group-read-group nil)) +(defun gnus-group-default-list-level () + "Return the real value for `gnus-group-default-list-level'." + (if (functionp gnus-group-default-list-level) + (funcall gnus-group-default-list-level) + gnus-group-default-list-level)) + ;; Look at LEVEL and find out what the level is really supposed to be. ;; If LEVEL is non-nil, LEVEL will be returned, if not, what happens ;; will depend on whether `gnus-group-use-permanent-levels' is used. @@ -1178,13 +1185,13 @@ (or (setq gnus-group-use-permanent-levels (or level (if (numberp gnus-group-use-permanent-levels) gnus-group-use-permanent-levels - (or gnus-group-default-list-level + (or (gnus-group-default-list-level) gnus-level-subscribed)))) - gnus-group-default-list-level gnus-level-subscribed)) + (gnus-group-default-list-level) gnus-level-subscribed)) (number-or-nil level) (t - (or level gnus-group-default-list-level gnus-level-subscribed)))) + (or level (gnus-group-default-list-level) gnus-level-subscribed)))) (defun gnus-group-setup-buffer () (set-buffer (gnus-get-buffer-create gnus-group-buffer)) @@ -1230,7 +1237,7 @@ (prefix-numeric-value current-prefix-arg) (or (gnus-group-default-level nil t) - gnus-group-default-list-level + (gnus-group-default-list-level) gnus-level-subscribed)))) (unless level (setq level (car gnus-group-list-mode) ------------------------------------------------------------ revno: 102129 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-10-27 17:47:09 -0400 message: * lisp/vc/log-edit.el (log-edit-rewrite-fixes): New var. (log-edit-author): New dynamic var. (log-edit-changelog-ours-p, log-edit-insert-changelog-entries): Use it to return the author if different from committer. (log-edit-insert-changelog): Use them to add Author: and Fixes headers. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-27 14:31:44 +0000 +++ lisp/ChangeLog 2010-10-27 21:47:09 +0000 @@ -1,5 +1,11 @@ 2010-10-27 Stefan Monnier + * vc/log-edit.el (log-edit-rewrite-fixes): New var. + (log-edit-author): New dynamic var. + (log-edit-changelog-ours-p, log-edit-insert-changelog-entries): Use it + to return the author if different from committer. + (log-edit-insert-changelog): Use them to add Author: and Fixes headers. + * play/landmark.el: Adjust commenting convention. (lm-nil-score): Rename from nil-score. (Xscore, XXscore, XXXscore, XXXXscore, Oscore, OOscore, OOOscore) === modified file 'lisp/vc/log-edit.el' --- lisp/vc/log-edit.el 2010-06-12 17:14:43 +0000 +++ lisp/vc/log-edit.el 2010-10-27 21:47:09 +0000 @@ -572,6 +572,14 @@ (log-edit-comment-to-change-log))))) (defvar log-edit-changelog-use-first nil) + +(defvar log-edit-rewrite-fixes nil + "Rule to rewrite bug numbers into Fixes: headers. +The value should be of the form (REGEXP . REPLACEMENT) +where REGEXP should match the expression referring to a bug number +in the text, and REPLACEMENT is an expression to pass to `replace-match' +to build the Fixes: header.") + (defun log-edit-insert-changelog (&optional use-first) "Insert a log message by looking at the ChangeLog. The idea is to write your ChangeLog entries first, and then use this @@ -593,18 +601,34 @@ (when (<= (point) eoh) (goto-char eoh) (if (looking-at "\n") (forward-char 1)))) - (let ((log-edit-changelog-use-first - (or use-first (eq last-command 'log-edit-insert-changelog)))) - (log-edit-insert-changelog-entries (log-edit-files))) - (log-edit-set-common-indentation) - (goto-char (point-min)) - (when (and log-edit-strip-single-file-name (looking-at "\\*\\s-+")) - (forward-line 1) - (when (not (re-search-forward "^\\*\\s-+" nil t)) - (goto-char (point-min)) - (skip-chars-forward "^():") - (skip-chars-forward ": ") - (delete-region (point-min) (point))))) + (let ((author + (let ((log-edit-changelog-use-first + (or use-first (eq last-command 'log-edit-insert-changelog)))) + (log-edit-insert-changelog-entries (log-edit-files))))) + (log-edit-set-common-indentation) + ;; Add an Author: field if appropriate. + (when author + (rfc822-goto-eoh) + (insert "Author: " author "\n" (if (looking-at "\n") "" "\n"))) + ;; Add a Fixes: field if applicable. + (when (consp log-edit-rewrite-fixes) + (rfc822-goto-eoh) + (when (re-search-forward (car log-edit-rewrite-fixes) nil t) + (let ((start (match-beginning 0)) + (end (match-end 0)) + (fixes (match-substitute-replacement + (cdr log-edit-rewrite-fixes)))) + (delete-region start end) + (rfc822-goto-eoh) + (insert "Fixes: " fixes "\n" (if (looking-at "\n") "" "\n"))))) + (goto-char (point-min)) + (when (and log-edit-strip-single-file-name (looking-at "\\*\\s-+")) + (forward-line 1) + (when (not (re-search-forward "^\\*\\s-+" nil t)) + (goto-char (point-min)) + (skip-chars-forward "^():") + (skip-chars-forward ": ") + (delete-region (point-min) (point)))))) ;;;; ;;;; functions for getting commit message from ChangeLog a file... @@ -670,6 +694,9 @@ (defvar user-full-name) (defvar user-mail-address) + +(defvar log-edit-author) ;Dynamically scoped. + (defun log-edit-changelog-ours-p () "See if ChangeLog entry at point is for the current user, today. Return non-nil if it is." @@ -684,9 +711,23 @@ (functionp add-log-time-format) (funcall add-log-time-format)) (format-time-string "%Y-%m-%d")))) - (looking-at (if log-edit-changelog-use-first - "[^ \t]" - (regexp-quote (format "%s %s <%s>" time name mail)))))) + (if (null log-edit-changelog-use-first) + (looking-at (regexp-quote (format "%s %s <%s>" time name mail))) + ;; Check the author, to potentially add it as a "Author: " header. + (when (looking-at "[^ \t]") + (when (and (boundp 'log-edit-author) + (not (looking-at (format ".+ .+ <%s>" + (regexp-quote mail)))) + (looking-at ".+ \\(.+ <.+>\\)")) + (let ((author (replace-regexp-in-string " " " " + (match-string 1)))) + (unless (and log-edit-author + (string-match (regexp-quote author) log-edit-author)) + (setq log-edit-author + (if log-edit-author + (concat log-edit-author ", " author) + author))))) + t)))) (defun log-edit-changelog-entries (file) "Return the ChangeLog entries for FILE, and the ChangeLog they came from. @@ -776,7 +817,8 @@ (defun log-edit-insert-changelog-entries (files) "Given a list of files FILES, insert the ChangeLog entries for them." - (let ((log-entries nil)) + (let ((log-entries nil) + (log-edit-author nil)) ;; Note that any ChangeLog entry can apply to more than one file. ;; Here we construct a log-entries list with elements of the form ;; ((LOGBUFFER ENTRYSTART ENTRYEND) FILE1 FILE2...) @@ -793,7 +835,8 @@ (dolist (log-entry (nreverse log-entries)) (apply 'log-edit-changelog-insert-entries (append (car log-entry) (cdr log-entry))) - (insert "\n")))) + (insert "\n")) + log-edit-author)) (defun log-edit-extract-headers (headers comment) "Extract headers from COMMENT to form command line arguments. ------------------------------------------------------------ revno: 102128 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-10-27 10:48:05 -0400 message: * test/indent/octave.m: Add a test to ensure indentation is local. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2010-10-23 19:51:14 +0000 +++ test/ChangeLog 2010-10-27 14:48:05 +0000 @@ -1,8 +1,12 @@ +2010-10-27 Stefan Monnier + + * indent/octave.m: Add a test to ensure indentation is local. + 2010-10-23 Glenn Morris * comint-testsuite.el - (comint-testsuite--test-comint-password-prompt-regexp): Add - "Please enter the password". (Bug#7224) + (comint-testsuite--test-comint-password-prompt-regexp): + Add "Please enter the password". (Bug#7224) 2010-09-20 Stefan Monnier === modified file 'test/indent/octave.m' --- test/indent/octave.m 2010-09-18 16:21:16 +0000 +++ test/indent/octave.m 2010-10-27 14:48:05 +0000 @@ -17,15 +17,21 @@ cnty = repmat(x(:,1)(:), 10, 1); pop = x(:,1:10)(:); - bir = x(:,11:20)(:); - dth = x(:,21:30)(:); - imig = x(:,31:40)(:); - dmig = x(:,41:50)(:); - gq = x(:,51:60)(:); - - yrs = repmat(2000:2009, 39, 1)(:); - - res = [yrs, cnty, pop, bir, dth, imig, dmig, gq]; + ## Here and below, we test if the indentation aligns with a previous + ## fixindented line. This is important so as to make it easier for the + ## user to verride some indentation somewhere, and also because it + ## reflects the fact that the indentation decision is taken with a minimum + ## amount of work (i.e. in the present case, without having to walk back + ## until the `function' line). + bir = x(:,11:20)(:); # fixindent + dth = x(:,21:30)(:); + imig = x(:,31:40)(:); + dmig = x(:,41:50)(:); + gq = x(:,51:60)(:); + + yrs = repmat(2000:2009, 39, 1)(:); + + res = [yrs, cnty, pop, bir, dth, imig, dmig, gq]; endfunction ------------------------------------------------------------ revno: 102127 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-10-27 10:31:44 -0400 message: * lisp/play/landmark.el: Adjust commenting convention. (lm-nil-score): Rename from nil-score. (Xscore, XXscore, XXXscore, XXXXscore, Oscore, OOscore, OOOscore) (OOOOscore): Move into a let in lm-score-trans-table. (lm-winning-threshold, lm-loosing-threshold): Use lm-score-trans-table. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-27 14:26:01 +0000 +++ lisp/ChangeLog 2010-10-27 14:31:44 +0000 @@ -1,5 +1,11 @@ 2010-10-27 Stefan Monnier + * play/landmark.el: Adjust commenting convention. + (lm-nil-score): Rename from nil-score. + (Xscore, XXscore, XXXscore, XXXXscore, Oscore, OOscore, OOOscore) + (OOOOscore): Move into a let in lm-score-trans-table. + (lm-winning-threshold, lm-loosing-threshold): Use lm-score-trans-table. + * electric.el (electric-indent-chars): Autoload. * progmodes/octave-mod.el (octave-mode): * progmodes/ruby-mode.el (ruby-mode): Take advantage of it. === modified file 'lisp/play/landmark.el' --- lisp/play/landmark.el 2010-10-10 23:12:30 +0000 +++ lisp/play/landmark.el 2010-10-27 14:31:44 +0000 @@ -30,31 +30,31 @@ ;;; Commentary: -;;; Lm is a relatively non-participatory game in which a robot -;;; attempts to maneuver towards a tree at the center of the window -;;; based on unique olfactory cues from each of the 4 directions. If -;;; the smell of the tree increases, then the weights in the robot's -;;; brain are adjusted to encourage this odor-driven behavior in the -;;; future. If the smell of the tree decreases, the robots weights are -;;; adjusted to discourage a correct move. - -;;; In laymen's terms, the search space is initially flat. The point -;;; of training is to "turn up the edges of the search space" so that -;;; the robot rolls toward the center. - -;;; Further, do not become alarmed if the robot appears to oscillate -;;; back and forth between two or a few positions. This simply means -;;; it is currently caught in a local minimum and is doing its best to -;;; work its way out. - -;;; The version of this program as described has a small problem. a -;;; move in a net direction can produce gross credit assignment. for -;;; example, if moving south will produce positive payoff, then, if in -;;; a single move, one moves east,west and south, then both east and -;;; west will be improved when they shouldn't - -;;; Many thanks to Yuri Pryadkin (yuri@rana.usc.edu) for this -;;; concise problem description. +;; Lm is a relatively non-participatory game in which a robot +;; attempts to maneuver towards a tree at the center of the window +;; based on unique olfactory cues from each of the 4 directions. If +;; the smell of the tree increases, then the weights in the robot's +;; brain are adjusted to encourage this odor-driven behavior in the +;; future. If the smell of the tree decreases, the robots weights are +;; adjusted to discourage a correct move. + +;; In laymen's terms, the search space is initially flat. The point +;; of training is to "turn up the edges of the search space" so that +;; the robot rolls toward the center. + +;; Further, do not become alarmed if the robot appears to oscillate +;; back and forth between two or a few positions. This simply means +;; it is currently caught in a local minimum and is doing its best to +;; work its way out. + +;; The version of this program as described has a small problem. a +;; move in a net direction can produce gross credit assignment. for +;; example, if moving south will produce positive payoff, then, if in +;; a single move, one moves east,west and south, then both east and +;; west will be improved when they shouldn't + +;; Many thanks to Yuri Pryadkin (yuri@rana.usc.edu) for this +;; concise problem description. ;;;_* Require (eval-when-compile (require 'cl)) @@ -303,47 +303,47 @@ ;; these values will change (hopefully improve) the strength of the program ;; and may change its style (rather aggressive here). -(defconst nil-score 7 "Score of an empty qtuple.") -(defconst Xscore 15 "Score of a qtuple containing one X.") -(defconst XXscore 400 "Score of a qtuple containing two X's.") -(defconst XXXscore 1800 "Score of a qtuple containing three X's.") -(defconst XXXXscore 100000 "Score of a qtuple containing four X's.") -(defconst Oscore 35 "Score of a qtuple containing one O.") -(defconst OOscore 800 "Score of a qtuple containing two O's.") -(defconst OOOscore 15000 "Score of a qtuple containing three O's.") -(defconst OOOOscore 800000 "Score of a qtuple containing four O's.") - -;; These values are not just random: if, given the following situation: -;; -;; . . . . . . . O . -;; . X X a . . . X . -;; . . . X . . . X . -;; . . . X . . . X . -;; . . . . . . . b . -;; -;; you want Emacs to play in "a" and not in "b", then the parameters must -;; satisfy the inequality: -;; -;; 6 * XXscore > XXXscore + XXscore -;; -;; because "a" mainly belongs to six "XX" qtuples (the others are less -;; important) while "b" belongs to one "XXX" and one "XX" qtuples. Other -;; conditions are required to obtain sensible moves, but the previous example -;; should illustrate the point. If you manage to improve on these values, -;; please send me a note. Thanks. - - -;; As we chose values 0, 1 and 6 to denote empty, X and O squares, the -;; contents of a qtuple are uniquely determined by the sum of its elements and -;; we just have to set up a translation table. +(defconst lm-nil-score 7 "Score of an empty qtuple.") (defconst lm-score-trans-table - (vector nil-score Xscore XXscore XXXscore XXXXscore 0 - Oscore 0 0 0 0 0 - OOscore 0 0 0 0 0 - OOOscore 0 0 0 0 0 - OOOOscore 0 0 0 0 0 - 0) + (let ((Xscore 15) ; Score of a qtuple containing one X. + (XXscore 400) ; Score of a qtuple containing two X's. + (XXXscore 1800) ; Score of a qtuple containing three X's. + (XXXXscore 100000) ; Score of a qtuple containing four X's. + (Oscore 35) ; Score of a qtuple containing one O. + (OOscore 800) ; Score of a qtuple containing two O's. + (OOOscore 15000) ; Score of a qtuple containing three O's. + (OOOOscore 800000)) ; Score of a qtuple containing four O's. + + ;; These values are not just random: if, given the following situation: + ;; + ;; . . . . . . . O . + ;; . X X a . . . X . + ;; . . . X . . . X . + ;; . . . X . . . X . + ;; . . . . . . . b . + ;; + ;; you want Emacs to play in "a" and not in "b", then the parameters must + ;; satisfy the inequality: + ;; + ;; 6 * XXscore > XXXscore + XXscore + ;; + ;; because "a" mainly belongs to six "XX" qtuples (the others are less + ;; important) while "b" belongs to one "XXX" and one "XX" qtuples. + ;; Other conditions are required to obtain sensible moves, but the + ;; previous example should illustrate the point. If you manage to + ;; improve on these values, please send me a note. Thanks. + + + ;; As we chose values 0, 1 and 6 to denote empty, X and O squares, + ;; the contents of a qtuple are uniquely determined by the sum of + ;; its elements and we just have to set up a translation table. + (vector lm-nil-score Xscore XXscore XXXscore XXXXscore 0 + Oscore 0 0 0 0 0 + OOscore 0 0 0 0 0 + OOOscore 0 0 0 0 0 + OOOOscore 0 0 0 0 0 + 0)) "Vector associating qtuple contents to their score.") @@ -354,10 +354,12 @@ ;; qtuple. We may use these considerations to detect when a given move is ;; winning or loosing. -(defconst lm-winning-threshold OOOOscore +(defconst lm-winning-threshold + (aref lm-score-trans-table (+ 6 6 6 6)) ;; OOOOscore "Threshold score beyond which an Emacs move is winning.") -(defconst lm-loosing-threshold XXXXscore +(defconst lm-loosing-threshold + (aref lm-score-trans-table (+ 1 1 1 1)) ;; XXXXscore "Threshold score beyond which a human move is winning.") @@ -423,7 +425,7 @@ (setq lm-score-table (copy-sequence lm-saved-score-table)) ;; No, compute it: (setq lm-score-table - (make-vector lm-vector-length (* 20 nil-score))) + (make-vector lm-vector-length (* 20 lm-nil-score))) (let (i j maxi maxj maxi2 maxj2) (setq maxi (/ (1+ lm-board-width) 2) maxj (/ (1+ lm-board-height) 2) ------------------------------------------------------------ revno: 102126 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-10-27 10:26:01 -0400 message: * lisp/electric.el (electric-indent-chars): Autoload. * lisp/progmodes/octave-mod.el (octave-mode): * lisp/progmodes/ruby-mode.el (ruby-mode): Take advantage of it. (ruby-mode-abbrev-table): Merge initialization and declaration. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-27 06:50:28 +0000 +++ lisp/ChangeLog 2010-10-27 14:26:01 +0000 @@ -1,3 +1,10 @@ +2010-10-27 Stefan Monnier + + * electric.el (electric-indent-chars): Autoload. + * progmodes/octave-mod.el (octave-mode): + * progmodes/ruby-mode.el (ruby-mode): Take advantage of it. + (ruby-mode-abbrev-table): Merge initialization and declaration. + 2010-10-27 Glenn Morris * abbrev.el (abbrev-mode): Remove one of the three definitions of this === modified file 'lisp/electric.el' --- lisp/electric.el 2010-09-04 22:54:58 +0000 +++ lisp/electric.el 2010-10-27 14:26:01 +0000 @@ -178,6 +178,10 @@ ;; Electric indentation. +;; Autoloading variables is generally undesirable, but major modes +;; should usually set this variable by adding elements to the default +;; value, which only works well if the variable is preloaded. +;;;###autoload (defvar electric-indent-chars '(?\n) "Characters that should cause automatic reindentation.") === modified file 'lisp/progmodes/octave-mod.el' --- lisp/progmodes/octave-mod.el 2010-10-07 11:27:19 +0000 +++ lisp/progmodes/octave-mod.el 2010-10-27 14:26:01 +0000 @@ -646,9 +646,8 @@ (aref (cdr kw) (1- (length (cdr kw))))) smie-closer-alist)))))) - ;; FIXME: maybe we should use (cons ?\; electric-indent-chars) - ;; since only ; is really octave-specific. - (set (make-local-variable 'electric-indent-chars) '(?\; ?\s ?\n)) + (set (make-local-variable 'electric-indent-chars) + (cons ?\; electric-indent-chars)) (set (make-local-variable 'comment-start) octave-comment-start) (set (make-local-variable 'comment-end) "") === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2010-09-10 23:13:42 +0000 +++ lisp/progmodes/ruby-mode.el 2010-10-27 14:26:01 +0000 @@ -135,11 +135,9 @@ (defconst ruby-symbol-re (concat "[" ruby-symbol-chars "]") "Regexp to match symbols.") -(defvar ruby-mode-abbrev-table nil +(define-abbrev-table 'ruby-mode-abbrev-table () "Abbrev table in use in Ruby mode buffers.") -(define-abbrev-table 'ruby-mode-abbrev-table ()) - (defvar ruby-mode-map (let ((map (make-sparse-keymap))) (define-key map "{" 'ruby-electric-brace) @@ -1430,8 +1428,6 @@ ) "Additional expressions to highlight in Ruby mode.") -(defvar electric-indent-chars) - ;;;###autoload (define-derived-mode ruby-mode prog-mode "Ruby" "Major mode for editing Ruby scripts. @@ -1456,8 +1452,7 @@ 'ruby-mode-set-encoding nil 'local) (set (make-local-variable 'electric-indent-chars) - (append '(?\{ ?\}) (if (boundp 'electric-indent-chars) - (default-value 'electric-indent-chars)))) + (append '(?\{ ?\}) electric-indent-chars)) (set (make-local-variable 'font-lock-defaults) '((ruby-font-lock-keywords) nil nil)) ------------------------------------------------------------ revno: 102125 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2010-10-27 08:07:41 +0000 message: nnimap.el (nnimap-retrieve-group-data-early): Remove bad comment. diff: === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-10-24 22:32:38 +0000 +++ lisp/gnus/nnimap.el 2010-10-27 08:07:41 +0000 @@ -1009,7 +1009,6 @@ (with-current-buffer (nnimap-buffer) (erase-buffer) (setf (nnimap-group nnimap-object) nil) - ;; QRESYNC handling isn't implemented. (let ((qresyncp (member "QRESYNC" (nnimap-capabilities nnimap-object))) params groups sequences active uidvalidity modseq group) ;; Go through the infos and gather the data needed to know ------------------------------------------------------------ revno: 102124 committer: Glenn Morris branch nick: trunk timestamp: Wed 2010-10-27 00:39:34 -0700 message: * lisp/term/ns-win.el (ns-insert-file): Init in let. (ns-find-file): Use let*. diff: === modified file 'lisp/term/ns-win.el' --- lisp/term/ns-win.el 2010-10-27 06:48:04 +0000 +++ lisp/term/ns-win.el 2010-10-27 07:39:34 +0000 @@ -420,8 +420,7 @@ "Insert contents of file `ns-input-file' like insert-file but with less prompting. If file is a directory perform a `find-file' on it." (interactive) - (let (f) - (setq f (pop ns-input-file)) + (let ((f (pop ns-input-file))) (if (file-directory-p f) (find-file f) (push-mark (+ (point) (cadr (insert-file-contents f))))))) @@ -527,11 +526,10 @@ (defun ns-find-file () "Do a `find-file' with the `ns-input-file' as argument." (interactive) - (let (f file bufwin1 bufwin2) - (setq f (file-truename (pop ns-input-file)) - file (find-file-noselect f) - bufwin1 (get-buffer-window file 'visible) - bufwin2 (get-buffer-window "*scratch*" 'visibile)) + (let* ((f (file-truename (pop ns-input-file))) + (file (find-file-noselect f)) + (bufwin1 (get-buffer-window file 'visible)) + (bufwin2 (get-buffer-window "*scratch*" 'visibile))) (cond (bufwin1 (select-frame (window-frame bufwin1)) ------------------------------------------------------------ revno: 102123 committer: Glenn Morris branch nick: trunk timestamp: Tue 2010-10-26 23:50:28 -0700 message: * abbrev.el (abbrev-mode): Remove one of the three definitions of this variable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-27 06:48:04 +0000 +++ lisp/ChangeLog 2010-10-27 06:50:28 +0000 @@ -1,5 +1,8 @@ 2010-10-27 Glenn Morris + * abbrev.el (abbrev-mode): Remove one of the three definitions of this + variable. + * server.el (server-host, server-port, server-auth-dir): Autoload risky. * term/ns-win.el: Restore require of cl when compiling. === modified file 'lisp/abbrev.el' --- lisp/abbrev.el 2010-08-29 16:17:13 +0000 +++ lisp/abbrev.el 2010-10-27 06:50:28 +0000 @@ -1,7 +1,7 @@ ;;; abbrev.el --- abbrev mode commands for Emacs -;; Copyright (C) 1985, 1986, 1987, 1992, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1987, 1992, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: abbrev convenience @@ -59,16 +59,6 @@ positive, otherwise turn it off. In Abbrev mode, inserting an abbreviation causes it to expand and be replaced by its expansion.") -(defcustom abbrev-mode nil - "Enable or disable Abbrev mode. -Non-nil means automatically expand abbrevs as they are inserted. - -Setting this variable with `setq' changes it for the current buffer. -Changing it with \\[customize] sets the default value. -Interactively, use the command `abbrev-mode' -to enable or disable Abbrev mode in the current buffer." - :type 'boolean - :group 'abbrev-mode) (put 'abbrev-mode 'safe-local-variable 'booleanp) @@ -927,5 +917,4 @@ (provide 'abbrev) -;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5 ;;; abbrev.el ends here