2017-06-21 11:20:20 +00:00
|
|
|
;;; ox-org.el --- Org Back-End for Org Export Engine -*- lexical-binding: t; -*-
|
2013-11-12 13:06:26 +00:00
|
|
|
|
2018-01-01 08:21:42 +00:00
|
|
|
;; Copyright (C) 2013-2018 Free Software Foundation, Inc.
|
2013-11-12 13:06:26 +00:00
|
|
|
|
|
|
|
;; Author: Nicolas Goaziou <n.goaziou@gmail.com>
|
|
|
|
;; Keywords: org, wp
|
|
|
|
|
Fix and standardize some copyright and license notices
* ob-abc.el: Add year, part of Emacs, standardize license text.
* ob-ebnf.el: Part of Emacs, standardize license text.
* ob-makefile.el: Fix years.
* org-macro.el, ox-beamer.el, ox-latex.el, ox-org.el: Part of Emacs.
* ox-ascii.el, ox-md.el, ox.el: Use range for years, part of Emacs.
* ox-html.el: Part of Emacs.
(org-html-scripts): Add 2013 to copyright years.
(org-html-infojs-template): Set copyright holder to FSF.
* ox-icalendar.el: Part of Emacs, fix years.
* ox-texinfo.el: Copyright to FSF, use range for years.
2013-11-12 17:03:46 +00:00
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2013-11-12 13:06:26 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2013-11-12 13:06:26 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
2014-01-07 13:22:53 +00:00
|
|
|
|
2013-11-12 13:06:26 +00:00
|
|
|
(require 'ox)
|
Pacify ‘make check-declare’
* lisp/cedet/srecode/insert.el (data-debug-new-buffer)
(data-debug-insert-stuff-list, data-debug-insert-thing):
* lisp/emulation/viper-ex.el (viper-change-state-to-vi)
(viper-change-state-to-emacs):
* lisp/emulation/viper-macs.el (viper-change-state-to-vi):
* lisp/org/ob-asymptote.el (orgtbl-to-generic):
* lisp/org/ob-awk.el (orgtbl-to-generic):
* lisp/org/ob-core.el (org-edit-src-code, orgtbl-to-generic):
* lisp/org/ob-emacs-lisp.el (orgtbl-to-generic):
* lisp/org/ob-exp.el (org-element-context):
* lisp/org/ob-gnuplot.el (org-time-string-to-time)
(orgtbl-to-generic):
* lisp/org/ob-haskell.el (org-export-to-file):
* lisp/org/ob-latex.el (org-create-formula-image)
(org-latex-compile):
* lisp/org/ob-python.el (run-python):
* lisp/org/ob-sh.el (orgtbl-to-generic):
* lisp/org/ob-tangle.el (org-link-escape, org-back-to-heading):
* lisp/org/org-colview.el (org-agenda-redo):
* lisp/org/org-feed.el (url-retrieve-synchronously):
* lisp/org/org-info.el (Info-find-node):
* lisp/org/org-list.el (org-previous-line-empty-p):
* lisp/org/org-macs.el (org-string-match-p):
* lisp/org/org.el (org-beamer-mode):
Fix prototype to match current definition.
* lisp/emacs-lisp/advice.el (function-called-at-point):
* lisp/progmodes/prolog.el (compilation-shell-minor-mode):
Fix typo: extra '.
* lisp/emacs-lisp/cl-generic.el (cl-defmethod):
Insert ,' to pacify check-declare.
* lisp/org/ob-comint.el (tramp-flush-directory-property):
* lisp/org/ob-tangle.el (org-babel-update-block-body):
* lisp/org/org-bibtex.el (org-babel-trim):
* lisp/org/org-pcomplete.el (org-export-backend-options):
* lisp/org/org-protocol.el (org-publish-get-project-from-filename):
Fix file name in declare-function.
* lisp/org/ob-comint.el (with-parsed-tramp-file-name)
* lisp/org/ob-core.el (with-parsed-tramp-file-name):
* lisp/org/org.el (org-beamer-mode):
* lisp/url/url-http.el (gnutls-negotiate):
Append ‘t’ to declare-function, since the declaration isn’t a defun.
* lisp/org/ob-core.el (show-all):
Declare outline-show-all instead, since it is the
non-obsolete version of this function.
(org-save-outline-visibility): Remove; not needed.
* lisp/org/ob-scheme.el (run-geiser, geiser-mode)
(geiser-eval-region, geiser-repl-exit):
* lisp/org/ox-org.el (htmlize-buffer):
Prepend "ext:" to file name, since it is not part of Emacs.
* lisp/org/ob-sh.el (org-babel-comint-in-buffer)
* lisp/org/org-gnus.el (nnimap-group-overview-filename):
Remove decl, since function was removed.
* lisp/org/ob-sh.el (org-babel-comint-with-output):
* lisp/org/org-macro.el (org-with-wide-buffer):
Omit unnecessary (and mismatching) decl.
* lisp/org/org-agenda.el (calendar-absolute-from-iso):
* lisp/org/org-clock.el (calendar-iso-to-absolute):
Declare calendar-iso-to-absolute instead, since it is the
non-obsolete version of this function.
* lisp/org/org-compat.el (w32-focus-frame):
Remove decl, since function is now obsolete.
2016-05-15 02:56:53 +00:00
|
|
|
(declare-function htmlize-buffer "ext:htmlize" (&optional buffer))
|
2017-06-21 11:20:20 +00:00
|
|
|
(defvar htmlize-output-type)
|
2013-11-12 13:06:26 +00:00
|
|
|
|
|
|
|
(defgroup org-export-org nil
|
|
|
|
"Options for exporting Org mode files to Org."
|
|
|
|
:tag "Org Export Org"
|
|
|
|
:group 'org-export
|
|
|
|
:version "24.4"
|
|
|
|
:package-version '(Org . "8.0"))
|
|
|
|
|
|
|
|
(defcustom org-org-htmlized-css-url nil
|
|
|
|
"URL pointing to the CSS defining colors for htmlized Emacs buffers.
|
|
|
|
Normally when creating an htmlized version of an Org buffer,
|
|
|
|
htmlize will create the CSS to define the font colors. However,
|
|
|
|
this does not work when converting in batch mode, and it also can
|
|
|
|
look bad if different people with different fontification setup
|
|
|
|
work on the same website. When this variable is non-nil,
|
|
|
|
creating an htmlized version of an Org buffer using
|
|
|
|
`org-org-export-as-org' will include a link to this URL if the
|
2017-06-21 11:20:20 +00:00
|
|
|
setting of `org-html-htmlize-output-type' is `css'."
|
2013-11-12 13:06:26 +00:00
|
|
|
:group 'org-export-org
|
|
|
|
:type '(choice
|
|
|
|
(const :tag "Don't include external stylesheet link" nil)
|
|
|
|
(string :tag "URL or local href")))
|
|
|
|
|
|
|
|
(org-export-define-backend 'org
|
|
|
|
'((babel-call . org-org-identity)
|
|
|
|
(bold . org-org-identity)
|
|
|
|
(center-block . org-org-identity)
|
|
|
|
(clock . org-org-identity)
|
|
|
|
(code . org-org-identity)
|
|
|
|
(diary-sexp . org-org-identity)
|
|
|
|
(drawer . org-org-identity)
|
|
|
|
(dynamic-block . org-org-identity)
|
|
|
|
(entity . org-org-identity)
|
|
|
|
(example-block . org-org-identity)
|
2017-06-21 11:20:20 +00:00
|
|
|
(export-block . org-org-export-block)
|
2013-11-12 13:06:26 +00:00
|
|
|
(fixed-width . org-org-identity)
|
2014-10-03 08:13:51 +00:00
|
|
|
(footnote-definition . ignore)
|
2013-11-12 13:06:26 +00:00
|
|
|
(footnote-reference . org-org-identity)
|
|
|
|
(headline . org-org-headline)
|
|
|
|
(horizontal-rule . org-org-identity)
|
|
|
|
(inline-babel-call . org-org-identity)
|
|
|
|
(inline-src-block . org-org-identity)
|
|
|
|
(inlinetask . org-org-identity)
|
|
|
|
(italic . org-org-identity)
|
|
|
|
(item . org-org-identity)
|
|
|
|
(keyword . org-org-keyword)
|
|
|
|
(latex-environment . org-org-identity)
|
|
|
|
(latex-fragment . org-org-identity)
|
|
|
|
(line-break . org-org-identity)
|
2017-06-21 11:20:20 +00:00
|
|
|
(link . org-org-link)
|
2013-11-12 13:06:26 +00:00
|
|
|
(node-property . org-org-identity)
|
2017-06-21 11:20:20 +00:00
|
|
|
(template . org-org-template)
|
2013-11-12 13:06:26 +00:00
|
|
|
(paragraph . org-org-identity)
|
|
|
|
(plain-list . org-org-identity)
|
|
|
|
(planning . org-org-identity)
|
|
|
|
(property-drawer . org-org-identity)
|
|
|
|
(quote-block . org-org-identity)
|
|
|
|
(radio-target . org-org-identity)
|
2014-10-03 08:13:51 +00:00
|
|
|
(section . org-org-section)
|
2013-11-12 13:06:26 +00:00
|
|
|
(special-block . org-org-identity)
|
|
|
|
(src-block . org-org-identity)
|
|
|
|
(statistics-cookie . org-org-identity)
|
|
|
|
(strike-through . org-org-identity)
|
|
|
|
(subscript . org-org-identity)
|
|
|
|
(superscript . org-org-identity)
|
|
|
|
(table . org-org-identity)
|
|
|
|
(table-cell . org-org-identity)
|
|
|
|
(table-row . org-org-identity)
|
|
|
|
(target . org-org-identity)
|
|
|
|
(timestamp . org-org-identity)
|
|
|
|
(underline . org-org-identity)
|
|
|
|
(verbatim . org-org-identity)
|
|
|
|
(verse-block . org-org-identity))
|
|
|
|
:menu-entry
|
|
|
|
'(?O "Export to Org"
|
|
|
|
((?O "As Org buffer" org-org-export-as-org)
|
|
|
|
(?o "As Org file" org-org-export-to-org)
|
|
|
|
(?v "As Org file and open"
|
|
|
|
(lambda (a s v b)
|
|
|
|
(if a (org-org-export-to-org t s v b)
|
2017-06-21 11:20:20 +00:00
|
|
|
(org-open-file (org-org-export-to-org nil s v b)))))))
|
|
|
|
:filters-alist '((:filter-parse-tree . org-org--add-missing-sections)))
|
|
|
|
|
|
|
|
(defun org-org--add-missing-sections (tree _backend _info)
|
|
|
|
"Ensure each headline has an associated section.
|
|
|
|
|
|
|
|
TREE is the parse tree being exported.
|
|
|
|
|
|
|
|
Footnotes relative to the headline are inserted in the section,
|
|
|
|
using `org-org-section'. However, this function is not called if
|
|
|
|
the headline doesn't contain any section in the first place, so
|
|
|
|
we make sure it is always called."
|
|
|
|
(org-element-map tree 'headline
|
|
|
|
(lambda (h)
|
|
|
|
(let ((first-child (car (org-element-contents h)))
|
|
|
|
(new-section (org-element-create 'section)))
|
|
|
|
(pcase (org-element-type first-child)
|
|
|
|
(`section nil)
|
|
|
|
(`nil (org-element-adopt-elements h new-section))
|
|
|
|
(_ (org-element-insert-before new-section first-child))))))
|
|
|
|
tree)
|
|
|
|
|
|
|
|
(defun org-org-export-block (export-block _contents _info)
|
|
|
|
"Transcode a EXPORT-BLOCK element from Org to LaTeX.
|
|
|
|
CONTENTS and INFO are ignored."
|
|
|
|
(and (equal (org-element-property :type export-block) "ORG")
|
|
|
|
(org-element-property :value export-block)))
|
|
|
|
|
|
|
|
(defun org-org-identity (blob contents _info)
|
2013-11-12 13:06:26 +00:00
|
|
|
"Transcode BLOB element or object back into Org syntax.
|
|
|
|
CONTENTS is its contents, as a string or nil. INFO is ignored."
|
2014-01-07 13:22:53 +00:00
|
|
|
(let ((case-fold-search t))
|
|
|
|
(replace-regexp-in-string
|
|
|
|
"^[ \t]*#\\+ATTR_[-_A-Za-z0-9]+:\\(?: .*\\)?\n" ""
|
|
|
|
(org-export-expand blob contents t))))
|
2013-11-12 13:06:26 +00:00
|
|
|
|
|
|
|
(defun org-org-headline (headline contents info)
|
|
|
|
"Transcode HEADLINE element back into Org syntax.
|
|
|
|
CONTENTS is its contents, as a string or nil. INFO is ignored."
|
2014-10-03 08:13:51 +00:00
|
|
|
(unless (org-element-property :footnote-section-p headline)
|
|
|
|
(unless (plist-get info :with-todo-keywords)
|
|
|
|
(org-element-put-property headline :todo-keyword nil))
|
|
|
|
(unless (plist-get info :with-tags)
|
|
|
|
(org-element-put-property headline :tags nil))
|
|
|
|
(unless (plist-get info :with-priority)
|
|
|
|
(org-element-put-property headline :priority nil))
|
|
|
|
(org-element-put-property headline :level
|
|
|
|
(org-export-get-relative-level headline info))
|
|
|
|
(org-element-headline-interpreter headline contents)))
|
2013-11-12 13:06:26 +00:00
|
|
|
|
2017-06-21 11:20:20 +00:00
|
|
|
(defun org-org-keyword (keyword _contents _info)
|
2013-11-12 13:06:26 +00:00
|
|
|
"Transcode KEYWORD element back into Org syntax.
|
2017-06-21 11:20:20 +00:00
|
|
|
CONTENTS is nil. INFO is ignored."
|
|
|
|
(let ((key (org-element-property :key keyword)))
|
|
|
|
(unless (member key
|
|
|
|
'("AUTHOR" "CREATOR" "DATE" "EMAIL" "OPTIONS" "TITLE"))
|
|
|
|
(org-element-keyword-interpreter keyword nil))))
|
|
|
|
|
|
|
|
(defun org-org-link (link contents _info)
|
|
|
|
"Transcode LINK object back into Org syntax.
|
|
|
|
CONTENTS is the description of the link, as a string, or nil.
|
|
|
|
INFO is a plist containing current export state."
|
|
|
|
(or (org-export-custom-protocol-maybe link contents 'org)
|
|
|
|
(org-element-link-interpreter link contents)))
|
|
|
|
|
|
|
|
(defun org-org-template (contents info)
|
|
|
|
"Return Org document template with document keywords.
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist used
|
|
|
|
as a communication channel."
|
|
|
|
(concat
|
|
|
|
(and (plist-get info :time-stamp-file)
|
|
|
|
(format-time-string "# Created %Y-%m-%d %a %H:%M\n"))
|
|
|
|
(org-element-normalize-string
|
|
|
|
(mapconcat #'identity
|
|
|
|
(org-element-map (plist-get info :parse-tree) 'keyword
|
|
|
|
(lambda (k)
|
|
|
|
(and (string-equal (org-element-property :key k) "OPTIONS")
|
|
|
|
(concat "#+OPTIONS: "
|
|
|
|
(org-element-property :value k)))))
|
|
|
|
"\n"))
|
|
|
|
(and (plist-get info :with-title)
|
|
|
|
(format "#+TITLE: %s\n" (org-export-data (plist-get info :title) info)))
|
|
|
|
(and (plist-get info :with-date)
|
|
|
|
(let ((date (org-export-data (org-export-get-date info) info)))
|
|
|
|
(and (org-string-nw-p date)
|
|
|
|
(format "#+DATE: %s\n" date))))
|
|
|
|
(and (plist-get info :with-author)
|
|
|
|
(let ((author (org-export-data (plist-get info :author) info)))
|
|
|
|
(and (org-string-nw-p author)
|
|
|
|
(format "#+AUTHOR: %s\n" author))))
|
|
|
|
(and (plist-get info :with-email)
|
|
|
|
(let ((email (org-export-data (plist-get info :email) info)))
|
|
|
|
(and (org-string-nw-p email)
|
|
|
|
(format "#+EMAIL: %s\n" email))))
|
|
|
|
(and (plist-get info :with-creator)
|
|
|
|
(org-string-nw-p (plist-get info :creator))
|
|
|
|
(format "#+CREATOR: %s\n" (plist-get info :creator)))
|
|
|
|
contents))
|
2013-11-12 13:06:26 +00:00
|
|
|
|
2014-10-03 08:13:51 +00:00
|
|
|
(defun org-org-section (section contents info)
|
|
|
|
"Transcode SECTION element back into Org syntax.
|
|
|
|
CONTENTS is the contents of the section. INFO is a plist used as
|
|
|
|
a communication channel."
|
|
|
|
(concat
|
|
|
|
(org-element-normalize-string contents)
|
|
|
|
;; Insert footnote definitions appearing for the first time in this
|
2017-06-21 11:20:20 +00:00
|
|
|
;; section, or in the relative headline title. Indeed, some of
|
|
|
|
;; them may not be available to narrowing so we make sure all of
|
|
|
|
;; them are included in the result.
|
|
|
|
(let ((footnotes
|
|
|
|
(org-element-map
|
|
|
|
(list (org-export-get-parent-headline section) section)
|
|
|
|
'footnote-reference
|
2014-10-03 08:13:51 +00:00
|
|
|
(lambda (fn)
|
|
|
|
(and (eq (org-element-property :type fn) 'standard)
|
|
|
|
(org-export-footnote-first-reference-p fn info)
|
2017-06-21 11:20:20 +00:00
|
|
|
(org-element-normalize-string
|
|
|
|
(format "[fn:%s] %s"
|
|
|
|
(org-element-property :label fn)
|
|
|
|
(org-export-data
|
|
|
|
(org-export-get-footnote-definition fn info)
|
|
|
|
info)))))
|
|
|
|
info nil 'headline t)))
|
|
|
|
(and footnotes (concat "\n" (mapconcat #'identity footnotes "\n"))))))
|
2014-10-03 08:13:51 +00:00
|
|
|
|
2013-11-12 13:06:26 +00:00
|
|
|
;;;###autoload
|
2017-06-21 11:20:20 +00:00
|
|
|
(defun org-org-export-as-org
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2013-11-12 13:06:26 +00:00
|
|
|
"Export current buffer to an Org buffer.
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
asynchronously. The resulting buffer should be accessible
|
|
|
|
through the `org-export-stack' interface.
|
|
|
|
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
first.
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
contents of hidden elements.
|
|
|
|
|
2017-06-21 11:20:20 +00:00
|
|
|
When optional argument BODY-ONLY is non-nil, strip document
|
|
|
|
keywords from output.
|
|
|
|
|
2013-11-12 13:06:26 +00:00
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
Export is done in a buffer named \"*Org ORG Export*\", which will
|
|
|
|
be displayed when `org-export-show-temporary-export-buffer' is
|
|
|
|
non-nil."
|
|
|
|
(interactive)
|
|
|
|
(org-export-to-buffer 'org "*Org ORG Export*"
|
2017-06-21 11:20:20 +00:00
|
|
|
async subtreep visible-only body-only ext-plist (lambda () (org-mode))))
|
2013-11-12 13:06:26 +00:00
|
|
|
|
|
|
|
;;;###autoload
|
2017-06-21 11:20:20 +00:00
|
|
|
(defun org-org-export-to-org
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2013-11-12 13:06:26 +00:00
|
|
|
"Export current buffer to an org file.
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
first.
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
contents of hidden elements.
|
|
|
|
|
2017-06-21 11:20:20 +00:00
|
|
|
When optional argument BODY-ONLY is non-nil, strip document
|
|
|
|
keywords from output.
|
|
|
|
|
2013-11-12 13:06:26 +00:00
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
Return output file name."
|
|
|
|
(interactive)
|
|
|
|
(let ((outfile (org-export-output-file-name ".org" subtreep)))
|
|
|
|
(org-export-to-file 'org outfile
|
2017-06-21 11:20:20 +00:00
|
|
|
async subtreep visible-only body-only ext-plist)))
|
2013-11-12 13:06:26 +00:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun org-org-publish-to-org (plist filename pub-dir)
|
|
|
|
"Publish an org file to org.
|
|
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
|
|
is the property list for the given project. PUB-DIR is the
|
|
|
|
publishing directory.
|
|
|
|
|
|
|
|
Return output file name."
|
|
|
|
(org-publish-org-to 'org filename ".org" plist pub-dir)
|
|
|
|
(when (plist-get plist :htmlized-source)
|
2017-09-18 10:01:12 +00:00
|
|
|
(or (require 'htmlize nil t)
|
|
|
|
(error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
|
2013-11-12 13:06:26 +00:00
|
|
|
(require 'ox-html)
|
|
|
|
(let* ((org-inhibit-startup t)
|
|
|
|
(htmlize-output-type 'css)
|
|
|
|
(html-ext (concat "." (or (plist-get plist :html-extension)
|
|
|
|
org-html-extension "html")))
|
|
|
|
(visitingp (find-buffer-visiting filename))
|
* lisp/font-lock.el (font-lock-flush, font-lock-ensure): New functions.
(font-lock-fontify-buffer): Mark interactive-only.
(font-lock-multiline, font-lock-fontified, font-lock-set-defaults):
Make buffer-local.
(font-lock-specified-p): Remove redundant boundp check.
(font-lock-flush-function, font-lock-ensure-function): New vars.
(font-lock-turn-on-thing-lock): Set them.
(font-lock-default-fontify-buffer): Obey font-lock-dont-widen.
(font-lock-after-change-function): Make `old-len' optional.
(font-lock-set-defaults): Remove redundant `set' of font-lock-defaults.
Call font-lock-flush, just in case.
* lisp/progmodes/verilog-mode.el (verilog-preprocess): Disable workaround in
recent Emacsen.
* lisp/progmodes/vera-mode.el (vera-fontify-buffer): Declare obsolete.
(vera-mode-map, vera-mode-menu): Remove bindings to it.
* lisp/progmodes/idlw-help.el (idlwave-help-fontify): Use font-lock-ensure
and with-syntax-table.
* lisp/textmodes/conf-mode.el (conf-quote-normal):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/prog-mode.el (prettify-symbols-mode):
* lisp/progmodes/f90.el (f90-font-lock-n):
* lisp/progmodes/cwarn.el (cwarn-mode):
* lisp/nxml/nxml-mode.el (nxml-toggle-char-ref-extra-display):
* lisp/progmodes/compile.el (compilation-setup, compilation--unsetup):
* lisp/hi-lock.el (hi-lock-mode, hi-lock-unface-buffer)
(hi-lock-set-pattern, hi-lock-set-file-patterns): Use font-lock-flush.
* lisp/mail/rmail.el (rmail-variables): Set font-lock-dont-widen instead of
font-lock-fontify-buffer-function and
font-lock-unfontify-buffer-function.
(rmail-unfontify-buffer-function, rmail-fontify-message):
Use with-silent-modifications.
* lisp/htmlfontify.el (hfy-force-fontification): Use jit-lock-fontify-now
and font-lock-ensure.
* lisp/bs.el (bs-show-in-buffer): Use font-lock-ensure.
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Use font-lock-ensure.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use font-lock-flush.
* lisp/org/org-compat.el (org-font-lock-ensure): New function.
* lisp/org/ox-odt.el (org-odt-do-format-code):
* lisp/org/ox-html.el (org-html-fontify-code):
* lisp/org/org.el (org-fontify-like-in-org-mode):
* lisp/org/org-src.el (org-src-font-lock-fontify-block):
* lisp/org/org-clock.el (org-clock-get-clocktable): Use it.
* lisp/org/ox-org.el (org-org-publish-to-org): Use it. Avoid using find-file
from Elisp.
* test/automated/ruby-mode-tests.el (ruby-assert-face): Use font-lock-ensure.
(ruby-interpolation-keeps-non-quote-syntax): Use syntax-propertize.
2014-05-29 03:45:29 +00:00
|
|
|
(work-buffer (or visitingp (find-file-noselect filename)))
|
2013-11-12 13:06:26 +00:00
|
|
|
newbuf)
|
* lisp/font-lock.el (font-lock-flush, font-lock-ensure): New functions.
(font-lock-fontify-buffer): Mark interactive-only.
(font-lock-multiline, font-lock-fontified, font-lock-set-defaults):
Make buffer-local.
(font-lock-specified-p): Remove redundant boundp check.
(font-lock-flush-function, font-lock-ensure-function): New vars.
(font-lock-turn-on-thing-lock): Set them.
(font-lock-default-fontify-buffer): Obey font-lock-dont-widen.
(font-lock-after-change-function): Make `old-len' optional.
(font-lock-set-defaults): Remove redundant `set' of font-lock-defaults.
Call font-lock-flush, just in case.
* lisp/progmodes/verilog-mode.el (verilog-preprocess): Disable workaround in
recent Emacsen.
* lisp/progmodes/vera-mode.el (vera-fontify-buffer): Declare obsolete.
(vera-mode-map, vera-mode-menu): Remove bindings to it.
* lisp/progmodes/idlw-help.el (idlwave-help-fontify): Use font-lock-ensure
and with-syntax-table.
* lisp/textmodes/conf-mode.el (conf-quote-normal):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/prog-mode.el (prettify-symbols-mode):
* lisp/progmodes/f90.el (f90-font-lock-n):
* lisp/progmodes/cwarn.el (cwarn-mode):
* lisp/nxml/nxml-mode.el (nxml-toggle-char-ref-extra-display):
* lisp/progmodes/compile.el (compilation-setup, compilation--unsetup):
* lisp/hi-lock.el (hi-lock-mode, hi-lock-unface-buffer)
(hi-lock-set-pattern, hi-lock-set-file-patterns): Use font-lock-flush.
* lisp/mail/rmail.el (rmail-variables): Set font-lock-dont-widen instead of
font-lock-fontify-buffer-function and
font-lock-unfontify-buffer-function.
(rmail-unfontify-buffer-function, rmail-fontify-message):
Use with-silent-modifications.
* lisp/htmlfontify.el (hfy-force-fontification): Use jit-lock-fontify-now
and font-lock-ensure.
* lisp/bs.el (bs-show-in-buffer): Use font-lock-ensure.
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Use font-lock-ensure.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use font-lock-flush.
* lisp/org/org-compat.el (org-font-lock-ensure): New function.
* lisp/org/ox-odt.el (org-odt-do-format-code):
* lisp/org/ox-html.el (org-html-fontify-code):
* lisp/org/org.el (org-fontify-like-in-org-mode):
* lisp/org/org-src.el (org-src-font-lock-fontify-block):
* lisp/org/org-clock.el (org-clock-get-clocktable): Use it.
* lisp/org/ox-org.el (org-org-publish-to-org): Use it. Avoid using find-file
from Elisp.
* test/automated/ruby-mode-tests.el (ruby-assert-face): Use font-lock-ensure.
(ruby-interpolation-keeps-non-quote-syntax): Use syntax-propertize.
2014-05-29 03:45:29 +00:00
|
|
|
(with-current-buffer work-buffer
|
|
|
|
(org-font-lock-ensure)
|
2017-06-21 11:20:20 +00:00
|
|
|
(outline-show-all)
|
* lisp/font-lock.el (font-lock-flush, font-lock-ensure): New functions.
(font-lock-fontify-buffer): Mark interactive-only.
(font-lock-multiline, font-lock-fontified, font-lock-set-defaults):
Make buffer-local.
(font-lock-specified-p): Remove redundant boundp check.
(font-lock-flush-function, font-lock-ensure-function): New vars.
(font-lock-turn-on-thing-lock): Set them.
(font-lock-default-fontify-buffer): Obey font-lock-dont-widen.
(font-lock-after-change-function): Make `old-len' optional.
(font-lock-set-defaults): Remove redundant `set' of font-lock-defaults.
Call font-lock-flush, just in case.
* lisp/progmodes/verilog-mode.el (verilog-preprocess): Disable workaround in
recent Emacsen.
* lisp/progmodes/vera-mode.el (vera-fontify-buffer): Declare obsolete.
(vera-mode-map, vera-mode-menu): Remove bindings to it.
* lisp/progmodes/idlw-help.el (idlwave-help-fontify): Use font-lock-ensure
and with-syntax-table.
* lisp/textmodes/conf-mode.el (conf-quote-normal):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/prog-mode.el (prettify-symbols-mode):
* lisp/progmodes/f90.el (f90-font-lock-n):
* lisp/progmodes/cwarn.el (cwarn-mode):
* lisp/nxml/nxml-mode.el (nxml-toggle-char-ref-extra-display):
* lisp/progmodes/compile.el (compilation-setup, compilation--unsetup):
* lisp/hi-lock.el (hi-lock-mode, hi-lock-unface-buffer)
(hi-lock-set-pattern, hi-lock-set-file-patterns): Use font-lock-flush.
* lisp/mail/rmail.el (rmail-variables): Set font-lock-dont-widen instead of
font-lock-fontify-buffer-function and
font-lock-unfontify-buffer-function.
(rmail-unfontify-buffer-function, rmail-fontify-message):
Use with-silent-modifications.
* lisp/htmlfontify.el (hfy-force-fontification): Use jit-lock-fontify-now
and font-lock-ensure.
* lisp/bs.el (bs-show-in-buffer): Use font-lock-ensure.
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Use font-lock-ensure.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use font-lock-flush.
* lisp/org/org-compat.el (org-font-lock-ensure): New function.
* lisp/org/ox-odt.el (org-odt-do-format-code):
* lisp/org/ox-html.el (org-html-fontify-code):
* lisp/org/org.el (org-fontify-like-in-org-mode):
* lisp/org/org-src.el (org-src-font-lock-fontify-block):
* lisp/org/org-clock.el (org-clock-get-clocktable): Use it.
* lisp/org/ox-org.el (org-org-publish-to-org): Use it. Avoid using find-file
from Elisp.
* test/automated/ruby-mode-tests.el (ruby-assert-face): Use font-lock-ensure.
(ruby-interpolation-keeps-non-quote-syntax): Use syntax-propertize.
2014-05-29 03:45:29 +00:00
|
|
|
(org-show-block-all)
|
|
|
|
(setq newbuf (htmlize-buffer)))
|
2013-11-12 13:06:26 +00:00
|
|
|
(with-current-buffer newbuf
|
|
|
|
(when org-org-htmlized-css-url
|
|
|
|
(goto-char (point-min))
|
|
|
|
(and (re-search-forward
|
|
|
|
"<style type=\"text/css\">[^\000]*?\n[ \t]*</style>.*" nil t)
|
|
|
|
(replace-match
|
|
|
|
(format
|
|
|
|
"<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">"
|
* lisp/font-lock.el (font-lock-flush, font-lock-ensure): New functions.
(font-lock-fontify-buffer): Mark interactive-only.
(font-lock-multiline, font-lock-fontified, font-lock-set-defaults):
Make buffer-local.
(font-lock-specified-p): Remove redundant boundp check.
(font-lock-flush-function, font-lock-ensure-function): New vars.
(font-lock-turn-on-thing-lock): Set them.
(font-lock-default-fontify-buffer): Obey font-lock-dont-widen.
(font-lock-after-change-function): Make `old-len' optional.
(font-lock-set-defaults): Remove redundant `set' of font-lock-defaults.
Call font-lock-flush, just in case.
* lisp/progmodes/verilog-mode.el (verilog-preprocess): Disable workaround in
recent Emacsen.
* lisp/progmodes/vera-mode.el (vera-fontify-buffer): Declare obsolete.
(vera-mode-map, vera-mode-menu): Remove bindings to it.
* lisp/progmodes/idlw-help.el (idlwave-help-fontify): Use font-lock-ensure
and with-syntax-table.
* lisp/textmodes/conf-mode.el (conf-quote-normal):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/prog-mode.el (prettify-symbols-mode):
* lisp/progmodes/f90.el (f90-font-lock-n):
* lisp/progmodes/cwarn.el (cwarn-mode):
* lisp/nxml/nxml-mode.el (nxml-toggle-char-ref-extra-display):
* lisp/progmodes/compile.el (compilation-setup, compilation--unsetup):
* lisp/hi-lock.el (hi-lock-mode, hi-lock-unface-buffer)
(hi-lock-set-pattern, hi-lock-set-file-patterns): Use font-lock-flush.
* lisp/mail/rmail.el (rmail-variables): Set font-lock-dont-widen instead of
font-lock-fontify-buffer-function and
font-lock-unfontify-buffer-function.
(rmail-unfontify-buffer-function, rmail-fontify-message):
Use with-silent-modifications.
* lisp/htmlfontify.el (hfy-force-fontification): Use jit-lock-fontify-now
and font-lock-ensure.
* lisp/bs.el (bs-show-in-buffer): Use font-lock-ensure.
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Use font-lock-ensure.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use font-lock-flush.
* lisp/org/org-compat.el (org-font-lock-ensure): New function.
* lisp/org/ox-odt.el (org-odt-do-format-code):
* lisp/org/ox-html.el (org-html-fontify-code):
* lisp/org/org.el (org-fontify-like-in-org-mode):
* lisp/org/org-src.el (org-src-font-lock-fontify-block):
* lisp/org/org-clock.el (org-clock-get-clocktable): Use it.
* lisp/org/ox-org.el (org-org-publish-to-org): Use it. Avoid using find-file
from Elisp.
* test/automated/ruby-mode-tests.el (ruby-assert-face): Use font-lock-ensure.
(ruby-interpolation-keeps-non-quote-syntax): Use syntax-propertize.
2014-05-29 03:45:29 +00:00
|
|
|
org-org-htmlized-css-url)
|
|
|
|
t t)))
|
2013-11-12 13:06:26 +00:00
|
|
|
(write-file (concat pub-dir (file-name-nondirectory filename) html-ext)))
|
|
|
|
(kill-buffer newbuf)
|
|
|
|
(unless visitingp (kill-buffer work-buffer)))
|
* lisp/font-lock.el (font-lock-flush, font-lock-ensure): New functions.
(font-lock-fontify-buffer): Mark interactive-only.
(font-lock-multiline, font-lock-fontified, font-lock-set-defaults):
Make buffer-local.
(font-lock-specified-p): Remove redundant boundp check.
(font-lock-flush-function, font-lock-ensure-function): New vars.
(font-lock-turn-on-thing-lock): Set them.
(font-lock-default-fontify-buffer): Obey font-lock-dont-widen.
(font-lock-after-change-function): Make `old-len' optional.
(font-lock-set-defaults): Remove redundant `set' of font-lock-defaults.
Call font-lock-flush, just in case.
* lisp/progmodes/verilog-mode.el (verilog-preprocess): Disable workaround in
recent Emacsen.
* lisp/progmodes/vera-mode.el (vera-fontify-buffer): Declare obsolete.
(vera-mode-map, vera-mode-menu): Remove bindings to it.
* lisp/progmodes/idlw-help.el (idlwave-help-fontify): Use font-lock-ensure
and with-syntax-table.
* lisp/textmodes/conf-mode.el (conf-quote-normal):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/prog-mode.el (prettify-symbols-mode):
* lisp/progmodes/f90.el (f90-font-lock-n):
* lisp/progmodes/cwarn.el (cwarn-mode):
* lisp/nxml/nxml-mode.el (nxml-toggle-char-ref-extra-display):
* lisp/progmodes/compile.el (compilation-setup, compilation--unsetup):
* lisp/hi-lock.el (hi-lock-mode, hi-lock-unface-buffer)
(hi-lock-set-pattern, hi-lock-set-file-patterns): Use font-lock-flush.
* lisp/mail/rmail.el (rmail-variables): Set font-lock-dont-widen instead of
font-lock-fontify-buffer-function and
font-lock-unfontify-buffer-function.
(rmail-unfontify-buffer-function, rmail-fontify-message):
Use with-silent-modifications.
* lisp/htmlfontify.el (hfy-force-fontification): Use jit-lock-fontify-now
and font-lock-ensure.
* lisp/bs.el (bs-show-in-buffer): Use font-lock-ensure.
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Use font-lock-ensure.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use font-lock-flush.
* lisp/org/org-compat.el (org-font-lock-ensure): New function.
* lisp/org/ox-odt.el (org-odt-do-format-code):
* lisp/org/ox-html.el (org-html-fontify-code):
* lisp/org/org.el (org-fontify-like-in-org-mode):
* lisp/org/org-src.el (org-src-font-lock-fontify-block):
* lisp/org/org-clock.el (org-clock-get-clocktable): Use it.
* lisp/org/ox-org.el (org-org-publish-to-org): Use it. Avoid using find-file
from Elisp.
* test/automated/ruby-mode-tests.el (ruby-assert-face): Use font-lock-ensure.
(ruby-interpolation-keeps-non-quote-syntax): Use syntax-propertize.
2014-05-29 03:45:29 +00:00
|
|
|
;; FIXME: Why? Which buffer is this supposed to apply to?
|
2013-11-12 13:06:26 +00:00
|
|
|
(set-buffer-modified-p nil)))
|
|
|
|
|
|
|
|
|
|
|
|
(provide 'ox-org)
|
|
|
|
|
|
|
|
;; Local variables:
|
|
|
|
;; generated-autoload-file: "org-loaddefs.el"
|
|
|
|
;; End:
|
|
|
|
|
|
|
|
;;; ox-org.el ends here
|