>From 22d9bb459c150f4c271614f6667f76701526a976 Mon Sep 17 00:00:00 2001 From: boccaperta-it Date: Fri, 24 Apr 2015 08:49:28 +0200 Subject: [PATCH 1/2] po-keep-mo-file: keep/discard mo files setting --- gettext-tools/misc/po-mode.el | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/gettext-tools/misc/po-mode.el b/gettext-tools/misc/po-mode.el index 1afba63..d7e9987 100644 --- a/gettext-tools/misc/po-mode.el +++ b/gettext-tools/misc/po-mode.el @@ -130,6 +130,11 @@ Value is nil, t, or ask." :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) @@ -3345,10 +3350,10 @@ Leave point after marked string." (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 @@ -3357,9 +3362,14 @@ Leave point after marked string." (compilation-buffer-name-function (function (lambda (mode-name) (concat "*" mode-name " validation*")))) - (compile-command (concat po-msgfmt-program - " --statistics -c -v -o " dev-null " " - (shell-quote-argument buffer-file-name)))) + (compile-command (if po-keep-mo-file + (concat po-msgfmt-program + " --statistics -c -v -o " + (substring buffer-file-name 0 -2) "mo " + (shell-quote-argument buffer-file-name)) + (concat po-msgfmt-program + " --statistics -c -v -o " dev-null " " + (shell-quote-argument buffer-file-name))))) (po-msgfmt-version-check) (compile compile-command))) -- 2.1.4 >From 517d8affc778e0fa90ff37f1e2abf54596fe9307 Mon Sep 17 00:00:00 2001 From: boccaperta-it Date: Fri, 24 Apr 2015 08:51:31 +0200 Subject: [PATCH 2/2] Fix comments indentation --- gettext-tools/misc/po-mode.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gettext-tools/misc/po-mode.el b/gettext-tools/misc/po-mode.el index d7e9987..b5ee360 100644 --- a/gettext-tools/misc/po-mode.el +++ b/gettext-tools/misc/po-mode.el @@ -3350,10 +3350,10 @@ Leave point after marked string." (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 -- 2.1.4