Hi Al,

Thanks, I tried testing it with a relatively recent Emacs master, with
Emacs -Q + AUCTeX, and the config:

  (setq preview-visibility-style 'always)
  (setq preview-at-point-placement 'before-string)
  Open tex file, M-x preview-automatic-mode

> Out of the box, enabling preview-automatic-mode would cause the previews
> to be auto-updated when modified.

I could not get existing previews to auto-update when modified.

For example, in a standard tex document containing

  Let $x$

I ran preview-buffer, so that the preview appears.  I change the above
to

  Let $x+y$

The previe preview invalidated, but did not regenerate automatically.

I fixed the "cateogry" typo in preview.el and the issue persisted.

> Setting `preview-automatic-function` to #'texmathp would further cause
> newly written math expressions to be previewed as well.

This also did not work reliably for me.

For example, after setting `preview-automatic-function` to #'texmathp
and typing

  Let $x$

at normal speed, no preview generated.

I also saw more severe failures.  When typing

  \[
  x+y

it tried to put a preview overlay over the rest of the buffer.

Just now, when I typed 

  $x

and paused, Emacs froze.  C-g and ESC did not help.  Sending USR2 to the
Emacs process gave the attached backtrace.

Thanks, best,

Paul

Debugger entered--returning value: t
  (setq quit-flag t)
  (condition-case nil
      (let ((inhibit-quit nil)) (accept-process-output cur-process))
    (quit (setq quit-flag t) (eval '(ignore nil) t)))
  (progn
    (if (and preview-current-region (not preview-abort-flag))
        (progn
          (progn
            (condition-case nil (progn (TeX-kill-job)) (error nil))
            (setq preview-abort-flag t))))
    (condition-case nil
        (let ((inhibit-quit nil)) (accept-process-output cur-process))
      (quit (setq quit-flag t) (eval '(ignore nil) t)))
    (preview-automatic-update buffer pt new-only))
  (if cur-process
      (progn
        (if (and preview-current-region (not preview-abort-flag))
            (progn
              (progn
                (condition-case nil (progn (TeX-kill-job)) (error nil))
                (setq preview-abort-flag t))))
        (condition-case nil
            (let ((inhibit-quit nil))
              (accept-process-output cur-process))
          (quit (setq quit-flag t) (eval '(ignore nil) t)))
        (preview-automatic-update buffer pt new-only))
    (let*
        ((region
          (and t
               (save-excursion
                 (goto-char pt) (let* (... ...) (if region ...))))))
      (if region
          (let
              ((TeX-suppress-compilation-message t) (save-silently t)
               (noninteractive t) (inhibit-message t) message-log-max)
            (let* ((process (preview-region ... ...)))
              (save-current-buffer
                (set-buffer (process-buffer process))
                (setq preview-silent-errors (prog1 t ...))))))))
  (let*
      ((cur-process
        (and t
             (or
              (get-buffer-process
               (TeX-process-buffer-name (TeX-region-file)))
              (get-buffer-process
               (TeX-process-buffer-name (TeX-master-file)))))))
    (if cur-process
        (progn
          (if (and preview-current-region (not preview-abort-flag))
              (progn
                (progn
                  (condition-case nil (progn ...) (error nil))
                  (setq preview-abort-flag t))))
          (condition-case nil
              (let ((inhibit-quit nil))
                (accept-process-output cur-process))
            (quit (setq quit-flag t) (eval '(ignore nil) t)))
          (preview-automatic-update buffer pt new-only))
      (let*
          ((region
            (and t (save-excursion (goto-char pt) (let* ... ...)))))
        (if region
            (let
                ((TeX-suppress-compilation-message t) (save-silently t)
                 (noninteractive t) (inhibit-message t) message-log-max)
              (let* ((process ...))
                (save-current-buffer
                  (set-buffer ...) (setq preview-silent-errors ...))))))))
  (save-current-buffer
    (set-buffer buffer)
    (let*
        ((cur-process
          (and t
               (or (get-buffer-process (TeX-process-buffer-name ...))
                   (get-buffer-process (TeX-process-buffer-name ...))))))
      (if cur-process
          (progn
            (if (and preview-current-region (not preview-abort-flag))
                (progn
                  (progn
                    (condition-case nil ... ...)
                    (setq preview-abort-flag t))))
            (condition-case nil
                (let ((inhibit-quit nil))
                  (accept-process-output cur-process))
              (quit (setq quit-flag t) (eval '... t)))
            (preview-automatic-update buffer pt new-only))
        (let* ((region (and t (save-excursion ... ...))))
          (if region
              (let
                  ((TeX-suppress-compilation-message t)
                   (save-silently t) (noninteractive t)
                   (inhibit-message t) message-log-max)
                (let* (...) (save-current-buffer ... ...))))))))
  (progn
    (save-current-buffer
      (set-buffer buffer)
      (let*
          ((cur-process
            (and t
                 (or (get-buffer-process ...) (get-buffer-process ...)))))
        (if cur-process
            (progn
              (if (and preview-current-region (not preview-abort-flag))
                  (progn (progn ... ...)))
              (condition-case nil
                  (let (...) (accept-process-output cur-process))
                (quit (setq quit-flag t) (eval ... t)))
              (preview-automatic-update buffer pt new-only))
          (let* ((region (and t ...)))
            (if region
                (let (... ... ... ... message-log-max) (let* ... ...))))))))
  (if (buffer-live-p buffer)
      (progn
        (save-current-buffer
          (set-buffer buffer)
          (let* ((cur-process (and t (or ... ...))))
            (if cur-process
                (progn
                  (if (and preview-current-region ...) (progn ...))
                  (condition-case nil (let ... ...) (quit ... ...))
                  (preview-automatic-update buffer pt new-only))
              (let* ((region ...)) (if region (let ... ...))))))))
  preview-automatic--update-1(#<buffer test.tex> 43 t)
  apply(preview-automatic--update-1 (#<buffer test.tex> 43 t))
  #f(compiled-function (buf) #<bytecode 0x150218cb59ca2452>)(#<buffer test.tex>)
  apply(#f(compiled-function (buf) #<bytecode 0x150218cb59ca2452>) #<buffer 
test.tex>)
  timer-event-handler([t 0 0 100000 nil #f(compiled-function (buf) #<bytecode 
0x150218cb59ca2452>) (#<buffer test.tex>) idle 0 nil])
_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to