New answers tagged buffer-local
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
Related Tags
buffer-local × 34hooks × 7
local-variables × 5
elisp × 4
variables × 3
org-mode × 2
window × 2
faces × 2
minibuffer × 2
minor-mode × 2
highlighting × 2
directory-local-variables × 2
file-local-variables × 2
environment × 2
hl-line-mode × 2
init-file × 1
org-babel × 1
buffers × 1
evil × 1
shell × 1
major-mode × 1
functions × 1
whitespace × 1
text-properties × 1
advice × 1