diff options
author | Austin Clements <amdragon@MIT.EDU> | 2014-08-08 13:06:05 -0400 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-08-16 17:44:47 -0700 |
commit | c1845bf0a430b1d0bda6703246a1bcc8962175ab (patch) | |
tree | edec5c07dbc9086a93a820cb66877d76bc09955e | |
parent | f92342cb76fa3e1fa2f1c2e727f8ddf1a5c21b7d (diff) |
emacs: Improved compatibility for window-body-width in Emacs < 24
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.
-rw-r--r-- | emacs/notmuch-jump.el | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el index 05bbce5e..5eb0949b 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 @@ 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))))) |