* Re: Autoload is being read inside documentation
2022-06-04 16:46 ` Lars Ingebrigtsen
2022-06-04 16:52 ` Daniel Fleischer
@ 2022-06-14 20:55 ` Basil L. Contovounesios
2022-06-15 12:05 ` Lars Ingebrigtsen
1 sibling, 1 reply; 6+ messages in thread
From: Basil L. Contovounesios @ 2022-06-14 20:55 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Daniel Fleischer, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]
Lars Ingebrigtsen [2022-06-04 18:46 +0200] wrote:
> Daniel Fleischer <danflscr@gmail.com> writes:
>
>> Hi, I've noticed a possible bug where an ;;;###autoload directive is
>> being read inside a documentation string of some `defvar` which didn't
>> happen before.
>
> There shouldn't be any such doc string in the Emacs tree -- did you find
> this problem with an external package?
>
> I've now made the scanner check whether it's inside a string (when
> scanning outside of the Emacs build).
Thanks, but git-bisect says this change had other fallout with package
autoloads:
e74652386d62a5a6142bf6332e0e4b4aa48c7088 is the first bad commit
commit e74652386d62a5a6142bf6332e0e4b4aa48c7088
Author: Lars Ingebrigtsen <larsi@gnus.org>
Date: Sat Jun 4 18:41:10 2022 +0200
Make loaddefs-generate--parse-file more robust
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Ensure that we don't have an autoload cookie on the first column
inside a string.
Here's the recipe:
$ cd "$(mktemp -d)"
$ export HOME="$PWD" XDG_CONFIG_HOME="$PWD/.config"
$ emacs -Q
M-x package-install RET auctex RET
C-x C-c
$ emacs -Q -f toggle-debug-on-error -f package-initialize
C-x C-f foo.tex RET
Here's the backtrace:
[-- Attachment #2: backtrace.txt --]
[-- Type: text/plain, Size: 2423 bytes --]
Debugger entered--Lisp error: (void-function TeX-latex-mode)
TeX-latex-mode()
apply(TeX-latex-mode nil)
latex-mode()
tex--redirect-to-submode(#f(advice TeX-tex-mode :override #f(compiled-function () (interactive nil) #<bytecode 0x17c9c237b2ee7511>)))
apply(tex--redirect-to-submode #f(advice TeX-tex-mode :override #f(compiled-function () (interactive nil) #<bytecode 0x17c9c237b2ee7511>)) nil)
tex-mode()
set-auto-mode-0(tex-mode nil)
set-auto-mode--apply-alist((("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr) ("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil jka-compr) ("\\.Z\\'" nil jka-compr) ("\\.vr[hi]?\\'" . vera-mode) ("\\(?:\\.\\(?:rbw?\\|ru\\|rake\\|thor\\|jbuilder\\|rabl\\|ge..." . ruby-mode) ("\\.re?st\\'" . rst-mode) ("\\.py[iw]?\\'" . python-mode) ("\\.m\\'" . octave-maybe-mode) ("\\.less\\'" . less-css-mode) ("\\.scss\\'" . scss-mode) ("\\.awk\\'" . awk-mode) ("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode) ("\\.idl\\'" . idl-mode) ("\\.java\\'" . java-mode) ("\\.m\\'" . objc-mode) ("\\.ii\\'" . c++-mode) ("\\.i\\'" . c-mode) ("\\.lex\\'" . c-mode) ("\\.y\\(acc\\)?\\'" . c-mode) ("\\.h\\'" . c-or-c++-mode) ("\\.c\\'" . c-mode) ("\\.\\(CC?\\|HH?\\)\\'" . c++-mode) ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode) ("\\.\\(cc\\|hh\\)\\'" . c++-mode) ("\\.\\(bat\\|cmd\\)\\'" . bat-mode) ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . mhtml-mode) ("\\.svgz?\\'" . image-mode) ("\\.svgz?\\'" . xml-mode) ("\\.x[bp]m\\'" . image-mode) ("\\.x[bp]m\\'" . c-mode) ("\\.p[bpgn]m\\'" . image-mode) ("\\.tiff?\\'" . image-mode) ("\\.gif\\'" . image-mode) ("\\.png\\'" . image-mode) ("\\.jpe?g\\'" . image-mode) ("\\.webp\\'" . image-mode) ("\\.te?xt\\'" . text-mode) ("\\.[tT]e[xX]\\'" . tex-mode) ("\\.ins\\'" . tex-mode) ("\\.ltx\\'" . latex-mode) ("\\.dtx\\'" . doctex-mode) ("\\.org\\'" . org-mode) ("\\.dir-locals\\(?:-2\\)?\\.el\\'" . lisp-data-mode) ...) nil nil)
set-auto-mode()
normal-mode(t)
after-find-file(t t)
find-file-noselect-1(#<buffer foo.tex> "~/foo.tex" nil nil "~/foo.tex" nil)
find-file-noselect("~/foo.tex" nil nil t)
find-file("~/foo.tex" t)
funcall-interactively(find-file "~/foo.tex" t)
call-interactively(find-file nil nil)
command-execute(find-file)
[-- Attachment #3: Type: text/plain, Size: 94 bytes --]
It looks like a subset of AUCTeX's autoloads are no longer included in
auctex-autoloads.el:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: auctex-autoloads.diff --]
[-- Type: text/x-diff, Size: 2196 bytes --]
diff --show-c-function -u /tmp/auctex-autoloads-good.el /tmp/auctex-autoloads-bad.el
--- /tmp/auctex-autoloads-good.el 2022-06-14 23:42:15.827566892 +0300
+++ /tmp/auctex-autoloads-bad.el 2022-06-14 23:26:45.625237807 +0300
@@ -9,15 +9,6 @@
\f
;;; Generated autoloads from bib-cite.el
-(autoload 'bib-cite-minor-mode "bib-cite" "\
-Toggle bib-cite mode.
-When bib-cite mode is enabled, citations, labels and refs are highlighted
-when the mouse is over them. Clicking on these highlights with [mouse-2]
-runs `bib-find', and [mouse-3] runs `bib-display'.
-
-(fn ARG)" t nil)
-(autoload 'turn-on-bib-cite "bib-cite" "\
-Unconditionally turn on Bib Cite mode." nil nil)
(register-definition-prefixes "bib-cite" '("LaTeX-" "bib-" "create-alist-from-list" "member-cis" "psg-" "search-directory-tree"))
\f
@@ -76,26 +67,6 @@
(autoload 'BibTeX-auto-store "latex" "\
This function should be called from `bibtex-mode-hook'.
It will setup BibTeX to store keys in an auto file." nil nil)
-(add-to-list 'auto-mode-alist '("\\.drv\\'" . latex-mode) t)
-(add-to-list 'auto-mode-alist '("\\.hva\\'" . latex-mode))
-(autoload 'TeX-latex-mode "latex" "\
-Major mode in AUCTeX for editing LaTeX files.
-See info under AUCTeX for full documentation.
-
-Special commands:
-\\{LaTeX-mode-map}
-
-Entering LaTeX mode calls the value of `text-mode-hook',
-then the value of `TeX-mode-hook', and then the value
-of `LaTeX-mode-hook'." t nil)
-(add-to-list 'auto-mode-alist '("\\.dtx\\'" . doctex-mode))
-(autoload 'docTeX-mode "latex" "\
-Major mode in AUCTeX for editing .dtx files derived from `LaTeX-mode'.
-Runs `LaTeX-mode', sets a few variables and
-runs the hooks in `docTeX-mode-hook'.
-
-(fn)" t nil)
-(defalias 'TeX-doctex-mode #'docTeX-mode)
(register-definition-prefixes "latex" '("Bib" "LaTeX-" "TeX-" "docTeX-" "latex-math-mode"))
\f
@@ -212,10 +183,6 @@
\f
;;; Generated autoloads from tex-bar.el
-(autoload 'TeX-install-toolbar "tex-bar" "\
-Install toolbar buttons for TeX mode." t nil)
-(autoload 'LaTeX-install-toolbar "tex-bar" "\
-Install toolbar buttons for LaTeX mode." t nil)
(register-definition-prefixes "tex-bar" '("TeX-bar-"))
\f
Diff finished. Tue Jun 14 23:42:35 2022
[-- Attachment #5: Type: text/plain, Size: 3069 bytes --]
--
Basil
In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu)
of 2022-06-14 built on tia
Repository revision: e74652386d62a5a6142bf6332e0e4b4aa48c7088
Repository branch: HEAD
System Description: Debian GNU/Linux bookworm/sid
Configured using:
'configure --prefix=/home/blc/.local --with-x-toolkit=no --without-x'
Configured features:
ACL DBUS GMP GNUTLS GPM JSON LCMS2 LIBSELINUX LIBSYSTEMD LIBXML2 MODULES
NOTIFY INOTIFY PDUMPER SECCOMP SOUND SQLITE3 THREADS XIM ZLIB
Important settings:
value of $LANG: en_IE.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Debugger
Minor modes in effect:
shell-dirtrack-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
buffer-read-only: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message yank-media rmc puny dired dnd
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-fns radix-tree cl-print debug
backtrace help-mode find-func tex-mode compile text-property-search
shell pcomplete comint ansi-color ring latexenc finder-inf info tool-bar
auctex-autoloads tex-site package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json map url-vars seq cl-loaddefs
cl-lib cus-start cus-load term/xterm xterm gv subr-x byte-opt bytecomp
byte-compile cconv regexp-opt iso-transl tooltip eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
multi-tty make-network-process emacs)
Memory information:
((conses 16 109799 6599)
(symbols 48 10658 0)
(strings 32 35218 2075)
(string-bytes 1 1023582)
(vectors 16 16588)
(vector-slots 8 191428 5927)
(floats 8 41 32)
(intervals 56 675 0)
(buffers 992 12))
^ permalink raw reply [flat|nested] 6+ messages in thread