From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: [RFC] Org Minor Mode? Date: Sat, 19 Apr 2014 12:11:41 +0200 Message-ID: <87d2gdtyqq.fsf@gmail.com> References: <87ha61f4rk.fsf@gmail.com> <8738hlkn64.fsf@gmail.com> <87eh11w77i.fsf@gmail.com> <87oazykbp5.fsf@bzg.ath.cx> <87k3amfxae.fsf@gmail.com> <87ioq5hoze.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbSEB-0004AB-Sz for emacs-orgmode@gnu.org; Sat, 19 Apr 2014 06:10:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WbSE5-0007KA-Ur for emacs-orgmode@gnu.org; Sat, 19 Apr 2014 06:10:31 -0400 Received: from plane.gmane.org ([80.91.229.3]:59304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbSE5-0007K2-MF for emacs-orgmode@gnu.org; Sat, 19 Apr 2014 06:10:25 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WbSE4-0005Mg-92 for emacs-orgmode@gnu.org; Sat, 19 Apr 2014 12:10:24 +0200 Received: from e178190076.adsl.alicedsl.de ([85.178.190.76]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Apr 2014 12:10:24 +0200 Received: from tjolitz by e178190076.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Apr 2014 12:10:24 +0200 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 Bastien writes: Hi Bastien, > Thorsten Jolitz writes: > >> The real value and innovation of a true >> org-minor-mode would be to introduce Org's intelligent headlines and all >> the related functionality into the world of outcommented text in >> programming modes. > > Yes. We could have `orgstruct-comment-prefix-regexp' along with > `orgstruct-heading-prefix-regexp'. I'll check this, thanks for > the idea! As long as there are hardcoded regexp searches all over the place in org.el, org-agenda.el, orgtbl.el, and to a minor extends almost all other Org libraries, I don't think just another outline-regexp can do the trick - the called functions will fail when trying to match ,-------- | "^foo$" `-------- but looking at ,--------------------------------------------------------------- | "^<>foo<>$" `--------------------------------------------------------------- Furthermore calling Org functions modifies the buffer, sometimes inserting new lines, sometimes not. An Org minor-mode would need to detect all newly inserted lines after a command call and outcomment them with the programming major-mode's comment syntax. I already found a way to do that using external calls to diff, its implemented in omm.el (needs to be debugged though, I stopped working on it because it seemed the idea of an Org Minor Mode was a bit unpopular). In summary, its about: 1. generalize the regexp constants and vars (allow for comment-syntax, when org-minor-mode) 2. deal with hardcoded regexp-snippets in functions (my proposoal: replace "^" with org-BOL, "$" with org-EOL, "\\*" with org-STAR) 3. outcomment new lines after calls to Org commands. All the other stuff should be already there in orgstruct and outshine. -- cheers, Thorsten