From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Nice hack if you're using my face-remapping-alist patch Date: Sun, 23 May 2004 06:59:50 +0900 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87brkgf7hl.fsf@tc-1-100.kawasaki.gol.ne.jp> Reply-To: Miles Bader NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085274467 11911 80.91.224.253 (23 May 2004 01:07:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 May 2004 01:07:47 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun May 23 03:07:39 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BRhSl-0003Qf-00 for ; Sun, 23 May 2004 03:07:39 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BRhSl-0007o4-00 for ; Sun, 23 May 2004 03:07:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BRgsh-0007zC-AZ for emacs-devel@quimby.gnus.org; Sat, 22 May 2004 20:30:23 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BRgrN-0007ok-2K for emacs-devel@gnu.org; Sat, 22 May 2004 20:29:01 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BRgqn-0007gf-El for emacs-devel@gnu.org; Sat, 22 May 2004 20:28:57 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BRgo1-0006lE-Qc; Sat, 22 May 2004 20:25:34 -0400 Original-Received: from [203.216.5.131] (helo=smtp01.fields.gol.com) by mx20.gnu.org with esmtp (Exim 4.34) id 1BReX4-0006xN-S3; Sat, 22 May 2004 17:59:55 -0400 Original-Received: from filter01.fields.gol.com ([203.216.5.148] helo=localhost) by smtp01.fields.gol.com with esmtp (Magnetic Fields) id 1BReX2-0006pm-FL; Sun, 23 May 2004 06:59:52 +0900 Original-Received: from yokohama2-61-203-152-167.ap.0038.net ([61.203.152.167] helo=tc-1-100.kawasaki.gol.ne.jp) by smtp01.fields.gol.com with asmtp (Magnetic Fields) id 1BReX1-0006pj-OG; Sun, 23 May 2004 06:59:52 +0900 Original-Received: by tc-1-100.kawasaki.gol.ne.jp (Postfix, from userid 1000) id 16B782F71; Sun, 23 May 2004 06:59:50 +0900 (JST) Original-To: emacs-devel@gnu.org System-Type: i686-pc-linux-gnu Original-Lines: 53 X-Virus-Scanned: by AMaViS GOL X-Abuse-Complaints: abuse@gol.com X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23831 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23831 ;; I find displaying mail/gnus in a variable-pitch font is especially nice, ;; if it's easy to toggle on/off, and you have a nice variable-pitch font ;; (I didn't, until I started using this; the variable-pitch font-family ;; I'm using, btw, is "charter" (which I think is a standard X font(?)), ;; with a :height scale of 1.1). ;;; This allows variable-width text to be turned on or off conveniently ;;; in a buffer: (define-minor-mode variable-pitch-mode "Variable-pitch default-face mode." :lighter " VarPitch" (when (boundp 'face-remapping-alist) (let ((default-remapping (assq 'default face-remapping-alist)) (remappings face-remapping-alist)) (cond ((and default-remapping (not variable-pitch-mode)) (setq remappings (remq default-remapping remappings))) ((and variable-pitch-mode (null default-remapping)) (setq remappings (cons '(default variable-pitch) remappings)))) (unless (eq remappings face-remapping-alist) (set (make-local-variable 'face-remapping-alist) remappings) (force-window-update (current-buffer)))))) (defun turn-on-variable-pitch-mode () "Turn on `variable-pitch-mode'." (interactive) (variable-pitch-mode t)) (global-set-key "\C-cv" 'variable-pitch-mode) ;;; Turn it on by default in some modes: ;; mail sending: (add-hook 'message-mode-hook 'turn-on-variable-pitch-mode) (add-hook 'mail-mode-hook 'turn-on-variable-pitch-mode) ;; mail/news reading: (add-hook 'gnus-article-mode-hook 'turn-on-variable-pitch-mode) (defun gnus-summary-toggle-variable-pitch-mode () (interactive) (with-current-buffer gnus-article-buffer (variable-pitch-mode 'toggle))) ;; Bind "F" to toggle variable-pitch-mode in the article buffer ;; (warning, "F" already has a standard binding, so change at will) (add-hook 'gnus-summary-mode-hook (lambda () (local-set-key "F" 'gnus-summary-toggle-variable-pitch-mode))) ;; -Miles -- 97% of everything is grunge