emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] fix hook calling in org-export-remove-or-extract-drawers
@ 2012-05-01  1:20 Bill Wishon
  2012-05-01 10:01 ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Bill Wishon @ 2012-05-01  1:20 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 400 bytes --]

* lisp/org-exp.el (org-export-remove-or-extract-drawers): Changed funcall
to run-hook-with-args-until-success to properly run the
org-export-format-drawer-function hook.

The problem was that funcall was being executed on the hook (list of
functions) instead of running the hook with
run-hook-with-args-until-success, which tries to run potentially a list of
hooks until one returns non-nil.

~>Bill

[-- Attachment #1.2: Type: text/html, Size: 422 bytes --]

[-- Attachment #2: 0001-Capture-Fix-call-to-org-export-format-drawer-functio.patch --]
[-- Type: application/octet-stream, Size: 1387 bytes --]

From 73df0bdec7289271f4084b91ff633e3537a44df1 Mon Sep 17 00:00:00 2001
From: William Wishon <bill@wishon.org>
Date: Mon, 30 Apr 2012 17:56:18 -0700
Subject: [PATCH] Capture: Fix call to org-export-format-drawer-function hook

* lisp/org-exp.el (org-export-remove-or-extract-drawers): Changed funcall to run-hook-with-args-until-success to properly run the org-export-format-drawer-function hook.

The problem was that funcall was being executed on the hook instead of running the hook with run-hook-with-args-until-success, which tries to run potentially a list of hooks until one returns non-nil.

Modified by William Wishon

TINYCHANGE
---
 lisp/org-exp.el |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 9aac321..796a86c 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1519,9 +1519,9 @@ EXP-DRAWERS will be removed."
 	 (delete-region beg (point))
 	 (when (or (eq exp-drawers t)
 		   (member name exp-drawers))
-	   (setq content (funcall (or org-export-format-drawer-function
-				      'org-export-format-drawer)
-				  name content))
+	   (setq content (or (run-hook-with-args-until-success
+			      'org-export-format-drawer-function name content)
+				      (org-export-format-drawer name content)))
 	   (insert content)))))))
 
 (defun org-export-format-drawer (name content)
-- 
1.7.10.msysgit.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-02 12:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-01  1:20 [PATCH] fix hook calling in org-export-remove-or-extract-drawers Bill Wishon
2012-05-01 10:01 ` Bastien
2012-05-01 14:46   ` Bill Wishon
2012-05-01 17:58     ` Bastien
2012-05-01 18:02       ` Bill Wishon
2012-05-01 18:18       ` Nicolas Goaziou
2012-05-01 18:29         ` Bill Wishon
2012-05-02 12:35           ` Nicolas Goaziou

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).