From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: org-element-at-point fails in programming-modes Date: Thu, 21 Aug 2014 13:22:13 +0200 Message-ID: <87vbpm9jfe.fsf@gmail.com> References: <87zjez9xqc.fsf@gmail.com> <878umj8hc4.fsf@geodiff-mac3.ulb.ac.be> <87r40b9sk7.fsf@gmail.com> <87ha16fcct.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKQS1-0001ji-Hn for emacs-orgmode@gnu.org; Thu, 21 Aug 2014 07:22:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKQRv-0000IR-FC for emacs-orgmode@gnu.org; Thu, 21 Aug 2014 07:22:41 -0400 Received: from plane.gmane.org ([80.91.229.3]:45970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKQRv-0000HT-84 for emacs-orgmode@gnu.org; Thu, 21 Aug 2014 07:22:35 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XKQRt-0000DE-I3 for emacs-orgmode@gnu.org; Thu, 21 Aug 2014 13:22:33 +0200 Received: from g231105128.adsl.alicedsl.de ([92.231.105.128]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Aug 2014 13:22:33 +0200 Received: from tjolitz by g231105128.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Aug 2014 13:22:33 +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 Nicolas Goaziou writes: > Hello, > > Thorsten Jolitz 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