From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id A3EFF6DE10A4 for ; Thu, 21 Feb 2019 09:18:23 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.46 X-Spam-Level: X-Spam-Status: No, score=0.46 tagged_above=-999 required=5 tests=[AWL=-0.192, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yls1JKOxk4QW for ; Thu, 21 Feb 2019 09:18:21 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 2F4626DE109F for ; Thu, 21 Feb 2019 09:18:20 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id AC856100063; Thu, 21 Feb 2019 19:18:16 +0200 (EET) From: Tomi Ollila To: Matt Armstrong , David Bremner , notmuch@notmuchmail.org Subject: Re: [Joerg Jaspert] Bug#922536: notmuch-emacs: notmuch breaks on directory removal In-Reply-To: References: <877edygman.fsf@tethera.net> User-Agent: Notmuch/0.28+29~ga10f231 (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 17:18:23 -0000 On Wed, Feb 20 2019, Matt Armstrong wrote: > Tomi Ollila 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