]> code.delx.au - gnu-emacs/blobdiff - lisp/mouse.el
* isearch.el (isearch-frames-exist): This isn't what we want -
[gnu-emacs] / lisp / mouse.el
index 71c4cf8328cebda7caf4176162f8975a47967729..4c1908b220b77725a64cd0a50454832298fadcab 100644 (file)
@@ -84,6 +84,16 @@ This must be bound to a mouse click."
   (interactive "e")
   (delete-window (posn-window (event-start click))))
 
+(defun mouse-tear-off-window (click)
+  "Delete the window clicked on, and create a new frame displaying its buffer."
+  (interactive "e")
+  (let* ((window (posn-window (event-start click)))
+        (buf (window-buffer window))
+        (frame (new-frame)))
+    (select-frame frame)
+    (switch-to-buffer buf)
+    (delete-window window)))
+
 (defun mouse-delete-other-windows ()
   "Delete all window except the one you click on."
   (interactive "@")