Timeline for Is there a reliable way to determine in the minibuffer from which buffer the interactive command was invoked?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 21, 2022 at 17:00 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
May 25, 2022 at 9:21 | comment | added | dalanicolai |
Maybe you could use the workaround to set a pre-command-minibuffer variable to the current buffer via the pre-command-hook , unless the current-buffer is a minibuffer. Maybe you'd have to exclude some other (types of) buffers, but otherwise this might work
|
|
May 24, 2022 at 16:05 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Apr 24, 2022 at 16:03 | history | edited | Drew |
edited tags
|
|
Apr 24, 2022 at 16:03 | answer | added | Drew | timeline score: 1 | |
Apr 24, 2022 at 14:15 | comment | added | dalanicolai | Ah okay, thanks. Well, than the answer on my 'original' comment is probably NO :) | |
Apr 24, 2022 at 14:13 | comment | added | Tom |
Your print function runs after the minibuffer was invoked. You can try the same using minibuffer-setup-hook which is called when the cursor is in the minibuffer.
|
|
Apr 24, 2022 at 14:12 | comment | added | dalanicolai |
Ah okay. Well I've tested it in Spacemacs (using ivy ) calling the following command: (defun test (dir) (interactive "D") (print (current-buffer))) , it printed the buffer from where I invoked ivy-switch-buffer , instead of the minibuffer. I remember something that helm does not use the minibuffer, which could be relevent (or not)... (I can not get the code block formatted 'correctly' here in the comments)
|
|
Apr 24, 2022 at 13:58 | comment | added | Tom | @dalanicolai when you are in the minibuffer then the minibuffer is the current buffer, not the invoking buffer | |
Apr 24, 2022 at 13:45 | comment | added | dalanicolai |
Doesn't most (or all) of the time the function current-buffer provide it?
|
|
Apr 24, 2022 at 11:49 | history | asked | Tom | CC BY-SA 4.0 |