+2015-04-24 Manuel Uberti <manuel@boccaperta.com> (tiny change)
+
+ * po-mode.el (po-keep-mo-file): New user option.
+ (po-validate): Respect po-keep-mo-file. Fix comment indentation.
+
2015-01-21 Peter Eisentraut <peter@eisentraut.org> (tiny change)
* po-mode.el (po-font-lock-keywords): Support all possible length
:type 'boolean
:group 'po)
+(defcustom po-keep-mo-file nil
+ "*Set whether MO file should be kept or discarded after validation."
+ :type 'boolean
+ :group 'po)
+
(defcustom po-auto-update-file-header t
"*Automatically revise headers. Value is nil, t, or ask."
:type '(choice (const nil)
(defun po-validate ()
"Use 'msgfmt' for validating the current PO file contents."
(interactive)
- ; The 'compile' subsystem is autoloaded through a call to (compile ...).
- ; We need to initialize it outside of any binding. Without this statement,
- ; all defcustoms and defvars of compile.el would be undone when the let*
- ; terminates.
+ ;; The 'compile' subsystem is autoloaded through a call to (compile ...).
+ ;; We need to initialize it outside of any binding. Without this statement,
+ ;; all defcustoms and defvars of compile.el would be undone when the let*
+ ;; terminates.
(require 'compile)
(let* ((dev-null
(cond ((boundp 'null-device) null-device) ; since Emacs 20.3
((memq system-type '(windows-nt windows-95)) "NUL")
(t "/dev/null")))
+ (output
+ (if po-keep-mo-file
+ (concat (file-name-sans-extension buffer-file-name) ".mo")
+ dev-null))
(compilation-buffer-name-function
(function (lambda (mode-name)
(concat "*" mode-name " validation*"))))
(compile-command (concat po-msgfmt-program
- " --statistics -c -v -o " dev-null " "
+ " --statistics -c -v -o "
+ (shell-quote-argument output) " "
(shell-quote-argument buffer-file-name))))
(po-msgfmt-version-check)
(compile compile-command)))