Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > Hello, > > Thorsten Jolitz <tjol...@gmail.com> 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