unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Nordlöw <per.nordlow@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Getting and Setting major-modes of buffers
Date: Thu, 17 Jan 2008 17:19:35 +0100	[thread overview]
Message-ID: <478F8017.30307@gmail.com> (raw)
In-Reply-To: <337c9c6b-3fb3-4208-bece-1d51c69a2ed4@v29g2000hsf.googlegroups.com>

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)))

      parent reply	other threads:[~2008-01-17 16:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-17 11:45 Getting and Setting major-modes of buffers Nordlöw
2008-01-17 12:39 ` Xah Lee
2008-01-17 16:19 ` Lennart Borgman (gmail) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478F8017.30307@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=per.nordlow@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).