blob: f4ac28efa662b20dc00ae8c4e43ad066cc1ed852 (
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
48
49
50
51
52
53
54
55
56
57
58
|
defadvice is obsolete in Emacs 30.
--- gnuserv-3.12.8/gnuserv-compat.el
+++ gnuserv-3.12.8/gnuserv-compat.el
@@ -112,38 +112,35 @@
;; can do! If the device doesn't represent a live frame, we create
;; the frame as requested.
- (defadvice make-frame (around
- gnuserv-compat-make-frame
- first
- (&optional parameters device)
- activate)
+ (defun gnuserv-compat-make-frame (orig-fun &optional parameters device)
(if (and device
(frame-live-p device))
(progn
(if parameters
(modify-frame-parameters device parameters))
- (setq ad-return-value device))
- ad-do-it))
+ device)
+ (funcall orig-fun parameters)))
+
+ (advice-add 'make-frame :around #'gnuserv-compat-make-frame)
;; 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)
+ (defun gnuserv-compat-delete-frame (&optional frame _force)
(run-hook-with-args 'delete-device-hook frame))
+ (advice-add 'delete-frame :before #'gnuserv-compat-delete-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.
- (defadvice filtered-frame-list (around
- gnuserv-compat-filtered-frame-list
- first
- (predicate &optional device)
- activate)
- ad-do-it))
+ (defun gnuserv-compat-filtered-frame-list (orig-fun predicate
+ &optional _device)
+ (funcall orig-fun predicate))
+
+ (advice-add 'filtered-frame-list
+ :around #'gnuserv-compat-filtered-frame-list)
+ )
;; Emulate XEmacs devices. A device is just a frame. For the most
|