From: Sebastian Rose <sebastian_rose@gmx.de>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: Emacs-orgmode mailing list <emacs-orgmode@gnu.org>
Subject: Re: [patch] Terminating lists by indentation of #+SPECIALS too
Date: Thu, 22 Apr 2010 03:26:12 +0200 [thread overview]
Message-ID: <871ve846rv.fsf@gmx.de> (raw)
In-Reply-To: <BEB3CDEA-D203-4FEB-B9FF-322B577B1AEA@gmail.com> (Carsten Dominik's message of "Wed, 21 Apr 2010 23:21:38 +0200")
[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]
Carsten Dominik <carsten.dominik@gmail.com> 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:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff, Size: 1110 bytes --]
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)
[-- Attachment #3: Type: text/plain, Size: 15 bytes --]
Sebastian
[-- Attachment #4: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next prev parent reply other threads:[~2010-04-22 1:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-18 23:01 [patch] Terminating lists by indentation of #+SPECIALS too Sebastian Rose
2010-04-18 23:54 ` Sebastian Rose
2010-04-21 7:59 ` Carsten Dominik
2010-04-21 16:08 ` Sebastian Rose
2010-04-21 21:21 ` Carsten Dominik
2010-04-22 1:26 ` Sebastian Rose [this message]
2010-04-22 8:22 ` Carsten Dominik
2010-04-22 9:09 ` Sebastian Rose
2010-04-22 9:44 ` Carsten Dominik
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871ve846rv.fsf@gmx.de \
--to=sebastian_rose@gmx.de \
--cc=carsten.dominik@gmail.com \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.