From c4d2bced9dc458803030f6b9938688485e192b21 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Fri, 13 Oct 2023 13:32:18 +0200 Subject: app-emacs/gnuserv: Fix some more byte-compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ulrich Müller --- .../gnuserv/files/gnuserv-3.12.8-advice.patch | 7 +- app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch | 62 ---------- .../gnuserv/files/gnuserv-3.12.8-devices.patch | 47 +++++++ .../gnuserv/files/gnuserv-3.12.8-emacs-29.patch | 135 --------------------- .../gnuserv/files/gnuserv-3.12.8-warnings.patch | 72 +++++++++++ app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild | 73 ----------- app-emacs/gnuserv/gnuserv-3.12.8-r7.ebuild | 75 ++++++++++++ 7 files changed, 198 insertions(+), 273 deletions(-) create mode 100644 app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch delete mode 100644 app-emacs/gnuserv/files/gnuserv-3.12.8-emacs-29.patch create mode 100644 app-emacs/gnuserv/files/gnuserv-3.12.8-warnings.patch delete mode 100644 app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild create mode 100644 app-emacs/gnuserv/gnuserv-3.12.8-r7.ebuild (limited to 'app-emacs/gnuserv') diff --git a/app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch index e5f1cb9248f9..f4ac28efa662 100644 --- a/app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-advice.patch @@ -2,7 +2,7 @@ defadvice is obsolete in Emacs 30. --- gnuserv-3.12.8/gnuserv-compat.el +++ gnuserv-3.12.8/gnuserv-compat.el -@@ -112,38 +112,34 @@ +@@ -112,38 +112,35 @@ ;; can do! If the device doesn't represent a live frame, we create ;; the frame as requested. @@ -45,13 +45,14 @@ defadvice is obsolete in Emacs 30. - first - (predicate &optional device) - activate) -- ad-do-it) +- 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-cl.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch index df5d1098ce5e..cf5c062fdab1 100644 --- a/app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-cl.patch @@ -1,67 +1,5 @@ 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 @@ 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..0c509a7cd842 --- /dev/null +++ b/app-emacs/gnuserv/files/gnuserv-3.12.8-devices.patch @@ -0,0 +1,47 @@ +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. + +--- gnuserv-3.12.8/gnuserv-compat.el ++++ gnuserv-3.12.8/gnuserv-compat.el +@@ -153,9 +153,39 @@ + (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) ++ ++ (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)) ++ ++ (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 ++ 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-emacs-29.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-emacs-29.patch deleted file mode 100644 index 7b9c8d05cb07..000000000000 --- a/app-emacs/gnuserv/files/gnuserv-3.12.8-emacs-29.patch +++ /dev/null @@ -1,135 +0,0 @@ -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/files/gnuserv-3.12.8-warnings.patch b/app-emacs/gnuserv/files/gnuserv-3.12.8-warnings.patch new file mode 100644 index 000000000000..113d7f0f5f37 --- /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 +@@ -150,7 +150,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-r6.ebuild b/app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild deleted file mode 100644 index 644039c6feeb..000000000000 --- a/app-emacs/gnuserv/gnuserv-3.12.8-r6.ebuild +++ /dev/null @@ -1,73 +0,0 @@ -# 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 -} diff --git a/app-emacs/gnuserv/gnuserv-3.12.8-r7.ebuild b/app-emacs/gnuserv/gnuserv-3.12.8-r7.ebuild new file mode 100644 index 000000000000..dd5eabd64a13 --- /dev/null +++ b/app-emacs/gnuserv/gnuserv-3.12.8-r7.ebuild @@ -0,0 +1,75 @@ +# 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}-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 gui xauth) \ + --x-includes="${EPREFIX}"/usr/include \ + --x-libraries="${EPREFIX}"/usr/$(get_libdir) +} + +src_compile() { + emake gnuserv gnuclient + BYTECOMPFLAGS+=" -l gnuserv-compat" 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 +} -- cgit v1.2.3-65-gdbad