From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: bug#7234: 24.0.50; strange message after text-scale-adjust Date: Tue, 19 Oct 2010 09:37:18 +0900 Message-ID: References: <87mxqbu1ii.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1287448655 3861 80.91.229.12 (19 Oct 2010 00:37:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Oct 2010 00:37:35 +0000 (UTC) Cc: emacs-devel@gnu.org, miles@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 19 02:37:34 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P80Cr-0006FR-Og for ged-emacs-devel@m.gmane.org; Tue, 19 Oct 2010 02:37:34 +0200 Original-Received: from localhost ([127.0.0.1]:56766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P80Cq-0007tA-T7 for ged-emacs-devel@m.gmane.org; Mon, 18 Oct 2010 20:37:32 -0400 Original-Received: from [140.186.70.92] (port=54628 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P80Ck-0007t5-K0 for emacs-devel@gnu.org; Mon, 18 Oct 2010 20:37:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P80Cj-00023p-NZ for emacs-devel@gnu.org; Mon, 18 Oct 2010 20:37:26 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:54167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P80Ch-00023P-9u; Mon, 18 Oct 2010 20:37:23 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id o9J0bJGF016111; Tue, 19 Oct 2010 09:37:19 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id o9J0bJcb018921; Tue, 19 Oct 2010 09:37:19 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id o9J0bI6s011181; Tue, 19 Oct 2010 09:37:18 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.71) (envelope-from ) id 1P80Cc-0003X5-LK; Tue, 19 Oct 2010 09:37:18 +0900 In-Reply-To: (message from Stefan Monnier on Mon, 18 Oct 2010 10:17:53 -0400) X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131827 Archived-At: In article , Stefan Monnier 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