help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

R scratch buffer


From: Benoit G.
Subject: R scratch buffer
Date: Thu, 12 Jul 2012 08:48:16 -0700 (PDT)
User-agent: G2/1.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]