[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#38317: Buffer-local variables don't work as history for read-from-mi
From: |
Federico Tedin |
Subject: |
bug#38317: Buffer-local variables don't work as history for read-from-minibuffer |
Date: |
Sun, 24 Nov 2019 00:12:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
> So although `read_minibuf' does call `add-to-history' before returning
> (and after setting the current buffer to be the minibuffer's), my input
> wasn't added to any list (that I know of). This is strange, since
> `add-to-history' seemed to work correctly with buffer-local variables
> when I tested it separately. I would've expected the new history item to
> be added to one of the minibuffer's `test-history' local variable.
>
> So I think the first step would be to make `read_minibuf' add the new
> history item into the right place when HIST is buffer-local.
Turns out `get_minibuffer' sets the minibuffer's buffer mode to
`minibuffer-inactive-mode', which resets the minibuffer's local
variables (though not 100% sure about this). I think the history items
were being added to the minibuffer's local version of the variable, and
then being deleted by that.
I created a small patch that sets back the original buffer at the end of
`read_minibuf', so that the history item is added in the right
place. Then, I modified `goto-history-element' as Michael suggested, so
that the function reads the buffer-local version of the variable, but
not the minibuffer's (and updated `minibuffer-history-isearch-wrap' just
in case as well). With this, M-p and M-n works again.
I'm attaching a draft patch in case anyone wants to provide some
feedback. Thanks!
- Fede
minibuf.diff
Description: patch
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Federico Tedin, 2019/11/21
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Lars Ingebrigtsen, 2019/11/22
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Michael Heerdegen, 2019/11/22
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, martin rudalics, 2019/11/22
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Lars Ingebrigtsen, 2019/11/23
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Federico Tedin, 2019/11/23
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer,
Federico Tedin <=
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Federico Tedin, 2019/11/26
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Robert Pluim, 2019/11/27
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Drew Adams, 2019/11/27
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Robert Pluim, 2019/11/27
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Lars Ingebrigtsen, 2019/11/27
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Federico Tedin, 2019/11/27
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Eli Zaretskii, 2019/11/27
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Federico Tedin, 2019/11/27
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Federico Tedin, 2019/11/28
- bug#38317: Buffer-local variables don't work as history for read-from-minibuffer, Richard Stallman, 2019/11/29