aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/dframe.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/dframe.el')
-rw-r--r--lisp/dframe.el42
1 files changed, 24 insertions, 18 deletions
diff --git a/lisp/dframe.el b/lisp/dframe.el
index 21b508512d3..66967075e34 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -1,4 +1,4 @@
1;;; dframe --- dedicate frame support modes 1;;; dframe --- dedicate frame support modes -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1996-2013 Free Software Foundation, Inc. 3;; Copyright (C) 1996-2013 Free Software Foundation, Inc.
4 4
@@ -259,9 +259,15 @@ This buffer will have `dframe-frame-mode' run on it.
259FRAME-NAME is the name of the frame to create. 259FRAME-NAME is the name of the frame to create.
260LOCAL-MODE-FN is the function used to call this one. 260LOCAL-MODE-FN is the function used to call this one.
261PARAMETERS are frame parameters to apply to this dframe. 261PARAMETERS are frame parameters to apply to this dframe.
262DELETE-HOOK are hooks to run when deleting a frame. 262DELETE-HOOK is a hook to run when deleting a frame.
263POPUP-HOOK are hooks to run before showing a frame. 263POPUP-HOOK is a hook to run before showing a frame.
264CREATE-HOOK are hooks to run after creating a frame." 264CREATE-HOOK is a hook to run after creating a frame."
265 (let ((conv-hook (lambda (val)
266 (let ((sym (make-symbol "hook")))
267 (set sym val) sym))))
268 (if (consp delete-hook) (setq delete-hook (funcall conv-hook delete-hook)))
269 (if (consp create-hook) (setq create-hook (funcall conv-hook create-hook)))
270 (if (consp popup-hook) (setq popup-hook (funcall conv-hook popup-hook))))
265 ;; toggle frame on and off. 271 ;; toggle frame on and off.
266 (if (not arg) (if (dframe-live-p (symbol-value frame-var)) 272 (if (not arg) (if (dframe-live-p (symbol-value frame-var))
267 (setq arg -1) (setq arg 1))) 273 (setq arg -1) (setq arg 1)))
@@ -270,7 +276,7 @@ CREATE-HOOK are hooks to run after creating a frame."
270 ;; turn the frame off on neg number 276 ;; turn the frame off on neg number
271 (if (and (numberp arg) (< arg 0)) 277 (if (and (numberp arg) (< arg 0))
272 (progn 278 (progn
273 (run-hooks 'delete-hook) 279 (run-hooks delete-hook)
274 (if (and (symbol-value frame-var) 280 (if (and (symbol-value frame-var)
275 (frame-live-p (symbol-value frame-var))) 281 (frame-live-p (symbol-value frame-var)))
276 (progn 282 (progn
@@ -279,7 +285,7 @@ CREATE-HOOK are hooks to run after creating a frame."
279 (set frame-var nil)) 285 (set frame-var nil))
280 ;; Set this as our currently attached frame 286 ;; Set this as our currently attached frame
281 (setq dframe-attached-frame (selected-frame)) 287 (setq dframe-attached-frame (selected-frame))
282 (run-hooks 'popup-hook) 288 (run-hooks popup-hook)
283 ;; Updated the buffer passed in to contain all the hacks needed 289 ;; Updated the buffer passed in to contain all the hacks needed
284 ;; to make it work well in a dedicated window. 290 ;; to make it work well in a dedicated window.
285 (with-current-buffer (symbol-value buffer-var) 291 (with-current-buffer (symbol-value buffer-var)
@@ -331,15 +337,15 @@ CREATE-HOOK are hooks to run after creating a frame."
331 (setq temp-buffer-show-function 'dframe-temp-buffer-show-function) 337 (setq temp-buffer-show-function 'dframe-temp-buffer-show-function)
332 ;; If this buffer is killed, we must make sure that we destroy 338 ;; If this buffer is killed, we must make sure that we destroy
333 ;; the frame the dedicated window is in. 339 ;; the frame the dedicated window is in.
334 (add-hook 'kill-buffer-hook `(lambda () 340 (add-hook 'kill-buffer-hook (lambda ()
335 (let ((skilling (boundp 'skilling))) 341 (let ((skilling (boundp 'skilling)))
336 (if skilling 342 (if skilling
337 nil 343 nil
338 (if dframe-controlled 344 (if dframe-controlled
339 (progn 345 (progn
340 (funcall dframe-controlled -1) 346 (funcall dframe-controlled -1)
341 (setq ,buffer-var nil) 347 (set buffer-var nil)
342 ))))) 348 )))))
343 t t) 349 t t)
344 ) 350 )
345 ;; Get the frame to work in 351 ;; Get the frame to work in
@@ -396,7 +402,7 @@ CREATE-HOOK are hooks to run after creating a frame."
396 (switch-to-buffer (symbol-value buffer-var)) 402 (switch-to-buffer (symbol-value buffer-var))
397 (set-window-dedicated-p (selected-window) t)) 403 (set-window-dedicated-p (selected-window) t))
398 ;; Run hooks (like reposition) 404 ;; Run hooks (like reposition)
399 (run-hooks 'create-hook) 405 (run-hooks create-hook)
400 ;; Frame name 406 ;; Frame name
401 (if (and (or (null window-system) (eq window-system 'pc)) 407 (if (and (or (null window-system) (eq window-system 'pc))
402 (fboundp 'set-frame-name)) 408 (fboundp 'set-frame-name))
@@ -602,7 +608,7 @@ Argument E is the event deleting the frame."
602If the selected frame is not in the symbol FRAME-VAR, then FRAME-VAR 608If the selected frame is not in the symbol FRAME-VAR, then FRAME-VAR
603frame is selected. If the FRAME-VAR is active, then select the 609frame is selected. If the FRAME-VAR is active, then select the
604attached frame. If FRAME-VAR is nil, ACTIVATOR is called to 610attached frame. If FRAME-VAR is nil, ACTIVATOR is called to
605created it. HOOK is an optional argument of hooks to run when 611created it. HOOK is an optional hook to run when
606selecting FRAME-VAR." 612selecting FRAME-VAR."
607 (interactive) 613 (interactive)
608 (if (eq (selected-frame) (symbol-value frame-var)) 614 (if (eq (selected-frame) (symbol-value frame-var))
@@ -616,7 +622,7 @@ selecting FRAME-VAR."
616 ) 622 )
617 (other-frame 0) 623 (other-frame 0)
618 ;; If updates are off, then refresh the frame (they want it now...) 624 ;; If updates are off, then refresh the frame (they want it now...)
619 (run-hooks 'hook)) 625 (run-hooks hook))
620 626
621 627
622(defun dframe-close-frame () 628(defun dframe-close-frame ()