From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Orgstruct-mode with custom outline-regexp (was: can the symbol for leading stars be changed?) Date: Tue, 17 Mar 2009 09:21:51 +0100 Message-ID: <87sklctv8g.fsf@thinkpad.tsdh.de> References: <878wn5g4we.fsf@thinkpad.tsdh.de> <6B9F5437-DC9D-43F1-B63B-7099F72D8221@uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LjUYr-0006kK-Lv for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 04:22:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LjUYn-0006jH-RC for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 04:22:09 -0400 Received: from [199.232.76.173] (port=42768 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LjUYn-0006iw-KA for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 04:22:05 -0400 Received: from main.gmane.org ([80.91.229.2]:40861 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LjUYn-0008Gt-84 for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 04:22:05 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LjUYj-0006sE-4C for emacs-orgmode@gnu.org; Tue, 17 Mar 2009 08:22:01 +0000 Received: from p54af28da.dip0.t-ipconnect.de ([84.175.40.218]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2009 08:22:01 +0000 Received: from tassilo by p54af28da.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2009 08:22:01 +0000 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: emacs-orgmode@gnu.org 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.