From mboxrd@z Thu Jan 1 00:00:00 1970 From: pinard@iro.umontreal.ca (=?utf-8?Q?Fran=C3=A7ois?= Pinard) Subject: Re: Scrolling down after Shift-TAB ? Date: Mon, 23 Jan 2012 21:02:25 -0500 Message-ID: <87sjj526z2.fsf@iro.umontreal.ca> References: <87r4yq2dld.fsf@iro.umontreal.ca> <9681.1327365914@alphaville> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpViV-0008Qz-9m for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 21:02:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpViU-0002Pz-0b for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 21:02:35 -0500 Received: from 206-248-137-202.dsl.teksavvy.com ([206.248.137.202]:63024 helo=mercure.epsilon-ti.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpViT-0002Pv-Mk for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 21:02:33 -0500 In-Reply-To: <9681.1327365914@alphaville> (Nick Dokos's message of "Mon, 23 Jan 2012 19:45:14 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org Nick Dokos writes: > Fran=C3=A7ois Pinard wrote: >> Very, very often, after a Shift-TAB that collapses all entries, [...] >> I [...] scroll down so see it all. > You'd need to code it somewhat carefully sp that you wouldn't lose the > property that after a couple of S-TABs, the buffer looks the same as > when you started and point has not moved: that's useful in order to zoom > out and orient yourself in the larger context and then zoom in again to > continue working. That's a nice property indeed. Thanks for your patience with me! :-) > Have you tried C-l after the collapse? It usually does not do the proper thing alone, but `C-l C-l C-l' is closer to what I want. > If you like the behavior, you can always advise org-cycle so that it > always calls recenter afterwards: > (defadvice org-cycle (after org-cycle-recenter) > "Recenter after org-cycle)" > (recenter)) > (ad-activate 'org-cycle) This was a good hint, thanks. Starting from your idea, I ended up with: (defun fp-org-cycle-recenter (type) "Recenter after global collapsing." (when (eq type 'overview) (recenter (1- (window-body-height))))) (add-hook 'org-cycle-hook 'fp-org-cycle-recenter) When returning to a more expanded view, the original line is recovered at the center of the window instead of at its precise previous position, which is quite acceptable to me. From there, another full cycle of course leaves the impression that the position did not move. Fran=C3=A7ois