From 0690672fdd5e78657a58f41bfc629aa5b92fbad5 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 24 Oct 2015 20:49:26 +0100 Subject: [PATCH] [PATCH] fix compilation on emacs23 --- a6/56691424adbdde20b4bd9a476882b6ed622854 | 116 ++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 a6/56691424adbdde20b4bd9a476882b6ed622854 diff --git a/a6/56691424adbdde20b4bd9a476882b6ed622854 b/a6/56691424adbdde20b4bd9a476882b6ed622854 new file mode 100644 index 000000000..e10959ea4 --- /dev/null +++ b/a6/56691424adbdde20b4bd9a476882b6ed622854 @@ -0,0 +1,116 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 1330C6DE1766 + for ; Sat, 24 Oct 2015 12:49:39 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.072 +X-Spam-Level: +X-Spam-Status: No, score=-0.072 tagged_above=-999 required=5 tests=[AWL=0.498, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, + RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id JyeXmawf-4sV for ; + Sat, 24 Oct 2015 12:49:36 -0700 (PDT) +Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com + [209.85.212.179]) + by arlo.cworth.org (Postfix) with ESMTPS id C9C326DE1764 + for ; Sat, 24 Oct 2015 12:49:35 -0700 (PDT) +Received: by wicll6 with SMTP id ll6so68595672wic.0 + for ; Sat, 24 Oct 2015 12:49:34 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=zfVlfbVZZafQuhJulAKYhVGVZZYmlLQ7w6wlHt7E0uU=; + b=M5v5tQN6gNslUM1QrBnRV1dn0YTJ7//VNptLxEYn0V4wmxOW/0i+Qt6Xs5Nb/sLOsS + vXNKTi85nNJsw6WKtLuARLDWnlcPdvKlVntggbFvdRBZ5OPI3/fA+powKPKOtrlspP5Z + CCL9OubUlgZttoVpLiEYoQeCqdkJpuxnNm9TuVHcQRSvpDQUTfNyNJF/TWB97NlfoGQq + Lt3CcKp873/5pkvaX3x89pEdVM3fvMJATjFvSWSvyR3t24mQ/7tHVSCOrQY0cz+ZSPPo + yJDmppk+F35J0i8BHkNeWxzP2De4fgxDEUBHh60CztQ/9rDsPf4Bb2nfYl2pOwVTP1qI + oruw== +X-Received: by 10.194.71.84 with SMTP id s20mr11738148wju.89.1445716173724; + Sat, 24 Oct 2015 12:49:33 -0700 (PDT) +Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) + by smtp.gmail.com with ESMTPSA id w9sm8235373wjf.20.2015.10.24.12.49.32 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sat, 24 Oct 2015 12:49:32 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH] fix compilation on emacs23 +Date: Sat, 24 Oct 2015 20:49:26 +0100 +Message-Id: <1445716166-26030-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1445708484-32189-4-git-send-email-david@tethera.net> +References: <1445708484-32189-4-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Sat, 24 Oct 2015 19:49:39 -0000 + +The series so far does not compile on emacs23. The two problems are +that cl-lib doesn't exist and that defvar-local is not defined. The +latter can trivially be replaced by defvar followed by +make-variable-buffer-local. + +For the former just require 'cl as we do elsewhere, and change the one +call to a cl function, namely to cl-case to case. +--- +Lightly tested and seems to compile and work on emacs 23 and emacs 24. + +Best wishes + +Mark + + +emacs/notmuch-company.el | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el +index 03c492f..a9e769c 100644 +--- a/emacs/notmuch-company.el ++++ b/emacs/notmuch-company.el +@@ -1,6 +1,5 @@ + ;; notmuch-company.el --- Mail address completion for notmuch via company-mode -*- lexical-binding: t -*- + +- + ;; Authors: Trevor Jim + ;; Michal Sojka + ;; +@@ -30,9 +29,10 @@ + ;;; Code: + + (require 'notmuch-address) +-(require 'cl-lib) ++(eval-when-compile (require 'cl)) + +-(defvar-local notmuch-company-last-prefix nil) ++(defvar notmuch-company-last-prefix nil) ++(make-variable-buffer-local 'notmuch-company-last-prefix) + (declare-function company-begin-backend "company") + (declare-function company-grab "company") + +@@ -43,7 +43,7 @@ (defun notmuch-company (command &optional arg &rest _ignore) + (require 'company) + (let ((case-fold-search t) + (completion-ignore-case t)) +- (cl-case command ++ (case command + (interactive (company-begin-backend 'notmuch-company)) + (prefix (and (derived-mode-p 'message-mode) + (looking-back "^\\(To\\|Cc\\|Bcc\\):.*" +-- +2.1.4 + -- 2.26.2