unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* R scratch buffer
@ 2012-07-12 15:48 Benoit G.
  2012-07-12 16:15 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 10+ messages in thread
From: Benoit G. @ 2012-07-12 15:48 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-07-13 12:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-12 15:48 R scratch buffer Benoit G.
2012-07-12 16:15 ` 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.

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