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

Signed-off-by: Ulrich Müller <ulm@gentoo.org>
This commit is contained in:
Ulrich Müller
2024-10-12 23:31:43 +02:00
parent 99511a853e
commit 0858ff6ab5
3 changed files with 69 additions and 2 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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"