all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I bind a variable for the minibuffer's use?
@ 2016-03-28 18:43 Alan Mackenzie
  2016-03-28 18:53 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alan Mackenzie @ 2016-03-28 18:43 UTC (permalink / raw
  To: emacs-devel

Hello, Emacs.

How do I bind a variable for the minibuffer?  In particular, I want to
bind text-property-default-nonsticky to include '(separator . t).

The way it is done at the moment (in query-replace-read-from) is simply
to bind that variable, in the hope that that binding will be the one
seen by the minibuffer.  When the variable has a buffer local binding in
the current buffer, this doesn't work - the minibuffer only sees the
global binding.  This has led to bug #23127

Where is the function `current-minibuffer'?  With it, I could create a
local binding in the minibuffer.  Where is the functionality to bind the
default value of a variable?

Any other ideas?

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I bind a variable for the minibuffer's use?
  2016-03-28 18:43 How do I bind a variable for the minibuffer's use? Alan Mackenzie
@ 2016-03-28 18:53 ` Eli Zaretskii
  2016-03-28 18:57 ` Andreas Schwab
  2016-03-28 18:59 ` Stefan Monnier
  2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2016-03-28 18:53 UTC (permalink / raw
  To: Alan Mackenzie; +Cc: emacs-devel

> Date: Mon, 28 Mar 2016 18:43:55 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> Where is the function `current-minibuffer'?

(window-buffer (minibuffer-window))



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I bind a variable for the minibuffer's use?
  2016-03-28 18:43 How do I bind a variable for the minibuffer's use? Alan Mackenzie
  2016-03-28 18:53 ` Eli Zaretskii
@ 2016-03-28 18:57 ` Andreas Schwab
  2016-03-28 18:59 ` Stefan Monnier
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2016-03-28 18:57 UTC (permalink / raw
  To: Alan Mackenzie; +Cc: emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> How do I bind a variable for the minibuffer?  In particular, I want to
> bind text-property-default-nonsticky to include '(separator . t).

minibuffer-setup-hook

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I bind a variable for the minibuffer's use?
  2016-03-28 18:43 How do I bind a variable for the minibuffer's use? Alan Mackenzie
  2016-03-28 18:53 ` Eli Zaretskii
  2016-03-28 18:57 ` Andreas Schwab
@ 2016-03-28 18:59 ` Stefan Monnier
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2016-03-28 18:59 UTC (permalink / raw
  To: emacs-devel

> How do I bind a variable for the minibuffer?

There can be several minibuffers, so you need to be more precise.

> In particular, I want to bind text-property-default-nonsticky to
> include '(separator . t).

When/where is this property added and then used?

> The way it is done at the moment (in query-replace-read-from) is simply
> to bind that variable, in the hope that that binding will be the one
> seen by the minibuffer.

I guess the simplest way would be to use minibuffer-with-setup-hook
where you setq-local those vars.

This has the downside that those buffer-local settings may leak to the
next use of the minibuffer, but it's probably harmless (and with any
luck minibuffer-inactive-mode will kill those buffer-local settings as
soon as you exit the minibuffer).


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-28 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-28 18:43 How do I bind a variable for the minibuffer's use? Alan Mackenzie
2016-03-28 18:53 ` Eli Zaretskii
2016-03-28 18:57 ` Andreas Schwab
2016-03-28 18:59 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.