auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Showing compilation progress indicator


From: Arash Esbati
Subject: Re: Showing compilation progress indicator
Date: Thu, 21 Jul 2022 10:18:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi Al,

Al Haji-Ali <abdo.haji.ali@gmail.com> writes:

> On 19/07/2022, Arash Esbati wrote:
>>
>> I hope you will figure out how to implement this :-)
> Just pushed a version that implements this. It was easier than I
> initially anticipated.

👍

>> I think this is would be a nice addition to AUCTeX, but keep in mind
>> that AUCTeX currently requires Emacs 25 and higher.  Your package says
>>
>>   ;; Package-Requires: ((emacs "28.0"))
>
> The requirement is for displaying svg images. In an AUCTeX
> implementation, older versions could use text or PNG images for
> example.

Ok, thanks for the clarification.

> This feature doesn't need to be included as is in AUCTeX. Instead,
> hooks on tex processes creation, filtering and sentinel would be
> sufficient to allow my and other packages to track the progress of
> these processes. I currently use the advice system which is a bit
> hacky IMO, for one thing it make it difficult to have a local mode.

Can you provide a patch to AUCTeX with the changes you need in order to
run your package standealone?

>> Question: Is it possible that the wrench disappears after successful
>> compilation, say after X seconds?  I had the impression that it is
>> currently "sticky" -- or should I just wait longer?
> Ah good idea. I implemented this in the new version. Any and all
> comments are welcome.

Thanks.  I currently have 2 minor suggestions:

 • Rename `tex-procress-mode' to something else in order to avoid
   collisions with Emacs tex-mode.

 • Apply this simple change (the '(:eval ... part is only indentation):

diff --git a/README.org b/README.org
index d6d45c3..101c6d8 100644
--- a/README.org
+++ b/README.org
@@ -26,7 +26,7 @@ enough to accommodate other processes.
     ;; :straight (:host github :repo "haji-ali/procress")
     :commands tex-procress-mode
     :init
-    (add-hook 'LaTeX-mode-hook 'tex-procress-mode)
+    (add-hook 'LaTeX-mode-hook #'tex-procress-mode)
     :config
     (procress-load-default-svg-images))
 #+end_src
diff --git a/procress.el b/procress.el
index d6590a8..18360e2 100644
--- a/procress.el
+++ b/procress.el
@@ -27,7 +27,7 @@
 ;;
 ;; (require 'procress)
 ;; (procress-load-default-svg-images)
-;; (add-hook 'LaTeX-mode-hook 'tex-procress-mode)
+;; (add-hook 'LaTeX-mode-hook #'tex-procress-mode)
 ;;
 ;; The function `procress-load-default-svg-images' can be called for SVG
 ;; images (an animations) to be used to indicate progress.
@@ -58,7 +58,7 @@ Typically, only first frame is used.")
   "mouse-1: Go to compilation output"
   "String to use for the help-string in the modeline.")

-(defvar-local procress-modeline-function 'idenity
+(defvar-local procress-modeline-function #'identity
   "Function to build modeline string.
 Takes the progress string as an argument and should return the
 final string.")
@@ -262,9 +262,9 @@ the center. "
           (setq mode-line-process
                 '(:eval (list
                          (with-current-buffer
-                           (find-file-noselect
-                            (TeX-master-file TeX-default-extension))
-                         (procress-modeline-string)))))
+                             (find-file-noselect
+                              (TeX-master-file TeX-default-extension))
+                           (procress-modeline-string)))))
           (setq procress-modeline-function
                 (lambda (x)
                   (concat x (with-current-buffer (TeX-active-buffer)
@@ -278,7 +278,7 @@ the center. "
       ;; (advice-remove 'TeX-command-sentinel 'procress--tex-done)
       (remove-hook 'procress-click-hook 'procress--tex-click)
       (setq mode-line-process nil)
-      (setq procress-modeline-function 'identity)))
+      (setq procress-modeline-function #'identity)))
   (force-mode-line-update))

 (defun procress--tex-start (&rest _)

Best, Arash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]