[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #64748] Can't use with emacs 29
From: |
Julien Palard |
Subject: |
[bug #64748] Can't use with emacs 29 |
Date: |
Thu, 5 Oct 2023 16:01:16 -0400 (EDT) |
Follow-up Comment #2, bug #64748 (project gettext):
[(Erreur - Introuvable)]
I dug deeper and found a clean way to reproduce the bug (still with emacs from
Debian):
$ mv ~/.emacs.d ~/.emacs.old
$ cat > ~/.emacs.d/init.el <<EOF
(require 'package)
(package-initialize)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
EOF
$ emacs
M-x package-list-packages
Install po-mode
C-x C-c
$ emacs any_file.po # gives po-find-file-coding-system-guts: Symbol’s
function definition is void: po-with-temp-buffer
Looks like it has to do with po-mode-autoloads.el near:
(autoload 'po-mode "po-mode" "\
Major mode for translators when they edit PO files.
Special commands:
\\{po-mode-map}
Turning on PO mode calls the value of the variable 'po-mode-hook',
if that value is non-nil. Behaviour may be adjusted through some
variables,
all reachable through 'M-x customize', in group 'Emacs.Editing.I18n.Po'."
t)
(add-to-list 'auto-mode-alist '("\\.po[tx]?\\'\\|\\.po\\." . po-mode))
(modify-coding-system-alist 'file "\\.po[tx]?\\'\\|\\.po\\."
'po-find-file-coding-system)
(register-definition-prefixes "po-mode" '("N_" "po-"))
Maybe when po-compat is evaluated po-mode.el is not loaded yet so the
`po-with-temp-buffer` is not defined yet? By changing `po-with-temp-buffer` to
`with-temp-buffer` in `po-compat.el` the bug vanishes (but I don't think it's
the right fix, that's just me trying to pinpoint the issue).
I really don't know how el files are evaluated, my only friend is strace, and
looks like po-compat.el is in fact evaluated before po-mode.el:
156420 openat(AT_FDCWD,
"/home/mdk/.emacs.d/elpa/po-mode-20230617.1058/po-compat.el",
O_RDONLY|O_CLOEXEC) = 16
156420 openat(AT_FDCWD,
"/home/mdk/.emacs.d/elpa/po-mode-20230617.1058/po-mode.el",
O_RDONLY|O_CLOEXEC) = 16
so I think we have the bug: po-mode-autloads.el uses po-compat.el which want
to use a function from po-mode.el before loading it.
Here follows my full "digging history" on this issue. I wrote it down like
personal notes for me just to keep track of what I was doing.
Digging deeper, still with emacs from Debian trixie packages:
- Starting `emacs -Q`
- M-x load-file /tmp/gettext/gettext-tools/emacs/po-mode.el
- C-x C-f one_of_my.po
- M-x po-mode
- It works
- Starting `emacs -Q`
- M-x load-file ~/.emacs.d/elpa/po-mode-20230617.1058/po-mode.el
- C-x C-f one_of_my.po
- M-x po-mode
- It works
- Starting `emacs`
- M-x load-file ~/.emacs.d/elpa/po-mode-20230617.1058/po-mode.el
- C-x C-f one_of_my.po
- M-x po-mode
- It fails with `Invalid function: po-with-temp-buffer`
- mv ~/.emacs.d ~/.emacs.hidden
- Starting `emacs`
- M-x load-file /tmp/gettext/gettext-tools/emacs/po-mode.el
- C-x C-f one_of_my.po
- M-x po-mode
- It works
OK I'm a bit lost here, so I started removing stuff in ~/.emacs.d/ to see at
which point it starts to work, looks like emacs is doing more that I was
thinking with no init.el file.
OK so today I learnt that emacs, with no init file, will look for the
~/.emacs.d/elpa directory (according to strace, and according to the behavior
I see).
So I'm starting to remove packages from ~/.emacs.d/elpa/ to see if something
fixes something...
OK I now just have:
$ ls
elpa
mdk@seraph:~/.emacs.d
$ ls elpa/
po-mode-20230617.1058
and still have the issue!
I'm now noticing I have two more files in elpa/po-mode-20230617.1058/ vs in
https://github.com/emacsmirror/po-mode/, I have po-mode-autoloads.el and
elpa/po-mode-20230617.1058/po-mode-pkg.el.
Looks like the issue comes from `po-mode-autoloads.el`, removing it forces me
to use `M-x load-file` but I can load po-mode without errors, I'm now digging
into po-mode-autoloads.el (and starting to write the first part of this
message).
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64748>
_______________________________________________
Message posté via Savannah
https://savannah.gnu.org/