1

Whenever I call

(describe-variable)

, there is no history of what variables I've recently viewed. Is there a way to enable it to have some kind of history?;)

1
  • 1
    You can do l in a *Help* buffer to go back in history, but you cannot select just variables: you'll get all of them (functions, keys, variables, anything). See help-go-back and help-xref-stack.
    – NickD
    Commented Jul 15, 2023 at 12:14

1 Answer 1

2

The short answer is "No", you can't do this out of the box, AFAIK.


C-h v (bound to describe-variable) uses completing-read with a nil value as its HISTORY argument. That means it uses minibuffer-history as the history variable, and the value of that variable mixes in lots of minibuffer inputs that you've entered, for different kinds of commands (it's a catch-all).

You would need to advise describe-variable to change its interactive spec to use completing-read with a specific (new) variable as the HISTORY argument, e.g. my-C-v-history. Then you could just use C-h v my-C-h-v-history, to see its value at any time.

Alternatively, you could define your own command my-describe-variable, which does that (just copy the describe-variable code and change that nil to my-C-h-v-history), and bind your command to C-h v.


FWIW, C-h M-n M-n... cycles through all of the variables, not just those you've entered as input to C-h v, but it may be worth knowing this fact. They're not in a recognizable order, however (the order is their order as symbols in obarray).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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