Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tex-buf is no longer a part of auctex #39

Closed
wang1zhen opened this issue Apr 9, 2022 · 18 comments
Closed

tex-buf is no longer a part of auctex #39

wang1zhen opened this issue Apr 9, 2022 · 18 comments

Comments

@wang1zhen
Copy link

see the changelog of auctex.

@titanofold
Copy link

It was sufficient to edit the (require 'tex-buf) to read (require 'tex)

@wang1zhen
Copy link
Author

It was sufficient to edit the (require 'tex-buf) to read (require 'tex)

No, I don't think that's true. As latex.el is already required, tex.el should be required by latex.el. And for backward compatibility, I think we shall keep requiring tex-buf.el as long as it exists.

@fab6
Copy link

fab6 commented Apr 13, 2022

Hi,
do you have an advice, how to tell straight that it should use an older commit of auctex until this is working again?
Thanks in advance!

@wang1zhen
Copy link
Author

wang1zhen commented Apr 14, 2022

Hi, do you have an advice, how to tell straight that it should use an older commit of auctex until this is working again? Thanks in advance!

try https://github.com/raxod502/straight.el#how-do-i-pin-package-versions-or-use-only-tagged-releases

@fab6
Copy link

fab6 commented Apr 14, 2022

ok, thank you

@felker
Copy link

felker commented Apr 14, 2022

AUCTeX 13.1 was released on 2022-02-20. Couldn't find the change you mentioned in either of these changelogs @wang1zhen:

Is it sufficient to use 13.0, or do you recommend an earlier version?

@titanofold
Copy link

That mirror may be out of date. https://git.savannah.gnu.org/gitweb/?p=emacs/elpa.git;a=commit;h=4b1c7015ae77b88832af35510232e1a1b716da3a

It is removed with the release of 13.1.2.

@stefan2904
Copy link

stefan2904 commented Apr 15, 2022

I now also ran into this issue.

In the AUCTeX.info (for version 13.1.2 from 2022-04-08), it says:

   * Now 'tex-buf.el' is merged into 'tex.el' and no longer exists.  If
     your personal code has '(require 'tex-buf)', one of the following
     prescriptions would serve.
       1. Remove '(require 'tex-buf)'.
       2. Replace it with '(require 'tex)'.
       3. Replace it with '(require 'latex)'.

//update: ach, I just noticed PR #40 :-)

@basil-conto
Copy link

FWIW, here's how I'm locally working around the issue at runtime until upstream is patched:

(defun my-auctex-latexmk-advice (req feature &rest args)
  "Call REQ with FEATURE and ARGS, unless FEATURE is `tex-buf'."
  (unless (eq feature 'tex-buf)
    (apply req feature args)))

(with-eval-after-load 'latex
  (unwind-protect
      (progn (advice-add 'require :around #'my-auctex-latexmk-advice)
             (auctex-latexmk-setup))
    (advice-remove 'require #'my-auctex-latexmk-advice)))

@stefan2904
Copy link

stefan2904 commented Apr 19, 2022

The change from PR #40 did the trick for me (applied to my copy of auctex-latexmk.el): 13c26e1

- (require 'tex-buf)
(require 'latex)
+ (require 'tex-buf nil t)

(This tries to load tex-buf but since require's noerror parameter is true, it does not result in an error in case it is not found. This makes the patch backwards-compatible.)

@berhoel
Copy link

berhoel commented Apr 20, 2022

The change from PR #40 did the trick for me (applied to my copy of auctex-latexmk.el): 13c26e1

- (require 'tex-buf)
(require 'latex)
+ (require 'tex-buf nil t)

(This tries to load tex-buf but since require's noerror parameter is true, it does not result in an error in case it is not found. This makes the patch backwards-compatible.)

This solution is problematic in my setting, where my OS package installer insists on installing auctex 12.3, but I insist on upgrading auctex via MELPA.

tex-buf is still found and loaded even if I use auctex 13.1.3.

for latex-extra I proposed:

- (require 'tex-buf)
  (require 'latex)
+ (unless (string-prefix-p "13" AUCTeX-version)
+   (require 'tex-buf))

@wang1zhen
Copy link
Author

The change from PR #40 did the trick for me (applied to my copy of auctex-latexmk.el): 13c26e1

- (require 'tex-buf)
(require 'latex)
+ (require 'tex-buf nil t)

(This tries to load tex-buf but since require's noerror parameter is true, it does not result in an error in case it is not found. This makes the patch backwards-compatible.)

This solution is problematic in my setting, where my OS package installer insists on installing auctex 12.3, but I insist on upgrading auctex via MELPA.

tex-buf is still found and loaded even if I use auctex 13.1.3.

for latex-extra I proposed:

- (require 'tex-buf)
  (require 'latex)
+ (unless (string-prefix-p "13" AUCTeX-version)
+   (require 'tex-buf))

I guess you might need to remove the old version of auctex files manually

@berhoel
Copy link

berhoel commented Apr 20, 2022

I guess you might need to remove the old version of auctex files manually

The old auctex was installed by my OS package manager. I can remove it, but there is some dependency that gets it reinstalled with the next update.

@felker
Copy link

felker commented Apr 20, 2022

@basil-conto thanks for sharing your runtime fix. Do you put those lines before the require/use-package lines?

The Error still appears in *Messages* for me with:

(defun my-auctex-latexmk-advice (req feature &rest args)
  "Call REQ with FEATURE and ARGS, unless FEATURE is `tex-buf'."
  (unless (eq feature 'tex-buf)
    (apply req feature args)))

(with-eval-after-load 'latex
  (unwind-protect
      (progn (advice-add 'require :around #'my-auctex-latexmk-advice)
             (auctex-latexmk-setup))
    (advice-remove 'require #'my-auctex-latexmk-advice)))

(use-package auctex-latexmk
  :ensure t
  :config
  (auctex-latexmk-setup)
  )

@basil-conto
Copy link

@felker

The Error still appears in *Messages* for me with:

That may be because you're calling auctex-latexmk-setup twice, once with the surrounding advice in place, and once without.

Or it may be because of the :ensure keyword, since the function advice I posted does not work around the tex-buf error during package installation.

Considering you see the error in the *Messages* buffer, I'm guessing it's the former.

Do you put those lines before the require/use-package lines?

The lines I wrote are standalone, i.e. independent of any use-package stanzas you may have. Here's how you could write the same advice more closely coupled with use-package, but disclaimer: I don't use use-package so this is only lightly tested.

(use-package auctex-latexmk
  :ensure t
  :defer t
  :after latex
  :functions auctex-latexmk-setup
  :preface
  (defun my-auctex-latexmk-advice (req feature &rest args)
    "Call REQ with FEATURE and ARGS, unless FEATURE is `tex-buf'."
    (unless (eq feature 'tex-buf)
      (apply req feature args)))
  :init
  (unwind-protect
      (progn (advice-add 'require :around #'my-auctex-latexmk-advice)
             (auctex-latexmk-setup))
    (advice-remove 'require #'my-auctex-latexmk-advice)))

Note that, as I mentioned above, this will not fix the tex-buf error the first time auctex-latexmk is installed thanks to the :ensure keyword.

@felker
Copy link

felker commented Apr 21, 2022

@basil-conto thanks! for someone who doesnt utilize use-package, you are more fluent with it than I am 😄 This worked and didnt throw the error, with or without :ensure t.

@jsilve24
Copy link

For some reason this doesn't work for me and I get the following error at startup

Error (use-package): auctex-latexmk/:init: Symbol’s value as variable is void: TeX-expand-list Disable showing Disable logging

@basil-conto
Copy link

basil-conto commented Apr 28, 2022

For some reason this doesn't work for me and I get the following error at startup

That shouldn't happen, as auctex-latexmk.el loads latex.el, which loads tex.el, which defines TeX-expand-list.

Can you get a backtrace for the error? E.g. via M-x toggle-debug-on-error, by setting (setq debug-on-error t), or by starting Emacs with the --debug-init option?

Do you have any other tex, latex, auctex, or auctex-latexmk configurations? Do you have a copy of auctex-latexmk-setup lying somewhere? Have you tried reinstalling your packages, or commenting out parts of your user-init-file to see if any other parts of it may be giving rise to this issue? What is your M-x emacs-version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants