From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: Getting and Setting major-modes of buffers Date: Thu, 17 Jan 2008 17:19:35 +0100 Message-ID: <478F8017.30307@gmail.com> References: <337c9c6b-3fb3-4208-bece-1d51c69a2ed4@v29g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1200586820 21295 80.91.229.12 (17 Jan 2008 16:20:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Jan 2008 16:20:20 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?ISO-8859-1?Q?Nordl=F6w?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 17 17:20:38 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JFXTh-0001GS-J5 for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Jan 2008 17:20:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JFXTI-0007wX-O6 for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Jan 2008 11:20:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JFXT2-0007wH-Ab for help-gnu-emacs@gnu.org; Thu, 17 Jan 2008 11:19:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JFXT0-0007vd-Os for help-gnu-emacs@gnu.org; Thu, 17 Jan 2008 11:19:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JFXT0-0007vZ-Ke for help-gnu-emacs@gnu.org; Thu, 17 Jan 2008 11:19:46 -0500 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JFXSz-0005v8-Mx for help-gnu-emacs@gnu.org; Thu, 17 Jan 2008 11:19:46 -0500 Original-Received: from c83-254-148-228.bredband.comhem.se ([83.254.148.228]:62855 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1JFXSy-0005gH-3G; Thu, 17 Jan 2008 17:19:44 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <337c9c6b-3fb3-4208-bece-1d51c69a2ed4@v29g2000hsf.googlegroups.com> X-Antivirus: avast! (VPS 080116-1, 2008-01-16), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.148.228 X-Scan-Result: No virus found in message 1JFXSy-0005gH-3G. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1JFXSy-0005gH-3G 07f6c8c85cb53fbdcf464be37fe7ff46 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:50780 Archived-At: Nordlöw wrote: > Hi! > > How do I determine the major-mode of a buffer (not necessarily the > current) and make another buffer enter that same mode? > > Thanks in advance, > Nordlöw (defun set-same-major-mode-as (buffer) (interactive "bSet same major mode as buffer: ") (let ((major (with-current-buffer buffer major-mode))) (funcall major)))