summaryrefslogtreecommitdiff
path: root/app-emacs/gnuserv/files/gnuserv-3.12.8-emacs-29.patch
blob: 7b9c8d05cb0790d98d37838f68b251810c761daf (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Fix collision of function device-class in Emacs 29.
Fix some byte-compiler warnings.

--- gnuserv-3.12.8/devices.el
+++ gnuserv-3.12.8/devices.el
@@ -32,13 +32,7 @@
 ;; determine the connection to an X display, etc.
 
 (require 'cl-macs)
-(eval-when-compile
-  (if (string-match "XEmacs" (emacs-version))
-      (set 'byte-optimize nil)))
     
-(if (string-match "XEmacs" (emacs-version))
-    nil
-'()
 (defalias 'selected-device 'ignore)
 (defalias 'device-or-frame-p 'framep)
 (defalias 'device-console 'ignore)
@@ -219,6 +213,10 @@
       (delete-frame (car frames) force)
       (setq frames (cdr frames)))))
 
+;; Apparently none of the functions below are used, and device-class
+;; collides with a function of the same name in frame.el of Emacs 29.
+'(
+
 (defun device-color-cells (&optional device)
   (cl-case window-system
     ((x win32 w32 pm) (x-display-color-cells device))
@@ -333,10 +331,6 @@
   "Given a TYPE, return t if it is valid."
   (memq type (device-type-list)))
 
-) ; This closes the conditional on whether we are in XEmacs or not
+)
 
 (provide 'devices)
-
-(eval-when-compile
-  (if (string-match "XEmacs" (emacs-version))
-      (set 'byte-optimize t)))
--- gnuserv-3.12.8/gnuserv-compat.el
+++ gnuserv-3.12.8/gnuserv-compat.el
@@ -100,8 +100,8 @@
 ;; `delete-frame' and `filtered-frame-list' to handle some device
 ;; stuff.
 
-(if (string-match "XEmacs" (emacs-version))
-    nil
+;;(if (string-match "XEmacs" (emacs-version))
+;;    nil
   
   ;; XEmacs `make-frame' takes an optional device to create the frame
   ;; on.  Since `make-device' just calls 'make-frame', we don't want
@@ -143,15 +143,16 @@
 				  first
 				  (predicate &optional device)
 				  activate)
-    ad-do-it))
+    ad-do-it)
+;;  )
 
 
 ;; Emulate XEmacs devices.  A device is just a frame. For the most
 ;; part we use devices.el from the Emacs-W3 distribution.  In some
 ;; places the implementation seems wrong, so we "fix" it!
 
-(if (string-match "XEmacs" (emacs-version))
-    nil
+;;(if (string-match "XEmacs" (emacs-version))
+;;    nil
 
   (require 'devices)
   (defalias 'device-list 'frame-list)
@@ -160,7 +161,8 @@
     (list
      (if device
 	device
-       (selected-frame)))))
+       (selected-frame))))
+;;  )
   
 
 
--- gnuserv-3.12.8/gnuserv.el
+++ gnuserv-3.12.8/gnuserv.el
@@ -455,13 +455,14 @@
 		       gnuserv-view-file-function
 		     gnuserv-find-file-function)
 		   path)
-	  (goto-line line)
+	  (goto-char (point-min))
+	  (forward-line (1- line))
 	  ;; Don't memorize the quick and view buffers.
 	  (unless (or quick view)
 	    (cl-pushnew (current-buffer) (gnuclient-buffers client))
 	    (setq gnuserv-minor-mode t)
 	    ;; Add the "Done" button to the menubar, only in this buffer.
-	    (if (and (featurep 'menubar) current-menubar)
+	    (if (and (eval-when-compile (featurep 'menubar)) current-menubar)
 	      (progn (set-buffer-menubar current-menubar)
 	      (add-menu-button nil ["Done" gnuserv-edit]))
 	      ))
@@ -616,12 +617,11 @@
     (when (null (gnuclient-buffers client))
       (gnuserv-kill-client client)))
   ;; Get rid of the buffer.
-  (save-excursion
-    (set-buffer buffer)
+  (with-current-buffer buffer
     (run-hooks 'gnuserv-done-hook)
     (setq gnuserv-minor-mode nil)
     ;; Delete the menu button.
-    (if (and (featurep 'menubar) current-menubar)
+    (if (and (eval-when-compile (featurep 'menubar)) current-menubar)
       (delete-menu-item '("Done")))
     (funcall (if (gnuserv-temp-file-p buffer)
 		 gnuserv-done-temp-file-function
@@ -685,7 +685,6 @@
 ;; This serves to run the hook and reset
 ;; `allow-deletion-of-last-visible-frame'.
 (defun gnuserv-prepare-shutdown ()
-  (setq allow-deletion-of-last-visible-frame nil)
   (run-hooks 'gnuserv-shutdown-hook))
 
 ;; This is a user-callable function, too.
@@ -716,7 +715,6 @@
     (set-process-sentinel gnuserv-process 'gnuserv-sentinel)
     (set-process-filter gnuserv-process 'gnuserv-process-filter)
     (set-process-query-on-exit-flag gnuserv-process nil)
-    (setq allow-deletion-of-last-visible-frame t)
     (run-hooks 'gnuserv-init-hook)))