Pārlūkot izejas kodu

Merge branch 'maint'

Bastien Guerry 11 gadi atpakaļ
vecāks
revīzija
4014947f31
3 mainītis faili ar 10 papildinājumiem un 14 dzēšanām
  1. 2 6
      lisp/org-agenda.el
  2. 3 2
      lisp/org-table.el
  3. 5 6
      lisp/org.el

+ 2 - 6
lisp/org-agenda.el

@@ -8660,7 +8660,8 @@ if it was hidden in the outline."
   (interactive "p")
   (let ((win (selected-window)))
     (org-agenda-goto t)
-    (org-recenter-heading 1)
+    (org-back-to-heading)
+    (set-window-start (selected-window) (point-at-bol))
     (cond
      ((= more 0)
       (hide-subtree)
@@ -8694,11 +8695,6 @@ if it was hidden in the outline."
       (message "Remote: SUBTREE AND ALL DRAWERS")))
     (select-window win)))
 
-(defun org-recenter-heading (n)
-  (save-excursion
-    (org-back-to-heading)
-    (recenter n)))
-
 (defvar org-agenda-cycle-counter nil)
 (defun org-agenda-cycle-show (&optional n)
   "Show the current entry in another window, with default settings.

+ 3 - 2
lisp/org-table.el

@@ -3935,9 +3935,10 @@ With prefix ARG, apply the new formulas to the table."
 	(push org-table-current-begin-pos org-show-positions)
 	(let ((min (apply 'min org-show-positions))
 	      (max (apply 'max org-show-positions)))
-	  (goto-char min) (recenter 0)
+	  (set-window-start (selected-window) (point-min))
 	  (goto-char max)
-	  (or (pos-visible-in-window-p max) (recenter -1))))
+	  (or (pos-visible-in-window-p max)
+	      (set-window-start (selected-window) (point-max)))))
       (select-window win))))
 
 (defun org-table-force-dataline ()

+ 5 - 6
lisp/org.el

@@ -5575,7 +5575,8 @@ The following commands are available:
 		    :parents (list text-mode-abbrev-table)))
 
 (defsubst org-fix-ellipsis-at-bol ()
-  (save-excursion (goto-char (window-start)) (recenter 0)))
+  (save-excursion
+    (set-window-start (selected-window) (point-min))))
 
 (defun org-find-invisible-foreground ()
   (let ((candidates (remove
@@ -7245,13 +7246,11 @@ show that drawer instead."
   (pos-visible-in-window-p
    (save-excursion (org-end-of-subtree t) (point))))
 
-(defun org-first-headline-recenter (&optional N)
-  "Move cursor to the first headline and recenter the headline.
-Optional argument N means put the headline into the Nth line of the window."
+(defun org-first-headline-recenter ()
+  "Move cursor to the first headline and recenter the headline."
   (goto-char (point-min))
   (when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t)
-    (beginning-of-line)
-    (recenter (prefix-numeric-value N))))
+    (set-window-start (selected-window) (point-at-bol))))
 
 ;;; Saving and restoring visibility