From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B982F158089 for ; Mon, 9 Oct 2023 20:01:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F3C2C2BC016; Mon, 9 Oct 2023 20:01:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A91802BC016 for ; Mon, 9 Oct 2023 20:01:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 75A37335C39 for ; Mon, 9 Oct 2023 20:01:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DA3E299B for ; Mon, 9 Oct 2023 20:01:12 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1696881633.09b9d6c50ba1f3349c70a0c45b848cb78c7f292b.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-emacs/gnuserv/, app-emacs/gnuserv/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch app-emacs/gnuserv/files/gnuserv-3.12.8-emacs-29.patch app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild X-VCS-Directories: app-emacs/gnuserv/files/ app-emacs/gnuserv/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 09b9d6c50ba1f3349c70a0c45b848cb78c7f292b X-VCS-Branch: master Date: Mon, 9 Oct 2023 20:01:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 296302cb-0b64-4f14-aa89-a3baf2d52650 X-Archives-Hash: e9c0fe2d524f58c9643cbc8e40f8ce13 commit: 09b9d6c50ba1f3349c70a0c45b848cb78c7f292b Author: Ulrich Müller gentoo org> AuthorDate: Mon Oct 9 19:52:02 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Mon Oct 9 20:00:33 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09b9d6c5 app-emacs/gnuserv: Fix some warnings with newer Emacs versions Replace "X" flag by "gui". Update ebuild to EAPI 8. Signed-off-by: Ulrich Müller gentoo.org> .../gnuserv/files/gnuserv-3.12.8-advice.patch | 57 +++++ app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch | 251 +++++++++++++++++++++ .../gnuserv/files/gnuserv-3.12.8-emacs-29.patch | 135 +++++++++++ app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild | 73 ++++++ 4 files changed, 516 insertions(+) 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..e5f1cb9248f9 --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch @@ -0,0 +1,57 @@ +defadvice is obsolete in Emacs 30. + +--- gnuserv-3.12.8/gnuserv-compat.el ++++ gnuserv-3.12.8/gnuserv-compat.el +@@ -112,38 +112,34 @@ + ;; 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) + ;; ) + + 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..df5d1098ce5e --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch @@ -0,0 +1,251 @@ +Most Common Lisp macros want a cl- prefix in Emacs 27 and later + +--- gnuserv-3.12.8/devices.el ++++ gnuserv-3.12.8/devices.el +@@ -31,7 +31,7 @@ + ;; XEmacs 19.14. A 'device' for Emacs 19 is just a frame, from which we can + ;; determine the connection to an X display, etc. + +-(require 'cl) ++(require 'cl-macs) + (eval-when-compile + (if (string-match "XEmacs" (emacs-version)) + (set 'byte-optimize nil))) +@@ -220,43 +220,43 @@ + (setq frames (cdr frames))))) + + (defun device-color-cells (&optional device) +- (case window-system ++ (cl-case window-system + ((x win32 w32 pm) (x-display-color-cells device)) + (ns (ns-display-color-cells device)) + (otherwise 1))) + + (defun device-pixel-width (&optional device) +- (case window-system ++ (cl-case window-system + ((x win32 w32 pm) (x-display-pixel-width device)) + (ns (ns-display-pixel-width device)) + (otherwise (frame-width device)))) + + (defun device-pixel-height (&optional device) +- (case window-system ++ (cl-case window-system + ((x win32 w32 pm) (x-display-pixel-height device)) + (ns (ns-display-pixel-height device)) + (otherwise (frame-height device)))) + + (defun device-mm-width (&optional device) +- (case window-system ++ (cl-case window-system + ((x win32 w32 pm) (x-display-mm-width device)) + (ns (ns-display-mm-width device)) + (otherwise nil))) + + (defun device-mm-height (&optional device) +- (case window-system ++ (cl-case window-system + ((x win32 w32 pm) (x-display-mm-height device)) + (ns (ns-display-mm-height device)) + (otherwise nil))) + + (defun device-bitplanes (&optional device) +- (case window-system ++ (cl-case window-system + ((x win32 w32 pm) (x-display-planes device)) + (ns (ns-display-planes device)) + (otherwise 2))) + + (defun device-class (&optional device) +- (case window-system ++ (cl-case window-system + (x ; X11 + (cond + ((fboundp 'x-display-visual-class) +--- 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-emacs-29.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-emacs-29.patch new file mode 100644 index 000000000000..7b9c8d05cb07 --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-emacs-29.patch @@ -0,0 +1,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))) + + diff --git a/app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild b/app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild new file mode 100644 index 000000000000..644039c6feeb --- /dev/null +++ b/app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit elisp desktop xdg-utils + +DESCRIPTION="Attach to an already running Emacs" +HOMEPAGE="https://web.archive.org/web/20160508134736/http://martin.meltin.net/hacks/emacs/ + https://www.emacswiki.org/emacs/GnuClient" +SRC_URI="https://web.archive.org/web/20150908031821/http://martin.meltin.net/sites/martin.meltin.net/files/hacks/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~x86-linux ~ppc-macos" +IUSE="gui" + +RDEPEND=">=app-eselect/eselect-emacs-1.15 + gui? ( x11-libs/libXau )" +DEPEND="${RDEPEND} + gui? ( x11-base/xorg-proto )" + +PATCHES=( + "${FILESDIR}"/${P}-backquotes.patch + "${FILESDIR}"/${P}-process-query.patch + "${FILESDIR}"/${P}-gnudoit.patch + "${FILESDIR}"/${P}-emacs-28.patch + "${FILESDIR}"/${P}-cl.patch + "${FILESDIR}"/${P}-emacs-29.patch + "${FILESDIR}"/${P}-advice.patch +) +SITEFILE="50${PN}-gentoo.el" + +src_configure() { + econf $(use_enable gui xauth) \ + --x-includes="${EPREFIX}"/usr/include \ + --x-libraries="${EPREFIX}"/usr/$(get_libdir) +} + +src_compile() { + emake gnuserv gnuclient + elisp-compile *.el +} + +src_install() { + exeinto /usr/libexec/emacs + doexe gnuserv + newbin gnuclient gnuclient-emacs + newbin gnudoit gnudoit-emacs + # Don't install gnuattach, it is not functional with FSF GNU Emacs + + newman gnuserv.1 gnuserv-emacs.1 + echo ".so man1/gnuserv-emacs.1" | newman - gnuclient-emacs.1 + echo ".so man1/gnuserv-emacs.1" | newman - gnudoit-emacs.1 + + elisp-install ${PN} *.el *.elc + elisp-site-file-install "${FILESDIR}/${SITEFILE}" + dodoc ChangeLog README README.orig + + use gui && domenu "${FILESDIR}"/gnuclient.desktop +} + +pkg_postinst() { + elisp-site-regen + use gui && xdg_desktop_database_update + eselect gnuclient update ifunset +} + +pkg_postrm() { + elisp-site-regen + use gui && xdg_desktop_database_update + eselect gnuclient update ifunset +}