From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brady Trainor Subject: Re: [PATCH] No title in org-export-as-odt Date: Fri, 28 Mar 2014 06:05:32 +0000 (UTC) Message-ID: References: <1348466593.45471.YahooMailClassic@web133101.mail.ir2.yahoo.com> <8761p5empk.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTPva-0006RY-Ld for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 02:06:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTPvU-0006zN-Di for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 02:06:06 -0400 Received: from plane.gmane.org ([80.91.229.3]:34534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTPvU-0006zG-77 for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 02:06:00 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WTPvQ-0001NK-SX for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 07:05:56 +0100 Received: from 71-217-24-179.tukw.qwest.net ([71.217.24.179]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Mar 2014 07:05:56 +0100 Received: from algebrat by 71-217-24-179.tukw.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Mar 2014 07:05:56 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Bastien gnu.org> writes: > Brady Trainor 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 - "")))))) + ""))))))) ;; Table of Contents (let* ((with-toc (plist-get info :with-toc)) (depth (and with-toc (if (wholenump with-toc)