From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3l5htXAoKB2gSGXSYZXUTMMUUMRK.IUSTUZSaINTUZSaINSGOR.UXM@flex--marmstrong.bounces.google.com> Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B65D96DE1025 for ; Wed, 20 Feb 2019 10:12:41 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -7.791 X-Spam-Level: X-Spam-Status: No, score=-7.791 tagged_above=-999 required=5 tests=[AWL=-0.091, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] 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 EOX_uvd7ZyGf for ; Wed, 20 Feb 2019 10:12:40 -0800 (PST) Received: from mail-qt1-f202.google.com (mail-qt1-f202.google.com [209.85.160.202]) by arlo.cworth.org (Postfix) with ESMTPS id 9E1EA6DE0F2E for ; Wed, 20 Feb 2019 10:12:40 -0800 (PST) Received: by mail-qt1-f202.google.com with SMTP id y31so24020243qty.9 for ; Wed, 20 Feb 2019 10:12:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to; bh=VUpFuXgtWzD58e4kvrXv87in8qzmWgbYfb/ZCz7NFbI=; b=hI7wdK7Uzot/ugK2/GdWz+/Fly5ZVMTFnjMfRQxTAV6vN7IzDnQiWcl5ezHb4xWkjj DBszBX7SmC5tt+iSxDA4mbc9HUqAYB8TBx01JBcFmt16Yf1R3nnY6g/PTOl8imi/ZUHl 1FoYLlF3ibGovQeZ1n2nBahCOWi9Z2HPIiDrCxbXwOzaMPOsFpb2KW6oiAtpnprb/Zll ytc2xA0vIKQ9o1bT3PCA43faFs9KtiQk8EeXg2XCyXEP9N5C22nfl4YFcc/K9I5k8nWE OW1XDq3Qszl3zJi8thpBXjOvkyOIGIcyBc0Cod5ZkmfLmN89Hd87Rda73Udc97KGZtgU ADsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to; bh=VUpFuXgtWzD58e4kvrXv87in8qzmWgbYfb/ZCz7NFbI=; b=CAX5IiPK+aBDAPJESWG3N7YmCd7pR51ka8fB04LRnuE+wxVD4xvVq3uzHfZraOGRCt eW3x5eoC/Jybq8MqU6U6mW1zHu+1NwjQ40/N/Gv2nftlDgw6nihrJEy4YtO8UMQUA7xW b61Xah7Gk3V3q5/CXPMnl2DwN8vuDIQHX+GwVgodOKNHqT30zZd883Ib0UzFTgL6k2zF dYAmGBektCRJV10CCjxqoHx9eBq3dojBTVM1eL5oMmuyl8rDI9hdBNJwv13//jFzFgTH IjK/Oa+n9sGJXgF4Q+jODeQgfczoGm8gYNeQ8Mu7W0JAoGo5/BRtfPnOB6WJZxpHYkAy 1g4Q== X-Gm-Message-State: AHQUAubWl15SXQEsLiOdy7AFz1KZpUC8G9mectdh90HCdn4/UQo1DAGz uh/fwpcp54JNiNCzBVH4XOET7/abbFxpt62z X-Google-Smtp-Source: AHgI3IYDaz29eak1xPlylY15h2q3NxVwZ3WOJK2uTtUBas79mFv2f9wbzivvR0rk+W19G/8HjE5pdxKbn4nIWXBP X-Received: by 2002:ac8:2d34:: with SMTP id n49mr16476582qta.15.1550686359566; Wed, 20 Feb 2019 10:12:39 -0800 (PST) Date: Wed, 20 Feb 2019 10:12:37 -0800 In-Reply-To: Message-Id: Mime-Version: 1.0 References: <877edygman.fsf@tethera.net> Subject: Re: [Joerg Jaspert] Bug#922536: notmuch-emacs: notmuch breaks on directory removal From: Matt Armstrong To: Tomi Ollila , David Bremner , notmuch@notmuchmail.org Content-Type: text/plain; charset="UTF-8" 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: Wed, 20 Feb 2019 18:12:41 -0000 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'. 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.