From 0d86295cf4c4b0d49d5e08dadca95e1b1a78b062 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Tue, 9 Oct 2012 23:25:34 +0200 Subject: [PATCH] Set delete slot in ein:notification-setup --- lisp/ein-notebook.el | 4 +++- lisp/ein-notification.el | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/ein-notebook.el b/lisp/ein-notebook.el index 8412f9f..37554a8 100644 --- a/lisp/ein-notebook.el +++ b/lisp/ein-notebook.el @@ -512,7 +512,9 @@ This is equivalent to do ``C-c`` in the console program." #'ein:worksheet-name (lambda (ws) (ein:notebook-worksheet--render-maybe ein:%notebook% ws "clicked") - (ein:worksheet-buffer ws))) + (ein:worksheet-buffer ws)) + (lambda (ws) + (ein:notebook-worksheet-delete ein:%notebook% ws t))) (ein:notebook-setup-kill-buffer-hook) (ein:notebook-set-buffer-file-name-maybe notebook) (setq ein:%notebook% notebook))) diff --git a/lisp/ein-notification.el b/lisp/ein-notification.el index 807b0c8..754e39c 100644 --- a/lisp/ein-notification.el +++ b/lisp/ein-notification.el @@ -153,7 +153,7 @@ where NS is `:kernel' or `:notebook' slot of NOTIFICATION." packed))) (defun ein:notification-setup (buffer events get-list get-current get-name - get-buffer) + get-buffer delete) "Setup a new notification widget in the BUFFER. This function saves the new notification widget instance in the local variable of the BUFFER. @@ -171,6 +171,9 @@ GET-NAME : function GET-BUFFER : function Get a buffer of given worksheet. Render it if needed. + +DELETE : function + Remove a given worksheet. " (with-current-buffer buffer (setq ein:%notification% @@ -182,7 +185,8 @@ GET-BUFFER : function :get-list get-list :get-current get-current :get-name get-name - :get-buffer get-buffer)) + :get-buffer get-buffer + :delete delete)) ein:%notification%))