[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Bug: Activating org-mode in any buffer recenters (unrelated) selecte
From: |
Nicolas Richard |
Subject: |
[O] Bug: Activating org-mode in any buffer recenters (unrelated) selected window. [8.2.6 (release_8.2.6-6-gfc37d1 @ /home/youngfrog/sourcetrees/org-mode/lisp/)] |
Date: |
Wed, 14 May 2014 11:59:22 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
The function `org-overview' calls `recenter' without checking if the
current buffer is actually in the currently selected window. Moreover,
turning on org-mode calls `org-overview' (I guess depending on the
configuration). IOW, turning on org-mode programmatically (e.g. via
find-file-noselect) will recenter whatever window is currently selected.
That's unexpected.
I noticed that because I recently tried org-notify, which uses
find-file-noselect, and the behaviour was very distracting to me. (Side
question : do people live with that or is it just me seeing the weird
behaviour ?)
Anyway, I would suggest to simply remove the call to recenter because I
don't understand why it's there. OTOH if it's there for a reason, then I
suggest something along the line of:
(when (eq
(current-buffer)
(window-buffer
(selected-window)))
(recenter '(4)))
(but then, why the interactive-looking argument ?)
While I am at it, I don't quite understand why (goto-char) is used
*after* recenter (also, why not just save-excursion ?)
Since there are many things I obviously don't understand, I'm not
posting an actual patch but I can do that if someone wants it.
--
Nico.
- [O] Bug: Activating org-mode in any buffer recenters (unrelated) selected window. [8.2.6 (release_8.2.6-6-gfc37d1 @ /home/youngfrog/sourcetrees/org-mode/lisp/)],
Nicolas Richard <=