unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: Tomi Ollila <tomi.ollila@iki.fi>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] make (kill-emacs) from emacsclient work with emacs 23.(1|2)
Date: Wed, 11 Jan 2012 23:13:44 -0500	[thread overview]
Message-ID: <20120112041344.GZ20796@mit.edu> (raw)
In-Reply-To: <1326293378-25248-1-git-send-email-tomi.ollila@iki.fi>

This is important to fix, but this solution seems needlessly
roundabout.  What about using an after-advice and simply delq'ing
whatever the offending hook is?  That wouldn't even need a version
check.

Quoth Tomi Ollila on Jan 11 at  4:49 pm:
> emacsclient --eval '(kill-emacs)' doesn't work without interactive
> user input. By removing the hook which asks user input makes things
> work well enough in our test cases.
> ---
>  test/test-lib.el |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/test/test-lib.el b/test/test-lib.el
> index 3b817c3..c52854e 100644
> --- a/test/test-lib.el
> +++ b/test/test-lib.el
> @@ -26,6 +26,19 @@
>  ;; `read' call.
>  (setq read-file-name-function (lambda (&rest _) (read)))
>  
> +;; Work around a bug in emacs 23.1 and emacs 23.2 which prevents
> +;; noninteractive (kill-emacs) from emacsclient.
> +(when (and (= emacs-major-version 23) (< emacs-minor-version 3))
> +  (require 'server)
> +  (fset 'server-start-real (symbol-function 'server-start))
> +  (defun server-start (&optional leave-dead)
> +    (interactive "P")
> +    (let ((hc (length kill-emacs-hook)))
> +      (unwind-protect
> +	  (server-start-real leave-dead)
> +	(if (> (length kill-emacs-hook) hc)
> +	    (setq kill-emacs-hook (cdr kill-emacs-hook)))))))
> +
>  (defun notmuch-test-wait ()
>    "Wait for process completion."
>    (while (get-buffer-process (current-buffer))

  reply	other threads:[~2012-01-12  4:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-01 10:05 Possible bug in tests with emacs 23.2.1 (debian stable) Mark Walters
2012-01-02 14:55 ` Tomi Ollila
2012-01-03 13:07   ` Tomi Ollila
2012-01-03 20:19     ` Mark Walters
2012-01-11 14:49       ` [PATCH] make (kill-emacs) from emacsclient work with emacs 23.(1|2) Tomi Ollila
2012-01-12  4:13         ` Austin Clements [this message]
2012-01-12  8:51           ` Tomi Ollila
2012-01-12 17:02             ` Austin Clements
2012-01-13  8:17               ` [PATCH] test: " Tomi Ollila
2012-01-13 19:18                 ` Austin Clements
2012-01-22 13:20                 ` 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=20120112041344.GZ20796@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /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).