From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Re: Using orgstruct-mode to structure source code Date: Fri, 05 Sep 2008 10:02:33 +0200 Message-ID: <87ej3zrpeu.fsf@thinkpad.tsdh.de> References: <87od35fx3a.fsf@thinkpad.tsdh.de> <87k5dtfs3z.fsf@thinkpad.tsdh.de> <0E11839C-C0CE-41E8-A937-2CBCCB163BB1@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 1KbWJ3-0001fB-31 for emacs-orgmode@gnu.org; Fri, 05 Sep 2008 04:04:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KbWJ2-0001dk-BH for emacs-orgmode@gnu.org; Fri, 05 Sep 2008 04:04:36 -0400 Received: from [199.232.76.173] (port=37723 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbWJ1-0001dM-JO for emacs-orgmode@gnu.org; Fri, 05 Sep 2008 04:04:35 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:56974) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KbWJ1-0006v3-DQ for emacs-orgmode@gnu.org; Fri, 05 Sep 2008 04:04:35 -0400 In-Reply-To: <0E11839C-C0CE-41E8-A937-2CBCCB163BB1@uva.nl> (Carsten Dominik's message of "Fri, 5 Sep 2008 09:15:35 +0200") 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: Carsten Dominik Cc: emacs-orgmode@gnu.org Carsten Dominik writes: Hi Carsten, > I though a little bit about this, and using org-struct-mode in a > commented block of text is going to be bumpy. No easy path. Too bad. I thought that it would be easy (at least for headlines) by simply allowing `comment-start' before the headline. > What I do in such cases: > > I put tow markers into the buffer hat delimit the text I want to edit > in orgstruct-mode. And then I have custom function that toggles the > comment starters on an off, like so: > > ;; BEGIN ORGSTRUCT ";; " > ;; * heading 1 > ;; with text > ;; * heading 2 > ;; ** subheading > ;; END ORGSTRUCT The problem with this is, that "with text" will be commented, too. But in my case this would be source code, which should not be commented. So now I think I'll stay with outline-minor-mode. The thing which is much better with orgstruct-mode is that TAB has a special meaning depending on the context point is on. So I'll use that feature to make outline-minor-mode do what I want. IMO this facility could be of use in may other places, too. I think it would be nice to rip that out of org-mode into something more generic, like (define-context-key some-keymap (kbd "TAB") 'foobar-context-p 'do-foo). I played a bit with the code and tried to elicit how you get the command that normally would have been invoked if the stealing function wasn't there, but I failed. Could you please enlighten me? All the best, Tassilo