emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] [patch] Terminating lists by indentation of #+SPECIALS too


From: Sebastian Rose
Subject: Re: [Orgmode] [patch] Terminating lists by indentation of #+SPECIALS too
Date: Thu, 22 Apr 2010 03:26:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Carsten Dominik <address@hidden> writes:
> Hi Sebastion, sorry for being hard to satisfy on this one.
>
> What I mean is this:
>
> The location where your patck kicks in looks like this:
>
> ....
>         (org-export-html-close-lists-maybe line)
>
>         ;; Protected HTML
>         (when (get-text-property 0 'org-protected line)
>           (let (par (ind (get-text-property 0 'original-indentation line)))
>             (when (re-search-backward
>                    "\\(<p>\\)\\([ \t\r\n]*\\)\\=" (- (point) 100) t)
>               (setq par (match-string 1))
>               (replace-match "\\2\n"))
>             (insert line "\n")
>
> So before we are looking at protected stuff, there is already a call to
> org-export-html-close-lists-maybe.  It seems to me that what you are trying to
> do
> could just happen inside that function.  The function checks for a text 
> property
> 'original-indentation to check for special stuff that was indented - 
> but apparently that does not cover your case.  So in that function you could
> also look at the protected property and act accordingly.
>
> Does that make sense?



Ah, now I got you here!

You're feeling for the code is all to good :) I could indeed remove more
than half of the lines.


So here comes the next generation:



diff --git a/lisp/org-html.el b/lisp/org-html.el
index 0903bff..5b13649 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -959,10 +959,12 @@ lang=\"%s\" xml:lang=\"%s\">
          (when (equal "ORG-VERSE-START" line)
            (org-close-par-maybe)
            (insert "\n<p class=\"verse\">\n")
+        (setq org-par-open t)
            (setq inverse t)
            (throw 'nextline nil))
          (when (equal "ORG-VERSE-END" line)
            (insert "</p>\n")
+        (setq org-par-open nil)
            (org-open-par)
            (setq inverse nil)
            (throw 'nextline nil))
@@ -1996,7 +1998,11 @@ If there are links in the string, don't modify these."
 (defvar local-list-indent)
 (defvar local-list-type)
 (defun org-export-html-close-lists-maybe (line)
-  (let ((ind (or (get-text-property 0 'original-indentation line)))
+  (let* ((rawhtml (and in-local-list (get-text-property 0 'org-protected 
line)))
+         (ind
+          (if rawhtml
+              (org-get-indentation line)
+            (or (get-text-property 0 'original-indentation line))))
 ;               (and (string-match "\\S-" line)
 ;                    (org-get-indentation line))))
        didclose)


  Sebastian

reply via email to

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