[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 9f9b106 35/51: hypb:replace-match-string): Re
From: |
Stefan Monnier |
Subject: |
[elpa] externals/hyperbole 9f9b106 35/51: hypb:replace-match-string): Replace with replace-regexp-in-string |
Date: |
Sun, 12 Jul 2020 18:10:16 -0400 (EDT) |
branch: externals/hyperbole
commit 9f9b1066602ccb5fc1d565ffa75d2b04381d16cb
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
hypb:replace-match-string): Replace with replace-regexp-in-string
---
hypb.el | 38 +-------------------------------------
1 file changed, 1 insertion(+), 37 deletions(-)
diff --git a/hypb.el b/hypb.el
index 131ea32..26a1893 100644
--- a/hypb.el
+++ b/hypb.el
@@ -533,43 +533,7 @@ that returns a replacement string."
(unless (or (stringp newtext) (functionp newtext))
(error "(hypb:replace-match-string): 3rd arg must be a string or function:
%s"
newtext))
- (let ((rtn-str "")
- (start 0)
- (special)
- match prev-start)
- (while (setq match (string-match regexp str start))
- (setq prev-start start
- start (match-end 0)
- rtn-str
- (concat
- rtn-str
- (substring str prev-start match)
- (cond ((functionp newtext)
- (hypb:replace-match-string
- regexp (substring str match start)
- (funcall newtext str) literal))
- (literal newtext)
- (t (mapconcat
- (lambda (c)
- (cond (special
- (setq special nil)
- (cond ((eq c ?\\) "\\")
- ((eq c ?&)
- (match-string 0 str))
- ((and (>= c ?0) (<= c ?9))
- (if (> c (+ ?0 (length
- (match-data))))
- ;; Invalid match num
- (error
"(hypb:replace-match-string) Invalid match num: %c" c)
- (setq c (- c ?0))
- (match-string c str)))
- (t (char-to-string c))))
- ((eq c ?\\)
- (setq special t)
- nil)
- (t (char-to-string c))))
- newtext ""))))))
- (concat rtn-str (substring str start))))
+ (replace-regexp-in-string regexp newtext str nil literal))
(defun hypb:return-process-output (program &optional infile &rest args)
"Return as a string the output from external PROGRAM with INFILE for input.
- [elpa] externals/hyperbole 2253ac2 50/51: V7.1.2 release, (continued)
- [elpa] externals/hyperbole 2253ac2 50/51: V7.1.2 release, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 7184b30 51/51: Fix ibut:delete, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 07c0664 21/51: Org-mode local binding of M-RET activates Hyperbole implicit buttons, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole f2a5c27 22/51: Fixed errors in using hyrolo-logic operators, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole ecc8f36 24/51: Smart Key live window resizing and frame dragging; auto-autoload gen, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole cb7827c 26/51: Swapping buffer improvements; handle grep lines with null separators, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 73fed44 28/51: Fix in-buffer text as ebut label; allow line/col in link-to-file, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole f98ce2a 29/51: Fix colorized display of HyRolo match terms on initial use., Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 7a14688 30/51: Update manual with bottommost modeline frame drags and Bookmarks, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole bf73086 31/51: Generalize in-buffer button completion UI; Hyperbole manual updates, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 9f9b106 35/51: hypb:replace-match-string): Replace with replace-regexp-in-string,
Stefan Monnier <=
- [elpa] externals/hyperbole 7d098e4 37/51: kbd-key:normalize: Rewrote and added support for many more keys, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole c050a69 42/51: kotl/klink.el: (require 'kcell): Removed recursive require loop, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 034d672 45/51: Only url encode the user input to the search (#25), Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 96dcfee 41/51: Bulk of changes for test release 7.1.2, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 2093d3e 48/51: quit-window - Handle primitive functions when replacing this command, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole aa04634 14/51: Handle null key sent to link-to-ibut and ibut:to, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole 8c234bf 46/51: Basic coding and documentation updates, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole f733d4f 20/51: Bug fixes in preparation for test release V7.0.9, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole a9ce82a 25/51: Removed {C-c C-r} ebut:rename binding due to major-mode conflicts, Stefan Monnier, 2020/07/12
- [elpa] externals/hyperbole a566b48 38/51: Large partial update in preparation for 7.1.1 test release, Stefan Monnier, 2020/07/12