From patchwork Thu Sep 22 01:23:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 42824 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8A67B27BC82; Thu, 22 Sep 2022 02:24:40 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5E05827BC06 for ; Thu, 22 Sep 2022 02:24:16 +0100 (BST) Received: from localhost ([::1]:55396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obAwo-0001jh-A8 for patchwork@mira.cbaines.net; Wed, 21 Sep 2022 21:24:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obAwc-0001ig-58 for guix-patches@gnu.org; Wed, 21 Sep 2022 21:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36440) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obAwb-0003XU-Tb for guix-patches@gnu.org; Wed, 21 Sep 2022 21:24:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obAwb-0005K3-NC for guix-patches@gnu.org; Wed, 21 Sep 2022 21:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57993] [PATCH] gnu: emacs-volatile-highlights: Emit deprecation messages. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 22 Sep 2022 01:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57993 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57993@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166380981520423 (code B ref -1); Thu, 22 Sep 2022 01:24:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Sep 2022 01:23:35 +0000 Received: from localhost ([127.0.0.1]:35518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obAwB-0005JL-5e for submit@debbugs.gnu.org; Wed, 21 Sep 2022 21:23:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:50030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obAw9-0005JB-DN for submit@debbugs.gnu.org; Wed, 21 Sep 2022 21:23:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obAw9-0001Lw-06 for guix-patches@gnu.org; Wed, 21 Sep 2022 21:23:33 -0400 Received: from mail.boiledscript.com ([144.168.59.46]:52208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obAw6-0003Ta-Pv for guix-patches@gnu.org; Wed, 21 Sep 2022 21:23:32 -0400 Date: Thu, 22 Sep 2022 09:23:15 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1663809809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eBqkAAFFR55W5FCKYDa9Jahlu+a/Dqgtkg1ke8MJefI=; b=MwVGElYpPdwX2yT+DNbMSWJHNKmNquRMWba3o0NW5DmT+/drG6KSY+4eWh3eRZubh83e5e JESnTH3b0ohhlZMK7m3/Xz2CSJyADZxgzmSAmldPhJ1qplONSAIb/R29ascdJ8NAOMFNYR 66SO1jdgNmIVVLDR9HlCVZPpIVzeOHz2FkNfiOfJO5gnffOSVdr6dzzae3W3oSDnpwNFDp Gc89FETQ9AJ1aEfbK0aac89hW4Wdm8dskMhgh+LqJzDHqy1rin9To1wdyg4qjaRRHNHFCa HQysRGTThI8ED+smfkx8b5vGqrQ8qWqk1B75gj7rOITjlYaqfastUlSxVS3AdA== Message-ID: MIME-Version: 1.0 Authentication-Results: mail.boiledscript.com; auth=pass smtp.mailfrom=hako@ultrarare.space X-Spamd-Bar: / Received-SPF: pass client-ip=144.168.59.46; envelope-from=hako@ultrarare.space; helo=mail.boiledscript.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches X-Patchwork-Original-From: Hilton Chain via Guix-patches via From: Hilton Chain X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/emacs-volatile-highlights-use-cl-lib.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/emacs-xyz.scm (emacs-volatile-highlights)[patches]: Add emacs-volatile-highlights-use-cl-lib.patch --- gnu/local.mk | 1 + gnu/packages/emacs-xyz.scm | 6 +- ...emacs-volatile-highlights-use-cl-lib.patch | 159 ++++++++++++++++++ 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/emacs-volatile-highlights-use-cl-lib.patch base-commit: 1a1ff7ed8fdaae58aff0e8625399cd7354038ca3 diff --git a/gnu/local.mk b/gnu/local.mk index ef1bae5f3c..d85c5992da 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1054,6 +1054,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-source-date-epoch.patch \ %D%/packages/patches/emacs-telega-path-placeholder.patch \ %D%/packages/patches/emacs-telega-test-env.patch \ + %D%/packages/patches/emacs-volatile-highlights-use-cl-lib.patch \ %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch \ %D%/packages/patches/emacs-yasnippet-fix-tests.patch \ %D%/packages/patches/emacs-kv-fix-tests.patch \ diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 32e4c33f16..05ec770637 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -32319,7 +32319,11 @@ (define-public emacs-volatile-highlights (file-name (git-file-name name version)) (sha256 (base32 - "1dsa6769lphyyv7yg92vkkpk395w52q4m7hdn8xy7s6lh5c6a955")))) + "1dsa6769lphyyv7yg92vkkpk395w52q4m7hdn8xy7s6lh5c6a955")) + (patches + (search-patches + ;; https://github.com/k-talo/volatile-highlights.el/pull/22 + "emacs-volatile-highlights-use-cl-lib.patch")))) (build-system emacs-build-system) (home-page "http://github.com/k-talo/volatile-highlights.el") (synopsis "Emacs minor mode for visual feedback on some operations") diff --git a/gnu/packages/patches/emacs-volatile-highlights-use-cl-lib.patch b/gnu/packages/patches/emacs-volatile-highlights-use-cl-lib.patch new file mode 100644 index 0000000000..daf1eb6faa --- /dev/null +++ b/gnu/packages/patches/emacs-volatile-highlights-use-cl-lib.patch @@ -0,0 +1,159 @@ +From f5801779ba3e8f52020a34313fdfaa55f6c0c967 Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Fri, 14 Jan 2022 22:31:39 +0100 +Subject: [PATCH 1/3] Use cl-lib instead of the deprecated cl package + +--- + volatile-highlights.el | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/volatile-highlights.el b/volatile-highlights.el +index e946afd..c1d7f2e 100644 +--- a/volatile-highlights.el ++++ b/volatile-highlights.el +@@ -195,7 +195,7 @@ + (defconst vhl/version "1.8") + + (eval-when-compile +- (require 'cl) ++ (require 'cl-lib) + (require 'easy-mmode) + (require 'advice)) + +@@ -409,7 +409,7 @@ Optional args are the same as `vhl/add-range'." + (let ((fn-on (intern (format "vhl/ext/%s/on" sym))) + (fn-off (intern (format "vhl/ext/%s/off" sym))) + (cust-name (intern (format "vhl/use-%s-extension-p" sym)))) +- (pushnew sym vhl/.installed-extensions) ++ (cl-pushnew sym vhl/.installed-extensions) + (eval `(defcustom ,cust-name t + ,(format "A flag if highlighting support for `%s' is on or not." sym) + :type 'boolean +@@ -532,34 +532,34 @@ would be listed in english. + This is included as a private support function for generating + lists of symbols to be included docstrings of auto-generated + extensions." +- (assert (listp items)) ++ (cl-assert (listp items)) + (cond ((null items) + ;; Zero items + "") + ((null (cdr items)) + ;; One item +- (assert (stringp (first items))) +- (format "%s" (first items))) ++ (cl-assert (stringp (cl-first items))) ++ (format "%s" (cl-first items))) + ((null (cddr items)) + ;; Two items +- (assert (stringp (first items))) +- (assert (stringp (second items))) ++ (cl-assert (stringp (cl-first items))) ++ (cl-assert (stringp (cl-second items))) + (apply 'format "%s and %s" items)) + ((null (cdddr items)) + ;; Three items +- (assert (stringp (first items))) +- (assert (stringp (second items))) +- (assert (stringp (third items))) ++ (cl-assert (stringp (cl-first items))) ++ (cl-assert (stringp (cl-second items))) ++ (cl-assert (stringp (third items))) + (apply 'format "%s, %s, and %s" items)) + (t + ;; 4 or more items +- (format "%s, %s" (first items) (vhl/.make-list-string (rest items))))))) ++ (format "%s, %s" (cl-first items) (vhl/.make-list-string (rest items))))))) + + ;; The following makes it trivial to define simple vhl extensions + (defmacro vhl/define-extension (name &rest functions) + "Define a VHL extension called NAME that applies standard VHL + advice to each of FUNCTIONS." +- (assert (first functions)) ++ (cl-assert (cl-first functions)) + (let* ((name-string (symbol-name (eval name))) + (function-list-string (vhl/.make-list-string + (mapcar (lambda (f) (format "`%s'" (symbol-name (eval f)))) + +From 1480383952ac46b7d76df749a8ff7565303bc184 Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Fri, 14 Jan 2022 22:31:32 +0100 +Subject: [PATCH 2/3] Use lexical-binding to get rid of lexical-let + +This should be safe as the byte compiler does not warn about free +variables. +--- + volatile-highlights.el | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/volatile-highlights.el b/volatile-highlights.el +index d12b336..e946afd 100644 +--- a/volatile-highlights.el ++++ b/volatile-highlights.el +@@ -1,4 +1,4 @@ +-;;; volatile-highlights.el --- Minor mode for visual feedback on some operations. ++;;; volatile-highlights.el --- Minor mode for visual feedback on some operations. -*- lexical-binding: t; -*- + + ;; Copyright (C) 2001, 2010-2016 K-talo Miyazaki, all rights reserved. + +@@ -671,7 +671,7 @@ extensions." + "Turn on volatile highlighting for `occur'." + (interactive) + +- (lexical-let ((*occur-str* nil)) ;; Text in current line. ++ (let ((*occur-str* nil)) ;; Text in current line. + (defun vhl/ext/occur/.pre-hook-fn () + (save-excursion + (let* ((bol (progn (beginning-of-line) (point))) + +From 5e017d2e4a88acc562d90775cf9c746be2d7f277 Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Fri, 14 Jan 2022 22:31:19 +0100 +Subject: [PATCH 3/3] Fix trailing whitespace + +--- + volatile-highlights.el | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/volatile-highlights.el b/volatile-highlights.el +index cb46897..d12b336 100644 +--- a/volatile-highlights.el ++++ b/volatile-highlights.el +@@ -106,7 +106,7 @@ + ;; + ;; (vhl/define-extension 'vip 'vip-yank) + ;; (vhl/install-extension 'vip) +-;; ++;; + ;; - evil-mode + ;; + ;; (vhl/define-extension 'evil 'evil-paste-after 'evil-paste-before +@@ -826,16 +826,16 @@ extensions." + (defadvice hs-show-block (around vhl/ext/hideshow/vhl/around-hook (&optional end)) + (let* ((bol (save-excursion (progn (beginning-of-line) (point)))) + (eol (save-excursion (progn (end-of-line) (point)))) +- (ov-folded (car (delq nil ++ (ov-folded (car (delq nil + (mapcar #'(lambda (ov) + (and (overlay-get ov 'hs) + ov)) + (overlays-in bol (1+ eol)))))) + (boov (and ov-folded (overlay-start ov-folded))) + (eoov (and ov-folded (overlay-end ov-folded)))) +- ++ + ad-do-it +- ++ + (when (and boov eoov) + (vhl/add-range boov eoov)))) + (ad-activate 'hs-show-block)) +@@ -843,7 +843,7 @@ extensions." + (defun vhl/ext/hideshow/on () + "Turn on volatile highlighting for `hideshow'." + (interactive) +- ++ + (cond + ((featurep 'hideshow) + (vhl/ext/hideshow/.activate))