emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] No title in org-export-as-odt


From: Brady Trainor
Subject: Re: [O] [PATCH] No title in org-export-as-odt
Date: Fri, 28 Mar 2014 06:05:32 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Bastien <bzg <at> gnu.org> writes:

> Brady Trainor <algebrat <at> uw.edu> writes:
> 
> > For my solution, I changed insert to ignore. 
> 
> Can you provide your change in the form of a patch?
> 

> 4. in Emacs, hit `C-x v =' from the file to create the patch


I wanted to return to this and attempt it, here is my first patch ever: 


diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index da2ca3f..8c7f0fe 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -1491,7 +1491,7 @@ original parsed data.  INFO is a plist holding export 
options."
       (goto-char (match-beginning 0))

       ;; Preamble - Title, Author, Date etc.
-      (insert
+      (ignore
        (let* ((title (org-export-data (plist-get info :title) info))
           (author (and (plist-get info :with-author)
                (let ((auth (plist-get info :author)))


I installed a fresh version of org-mode from Elpa or Melpa before doing 
this. (I am just now looking a little into the maint branch.)

In the long-long run, when I go to insert the code, I wonder why we don't 
make removing the title an option in ox.el. Otherwise, I might've 
considered figuring out how to expose the above ad-hoc solution as a 
variable in the customize group. I don't know what the use cases are for 
the title. So, a temporary solution might go, org-odt-export-preamble off 
and on.

(ETA: then, perhaps the individual exporters should be focused on, before 
considering pulling variables back to ox.el.) 

Thank you always for org-mode,

Brady

P.S., so... I went ahead and tried the exposed variable fix, and that is 
below: (This was my first shot at making a Emacs customizable variable, 
blindly with no RTFM, and... I don't think it works as is.) 

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index da2ca3f..c2b4609 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -351,6 +351,16 @@ the entity.  See `org-odt--enumerate'.")
   :group 'org-export)


+;;;; Insert Preamble (Title, Author...)
+
+(defcustom org-odt-insert-preamble 'nil
+  "Choose whether title and author preamble appears in export."
+  :group 'org-export-odt
+  :version "24.1"
+  :type 'boolean
+  )
+
+
 ;;;; Debugging

 (defcustom org-odt-prettify-xml nil
@@ -1491,6 +1501,7 @@ original parsed data.  INFO is a plist holding export 
options."
       (goto-char (match-beginning 0))

       ;; Preamble - Title, Author, Date etc.
+      (if org-odt-insert-preamble
       (insert
        (let* ((title (org-export-data (plist-get info :title) info))
           (author (and (plist-get info :with-author)
@@ -1543,7 +1554,7 @@ original parsed data.  INFO is a plist holding export 
options."
                (org-odt--format-timestamp (car date))
              (org-export-data (plist-get info :date) info)))
            ;; Separator
-           "<text:p text:style-name=\"OrgSubtitle\"/>"))))))
+           "<text:p text:style-name=\"OrgSubtitle\"/>")))))))
       ;; Table of Contents
       (let* ((with-toc (plist-get info :with-toc))
          (depth (and with-toc (if (wholenump with-toc)







reply via email to

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