0

I'm running this version of Emacs:

GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.11) of 2019-09-23, modified by Debian

Installed on Ubuntu 19.10 via apt, and not built from source.

I'm trying to set the helm-debug variable so that I can see what Helm is doing to debug a problem (helm-locate is not showing files that exist in a directory whose parent element has .git in it).

So in the past, I could use M-: (mapped to eval-expression) and type in an expression, which I did with this:

(progn (setq helm-debug 'xxx) (message "helm-debug == %S" helm-debug))

And I get what I expect to see in the message area of:

"helm-debug == xxx"

And, I go back in and run M-: again to check on the value like this:

helm-debug

I see xxx as the resulting value. All good so far.

But then, when I type C-h v (mapped to describe-variable), and then type in helm-debug, and I see this:

helm-debug is a variable defined in ‘helm.el’.
Its value is nil

Documentation:
If non-‘nil’, write log message to ‘helm-debug-buffer’.
Default is ‘nil’, which disables writing log messages because the
size of ‘helm-debug-buffer’ grows quickly.

Why is it reporting nil, when I have clearly set it inside the eval-expression call?

For reference, the defvar for this variable resides in ~/.emacs.d/elpa/helm-core-20191013.626/helm.el in my setup (meaning Helm mode has been recently upgraded)

(defvar helm-debug nil
  "If non-`nil', write log message to `helm-debug-buffer'.
Default is `nil', which disables writing log messages because the
size of `helm-debug-buffer' grows quickly.")
  • Do you see the same thing if you start Emacs using emacs -Q? If not, bisect your init file to find the culprit. – Drew Oct 25 at 16:05
  • I refrained from bisecting the init file because this seemed to be deep in the guts of helm mode itself. And xuchunyang's answer at emacs.stackexchange.com/a/53370/15483 confirms that. – bgoodr Oct 26 at 15:54
1

It seems it's intended:

helm-internal calls 
  helm-log-save-maybe calls 
    (setq helm-debug nil)

thus whenever a helm session ends, helm-debug will be reset to nil. I guess it's because the log buffer can grow too quickly.

Instead of changing helm-debug directly, according to helm's own help (you can get it by type C-h m within any helm session, I have pasted the related section below), you can use C-h C-d:

Debugging Helm

Helm exposes the special variable helm-debug: setting it to non-nil will enable Helm logging in a special outline-mode buffer. Helm resets the variable to nil at the end of each session.

For convenience, C-h C-d allows you to turn on debugging for this session only. To avoid accumulating log entries while you are typing patterns, you can use C-! to turn off updating. When you are ready turn it on again to resume logging.

Once you exit your Helm session you can access the debug buffer with helm-debug-open-last-log. It is possible to save logs to dated files when helm-debug-root-directory is set to a valid directory.

Note: Be aware that Helm log buffers grow really fast, so use helm-debug only when needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.