aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2018-11-16 01:09:54 +0200
committerJuri Linkov2018-11-16 01:09:54 +0200
commitf22a16ae066cc512322f115c2098837d74feeff8 (patch)
tree963546bf637693d1903f6f95742f1aa8e2c37e5a
parentce915653df74166fe6eb5783d57619b73cd74681 (diff)
downloademacs-f22a16ae066cc512322f115c2098837d74feeff8.tar.gz
emacs-f22a16ae066cc512322f115c2098837d74feeff8.zip
* 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.
-rw-r--r--etc/NEWS1
-rw-r--r--lisp/windmove.el20
2 files changed, 11 insertions, 10 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 76531f288ff..4f3b9a9a061 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -371,6 +371,7 @@ To disable it, set the new defcustom 'diff-font-lock-refine' to nil.
371*** File headers can be shortened, mimicking Magit's diff format. 371*** File headers can be shortened, mimicking Magit's diff format.
372To enable it, set the new defcustom 'diff-font-lock-prettify to t. 372To enable it, set the new defcustom 'diff-font-lock-prettify to t.
373 373
374+++
374*** Prefix arg of 'diff-goto-source' means jump to the old revision 375*** Prefix arg of 'diff-goto-source' means jump to the old revision
375of the file under version control if point is on an old changed line, 376of the file under version control if point is on an old changed line,
376or to the new revision of the file otherwise. 377or to the new revision of the file otherwise.
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 598e495c7a9..c38524fede6 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'."
481 "Move to the window at direction DIR. 481 "Move to the window at direction DIR.
482DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'. 482DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'.
483If no window is at direction DIR, an error is signaled. 483If no window is at direction DIR, an error is signaled.
484If `windmove-create-window' is non-nil, instead of signalling an error 484If `windmove-create-window' is non-nil, try to create a new window
485it creates a new window at direction DIR ." 485in direction DIR instead."
486 (let ((other-window (windmove-find-other-window dir arg window))) 486 (let ((other-window (windmove-find-other-window dir arg window)))
487 (when (and windmove-create-window 487 (when (and windmove-create-window
488 (or (null other-window) 488 (or (null other-window)
@@ -510,9 +510,9 @@ With no prefix argument, or with prefix argument equal to zero,
510it is relative to the top edge (for positive ARG) or the bottom edge 510it is relative to the top edge (for positive ARG) or the bottom edge
511\(for negative ARG) of the current window. 511\(for negative ARG) of the current window.
512If no window is at the desired location, an error is signaled 512If no window is at the desired location, an error is signaled
513unless `windmove-create-window' is non-nil that creates a new window." 513unless `windmove-create-window' is non-nil and a new window is created."
514 (interactive "P") 514 (interactive "P")
515 (windmove-do-window-select 'left arg)) 515 (windmove-do-window-select 'left (and arg (prefix-numeric-value arg))))
516 516
517;;;###autoload 517;;;###autoload
518(defun windmove-up (&optional arg) 518(defun windmove-up (&optional arg)
@@ -522,9 +522,9 @@ is relative to the position of point in the window; otherwise it is
522relative to the left edge (for positive ARG) or the right edge (for 522relative to the left edge (for positive ARG) or the right edge (for
523negative ARG) of the current window. 523negative ARG) of the current window.
524If no window is at the desired location, an error is signaled 524If no window is at the desired location, an error is signaled
525unless `windmove-create-window' is non-nil that creates a new window." 525unless `windmove-create-window' is non-nil and a new window is created."
526 (interactive "P") 526 (interactive "P")
527 (windmove-do-window-select 'up arg)) 527 (windmove-do-window-select 'up (and arg (prefix-numeric-value arg))))
528 528
529;;;###autoload 529;;;###autoload
530(defun windmove-right (&optional arg) 530(defun windmove-right (&optional arg)
@@ -534,9 +534,9 @@ With no prefix argument, or with prefix argument equal to zero,
534otherwise it is relative to the top edge (for positive ARG) or the 534otherwise it is relative to the top edge (for positive ARG) or the
535bottom edge (for negative ARG) of the current window. 535bottom edge (for negative ARG) of the current window.
536If no window is at the desired location, an error is signaled 536If no window is at the desired location, an error is signaled
537unless `windmove-create-window' is non-nil that creates a new window." 537unless `windmove-create-window' is non-nil and a new window is created."
538 (interactive "P") 538 (interactive "P")
539 (windmove-do-window-select 'right arg)) 539 (windmove-do-window-select 'right (and arg (prefix-numeric-value arg))))
540 540
541;;;###autoload 541;;;###autoload
542(defun windmove-down (&optional arg) 542(defun windmove-down (&optional arg)
@@ -546,9 +546,9 @@ With no prefix argument, or with prefix argument equal to zero,
546it is relative to the left edge (for positive ARG) or the right edge 546it is relative to the left edge (for positive ARG) or the right edge
547\(for negative ARG) of the current window. 547\(for negative ARG) of the current window.
548If no window is at the desired location, an error is signaled 548If no window is at the desired location, an error is signaled
549unless `windmove-create-window' is non-nil that creates a new window." 549unless `windmove-create-window' is non-nil and a new window is created."
550 (interactive "P") 550 (interactive "P")
551 (windmove-do-window-select 'down arg)) 551 (windmove-do-window-select 'down (and arg (prefix-numeric-value arg))))
552 552
553 553
554;;; set up keybindings 554;;; set up keybindings