emacs: Improved compatibility for window-body-width in Emacs < 24
authorAustin Clements <amdragon@MIT.EDU>
Fri, 8 Aug 2014 17:06:05 +0000 (13:06 -0400)
committerDavid Bremner <david@tethera.net>
Sun, 17 Aug 2014 00:44:47 +0000 (17:44 -0700)
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.

emacs/notmuch-jump.el

index 05bbce5eaeadb8d8866749059c90b13b9d76e867..5eb0949be0c3757f2e26c84ad6bb3c42b978062b 100644 (file)
 (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 @@ buffer."
           (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)))))