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 00B3C431FBC for ; Mon, 28 Dec 2009 16:30:35 -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 cunruAUgiTjf for ; Mon, 28 Dec 2009 16:30:34 -0800 (PST) Received: from tarap.cc.columbia.edu (tarap.cc.columbia.edu [128.59.29.7]) by olra.theworths.org (Postfix) with ESMTP id 0DD9B431FAE for ; Mon, 28 Dec 2009 16:30:33 -0800 (PST) Received: from servo.finestructure.net (cpe-74-75-106-183.maine.res.rr.com [74.75.106.183]) (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0) by tarap.cc.columbia.edu (8.14.3/8.14.3) with ESMTP id nBT0UUcj002007 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 28 Dec 2009 19:30:31 -0500 (EST) Received: from jrollins by servo.finestructure.net with local (Exim 4.71) (envelope-from ) id 1NPPyn-0006Yh-IM; Mon, 28 Dec 2009 19:30:29 -0500 Date: Mon, 28 Dec 2009 19:30:29 -0500 From: Jameson Graef Rollins To: Tassilo Horn Message-ID: <20091229003029.GA4400@finestructure.net> References: <20091228211812.GA10885@finestructure.net> <87k4w691kd.fsf@thinkpad.tsdh.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline In-Reply-To: <87k4w691kd.fsf@thinkpad.tsdh.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.68 on 128.59.29.7 Cc: notmuch@notmuchmail.org Subject: Re: [notmuch] modifying emacs keymap 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: Tue, 29 Dec 2009 00:30:35 -0000 --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 28, 2009 at 11:27:30PM +0100, Tassilo Horn wrote: > > (add-hook 'notmuch-search-mode > > (define-key notmuch-search-mode-map "A" 'notmuch-show-mark-read-then-= archive-thread) > > ) >=20 > `notmuch-search-mode' is no hook, and even if it was, you couldn't add > what you like, because that's no function. You would need to define a > function that doesn that or wrap it in a lambda function. Thanks for the response, Tassilo. I should have explained that the command I used above did work in so far as it did make the new key available in the correct mode (notmuch-search-mode), as I could tell through the notmuch-help in the notmuch-search-mode. The command I used above has worked for me in other contexts, as I've found documented in a couple of different place on the net. I'm completely an elisp n00b, though, and I can't claim to understand why it worked. > Anyway, this should do the trick: >=20 > (define-key notmuch-search-mode-map "A" 'notmuch-show-mark-read-then-arch= ive-thread) As far as I can tell, this command works the same as the one I used above. It produces identical results. I realize now that the problem is that the notmuch-show-mark-read-then-archive-thread function is meant for notmuch-show-mode (as should have been clear to me via the name) and not for notmuch-search-mode. I manually created a new function for the appropriate mode, and that worked. Below is the code that I used that worked. Thanks for the help, and sorry for the spam. jamie. (defun notmuch-search-mark-read-then-archive-thread () "Mark thread as read (remove \"unread\" tag) and then archive (remove \"i= nbox\" tag). This function advances to the next thread when finished." (interactive) (notmuch-search-remove-tag "inbox") (notmuch-search-remove-tag "unread") (forward-line)) (define-key notmuch-search-mode-map "A" 'notmuch-search-mark-read-then-arch= ive-thread) --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: attachment -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBCAAGBQJLOU2cAAoJEO00zqvie6q8RAIQAI2WPK2OTReXtyDtqXzPIPst 78Fo01qy7esJvcTp0KvEtRlHzDubBOkMq7eqs++bSPWUjDuATiItfmCOK66xKACh uFjsfwMxJW90s7Gjwo/UuXaD0vJj5KS0ruaFdV++n35dHNURqPxkIJDnFHSCwRl/ X777Yi0daTMHRXMA/C9ixvTgAdLXStKmVQ/Hr9JSUYZQJbmmYXVWZMvtPUc+0BeB oj6nIvikt3F+b5VchJNWQ7AJnSqB1I5SVG3doXN9S9m0sJ0wD8vh5jiWayz65TKG f9tB1Yb/iapXeA8InHNOVKY6WL55v2XiPkG6czeH5UO9y5CP3LwXhpexYLXHKcRp AEZ3SjzDqxajxqp1xwFlJnLbgtgur7MOSZq/aEE/CI2ozNJ0Q4Rspw3kPS+NCshd GcUrxLR/xVNGeRcvoY555NkGHerDTTtnfaHV1TesWNMYvuSAL2TAiqBv11EJvDCh NYfv2II4s9QlJrMmgqjY5/vr5df7BynvFWbBQmaQ3gEZQFYpbCvhNGniWeZoiQRa R8TN2pqhQ/zZNe5RN7eKLFbWkfqZP+oMpOXAt7dTLLi3KIsdZyN0BRyhquwCW/nW VFnkDG64sWrqxGdthVgJ0R0lw/F6Yz6dM1GsH9Ex/uNv8fjqHvQPsYxAKZj9/66S wipi6Cb2OatoBB7ZKAFE =MHhB -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G--