From: Tomi Ollila Date: Sat, 9 Aug 2014 10:11:03 +0000 (+0300) Subject: Re: [PATCH v2] emacs: Improved compatibility for window-body-width in Emacs < 24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=338c73c07af577ddba8926b5cd47e7f2da3f000b;p=notmuch-archives.git Re: [PATCH v2] emacs: Improved compatibility for window-body-width in Emacs < 24 --- diff --git a/08/eec2dd0f02c598670a35868015e3175ddf7b62 b/08/eec2dd0f02c598670a35868015e3175ddf7b62 new file mode 100644 index 000000000..29950c508 --- /dev/null +++ b/08/eec2dd0f02c598670a35868015e3175ddf7b62 @@ -0,0 +1,105 @@ +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 38E0B431FAF + for ; Sat, 9 Aug 2014 03:11:23 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +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 SPDaDnsB7m4i for ; + Sat, 9 Aug 2014 03:11:17 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id A0284431FAE + for ; Sat, 9 Aug 2014 03:11:17 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 8C32D100051; + Sat, 9 Aug 2014 13:11:03 +0300 (EEST) +From: Tomi Ollila +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH v2] emacs: Improved compatibility for window-body-width + in Emacs < 24 +In-Reply-To: <1407517565-24490-1-git-send-email-amdragon@mit.edu> +References: <1407510680-17576-1-git-send-email-amdragon@mit.edu> + <1407517565-24490-1-git-send-email-amdragon@mit.edu> +User-Agent: Notmuch/0.18.1+25~gdaf4b6f (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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: Sat, 09 Aug 2014 10:11:23 -0000 + +On Fri, Aug 08 2014, Austin Clements wrote: + +> Fix byte compiler warning "Warning: the function `window-body-width' +> is not known to be defined." by moving our compatibility wrapper +> before its use and simplify the definition to a defalias for the old +> name of the function. +> --- +> +> Tomi pointed out that window-body-width simply used to be called +> window-width, so this simplifies the wrapper to a defalias. + +LGTM. Tested w/ (notmuch-jump nil "foo") in emacs 23.1.1 -- call failed +but after calling (window-body-width). + +Tomi + + +> +> emacs/notmuch-jump.el | 10 ++++------ +> 1 file changed, 4 insertions(+), 6 deletions(-) +> +> diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el +> index 05bbce5..5eb0949 100644 +> --- a/emacs/notmuch-jump.el +> +++ b/emacs/notmuch-jump.el +> @@ -25,6 +25,10 @@ +> (require 'notmuch-lib) +> (require 'notmuch-hello) +> +> +(unless (fboundp 'window-body-width) +> + ;; Compatibility for Emacs pre-24 +> + (defalias 'window-body-width 'window-width)) +> + +> ;;;###autoload +> (defun notmuch-jump-search () +> "Jump to a saved search by shortcut key. +> @@ -165,9 +169,3 @@ (defun notmuch-jump--make-keymap (action-map) +> (setq notmuch-jump--action ',(third action)) +> (exit-minibuffer)))) +> map)) +> - +> -(unless (fboundp 'window-body-width) +> - ;; Compatibility for Emacs pre-24 +> - (defun window-body-width (&optional window) +> - (let ((edges (window-inside-edges window))) +> - (- (caddr edges) (car edges))))) +> -- +> 2.0.0 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch