From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: finger-pointer curser as default for mouse-face text Date: Tue, 2 Nov 2004 15:41:40 -0800 Message-ID: References: <20041102215135.GA20505@fencepost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1099438997 25912 80.91.229.6 (2 Nov 2004 23:43:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Nov 2004 23:43:17 +0000 (UTC) Cc: Miles Bader , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 03 00:43:04 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CP8Iq-0005NV-00 for ; Wed, 03 Nov 2004 00:43:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CP8Qu-0008T6-LS for ged-emacs-devel@m.gmane.org; Tue, 02 Nov 2004 18:51:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CP8QX-0008KU-54 for emacs-devel@gnu.org; Tue, 02 Nov 2004 18:51:01 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CP8QV-0008JE-KS for emacs-devel@gnu.org; Tue, 02 Nov 2004 18:51:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CP8QU-0008II-RI for emacs-devel@gnu.org; Tue, 02 Nov 2004 18:50:58 -0500 Original-Received: from [141.146.126.229] (helo=agminet02.oracle.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CP8He-0005XA-VN; Tue, 02 Nov 2004 18:41:51 -0500 Original-Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.191.12]) by agminet02.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id iA2NfhPG001203; Tue, 2 Nov 2004 15:41:44 -0800 Original-Received: from rgmgw3.us.oracle.com (localhost [127.0.0.1]) by rgmgw3.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id iA2NfhuR010966; Tue, 2 Nov 2004 16:41:43 -0700 Original-Received: from dradamslap (dhcp-amer-csvpn-gw2-141-144-85-61.vpn.oracle.com [141.144.85.61]) by rgmgw3.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id iA2Nfhpw010931; Tue, 2 Nov 2004 16:41:43 -0700 Original-To: "Karl Eichwalder" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <20041102215135.GA20505@fencepost> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal 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: main.gmane.org gmane.emacs.devel:29348 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29348 [I don't know if this is pertinant to this discussion or not - ignore if not. (CC'ing the list because this is related to Miles's message -- this is _not_ a request to consider this feature for inclusion in Emacs.)] Karl, I too wrote a command (`doremi-grow-font') that increases or decreases the font size of the frame by an increment. You could bind it to, say, C-+ (and bind to C-- a lambda that calls `doremi-grow-font' after flipping the sign of the increment). Like Miles's code, this lets you, in effect, _zoom_ the Emacs page (buffer) in and out easily. However, I also wrote another command, `doremi-font-size', that uses `doremi-grow-font' to let you increase or decrease the font size incrementally using the arrow keys or the mouse wheel (like IE browser-text zooming with the mouse wheel). Command `doremi-font-size' uses a very general function, `doremi', which you can use to do almost anything incrementally using the arrow keys or mouse wheel. See, for discussion, code, and documentation, http://www.emacswiki.org/cgi-bin/wiki/DoReMi (the font-size changing code is in library http://www.emacswiki.org/elisp/doremi-frm.el; the general `doremi' function is in library http://www.emacswiki.org/elisp/doremi.el). Without going into the details of the rest, here is the code of `doremi-grow-font', to give you an idea: (defun doremi-grow-font (&optional increment frame) "Increase size of font in FRAME by INCREMENT. Interactively, INCREMENT is given by the prefix argument. Optional FRAME parameter defaults to current frame." (interactive "p") (setq frame (or frame (selected-frame))) (let ((fontname (cdr (assq 'font (frame-parameters frame))))) (when (query-fontset fontname) (setq fontname (nth 2 (assq 'ascii (aref (fontset-info fontname frame) 2))))) (let ((xlfd-fields (x-decompose-font-name fontname)) new-font-name) (unless xlfd-fields (error "Cannot decompose font name")) (aset xlfd-fields xlfd-regexp-pixelsize-subnum (number-to-string (+ (string-to-number (aref xlfd-fields xlfd-regexp-pixelsize-subnum)) increment))) ;; Must set point size and width to "*", so frame width will adjust to new font size (aset xlfd-fields xlfd-regexp-pointsize-subnum "*") (aset xlfd-fields xlfd-regexp-avgwidth-subnum "*") (setq new-font-name (x-compose-font-name xlfd-fields)) (modify-frame-parameters frame (list (cons 'font new-font-name))) ;; Update faces that want a bold or italic version of the default font. (frame-update-faces frame)))) Miles's code looks much simpler, and seems to work just as well. I don't know what other functional differences there might be. HTH, Drew -----Original Message-----From: Miles Bader On Tue, Nov 02, 2004 at 07:08:34PM +0100, Karl Eichwalder wrote: > From time to time it is necessary to increase the font size: When I want > to demonstrate something to somebody watching my screen, or when I want > to check some accented or foreign characters more closely. Something like the following elisp code might be more useful for this. It implements the C-+ and C-- (that's control-minus :-) bindings many modern GUI programs use to grow/shrink the default face. ... default-grow.el