Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7522429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:31:12+00:00 2026-05-30T02:31:12+00:00

I use the function TeX-parse-error defined by Ivan Andrus at the bottom of Emacs

  • 0

I use the function TeX-parse-error defined by Ivan Andrus at the bottom of Emacs latexmk function throws me into an empty buffer in order to automatically open the *TeX Help* buffer when there was an error during the compilation (C-c C-c). After correcting an error and compiling again, the *TeX Help* buffer remains open (although the error has been corrected). Is there any way to adjust the function (unfortunately, I’m not experienced in elisp programming) so that the *TeX Help* buffer is closed if the error was resolved and updated (and still open) if the error wasn’t resolved? That would save a lot of typing like C-c ' to show the *TeX Help* buffer and C-x 1 to hide it again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:31:14+00:00Added an answer on May 30, 2026 at 2:31 am

    First, let’s define a function that finds the *TeX Help* buffer, if it exists, closes its window, and then kills the buffer:

    (defun demolish-tex-help ()
      (interactive)
      (if (get-buffer "*TeX Help*") ;; Tests if the buffer exists
          (progn ;; Do the following commands in sequence
            (if (get-buffer-window (get-buffer "*TeX Help*")) ;; Tests if the window exists
                (delete-window (get-buffer-window (get-buffer "*TeX Help*")))
              ) ;; That should close the window
            (kill-buffer "*TeX Help*") ;; This should kill the buffer
            )
        )
      )
    

    Now, you have to call this when you call whatever function it is that you use to compile. Taking the example from that other page, you can modify Ivan Andrus’s function to be:

    (defun run-latexmk ()
      (interactive)
      (let ((TeX-save-query nil)
            (TeX-process-asynchronous nil)
            (master-file (TeX-master-file)))
        (TeX-save-document "")
        (TeX-run-TeX "latexmk"
                     (TeX-command-expand "latexmk %t" 'TeX-master-file)
                     master-file)
        (if (plist-get TeX-error-report-switches (intern master-file))
            (TeX-next-error t)
          (progn
           (demolish-tex-help)
           (minibuffer-message "latexmk done")))))
    
    (add-hook 'LaTeX-mode-hook
              (lambda () (local-set-key (kbd "C-0") #'run-latexmk)))
    

    (Note: This doesn’t actually work for me, because my latexmk is screwed up, so I haven’t successfully tested it. But if Ivan’s version worked for you, then this should too.)

    So now, any time you call latexmk with this function (by hitting C-0, for example), once the compilation is done, it checks for errors. If there were errors, it automatically opens the Help window and gets the first error. If there were none, it checks to see if the Help buffer is open; if so, it closes that window and kills the buffer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use emacs+AucTeX to write LaTeX files. At the bottom of the .tex file
Inside a function I use to initialise some TeX related settings I have the
I got the error Can't use function return value in write context when trying
Fatal error: Can't use function return value in write context in line 3, In
I am running on proxy and when i use function file_get_contents i get error
How do I use function arguments declared like void f(double) { /**/ } if
In VB.NET, which is better to use: function overloading or default parameters?
I use DATEDIFF function to filter records added this week only: DATEDIFF(week, DateCreated, GETDATE())
I use htmlspecialchars function in my string. But, I don't want to clean them;
I use a function that sends emails to some users. I use the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.