From b4ba5c7e95bd8e0063157107960fed64e04c00c2 Mon Sep 17 00:00:00 2001 From: Masanao Igarashi Date: Thu, 3 Apr 2025 16:57:19 +0900 Subject: [PATCH] Set default to rst-format-drawer-function --- ox-rst.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ox-rst.el b/ox-rst.el index 31d6af8..7948d62 100644 --- a/ox-rst.el +++ b/ox-rst.el @@ -254,7 +254,7 @@ the same number of blank lines as in the original document." ;;;; Drawers -(defcustom org-rst-format-drawer-function nil +(defcustom org-rst-format-drawer-function (lambda (_name contents) contents) "Function called to format a drawer in reStructuredText code. The function must accept two parameters: @@ -589,18 +589,13 @@ channel." ;;;; Drawer -(defun org-rst-drawer (drawer contents _info) +(defun org-rst-drawer (drawer contents info) "Transcode a DRAWER element from Org to reStructuredText. CONTENTS holds the contents of the block. INFO is a plist holding contextual information." - (let* ((name (org-element-property :drawer-name drawer)) - (output (if (functionp org-rst-format-drawer-function) - (funcall org-rst-format-drawer-function - name contents) - ;; If there's no user defined function: simply - ;; display contents of the drawer. - contents))) - output)) + (funcall (plist-get info :rst-format-drawer-function) + (org-element-property :drawer-name drawer) + contents)) ;;;; Dynamic Block