[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/embark 4ddbe6326b 5/5: Merge pull request #727 from min
From: |
ELPA Syncer |
Subject: |
[elpa] externals/embark 4ddbe6326b 5/5: Merge pull request #727 from minad/consult-xref-default-action |
Date: |
Wed, 17 Jul 2024 18:58:16 -0400 (EDT) |
branch: externals/embark
commit 4ddbe6326bc596a05b574cf0109acdb5a79bc748
Merge: 9c166c4b96 9b8d8e63f1
Author: Omar AntolĂn Camarena <omar.antolin@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #727 from minad/consult-xref-default-action
Add default action for consult-xref
---
README.org | 4 ++--
embark-consult.el | 12 ++++++++++--
embark.el | 8 ++++----
embark.texi | 4 ++--
4 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/README.org b/README.org
index 7af6a2f487..ab02db1c3e 100644
--- a/README.org
+++ b/README.org
@@ -398,8 +398,8 @@ About the suggested key bindings for =embark-act= and
=embark-dwim=:
installations of) GNOME to input emojis, and Emacs doesn't even get
a chance to respond to the binding. You can select a different key
binding for =embark-act= or use =ibus-setup= to change the shortcut for
- emoji insertion (Emacs 29 will likely use =C-x 8 e e=, in case you
- want to set the same one system-wide).
+ emoji insertion (Emacs 29 uses =C-x 8 e e=, in case you want to set
+ the same one system-wide).
- The suggested alternative of =M-.= for =embark-dwim= is bound by default
to =xref-find-definitions=. That is a very useful command but
overwriting it with =embark-dwim= is sensible since in Embark's
diff --git a/embark-consult.el b/embark-consult.el
index 0bdbc72879..aec4dba4ed 100644
--- a/embark-consult.el
+++ b/embark-consult.el
@@ -7,7 +7,7 @@
;; Keywords: convenience
;; Version: 1.1
;; Homepage: https://github.com/oantolin/embark
-;; Package-Requires: ((emacs "27.1") (compat "29.1.4.0") (embark "1.0")
(consult "1.0"))
+;; Package-Requires: ((emacs "27.1") (compat "30") (embark "1.0") (consult
"1.7"))
;; 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
@@ -282,8 +282,9 @@ category `consult-grep'."
;;; Support for consult-xref
-(declare-function xref--show-xref-buffer "ext:xref")
(declare-function consult-xref "ext:consult-xref")
+(declare-function xref--show-xref-buffer "xref")
+(declare-function xref-pop-to-location "xref")
(defvar xref-auto-jump-to-first-xref)
(defvar consult-xref--fetcher)
@@ -324,6 +325,13 @@ category `consult-grep'."
(setf (alist-get 'consult-xref embark-exporters-alist)
#'embark-consult-export-xref)
+(defun embark-consult-xref (cand)
+ "Default action override for `consult-xref', open CAND xref location."
+ (xref-pop-to-location (get-text-property 0 'consult-xref cand)))
+
+(setf (alist-get 'consult-xref embark-default-action-overrides)
+ #'embark-consult-xref)
+
;;; Support for consult-find and consult-locate
(setf (alist-get '(file . consult-find) embark-default-action-overrides
diff --git a/embark.el b/embark.el
index d00968d1f7..7ced03ae8f 100644
--- a/embark.el
+++ b/embark.el
@@ -7,7 +7,7 @@
;; Keywords: convenience
;; Version: 1.1
;; Homepage: https://github.com/oantolin/embark
-;; Package-Requires: ((emacs "27.1") (compat "29.1.4.0"))
+;; Package-Requires: ((emacs "27.1") (compat "30"))
;; This file is part of GNU Emacs.
@@ -500,7 +500,7 @@ used for other types of action hooks, for more details see
(const :tag "Always" :always))
:value-type hook))
-(when (version-list-< (version-to-list emacs-version) '(29 1))
+(static-if (< emacs-major-version 29)
;; narrow to target for duration of action
(setf (alist-get 'repunctuate-sentences embark-around-action-hooks)
'(embark--narrow-to-target)))
@@ -3947,7 +3947,7 @@ argument), no quoting is used for strings."
(eval (read (buffer-substring beg end)) lexical-binding)))
(delete-region beg end))))
-(when (< emacs-major-version 29)
+(static-if (< emacs-major-version 29)
(defun embark-elp-restore-package (prefix)
"Remove instrumentation from functions with names starting with PREFIX."
(interactive "SPrefix: ")
@@ -4006,7 +4006,7 @@ ALGORITHM is the hash algorithm symbol understood by
`secure-hash'."
(access-file dir "Download failed")
(url-retrieve
url #'eww-download-callback
- (if (>= emacs-major-version 28) (list url dir) (list url)))))
+ (static-if (>= emacs-major-version 28) (list url dir) (list url)))))
;;; Setup and pre-action hooks
diff --git a/embark.texi b/embark.texi
index e510368e69..ac9e9eb32a 100644
--- a/embark.texi
+++ b/embark.texi
@@ -526,8 +526,8 @@ The suggested @samp{C-.} binding is used by default in (at
least some
installations of) GNOME to input emojis, and Emacs doesn't even get
a chance to respond to the binding. You can select a different key
binding for @samp{embark-act} or use @samp{ibus-setup} to change the shortcut
for
-emoji insertion (Emacs 29 will likely use @samp{C-x 8 e e}, in case you
-want to set the same one system-wide).
+emoji insertion (Emacs 29 uses @samp{C-x 8 e e}, in case you want to set
+the same one system-wide).
@item
The suggested alternative of @samp{M-.} for @samp{embark-dwim} is bound by
default
to @samp{xref-find-definitions}. That is a very useful command but
- [elpa] externals/embark updated (9c166c4b96 -> 4ddbe6326b), ELPA Syncer, 2024/07/17
- [elpa] externals/embark 4380fa2aef 3/5: Simplify, use static-if, ELPA Syncer, 2024/07/17
- [elpa] externals/embark 9b8d8e63f1 4/5: Update README, ELPA Syncer, 2024/07/17
- [elpa] externals/embark 4ddbe6326b 5/5: Merge pull request #727 from minad/consult-xref-default-action,
ELPA Syncer <=
- [elpa] externals/embark a16d3fdbb8 2/5: Bump dependencies, ELPA Syncer, 2024/07/17
- [elpa] externals/embark 58440970a3 1/5: Add default action for consult-xref, ELPA Syncer, 2024/07/17