branch: externals/debbugs
commit a35646a9798226b8630fbd7a0691edc78ccd92b3
Author: Michael Albinus <michael.albi...@gmx.de>
Commit: Michael Albinus <michael.albi...@gmx.de>

    Release debbugs 0.32
    
    * debbugs-compat.el: New file.
    
    * debbugs-gnu.el (debbugs-compat): Require it.
    (debbugs-gnu-insert-changelog): Use `debbugs-compat-string-replace'.
    
    * debbugs.el: Require Emacs 26.1.  Move version to 0.32.
    (subr-x): Require it.
---
 debbugs-compat.el | 35 +++++++++++++++++++++++++++++++++++
 debbugs-gnu.el    |  3 ++-
 debbugs.el        |  5 +++--
 3 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/debbugs-compat.el b/debbugs-compat.el
new file mode 100644
index 0000000000..5ea13fbeab
--- /dev/null
+++ b/debbugs-compat.el
@@ -0,0 +1,35 @@
+;;; debbugs-compat.el --- Compatibility library for debbugs  -*- 
lexical-binding:t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Michael Albinus <michael.albi...@gmx.de>
+;; Keywords: comm, hypermedia
+;; Package: debbugs
+
+;; This file is not part of GNU Emacs.
+
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;; Function `string-replace' is new in Emacs 28.1.
+(defalias 'debbugs-compat-string-replace
+  (if (fboundp 'string-replace)
+      #'string-replace
+    (lambda (from-string to-string in-string)
+      (let ((case-fold-search nil))
+        (replace-regexp-in-string
+         (regexp-quote from-string) to-string in-string t t)))))
+
+(provide 'debbugs-compat)
+
+;;; debbugs-compat.el ends here
diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index 64a076997d..dd3bc24ea9 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -174,6 +174,7 @@
 ;;; Code:
 
 (require 'debbugs)
+(require 'debbugs-compat)
 (require 'tabulated-list)
 (require 'add-log)
 (eval-when-compile (require 'subr-x))
@@ -2708,7 +2709,7 @@ If SELECTIVELY, query the user before applying the patch."
        (delete-region (line-beginning-position) (point-max))
        (save-restriction
          (narrow-to-region (point) (point))
-         (insert (string-replace "\r" "" changelog))
+         (insert (debbugs-compat-string-replace "\r" "" changelog))
          (indent-region (point-min) (point-max))))
       (let ((point (point)))
        (when (string-match "\\(bug#[0-9]+\\)" subject)
diff --git a/debbugs.el b/debbugs.el
index bd55294ecf..eec36d475d 100644
--- a/debbugs.el
+++ b/debbugs.el
@@ -5,8 +5,8 @@
 ;; Author: Michael Albinus <michael.albi...@gmx.de>
 ;; Keywords: comm, hypermedia
 ;; Package: debbugs
-;; Version: 0.31
-;; Package-Requires: ((emacs "25.1") (soap-client "3.1.5"))
+;; Version: 0.32
+;; Package-Requires: ((emacs "26.1") (soap-client "3.1.5"))
 
 ;; This file is not part of GNU Emacs.
 
@@ -38,6 +38,7 @@
 
 ;;; Code:
 
+(require 'subr-x)
 ;(setq soap-debug t url-debug t message-log-max t)
 (require 'soap-client)
 (eval-when-compile (require 'cl-lib))

Reply via email to