Skip to content
Nicholas Vollmer edited this page Jul 12, 2023 · 6 revisions

How to change a command's log query

See the elpaca-log-command-queries variable and the following examples. The variable should be set after elpaca-log has been loaded. You can ensure this by wrapping the forms in with-eval-after-load forms:

https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks-for-Loading.html

Filter by #latest search tag when the elpaca-rebuild command is run:

(setf (alist-get 'elpaca-rebuild elpaca-log-commmand-queries) "#latest"))

Don't display the log when the elpaca-delete command is run:

(setf (alist-get 'elpaca-delete elpaca-log-command-queries) 'silent))

Override silent commands:

(setf (alist-get '(eval-buffer eval-region eval-defun eval-last-sexp org-ctrl-c-ctrl-c)
                 elpaca-log-command-queries nil nil #'equal)
      "#unique | !finished")

How to disable logging

See the elpaca-log-functions user option.

Permanently (not recommended):

(setq elpaca-log-functions nil)

Temporarily:

(let ((elpaca-log-functions nil))
  ;; Do work
)

Auto-hiding the elpaca-log buffer

Define a variable to store the commands to auto-hide the log buffer for:

(defvar +elpaca-hide-log-commands '( eval-buffer eval-region eval-defun
                                     eval-last-sexp org-ctrl-c-ctrl-c)
  "List of commands for which a successfully processed log is auto hidden.")

Add a function which closes the log on success queue processing to elpaca-post-queue-hook:

(defun +elpaca-hide-successful-log ()
    "Hide Elpaca log buffer if queues processed successfully."
    (message "this: %S last: %S" this-command last-command)
    (if-let ((incomplete (cl-find 'incomplete elpaca--queues :key #'elpaca-q<-status))
             ((elpaca-q<-elpacas incomplete)))
        nil
      (when-let ((log (bound-and-true-p elpaca-log-buffer))
                 (window (get-buffer-window log t)) ;; log buffer visible
                 ((or (member last-command +elpaca-hide-log-commands)
                      (member this-command +elpaca-hide-log-commands))))
        (with-selected-window window (quit-window 'kill window)))))

(add-hook 'elpaca-post-queue-hook #'+elpaca-hide-successful-log)

Customizing the position of the elpaca-log buffer

display-buffer-alist can be used to customize the position of windows. For example, to display the log at the bottom of the frame:

(add-to-list 'display-buffer-alist '("\\*elpaca-log\\*" (display-buffer-reuse-window display-buffer-at-bottom)))

See the following resources for more info: