From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Titus von der Malsburg Newsgroups: gmane.emacs.help Subject: Re: text-scale-mode and switching major modes Date: Fri, 6 Jan 2012 22:52:07 +0100 Message-ID: References: <7657D9B3D1F14A0C92E8FE77E8AC3349@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1325886771 6557 80.91.229.12 (6 Jan 2012 21:52:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Jan 2012 21:52:51 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 06 22:52:47 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RjHiR-0002oM-4U for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jan 2012 22:52:47 +0100 Original-Received: from localhost ([::1]:45061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjHiQ-0008NJ-HT for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jan 2012 16:52:46 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:34323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjHiK-0008N0-Te for help-gnu-emacs@gnu.org; Fri, 06 Jan 2012 16:52:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjHiJ-0007cp-9c for help-gnu-emacs@gnu.org; Fri, 06 Jan 2012 16:52:40 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:50131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjHiJ-0007ch-3Q for help-gnu-emacs@gnu.org; Fri, 06 Jan 2012 16:52:39 -0500 Original-Received: by iacb35 with SMTP id b35so3807385iac.0 for ; Fri, 06 Jan 2012 13:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=iWKiWW937P109rnKAK7HT4z0ZJCeu6LGqCnsHDv7Vkg=; b=Ie81NhMXPnsfwUOCe8Ndj2f/Xd16pT6sXQBlyEFBD8txNg3cB5rp0PI7MY8plMhPEn 3zOr3Z8XtsoV+hLU2qPvRbzPeo5d5+qTenggQXRfYbBpqmhdrgXC4PlwlLpkhR9gl17+ MKtAiDyjzEHbC9wuKL8PmI0fW10f7TLxtccdU= Original-Received: by 10.50.15.161 with SMTP id y1mr10750305igc.4.1325886758351; Fri, 06 Jan 2012 13:52:38 -0800 (PST) Original-Received: by 10.42.19.129 with HTTP; Fri, 6 Jan 2012 13:52:07 -0800 (PST) In-Reply-To: <7657D9B3D1F14A0C92E8FE77E8AC3349@us.oracle.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83383 Archived-At: Hi Drew, thanks for your suggestion. Below is my solution. I don't know if this is the idiomatic way of doing these things but it seems to work. ;; Restore text-scale after change of major mode. (autoload 'text-scale-mode "face-remap") (add-hook 'change-major-mode-hook (lambda () (put 'text-scale-mode-amount 'permanent-local t))) (add-hook 'after-change-major-mode-hook 'text-scale-mode) Cheers, Titus On Fri, Jan 6, 2012 at 6:10 PM, Drew Adams wrote: >> I use noweb-mode a lot. =C2=A0This mode allows to have several languages= in >> one file (e.g. latex and R) and switch major modes automatically >> depending on where the cursor is -- very useful! =C2=A0However, every ti= me >> modes are switched the font size (which I set with text-scale-adjust) >> changes back to the default. =C2=A0Is there a way to make the font size >> persistent? >> >> Note that I'd like to use different font sizes in >> different buffers, so setting the default font size a specific value >> is not a solution. > > AFAIK, text scaling is on a per-buffer basis. =C2=A0You could perhaps imp= lement a > workaround for your problem using `(after-)change-major-mode-hook'. > > Another thing you could do, but which goes against your last sentence, is= to > zoom the frame (yes, change its default font size) instead of scaling the= text > of various buffers. =C2=A0See http://www.emacswiki.org/emacs/SetFonts#toc= 6 and > http://www.emacswiki.org/emacs/download/zoom-frm.el. > --=20 Titus von der Malsburg DFG Research Group 868: Mind and Brain Dynamics Dept. of Linguistics, University of Potsdam http://www.ling.uni-potsdam.de/~malsburg/