emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/helm a217591623 2/5: Incompatible changes: Change helm-log


From: ELPA Syncer
Subject: [nongnu] elpa/helm a217591623 2/5: Incompatible changes: Change helm-log signature.
Date: Tue, 20 Sep 2022 07:59:29 -0400 (EDT)

branch: elpa/helm
commit a21759162303fdbd3e5f9f8032b0c7612493dd37
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Incompatible changes: Change helm-log signature.
    
    Takes now a new arg FROM.
    Remove now unnneeded function detecting FROM.
---
 helm-core.el     | 207 ++++++++++++++++++++++++++++---------------------------
 helm-fd.el       |   6 +-
 helm-files.el    |   3 +
 helm-find.el     |   4 +-
 helm-grep.el     |  24 ++++---
 helm-id-utils.el |   2 +-
 helm-imenu.el    |   2 +-
 helm-locate.el   |   6 +-
 helm-ring.el     |   2 +-
 helm-semantic.el |   3 +-
 helm-tags.el     |   2 +-
 helm-utils.el    |   6 +-
 12 files changed, 140 insertions(+), 127 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index 8d0779500d..02bb00c715 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -1959,10 +1959,11 @@ The hook should takes one arg SOURCES.")
   "The value of `helm-pattern' is stored here exit or quit.")
 
 ;; Utility: logging
-(defun helm-log (format-string &rest args)
-  "Log message `helm-debug' is non-nil.
+(defun helm-log (from format-string &rest args)
+  "Log message if `helm-debug' is non-nil.
 Messages are written to the `helm-debug-buffer' buffer.
 
+FROM is the place from where it is called.
 Argument FORMAT-STRING is a string to use with `format'.
 Use optional arguments ARGS like in `format'."
   (when helm-debug
@@ -1977,39 +1978,23 @@ Use optional arguments ARGS like in `format'."
                                   "%s.%06d (%s)\n %s\n")
                           (format-time-string "%H:%M:%S" tm)
                           (nth 2 tm)
-                          (helm-log-get-current-function)
+                          from
                           (apply #'format (cons format-string args)))))))))
 
-(defun helm-log-run-hook (hook)
-  "Run HOOK like `run-hooks' but write these actions to Helm log buffer."
-  (helm-log "Executing %s with value = %S" hook (symbol-value hook))
-  (helm-log "Executing %s with global value = %S" hook (default-value hook))
+(defun helm-log-run-hook (from hook)
+  "Run HOOK like `run-hooks' and log these actions to Helm log buffer.
+FROM is the place from where it is called."
+  (helm-log from "Executing %s with value = %S" hook (symbol-value hook))
+  (helm-log from "Executing %s with global value = %S" hook (default-value 
hook))
   (run-hooks hook)
-  (helm-log "executed %s" hook))
-
-(defvar helm--log-exclude-functions '(helm-interpret-value
-                                      helm-log
-                                      helm-log-get-current-function
-                                      helm-log-error
-                                      helm-log-save-maybe
-                                      helm-log-run-hook
-                                      helm-apply-functions-from-source
-                                      helm-funcall-with-source 
helm-funcall-foreach
-                                      helm-compute-attr-in-sources))
-(defun helm-log-get-current-function ()
-  "Get name of function calling `helm-log'."
-  (cl-loop for btn from 1 to 40
-           for btf = (cl-second (backtrace-frame btn))
-           for fn  = (if (symbolp btf) (symbol-name btf) "")
-           if (and (string-match "\\`helm" fn)
-                   (not (memq btf helm--log-exclude-functions)))
-           return fn))
-
-(defun helm-log-error (&rest args)
+  (helm-log from "executed %s" hook))
+
+(defun helm-log-error (from &rest args)
   "Accumulate error messages into `helm-issued-errors'.
+FROM is the place from where it is called.
 ARGS are args given to `format'.
 E.g. (helm-log-error \"Error %s: %s\" (car err) (cdr err))."
-  (apply 'helm-log (concat "ERROR: " (car args)) (cdr args))
+  (apply 'helm-log from (concat "ERROR: " (car args)) (cdr args))
   (let ((msg (apply 'format args)))
     (unless (member msg helm-issued-errors)
       (cl-pushnew msg helm-issued-errors :test 'equal))))
@@ -2332,7 +2317,7 @@ existing Helm function names."
     (let ((cur-disp-sel (helm-get-selection nil t)))
       (set (make-local-variable 'helm-source-filter)
            (helm--normalize-filter-sources sources))
-      (helm-log "helm-source-filter = %S" helm-source-filter)
+      (helm-log "helm-set-source-filter" "helm-source-filter = %S" 
helm-source-filter)
       ;; Use force-update to run init/update functions.
       (helm-update (and (stringp cur-disp-sel)
                         (regexp-quote cur-disp-sel))))))
@@ -2350,7 +2335,7 @@ If NO-INIT is non-nil, skip executing init functions of 
SOURCES.
 If NO-UPDATE is non-nil, skip executing `helm-update'."
   (with-current-buffer helm-buffer
     (setq helm-sources (helm-get-sources sources))
-    (helm-log "helm-sources = %S" helm-sources))
+    (helm-log "helm-set-sources" "helm-sources = %S" helm-sources))
   (unless no-init (helm-compute-attr-in-sources 'init))
   (unless no-update (helm-update)))
 
@@ -2426,7 +2411,7 @@ when you want the `display-to-real' function(s) to be 
applied."
                                      (helm-apply-functions-from-source source 
it disp))
                                     (t disp))))
         (unless (equal selection "")
-          (helm-log "selection = %S" selection)
+          (helm-log "helm-get-selection" "selection = %S" selection)
           selection)))))
 
 (defun helm-get-actions-from-current-source (&optional source)
@@ -2479,8 +2464,8 @@ Use this on commands invoked from key bindings, but not 
on action
 functions invoked as action from the action menu, i.e. functions
 called with RET."
   (helm-kill-async-processes)
-  (helm-log "function = %S" function)
-  (helm-log "args = %S" args)
+  (helm-log "helm-run-after-exit" "function = %S" function)
+  (helm-log "helm-run-after-exit" "args = %S" args)
   (helm-exit-and-execute-action
    (lambda (_candidate)
      (apply function args))))
@@ -2498,7 +2483,7 @@ i.e. functions called with RET."
   ;; source that inherit actions from type, note that ACTION have to
   ;; be bound to a symbol and not to be an anonymous action
   ;; i.e. lambda or byte-code.
-  (helm-log "Start executing action")
+  (helm-log "helm-exit-and-execute-action" "Start executing action")
   (let ((actions (helm-get-actions-from-current-source)))
     (when actions
       (cl-assert (or (eq action actions)
@@ -2970,13 +2955,13 @@ HISTORY args see `helm'."
     ;; Ensure linum-mode is disabled in Helm buffers to preserve
     ;; performances (Bug#1894).
     (advice-add 'linum-on :override #'helm--advice-linum-on '((depth . 100))))
-  (helm-log (concat "[Start session] " (make-string 41 ?+)))
-  (helm-log "prompt = %S" prompt)
-  (helm-log "preselect = %S" preselect)
-  (helm-log "buffer = %S" buffer)
-  (helm-log "keymap = %S" keymap)
-  (helm-log "default = %S" default)
-  (helm-log "history = %S" history)
+  (helm-log "helm-internal" (concat "[Start session] " (make-string 41 ?+)))
+  (helm-log "helm-internal" "prompt = %S" prompt)
+  (helm-log "helm-internal" "preselect = %S" preselect)
+  (helm-log "helm-internal" "buffer = %S" buffer)
+  (helm-log "helm-internal" "keymap = %S" keymap)
+  (helm-log "helm-internal" "default = %S" default)
+  (helm-log "helm-internal" "history = %S" history)
   (setq helm--prompt (or prompt "pattern: "))
   (let ((non-essential t)
         ;; Prevent mouse jumping to the upper-right
@@ -3042,7 +3027,7 @@ HISTORY args see `helm'."
               ;; until a key is hitted (Bug#1670).
               (add-hook 'helm-after-update-hook 'helm--maybe-update-keymap)
               (add-hook 'post-command-hook 'helm--update-header-line)
-              (helm-log "show prompt")
+              (helm-log "helm-internal" "show prompt")
               (unwind-protect
                   (helm-read-from-minibuffer
                    prompt input preselect
@@ -3050,18 +3035,18 @@ HISTORY args see `helm'."
                 (helm-cleanup))
               (prog1
                   (unless helm--quit (helm-execute-selection-action))
-                (helm-log (concat "[End session] " (make-string 41 ?-)))))
+                (helm-log "helm-internal" (concat "[End session] " 
(make-string 41 ?-)))))
           (quit
            (helm-restore-position-on-quit)
-           (helm-log-run-hook 'helm-quit-hook)
-           (helm-log (concat "[End session (quit)] " (make-string 34 ?-)))
+           (helm-log-run-hook "helm-internal" 'helm-quit-hook)
+           (helm-log "helm-internal" (concat "[End session (quit)] " 
(make-string 34 ?-)))
            nil))
       (when (fboundp 'advice-remove)
         (advice-remove 'tramp-read-passwd #'helm--suspend-read-passwd)
         (advice-remove 'ange-ftp-get-passwd #'helm--suspend-read-passwd)
         (advice-remove 'epa-passphrase-callback-function 
#'helm--suspend-read-passwd)
         (advice-remove 'linum-on #'helm--advice-linum-on))
-      (helm-log "helm-alive-p = %S" (setq helm-alive-p nil))
+      (helm-log "helm-internal" "helm-alive-p = %S" (setq helm-alive-p nil))
       (helm--remap-mouse-mode -1)       ; Reenable mouse bindings.
       (setq helm-alive-p nil)
       (and ori--minibuffer-follows-selected-frame
@@ -3303,14 +3288,14 @@ Don't use this directly, use instead `helm' with the 
keyword
 Argument SAVE-OR-RESTORE is either save or restore."
   (cl-case save-or-restore
     (save
-     (helm-log "Save position at %S" (cons (point) (window-start)))
+     (helm-log "helm-current-position" "Save position at %S" (cons (point) 
(window-start)))
      (setq helm-current-position (cons (point) (window-start))))
     (restore
      ;; Maybe `helm-current-buffer' have been deleted
      ;; during helm session so check if it is here
      ;; otherwise position in underlying buffer will be lost.
      (when (get-buffer-window helm-current-buffer 'visible)
-       (helm-log "Restore position at  %S in buffer %s"
+       (helm-log "helm-current-position" "Restore position at  %S in buffer %s"
                  helm-current-position
                  (buffer-name (current-buffer)))
        (goto-char (car helm-current-position))
@@ -3324,7 +3309,7 @@ Argument SAVE-OR-RESTORE is either save or restore."
   "Save or restore last frame or window configuration.
 Argument SAVE-OR-RESTORE is either save or restore of window or
 frame configuration as per `helm-save-configuration-functions'."
-  (helm-log "helm-save-configuration-functions = %S"
+  (helm-log "helm-frame-or-window-configuration" 
"helm-save-configuration-functions = %S"
             helm-save-configuration-functions)
   (let ((window-persistent-parameters (append '((no-other-window . t))
                                               window-persistent-parameters)))
@@ -3522,7 +3507,7 @@ value of `helm-full-frame' or 
`helm-split-window-default-side'."
                 . ,(append helm-default-display-buffer-alist
                            `((window-height . 
,helm-display-buffer-default-height)
                              (window-width  . 
,helm-display-buffer-default-width)))))
-      (helm-log-run-hook 'helm-window-configuration-hook))))
+      (helm-log-run-hook "helm-default-display-buffer" 
'helm-window-configuration-hook))))
 
 ;; Shut up byte-compiler in emacs-26
 (defvar tab-bar-mode)
@@ -3617,7 +3602,7 @@ version < emacs-28."
         (set-frame-size helm-popup-frame
                         helm-display-buffer-width
                         helm-display-buffer-height)))
-    (helm-log-run-hook 'helm-window-configuration-hook)))
+    (helm-log-run-hook "helm-display-buffer-in-own-frame" 
'helm-window-configuration-hook)))
 
 (defun helm-display-buffer-popup-frame (buffer frame-alist)
   (if helm-display-buffer-reuse-frame
@@ -3666,7 +3651,7 @@ Return the resulting list."
 (defun helm-initialize (resume input default sources)
   "Start initialization of Helm session.
 For RESUME INPUT DEFAULT and SOURCES see `helm'."
-  (helm-log "start initialization: resume=%S input=%S"
+  (helm-log "helm-initialize" "start initialization: resume=%S input=%S"
             resume input)
   (helm-frame-or-window-configuration 'save)
   (let ((sources-list (helm-get-sources sources)))
@@ -3677,7 +3662,7 @@ For RESUME INPUT DEFAULT and SOURCES see `helm'."
                    when (or (memq 'helm-fuzzy-match matchfns)
                             (memq 'helm-fuzzy-search searchfns))
                    return t))
-    (helm-log "sources-list = %S" sources-list)
+    (helm-log "helm-initialize" "sources-list = %S" sources-list)
     (helm-set-local-variable 'helm-sources sources-list)
     ;; Once `helm-buffer' is created `helm-sources' will be a local
     ;; variable which value is a list of alists.
@@ -3693,11 +3678,11 @@ For RESUME INPUT DEFAULT and SOURCES see `helm'."
     ;; will run its function.
     (when (helm-resume-p resume)
       (helm-compute-attr-in-sources 'resume))
-    (helm-log "end initialization")))
+    (helm-log "helm-initialize" "end initialization")))
 
 (defun helm-initialize-overlays (buffer)
   "Initialize Helm overlays in BUFFER."
-  (helm-log "overlay setup")
+  (helm-log "helm-initialize-overlays" "overlay setup")
   (if helm-selection-overlay
       ;; make sure the overlay belongs to the helm buffer if
       ;; it's newly created
@@ -3712,7 +3697,7 @@ For RESUME INPUT DEFAULT and SOURCES see `helm'."
 (defun helm-initial-setup (input default sources)
   "Initialize Helm settings and set up the Helm buffer."
   ;; Run global hook.
-  (helm-log-run-hook 'helm-before-initialize-hook)
+  (helm-log-run-hook "helm-initial-setup" 'helm-before-initialize-hook)
   ;; Run local source hook.
   (helm--run-init-hooks 'before-init-hook sources)
   ;; For initialization of helm locals vars that need
@@ -3775,7 +3760,7 @@ For RESUME INPUT DEFAULT and SOURCES see `helm'."
   (helm-create-helm-buffer)
   (helm-clear-visible-mark)
   ;; Run global hook.
-  (helm-log-run-hook 'helm-after-initialize-hook)
+  (helm-log-run-hook "helm-initial-setup" 'helm-after-initialize-hook)
   ;; Run local source hook.
   (helm--run-init-hooks 'after-init-hook sources))
 
@@ -3791,7 +3776,7 @@ See :after-init-hook and :before-init-hook in 
`helm-source'."
                  (funcall hv))
                 ((and hook (pred (listp)))
                  (dolist (h hook) (funcall h)))
-                (_ (helm-log-run-hook hv)))))
+                (_ (helm-log-run-hook "helm--run-init-hooks" hv)))))
 
 (defun helm-restore-position-on-quit ()
   "Restore position in `helm-current-buffer' when quitting."
@@ -3832,8 +3817,8 @@ Unuseful when used outside Helm, don't use it.")
   (let ((root-dir default-directory)
         (inhibit-read-only t))
     (with-current-buffer (get-buffer-create helm-buffer)
-      (helm-log "Enabling major-mode %S" major-mode)
-      (helm-log "kill local variables: %S" (buffer-local-variables))
+      (helm-log "helm-create-helm-buffer" "Enabling major-mode %S" major-mode)
+      (helm-log "helm-create-helm-buffer" "kill local variables: %S" 
(buffer-local-variables))
       (kill-all-local-variables)
       (helm-major-mode)
       (set (make-local-variable 'buffer-read-only) nil)
@@ -3854,8 +3839,8 @@ Unuseful when used outside Helm, don't use it.")
       (set (make-local-variable 'helm-marked-candidates) nil)
       (set (make-local-variable 'helm--prompt) helm--prompt)
       (helm-initialize-persistent-action)
-      (helm-log "helm-display-function = %S" helm-display-function)
-      (helm-log "helm--local-variables = %S" helm--local-variables)
+      (helm-log "helm-create-helm-buffer" "helm-display-function = %S" 
helm-display-function)
+      (helm-log "helm-create-helm-buffer" "helm--local-variables = %S" 
helm--local-variables)
       (helm--set-local-variables-internal)
       (setq truncate-lines helm-truncate-lines) ; already local.
       (setq left-margin-width helm-left-margin-width)
@@ -3912,11 +3897,12 @@ For PRESELECT RESUME KEYMAP DEFAULT HISTORY, see 
`helm'."
            ;; prevent this and allow `C-g' (the helm one aka
            ;; `helm-keyboard-quit') to quit immediately.
            (inhibit-quit source-process-p))
-      (helm-log "helm-get-candidate-number => %S"
+      (helm-log "helm-read-from-minibuffer" "helm-get-candidate-number => %S"
                 (helm-get-candidate-number))
-      (helm-log "helm-execute-action-at-once-if-one = %S"
+      (helm-log "helm-read-from-minibuffer" 
"helm-execute-action-at-once-if-one = %S"
                 helm-execute-action-at-once-if-one)
-      (helm-log "helm-quit-if-no-candidate = %S" helm-quit-if-no-candidate)
+      (helm-log "helm-read-from-minibuffer"
+                "helm-quit-if-no-candidate = %S" helm-quit-if-no-candidate)
       (when (and src (helm-resume-p resume))
         (helm-display-mode-line src)
         (setq helm-pattern input))
@@ -3975,7 +3961,8 @@ For PRESELECT RESUME KEYMAP DEFAULT HISTORY, see `helm'."
                          ;; - Or fallback to the global value of helm-map.
                          (helm--maybe-update-keymap
                           (or src-keymap keymap helm-map))
-                         (helm-log-run-hook 'helm-minibuffer-set-up-hook)
+                         (helm-log-run-hook "helm-read-from-minibuffer"
+                                            'helm-minibuffer-set-up-hook)
                          (setq timer
                                (run-with-idle-timer
                                 (max (with-helm-buffer helm-input-idle-delay)
@@ -4108,7 +4095,7 @@ WARNING: Do not use this mode yourself, it is internal to 
Helm."
 
 (defun helm-cleanup ()
   "Clean up the mess when Helm exit or quit."
-  (helm-log "start cleanup")
+  (helm-log "helm-cleanup" "start cleanup")
   (with-selected-window
       ;; When exiting with `helm-execute-action-at-once-if-one',
       ;; `helm-window' may not be created and we endup with an error
@@ -4156,7 +4143,7 @@ WARNING: Do not use this mode yourself, it is internal to 
Helm."
   ;; which have a minibuffer, so be sure to disable
   ;; the `no-other-window' prop there.
   (helm-prevent-switching-other-window :enabled nil)
-  (helm-log-run-hook 'helm-cleanup-hook)
+  (helm-log-run-hook "helm-cleanup" 'helm-cleanup-hook)
   (helm-frame-or-window-configuration 'restore)
   ;; [1] now bury-buffer from underlying windows otherwise,
   ;; if this window is killed the underlying buffer will
@@ -4199,9 +4186,9 @@ WARNING: Do not use this mode yourself, it is internal to 
Helm."
     (setq helm-pattern input)
     (unless (helm-action-window)
       (setq helm-input helm-pattern))
-    (helm-log "helm-pattern = %S" helm-pattern)
-    (helm-log "helm-input = %S" helm-input)
-    (helm-log-run-hook 'helm-before-update-hook)
+    (helm-log "helm-check-new-input" "helm-pattern = %S" helm-pattern)
+    (helm-log "helm-check-new-input" "helm-input = %S" helm-input)
+    (helm-log-run-hook "helm-check-new-input" 'helm-before-update-hook)
     (setq helm--in-update t)
     (helm-update)))
 
@@ -4239,7 +4226,9 @@ WARNING: Do not use this mode yourself, it is internal to 
Helm."
                              ;; and not `helm-apply-functions-from-source'.
                              (helm-interpret-value candidate-proc)
                            (helm-interpret-value candidate-fn source))
-                       (error (helm-log "Error: %S" (setq cfn-error err)) 
nil))))
+                       (error (helm-log "helm-get-candidates"
+                                        "Error: %S" (setq cfn-error err))
+                              nil))))
     (cond ((and (processp candidates) (not candidate-proc))
            (warn "Candidates function `%s' should be called in a 
`candidates-process' attribute"
                  candidate-fn))
@@ -4280,8 +4269,10 @@ Cache the candidates if there is no cached value yet."
          ;; handles quit-flag?
          (inhibit-quit (assoc-default 'candidates-process source)))
     (helm-aif candidate-cache
-        (prog1 it (helm-log "Use cached candidates"))
-      (helm-log "No cached candidates, calculate candidates")
+        (prog1 it (helm-log "helm-get-cached-candidates"
+                            "Use cached candidates"))
+      (helm-log "helm-get-cached-candidates"
+                "No cached candidates, calculate candidates")
       (let ((candidates (helm-get-candidates source)))
         (cond ((processp candidates)
                (push (cons candidates
@@ -4832,7 +4823,8 @@ emacs-27 to provide such scoring in emacs<27."
                                 (propertize c 'match-part part))
                             c)))
       (error (unless (eq (car err) 'invalid-regexp) ; Always ignore regexps 
errors.
-               (helm-log-error "helm-match-from-candidates in source `%s': %s 
%s"
+               (helm-log-error "helm-match-from-candidates"
+                               "helm-match-from-candidates in source `%s': %s 
%s"
                                (assoc-default 'name source) (car err) (cdr 
err)))
              nil))))
 
@@ -4880,7 +4872,7 @@ emacs-27 to provide such scoring in emacs<27."
 
 (defun helm-render-source (source matches)
   "Display MATCHES from SOURCE according to its settings."
-  (helm-log "Source = %S" (remove (assq 'keymap source) source))
+  (helm-log "helm-render-source" "Source = %S" (remove (assq 'keymap source) 
source))
   (when matches
     (helm-insert-header-from-source source)
     (cl-loop with separate = nil
@@ -4924,7 +4916,8 @@ Unlike `while-no-input' this macro ensure to not returns 
`t'."
               (not (file-remote-p helm-pattern nil t)))
          ;; Tramp will ask for passwd, don't use `helm-while-no-input'.
          ,@body
-       (helm-log "Using here `helm-while-no-input'")
+       (helm-log "helm--maybe-use-while-no-input"
+                 "Using here `helm-while-no-input'")
        ;; Emacs bug <https://debbugs.gnu.org/47205>, unexpected
        ;; dbus-event is triggered on dbus init.
        ;; Ignoring the dbus-event work on emacs28+; for emacs27 or older
@@ -4988,7 +4981,7 @@ When SOURCE is provided update mode-line for this source, 
otherwise
 the current source will be used.
 Argument CANDIDATES when provided is used to redisplay these candidates
 without recomputing them, it should be a list of lists."
-  (helm-log "Start updating")
+  (helm-log "helm-update" "Start updating")
   (helm-kill-async-processes)
   ;; When persistent action have been called
   ;; we have two windows even with `helm-full-frame'.
@@ -5020,7 +5013,7 @@ without recomputing them, it should be a list of lists."
           ;; Compute matches without rendering the sources.
           ;; This prevent the helm-buffer flickering when constantly
           ;; updating.
-          (helm-log "Matches: %S"
+          (helm-log "helm-update" "Matches: %S"
                     (setq matches (or candidates (helm--collect-matches 
sources))))
           ;; If computing matches finished and is not interrupted
           ;; erase the helm-buffer and render results (Fix #1157).
@@ -5040,15 +5033,15 @@ without recomputing them, it should be a list of lists."
       (let ((src (or source (helm-get-current-source))))
         (unless (assq 'candidates-process src)
           (helm-display-mode-line src 'force)
-          (helm-log-run-hook 'helm-after-update-hook)))
+          (helm-log-run-hook "helm-update" 'helm-after-update-hook)))
       (when preselect
-        (helm-log "Update preselect candidate %s" preselect)
+        (helm-log "helm-update" "Update preselect candidate %s" preselect)
         (if (helm-window)
             (with-helm-window (helm-preselect preselect source))
           (helm-preselect preselect source)))
       (setq helm--force-updating-p nil)
       (helm--reset-update-flag))
-    (helm-log "end update")))
+    (helm-log "helm-update" "end update")))
 
 (defun helm-update-source-p (source)
   "Whether SOURCE needs updating or not."
@@ -5355,7 +5348,7 @@ This will work only in Emacs-26+, i.e. Emacs versions 
that have
     (helm-output-filter-1 (assoc process helm-async-processes) output-string)))
 
 (defun helm-output-filter-1 (process-assoc output-string)
-  (helm-log "output-string = %S" output-string)
+  (helm-log "helm-output-filter-1" "output-string = %S" output-string)
   (with-current-buffer helm-buffer
     (let ((source (cdr process-assoc)))
       (save-excursion
@@ -5392,7 +5385,8 @@ This will work only in Emacs-26+, i.e. Emacs versions 
that have
     (cl-incf (cdr (assq 'item-count source)))
     (when (>= (assoc-default 'item-count source) limit)
       (helm-kill-async-process process)
-      (helm-log-run-hook 'helm-async-outer-limit-hook)
+      (helm-log-run-hook "helm-output-filter--process-source"
+                         'helm-async-outer-limit-hook)
       (cl-return))))
 
 (defun helm-output-filter--collect-candidates (lines incomplete-line-info)
@@ -5403,7 +5397,8 @@ This will work only in Emacs-26+, i.e. Emacs versions 
that have
   ;; incomplete line of the next arriving chunk. INCOMPLETE-LINE-INFO
   ;; is an attribute of source; it is created with an empty string
   ;; when the source is computed => (incomplete-line . "")
-  (helm-log "incomplete-line-info = %S" (cdr incomplete-line-info))
+  (helm-log "helm-output-filter--collect-candidates"
+            "incomplete-line-info = %S" (cdr incomplete-line-info))
   (butlast
    (cl-loop for line in lines
             ;; On start `incomplete-line-info' value is empty string.
@@ -5429,7 +5424,8 @@ This will work only in Emacs-26+, i.e. Emacs versions 
that have
         ;; FIXME Don't hardcode follow delay.
         (helm-follow-execute-persistent-action-maybe 0.5)
         (helm-display-mode-line (helm-get-current-source))
-        (helm-log-run-hook 'helm-after-update-hook)
+        (helm-log-run-hook "helm-output-filter--post-process"
+                           'helm-after-update-hook)
         (helm--reset-update-flag))))
 
 (defun helm-process-deferred-sentinel-hook (process event file)
@@ -5477,13 +5473,15 @@ function."
 ;;
 (defun helm-execute-selection-action ()
   "Execute current action."
-  (helm-log-run-hook 'helm-before-action-hook)
+  (helm-log-run-hook "helm-execute-selection-action"
+                     'helm-before-action-hook)
   ;; Position can be change when `helm-current-buffer'
   ;; is split, so jump to this position before executing action.
   (helm-current-position 'restore)
   (unwind-protect
       (prog1 (helm-execute-selection-action-1)
-        (helm-log-run-hook 'helm-after-action-hook))
+        (helm-log-run-hook "helm-execute-selection-action"
+                           'helm-after-action-hook))
     (setq helm--executing-helm-action nil)))
 
 (defun helm-execute-selection-action-1 (&optional
@@ -5491,7 +5489,7 @@ function."
                                         preserve-saved-action)
   "Execute ACTION on current SELECTION.
 If PRESERVE-SAVED-ACTION is non-nil, then save the action."
-  (helm-log "executing action")
+  (helm-log "helm-execute-selection-action-1" "executing action")
   (setq action (helm-get-default-action
                 (or action
                     helm-saved-action
@@ -5538,7 +5536,7 @@ If action buffer is selected, back to the Helm buffer."
   (interactive)
   (with-helm-alive-p
     (let ((src (helm-get-current-source)))
-      (helm-log-run-hook 'helm-select-action-hook)
+      (helm-log-run-hook "helm-select-action" 'helm-select-action-hook)
       (setq helm-saved-selection (helm-get-selection nil nil src))
       (with-selected-frame (with-helm-window (selected-frame))
         (prog1
@@ -5890,7 +5888,8 @@ Key arg DIRECTION can be one of:
       (with-helm-window
         (when helm-allow-mouse
           (helm--mouse-reset-selection-help-echo))
-        (helm-log-run-hook 'helm-move-selection-before-hook)
+        (helm-log-run-hook "helm-move-selection-common"
+                           'helm-move-selection-before-hook)
         (funcall move-func)
         (and (memq direction '(next previous))
              (helm-skip-noncandidate-line direction))
@@ -5901,7 +5900,8 @@ Key arg DIRECTION can be one of:
         (when follow
           (helm-follow-execute-persistent-action-maybe))
         (helm-display-mode-line (setq source (helm-get-current-source)))
-        (helm-log-run-hook 'helm-move-selection-after-hook)
+        (helm-log-run-hook "helm-move-selection-common"
+                           'helm-move-selection-after-hook)
         (helm--set-minibuffer-completion-confirm source)))))
 
 (defun helm-move--beginning-of-multiline-candidate ()
@@ -6011,7 +6011,7 @@ Key arg DIRECTION can be one of:
       (condition-case err
           (while (not (string= name (helm-current-line-contents)))
             (goto-char (helm-get-next-header-pos)))
-        (error (helm-log "%S" err))))))
+        (error (helm-log "helm-move--goto-source-fn" "%S" err))))))
 
 (defun helm-candidate-number-at-point ()
   (if helm-alive-p
@@ -6287,7 +6287,8 @@ message \\='no match'."
   (unless helm-current-prefix-arg
     (setq helm-current-prefix-arg current-prefix-arg))
   (setq helm-exit-status 0)
-  (helm-log-run-hook 'helm-exit-minibuffer-hook)
+  (helm-log-run-hook "helm-exit-minibuffer"
+                     'helm-exit-minibuffer-hook)
   (exit-minibuffer))
 
 (defun helm-keyboard-quit ()
@@ -6417,7 +6418,7 @@ Optional argument SOURCE is a Helm source object."
       (helm--mouse-reset-selection-help-echo))
     (helm-mark-current-line)
     (helm-display-mode-line (or source (helm-get-current-source)))
-    (helm-log-run-hook 'helm-after-preselection-hook)))
+    (helm-log-run-hook "helm-preselect" 'helm-after-preselection-hook)))
 
 (defun helm-delete-current-selection ()
   "Delete the currently selected item."
@@ -7095,7 +7096,7 @@ splitting inconditionally, it is unused actually."
       (unless attr
         (setq attr (or (car (assq 'persistent-action source))
                        (car (assq 'persistent-action-if source)))))
-      (helm-log "executing persistent-action")
+      (helm-log "helm-execute-persistent-action" "executing persistent-action")
       (let* ((selection (and source (helm-get-selection nil nil source)))
              (attr-val (if (eq attr 'persistent-action-if)
                            (funcall (assoc-default attr source) selection)
@@ -7124,7 +7125,8 @@ splitting inconditionally, it is unused actually."
                     (helm-select-persistent-action-window :split 'never)
                   (helm-select-persistent-action-window
                    :split (or split helm-onewindow-p)))
-                (helm-log "current-buffer = %S" (current-buffer))
+                (helm-log "helm-execute-persistent-action"
+                          "current-buffer = %S" (current-buffer))
                 (let ((helm-in-persistent-action t)
                       (display-buffer-alist '((".*" 
(display-buffer-same-window))))
                       display-buffer-function pop-up-windows pop-up-frames
@@ -7132,7 +7134,8 @@ splitting inconditionally, it is unused actually."
                   (helm-execute-selection-action-1
                    selection (or fn (helm-get-actions-from-current-source 
source)) t)
                   (unless (helm-action-window)
-                    (helm-log-run-hook 'helm-after-persistent-action-hook)))
+                    (helm-log-run-hook "helm-execute-persistent-action"
+                                       'helm-after-persistent-action-hook)))
                 ;; A typical case is when a persistent action delete
                 ;; the buffer already displayed in
                 ;; `helm-persistent-action-display-window' and 
`helm-full-frame'
@@ -7172,7 +7175,8 @@ See `helm-persistent-action-display-window' for how to 
use SPLIT."
       (select-window
        (setq minibuffer-scroll-window
              (helm-persistent-action-display-window :split split)))
-    (helm-log "Selected window is %S" minibuffer-scroll-window)))
+    (helm-log "helm-select-persistent-action-window"
+              "Selected window is %S" minibuffer-scroll-window)))
 
 ;;; Scrolling - recentering
 ;;
@@ -7480,7 +7484,8 @@ sources."
               (helm--compute-marked
                sel current-src
                (and with-wildcard (null (file-exists-p sel))))))
-      (helm-log "Marked candidates = %S" candidates)
+      (helm-log "helm-marked-candidates"
+                "Marked candidates = %S" candidates)
       candidates)))
 
 (defun helm--remove-marked-and-update-mode-line (elm)
diff --git a/helm-fd.el b/helm-fd.el
index 69d1116ad7..8b10d12fb3 100644
--- a/helm-fd.el
+++ b/helm-fd.el
@@ -84,8 +84,8 @@
          (fd-version (replace-regexp-in-string
                       "\n" ""
                       (shell-command-to-string (concat helm-fd-executable " 
--version")))))
-    (helm-log "Fd command:\nfd %s" (mapconcat 'identity cmd " "))
-    (helm-log "VERSION: %s" fd-version)
+    (helm-log "helm-fd-process" "Fd command:\nfd %s" (mapconcat 'identity cmd 
" "))
+    (helm-log "helm-fd-process" "VERSION: %s" fd-version)
     (prog1
         proc
       (set-process-sentinel
@@ -103,7 +103,7 @@
                                      (helm-get-candidate-number))
                                     'face 'helm-fd-finish))))
                     (force-mode-line-update))
-                (helm-log "Error: Fd %s"
+                (helm-log "helm-fd-process sentinel" "Error: Fd %s"
                           (replace-regexp-in-string "\n" "" event))))))))
 
 (defun helm-fd-fct (candidates _source)
diff --git a/helm-files.el b/helm-files.el
index 524a472398..e1d591c67a 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -3232,6 +3232,7 @@ debugging purpose."
               (or (>= (length (helm-basename path)) 3) dir-p)))
       ;; At this point the tramp connection is triggered.
       (helm-log
+       "helm-find-files-get-candidates"
        "Pattern=%S"
        (setq helm-pattern (if (string-match helm-ff-tramp-method-regexp path)
                               ;; A tramp method, don't modify pattern.
@@ -3526,6 +3527,8 @@ in cache."
   (lambda (event)
     (let ((desc (cadr event))
           (target directory)) ; Either truename or directory.
+      (when helm-debug
+        (helm-log "Inotify callback" "Event %S called on %S" event directory))
       ;; `attribute-changed' means permissions have changed, not
       ;; file modifications like file changes, visit
       ;; etc... AFAIU the desc for this is `changed' and for our
diff --git a/helm-find.el b/helm-find.el
index 7626639be1..eeec424baf 100644
--- a/helm-find.el
+++ b/helm-find.el
@@ -116,7 +116,7 @@ separator."
          (cmd (concat (helm-find--build-cmd-line)
                       (if helm-find-noerrors "2> /dev/null" "")))
          (proc (start-file-process-shell-command "hfind" helm-buffer cmd)))
-    (helm-log "Find command:\n%s" cmd)
+    (helm-log "helm-find-shell-command-fn" "Find command:\n%s" cmd)
     (prog1 proc
       (set-process-sentinel
        proc
@@ -125,7 +125,7 @@ separator."
             process event (helm-default-directory))
            (if (string= event "finished\n")
                (helm-locate-update-mode-line "Find")
-             (helm-log "Error: Find %s"
+             (helm-log "helm-find-shell-command-fn sentinel" "Error: Find %s"
                        (replace-regexp-in-string "\n" "" event))))))))
 
 (defun helm-find-1 (dir)
diff --git a/helm-grep.el b/helm-grep.el
index 91e5055ebd..71b6bb5aaf 100644
--- a/helm-grep.el
+++ b/helm-grep.el
@@ -625,8 +625,8 @@ Have no effect when grep backend use \"--color=\"."
                              (helm-grep-command)))))
          non-essential)
     ;; Start grep process.
-    (helm-log "Starting Grep process in directory `%s'" default-directory)
-    (helm-log "Command line used was:\n\n%s"
+    (helm-log "helm-grep-init" "Starting Grep process in directory `%s'" 
default-directory)
+    (helm-log "helm-grep-init" "Command line used was:\n\n%s"
               (concat ">>> " (propertize cmd-line 'face 'helm-grep-cmd-line) 
"\n\n"))
     (prog1            ; This function should return the process first.
         (start-file-process-shell-command
@@ -664,7 +664,7 @@ Have no effect when grep backend use \"--color=\"."
                              ;; that exit with code 1
                              ;; after a certain amount of results.
                              (with-helm-buffer (not (helm-empty-buffer-p)))))
-                    (helm-log "%s process finished with %s results in %fs"
+                    (helm-log "helm-grep-init" "%s process finished with %s 
results in %fs"
                               proc-name
                               (helm-get-candidate-number)
                               (- (float-time) start-time))
@@ -685,6 +685,7 @@ Have no effect when grep backend use \"--color=\"."
                         (helm--bind-mouse-for-selection 
helm-selection-point))))
                    ;; Catch error output in log.
                    (t (helm-log
+                       "helm-grep-init"
                        "Error: %s %s"
                        proc-name
                        (replace-regexp-in-string "\n" "" event))))))))))
@@ -719,7 +720,7 @@ WHERE can be `other-window' or `other-frame'."
          (fname        (if tramp-fname
                            (concat tramp-fname loc-fname)
                          loc-fname)))
-    (helm-log "helm-grep-action fname: %s" fname )
+    (helm-log "helm-grep-action" "helm-grep-action fname: %s" fname )
     (cl-case where
       (other-window (helm-window-show-buffers
                      (list (find-file-noselect fname)) t))
@@ -812,7 +813,7 @@ If N is positive go forward otherwise go backward."
            (funcall mark-maybe)))
     (unless allow-mode
       (helm-follow-execute-persistent-action-maybe)
-      (helm-log-run-hook 'helm-move-selection-after-hook))))
+      (helm-log-run-hook "helm-goto-next-or-prec-file" 
'helm-move-selection-after-hook))))
 
 ;;;###autoload
 (defun helm-goto-precedent-file ()
@@ -1519,8 +1520,8 @@ non-file buffers."
                            fnargs))
          process-connection-type)
     ;; Start pdf grep process.
-    (helm-log "Starting Pdf Grep process in directory `%s'" default-directory)
-    (helm-log "Command line used was:\n\n%s"
+    (helm-log "helm-pdfgrep-init" "Starting Pdf Grep process in directory 
`%s'" default-directory)
+    (helm-log "helm-pdfgrep-init" "Command line used was:\n\n%s"
               (concat ">>> " (propertize cmd-line 'face 'helm-grep-cmd-line) 
"\n\n"))
     (prog1
         (start-file-process-shell-command
@@ -1542,7 +1543,7 @@ non-file buffers."
                  (force-mode-line-update)
                  (when helm-allow-mouse
                    (helm--bind-mouse-for-selection helm-selection-point)))
-             (helm-log "Error: Pdf grep %s"
+             (helm-log "helm-pdfgrep-init" "Error: Pdf grep %s"
                        (replace-regexp-in-string "\n" "" event))))))))
 
 (defun helm-do-pdfgrep-1 (only &optional recurse)
@@ -1652,9 +1653,9 @@ returns if available with current AG version."
         (start-time (float-time))
         (proc-name (helm-grep--ag-command)))
     (set (make-local-variable 'helm-grep-last-cmd-line) cmd-line)
-    (helm-log "Starting %s process in directory `%s'"
+    (helm-log "helm-grep-ag-init" "Starting %s process in directory `%s'"
               proc-name directory)
-    (helm-log "Command line used was:\n\n%s"
+    (helm-log "helm-grep-ag-init" "Command line used was:\n\n%s"
               (concat ">>> " cmd-line "\n\n"))
     (prog1
         (start-file-process-shell-command
@@ -1679,7 +1680,7 @@ returns if available with current AG version."
                                      ,(upcase proc-name))
                                     'face 'helm-grep-finish))))))
                  ((string= event "finished\n")
-                  (helm-log "%s process finished with %s results in %fs"
+                  (helm-log "helm-grep-ag-init" "%s process finished with %s 
results in %fs"
                               proc-name
                               (helm-get-candidate-number)
                               (- (float-time) start-time))
@@ -1699,6 +1700,7 @@ returns if available with current AG version."
                     (when helm-allow-mouse
                       (helm--bind-mouse-for-selection helm-selection-point))))
                  (t (helm-log
+                     "helm-grep-ag-init"
                      "Error: %s %s"
                      proc-name
                      (replace-regexp-in-string "\n" "" event))))))))))
diff --git a/helm-id-utils.el b/helm-id-utils.el
index 0ff71e5246..215092b608 100644
--- a/helm-id-utils.el
+++ b/helm-id-utils.el
@@ -67,7 +67,7 @@ MacPorts to install id-utils, it should be `gid32'."
                                                0))
                                   'face 'helm-locate-finish))))
                   (force-mode-line-update))
-                (helm-log "Error: Gid %s"
+                (helm-log "helm-gid-candidates-process" "Error: Gid %s"
                           (replace-regexp-in-string "\n" "" event))))))))
 
 (defun helm-gid-filtered-candidate-transformer (candidates _source)
diff --git a/helm-imenu.el b/helm-imenu.el
index 36aa9780f2..80802357ce 100644
--- a/helm-imenu.el
+++ b/helm-imenu.el
@@ -319,7 +319,7 @@ The sexp should be an `all-the-icons' function with its 
args."
 
 (defun helm-imenu-action (candidate)
   "Default action for `helm-source-imenu'."
-  (helm-log-run-hook 'helm-goto-line-before-hook)
+  (helm-log-run-hook "helm-imenu-action" 'helm-goto-line-before-hook)
   (helm-imenu--maybe-switch-to-buffer candidate)
   (imenu candidate)
   ;; If semantic is supported in this buffer
diff --git a/helm-locate.el b/helm-locate.el
index 95b478d61b..898d35cfc1 100644
--- a/helm-locate.el
+++ b/helm-locate.el
@@ -317,8 +317,8 @@ See also `helm-locate'."
                         (shell-quote-argument (car args)))))
          (default-directory (if (file-directory-p default-directory)
                                 default-directory "/")))
-    (helm-log "Starting helm-locate process")
-    (helm-log "Command line used was:\n\n%s"
+    (helm-log "helm-locat-init" "Starting helm-locate process")
+    (helm-log "helm-locat-init" "Command line used was:\n\n%s"
               (concat ">>> " (propertize cmd 'face 'font-lock-comment-face) 
"\n\n"))
     (prog1
         (start-process-shell-command
@@ -341,7 +341,7 @@ See also `helm-locate'."
                     (helm-redisplay-buffer))
                   (helm-locate-update-mode-line "Locate"))
                  (t
-                  (helm-log "Error: Locate %s"
+                  (helm-log "helm-locat-init" "Error: Locate %s"
                             (replace-regexp-in-string "\n" "" event))))))))))
 
 (defun helm-locate-default-fuzzy-sort-fn (candidates)
diff --git a/helm-ring.el b/helm-ring.el
index 6459ba39af..c9c50c93e5 100644
--- a/helm-ring.el
+++ b/helm-ring.el
@@ -301,7 +301,7 @@ This is a command for `helm-kill-ring-map'."
     (helm-aif (marker-buffer candidate)
         (progn
           (switch-to-buffer it)
-          (helm-log-run-hook 'helm-goto-line-before-hook)
+          (helm-log-run-hook "helm-mark-ring-default-action" 
'helm-goto-line-before-hook)
           (helm-match-line-cleanup)
           (with-helm-current-buffer
             (unless helm-yank-point (setq helm-yank-point (point))))
diff --git a/helm-semantic.el b/helm-semantic.el
index 4687029443..0ba207ec13 100644
--- a/helm-semantic.el
+++ b/helm-semantic.el
@@ -119,7 +119,8 @@ you have completion on these functions with `C-M i' in the 
customize interface."
 (defun helm-semantic-default-action (_candidate &optional persistent)
   ;; By default, helm doesn't pass on the text properties of the selection.
   ;; Fix this.
-  (helm-log-run-hook 'helm-goto-line-before-hook)
+  (helm-log-run-hook "helm-semantic-default-action"
+                     'helm-goto-line-before-hook)
   (with-current-buffer helm-buffer
     (when (looking-at " ")
       (goto-char (next-single-property-change
diff --git a/helm-tags.el b/helm-tags.el
index 6b29f8331a..d716fda5f7 100644
--- a/helm-tags.el
+++ b/helm-tags.el
@@ -262,7 +262,7 @@ If there is no entry in cache, create one."
   "Helm default action to jump to an etags entry in other window."
   (require 'etags)
   (deactivate-mark t)
-  (helm-log-run-hook 'helm-goto-line-before-hook)
+  (helm-log-run-hook "helm-etags-action-goto " 'helm-goto-line-before-hook)
   (let* ((split (helm-grep-split-line candidate))
          (fname (cl-loop for tagf being the hash-keys of helm-etags-cache
                          for f = (expand-file-name
diff --git a/helm-utils.el b/helm-utils.el
index a745e2ef83..1cf1d61590 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -509,7 +509,8 @@ Default is `helm-current-buffer'."
 (defun helm-goto-line (lineno &optional noanim)
   "Goto LINENO opening only outline headline if needed.
 Animation is used unless NOANIM is non--nil."
-  (helm-log-run-hook 'helm-goto-line-before-hook)
+  (helm-log-run-hook "helm-goto-line"
+                     'helm-goto-line-before-hook)
   (helm-match-line-cleanup)
   (unless helm-alive-p
     (with-helm-current-buffer
@@ -1069,7 +1070,8 @@ If FILE is a directory, open this directory."
 Run `helm-find-many-files-after-hook' at end."
   (let ((helm--reading-passwd-or-string t))
     (mapc 'find-file (helm-marked-candidates))
-    (helm-log-run-hook 'helm-find-many-files-after-hook)))
+    (helm-log-run-hook "helm-find-many-files"
+                       'helm-find-many-files-after-hook)))
 
 (defun helm-read-repeat-string (prompt &optional count)
   "Prompt as many time PROMPT is not empty.



reply via email to

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