From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Barzilay Newsgroups: gmane.emacs.bugs Subject: bug#21634: 24.5; Suggested improvement Date: Tue, 6 Oct 2015 08:04:03 -0400 Message-ID: <22035.47283.76000.848103@gargle.gargle.HOWL> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1444133131 13643 80.91.229.3 (6 Oct 2015 12:05:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Oct 2015 12:05:31 +0000 (UTC) To: 21634@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 06 14:05:19 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZjQzb-0000vY-CM for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Oct 2015 14:05:15 +0200 Original-Received: from localhost ([::1]:50457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjQza-0008VP-UC for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Oct 2015 08:05:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjQzU-0008Rl-C4 for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 08:05:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjQzO-0000wH-MU for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 08:05:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjQzO-0000w2-JT for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 08:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZjQzO-0002im-Au for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 08:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Barzilay Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Oct 2015 12:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21634 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144413306410409 (code B ref -1); Tue, 06 Oct 2015 12:05:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Oct 2015 12:04:24 +0000 Original-Received: from localhost ([127.0.0.1]:56068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjQym-0002ho-5i for submit@debbugs.gnu.org; Tue, 06 Oct 2015 08:04:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44593) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjQyj-0002hf-IJ for submit@debbugs.gnu.org; Tue, 06 Oct 2015 08:04:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjQyi-0000YE-DJ for submit@debbugs.gnu.org; Tue, 06 Oct 2015 08:04:21 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjQyi-0000YA-AF for submit@debbugs.gnu.org; Tue, 06 Oct 2015 08:04:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjQyd-0008Mk-8h for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 08:04:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjQya-0000R0-1k for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 08:04:15 -0400 Original-Received: from mail-qg0-f54.google.com ([209.85.192.54]:36604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjQyZ-0000Pj-Ta for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2015 08:04:11 -0400 Original-Received: by qgx61 with SMTP id 61so172030866qgx.3 for ; Tue, 06 Oct 2015 05:04:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:subject; bh=GhTMm5nN9wYtIxwcToYKwk5v/tRh5yOp+WNsUyahXrM=; b=BATst2zzDiyJftHj+Aq7PZZ95AsUrAlPxbNTP0J+4yeK44w8m9pGBLgfr/MtLcyQkJ 1HuXIXaW6000mwUZjRUE8++QgS9BlvoYZWa3DfN/z2TiSdTtFEhdHPkliU3hX5vU5DIF Yz9/SdfR0VOpV6jBJrDpWVMElA5EoFDmCrRNCeWeh9Kl+kcu42B25U1fSjTs1g2Mg4NO qVkDTPd9CIHdOIcSSJ/Kx1EsSZB9EpSFsbhMJWLbTzBCpdUKEH3nsrQV9gK1WXkMKBq8 2mybwmz8kt1OGU2Yj40RYBuENQh4ea6ooyEjSQ0rkNRSNsmx2dP08BdX0qwhIQ48NUk8 ZsYA== X-Gm-Message-State: ALoCoQmELAXTZclYzXST7UH/xjQrIho5yjOg4TTnHVV128t2ZNRb2MjRYWn9JdQB2/JXfdmFbxYc X-Received: by 10.140.19.227 with SMTP id 90mr45505215qgh.51.1444133050960; Tue, 06 Oct 2015 05:04:10 -0700 (PDT) Original-Received: from BARZILAY ([199.48.244.137]) by smtp.gmail.com with ESMTPSA id f7sm13704581qka.41.2015.10.06.05.04.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2015 05:04:10 -0700 (PDT) X-Mailer: VM 8.2.0a under 24.5.1 (i686-pc-mingw32) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107368 Archived-At: Would it make sense to implement `text-scale-adjust' as follows? One minor change is using the `keep-pred' argument to avoid re-setting the map repeatedly, but the important change is having it timeout after a few seconds. This avoids the kind of mode-ish interaction that feels weird in Emacs. In fact, I find this useful in other cases too (a command that allows you to resize the current window with the arrow keys), so I think that it's useful to either add an additional timeout argument -- or perhaps an extension where `keep-pred' can be a number of seconds and will do the timeout thing. ------------------------------------------------------------------------------- (defun text-scale-adjust (inc) "..." (interactive "p") (let ((ev last-command-event) (echo-keystrokes nil)) (let* ((base (event-basic-type ev)) (step (pcase base ((or ?+ ?=) inc) (?- (- inc)) (?0 0) (_ inc)))) (text-scale-increase step) (message "Use +,-,0 for further adjustment") (run-with-idle-timer 2 nil (set-transient-map (let ((map (make-sparse-keymap))) (dolist (mods '(() (control))) (dolist (key '(?- ?+ ?= ?0)) ;; = is often unshifted +. (define-key map (vector (append mods (list key))) (lambda () (interactive) (text-scale-adjust (abs inc)))))) map) t (lambda () (message "done"))))))) ------------------------------------------------------------------------------- -- ((x=>x(x))(x=>x(x))) Eli Barzilay: http://barzilay.org/ Maze is Life!