emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-element-at-point fails in programming-modes


From: Thorsten Jolitz
Subject: Re: [O] org-element-at-point fails in programming-modes
Date: Thu, 21 Aug 2014 13:22:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Hello,
>
> Thorsten Jolitz <address@hidden> writes:
>
>> Ok, thanks, that sounds promising. OTOH, is the use of "\\S-" really
>> mandatory,
>
> No, it isn't.
>
>> couldn't a more robust construct be used, either something
>> like this (untested) regexp:
>>
>> ,----
>> | "[^[:space:]\\n]+"
>> `----
>
> AFAIK, [:space:] is not compatible with XEmacs. It could be "[^
> \r\t\n]+", but even this could be too broad (e.g., "#+BEGIN_..."). We
> could also limit block names to alphanumeric characters and a bunch of
> symbols.

I would support that, since the current regexp limits the function's use
unnecessarily to text-modes.

I have no strong argument (real use-case) for making
`org-element-at-point' work with programming-modes too, except the
'principle of least surprise' - I was surprised that my formerly working
`org-dp-wrap-in-block' suddenly did not work anymore when playing around
with it in the *scratch* buffer and spend some time debugging my code,
only to find out that there was no bug but the input from
`org-element-at-point' was not what I expected.

-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]