diff options
Diffstat (limited to 'app-emacs/gnuserv')
-rw-r--r-- | app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch | 45 | ||||
-rw-r--r-- | app-emacs/gnuserv/files/gnuserv-3.12.8-backquotes.patch | 16 | ||||
-rw-r--r-- | app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch | 189 | ||||
-rw-r--r-- | app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch | 64 | ||||
-rw-r--r-- | app-emacs/gnuserv/files/gnuserv-3.12.8-no-custom.patch | 31 | ||||
-rw-r--r-- | app-emacs/gnuserv/files/gnuserv-3.12.8-warnings.patch | 72 | ||||
-rw-r--r-- | app-emacs/gnuserv/gnuserv-3.12.8-r8.ebuild (renamed from app-emacs/gnuserv/gnuserv-3.12.8-r5.ebuild) | 28 |
7 files changed, 418 insertions, 27 deletions
diff --git a/app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch new file mode 100644 index 000000000000..90d4938751e2 --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch @@ -0,0 +1,45 @@ +defadvice is obsolete in Emacs 30. + +--- gnuserv-3.12.8/gnuserv-compat.el ++++ gnuserv-3.12.8/gnuserv-compat.el +@@ -112,28 +112,27 @@ + ;; 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 `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 diff --git a/app-emacs/gnuserv/files/gnuserv-3.12.8-backquotes.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-backquotes.patch deleted file mode 100644 index fa31ac2e4017..000000000000 --- a/app-emacs/gnuserv/files/gnuserv-3.12.8-backquotes.patch +++ /dev/null @@ -1,16 +0,0 @@ -Use new-style backquotes, to make it compile with Emacs 27. - ---- gnuserv-3.12.8-orig/gnuserv-compat.el -+++ gnuserv-3.12.8/gnuserv-compat.el -@@ -193,9 +193,9 @@ - (defmacro defgroup (&rest args) - nil) - (defmacro defcustom (var value doc &rest args) -- (` (defvar (, var) (, value) (, doc)))) -+ `(defvar ,var ,value ,doc)) - (defmacro defface (var value doc &rest args) -- (` (make-face (, var)))) -+ `(make-face ,var)) - (defmacro define-widget (&rest args) - nil))) - diff --git a/app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch new file mode 100644 index 000000000000..cf5c062fdab1 --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch @@ -0,0 +1,189 @@ +Most Common Lisp macros want a cl- prefix in Emacs 27 and later + +--- gnuserv-3.12.8/gnuserv-compat.el ++++ gnuserv-3.12.8/gnuserv-compat.el +@@ -49,7 +49,7 @@ + ;; 20.3. Also, XEmacs preloads the common lisp stuff, and we might as + ;; well use it here. + +-(require 'cl) ++(require 'cl-macs) + + (eval-and-compile + (unless (fboundp 'define-obsolete-variable-alias) +@@ -66,7 +66,7 @@ + (unless (fboundp 'add-minor-mode) + (defun add-minor-mode (toggle name) + "Register a new minor mode." +- (pushnew (list toggle name) ++ (cl-pushnew (list toggle name) + minor-mode-alist + :test 'equal))) + +--- gnuserv-3.12.8/gnuserv.el ++++ gnuserv-3.12.8/gnuserv.el +@@ -83,6 +83,8 @@ + + ;;; Code: + ++(require 'cl-macs) ++ + (defgroup gnuserv nil + "The gnuserv suite of programs to talk to Emacs from outside." + :group 'environment +@@ -203,7 +205,7 @@ + + ;;; Internal variables: + +-(defstruct gnuclient ++(cl-defstruct gnuclient + "An object that encompasses several buffers in one. + Normally, a client connecting to Emacs will be assigned an id, and + will request editing of several files. +@@ -289,7 +291,7 @@ + (defun gnuserv-sentinel (proc msg) + (let ((msgstring (concat "Gnuserv process %s; restart with `%s'")) + (keystring (substitute-command-keys "\\[gnuserv-start]"))) +- (case (process-status proc) ++ (cl-case (process-status proc) + (exit + (message msgstring "exited" keystring) + (gnuserv-prepare-shutdown)) +@@ -403,7 +405,7 @@ + If a flag is `view', view the files read-only." + (let (quick view) + (mapc (lambda (flag) +- (case flag ++ (cl-case flag + (quick (setq quick t)) + (view (setq view t)) + (t (error "Invalid flag %s" flag)))) +@@ -419,7 +421,7 @@ + (device (cond ((frame-live-p dest-frame) + (frame-device dest-frame)) + ((null dest-frame) +- (case (car type) ++ (cl-case (car type) + (tty (apply 'make-tty-device (cdr type))) + (gtk (make-gtk-device)) + (x (make-x-device-with-gtk-fallback (cadr type))) +@@ -456,7 +458,7 @@ + (goto-line line) + ;; Don't memorize the quick and view buffers. + (unless (or quick view) +- (pushnew (current-buffer) (gnuclient-buffers client)) ++ (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) +@@ -510,9 +512,9 @@ + ;; Like `gnuserv-buffer-clients', but returns a boolean; doesn't + ;; collect a list. + (defun gnuserv-buffer-p (buffer) +- (member* buffer gnuserv-clients +- :test 'memq +- :key 'gnuclient-buffers)) ++ (cl-member buffer gnuserv-clients ++ :test 'memq ++ :key 'gnuclient-buffers)) + + ;; This function makes sure that a killed buffer is deleted off the + ;; list for the particular client. +@@ -525,7 +527,7 @@ + editing has ended." + (let* ((buf (current-buffer))) + (dolist (client (gnuserv-buffer-clients buf)) +- (callf2 delq buf (gnuclient-buffers client)) ++ (cl-callf2 delq buf (gnuclient-buffers client)) + ;; If no more buffers, kill the client. + (when (null (gnuclient-buffers client)) + (gnuserv-kill-client client))))) +@@ -546,7 +548,7 @@ + + (defun gnuserv-kill-emacs-query-function () + (or gnuserv-kill-quietly +- (not (some 'gnuclient-buffers gnuserv-clients)) ++ (not (cl-some 'gnuclient-buffers gnuserv-clients)) + (yes-or-no-p "Gnuserv buffers still have clients; exit anyway? "))) + + (add-hook 'kill-emacs-query-functions +@@ -562,7 +564,7 @@ + ;; killing the device, because it would cause a device-dead + ;; error when `delete-device' tries to do the job later. + (gnuserv-kill-client client t)))) +- (callf2 delq device gnuserv-devices)) ++ (cl-callf2 delq device gnuserv-devices)) + + (add-hook 'delete-device-hook 'gnuserv-check-device) + +@@ -582,7 +584,7 @@ + the function will not remove the frames associated with the client." + ;; Order is important: first delete client from gnuserv-clients, to + ;; prevent gnuserv-buffer-done-1 calling us recursively. +- (callf2 delq client gnuserv-clients) ++ (cl-callf2 delq client gnuserv-clients) + ;; Process the buffers. + (mapc 'gnuserv-buffer-done-1 (gnuclient-buffers client)) + (unless leave-frame +@@ -593,15 +595,15 @@ + ;; note: last frame on a device will not be deleted here. + (when (and (gnuclient-frame client) + (frame-live-p (gnuclient-frame client)) +- (second (device-frame-list device))) ++ (cl-second (device-frame-list device))) + (delete-frame (gnuclient-frame client))) + ;; If the device is live, created by a client, and no longer used + ;; by any client, delete it. + (when (and (device-live-p device) + (memq device gnuserv-devices) +- (second (device-list)) +- (not (member* device gnuserv-clients +- :key 'gnuclient-device))) ++ (cl-second (device-list)) ++ (not (cl-member device gnuserv-clients ++ :key 'gnuclient-device))) + ;; `gnuserv-check-device' will remove it from `gnuserv-devices'. + (delete-device device)))) + ;; Notify the client. +@@ -610,7 +612,7 @@ + ;; Do away with the buffer. + (defun gnuserv-buffer-done-1 (buffer) + (dolist (client (gnuserv-buffer-clients buffer)) +- (callf2 delq buffer (gnuclient-buffers client)) ++ (cl-callf2 delq buffer (gnuclient-buffers client)) + (when (null (gnuclient-buffers client)) + (gnuserv-kill-client client))) + ;; Get rid of the buffer. +@@ -639,19 +641,19 @@ + ;; If we have a client belonging to this frame, return + ;; the first buffer from it. + ((setq client +- (car (member* frame gnuserv-clients :key 'gnuclient-frame))) ++ (car (cl-member frame gnuserv-clients :key 'gnuclient-frame))) + (car (gnuclient-buffers client))) + ;; Else, look for a device. + ((and + (memq (selected-device) gnuserv-devices) + (setq client +- (car (member* device gnuserv-clients :key 'gnuclient-device)))) ++ (car (cl-member device gnuserv-clients :key 'gnuclient-device)))) + (car (gnuclient-buffers client))) + ;; Else, try to find any client with at least one buffer, and + ;; return its first buffer. + ((setq client +- (car (member-if-not #'null gnuserv-clients +- :key 'gnuclient-buffers))) ++ (car (cl-member-if-not #'null gnuserv-clients ++ :key 'gnuclient-buffers))) + (car (gnuclient-buffers client))) + ;; Oh, give up. + (t nil)))) +@@ -759,7 +761,7 @@ + (when (null count) + (setq count 1)) + (cond ((numberp count) +- (while (natnump (decf count)) ++ (while (natnump (cl-decf count)) + (let ((frame (selected-frame))) + (gnuserv-buffer-done (current-buffer)) + (when (eq frame (selected-frame)) diff --git a/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch new file mode 100644 index 000000000000..3d0e9f876292 --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch @@ -0,0 +1,64 @@ +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 +@@ -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 + +- (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) ++ (defvaralias 'delete-device-hook 'delete-frame-functions) ++ ++ (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)) ++ ++ (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 diff --git a/app-emacs/gnuserv/files/gnuserv-3.12.8-no-custom.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-no-custom.patch new file mode 100644 index 000000000000..12cd31c16c0e --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-no-custom.patch @@ -0,0 +1,31 @@ +Old-style backquotes don't work with Emacs 27 or later. Remove the +code altogether, because it is no longer needed since Emacs 20.1. + +--- gnuserv-3.12.8/gnuserv-compat.el ++++ gnuserv-3.12.8/gnuserv-compat.el +@@ -180,25 +180,6 @@ + (defun frame-totally-visible-p (frame) + (eq t (frame-visible-p frame)))) + +-;; Make custom stuff work even without customize +-;; Courtesy of Hrvoje Niksic <hniksic@srce.hr> +-;; via Ronan Waide <waider@scope.ie>. +-(eval-and-compile +- (condition-case () +- (require 'custom) +- (error nil)) +- (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) +- nil ;; We've got what we needed +- ;; We have the old custom-library, hack around it! +- (defmacro defgroup (&rest args) +- nil) +- (defmacro defcustom (var value doc &rest args) +- (` (defvar (, var) (, value) (, doc)))) +- (defmacro defface (var value doc &rest args) +- (` (make-face (, var)))) +- (defmacro define-widget (&rest args) +- nil))) +- + ;; Now for gnuserv... + (require 'gnuserv) + diff --git a/app-emacs/gnuserv/files/gnuserv-3.12.8-warnings.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-warnings.patch new file mode 100644 index 000000000000..5310f357621f --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-warnings.patch @@ -0,0 +1,72 @@ +Fix some byte-compiler warnings + +--- gnuserv-3.12.8/gnuserv-compat.el ++++ gnuserv-3.12.8/gnuserv-compat.el +@@ -100,7 +100,7 @@ + ;; `delete-frame' and `filtered-frame-list' to handle some device + ;; stuff. + +-(if (string-match "XEmacs" (emacs-version)) ++(if (featurep 'xemacs) + nil + + ;; XEmacs `make-frame' takes an optional device to create the frame +@@ -140,7 +140,7 @@ + ;; 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)) ++(if (featurep 'xemacs) + nil + + (defalias 'device-list 'frame-list) +--- 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))) + + diff --git a/app-emacs/gnuserv/gnuserv-3.12.8-r5.ebuild b/app-emacs/gnuserv/gnuserv-3.12.8-r8.ebuild index 8c147acf559b..d4299f3b51c1 100644 --- a/app-emacs/gnuserv/gnuserv-3.12.8-r5.ebuild +++ b/app-emacs/gnuserv/gnuserv-3.12.8-r8.ebuild @@ -1,7 +1,7 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 inherit elisp desktop xdg-utils @@ -13,29 +13,35 @@ SRC_URI="https://web.archive.org/web/20150908031821/http://martin.meltin.net/sit LICENSE="GPL-2+" SLOT="0" KEYWORDS="amd64 ~ppc x86 ~x86-linux ~ppc-macos" -IUSE="X" +IUSE="gui" RDEPEND=">=app-eselect/eselect-emacs-1.15 - X? ( x11-libs/libXau )" + gui? ( x11-libs/libXau )" DEPEND="${RDEPEND} - X? ( x11-base/xorg-proto )" + gui? ( x11-base/xorg-proto )" PATCHES=( - "${FILESDIR}"/${P}-backquotes.patch + "${FILESDIR}"/${P}-no-custom.patch "${FILESDIR}"/${P}-process-query.patch "${FILESDIR}"/${P}-gnudoit.patch "${FILESDIR}"/${P}-emacs-28.patch + "${FILESDIR}"/${P}-devices.patch + "${FILESDIR}"/${P}-cl.patch + "${FILESDIR}"/${P}-warnings.patch + "${FILESDIR}"/${P}-advice.patch ) +ELISP_REMOVE="devices.el" SITEFILE="50${PN}-gentoo.el" src_configure() { - econf $(use_enable X xauth) \ + econf $(use_enable gui xauth) \ --x-includes="${EPREFIX}"/usr/include \ --x-libraries="${EPREFIX}"/usr/$(get_libdir) } src_compile() { - default + emake gnuserv gnuclient + BYTECOMPFLAGS+=" -l gnuserv-compat" elisp-compile *.el } src_install() { @@ -53,17 +59,17 @@ src_install() { elisp-site-file-install "${FILESDIR}/${SITEFILE}" dodoc ChangeLog README README.orig - use X && domenu "${FILESDIR}"/gnuclient.desktop + use gui && domenu "${FILESDIR}"/gnuclient.desktop } pkg_postinst() { elisp-site-regen - use X && xdg_desktop_database_update + use gui && xdg_desktop_database_update eselect gnuclient update ifunset } pkg_postrm() { elisp-site-regen - use X && xdg_desktop_database_update + use gui && xdg_desktop_database_update eselect gnuclient update ifunset } |