[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode 55ff225f46 3/8: Silence the byte compiler in Ema
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode 55ff225f46 3/8: Silence the byte compiler in Emacs 29.1 AND Emacs 30.1 |
Date: |
Thu, 1 Feb 2024 16:01:27 -0500 (EST) |
branch: elpa/adoc-mode
commit 55ff225f46cfb37fbe2df9ae7099f92acd21e0e8
Author: Tobias Zawada <TOZ@esi-group.com>
Commit: TobiasZawada <i@tn-home.de>
Silence the byte compiler in Emacs 29.1 AND Emacs 30.1
---
adoc-mode.el | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/adoc-mode.el b/adoc-mode.el
index 72ec49573d..312dff736f 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -1991,6 +1991,13 @@ LANG is a string, and the returned major mode is a
symbol."
(intern (concat lang "-mode"))
(intern (concat (downcase lang) "-mode")))))
+(defmacro adoc-cond-let (cond binding &rest body)
+ "Let-bind BINDING when COND is fulfilled at compile-time.
+Execute BODY like `progn'."
+ (declare (debug (form (&rest (symbolp form)) body)) (indent 2))
+ `(let ,(when (eval cond) binding)
+ ,@body))
+
;; Based on `org-src-font-lock-fontify-block' from org-src.el.
(defun adoc-fontify-code-block-natively (lang start-block end-block start-src
end-src)
"Fontify source code block.
@@ -2018,15 +2025,15 @@ START-SRC and END-SRC delimit the actual source code."
(insert string))
(unless (eq major-mode lang-mode) (funcall lang-mode))
(font-lock-ensure)
- (cl-loop for int = nil
- for int being the intervals property 'face
- for pos = (car int)
- for next = (cdr int)
- for val = (get-text-property pos 'face)
- when val do
- (put-text-property
- (+ start-src (1- pos)) (1- (+ start-src next)) 'face
- val adoc-buffer)))
+ (adoc-cond-let (version< emacs-version "30.0") (int)
+ (cl-loop for int being the intervals property 'face
+ for pos = (car int)
+ for next = (cdr int)
+ for val = (get-text-property pos 'face)
+ when val do
+ (put-text-property
+ (+ start-src (1- pos)) (1- (+ start-src next)) 'face
+ val adoc-buffer))))
(add-text-properties start-block start-src '(face adoc-meta-face))
(add-text-properties end-src end-block '(face adoc-meta-face))
(add-text-properties
- [nongnu] elpa/adoc-mode updated (05914c7319 -> d4df8e1de6), ELPA Syncer, 2024/02/01
- [nongnu] elpa/adoc-mode 47e27bf1af 2/8: Try to calm down byte-compiler in Emacs 28.1 AND Emacs 29.1, ELPA Syncer, 2024/02/01
- [nongnu] elpa/adoc-mode 7a28db1892 1/8: #44 Separate one-line header from next text block by paragraph-separate, ELPA Syncer, 2024/02/01
- [nongnu] elpa/adoc-mode 55ff225f46 3/8: Silence the byte compiler in Emacs 29.1 AND Emacs 30.1,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode 52147105d5 4/8: #44 Avoid cl-loop in native fontification of source blocks, ELPA Syncer, 2024/02/01
- [nongnu] elpa/adoc-mode 0a189c5f28 7/8: Revert "#44 Avoid cl-loop in native fontification of source blocks", ELPA Syncer, 2024/02/01
- [nongnu] elpa/adoc-mode d4df8e1de6 8/8: Only remove kw-replacement overlays in adoc-unfontify-region-function (#46), ELPA Syncer, 2024/02/01
- [nongnu] elpa/adoc-mode 45af71bf17 5/8: #44 Just expansion of a doc string, ELPA Syncer, 2024/02/01
- [nongnu] elpa/adoc-mode cb7bb8f9d1 6/8: Revert "#44 Just expansion of a doc string", ELPA Syncer, 2024/02/01