From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: New global bindings Date: Wed, 04 Jun 2008 11:50:42 +0900 Message-ID: References: Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212547887 23045 80.91.229.12 (4 Jun 2008 02:51:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Jun 2008 02:51:27 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: M Jared Finder Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 04 04:52:08 2008 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.50) id 1K3j6e-00062A-1C for ged-emacs-devel@m.gmane.org; Wed, 04 Jun 2008 04:52:08 +0200 Original-Received: from localhost ([127.0.0.1]:54778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3j5s-0005rF-4Q for ged-emacs-devel@m.gmane.org; Tue, 03 Jun 2008 22:51:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3j5P-0005U1-0U for emacs-devel@gnu.org; Tue, 03 Jun 2008 22:50:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3j5N-0005SF-DI for emacs-devel@gnu.org; Tue, 03 Jun 2008 22:50:50 -0400 Original-Received: from [199.232.76.173] (port=34010 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3j5N-0005S8-7O for emacs-devel@gnu.org; Tue, 03 Jun 2008 22:50:49 -0400 Original-Received: from tyo201.gate.nec.co.jp ([202.32.8.193]:43438) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3j5I-0003Za-Sc; Tue, 03 Jun 2008 22:50:45 -0400 Original-Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m542og4o008236; Wed, 4 Jun 2008 11:50:42 +0900 (JST) Original-Received: from relay11.aps.necel.com ([10.29.19.16] [10.29.19.16]) by relay31.aps.necel.com with ESMTP; Wed, 4 Jun 2008 11:50:42 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.112.215] [10.114.112.215]) by relay11.aps.necel.com with ESMTP; Wed, 4 Jun 2008 11:50:42 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id 76578644; Wed, 4 Jun 2008 11:50:42 +0900 (JST) System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: (M. Jared Finder's message of "Tue, 03 Jun 2008 09:39:39 -0700") Original-Lines: 61 X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) 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:98351 Archived-At: M Jared Finder writes: > I would be happy with C-x C-+/C-x C-- bindings. Please try the following: (define-key ctl-x-map [(control ?+)] 'incdec-buffer-face-height) (define-key ctl-x-map [(control ?-)] 'incdec-buffer-face-height) (define-key ctl-x-map [(control ?=)] 'incdec-buffer-face-height) (define-key ctl-x-map [(control ?0)] 'incdec-buffer-face-height) (defun incdec-buffer-face-height (&optional inc) "Increase or decrease the height of the default face in the current buffer. Then, continue to read input events and increase/decrease the face height as long as the input events with all modifiers removed are one of the following: +, = Increase the default face height by one step - Decrease the default face height by one step 0 Reset the default face height to the global default Each step scales the height of the default face by the variable `text-scale-mode-step' (a negative number of steps decreases the height by the same amount). As a special case, an argument of 0 will remove any scaling currently active. This command is a special-purpose wrapper around the `increase-buffer-face-height' command which makes repetition convenient even when it is bound in a non-top-level keymap. For binding in a top-level keymap, `increase-buffer-face-height' or `decrease-default-face-height' may be more appropriate." (interactive "p") (let ((first t) (step t) (ev last-command-event)) (while step (let ((base (event-basic-type ev))) (cond ((or (eq base ?+) (eq base ?=)) (setq step inc)) ((eq base ?-) (setq step (- inc))) ((eq base ?0) (setq step 0)) (first (setq step inc)) (t (setq step nil)))) (when step (increase-buffer-face-height step) (setq inc 1 first nil) (setq ev (read-event)))) (push ev unread-command-events))) Thanks, -Miles -- Education, n. That which discloses to the wise and disguises from the foolish their lack of understanding.