summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch')
-rw-r--r--app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch27
1 files changed, 22 insertions, 5 deletions
diff --git a/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch
index 0c509a7cd842..faab53e6da1e 100644
--- a/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch
+++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch
@@ -2,9 +2,29 @@ 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.
+Define delete-device-hook as an alias of delete-frame-functions, so we
+need no advice for delete-frame.
+
--- gnuserv-3.12.8/gnuserv-compat.el
+++ gnuserv-3.12.8/gnuserv-compat.el
-@@ -153,9 +153,39 @@
+@@ -125,16 +125,6 @@
+ (setq ad-return-value device))
+ ad-do-it))
+
+- ;; Advise `delete-frame' to run `delete-device-hook'. This might be a
+- ;; little too hacky, but it seems to work! If someone actually tries
+- ;; to do something device specific then it will probably blow up!
+- (defadvice delete-frame (before
+- gnuserv-compat-delete-frame
+- first
+- nil
+- activate)
+- (run-hook-with-args 'delete-device-hook frame))
+-
+ ;; Advise `filtered-frame-list' to ignore the optional device
+ ;; argument. Here we don't follow the mapping of devices to frames.
+ ;; We just assume that any frame satisfying the predicate will do.
+@@ -153,9 +143,36 @@
(if (string-match "XEmacs" (emacs-version))
nil
@@ -14,6 +34,7 @@ we need, and drop devices.el altogether.
+ (defalias 'device-live-p 'frame-live-p)
+ (defalias 'frame-device 'identity)
+ (defalias 'make-tty-device 'ignore)
++ (defvaralias 'delete-device-hook 'delete-frame-functions)
+
+ (defun make-x-device (&optional display)
+ (if display
@@ -26,10 +47,6 @@ we need, and drop devices.el altogether.
+ 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