diff options
| author | Karl Heuer | 1995-11-04 00:39:03 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-11-04 00:39:03 +0000 |
| commit | dc8cec25f01de86092f4b1ccbd086c402157c7a8 (patch) | |
| tree | f8bacad85a1736bb3c7b935990c5c9434f04260e | |
| parent | 89fdc4a0ab4733157083e29e61e80c3890cfec3c (diff) | |
| download | emacs-dc8cec25f01de86092f4b1ccbd086c402157c7a8.tar.gz emacs-dc8cec25f01de86092f4b1ccbd086c402157c7a8.zip | |
(mail): Don't change directory for *mail* buffer.
(sendmail-send-it, mail-recover): Instead, temporarily change to a
safe directory for just the subprocess.
| -rw-r--r-- | lisp/mail/sendmail.el | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 7427b37b2c6..b6146371b56 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -580,30 +580,31 @@ the user from the mailer." | |||
| 580 | (save-excursion | 580 | (save-excursion |
| 581 | (set-buffer errbuf) | 581 | (set-buffer errbuf) |
| 582 | (erase-buffer)))) | 582 | (erase-buffer)))) |
| 583 | (apply 'call-process-region | 583 | (let ((default-directory "/")) |
| 584 | (append (list (point-min) (point-max) | 584 | (apply 'call-process-region |
| 585 | (if (boundp 'sendmail-program) | 585 | (append (list (point-min) (point-max) |
| 586 | sendmail-program | 586 | (if (boundp 'sendmail-program) |
| 587 | "/usr/lib/sendmail") | 587 | sendmail-program |
| 588 | nil errbuf nil "-oi") | 588 | "/usr/lib/sendmail") |
| 589 | ;; Always specify who from, | 589 | nil errbuf nil "-oi") |
| 590 | ;; since some systems have broken sendmails. | 590 | ;; Always specify who from, |
| 591 | (list "-f" (user-login-name)) | 591 | ;; since some systems have broken sendmails. |
| 592 | ;;; ;; Don't say "from root" if running under su. | 592 | (list "-f" (user-login-name)) |
| 593 | ;;; (and (equal (user-real-login-name) "root") | 593 | ;;; ;; Don't say "from root" if running under su. |
| 594 | ;;; (list "-f" (user-login-name))) | 594 | ;;; (and (equal (user-real-login-name) "root") |
| 595 | (and mail-alias-file | 595 | ;;; (list "-f" (user-login-name))) |
| 596 | (list (concat "-oA" mail-alias-file))) | 596 | (and mail-alias-file |
| 597 | ;; These mean "report errors by mail" | 597 | (list (concat "-oA" mail-alias-file))) |
| 598 | ;; and "deliver in background". | 598 | ;; These mean "report errors by mail" |
| 599 | (if (null mail-interactive) '("-oem" "-odb")) | 599 | ;; and "deliver in background". |
| 600 | ;; Get the addresses from the message | 600 | (if (null mail-interactive) '("-oem" "-odb")) |
| 601 | ;; unless this is a resend. | 601 | ;; Get the addresses from the message |
| 602 | ;; We must not do that for a resend | 602 | ;; unless this is a resend. |
| 603 | ;; because we would find the original addresses. | 603 | ;; We must not do that for a resend |
| 604 | ;; For a resend, include the specific addresses. | 604 | ;; because we would find the original addresses. |
| 605 | (or resend-to-addresses | 605 | ;; For a resend, include the specific addresses. |
| 606 | '("-t")))) | 606 | (or resend-to-addresses |
| 607 | '("-t"))))) | ||
| 607 | (if mail-interactive | 608 | (if mail-interactive |
| 608 | (save-excursion | 609 | (save-excursion |
| 609 | (set-buffer errbuf) | 610 | (set-buffer errbuf) |
| @@ -993,8 +994,6 @@ The seventh argument ACTIONS is a list of actions to take | |||
| 993 | ;;; (message "Auto save file for draft message exists; consider M-x mail-recover")) | 994 | ;;; (message "Auto save file for draft message exists; consider M-x mail-recover")) |
| 994 | ;;; t)) | 995 | ;;; t)) |
| 995 | (pop-to-buffer "*mail*") | 996 | (pop-to-buffer "*mail*") |
| 996 | (if (file-exists-p (expand-file-name "~/")) | ||
| 997 | (setq default-directory (expand-file-name "~/"))) | ||
| 998 | (auto-save-mode auto-save-default) | 997 | (auto-save-mode auto-save-default) |
| 999 | (mail-mode) | 998 | (mail-mode) |
| 1000 | ;; Disconnect the buffer from its visited file | 999 | ;; Disconnect the buffer from its visited file |
| @@ -1020,7 +1019,9 @@ The seventh argument ACTIONS is a list of actions to take | |||
| 1020 | (if (not (eq system-type 'vax-vms)) | 1019 | (if (not (eq system-type 'vax-vms)) |
| 1021 | (with-output-to-temp-buffer "*Directory*" | 1020 | (with-output-to-temp-buffer "*Directory*" |
| 1022 | (buffer-disable-undo standard-output) | 1021 | (buffer-disable-undo standard-output) |
| 1023 | (call-process "ls" nil standard-output nil "-l" file-name))) | 1022 | (let ((default-directory "/")) |
| 1023 | (call-process | ||
| 1024 | "ls" nil standard-output nil "-l" file-name)))) | ||
| 1024 | (yes-or-no-p (format "Recover auto save file %s? " file-name))) | 1025 | (yes-or-no-p (format "Recover auto save file %s? " file-name))) |
| 1025 | (let ((buffer-read-only nil)) | 1026 | (let ((buffer-read-only nil)) |
| 1026 | (erase-buffer) | 1027 | (erase-buffer) |