through @code{substitute-command-keys} (@pxref{Keys in Documentation}).
@end defun
-@defvar read-minibuffer-restore-windows
-If this option is non-@code{nil} (the default), getting input from the
-minibuffer will restore, on exit, the window configurations of the frame
-where the minibuffer was entered from and, if it is different, the frame
-that owns the minibuffer window. This means that if, for example, a
-user splits a window while getting input from the minibuffer on the same
-frame, that split will be undone when exiting the minibuffer.
-
-If this option is @code{nil}, no such restorations are done. Hence, the
-window split mentioned above will persist after exiting the minibuffer.
-@end defvar
-
@node Object from Minibuffer
@section Reading Lisp Objects with the Minibuffer
@cindex minibuffer input, reading lisp objects
"21.1"
:set minibuffer-prompt-properties--setter)
(minibuffer-auto-raise minibuffer boolean)
- (read-minibuffer-restore-windows minibuffer boolean "28.1")
;; options property set at end
(read-buffer-function minibuffer
(choice (const nil)
(if erc-scrolltobottom-mode
(if erc-scrolltobottom-all
(progn
- (setq-local read-minibuffer-restore-windows nil)
(when (zerop scroll-conservatively)
(setq-local scroll-step 1))
(unless (eq erc-scrolltobottom-all 'relaxed)
(remove-hook 'post-command-hook #'erc--scrolltobottom-on-post-command t)
(remove-hook 'window-configuration-change-hook
#'erc--scrolltobottom-on-win-conf-change t)
- (kill-local-variable 'read-minibuffer-restore-windows)
(kill-local-variable 'scroll-step)
(kill-local-variable 'erc--scrolltobottom-window-info)))
(define-key map "\M-<" 'minibuffer-beginning-of-buffer)
(define-key map "\C-x\M-k" 'minibuffer-kill-from-history)
(define-key map "\C-x\M-h" 'minibuffer-alternate-history)
+ (define-key map "\C-x\C-w" 'minibuffer-insert-symbol-at-point)
(define-key map "\C-xj" 'minibuffer-set-action)
(define-key map "\n" 'minibuffer-apply)
(define-key map "\r" 'exit-minibuffer))
(when file-name-at-point
(insert file-name-at-point))))
+(defun minibuffer-insert-symbol-at-point ()
+ "Get a symbol at point in original buffer and insert it to minibuffer."
+ (interactive "" minibuffer-mode)
+ (when-let ((sym (with-current-buffer
+ (window-buffer (minibuffer-selected-window))
+ (thing-at-point 'symbol t))))
+ (insert sym)))
+
(defun minibuffer-beginning-of-buffer (&optional arg)
"Move to the logical beginning of the minibuffer.
This command behaves like `beginning-of-buffer', but if point is
(defvar minibuffer-allow-text-properties nil "Unused obsolete variable.")
(make-obsolete-variable 'minibuffer-allow-text-properties nil "30.1")
+(defvar read-minibuffer-restore-windows nil "Unused obsolete variable.")
+(make-obsolete-variable 'read-minibuffer-restore-windows nil "30.1")
+
(defcustom minibuffer-auto-completion-idle-time 0.4
"Number for seconds to wait before auto-completion in the minibuffer."
:type 'float
:group 'tab-bar
:version "30.1")
-(defvar tab-bar-minibuffer-restore-tab nil
- "Tab number for `tab-bar-minibuffer-restore-tab'.")
-
-(defun tab-bar-minibuffer-restore-tab ()
- "Switch back to the tab where the minibuffer was activated.
-This is necessary to prepare the same window configuration where
-original windows were saved and will be restored. This function
-is used only when `read-minibuffer-restore-windows' is non-nil."
- (when tab-bar-minibuffer-restore-tab
- (tab-bar-select-tab tab-bar-minibuffer-restore-tab)))
-
(defun tab-bar-select-tab (&optional tab-number)
"Switch to the tab by its absolute position TAB-NUMBER in the tab bar.
When this command is bound to a numeric key (with a key prefix or modifier key
(to-index (1- (max 1 (min to-number (length tabs)))))
(minibuffer-was-active (minibuffer-window-active-p (selected-window))))
- (when (and read-minibuffer-restore-windows minibuffer-was-active
- (not tab-bar-minibuffer-restore-tab))
- (setq-local tab-bar-minibuffer-restore-tab (1+ from-index))
- (add-hook 'minibuffer-exit-hook #'tab-bar-minibuffer-restore-tab nil t))
-
(unless (eq from-index to-index)
(let* ((from-tab (tab-bar--tab))
(to-tab (nth to-index tabs))
call1 (Qpush_window_buffer_onto_prev, minibuf_window);
record_unwind_protect_void (minibuffer_unwind);
- if (read_minibuffer_restore_windows)
- record_unwind_protect (restore_window_configuration,
- list3 (Fcurrent_window_configuration (Qnil),
- Qt, Qt));
-
- /* If the minibuffer window is on a different frame, save that
- frame's configuration too. */
- if (read_minibuffer_restore_windows &&
- !EQ (mini_frame, selected_frame))
- record_unwind_protect (restore_window_configuration,
- list3 (Fcurrent_window_configuration (mini_frame),
- Qnil, Qt));
/* If the minibuffer is on an iconified or invisible frame,
make it visible now. */
instead. */);
inhibit_interaction = 0;
- DEFVAR_BOOL ("read-minibuffer-restore-windows", read_minibuffer_restore_windows,
- doc: /* Non-nil means restore window configurations on exit from minibuffer.
-If this is non-nil (the default), reading input with the minibuffer will
-restore, on exit, the window configurations of the frame where the
-minibuffer was entered from and, if it is different, the frame that owns
-the associated minibuffer window.
-
-If this is nil, window configurations are not restored upon exiting
-the minibuffer. However, if `minibuffer-restore-windows' is present
-in `minibuffer-exit-hook', exiting the minibuffer will remove the window
-showing the *Completions* buffer, if any. */);
- read_minibuffer_restore_windows = true;
-
defsubr (&Sactive_minibuffer_window);
defsubr (&Sset_minibuffer_window);
defsubr (&Sread_from_minibuffer);