[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 64579b0 30/50: Fix defil with function improp
From: |
Stefan Monnier |
Subject: |
[elpa] externals/hyperbole 64579b0 30/50: Fix defil with function improper call to regexp-quote |
Date: |
Wed, 17 Mar 2021 18:44:19 -0400 (EDT) |
branch: externals/hyperbole
commit 64579b0e1731687b0e5196ccc25937c6114e39bb
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
Fix defil with function improper call to regexp-quote
Also add label flash of git-commit-references ibuttons.
---
Changes | 6 ++++++
hbut.el | 14 ++++++++------
hib-social.el | 10 ++++++----
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/Changes b/Changes
index 74f58da..bdfeb19 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,9 @@
+2021-02-15 Bob Weiner <rsw@gnu.org>
+
+* hbut.el (defil): Fixed improper call of regexp-quote when link-expr was not
a string.
+
+* hib-social.el (git-commit-reference): Added flash of button label
+
2021-02-14 Bob Weiner <rsw@gnu.org>
* man/hyperbole.texi (Programmatic Button Creation): Documented ebut:program.
diff --git a/hbut.el b/hbut.el
index 2fecc1b..935836c 100644
--- a/hbut.el
+++ b/hbut.el
@@ -1730,7 +1730,7 @@ type for ibtype is presently undefined."
[&optional stringp] ; Match the doc string, if present.
def-body))
-(defun ibtype:activate-link-path (referent)
+(defun ibtype:activate-link (referent)
"Activate a Hyperbole implicit link `referent', either a key series, a URL
or a path."
(when referent
(let ((key-series (kbd-key:is-p referent)))
@@ -1800,18 +1800,20 @@ commit changes."
(when button-text
(if (or (functionp ,link-expr) (subrp ,link-expr))
(hact ,link-expr button-text)
- (let ((path-to-display (when (and button-text (string-match
,text-regexp button-text))
- (replace-match ,link-expr nil nil
button-text))))
- (ibtype:activate-link-path path-to-display))))))
+ (let ((referent (when (and button-text (stringp ,link-expr)
+ (string-match ,text-regexp
button-text))
+ (replace-match ,link-expr nil nil
button-text))))
+ (ibtype:activate-link referent))))))
(put (intern (format "ibtypes::%s" ',type))
'function-documentation
(or ,doc
(format "%s - %s\n\n%s %s%s%s\n%s %s" ',type "Hyperbole
implicit button type"
" Recognizes buttons of the form:\n "
(if ,start-regexp-flag (regexp-quote ,start-delim)
,start-delim)
- (regexp-quote ,text-regexp)
+ ,text-regexp
(if ,end-regexp-flag (regexp-quote ,end-delim)
,end-delim)
- " which display links of the form:\n "
(regexp-quote ,link-expr)))))))
+ " which display links with:\n "
+ (if (stringp ,link-expr) (regexp-quote ,link-expr)
,link-expr)))))))
(defmacro defal (type link-expr &optional doc)
"Create Hyperbole action button link TYPE (an unquoted symbol) whose buttons
look like: <TYPE link-text> where link-text is substituted into LINK-EXPR as
grouping 1 (\\\\1).
diff --git a/hib-social.el b/hib-social.el
index 0092ed0..1d32247 100644
--- a/hib-social.el
+++ b/hib-social.el
@@ -608,10 +608,12 @@ PROJECT value is provided, it defaults to the value of
(defib git-commit-reference ()
"Display the diff for a git commit reference, e.g. \"commit a55e21\",
typically produced by git log."
- (if (save-excursion
- (beginning-of-line)
- (looking-at "\\s-*commit \\([0-9a-f][0-9a-f][0-9a-f][0-9a-f]+\\)\\s-"))
- (hact #'git-reference (match-string-no-properties 1))))
+ (when (save-excursion
+ (beginning-of-line)
+ (looking-at "\\s-*\\(commit
\\([0-9a-f][0-9a-f][0-9a-f][0-9a-f]+\\)\\)\\s-"))
+ (save-match-data
+ (ibut:label-set (match-string-no-properties 1) (match-beginning 1)
(match-end 1)))
+ (hact #'git-reference (match-string-no-properties 2))))
(defvar hibtypes-git-repos-cache
(expand-file-name "Local-Git-Repos" hbmap:dir-user)
- [elpa] externals/hyperbole 3469ea3 29/50: Release defil and defal simpler implicit button type create macros, (continued)
- [elpa] externals/hyperbole 3469ea3 29/50: Release defil and defal simpler implicit button type create macros, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 6a8154a 33/50: Add first unit tests (#46), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole a44b392 34/50: Add UNIX shell error implicit button support, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole aa6f2f6 38/50: Verify error message from hpath:find is correct (#50), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole aad4494 40/50: Add smart-magit-tab: Do what TAB or RET does, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole d1dcd54 41/50: * Disable magit-auto-revert-mode-enable-in-buffers in hyrolo buffer, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole c7d62e1 46/50: Make defil handle action type symbols and strings, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 6b2c073 49/50: Correct test cases failing on mac (#55), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 4eef4e9 50/50: Install with-simulated-input if not available (#54), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 25ba634 31/50: Add fast window link button creation via {M-o w} with Ace Window., Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 64579b0 30/50: Fix defil with function improper call to regexp-quote,
Stefan Monnier <=
- [elpa] externals/hyperbole fccc0e5 42/50: Limit Action Button function arg to parameter after function name, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 1219e12 35/50: Merge branch 'master' of hyperbole, Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 9ca5b0f 45/50: More tests for ib with labels (#53), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole cd36bea 39/50: Add more defal and defil tests (#51), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole aeb5a31 37/50: Add defal defil tests plus some extras (#49), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole 1c21784 44/50: Add tests for ib with labels (#52), Stefan Monnier, 2021/03/17
- [elpa] externals/hyperbole faa061e 48/50: Magit Action/Assist Mouse Key on header line toggles diff/all sections visibility, Stefan Monnier, 2021/03/17