Browse Source

Delete htmlize.el from Org’s contrib directory

* lisp/ox-org.el (org-org-publish-to-org):
* lisp/ox-html.el (org-html-htmlize-generate-css):
(org-html-fontify-code):
* lisp/org-agenda.el (org-agenda-write): Throw an error
requesting the user to install htmlize.el.

* doc/org.texi (Exporting agenda views, Literal examples):
Don’t assume htmlize.el is available.

You need to install it from https://github.com/hniksic/emacs-htmlize

See https://github.com/hniksic/emacs-htmlize/issues/7 for this issue.
Bastien 5 months ago
parent
commit
d0ced98943
5 changed files with 20 additions and 1938 deletions
  1. 0 1924
      contrib/lisp/htmlize.el
  2. 11 10
      doc/org.texi
  3. 2 1
      lisp/org-agenda.el
  4. 5 2
      lisp/ox-html.el
  5. 2 1
      lisp/ox-org.el

File diff suppressed because it is too large
+ 0 - 1924
contrib/lisp/htmlize.el


+ 11 - 10
doc/org.texi

@@ -9687,8 +9687,9 @@ See the docstring of the variable for more information.
 
 If you are away from your computer, it can be very useful to have a printed
 version of some agenda views to carry around.  Org mode can export custom
-agenda views as plain text, HTML@footnote{You need to install Hrvoje Niksic's
-@file{htmlize.el}.}, Postscript, PDF@footnote{To create PDF output, the
+agenda views as plain text, HTML@footnote{You need to install
+@file{htmlize.el} from @uref{https://github.com/hniksic/emacs-htmlize,Hrvoje
+Niksic's repository.}, Postscript, PDF@footnote{To create PDF output, the
 ghostscript @file{ps2pdf} utility must be installed on the system.  Selecting
 a PDF file will also create the postscript file.}, and iCalendar files.  If
 you want to do this only occasionally, use the command
@@ -9750,13 +9751,13 @@ or absolute.
 @end lisp
 
 The extension of the file name determines the type of export.  If it is
-@file{.html}, Org mode will use the @file{htmlize.el} package to convert
-the buffer to HTML and save it to this file name.  If the extension is
-@file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
-Postscript output.  If the extension is @file{.ics}, iCalendar export is
-run export over all files that were used to construct the agenda, and
-limit the export to entries listed in the agenda.  Any other
-extension produces a plain ASCII file.
+@file{.html}, Org mode will try to use the @file{htmlize.el} package to
+convert the buffer to HTML and save it to this file name.  If the extension
+is @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
+Postscript output.  If the extension is @file{.ics}, iCalendar export is run
+export over all files that were used to construct the agenda, and limit the
+export to entries listed in the agenda.  Any other extension produces a plain
+ASCII file.
 
 The export files are @emph{not} created when you use one of those
 commands interactively because this might use too much overhead.
@@ -10064,7 +10065,7 @@ If the example is source code from a programming language, or any other text
 that can be marked up by font-lock in Emacs, you can ask for the example to
 look like the fontified Emacs buffer@footnote{This works automatically for
 the HTML back-end (it requires version 1.34 of the @file{htmlize.el} package,
-which is distributed with Org).  Fontified code chunks in @LaTeX{} can be
+which you need to install).  Fontified code chunks in @LaTeX{} can be
 achieved using either the
 @url{https://www.ctan.org/tex-archive/macros/latex/contrib/listings/?lang=en, listings,}
 or the

+ 2 - 1
lisp/org-agenda.el

@@ -3410,7 +3410,8 @@ the agenda to write."
 		 (kill-buffer (current-buffer))
 		 (message "Org file written to %s" file)))
 	      ((member extension '("html" "htm"))
-	       (require 'htmlize)
+	       (or (require 'htmlize nil t)
+		   (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
 	       (set-buffer (htmlize-buffer (current-buffer)))
 	       (when org-agenda-export-html-style
 		 ;; replace <style> section with org-agenda-export-html-style

+ 5 - 2
lisp/ox-html.el

@@ -1743,7 +1743,8 @@ If you then set `org-html-htmlize-output-type' to `css', calls
 to the function `org-html-htmlize-region-for-paste' will
 produce code that uses these same face definitions."
   (interactive)
-  (require 'htmlize)
+  (or (require 'htmlize nil t)
+      (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
   (and (get-buffer "*html*") (kill-buffer "*html*"))
   (with-temp-buffer
     (let ((fl (face-list))
@@ -2165,7 +2166,9 @@ is the language used for CODE, as a string, or nil."
       ;; Simple transcoding.
       (org-html-encode-plain-text code))
      ;; Case 2: No htmlize or an inferior version of htmlize
-     ((not (and (require 'htmlize nil t) (fboundp 'htmlize-region-for-paste)))
+     ((not (and (or (require 'htmlize nil t)
+		    (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
+		(fboundp 'htmlize-region-for-paste)))
       ;; Emit a warning.
       (message "Cannot fontify src block (htmlize.el >= 1.34 required)")
       ;; Simple transcoding.

+ 2 - 1
lisp/ox-org.el

@@ -312,7 +312,8 @@ publishing directory.
 Return output file name."
   (org-publish-org-to 'org filename ".org" plist pub-dir)
   (when (plist-get plist :htmlized-source)
-    (require 'htmlize)
+    (or (require 'htmlize nil t)
+	(error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
     (require 'ox-html)
     (let* ((org-inhibit-startup t)
 	   (htmlize-output-type 'css)