From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Benoit G." Newsgroups: gmane.emacs.help Subject: R scratch buffer Date: Thu, 12 Jul 2012 08:48:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1342108213 6348 80.91.229.3 (12 Jul 2012 15:50:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 Jul 2012 15:50:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 12 17:50:13 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SpLee-0004IJ-Le for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Jul 2012 17:50:12 +0200 Original-Received: from localhost ([::1]:36219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpLed-0006xr-VF for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Jul 2012 11:50:11 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 194.254.175.14 Original-X-Trace: posting.google.com 1342108097 8669 127.0.0.1 (12 Jul 2012 15:48:17 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 12 Jul 2012 15:48:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=194.254.175.14; posting-account=lsrZwgoAAADDjpU1Q0FkITe-H25pPMZY User-Agent: G2/1.0 Original-Xref: usenet.stanford.edu gnu.emacs.help:193433 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85816 Archived-At: 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