From: "Benoit G." <benoit.goussen@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: R scratch buffer
Date: Thu, 12 Jul 2012 08:48:16 -0700 (PDT) [thread overview]
Message-ID: <f85a87cc-be13-4707-afc3-ff5d5822de44@googlegroups.com> (raw)
Dear all,
I am trying to make a second scratch buffer which enable automatically the R-mode.
I copy-paste-modified a code I found on the www but this don't seems to work (the buffer is created but in fundmental mode).
Can you help me solving this issue?
Here is a part of my .emacs file :
(save-excursion
(set-buffer (get-buffer-create "*scratch-R*"))
(R-mode)
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'kill-scratch-R-buffer))
(defun kill-scratch-R-buffer ()
;; The next line is just in case someone calls this manually
(set-buffer (get-buffer-create "*scratch-R*"))
;; Kill the current (*scratch-R*) buffer
(remove-hook 'kill-buffer-query-functions 'kill-scratch-R-buffer)
(kill-buffer (current-buffer))
;; Make a brand new *scratch-R* buffer
(set-buffer (get-buffer-create "*scratch-R*"))
(R-mode)
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'kill-scratch-R-buffer)
;; Since we killed it, don't let caller do that.
nil)
Benoit
next reply other threads:[~2012-07-12 15:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 15:48 Benoit G. [this message]
2012-07-12 16:15 ` R scratch buffer Pascal J. Bourguignon
2012-07-13 7:52 ` Benoit G.
2012-07-13 7:56 ` Benoit G.
2012-07-13 8:31 ` Pascal J. Bourguignon
2012-07-13 9:22 ` Benoit G.
2012-07-13 10:12 ` Pascal J. Bourguignon
2012-07-13 12:18 ` Benoit G.
2012-07-13 12:32 ` Pascal J. Bourguignon
2012-07-13 12:46 ` Benoit G.
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=f85a87cc-be13-4707-afc3-ff5d5822de44@googlegroups.com \
--to=benoit.goussen@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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).