From 59760e0886aa66e1f9fa1a0efe1e16787a0dd0f1 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 21 Jan 2015 11:38:19 +0200 Subject: [PATCH] Re: [DRAFT PATCH v2] modified notmuch-emacs-mua v2 --- 1e/19a7036e5d872c531560e0d2de4f67ba752bc8 | 127 ++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 1e/19a7036e5d872c531560e0d2de4f67ba752bc8 diff --git a/1e/19a7036e5d872c531560e0d2de4f67ba752bc8 b/1e/19a7036e5d872c531560e0d2de4f67ba752bc8 new file mode 100644 index 000000000..3629c6bde --- /dev/null +++ b/1e/19a7036e5d872c531560e0d2de4f67ba752bc8 @@ -0,0 +1,127 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 3AB86431FC9 + for ; Wed, 21 Jan 2015 01:38:44 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id zmTb555NAIYi for ; + Wed, 21 Jan 2015 01:38:41 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id D3AD1431FBC + for ; Wed, 21 Jan 2015 01:38:40 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id A22A61000E0; + Wed, 21 Jan 2015 11:38:19 +0200 (EET) +From: Tomi Ollila +To: David Bremner , notmuch@notmuchmail.org, + Jani Nikula +Subject: Re: [DRAFT PATCH v2] modified notmuch-emacs-mua v2 +In-Reply-To: <87ppa9xor8.fsf@maritornes.cs.unb.ca> +References: <1421598115-4889-1-git-send-email-david@tethera.net> + <1421776424-24304-1-git-send-email-tomi.ollila@iki.fi> + <87ppa9xor8.fsf@maritornes.cs.unb.ca> +User-Agent: Notmuch/0.19+29~g7367d27 (http://notmuchmail.org) Emacs/24.3.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.13 +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, 21 Jan 2015 09:38:44 -0000 + +On Tue, Jan 20 2015, David Bremner wrote: + +> Tomi Ollila writes: +> +>> This is second draft patch of (first being) +>> +>> id:1405026779-29966-1-git-send-email-tomi.ollila@iki.fi +>> +>> I saw potential problem with only supporting emacsclient(1) in +>> the version David sent: +>> id:1421598115-4889-1-git-send-email-david@tethera.net +>> +>> (no emacs server running and no tty -- new X client not started) +>> +> +> I don't understand what use case is failing for you. I think I tested +> all 4 combinations of DISPLAY set and unset and emacs server running and +> not running. Do you somehow want to run the notmuch-emacs-mua script +> from a process not attached to a terminal (from cron?). + +It seems that you have done good testing and I just failed to test using +exactly the same options you have: + +emacsclient -c -a '' .zshrc + +Works as one'd expect to work successfully in all cases, DISPLAY set/unset +and emacs-server running or not (now deleting 6 lines of text below that +was based on wrong assumtions...) + +// 6 lines of text deleted ... :) // + +So, the question goes into deciding whether the magic of starting emacs +server to the user if it is not running -- something that many users would +not anticipate/desire (I am one of those)... + +Running emacs via emacsclient has subtle differences to just running emacs +the "regular" way -- while testing I just had problems exiting the +emacsclient session without exiting the whole emacs -- I exited the whole +emacs and next time paid attention to minibuffer message saying c-x 5 0 +exits the session... +Now that I got the tests work as David would have expected me to do those, +the frame emacs started looked different that my emacs frames have when +starting "normally" -- there was extra toolbar in the frame (I have +inhibited all menu and toolbars in my normal setup). Just that it behaves +differently is suspicious. + +Therefore, IMO it is clearer to run "regular" emacs unless user is +explicitly running emacs-server and can anticipate the behaviour +differences when running emacsclient there. + + +>> In case emacsclient(1) is used and no --no-window-system, '-c' arg is +>> given to emacsclient like in the version David sent. +>> +>> (this means that if emacs is not running on X, user may get this message: +>> "emacsclient: could not get terminal name" -- we need to document user +>> to give -nw (--no-window-system) option then) +> +> As I wrote above, I'm missing what the tradeoff is. The version I sent +> works fine (at least for me) in the case where DISPLAY is not set and +> --no-window-system is not given (i.e. it's implied if DISPLAY is not +> set). + +Ok, my tests failed colossally here. Sorry. First, I forgot to have +-a '' there (for comparison) and secondly I closed stdout before +running emacsclient (bug in the script). + +That's what you get after almost 3 hours of vigorous hacking there; the +manual test coverage is probably not the best possible... + +> +> d + +Tomi -- 2.26.2