commit:     0858ff6ab5fd7ca5d77e77b798f1d6422b4edcd9
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 12 21:31:43 2024 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Oct 12 21:44:27 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0858ff6a

app-emacs/rnc-mode: Fix byte-compile warnings

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 .../rnc-mode/files/rnc-mode-1.0.6-flymake.patch    | 30 ++++++++++++++++++++
 .../rnc-mode/files/rnc-mode-1.0.6-font-lock.patch  | 33 ++++++++++++++++++++++
 ...-mode-1.0.6.ebuild => rnc-mode-1.0.6-r1.ebuild} |  8 ++++--
 3 files changed, 69 insertions(+), 2 deletions(-)

diff --git a/app-emacs/rnc-mode/files/rnc-mode-1.0.6-flymake.patch 
b/app-emacs/rnc-mode/files/rnc-mode-1.0.6-flymake.patch
new file mode 100644
index 000000000000..6904a063c682
--- /dev/null
+++ b/app-emacs/rnc-mode/files/rnc-mode-1.0.6-flymake.patch
@@ -0,0 +1,30 @@
+Update function and variable names that are obsolete since Emacs 26
+
+--- rnc-mode-1.0.6/rnc-mode.el
++++ rnc-mode-1.0.6/rnc-mode.el
+@@ -113,8 +113,8 @@
+ 
+ (defun rnc-flymake-init ()
+   "Flymake init function for running Jing on the schema."
+-  (let* ((temp-file (flymake-init-create-temp-buffer-copy
+-                     'flymake-create-temp-inplace))
++  (let* ((temp-file (flymake-proc-init-create-temp-buffer-copy
++                     'flymake-proc-create-temp-inplace))
+          (local-file (file-relative-name
+                       temp-file
+                       (file-name-directory buffer-file-name))))
+@@ -123,11 +123,11 @@
+ (defun rnc-configure-flymake ()
+   (if (and (stringp rnc-jing-jar-file)
+            (file-exists-p rnc-jing-jar-file))
+-      (add-to-list 'flymake-allowed-file-name-masks
++      (add-to-list 'flymake-proc-allowed-file-name-masks
+                    '(".+\\.rnc$"
+                      rnc-flymake-init
+-                     flymake-simple-cleanup
+-                     flymake-get-real-file-name))
++                     flymake-proc-simple-cleanup
++                     flymake-proc-get-real-file-name))
+     (message "RNC flymake not enabled because the Jing jar could not be 
found")))
+ 
+ ;;; Imenu support

diff --git a/app-emacs/rnc-mode/files/rnc-mode-1.0.6-font-lock.patch 
b/app-emacs/rnc-mode/files/rnc-mode-1.0.6-font-lock.patch
new file mode 100644
index 000000000000..5f615468ed11
--- /dev/null
+++ b/app-emacs/rnc-mode/files/rnc-mode-1.0.6-font-lock.patch
@@ -0,0 +1,33 @@
+Remove indirection for face names
+
+--- rnc-mode-1.0.6/rnc-mode.el
++++ rnc-mode-1.0.6/rnc-mode.el
+@@ -156,24 +156,17 @@
+              (concat (substring result 0 -2) "\\)"))
+       (setq result (concat result op "\\|")))))
+ 
+-;; Font lock treats face names differently in GNU Emacs and XEmacs
+-;; The following defvars is a workaround
+-
+-(defvar italic 'italic)
+-(defvar default 'default)
+-(defvar font-lock-preprocessor-face 'font-lock-preprocessor-face)
+-
+ (defvar rnc-font-lock-keywords
+   (list
+    '("\\b\\(attribute\\|element\\)\\b\\([^{]+\\){" 2 
+      font-lock-variable-name-face)
+-   '("[a-zA-Z][-a-zA-Z0-9._]*:[a-zA-Z][-a-zA-Z0-9._]*" . italic)
++   '("[a-zA-Z][-a-zA-Z0-9._]*:[a-zA-Z][-a-zA-Z0-9._]*" . 'italic)
+    '("\\b\\(default\\(\\s +namespace\\)?\\|namespace\\|datatypes\\)\\(\\s 
+[a-zA-Z][-a-zA-Z0-9._]*\\)?\\s *=" 1 font-lock-preprocessor-face)
+    '("\\([a-zA-Z][-a-zA-Z0-9._]*\\)\\(\\s \\|\n\\)*[|&]?=" 1 
+      font-lock-function-name-face)
+-   '("[a-zA-Z][a-zA-Z0-9._]*\\(-[a-zA-Z][a-zA-Z0-9._]*\\)+" . default)
+-   (cons (rnc-make-regexp-choice rnc-atoms) 'italic)
+-   (cons (rnc-make-regexp-choice rnc-keywords) font-lock-keyword-face)
++   '("[a-zA-Z][a-zA-Z0-9._]*\\(-[a-zA-Z][a-zA-Z0-9._]*\\)+" . 'default)
++   (cons (rnc-make-regexp-choice rnc-atoms) ''italic)
++   (cons (rnc-make-regexp-choice rnc-keywords) 'font-lock-keyword-face)
+    )
+   "RNC Highlighting")
+ 

diff --git a/app-emacs/rnc-mode/rnc-mode-1.0.6.ebuild 
b/app-emacs/rnc-mode/rnc-mode-1.0.6-r1.ebuild
similarity index 77%
rename from app-emacs/rnc-mode/rnc-mode-1.0.6.ebuild
rename to app-emacs/rnc-mode/rnc-mode-1.0.6-r1.ebuild
index 6dd83e053d79..820aaf70cc00 100644
--- a/app-emacs/rnc-mode/rnc-mode-1.0.6.ebuild
+++ b/app-emacs/rnc-mode/rnc-mode-1.0.6-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit elisp
 
@@ -14,5 +14,9 @@ LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
 
+PATCHES=(
+       "${FILESDIR}/${P}-flymake.patch"
+       "${FILESDIR}/${P}-font-lock.patch"
+)
 SITEFILE="50${PN}-gentoo.el"
 DOCS="README.md"

Reply via email to