From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Thompson Subject: Re: S-Tab strange behavour Date: Tue, 2 Feb 2010 13:25:52 -0800 Message-ID: <2a4ba2fd1002021325y7799d84fyed189502582f47e2@mail.gmail.com> References: <4B687CF9.5030807@vanav.com.ua> <2a4ba2fd1002021140m43ed89ecof918578f08889c30@mail.gmail.com> <4B688D47.5060208@vanav.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcQGT-0000ox-CD for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 16:26:29 -0500 Received: from [199.232.76.173] (port=51638 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcQGS-0000oJ-Rr for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 16:26:28 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcQGK-00038k-N8 for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 16:26:25 -0500 Received: from mail-iw0-f203.google.com ([209.85.223.203]:36469) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NcQGH-00037t-0M for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 16:26:17 -0500 Received: by iwn41 with SMTP id 41so643524iwn.12 for ; Tue, 02 Feb 2010 13:26:12 -0800 (PST) In-Reply-To: <4B688D47.5060208@vanav.com.ua> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ivan Vanyushkin Cc: emacs-orgmode@gnu.org S-Tab probably checks the value of last-command to see if the previous command was also a S-Tab. If the previous command was anything else, then Org Mode has no idea whether the buffer or its visibility has changed since the last-executed S-Tab, since it cannot know which other commands will affect buffer visibility and which will not. So, if the previous command is not S-Tab, then the next S-Tab will restart the cycle from the beginning. Similarly, when you first open a buffer, the value of last-command is probably 'find-file or something. On Tue, Feb 2, 2010 at 12:38 PM, Ivan Vanyushkin wrote= : > There is org-startup-folded that controls startup state, so org-mode shou= ld > know it. > > Also S-Tab forgets state even in the middle of document. Key presses to > reproduce: > > 1) S-Tab - OVERVIEW > 2) S-Tab - CONTENTS > 3) C-G (or any other) > 4) S-Tab - OVERVIEW (expected: SHOW ALL) > > or > > 1) S-Tab - OVERVIEW > 3) C-G (or any other) > 4) S-Tab - OVERVIEW (nothing changed! expected: CONTENTS) > > Is it by design? Why? > > > On 02.02.2010 21:40, Ryan Thompson wrote: >> >> I don't think it is possible in general to know the startup state of a >> file. Files with a #+STARTUP line may be an execption. >> >> On Tue, Feb 2, 2010 at 11:28 AM, Ivan Vanyushkin >> =A0wrote: >>> >>> Hello. >>> >>> On initial file opening, S- =A0cycles through >>> 1) OVERVIEW -> =A02) CONTENTS -> =A03) SHOW ALL >>> not depending on current state of document. >>> >>> So, if (as default) document is in OVERVIEW state, first press >>> _does nothing_ (switch to OVERVIEW again). Expected: CONTENTS. >>> >>> If document initially "#+STARTUP: content", then first press switches i= t >>> back to OVERVIEW. Expected: SHOW ALL. >>> >>> So, S-Tab (and maybe Tab) doesn't use context state when start cycling. >>> >>> Is it correct and why? >>> >>> org-version 6.21 and 6.34c >>> Emacs 23.1.1 >>> >>> Thank you for your answer! >>> >>> >>> -- >>> Ivan Vanyushkin - Vanav. > >