emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [RFC] Org Minor Mode?
Date: Thu, 29 May 2014 19:47:04 +0200	[thread overview]
Message-ID: <87zji0xysn.fsf@gmail.com> (raw)
In-Reply-To: 87y4xl1mh5.fsf@bzg.ath.cx

Bastien <bzg@gnu.org> writes:

Hi Bastien,

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Thats currently possible with outorg.el, M-# M-# on a outshine subtree
>> or buffer is just the reverse of C-c ' on a source-block - it offers the
>> subtree of buffer in a temporary *outorg-edit-buffer* in full Org-mode
>> with the comment-section converted to text and the source-code enclosed
>> in source-blocks.
>
> (Did you look at `org-open-at-point' and the way it handles link in
> comments?  I don't think M-# M-# does the same.)

I looked at it, but to be honest, could not figure out what you are
referring to. Could you be more specific please (line number or so?)

>> There is definitely a cost, but the gain would be considerable too

> This is not about the number of lines to be edited or the man-hour we
> need to spend on this.  Rather about performance and maintainability.

Ok, I can see that the function call necessary to build the regexps
dynamically can be a problem here. 

Maybe instead of function calls some Backslash Constructs can be used to
derive regexp patterns that replace "^" and "$" in a way that they match
all or at least many comment-syntax (whats the plural of syntax?)?

,--------------------------------------------------------------------
| '\scode'
|     matches any character whose syntax is code. Here code is a
|     character that represents a syntax code: thus, 'w' for word
|     constituent, '-' for whitespace, '(' for open parenthesis, etc.
|     To represent whitespace syntax, use either '-' or a space
|     character. See Syntax Class Table, for a list of syntax codes
|     and the characters that stand for them.
`--------------------------------------------------------------------

e.g.

,---------------------------------------------------------------------
| Comment starters: '<'
| Comment enders: '>'
|     Characters used in various languages to delimit comments. Human
|     text has no comment characters. In Lisp, the semicolon (';')
|     starts a comment and a newline or formfeed ends one.
| [...]
| Generic comment delimiters: '!'
|     Characters that start or end a special kind of comment. Any
|     generic comment delimiter matches any generic comment delimiter,
|     but they cannot match a comment starter or comment ender;
|     generic comment delimiters can only match each other.
|    
|     This syntax class is primarily meant for use with the
|     syntax-table text property (see Syntax Properties). You can mark
|     any range of characters as forming a comment, by giving the
|     first and last characters of the range syntax-table properties
|     identifying them as generic comment delimiters.
`---------------------------------------------------------------------

For the Org star "*" maybe one could define a new category

,--------------------------------------------------------------------
| Categories provide an alternate way of classifying characters
| syntactically. You can define several categories as needed, then
| independently assign each character to one or more categories.
| Unlike syntax classes, categories are not mutually exclusive; it is
| normal for one character to belong to several categories.
`--------------------------------------------------------------------

and match them with

,---------------------------------------------------------------------
| '\cc'
|     matches any character whose category is c. Here c is a character
|     that represents a category: thus, 'c' for Chinese characters or
|     'g' for Greek characters in the standard category table. You can
|     see the list of all the currently defined categories with M-x
|     describe-categories <RET>. You can also define your own
|     categories in addition to the standard ones using the
|     define-category function (see Categories).
`---------------------------------------------------------------------

In the beginning, that category would only consist of (* ;).

This is quite low level and I haven't done anything on this level yet,
but it might be a way to stick with performant constant regexp strings,
but make them more general.

-- 
cheers,
Thorsten

  reply	other threads:[~2014-05-29 17:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zji0xysn.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).