From: Tomi Ollila <tomi.ollila@iki.fi>
To: Matt Armstrong <marmstrong@google.com>,
David Bremner <david@tethera.net>,
notmuch@notmuchmail.org
Subject: Re: [Joerg Jaspert] Bug#922536: notmuch-emacs: notmuch breaks on directory removal
Date: Thu, 21 Feb 2019 19:18:16 +0200 [thread overview]
Message-ID: <m2h8cxjc13.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <qf5ef82tjl6.fsf@naz.kir.corp.google.com>
On Wed, Feb 20 2019, Matt Armstrong wrote:
> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>> On Sun, Feb 17 2019, David Bremner wrote:
>>
>>> Seems like reasonable complaint. It should be possible to change to
>>> the maildir root, but probably requires shelling out to notmuch
>>> config get the value.
>>
>> Hmm. what does other emacs software do in that case ?
>>
>> Since OTOH I can think of a situation where I run emacs when located
>> on a directory. from *scratch* buffer I launch notmuch-hello, then I
>> press 'm' to compose new mail and c-x i (insert-file) ... Now I'd
>> expect to be located on the same directory instead of my mail buffer
>> is suddenly cd'd to totally different location (*)
>>
>> Tomi
>>
>> (*) that would be comparable annoying like my experience when using
>> ultimaker cura: have to run it with
>> $ HOME=$PWD /path/to/cura $PWD/file.stl
>> to have it working as i'd expect software to locate input and
>> output directories/files (it sure never default to current dir)
>
> I think David's original message was not specific about exactly how the
> directory might be changed. There are two separable questions here:
>
> a) should notmuch-lib.el use whatever `default-directory' was in effect
> when, say, M-x notmuch was run when running notmuch sub-commands
> (i.e. when executing `call-process').
>
> b) if (a) is "no", then in what way should `default-directory' be
> changed?
>
> I think (a) is probably "yes" -- it is possible to run M-x notmuch while
> under any directory, but it makes little sense to run the notmuch
> sub-commands from the same directory.
>
> I think (b) has multiple answers.
>
> 1) The `default-directory' could be set to something predictable each
> notmuch mode (hello, etc.).
>
> 2) The `default-directory' could be let-bound to something reasonable,
> like (expand-file-name "~"), around each call to `call-proccess'.
Yes, (2) this seems pretty good alternative (3) is just...
Is `(expand-file-name` -part needed: for me default-directory seems to
start with ~ whenever I test-start emacs in subdirectory of $HOME (*)
Tomi
(*) Emacs expands ~ to $HOME (the usual case) -- some other software
(uses the home directory in password database to expand ~
(e.g. in openssh config example ControlPath ~/.ssh/master-%r@%h:%p).
> 3) Notmuch could limit option (2) to those cases where the current
> diretory seems inaccessible.
>
> I think (2) is probably the best option.
>
> Emacs itself sets a bit of a precedent here. If `default-directory' is
> a remote file system (I suppose this is tramp?) then `call-process' runs
> the command under "~" instead.
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2019-02-21 17:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-17 21:03 [Joerg Jaspert] Bug#922536: notmuch-emacs: notmuch breaks on directory removal David Bremner
2019-02-18 22:18 ` Tomi Ollila
2019-02-20 18:12 ` Matt Armstrong
2019-02-21 17:18 ` Tomi Ollila [this message]
2019-02-26 12:34 ` David Bremner
2021-08-29 19:23 ` Wrap process creating primitives with safe CWD David Bremner
2021-08-29 19:23 ` [PATCH 1/9] test/emacs: provide macro test-log-error David Bremner
2021-08-29 19:23 ` [PATCH 2/9] test/emacs: run notmuch-hello with a nonexisting default dir David Bremner
2021-08-29 19:23 ` [PATCH 3/9] emacs: wrap process-lines David Bremner
2021-08-29 19:23 ` [PATCH 4/9] emacs: wrap call-process-region David Bremner
2021-08-29 19:23 ` [PATCH 5/9] test/emacs: test for notmuch-search with nonexistent CWD David Bremner
2021-08-29 19:23 ` [PATCH 6/9] emacs: wrap make-process David Bremner
2021-08-29 19:23 ` [PATCH 7/9] test/emacs: test for notmuch-show with nonexistent CWD David Bremner
2021-08-29 19:23 ` [PATCH 8/9] emacs: wrap call-process David Bremner
2021-08-29 19:23 ` [PATCH 9/9] test/emacs: tests for notmuch-{tree,unthreaded} with bad CWD David Bremner
2021-09-11 14:35 ` Wrap process creating primitives with safe CWD David Bremner
2021-09-11 14:49 ` [Joerg Jaspert] Bug#922536: notmuch-emacs: notmuch breaks on directory removal David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2h8cxjc13.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=david@tethera.net \
--cc=marmstrong@google.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).