From faa95a784d2c74c72e70367a5d531df6dd61aeab Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sun, 6 Aug 2023 16:41:48 +0200 Subject: [PATCH] Don't redefine built-in function Fixes #1817 --- tests/haskell-indent-tests.el | 14 ++++++++------ tests/haskell-indentation-tests.el | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/haskell-indent-tests.el b/tests/haskell-indent-tests.el index 7196405b8..9a3de4ad3 100644 --- a/tests/haskell-indent-tests.el +++ b/tests/haskell-indent-tests.el @@ -40,11 +40,13 @@ ;; (haskell-indent-put-region-in-literate (point-min) (point-max) -1) ;; (buffer-substring-no-properties (point-min) (point-max)))))) -(defsubst string-trim-left (string) - "Remove leading whitespace from STRING." - (if (string-match "\\`[ \t\n\r]+" string) - (replace-match "" t t string) - string)) +(if (fboundp 'string-trim-left) + (defalias 'haskell--string-trim-left 'string-trim-left) + (defun haskell--string-trim-left (string &optional regexp) + "Remove leading whitespace from STRING." + (if (string-match (concat "\\`\\(?:" (or regexp "[ \t\n\r]+") "\\)") string) + (substring string (match-end 0)) + string))) (defun haskell-indent-format-info (info) (if (cdr info) @@ -128,7 +130,7 @@ macro quotes them for you." :expected-result ,(if allow-failure :failed :passed) (haskell-indent-check - ,(string-trim-left source) + ,(haskell--string-trim-left source) ,@(mapcar (lambda (x) (list 'quote x)) test-cases)))))) diff --git a/tests/haskell-indentation-tests.el b/tests/haskell-indentation-tests.el index 4889b76a7..cd783a4f4 100644 --- a/tests/haskell-indentation-tests.el +++ b/tests/haskell-indentation-tests.el @@ -33,11 +33,13 @@ ;;; Code: -(defsubst string-trim-left (string) - "Remove leading whitespace from STRING." - (if (string-match "\\`[ \t\n\r]+" string) - (replace-match "" t t string) - string)) +(if (fboundp 'string-trim-left) + (defalias 'haskell--string-trim-left 'string-trim-left) + (defun haskell--string-trim-left (string &optional regexp) + "Remove leading whitespace from STRING." + (if (string-match (concat "\\`\\(?:" (or regexp "[ \t\n\r]+") "\\)") string) + (substring string (match-end 0)) + string))) (defun haskell-indentation-check (source &rest test-cases) "Check if `haskell-indentation-find-indentations' returns expected results. @@ -115,7 +117,7 @@ macro quotes them for you." :expected-result ,(if allow-failure :failed :passed) (haskell-indentation-check - ,(string-trim-left source) + ,(haskell--string-trim-left source) ,@(mapcar (lambda (x) (list 'quote x)) test-cases)))))) nu/packages/aux-files/linux-libre/6.1-x86_64.conf?id=3349a50d700a2112a31ac4ce6cc6639d3b4cf1e2&showmsg=1'>Expand)Author 2023-02-19gnu: linux-libre: Consistently provide the drop_monitor module....This is needed by, e.g., <https://github.com/nhorman/dropwatch>. Build it as a module everywhere for consistency. * gnu/packages/aux-files/linux-libre/4.14-i686.conf: Set CONFIG_NET_DROP_MONITOR=m. * gnu/packages/aux-files/linux-libre/4.14-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/4.19-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/4.19-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.10-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.10-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.10-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.10-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.4-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.4-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.4-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.4-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-x86_64.conf: Likewise. Reported by mirai in #guix. Tobias Geerinckx-Rice 2023-02-12gnu: linux-libre: Disable unprivileged BPF by default....* gnu/packages/aux-files/linux-libre/5.15-arm.conf: Set CONFIG_BPF_UNPRIV_DEFAULT_OFF=y. * gnu/packages/aux-files/linux-libre/5.15-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/5.15-x86_64.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-arm.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-arm64.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-i686.conf: Likewise. * gnu/packages/aux-files/linux-libre/6.1-x86_64.conf: Likewise. Tobias Geerinckx-Rice 2023-01-03gnu: Add linux-libre 6.1....* gnu/packages/linux.scm (linux-libre-6.1-version, linux-libre-6.1-gnu-revision, deblob-scripts-6.1, linux-libre-6.1-source, linux-libre-headers-6.1, linux-libre-6.1): New variables. * gnu/packages/aux-files/linux-libre/6.1-arm.conf, gnu/packages/aux-files/linux-libre/6.1-arm64.conf, gnu/packages/aux-files/linux-libre/6.1-i686.conf, gnu/packages/aux-files/linux-libre/6.1-x86_64.conf: New files. * Makefile.am (AUX_FILES): Add them. Leo Famulari