From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Orgstruct-mode with custom outline-regexp (was: can the symbol for leading stars be changed?) Date: Tue, 17 Mar 2009 11:48:50 +0100 Message-ID: References: <878wn5g4we.fsf@thinkpad.tsdh.de> <6B9F5437-DC9D-43F1-B63B-7099F72D8221@uva.nl> <87sklctv8g.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LjXWf-0007Hf-MX for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 07:32:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LjXWa-0007Gw-VM for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 07:32:05 -0400 Received: from [199.232.76.173] (port=36372 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LjXWa-0007Gt-SV for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 07:32:00 -0400 Received: from mail-ew0-f160.google.com ([209.85.219.160]:45460) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LjXWa-00062Q-En for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 07:32:00 -0400 Received: by ewy4 with SMTP id 4so12232ewy.42 for ; Tue, 17 Mar 2009 04:31:59 -0700 (PDT) In-Reply-To: <87sklctv8g.fsf@thinkpad.tsdh.de> 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: Tassilo Horn Cc: emacs-orgmode@gnu.org Hi Tassilo, you are right, it does not work with orgstruct-mode, because that sets local variables like in Org-mode for the duration of the command. I think the best solution in this case, where you want to do mainly visibility cycling in an arbitrary mode is using outline-minor-mode and bind org-cycle to some convenient command. There is a FAQ which describes a setup for this, "Can I get the visibility-cycling features in outline-mode and outline- minor-mode?" - Carsten On Mar 17, 2009, at 9:21 AM, Tassilo Horn wrote: > Carsten Dominik writes: > > Hi Carsten, > >>> I wonder if I cannot make `orgstruct-mode' work the same way. I've >>> always thought that it uses `outline-regexp' for the cycling and >>> stuff, but maybe I'm wrong. What's the correct regexp that's used >>> for `org-cycle'? `org-complex-heading-regexp'? >> >> org-cycle does use outline-regexp, so this will work fine. > > Hm, it does work with "M-x org-cycle" (then it toggles between FOLDED > and CHILDREN, but not SUBTREE), but with TAB nothing happens. > > ,---- > | runs the command orgstruct-hijacker-command-102, which is an > interactive > | Lisp function. > | > | It is bound to . > | > | (orgstruct-hijacker-command-102 arg) > | > | In Structure, run `org-cycle'. > | Outside of structure, run the binding of `[(tab)]' or ` '. > `---- > > Here's the test file: > > --8<---------------cut here---------------start------------->8--- > ;;* Heading 1 > > (setq foo 1) > > ;;** SubHeading 1.1 > > (+ 1 1) ;; test > > ;;** SubHeading 1.2 > > (defun foo () nil) > > ;;* Heading 2 > > (defun bar () nil) > > ;;** SubHeading 2.1 > > (+ 7 7) > --8<---------------cut here---------------end--------------->8--- > > When I hit C-c C-c which should allow setting tags, it tells me > > org-ctrl-c-ctrl-c: C-c C-c can do nothing useful at this location. > > although I'm on a headline and the value of outline regexp is: > > ,---- > | outline-regexp is a variable defined in `outline.el'. > | Its value is ";;[*]+ " > | Local in buffer test.el; global value is "[*\f]+" > `---- > > The only thing that comes into my mind is that those hijacker commands > use a hardcoded outline-regexp or an earlier value of outline-regexp. > Yeah, that seems to be the case. When I use only stars, the key > bindings work. > > Carsten, could you change that, so that the hijackers use the current > value of outline-regexp? > >> However, for much other functionality, including demotion and >> promotion, stars are hard-coded. > > Cycling would be more than enough for me. I just want to have a good > structure in my code files where I can easily toggle the visibility. > Basically, `outline-minor-mode' does what I want, but org cycling is > still better. > > Bye, > Tassilo > -- > Chuck Norris sheds his skin twice a year. > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode