emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [RFC] Org Minor Mode?
@ 2014-04-10 17:55 Thorsten Jolitz
  2014-04-10 19:19 ` Nicolas Goaziou
  0 siblings, 1 reply; 36+ messages in thread
From: Thorsten Jolitz @ 2014-04-10 17:55 UTC (permalink / raw)
  To: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2014-05-30 14:39 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-10 17:55 [RFC] Org Minor Mode? Thorsten Jolitz
2014-04-10 19:19 ` Nicolas Goaziou
2014-04-11 10:07   ` Bastien
2014-04-11 17:22     ` Richard Lawrence
2014-04-13 16:28       ` Thorsten Jolitz
2014-04-19  5:37       ` Samuel Wales
2014-04-19 10:25         ` Thorsten Jolitz
2014-04-13 16:07     ` Thorsten Jolitz
2014-04-18 13:27       ` Bastien
2014-04-13 16:00   ` Thorsten Jolitz
2014-04-18 13:29     ` Bastien
2014-04-18 15:54       ` Thorsten Jolitz
2014-04-19  5:23         ` Bastien
2014-04-19 10:11           ` Thorsten Jolitz
2014-04-19 12:57             ` Bastien
2014-04-24 21:06               ` Ilya Shlyakhter
2014-04-25  8:00                 ` Thorsten Jolitz
2014-04-29 12:24                 ` Bastien
2014-04-29 18:44                   ` Ilya Shlyakhter
2014-05-06  9:06                     ` Bastien
2014-04-24 21:16   ` Ilya Shlyakhter
2014-04-25  7:49     ` Thorsten Jolitz
2014-05-06  9:20       ` Bastien
2014-05-27  9:20         ` Thorsten Jolitz
2014-05-28 21:47           ` Bastien
2014-05-28 22:19             ` Thorsten Jolitz
2014-05-29  0:01               ` Bastien
2014-05-29 17:47                 ` Thorsten Jolitz
2014-05-29 18:57                   ` Bastien
2014-05-30  8:52                     ` Thorsten Jolitz
2014-05-30 12:13                       ` Bastien
2014-05-30 13:41                         ` Thorsten Jolitz
2014-05-30 13:54                           ` Bastien
2014-05-30 14:15                             ` Thorsten Jolitz
2014-05-30 14:22                               ` Bastien
2014-05-30 14:38                                 ` Thorsten Jolitz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).