unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: Fix byte compile warning on Emacs < 24
@ 2014-08-08 15:11 Austin Clements
  2014-08-08 17:06 ` [PATCH v2] emacs: Improved compatibility for window-body-width in " Austin Clements
  0 siblings, 1 reply; 4+ messages in thread
From: Austin Clements @ 2014-08-08 15:11 UTC (permalink / raw)
  To: notmuch

Fix "Warning: the function `window-body-width' is not known to be
defined." by moving our compatibility wrapper before its use.
---
 emacs/notmuch-jump.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 05bbce5..35082a6 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -25,6 +25,12 @@
 (require 'notmuch-lib)
 (require 'notmuch-hello)
 
+(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)))))
+
 ;;;###autoload
 (defun notmuch-jump-search ()
   "Jump to a saved search by shortcut key.
@@ -165,9 +171,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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] emacs: Improved compatibility for window-body-width in Emacs < 24
  2014-08-08 15:11 [PATCH] emacs: Fix byte compile warning on Emacs < 24 Austin Clements
@ 2014-08-08 17:06 ` Austin Clements
  2014-08-09 10:11   ` Tomi Ollila
  2014-08-17  0:48   ` David Bremner
  0 siblings, 2 replies; 4+ messages in thread
From: Austin Clements @ 2014-08-08 17:06 UTC (permalink / raw)
  To: notmuch

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.

 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] emacs: Improved compatibility for window-body-width in Emacs < 24
  2014-08-08 17:06 ` [PATCH v2] emacs: Improved compatibility for window-body-width in " Austin Clements
@ 2014-08-09 10:11   ` Tomi Ollila
  2014-08-17  0:48   ` David Bremner
  1 sibling, 0 replies; 4+ messages in thread
From: Tomi Ollila @ 2014-08-09 10:11 UTC (permalink / raw)
  To: Austin Clements, notmuch

On Fri, Aug 08 2014, Austin Clements <amdragon@MIT.EDU> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] emacs: Improved compatibility for window-body-width in Emacs < 24
  2014-08-08 17:06 ` [PATCH v2] emacs: Improved compatibility for window-body-width in " Austin Clements
  2014-08-09 10:11   ` Tomi Ollila
@ 2014-08-17  0:48   ` David Bremner
  1 sibling, 0 replies; 4+ messages in thread
From: David Bremner @ 2014-08-17  0:48 UTC (permalink / raw)
  To: Austin Clements, notmuch

Austin Clements <amdragon@MIT.EDU> writes:

> 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.

pushed.

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-17  0:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-08 15:11 [PATCH] emacs: Fix byte compile warning on Emacs < 24 Austin Clements
2014-08-08 17:06 ` [PATCH v2] emacs: Improved compatibility for window-body-width in " Austin Clements
2014-08-09 10:11   ` Tomi Ollila
2014-08-17  0:48   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).