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 C6670431FBD for ; Sat, 27 Feb 2010 17:35:03 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.005 X-Spam-Level: X-Spam-Status: No, score=0.005 tagged_above=-999 required=5 tests=[AWL=-0.096, BAYES_50=0.001, 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 3nlJywHlyIEK for ; Sat, 27 Feb 2010 17:35:03 -0800 (PST) Received: from hackervisions.org (67-207-143-141.slicehost.net [67.207.143.141]) by olra.theworths.org (Postfix) with ESMTP id 32408431FAE for ; Sat, 27 Feb 2010 17:35:03 -0800 (PST) Received: from ool-18bd392a.dyn.optonline.net ([24.189.57.42] helo=localhost) by hv with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1NlY3c-0000Ho-DR; Sat, 27 Feb 2010 20:34:56 -0500 From: James Vasile To: notmuch@notmuchmail.org In-Reply-To: <878wb2qelh.wl%james@hackervisions.org> References: <878wb2qelh.wl%james@hackervisions.org> Date: Sat, 27 Feb 2010 20:34:45 -0500 Message-ID: <87635idtxm.fsf@hackervisions.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [notmuch] [PATCH] compatibility with emacs22 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: Sun, 28 Feb 2010 01:35:04 -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 This is an updated patch that fixes a bug in the last version. --- notmuch.el | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/notmuch.el b/notmuch.el index 5577dde..20e82f1 100644 --- a/notmuch.el +++ b/notmuch.el @@ -67,6 +67,21 @@ (fset 'notmuch-show-stash-map notmuch-show-stash-map) +;; Old emacs lacks apply-partially +(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) -- 1.6.3.3