emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Achim Gratz <Stromeko@nexgo.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Do not indent option keywords
Date: Fri, 10 May 2013 19:57:10 +0200	[thread overview]
Message-ID: <84E4FC16-3269-4639-B880-3D99FF80FC4B@gmail.com> (raw)
In-Reply-To: <874nebfie5.fsf@Rainer.invalid>


On 10.5.2013, at 08:39, Achim Gratz <Stromeko@nexgo.de> wrote:

> Carsten Dominik writes:
>> by decoration you mean font-lock support?
> 
> Yes, but I also don't think these should ever become indented in the
> first place.  That's debatable of course, the syntax as defined by
> org-element does not require this IIRC.

Well, which are the ones you think should never become indented?  OPTIONS, TITLE, of maybe you mean the whole suite of keywords?

I sometimes put the setup below a major headline "* setup" or so, to make them hide away and give the buffer a clean look.  Depending on indentation setting it then does make some sense to allow indentation.  So I think the font-lock fix is more important than the indentation one.

Please read on below.


> 
>> Maybe this would be a better fix:
>> 
>> 	Modified lisp/org.el
>> diff --git a/lisp/org.el b/lisp/org.el
>> index 745fb82..43df094 100644
>> --- a/lisp/org.el
>> +++ b/lisp/org.el
>> @@ -5867,7 +5867,8 @@ by a #."
>> 	   ((or (equal dc1 "+results")
>> 		(member dc1 '("+begin:" "+end:" "+caption:" "+label:"
>> 			      "+orgtbl:" "+tblfm:" "+tblname:" "+results:"
>> -			      "+call:" "+header:" "+headers:" "+name:"))
>> +			      "+call:" "+header:" "+headers:" "+name:"
>> +			      "+options:"))
>> 		(and (match-end 4) (equal dc3 "+attr")))
>> 	    (add-text-properties
>> 	     beg (match-end 0)
> 
> Sure, that helps too and has certainly less potential for controversy.
> 
> I think we should make an effort to shift most if not all the regex
> stuff in org.el into org-element.  There's far too much duplication with
> subtle differences sprinkled all over the place to get match data to
> work with and it's almost hopeless to try and find all such uses for a
> single element.

What do you mean?  Do you meant to use the org-elemnt parser
and base also font-lock on it?  Or do you mean all the definitions
of regexp constants.  This sounds desirable - but it also sounds
like an extremely daunting task with possibilities for problems
in side effects of regexp matching that will be difficult to find
and might only show after a long time.  I guess we could start
such a process one regexp at a time.

- Carsten

  reply	other threads:[~2013-05-10 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09 19:14 [PATCH] Do not indent option keywords Achim Gratz
2013-05-09 20:34 ` Achim Gratz
2013-05-10  6:26   ` Carsten Dominik
2013-05-10  6:39     ` Achim Gratz
2013-05-10 17:57       ` Carsten Dominik [this message]
2013-05-10 18:30         ` Achim Gratz

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=84E4FC16-3269-4639-B880-3D99FF80FC4B@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=Stromeko@nexgo.de \
    --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).