summaryrefslogtreecommitdiff
path: root/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch
blob: 0c509a7cd8427210b68da0effe06636aea9b1cc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Function device-class from devices.el is not used, but collides with
a function of the same name in frame.el of Emacs 29. So, inline what
we need, and drop devices.el altogether.

--- gnuserv-3.12.8/gnuserv-compat.el
+++ gnuserv-3.12.8/gnuserv-compat.el
@@ -153,9 +153,39 @@
 (if (string-match "XEmacs" (emacs-version))
     nil
 
-  (require 'devices)
   (defalias 'device-list 'frame-list)
   (defalias 'selected-device 'selected-frame)
+  (defalias 'device-live-p 'frame-live-p)
+  (defalias 'frame-device 'identity)
+  (defalias 'make-tty-device 'ignore)
+
+  (defun make-x-device (&optional display)
+    (if display
+	(make-frame-on-display display)
+      (make-frame)))
+
+  (defun device-on-window-system-p (&optional device)
+    "Return non-nil if DEVICE is on a window system.
+  This generally means that there is support for the mouse, the menubar,
+  the toolbar, glyphs, etc."
+    (and (cdr-safe (assq 'display (frame-parameters device))) t))
+
+  (defvar delete-device-hook nil
+    "Function or functions to call when a device is deleted.
+  One argument, the to-be-deleted device.")
+
+  (defun delete-device (device &optional force)
+    "Delete DEVICE, permanently eliminating it from use.
+  Normally, you cannot delete the last non-minibuffer-only frame (you must
+  use `save-buffers-kill-emacs' or `kill-emacs').  However, if optional
+  second argument FORCE is non-nil, you can delete the last frame. (This
+  will automatically call `save-buffers-kill-emacs'.)"
+    (let ((frames (device-frame-list device)))
+      (run-hook-with-args 'delete-device-hook device)
+      (while frames
+	(delete-frame (car frames) force)
+	(setq frames (cdr frames)))))
+
   (defun device-frame-list (&optional device)
     (list
      (if device