Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

1

What I'm actually trying to do is ... calling read-number from a separate function (my-command) with a buffer-local variable as HIST. As read-number doesn't have its own history list, you could let-bind minibuffer-history to your buffer-local history list around your call to read-number. (defvar-local local-history nil "Buffer-local history.") (defun my-...


2

Here's how to do it buffer-locally: (defvar-local my-hist-symbol nil) (defun my-function () (unless my-hist-symbol ;; Create the buffer's history symbol. (setq-local my-hist-symbol (make-symbol "my-hist"))) (read-from-minibuffer "> " nil nil nil my-hist-symbol)) (defun my-command () (interactive) (my-function)) (defun my-show-buffer-...


2

Do this: (defvar my-hist nil) (make-variable-buffer-local 'my-hist) (defun my-function (hist) (read-from-minibuffer "> " nil nil nil hist)) (defun my-command () (interactive) (add-to-history 'my-hist (my-function 'my-hist))) Don't quote hist when you pass it to read-from-minibuffer. You want to pass its value, e.g. the symbol my-hist, and not ...


Top 50 recent answers are included