[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19129: 25.0.50; recenter-positions is missing a reference to move-to
From: |
H. Dieter Wilhelm |
Subject: |
bug#19129: 25.0.50; recenter-positions is missing a reference to move-to-window-line-top-bottom |
Date: |
Fri, 21 Nov 2014 11:10:30 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: dieter@duenenhof-wilhelm.de (H. Dieter Wilhelm)
>> Date: Fri, 21 Nov 2014 00:28:42 +0100
>>
>> please close the bug (or can I do this as well?)
>
> Anyone can, by sending an email message to 19129-done@debbugs.gnu.org.
I see, thanks, I'll do that for #19129.
Please tell me briefly what are you thinking of introducing an extra
defcustom for move-to-window-line-top-bottom?
diff --git a/lisp/window.el b/lisp/window.el
index 91a0e15..8b9c7f5 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7475,6 +7475,27 @@ cycling order is middle -> top -> bottom."
:version "23.2"
:group 'windows)
+(defcustom move-to-window-line-positions '(middle top bottom)
+ "Cycling order for `move-to-window-line-top-bottom'.
+A list of elements with possible values `top', `middle', `bottom',
+integer or float numbers that define the cycling order for
+the command `move-to-window-line-top-bottom'.
+
+Top and bottom destinations are `scroll-margin' lines from the true
+window top and bottom. Middle redraws the frame and centers point
+vertically within the window. Integer number moves current line to
+the specified absolute window-line. Float number between 0.0 and 1.0
+means the percentage of the screen space from the top. The default
+cycling order is middle -> top -> bottom."
+ :type '(repeat (choice
+ (const :tag "Top" top)
+ (const :tag "Middle" middle)
+ (const :tag "Bottom" bottom)
+ (integer :tag "Line number")
+ (float :tag "Percentage")))
+ :version "25.1"
+ :group 'windows)
+
(defun recenter-top-bottom (&optional arg)
"Move current buffer line to the specified window line.
With no prefix argument, successive calls place point according
@@ -7515,16 +7536,16 @@ With a prefix argument ARG, acts like
`move-to-window-line'.
With no argument, positions point at center of window.
Successive calls position point at positions defined
-by `recenter-positions'."
+by `move-to-window-line-positions'."
(interactive "P")
(cond
(arg (move-to-window-line arg)) ; Always respect ARG.
(t
(setq recenter-last-op
(if (eq this-command last-command)
- (car (or (cdr (member recenter-last-op recenter-positions))
- recenter-positions))
- (car recenter-positions)))
+ (car (or (cdr (member recenter-last-op
move-to-window-line-positions))
+ move-to-window-line-positions))
+ (car move-to-window-line-positions)))
(let ((this-scroll-margin
(min (max 0 scroll-margin)
(truncate (/ (window-body-height) 4.0)))))
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany
bug#19129: 25.0.50; recenter-positions is missing a reference to move-to-window-line-top-bottom, Eli Zaretskii, 2014/11/21