I'm using this test code.
(defun +outline~show-all (orig-fn &rest args)
"Show all."
(let ((beg1 (window-start))
(end1 (window-end))
(beg2) (end2))
(apply orig-fn args)
(setq beg2 (window-start) end2 (window-end))
(message "before (%d , %d) | after (%d , %d)" beg1 end1 beg2 end2)))
(advice-add #'outline-show-all :around #'outline~show-all)
I expect difference between (window-start)
and (window-end)
to be smaller after calling outline-show-all
in a (sufficiently large) org file with folded headings. This is because the window can't show as much of the text now that the contents of org headings are visible. But the window beginning and end before calling outline-show-all
and after are the same according to the output of my advice.
Here's an example of the output in a huge orgfile.
before (1 , 246850) | after (1 , 246850)
It is visibly obvious that the window beginning and end have changed. But to make sure I use eval-expression
and indeed (window-end)
is smaller.
I evaluated this form: (message "wndow-beg: %d | window-end: %d" (window-start) (window-end))
.
I get this output.
window-beg: 1 | window-end: 884
But why didn't I get this output from my advice?