From: Brady Trainor <algebrat@uw.edu>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] No title in org-export-as-odt
Date: Fri, 28 Mar 2014 06:05:32 +0000 (UTC) [thread overview]
Message-ID: <loom.20140328T065958-200@post.gmane.org> (raw)
In-Reply-To: 8761p5empk.fsf@bzg.ath.cx
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)
next prev parent reply other threads:[~2014-03-28 6:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-24 6:03 No title in org-export-as-odt Miguel Ruiz
2012-09-24 6:42 ` Nick Dokos
2012-09-24 12:10 ` Giovanni Ridolfi
2014-01-27 6:31 ` Brady Trainor
2014-01-27 10:35 ` Bastien
2014-03-28 6:05 ` Brady Trainor [this message]
2014-04-16 14:38 ` [PATCH] " Bastien
2014-01-27 14:23 ` Jambunathan K
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20140328T065958-200@post.gmane.org \
--to=algebrat@uw.edu \
--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 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).