From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marco Baringer Newsgroups: gmane.emacs.help Subject: Re: switch-to-buffer hook? Date: 14 Jun 2002 16:19:52 +0200 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1024064982 28907 127.0.0.1 (14 Jun 2002 14:29:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 14 Jun 2002 14:29:42 +0000 (UTC) Cc: "'help-gnu-emacs@gnu.org'" Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17Is58-0007W8-00 for ; Fri, 14 Jun 2002 16:29:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17Irzj-0001N9-00; Fri, 14 Jun 2002 10:24:07 -0400 Original-Received: from ppp-62-10-92-99.dialup.tiscali.it ([62.10.92.99] helo=localhost.com) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17Irxz-0001IZ-00 for ; Fri, 14 Jun 2002 10:22:19 -0400 Original-Received: (from marco@localhost) by localhost.com (8.10.2/8.10.2) id g5EEL2b02537; Fri, 14 Jun 2002 16:21:02 +0200 (CEST) X-Authentication-Warning: localhost: marco set sender to e.baringer@studenti.to.it using -f Original-To: Douglas Lewan In-Reply-To: Original-Lines: 26 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.30 Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:472 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:472 Douglas Lewan writes: > Hi, > > Is there a hook that can be executed on switching buffers? > > I'd like to change colors based on the major release of the code that I'm > looking at, but that looks like it is frame-wide and that still wouldn't > necessarily remind me which version of a particular file I'm looking at. > to the best of my knowledge, no. however: (global-set-ket (kbd "C-xb") (lambda (buffer &optional norecor) (change-colors-based-on-new-buffer-contents-code buffer) (switch-to-buffer buffer norecord))) -- -Marco Ring the bells that still can ring. Forget the perfect offering. There's a crack in everything. It's how the light gets in. -Isonard Cohen