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 1360F431FC2 for ; Fri, 27 Nov 2009 06:18:03 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 ksDh7tW27pby for ; Fri, 27 Nov 2009 06:18:01 -0800 (PST) Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com [209.85.218.224]) by olra.theworths.org (Postfix) with ESMTP id 58078431FAE for ; Fri, 27 Nov 2009 06:18:01 -0800 (PST) Received: by bwz24 with SMTP id 24so1228361bwz.30 for ; Fri, 27 Nov 2009 06:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:subject :in-reply-to:references:date:message-id:mime-version:content-type; bh=3skrouN9G9eu534fpbIKKdLlBQ+FNeNpUSCfCH/7+DA=; b=u2ZsvivdPxBfgRAA/ROABYzhoteAxiIod+rZ+WphxVzLQpl7yy6ePi7XNWO0F+5yhs lECfhTrTU+nG5pNP4R7y/mjOMWeJ+fuz2SnlNHPeMxg04YrRAmA01gTcnXZsfvUZq72b gWm4eg6xFSRO6FlgSlO18wjs9xoBsUlUWEyiQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; b=E4K/EoXrUX97toViEAn+qPAr5rpztFD99dVkydIjYd3UoiZ97g9MbIWcgxc+dq1TL+ 2zTCgSyzCHlQ4mY4ZMFf97HBDHtQmUKBGuDSmJXDj5OCcuAK7ghAw6H0uSGdn+/F3jkx onBQxpZDFhJniRnbP+LXsf5XJ3xodlbwhvffI= Received: by 10.204.3.211 with SMTP id 19mr1105668bko.153.1259331480081; Fri, 27 Nov 2009 06:18:00 -0800 (PST) Received: from kunyang (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id y15sm2078987fkd.26.2009.11.27.06.17.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 27 Nov 2009 06:17:58 -0800 (PST) Sender: Jed Brown From: Jed Brown To: Carl Worth , notmuch@notmuchmail.org In-Reply-To: <87bpioqe3r.fsf@yoom.home.cworth.org> References: <1259094131-32405-1-git-send-email-jed@59A2.org> <1259087712-18844-1-git-send-email-jed@59A2.org> <87my2bfyyj.fsf@59A2.org> <87bpioqe3r.fsf@yoom.home.cworth.org> Date: Fri, 27 Nov 2009 15:18:31 +0100 Message-ID: <87tywgdpag.fsf@59A2.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: [notmuch] [PATCH] New function notmuch-show-kill-ring-save-message-id. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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: Fri, 27 Nov 2009 14:18:03 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Fri, 27 Nov 2009 05:41:44 -0800, Carl Worth wrote: > Thanks for the patch, Jed, I almost pushed it, but noticed that it's > calling `called-interactively-p' with an argument even though that > function does not accept an argument. My docs say it does take an argument: called-interactively-p is a built-in function in `C source code'. =20=20 (called-interactively-p KIND) =20=20 Return t if the containing function was called by `call-interactively'. If KIND is `interactive', then only return t if the call was made interactively by the user, i.e. not in `noninteractive' mode nor when `executing-kbd-macro'. If KIND is `any', on the other hand, it will return t for any kind of interactive call, including being called as the binding of a key, or from a keyboard macro, or in `noninteractive' mode. =20=20 The only known proper use of `interactive' for KIND is in deciding whether to display a helpful message, or how to display it. If you're thinking of using it for any other purpose, it is quite likely that you're making a mistake. Think: what do you want to do when the command is called from a keyboard macro? =20=20 This function is meant for implementing advice and other function-modifying features. Instead of using this, it is sometimes cleaner to give your function an extra optional argument whose `interactive' spec specifies non-nil unconditionally ("p" is a good way to do this), or via (not (or executing-kbd-macro noninteractive)). > Meanwhile, the documentation of called-interactively-p suggests that > using (interactive "p") is an easier way to check whether the function > is called interactively. I thought my usage fell precisely under "in deciding whether to display a helpful message, or how to display it". This message is just noise if executed inside a macro. As further evidence, see copy-region-as-kill (simple.el): ;; This use of called-interactively-p is correct ;; because the code it controls just gives the user visual feedback. (if (called-interactively-p 'interactive) Let me know if you still want me to change it. > No, "git send-email" wouldn't strip that since it's a custom thing for > notmuch. Of course, I was just sloppy when pasting it into my shell, which rubbed this issue in my face: > So for passing the thread ID to notmuch users, the "id:" prefix is > convenient. For passing it not non-notmuch-based consumers it won't be > desired. And that's hard to fix. I'm thinking of having a prefix determine whether it is stripped or not. Do you have a preference about which is the non-prefix behavior? > I think long-term, a good solution would be to switch from "id:foo" to > "" as the syntax for message-ID-based search strings. That's then a > syntax that almost any consumer of a message ID should be prepared to > accept. Downside is that it requires shell escapes when pasting into a terminal. Jed --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAksP37cACgkQU7Rz1O1Q6otDFgCgrggpYHTKhp7Ijvtbk/ZW+XtK xdYAnAkqz/UY/jMYBO19b6Lrt7pDGAND =cNMu -----END PGP SIGNATURE----- --=-=-=--