emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f22a16a: * lisp/windmove.el: Support more prefix ar


From: Juri Linkov
Subject: [Emacs-diffs] master f22a16a: * lisp/windmove.el: Support more prefix args (bug#32790)
Date: Thu, 15 Nov 2018 18:10:02 -0500 (EST)

branch: master
commit f22a16ae066cc512322f115c2098837d74feeff8
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * lisp/windmove.el: Support more prefix args (bug#32790)
    
    * lisp/windmove.el (windmove-left, windmove-up, windmove-right)
    (windmove-down): Use prefix-numeric-value to support more prefix args
    like 'C-u' and 'M--'.  Doc fix.
---
 etc/NEWS         |  1 +
 lisp/windmove.el | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 76531f2..4f3b9a9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -371,6 +371,7 @@ To disable it, set the new defcustom 
'diff-font-lock-refine' to nil.
 *** File headers can be shortened, mimicking Magit's diff format.
 To enable it, set the new defcustom 'diff-font-lock-prettify to t.
 
++++
 *** Prefix arg of 'diff-goto-source' means jump to the old revision
 of the file under version control if point is on an old changed line,
 or to the new revision of the file otherwise.
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 598e495..c38524f 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -481,8 +481,8 @@ DIR, ARG, and WINDOW are handled as by 
`windmove-other-window-loc'."
   "Move to the window at direction DIR.
 DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'.
 If no window is at direction DIR, an error is signaled.
-If `windmove-create-window' is non-nil, instead of signalling an error
-it creates a new window at direction DIR ."
+If `windmove-create-window' is non-nil, try to create a new window
+in direction DIR instead."
   (let ((other-window (windmove-find-other-window dir arg window)))
     (when (and windmove-create-window
                (or (null other-window)
@@ -510,9 +510,9 @@ With no prefix argument, or with prefix argument equal to 
zero,
 it is relative to the top edge (for positive ARG) or the bottom edge
 \(for negative ARG) of the current window.
 If no window is at the desired location, an error is signaled
-unless `windmove-create-window' is non-nil that creates a new window."
+unless `windmove-create-window' is non-nil and a new window is created."
   (interactive "P")
-  (windmove-do-window-select 'left arg))
+  (windmove-do-window-select 'left (and arg (prefix-numeric-value arg))))
 
 ;;;###autoload
 (defun windmove-up (&optional arg)
@@ -522,9 +522,9 @@ is relative to the position of point in the window; 
otherwise it is
 relative to the left edge (for positive ARG) or the right edge (for
 negative ARG) of the current window.
 If no window is at the desired location, an error is signaled
-unless `windmove-create-window' is non-nil that creates a new window."
+unless `windmove-create-window' is non-nil and a new window is created."
   (interactive "P")
-  (windmove-do-window-select 'up arg))
+  (windmove-do-window-select 'up (and arg (prefix-numeric-value arg))))
 
 ;;;###autoload
 (defun windmove-right (&optional arg)
@@ -534,9 +534,9 @@ With no prefix argument, or with prefix argument equal to 
zero,
 otherwise it is relative to the top edge (for positive ARG) or the
 bottom edge (for negative ARG) of the current window.
 If no window is at the desired location, an error is signaled
-unless `windmove-create-window' is non-nil that creates a new window."
+unless `windmove-create-window' is non-nil and a new window is created."
   (interactive "P")
-  (windmove-do-window-select 'right arg))
+  (windmove-do-window-select 'right (and arg (prefix-numeric-value arg))))
 
 ;;;###autoload
 (defun windmove-down (&optional arg)
@@ -546,9 +546,9 @@ With no prefix argument, or with prefix argument equal to 
zero,
 it is relative to the left edge (for positive ARG) or the right edge
 \(for negative ARG) of the current window.
 If no window is at the desired location, an error is signaled
-unless `windmove-create-window' is non-nil that creates a new window."
+unless `windmove-create-window' is non-nil and a new window is created."
   (interactive "P")
-  (windmove-do-window-select 'down arg))
+  (windmove-do-window-select 'down (and arg (prefix-numeric-value arg))))
 
 
 ;;; set up keybindings



reply via email to

[Prev in Thread] Current Thread [Next in Thread]