]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge from trunk with two adjustments in sendmail.el.
authorMartin Rudalics <rudalics@gmx.at>
Thu, 13 Jan 2011 17:26:19 +0000 (18:26 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Thu, 13 Jan 2011 17:26:19 +0000 (18:26 +0100)
1  2 
lisp/ChangeLog
lisp/dired.el
lisp/gnus/ChangeLog
lisp/gnus/message.el
lisp/mail/sendmail.el
lisp/mh-e/ChangeLog
lisp/mh-e/mh-comp.el
lisp/simple.el

diff --cc lisp/ChangeLog
index a04696dc4f36ccae8c2b06962557a66a23eb140c,eafb096f499327be17789a66b4ad833c09008636..0bf2d2cdd2193f489306e95d5e2acce04693224f
 +2011-01-13  Martin Rudalics  <rudalics@gmx.at>
 +
++      * 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  <storm@cua.dk>
+       * 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  <tassilo@member.fsf.org>
+       * dired-x.el (dired-omit-verbose): New defcustom that allows
+       disabling the omit messages.
+       (dired-omit-expunge): Use it.
+ 2011-01-13  Christian Ohler  <ohler@gnu.org>
+       * emacs-lisp/ert.el, emacs-lisp/ert-x.el: New files.
+ 2011-01-13  Chong Yidong  <cyd@stupidchicken.com>
+       * font-lock.el (font-lock-verbose): Default to nil.
+ 2011-01-13  Chong Yidong  <cyd@stupidchicken.com>
+       * 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  <rudalics@gmx.at>
 +
 +      * 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  <cyd@stupidchicken.com>
+       * 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  <rudalics@gmx.at>
 +
 +      * 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  <bojohan@gnu.org>
  
diff --cc lisp/dired.el
index 3c6e09ac243238f948efa3384e0eeaa1630c89f2,e34340c15df6dbb7e43e3cede28ceb8afb9dcc19..526dde82e5a9186677a77871d43dc69e884b7038
@@@ -4009,7 -4021,7 +4009,7 @@@ true then the type of the file linked t
  ;;;***
  \f
  ;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el"
--;;;;;;  "27c312d6d5d40d8cb4ef8d62e30d5f4a")
++;;;;;;  "6181a5bcc2b61255676a7a41549b9f40")
  ;;; Generated autoloads from dired-x.el
  
  (autoload 'dired-jump "dired-x" "\
Simple merge
Simple merge
index 88c91b56b08908a2a13203113e420d7e5a594e63,4fa513089bcccd71eb80e4bde19a5d185926618a..ffc29c09c7a61078a74163ffee7467a85d77dc91
@@@ -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)
\f
+ ;;;###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))
Simple merge
Simple merge
diff --cc lisp/simple.el
index 615a965653ae7ddc6afb85e94f6702dc500bc592,57ef84882d0acfd2c2826fcaa703aac0a2d23a74..f61be7e8de91a1c8e8d3e918fd84b511ade148b7
@@@ -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))
 -
  \f
  (defvar set-variable-value-history nil
    "History of values entered with `set-variable'.