From: Martin Rudalics Date: Thu, 13 Jan 2011 17:26:19 +0000 (+0100) Subject: Merge from trunk with two adjustments in sendmail.el. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e63bc9aa7225b017b5967b875e43742d0fffe12d;p=emacs.git Merge from trunk with two adjustments in sendmail.el. --- e63bc9aa7225b017b5967b875e43742d0fffe12d diff --cc lisp/ChangeLog index a04696dc4f3,eafb096f499..0bf2d2cdd21 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@@ -1,72 -1,47 +1,120 @@@ +2011-01-13 Martin Rudalics + ++ * mail/sendmail.el (sendmail-user-agent-compose): Remove let ++ bindings around funcall of switch-function. ++ (mail-bury): Merge change from trunk with quit-restore-window. ++ + * electric.el (Electric-pop-up-window): Adapt to new buffer + display specifiers. + + 2011-01-13 Kim F. Storm + + * ido.el (ido-may-cache-directory): Move "too-big" check later. + (ido-next-match, ido-prev-match): Fix stray reordering of matching + items when cycling through the matches. + + 2011-01-13 Tassilo Horn + + * dired-x.el (dired-omit-verbose): New defcustom that allows + disabling the omit messages. + (dired-omit-expunge): Use it. + + 2011-01-13 Christian Ohler + + * emacs-lisp/ert.el, emacs-lisp/ert-x.el: New files. + + 2011-01-13 Chong Yidong + + * font-lock.el (font-lock-verbose): Default to nil. + + 2011-01-13 Chong Yidong + + * simple.el (sendmail-user-agent-compose): Move to sendmail.el. + (compose-mail): New arg RETURN-ACTION. + (compose-mail-other-window, compose-mail-other-frame): Likewise. + + * mail/sendmail.el (mail-return-action): New var. + (mail-mode): Make it buffer-local. + (mail-bury): Obey it. Move special Rmail window handling to + rmail-mail-return. + (mail, mail-setup): New arg RETURN-ACTION. + (sendmail-user-agent-compose): Move from simple.el. + + * mail/rmail.el (rmail-mail-return): New function. + (rmail-start-mail): Pass it to compose-mail. + +2011-01-12 Martin Rudalics + + * dired.el (dired-display-file, dired-why): Use + display-buffer-other-window with label. + (dired-pop-to-buffer): Remove. + (dired-mark-pop-up): Use display-buffer and quit-restore-window. + + * proced.el (proced-send-signal): Use display-buffer and + quit-restore-window. + + 2011-01-12 Chong Yidong + + * menu-bar.el (menu-bar-custom-menu): Tweak Mule and Customize + menus. Add menu item for customize-themes. + + * cus-theme.el (customize-themes): + * emacs-lisp/package.el (package--list-packages): Use ++ +2011-01-11 Martin Rudalics + + * vc/ediff-ptch.el (ediff-show-patch-diagnostics): Use + display-buffer-other-window. + + * simple.el (goto-line, compose-mail-other-window): Replace + switch-to-buffer-other-window by pop-to-buffer-other-window. + (pop-global-mark): Use pop-to-buffer-same-window instead of switch-to-buffer. + (compose-mail-other-frame): Use pop-to-buffer-other-frame + instead of switch-to-buffer-other-frame. + (special-mode-map): Bind "q" to quit-restore-window instead of + quit-window. + + * buff-menu.el (Buffer-menu-mode-map): Bind "q" to + quit-restore-window. + (buffer-menu): Call pop-to-buffer-same-window. + (buffer-menu-other-window): Call pop-to-buffer-other-window. + (Buffer-menu-select): Rewrite using display-buffer-same-window + and display-buffer. + (Buffer-menu-1-window, Buffer-menu-mouse-select) + (Buffer-menu-this-window): Call pop-to-buffer-same-window. + (Buffer-menu-other-window): Call pop-to-buffer-other-window. + (Buffer-menu-switch-other-window): Call + display-buffer-same-frame-other-window. + (Buffer-menu-2-window): Add label argument in calls of + display-buffer-same-window and + pop-to-buffer-same-frame-other-window. + + * mail/reporter.el (reporter-submit-bug-report): Use + display-buffer-same-frame-other-window. + + * progmodes/compile.el (compilation-find-file): Use + display-buffer-same-frame. + + * progmodes/inf-lisp.el (switch-to-lisp): Rewrite with new buffer + display method specifiers. + + * vc/ediff-ptch.el (ediff-get-patch-buffer): Use + pop-to-buffer-other-window. + (ediff-patch-file-internal): Replace switch-to-buffer by + pop-to-buffer-same-window and switch-to-buffer-other-window by + pop-to-buffer-other-window. + + * vc/pcvs.el (cvs-ediff-exit-hook): Call + pop-to-buffer-same-window instead of switch-to-buffer. + (cvs-mode-find-file): Replace switch-to-buffer and + switch-to-buffer-other-window by pop-to-buffer-same-window and + pop-to-buffer-other-window. Replace call to dired-other-window + by call to display-buffer-other-window. + (cvs-temp-buffer): Call display-buffer-other-window instead of + display-buffer. + + * vc/pcvs-util.el (cvs-bury-buffer): Call quit-restore-window. 2011-01-11 Johan Bockgård diff --cc lisp/dired.el index 3c6e09ac243,e34340c15df..526dde82e5a --- a/lisp/dired.el +++ b/lisp/dired.el @@@ -4009,7 -4021,7 +4009,7 @@@ true then the type of the file linked t ;;;*** ;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el" --;;;;;; "27c312d6d5d40d8cb4ef8d62e30d5f4a") ++;;;;;; "6181a5bcc2b61255676a7a41549b9f40") ;;; Generated autoloads from dired-x.el (autoload 'dired-jump "dired-x" "\ diff --cc lisp/mail/sendmail.el index 88c91b56b08,4fa513089bc..ffc29c09c7a --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@@ -521,7 -520,46 +520,42 @@@ by Emacs.)" (setq mail-alias-modtime modtime mail-aliases t))))) - (defun mail-setup (to subject in-reply-to cc replybuffer actions) + + ;;;###autoload + (define-mail-user-agent 'sendmail-user-agent + 'sendmail-user-agent-compose + 'mail-send-and-exit) + + ;;;###autoload + (defun sendmail-user-agent-compose (&optional to subject other-headers + continue switch-function yank-action + send-actions return-action + &rest ignored) + (if switch-function - (let ((special-display-buffer-names nil) - (special-display-regexps nil) - (same-window-buffer-names nil) - (same-window-regexps nil)) - (funcall switch-function "*mail*"))) ++ (funcall switch-function "*mail*")) + (let ((cc (cdr (assoc-string "cc" other-headers t))) + (in-reply-to (cdr (assoc-string "in-reply-to" other-headers t))) + (body (cdr (assoc-string "body" other-headers t)))) + (or (mail continue to subject in-reply-to cc yank-action + send-actions return-action) + continue + (error "Message aborted")) + (save-excursion + (rfc822-goto-eoh) + (while other-headers + (unless (member-ignore-case (car (car other-headers)) + '("in-reply-to" "cc" "body")) + (insert (car (car other-headers)) ": " + (cdr (car other-headers)) + (if use-hard-newlines hard-newline "\n"))) + (setq other-headers (cdr other-headers))) + (when body + (forward-line 1) + (insert body)) + t))) + + (defun mail-setup (to subject in-reply-to cc replybuffer + actions return-action) (or mail-default-reply-to (setq mail-default-reply-to (getenv "REPLYTO"))) (sendmail-sync-aliases) @@@ -760,46 -803,11 +799,11 @@@ Prefix arg means don't delete this wind (defun mail-bury (&optional arg) "Bury this mail buffer." -- (let ((newbuf (other-buffer (current-buffer)))) -- (bury-buffer (current-buffer)) - ;; The inherent assumption is that we are in the selected window so - ;; using `frame-selected-window' doesn't make any sense. We should - ;; be able to use `quit-restore-window' here but I don't understand - ;; all implications of the code so try to do what was done before. - (if (and (or nil - ;; In this case, we need to go to a different frame. - (window-dedicated-p) - (let ((quit-restore (window-parameter nil 'quit-restore))) - (and (memq (car-safe quit-restore) '(new-window new-frame)) - ;; Check that WINDOW's buffer is still the same. - (eq (window-buffer) (nth 1 quit-restore)))) - (cdr (assq 'mail-dedicated-frame (frame-parameters)))) - (other-visible-frames-p)) + (if (and (null arg) mail-return-action) - (apply (car mail-return-action) (cdr mail-return-action)) - (switch-to-buffer newbuf)))) + (progn - (if (display-multi-frame-p) - (delete-frame (selected-frame)) - ;; The previous frame is where normally they have the - ;; Rmail buffer displayed. - (other-frame -1))) - - (let (rmail-flag summary-buffer) - (and (not arg) - (not (one-window-p)) - (with-current-buffer - (window-buffer (next-window (selected-window) 'not)) - (setq rmail-flag (eq major-mode 'rmail-mode)) - (setq summary-buffer - (and mail-bury-selects-summary - (boundp 'rmail-summary-buffer) - rmail-summary-buffer - (buffer-name rmail-summary-buffer) - (not (get-buffer-window rmail-summary-buffer)) - rmail-summary-buffer)))) - (if rmail-flag - ;; If the Rmail buffer has a summary, show that. - (if summary-buffer (switch-to-buffer summary-buffer) - (delete-window)) - (switch-to-buffer newbuf)))))) ++ (bury-buffer (current-buffer)) ++ (apply (car mail-return-action) (cdr mail-return-action))) ++ (quit-restore-window))) (defcustom mail-send-hook nil "Hook run just before sending a message." @@@ -1644,8 -1652,12 +1648,9 @@@ If the current line has `mail-yank-pref ;; Put these commands last, to reduce chance of lossage from quitting ;; in middle of loading the file. -;;;###autoload (add-hook 'same-window-buffer-names (purecopy "*mail*")) -;;;###autoload (add-hook 'same-window-buffer-names (purecopy "*unsent mail*")) - ;;;###autoload - (defun mail (&optional noerase to subject in-reply-to cc replybuffer actions) + (defun mail (&optional noerase to subject in-reply-to cc replybuffer + actions return-action) "Edit a message to be sent. Prefix arg means resume editing (don't erase). When this function returns, the buffer `*mail*' is selected. The value is t if the message was newly initialized; otherwise, nil. @@@ -1693,51 -1705,8 +1698,8 @@@ The seventh argument ACTIONS is a list when the message is sent, we apply FUNCTION to ARGS. This is how Rmail arranges to mark messages `answered'." (interactive "P") - ;; This is commented out because I found it was confusing in practice. - ;; It is easy enough to rename *mail* by hand with rename-buffer - ;; if you want to have multiple mail buffers. - ;; And then you can control which messages to save. --rms. - ;; (let ((index 1) - ;; buffer) - ;; ;; If requested, look for a mail buffer that is modified and go to it. - ;; (if noerase - ;; (progn - ;; (while (and (setq buffer - ;; (get-buffer (if (= 1 index) "*mail*" - ;; (format "*mail*<%d>" index)))) - ;; (not (buffer-modified-p buffer))) - ;; (setq index (1+ index))) - ;; (if buffer (switch-to-buffer buffer) - ;; ;; If none exists, start a new message. - ;; ;; This will never re-use an existing unmodified mail buffer - ;; ;; (since index is not 1 anymore). Perhaps it should. - ;; (setq noerase nil)))) - ;; ;; Unless we found a modified message and are happy, start a new message. - ;; (if (not noerase) - ;; (progn - ;; ;; Look for existing unmodified mail buffer. - ;; (while (and (setq buffer - ;; (get-buffer (if (= 1 index) "*mail*" - ;; (format "*mail*<%d>" index)))) - ;; (buffer-modified-p buffer)) - ;; (setq index (1+ index))) - ;; ;; If none, make a new one. - ;; (or buffer - ;; (setq buffer (generate-new-buffer "*mail*"))) - ;; ;; Go there and initialize it. - ;; (switch-to-buffer buffer) - ;; (erase-buffer) - ;; (setq default-directory (expand-file-name "~/")) - ;; (auto-save-mode auto-save-default) - ;; (mail-mode) - ;; (mail-setup to subject in-reply-to cc replybuffer actions) - ;; (if (and buffer-auto-save-file-name - ;; (file-exists-p buffer-auto-save-file-name)) - ;; (message "Auto save file for draft message exists; consider M-x mail-recover")) - ;; t)) - (if (eq noerase 'new) - (pop-to-buffer (generate-new-buffer "*mail*")) + (pop-to-buffer-same-window (generate-new-buffer "*mail*")) (and noerase (not (get-buffer "*mail*")) (setq noerase nil)) diff --cc lisp/simple.el index 615a965653a,57ef84882d0..f61be7e8de9 --- a/lisp/simple.el +++ b/lisp/simple.el @@@ -5751,25 -5781,27 +5728,26 @@@ To disable this warning, set `compose-m warn-vars " ")))))) (let ((function (get mail-user-agent 'composefunc))) - (funcall function to subject other-headers continue - switch-function yank-action send-actions))) + (funcall function to subject other-headers continue switch-function + yank-action send-actions return-action))) (defun compose-mail-other-window (&optional to subject other-headers continue - yank-action send-actions) + yank-action send-actions + return-action) "Like \\[compose-mail], but edit the outgoing message in another window." - (interactive - (list nil nil nil current-prefix-arg)) + (interactive (list nil nil nil current-prefix-arg)) (compose-mail to subject other-headers continue - 'pop-to-buffer-other-window yank-action send-actions)) - - 'switch-to-buffer-other-window yank-action send-actions ++ 'pop-to-buffer-other-window yank-action send-actions + return-action)) (defun compose-mail-other-frame (&optional to subject other-headers continue - yank-action send-actions) + yank-action send-actions + return-action) "Like \\[compose-mail], but edit the outgoing message in another frame." - (interactive - (list nil nil nil current-prefix-arg)) + (interactive (list nil nil nil current-prefix-arg)) (compose-mail to subject other-headers continue - 'switch-to-buffer-other-frame yank-action send-actions + 'pop-to-buffer-other-frame yank-action send-actions)) + return-action)) - (defvar set-variable-value-history nil "History of values entered with `set-variable'.