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 AD3F4431FBC for ; Tue, 9 Feb 2010 20:07:55 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.715 X-Spam-Level: X-Spam-Status: No, score=-0.715 tagged_above=-999 required=5 tests=[AWL=-1.885, BAYES_50=0.001, DATE_IN_PAST_06_12=1.069, RDNS_DYNAMIC=0.1] autolearn=no 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 K4pVcDWzv7Sv for ; Tue, 9 Feb 2010 20:07:55 -0800 (PST) X-Greylist: delayed 1466 seconds by postgrey-1.32 at olra; Tue, 09 Feb 2010 20:07:55 PST Received: from hackervisions.org (67-207-143-141.slicehost.net [67.207.143.141]) by olra.theworths.org (Postfix) with ESMTP id 4E241431FAE for ; Tue, 9 Feb 2010 20:07:55 -0800 (PST) Received: from ool-18bd392a.dyn.optonline.net ([24.189.57.42] helo=wyzanski.hackervisions.org) by hv with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1Nf3U9-0005oF-8E; Tue, 09 Feb 2010 22:43:29 -0500 Date: Tue, 09 Feb 2010 16:33:14 -0500 Message-ID: <878wb2qelh.wl%james@hackervisions.org> From: James Vasile To: notmuch@notmuchmail.org X-Mailer: Wanderlust/2.15.6 User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1.50 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Mailman-Approved-At: Wed, 10 Feb 2010 09:45:27 -0800 Subject: [notmuch] notmuch.el patch for older emacs 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, 10 Feb 2010 04:07:55 -0000 Emacs22 lacks apply-partially and mouse-event-p, so define them if emacs version is less than 23. With this change, I was able to begin using notmuch in emacs22. apply-partially cribbed from http://notmuchmail.org/pipermail/notmuch/2009/000889.html diff --git a/notmuch.el b/notmuch.el index 97914f2..03b17f6 100644 --- a/notmuch.el +++ b/notmuch.el @@ -51,6 +51,21 @@ (require 'mm-view) (require 'message) +;; Old emacs lacks apply-partially and mouse-event-p +(when (<= emacs-major-version 23) + (defun apply-partially (fun &rest args) + "Return a function that is a partial application of FUN to ARGS. +ARGS is a list of the first N arguments to pass to FUN. +The result is a new function which does the same as FUN, except that +the first N arguments are fixed at the values with which this function +was called." + (lexical-let ((fun fun) (args1 args)) + (lambda (&rest args2) (apply fun (append args1 args2))))) + + (defun mouse-event-p (object) + "Return non-nil if OBJECT is a mouse click event." + (memq (event-basic-type object) '(mouse-1 mouse-2 mouse-3 mouse-movement)))) + (defvar notmuch-show-mode-map (let ((map (make-sparse-keymap))) (define-key map "?" 'notmuch-help)