GNU bug report logs -
#77263
MH-E: want all folder buffers to use $HOME as default-directory
Previous Next
Reported by: Stephen Gildea <stepheng+emacs <at> gildea.com>
Date: Tue, 25 Mar 2025 21:08:02 UTC
Severity: wishlist
Tags: patch
Found in version 30.1
Done: Stephen Gildea <stepheng+emacs <at> gildea.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Version: 30.1
Severity: wishlist
Tags: patch
An MH-E folder buffer inherits the default-directory of the
buffer you happened to be in when you gave the command 'mh-rmail'.
This seems arbitrary in general, and inconvenient when the
current directory happens to be remote. With a remote
directory, Emacs tries to do remote things in the background,
and all I'm trying to do is read my (local) email.
The following patch would fix the problem. It introduces a new
variable 'mh-default-directory', which defaults to $HOME.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index e507996c581..ca829c6cf3c 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -144,6 +144,9 @@ mh-lib-progs
;;;###autoload
(put 'mh-lib-progs 'risky-local-variable t)
+(defvar mh-default-directory "~/"
+ "Default directory for MH-E folder buffers.")
+
;; Profile Components
(defvar mh-draft-folder nil
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 5009c2c4f98..43b4c98ef01 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -51,9 +51,12 @@ mh-rmail
(interactive "P")
(mh-find-path)
(if arg
- (call-interactively 'mh-visit-folder)
+ (progn
+ (call-interactively 'mh-visit-folder)
+ (cd-absolute mh-default-directory))
(unless (get-buffer mh-inbox)
- (mh-visit-folder mh-inbox (symbol-name mh-unseen-seq)))
+ (mh-visit-folder mh-inbox (symbol-name mh-unseen-seq))
+ (cd-absolute mh-default-directory))
(mh-inc-folder)))
;;;###autoload
@@ -67,6 +70,7 @@ mh-nmail
(mh-find-path) ; init mh-inbox
(if arg
(call-interactively 'mh-visit-folder)
- (mh-visit-folder mh-inbox)))
+ (mh-visit-folder mh-inbox))
+ (cd-absolute mh-default-directory))
This bug report was last modified 53 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.