From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: [RFC] Org Minor Mode? Date: Thu, 10 Apr 2014 19:55:43 +0200 Message-ID: <87ha61f4rk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYJBL-0001mS-Hg for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 13:54:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYJBC-0004Bp-LO for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 13:54:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:59569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYJBC-0004Be-En for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 13:54:26 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WYJBB-0001Aa-Fq for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 19:54:25 +0200 Received: from e178191054.adsl.alicedsl.de ([85.178.191.54]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Apr 2014 19:54:25 +0200 Received: from tjolitz by e178191054.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Apr 2014 19:54:25 +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 Hi List, I cite from a recent thread on Emacs Help: #+begin_quote Right, I'm very much convinced that the power of Org-mode could be unleashed in a true org-minor-mode that works in the comment-sections of programming major-modes. [...] The major "flaw" of Org-mode that inhibits its use as minor-mode is the wide-spread use of hard-coded regexps, i.e. regexps of this form ,-------------- | "^\\*+ ... $" `-------------- in many many variants all over the place. Those three elements "^" (bol), "$" (eol) and "*" (star) are not portable, since in comment-sections of programming major-modes the above should look like: PicoLisp (comment-start repeated with padding) ,-------------- | "^## *+ ... $" `-------------- Elisp outshine-style (comment-start repeated with padding) ,-------------- | "^;; *+ ... $" `-------------- old-school Elisp (comment-start repeated no padding, different star) ,-------------- | "^;;;+ ... $" `-------------- #+end_quote Now I just announced [[https://github.com/tj64/drx][drx.el]] on Emacs Help, I cite again: #+begin_quote Its main purpose is to abstract from hardcoded "^", "$" and "\\*" in regexps. Here are a few examples: # basic usage #+begin_src emacs-lisp (drx "foo" t nil t) #+end_src #+results: : ^foo$ # org-mode version #+begin_src emacs-lisp (drx " foo" t '(t "+") t) #+end_src #+results: : ^\(\*+\) foo$ # css-mode version with # as star #+begin_src emacs-lisp (let ((drx-BOL "^/* ") (drx-EOL "*/$") (drx-STAR "#")) (drx " foo" t '(t "+") t)) #+end_src #+results: : ^/* \(#+\) foo*/$ Many more things are possible, the more than 80 ERT tests in drx.el give many examples with expected output. #+end_quote What do you think - is there any chance that Org-mode switches from static hardcoded regexp strings (all over the place) to dynamic regexps calculated at runtime (using libraries like drx.el or rx.el)? There would be a cost definitely, but then a true org-minor-mode could become reality that offers the full power of Org-mode in programming mode's comment section (I'm actually working on it by merging outshine with orgstruct: [[https://github.com/tj64/omm][omm.el]]). -- cheers, Thorsten