branch: externals/hyperbole commit 30dd8faee05ec12c39067dde323bbf05f400a8d8 Author: Mats Lidell <mats.lid...@lidells.se> Commit: Mats Lidell <mats.lid...@lidells.se>
Use replace-regexp-in-string for compatibility with Emacs 27.2 --- ChangeLog | 5 +++++ hui-mini.el | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26f9acce9a..feb0d43421 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-01-30 Mats Lidell <ma...@gnu.org> + +* hui-mini.el (hui:menu-read-from-minibuffer): Use + replace-regexp-in-string for compatibility with Emacs 27.2. + 2025-01-29 Mats Lidell <ma...@gnu.org> * Makefile (HYPB_GEN, HYPB_ELC, HYPB_ELC_ELN, HYPB_at): Verbosity macros. diff --git a/hui-mini.el b/hui-mini.el index bdecda9d14..b5187ee54c 100644 --- a/hui-mini.el +++ b/hui-mini.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 15-Oct-91 at 20:13:17 -;; Last-Mod: 18-Jan-25 at 13:57:49 by Bob Weiner +;; Last-Mod: 30-Jan-25 at 19:44:11 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -22,8 +22,6 @@ (require 'browse-url) (require 'hsettings) ; For hyperbole-web-search-alist (require 'hypb) -(unless (fboundp 'string-replace) - (load "subr")) ;; for `string-replace' ;;; ************************************************************************ ;;; Public declarations @@ -424,9 +422,9 @@ Allows custom handling of menu lines before selecting an item." org-m-ret-options)) (current-name (cdr (assq hsys-org-enable-smart-keys option-lookups)))) (when (and (stringp current-name) (stringp initial-contents)) - (setq initial-contents (string-replace current-name - (concat "==" current-name "==") - initial-contents))))) + (setq initial-contents (replace-regexp-in-string (regexp-quote current-name) + (concat "==" current-name "==") + initial-contents))))) (setq initial-contents (hui:menu-maybe-highlight-item-keys initial-contents)) (read-from-minibuffer prompt initial-contents keymap read hist default-value inherit-input-method))