From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: 6253@debbugs.gnu.org
Subject: bug#6253: Please resize mini-buffer for queries even if
Date: Wed, 11 Apr 2012 08:56:40 -0400 [thread overview]
Message-ID: <jwvy5q2bflq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3pqbewmfg.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Wed, 11 Apr 2012 13:13:55 +0200")
> I've read the patch, and it looks good to me. Do we want to discuss
> this any further, or should I just apply the patch?
The patch I have (see below) doesn't look applicable as-is.
See comments below.
> --- trunk/src/fns.c 2010-04-25 22:16:58 +0000
> +++ patched/src/fns.c 2010-05-23 22:13:34 +0000
> @@ -2577,6 +2577,9 @@
> Lisp_Object args[2];
> struct gcpro gcpro1, gcpro2;
> int count = SPECPDL_INDEX ();
> + Lisp_Object old_Vresize_mini_windows = Vresize_mini_windows;
> +
> + specbind (Qcursor_in_echo_area, Qt);
>
> specbind (Qcursor_in_echo_area, Qt);
I don't think we need to specbind the same variable twice ;-)
> @@ -2616,13 +2619,38 @@
> {
> Lisp_Object pargs[3];
> -
> - /* Colorize prompt according to `minibuffer-prompt' face. */
> + Lisp_Object face;
> + Lisp_Object props;
> + Lisp_Object use_face;
> + Lisp_Object elt;
> +
> + face = intern("face");
> + props = Fsymbol_value (intern ("minibuffer-prompt-properties"));
> + use_face = Qnil;
> +
> + /* Colorize prompt according to `minibuffer-prompt-properties'. */
> + use_face = intern("default");
> + while (1)
> + {
> + if (!CONSP (props) || EQ (XCAR (props), face))
> + break;
> +
> + props = XCDR (props);
> + }
> + if (CONSP (props))
> + {
> + props = XCDR (props);
> + if (CONSP (props))
> + {
> + use_face = XCAR (props);
> + }
> + }
> pargs[0] = build_string ("%s(y or n) ");
> pargs[1] = intern ("face");
> - pargs[2] = intern ("minibuffer-prompt");
> + pargs[2] = use_face;
This seems unrelated. Maybe it's a good change, but it should be
submitted separately, and motivated.
> - Fmake_frame_visible (mini_frame);
> + Fmake_frame_visible (mini_frame, Qnil);
That also seems unrelated.
> + Vresize_mini_windows = Qt;
The main problem with the patch is that this new behavior cannot
be controlled.
> + Lisp_Object old_Vresize_mini_windows = Vresize_mini_windows;
> + Vresize_mini_windows = Qt;
>
> if (! NILP (prompt))
> message_with_string ("%s", prompt, 0);
>
> val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);
>
> + if (! NILP (prompt))
> + message (0); /* Resize. */
> + Vresize_mini_windows = old_Vresize_mini_windows;
This technique you've used at various places is unreliable. You want to
use specbind+unbind instead.
> --- trunk/src/lisp.h 2010-05-15 21:19:05 +0000
> +++ patched/src/lisp.h 2010-05-23 15:47:47 +0000
> @@ -2625,6 +2625,7 @@
> extern void safe_bcopy P_ ((const char *, char *, int));
>
> /* Defined in xdisp.c */
> +extern Lisp_Object Vresize_mini_windows;
> extern Lisp_Object Qinhibit_point_motion_hooks;
> extern Lisp_Object Qinhibit_redisplay, Qdisplay;
> extern Lisp_Object Qinhibit_eval_during_redisplay;
This is not needed.
Stefan
next prev parent reply other threads:[~2012-04-11 12:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-23 11:46 bug#6253: Please resize mini-buffer for queries even if resize-mini-windows is nil Lennart Borgman
2010-05-23 13:43 ` Stefan Monnier
2010-05-23 13:49 ` Lennart Borgman
2010-05-23 14:10 ` bug#6253: Please resize mini-buffer for queries even if Stefan Monnier
2010-05-23 22:24 ` Lennart Borgman
2012-04-11 11:13 ` Lars Magne Ingebrigtsen
2012-04-11 12:56 ` Stefan Monnier [this message]
2019-06-27 17:12 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy5q2bflq.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=6253@debbugs.gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).