From: Kenichi Handa <handa@m17n.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, miles@gnu.org
Subject: Re: bug#7234: 24.0.50; strange message after text-scale-adjust
Date: Tue, 19 Oct 2010 09:37:18 +0900 [thread overview]
Message-ID: <tl7wrpfggqp.fsf@m17n.org> (raw)
In-Reply-To: <jwv62wzy4nf.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Mon, 18 Oct 2010 10:17:53 -0400)
In article <jwv62wzy4nf.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > It would be better that read-event call in
> > text-scale-adjust has some prompt:
> > e.g. (read-event "+,-,0 for further adjustment: ")
> Agreed.
Shall I install that change, or do you have a better prompt
string, or should we wait for your alternative
implementation?
> > For non-interactive use, you should probably also be using
> > `text-scale-set' or `text-scale-increase' instead.
> BTW, I've been playing around with an alternative implementation for
> such things. The reason is that the use of
> read-event/read-char/read-key has surprising side-effects: in those
> cases I'm concerned with, the user expects that the command is already
> finished and the behavior is somewhat consistent with that expectation,
> but not completely: indeed typing "any" key sequence (except for a few
> special ones) runs the usual corresponding command, but OTOH
> post-command-hook and friends aren't run when expected.
I think the situation is similar to isearch. How does
isearch solve it?
> So, instead I use a new function set-temporary-overlay-map which sets up
> a keymap that's only active for a short period of time (by default just
> for the next key-sequence):
> ;; ----------------------------------------------------------------
> --- 294,317 ----
> `text-scale-decrease' may be more appropriate."
> (interactive "p")
> (let ((first t)
> (ev last-command-event)
> (echo-keystrokes nil))
> ! (let* ((base (event-basic-type ev))
> ! (step
> ! (case base
> ! ((?+ ?=) inc)
> ! (?- (- inc))
> ! (?0 0)
> ! (t inc))))
> (text-scale-increase step)
> ! (set-temporary-overlay-map
> ! (let ((map (make-sparse-keymap)))
> ! (define-key map [?=] 'text-scale-increase)
> ! (define-key map [?0] (lambda () (interactive) (text-scale-increase 0)))
> ! (define-key map [?+] 'text-scale-increase)
> ! (define-key map [?-] 'text-scale-decrease)
> ! map)
> ! t))))
With that, how to show the prompt?
---
Kenichi Handa
handa@m17n.org
next prev parent reply other threads:[~2010-10-19 0:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tl762x0i1l2.fsf@m17n.org>
[not found] ` <E1P7jwu-0005UJ-KX@fencepost.gnu.org>
[not found] ` <mailman.0.1287400359.30531.bug-gnu-emacs@gnu.org>
[not found] ` <87mxqbu1ii.fsf@catnip.gol.com>
2010-10-18 14:17 ` bug#7234: 24.0.50; strange message after text-scale-adjust Stefan Monnier
2010-10-19 0:37 ` Kenichi Handa [this message]
2010-10-19 16:26 ` Stefan Monnier
2010-10-20 2:00 ` Kenichi Handa
2010-10-20 16:07 ` Stefan Monnier
2010-10-21 1:21 ` Kenichi Handa
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=tl7wrpfggqp.fsf@m17n.org \
--to=handa@m17n.org \
--cc=emacs-devel@gnu.org \
--cc=miles@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).