ox-odt: Remove obnoxious messages when compiling library

* lisp/ox-odt.el (org-odt-schema-dir):
(org-odt-styles-dir): Remove debugging messages.  Small refactoring.
This commit is contained in:
Nicolas Goaziou 2016-07-25 17:18:03 +02:00
parent c4da20a2f3
commit 67c29aa1e8
1 changed files with 19 additions and 37 deletions

View File

@ -187,20 +187,14 @@ heuristically based on the values of `org-odt-lib-dir' and
`org-odt-data-dir'.") `org-odt-data-dir'.")
(defconst org-odt-styles-dir (defconst org-odt-styles-dir
(let* ((styles-dir (let ((styles-dir
(catch 'styles-dir (cl-find-if
(message "Debug (ox-odt): Searching for OpenDocument styles files...") (lambda (dir)
(dolist (styles-dir org-odt-styles-dir-list) (and dir
(when styles-dir (file-readable-p
(message "Debug (ox-odt): Trying %s..." styles-dir) (expand-file-name "OrgOdtContentTemplate.xml" dir))
(when (and (file-readable-p (file-readable-p (expand-file-name "OrgOdtStyles.xml" dir))))
(expand-file-name org-odt-styles-dir-list)))
"OrgOdtContentTemplate.xml" styles-dir))
(file-readable-p
(expand-file-name
"OrgOdtStyles.xml" styles-dir)))
(message "Debug (ox-odt): Using styles under %s" styles-dir)
(throw 'styles-dir styles-dir)))))))
(unless styles-dir (unless styles-dir
(error "Error (ox-odt): Cannot find factory styles files, aborting")) (error "Error (ox-odt): Cannot find factory styles files, aborting"))
styles-dir) styles-dir)
@ -212,9 +206,9 @@ This directory contains the following XML files -
`org-odt-styles-file' and `org-odt-content-template-file'. `org-odt-styles-file' and `org-odt-content-template-file'.
The default value of this variable varies depending on the The default value of this variable varies depending on the
version of org in use and is initialized from version of Org in use and is initialized from
`org-odt-styles-dir-list'. Note that the user could be using org `org-odt-styles-dir-list'. Note that the user could be using Org
from one of: org's own private git repository, GNU ELPA tar or from one of: Org own private git repository, GNU ELPA tar or
standard Emacs.") standard Emacs.")
(defconst org-odt-bookmark-prefix "OrgXref.") (defconst org-odt-bookmark-prefix "OrgXref.")
@ -384,26 +378,14 @@ visually."
(require 'rng-loc) (require 'rng-loc)
(defcustom org-odt-schema-dir (defcustom org-odt-schema-dir
(let* ((schema-dir (cl-find-if
(catch 'schema-dir (lambda (dir)
(message "Debug (ox-odt): Searching for OpenDocument schema files...") (and dir
(dolist (schema-dir org-odt-schema-dir-list) (file-expand-wildcards
(when schema-dir (expand-file-name "od-manifest-schema*.rnc" dir))
(message "Debug (ox-odt): Trying %s..." schema-dir) (file-expand-wildcards (expand-file-name "od-schema*.rnc" dir))
(when (and (file-expand-wildcards (file-readable-p (expand-file-name "schemas.xml" dir))))
(expand-file-name "od-manifest-schema*.rnc" org-odt-schema-dir-list)
schema-dir))
(file-expand-wildcards
(expand-file-name "od-schema*.rnc"
schema-dir))
(file-readable-p
(expand-file-name "schemas.xml" schema-dir)))
(message "Debug (ox-odt): Using schema files under %s"
schema-dir)
(throw 'schema-dir schema-dir))))
(message "Debug (ox-odt): No OpenDocument schema files installed")
nil)))
schema-dir)
"Directory that contains OpenDocument schema files. "Directory that contains OpenDocument schema files.
This directory contains: This directory contains: