[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex e9af1e68fb 15/77: Fix preview-latex to work with
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex e9af1e68fb 15/77: Fix preview-latex to work with desktop.el again |
Date: |
Fri, 26 Aug 2022 16:06:32 -0400 (EDT) |
branch: externals/auctex
commit e9af1e68fb464a45369e19ff85162c49467c87e6
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Fix preview-latex to work with desktop.el again
* preview.el.in (): Don't use obsolete variable
`desktop-buffer-misc-functions'.
(): Just use `desktop-buffer-mode-handlers' which all supported
Emacsens now have.
Use autoload cookie instead of `eval-after-load'.
(desktop-buffer-preview): Add autoload cookie so that it's available
before preview.el is loaded.
(LaTeX-preview-setup): Don't use `desktop-buffer-misc' because it
isn't available (It's now lexically scoped variable in
`desktop-create-buffer'. In addition, `LaTeX-preview-setup' isn't
called anyway during `desktop-buffer-misc' is bound.).
---
preview.el.in | 36 ++++++++++++++++--------------------
1 file changed, 16 insertions(+), 20 deletions(-)
diff --git a/preview.el.in b/preview.el.in
index a995485d77..96c5706683 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -2328,11 +2328,6 @@ kept."
(and save-info
(cons 'preview (cons timestamp (nreverse save-info))))))))
-(eval-after-load "desktop"
- '(add-hook
- 'desktop-buffer-misc-functions
- #'desktop-buffer-preview-misc-data))
-
(defvar preview-temp-dirs nil
"List of top level temporary directories in use from preview.
Any directory not in this list will be cleared out by preview
@@ -2388,6 +2383,18 @@ BUFFER-MISC is the appropriate data to be used."
(preview-buffer-restore-internal
buffer-misc))))))
+;; Add autoload cookies explicitly for desktop.el.
+;; <Background> preview-latex doesn't conform to the following
+;; assumptions of desktop.el:
+;; (1) The file associated with the major mode by autoload has defun
+;; of handler, which restores the state of the buffer.
+;; (2) The file has suitable `add-to-list' form also for
+;; `desktop-buffer-mode-handlers' to register the entry of the
+;; handler.
+;; This isn't the case here because the file associated with
+;; `latex-mode' is tex-mode.el, neither preview.el nor latex.el. Thus
+;; we include both of them as explicit autoloads in preview-latex.el.
+;;;###autoload
(defun desktop-buffer-preview (file-name _buffer-name misc)
"Hook function for restoring persistent previews into a buffer."
(when (and file-name (file-readable-p file-name))
@@ -2398,18 +2405,9 @@ BUFFER-MISC is the appropriate data to be used."
buf)
buf))))
-(eval-after-load "desktop"
- '(if (boundp 'desktop-buffer-mode-handlers)
- (add-to-list 'desktop-buffer-mode-handlers
- '(latex-mode . desktop-buffer-preview))
- (defvar desktop-buffer-file-name)
- (defvar desktop-buffer-name)
- (defvar desktop-buffer-misc)
- (add-hook 'desktop-buffer-handlers (lambda ()
- (desktop-buffer-preview
- desktop-buffer-file-name
- desktop-buffer-name
- desktop-buffer-misc)))))
+;;;###autoload
+(add-to-list 'desktop-buffer-mode-handlers
+ '(latex-mode . desktop-buffer-preview))
(defcustom preview-auto-cache-preamble 'ask
"Whether to generate a preamble cache format automatically.
@@ -3115,9 +3113,7 @@ to add the preview functionality."
`(menu-item "Preview at point" preview-at-point
:image ,preview-tb-icon
:help "Preview on/off at point"
- :vert-only t)))
- (if (boundp 'desktop-buffer-misc)
- (preview-buffer-restore desktop-buffer-misc))))
+ :vert-only t)))))
(defun preview-clean-subdir (dir)
"Cleans out a temporary DIR with preview image files."
- [elpa] externals/auctex updated (b91f15b3a3 -> 0029ca410f), Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 71a288a2fe 08/77: Add styles for iftex bundle, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 9ede1fa203 03/77: Improve insertion of & in matrix-like environments, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 7846cb9f94 04/77: Mention 'M-RET' alias which runs `LaTeX-insert-item', Tassilo Horn, 2022/08/26
- [elpa] externals/auctex ba6e5ef69c 07/77: ; Fix warnings reported by 'make dynvars-check', Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 619f329595 10/77: * tex-ispell.el (TeX-ispell-skip-cmds-list): Support shortvrb.sty., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex fabe675915 12/77: Adapt regression test for the previous commit, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex ecf8b28cda 14/77: Add new style/multibib.el, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex e9af1e68fb 15/77: Fix preview-latex to work with desktop.el again,
Tassilo Horn <=
- [elpa] externals/auctex 37e5a450a3 20/77: Complete LaTeX lengths and counters, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 3f0d5a7411 23/77: Add support for \linespread macro, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex d47a6e8716 29/77: Support complex \input path (bug#55511), Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 9378b66daa 61/77: Add TODO, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 9a3078e510 68/77: Fix comments and doc strings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 30f7a1ca68 63/77: Don't use void function texinfo-outline-level, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 3447aa75c3 32/77: ; Further fixes about single quotes in docstrings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex fade32d568 54/77: Don't break line inside \verb-like macro (bug#56160), Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 545129e1c3 55/77: * style/shortvrb.el: Add missing macros incl. fontification., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 010a1e24be 01/77: Follow up the previous commit, Tassilo Horn, 2022/08/26