emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Do not indent option keywords
Date: Thu, 09 May 2013 22:34:31 +0200	[thread overview]
Message-ID: <87txmbgaeg.fsf@Rainer.invalid> (raw)
In-Reply-To: 8738twge3b.fsf@Rainer.invalid

[-- Attachment #1: Type: text/plain, Size: 66 bytes --]

That was not the patch I was trying to send, sorry.  Second try:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org.el-do-not-indent-option-keyword-lines.patch --]
[-- Type: text/x-patch, Size: 1385 bytes --]

From 990257c497aa9fb0b8250d770c8e899762cc7abc Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Thu, 9 May 2013 22:30:08 +0200
Subject: [PATCH] org.el: do not indent option keyword lines

* lisp/org.el (org-indent-line): Keep option keyword lines at column
  zero so they don't lose their decoration.
---
 lisp/org.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 08570c3..b357c90 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -21932,6 +21932,11 @@ (defun org-indent-line ()
 			     (org-inlinetask-in-task-p)))
 	 (inline-re (and inline-task-p
 			 (org-inlinetask-outline-regexp)))
+	 (opt-re (org-make-options-regexp
+		  '("CATEGORY" "TODO" "COLUMNS" "STARTUP" "ARCHIVE"
+		    "LINK" "PRIORITIES" "CONSTANTS" "PROPERTY" "DRAWERS"
+		    "SETUPFILE" "OPTIONS")
+		  "\\(?:[a-zA-Z][0-9a-zA-Z_]*_TODO\\)"))
 	 column)
     (if (and orgstruct-is-++ (eq pos (point)))
 	(let ((indent-line-function (cadadr (assoc 'indent-line-function org-fb-vars))))
@@ -21976,6 +21981,8 @@ (defun org-indent-line ()
 			  (org-get-indentation (match-string 0))))
 		    (t
 		     (org-get-indentation (match-string 0))))))
+       ;; Option keywords
+       ((looking-at opt-re) (setq column 0))
        ;; This line has nothing special, look at the previous relevant
        ;; line to compute indentation
        (t
-- 
1.8.2.1


[-- Attachment #3: Type: text/plain, Size: 186 bytes --]



Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra

  reply	other threads:[~2013-05-09 20:35 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 [this message]
2013-05-10  6:26   ` Carsten Dominik
2013-05-10  6:39     ` Achim Gratz
2013-05-10 17:57       ` Carsten Dominik
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=87txmbgaeg.fsf@Rainer.invalid \
    --to=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).