GNU bug report logs - #77263
MH-E: want all folder buffers to use $HOME as default-directory

Previous Next

Package: emacs;

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Gildea <stepheng+emacs <at> gildea.com>, Bill Wohler <wohler <at> newt.com>
Cc: 77263 <at> debbugs.gnu.org
Subject: bug#77263: MH-E: want all folder buffers to use $HOME as default-directory
Date: Wed, 26 Mar 2025 14:16:20 +0200
> From: Stephen Gildea <stepheng+emacs <at> gildea.com>
> Date: Tue, 25 Mar 2025 14:07:33 -0700
> 
> 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.

Bill, any comments?

> --- 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))
>  

I wonder if calling cd-absolute here is really a good idea.  That
function could signal an error, and it insists on the directory being
an existing accessible directory.  Is it a good idea to potentially
screw up starting MH-E if the directory happens to be problematic?
Why not simply set the default-directory of the buffer instead?

However, I'm not using MH-E, so feel free to disregard the above.

Thanks.




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.