From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arun Persaud Subject: org-cycle hook recenter question Date: Sat, 23 Feb 2013 16:26:10 -0800 Message-ID: <51295E22.90901@lbl.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9PQ1-0001UG-10 for emacs-orgmode@gnu.org; Sat, 23 Feb 2013 19:26:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9PPz-0005fK-Rm for emacs-orgmode@gnu.org; Sat, 23 Feb 2013 19:26:16 -0500 Received: from fe1.lbl.gov ([128.3.41.133]:6465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9PPz-0005f7-LN for emacs-orgmode@gnu.org; Sat, 23 Feb 2013 19:26:15 -0500 Received: by mail-da0-f72.google.com with SMTP id k18so2374580dae.3 for ; Sat, 23 Feb 2013 16:26:13 -0800 (PST) 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: emacs-orgmode@gnu.org Hi when I cycle using -TAB and I go from all->content, that is just the headlines, I often don't see the top headlines in the buffer, although there would be enough space to show them. The top is truncated and a "..." is shown and I need to do a ctrl-l or scroll upward to see everything. I was wondering if it would be possible to automatically recenter when the cycle goes from all->content? I tried to change the org-cycle-hook to include a line like: ((eq state 'content) (recenter 1)) and I also tried to add a (recenter-top-bottom) in org.el where org-cycle-global-status is being set to 'contents. But couldn't get it to work... what's the correct place to do this and is there a reason not to recenter by default during this cycle operation? NB: in org-cycle-hook state is tested for 'content, should it be 'contents? org-cycle-hook and org-pre-cycle-hook list both content and contents and both show up in org.el, but org-cycle-global-state seems to be only set to 'contents Arun