bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug#316852: gettext-el: po-validate prevents proper initialization of co


From: Santiago Vila
Subject: Bug#316852: gettext-el: po-validate prevents proper initialization of compile.el (fwd)
Date: Mon, 4 Jul 2005 19:29:47 +0200 (CEST)

Hello.

I received this from the Debian bug system. As I'm not an emacs lisp
expert, this is really for you to decide.

[ As usual, please keep the Cc: lines when replying. The "-forwarded"
  suffix may be ommited. Thanks ].

---------- Forwarded message ----------
From: Sven Joachim <address@hidden>
To: Debian Bug Tracking System <address@hidden>
Date: Mon, 04 Jul 2005 11:11:51 +0200
Subject: Bug#316852: gettext-el: po-validate prevents proper initialization of
    compile.el

Package: gettext-el
Version: 0.14.4-2
Severity: normal
Tags: patch

There is a bug in po-mode.el, more precisely in the function
po-validate, which can prevent a proper initialization of the Emacs
"compile" package, i.e. important variables such as "compile-command"
may be undefined. To reproduce this bug, take the following steps:

* Start Emacs and load a .po file: emacs -q /tmp/junk.po
* In Emacs, type:
  C-x C-s         to save the file
  V               to call "po-validate"
  M-x compile     to start a compilation process.

You will get the error message
"Symbol's value as variable is void: compile-command".

I believe I have found out the reason for this. In the function
po-validate, the "compile" package is implicitly loaded by a call to
the autoloaded compile command. But this call takes place inside a let*
form, so all defcustoms and defvars from compile.el are evaluated only
temporarily -- and lost afterwards. Subsequent invocations of the
"compile" command won't define them, as the "compile" package is
already loaded.

To fix this, "po-validate" can explicitly load the "compile" feature
if not already present, as in the following patch:

------------------------------------------------------------------
diff -u /usr/share/emacs/site-lisp/gettext/po-mode.el
/home/sven/elisp/po-mode.el
--- /usr/share/emacs/site-lisp/gettext/po-mode.el       2005-05-05
17:07:51.000000000 +0200
+++ /home/sven/elisp/po-mode.el 2005-07-04 08:34:38.000000000 +0200
@@ -3096,6 +3096,7 @@
 (defun po-validate ()
   "Use 'msgfmt' for validating the current PO file contents."
   (interactive)
+  (require 'compile)           ; make sure 'compile.el' is initialized
   (let* ((dev-null
          (cond ((boundp 'null-device) null-device) ; since Emacs 20.3
                ((memq system-type '(windows-nt windows-95)) "NUL")
-------------------------------------------------------------------

Note that I have only tested this patch with GNU Emacs, because I
don't have XEmacs installed.


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.31
Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1)

Versions of packages gettext-el depends on:
ii  emacs21 [emacsen]             21.4a-1    The GNU Emacs editor
ii  gettext                       0.14.4-2   GNU Internationalization utilities

-- no debconf information




reply via email to

[Prev in Thread] Current Thread [Next in Thread]