forked from mirrors/org-mode
Prefer set-window-start' over
recenter' in some places.
* org-agenda.el (org-agenda-show-1): * org-table.el (org-table-show-reference): * org.el (org-fix-ellipsis-at-bol) (org-first-headline-recenter): Use `set-window-start' instead of `recenter'. * org-agenda.el (org-recenter-heading): Delete.
This commit is contained in:
parent
6c9b3ad91f
commit
30220ffcdc
|
@ -8599,7 +8599,8 @@ if it was hidden in the outline."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
(let ((win (selected-window)))
|
(let ((win (selected-window)))
|
||||||
(org-agenda-goto t)
|
(org-agenda-goto t)
|
||||||
(org-recenter-heading 1)
|
(org-back-to-heading)
|
||||||
|
(set-window-start (selected-window) (point-at-bol))
|
||||||
(cond
|
(cond
|
||||||
((= more 0)
|
((= more 0)
|
||||||
(hide-subtree)
|
(hide-subtree)
|
||||||
|
@ -8638,11 +8639,6 @@ if it was hidden in the outline."
|
||||||
(message "Remote: SUBTREE AND ALL DRAWERS")))
|
(message "Remote: SUBTREE AND ALL DRAWERS")))
|
||||||
(select-window win)))
|
(select-window win)))
|
||||||
|
|
||||||
(defun org-recenter-heading (n)
|
|
||||||
(save-excursion
|
|
||||||
(org-back-to-heading)
|
|
||||||
(recenter n)))
|
|
||||||
|
|
||||||
(defvar org-agenda-cycle-counter nil)
|
(defvar org-agenda-cycle-counter nil)
|
||||||
(defun org-agenda-cycle-show (&optional n)
|
(defun org-agenda-cycle-show (&optional n)
|
||||||
"Show the current entry in another window, with default settings.
|
"Show the current entry in another window, with default settings.
|
||||||
|
|
|
@ -3863,9 +3863,10 @@ With prefix ARG, apply the new formulas to the table."
|
||||||
(push org-table-current-begin-pos org-show-positions)
|
(push org-table-current-begin-pos org-show-positions)
|
||||||
(let ((min (apply 'min org-show-positions))
|
(let ((min (apply 'min org-show-positions))
|
||||||
(max (apply 'max org-show-positions)))
|
(max (apply 'max org-show-positions)))
|
||||||
(goto-char min) (recenter 0)
|
(set-window-start (selected-window) (point-min))
|
||||||
(goto-char max)
|
(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))))
|
(select-window win))))
|
||||||
|
|
||||||
(defun org-table-force-dataline ()
|
(defun org-table-force-dataline ()
|
||||||
|
|
11
lisp/org.el
11
lisp/org.el
|
@ -5484,7 +5484,8 @@ The following commands are available:
|
||||||
(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
|
(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
|
||||||
|
|
||||||
(defsubst org-fix-ellipsis-at-bol ()
|
(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 ()
|
(defun org-find-invisible-foreground ()
|
||||||
(let ((candidates (remove
|
(let ((candidates (remove
|
||||||
|
@ -7117,13 +7118,11 @@ Otherwise make it visible."
|
||||||
(pos-visible-in-window-p
|
(pos-visible-in-window-p
|
||||||
(save-excursion (org-end-of-subtree t) (point))))
|
(save-excursion (org-end-of-subtree t) (point))))
|
||||||
|
|
||||||
(defun org-first-headline-recenter (&optional N)
|
(defun org-first-headline-recenter ()
|
||||||
"Move cursor to the first headline and recenter the headline.
|
"Move cursor to the first headline and recenter the headline."
|
||||||
Optional argument N means put the headline into the Nth line of the window."
|
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t)
|
(when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t)
|
||||||
(beginning-of-line)
|
(set-window-start (selected-window) (point-at-bol))))
|
||||||
(recenter (prefix-numeric-value N))))
|
|
||||||
|
|
||||||
;;; Saving and restoring visibility
|
;;; Saving and restoring visibility
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue