diff options
| author | Stephen Gildea | 2025-03-27 14:54:47 -0700 |
|---|---|---|
| committer | Stephen Gildea | 2025-03-27 14:57:14 -0700 |
| commit | 01f4a0cb6cb15fbbc28e64abd94cb38604a24672 (patch) | |
| tree | 30d6d76be1e3a93ea7931b481e325113e2760f5b | |
| parent | 364c3dbc12e7b6d41ab449dd495c96d08874310e (diff) | |
| download | emacs-01f4a0cb6cb15fbbc28e64abd94cb38604a24672.tar.gz emacs-01f4a0cb6cb15fbbc28e64abd94cb38604a24672.zip | |
MH-E: set default-directory to HOME on entry
* lisp/mh-e/mh-e.el (mh-default-directory, mh-set-default-directory):
New variable (defaults to "~/"), new function to use it.
* lisp/mh-e/mh-folder.el (mh-rmail, mh-nmail): Call
mh-set-default-directory on entry to MH-E (closes: bug#77263).
| -rw-r--r-- | lisp/mh-e/mh-e.el | 10 | ||||
| -rw-r--r-- | lisp/mh-e/mh-folder.el | 10 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index e507996c581..f64b02c7bca 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el | |||
| @@ -144,6 +144,10 @@ This directory contains, among other things, the mhl program.") | |||
| 144 | ;;;###autoload | 144 | ;;;###autoload |
| 145 | (put 'mh-lib-progs 'risky-local-variable t) | 145 | (put 'mh-lib-progs 'risky-local-variable t) |
| 146 | 146 | ||
| 147 | (defvar mh-default-directory "~/" | ||
| 148 | "Default directory for MH-E folder buffers. | ||
| 149 | Set to nil to have MH-E buffers inherit default-directory.") | ||
| 150 | |||
| 147 | ;; Profile Components | 151 | ;; Profile Components |
| 148 | 152 | ||
| 149 | (defvar mh-draft-folder nil | 153 | (defvar mh-draft-folder nil |
| @@ -438,6 +442,12 @@ gnus-version) | |||
| 438 | (error "Bad element: %s" element)))) | 442 | (error "Bad element: %s" element)))) |
| 439 | new-list)) | 443 | new-list)) |
| 440 | 444 | ||
| 445 | (defun mh-set-default-directory () | ||
| 446 | "Set `default-directory' to `mh-default-directory' unless it is nil." | ||
| 447 | (when (stringp mh-default-directory) | ||
| 448 | (setq default-directory (file-name-as-directory | ||
| 449 | (expand-file-name mh-default-directory))))) | ||
| 450 | |||
| 441 | 451 | ||
| 442 | 452 | ||
| 443 | ;;; MH-E Process Support | 453 | ;;; MH-E Process Support |
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 5009c2c4f98..e0c53724f9c 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el | |||
| @@ -51,9 +51,12 @@ the MH mail system." | |||
| 51 | (interactive "P") | 51 | (interactive "P") |
| 52 | (mh-find-path) | 52 | (mh-find-path) |
| 53 | (if arg | 53 | (if arg |
| 54 | (call-interactively 'mh-visit-folder) | 54 | (progn |
| 55 | (call-interactively 'mh-visit-folder) | ||
| 56 | (mh-set-default-directory)) | ||
| 55 | (unless (get-buffer mh-inbox) | 57 | (unless (get-buffer mh-inbox) |
| 56 | (mh-visit-folder mh-inbox (symbol-name mh-unseen-seq))) | 58 | (mh-visit-folder mh-inbox (symbol-name mh-unseen-seq)) |
| 59 | (mh-set-default-directory)) | ||
| 57 | (mh-inc-folder))) | 60 | (mh-inc-folder))) |
| 58 | 61 | ||
| 59 | ;;;###autoload | 62 | ;;;###autoload |
| @@ -67,7 +70,8 @@ the MH mail system." | |||
| 67 | (mh-find-path) ; init mh-inbox | 70 | (mh-find-path) ; init mh-inbox |
| 68 | (if arg | 71 | (if arg |
| 69 | (call-interactively 'mh-visit-folder) | 72 | (call-interactively 'mh-visit-folder) |
| 70 | (mh-visit-folder mh-inbox))) | 73 | (mh-visit-folder mh-inbox)) |
| 74 | (mh-set-default-directory)) | ||
| 71 | 75 | ||
| 72 | 76 | ||
| 73 | ;;; Desktop Integration | 77 | ;;; Desktop Integration |