[elpa] externals/vertico 152f560: Rename `x-title-function` to `group-function` as per Emacs 28

2021-05-21 Thread Protesilaos Stavrou
branch: externals/vertico
commit 152f560f28627a9a249929381bbe37c97f220744
Author: Daniel Mendler 
Commit: Daniel Mendler 

Rename `x-title-function` to `group-function` as per Emacs 28
---
 README.org |  2 +-
 vertico.el | 12 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/README.org b/README.org
index ef5442a..835f4fa 100644
--- a/README.org
+++ b/README.org
@@ -26,7 +26,7 @@ enhancements can be installed separately via complementary 
packages.
 - Sorting by history position, string length and alphabetically
 - Long candidates with newlines are formatted to take up less space
 - Deferred completion style highlighting for performance
-- Support for ~annotation-function~, ~affixation-function~ and 
~x-title-function~
+- Support for ~annotation-function~, ~affixation-function~ and ~group-function~
 
 [[https://github.com/minad/vertico/blob/main/screenshot.svg?raw=true]]
 
diff --git a/vertico.el b/vertico.el
index 29ba089..4e1fb41 100644
--- a/vertico.el
+++ b/vertico.el
@@ -273,8 +273,8 @@
 (when (and completing-file (not (string-suffix-p "/" field)))
   (setq all (vertico--move-to-front (concat field "/") all)))
 (setq all (vertico--move-to-front field all))
-(when-let (title-fun (completion-metadata-get metadata 'x-title-function))
-  (setq all (vertico--group-by title-fun all)))
+(when-let (group-fun (completion-metadata-get metadata 'group-function))
+  (setq all (vertico--group-by group-fun all)))
 (list base (length all) all (cdr all-hl
 
 (defun vertico--group-by (fun elems)
@@ -347,8 +347,8 @@
 
 (defun vertico--format-candidates (metadata)
   "Format current candidates with METADATA."
-  (let* ((title-fun (completion-metadata-get metadata 'x-title-function))
- (group-format (and title-fun vertico-group-format (concat 
vertico-group-format "\n")))
+  (let* ((group-fun (completion-metadata-get metadata 'group-function))
+ (group-format (and group-fun vertico-group-format (concat 
vertico-group-format "\n")))
  (index (min (max 0 (- vertico--index (/ vertico-count 2) (if 
group-format -1 0)))
  (max 0 (- vertico--total vertico-count
  (candidates
@@ -362,10 +362,10 @@
   (let ((prefix "") (suffix ""))
 (when (consp cand)
   (setq prefix (cadr cand) suffix (caddr cand) cand (car cand)))
-(when-let (new-title (and group-format (funcall title-fun cand nil)))
+(when-let (new-title (and group-format (funcall group-fun cand nil)))
   (unless (equal title new-title)
 (push (format group-format (setq title new-title)) lines))
-  (setq cand (funcall title-fun cand 'transform)))
+  (setq cand (funcall group-fun cand 'transform)))
 (when (string-match-p "\n" cand)
   (setq cand (thread-last cand
(replace-regexp-in-string "[\t ]+" " ")



[elpa] externals/swiper a5eade0 2/3: Fix swiper-avy indexing in swiper-isearch (#2873)

2021-05-21 Thread Basil L. Contovounesios
branch: externals/swiper
commit a5eade0c77b7dd78cdea0f246683c6cb00f7b7c6
Author: Basil L. Contovounesios 
Commit: Basil L. Contovounesios 

Fix swiper-avy indexing in swiper-isearch (#2873)

* swiper.el (swiper--avy-index): New function extracted from
swiper--avy-goto that additionally checks for the 'point' text
property used by swiper-isearch (#2867).
(swiper--avy-goto): Use it.  Set ivy--index directly instead of
going through ivy-set-index as the latter heeds ivy-calling.
---
 swiper.el | 29 +++--
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/swiper.el b/swiper.el
index ed8192d..fe4fbb7 100644
--- a/swiper.el
+++ b/swiper.el
@@ -332,19 +332,28 @@ If the input is empty, select the previous history 
element instead."
(avy-push-mark))
   (avy--done
 
+(defun swiper--avy-index (pos)
+  "Return `ivy--index' for `avy' candidate at minibuffer POS."
+  ;; Position in original buffer.
+  (let ((opos (get-text-property pos 'point)))
+(or
+ ;; Find `swiper-isearch' index based on buffer position.
+ (and opos (cl-position opos ivy--all-candidates))
+ ;; Find `swiper' index based on line number.
+ (let ((nlines (count-lines (point-min) (point-max
+   (+ (car (ivy--minibuffer-index-bounds
+ivy--index ivy--length ivy-height))
+  (line-number-at-pos pos)
+  (if (or (= nlines (1+ ivy-height))
+  (< ivy--length ivy-height))
+  0
+(- ivy-height nlines))
+  -2)
+
 (defun swiper--avy-goto (candidate)
   (cond ((let ((win (cdr-safe candidate)))
(and win (window-minibuffer-p win)))
- (let ((nlines (count-lines (point-min) (point-max
-   (ivy-set-index
-(+ (car (ivy--minibuffer-index-bounds
- ivy--index ivy--length ivy-height))
-   (line-number-at-pos (car candidate))
-   (if (or (= nlines (1+ ivy-height))
-   (< ivy--length ivy-height))
-   0
- (- ivy-height nlines))
-   -2)))
+ (setq ivy--index (swiper--avy-index (car candidate)))
  (ivy--exhibit)
  (ivy-done)
  (ivy-call))



[elpa] externals/swiper f6b46bc 1/3: Fix swiper-avy error with swiper-isearch (#2873)

2021-05-21 Thread Basil L. Contovounesios
branch: externals/swiper
commit f6b46bc571dc4f62eee657b4d2ccb482ff65c240
Author: Basil L. Contovounesios 
Commit: Basil L. Contovounesios 

Fix swiper-avy error with swiper-isearch (#2873)

* swiper.el (swiper-avy): Don't call swiper--update-input-ivy for
swiper-isearch, as the former expects string candidates and the
latter now uses buffer positions.

Closes #2867.
---
 swiper.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/swiper.el b/swiper.el
index 7e4f7ed..ed8192d 100644
--- a/swiper.el
+++ b/swiper.el
@@ -355,16 +355,19 @@ If the input is empty, select the previous history 
element instead."
 
 ;;;###autoload
 (defun swiper-avy ()
-  "Jump to one of the current swiper candidates."
+  "Jump to one of the current swiper candidates with `avy'."
   (interactive)
   (unless (require 'avy nil 'noerror)
-(error "Package avy isn't installed"))
+(user-error "Package avy isn't installed"))
   (cl-case (length ivy-text)
 (0
  (user-error "Need at least one char of input"))
 (1
- (let ((swiper-min-highlight 1))
-   (swiper--update-input-ivy
+ ;; FIXME: `swiper--update-input-ivy' expects string candidates,
+ ;; but `swiper-isearch' now uses buffer positions.
+ (when (stringp (ivy-state-current ivy-last))
+   (let ((swiper-min-highlight 1))
+ (swiper--update-input-ivy)
   (swiper--avy-goto (swiper--avy-candidate)))
 
 (declare-function mc/create-fake-cursor-at-point "ext:multiple-cursors-core")



[elpa] externals/swiper 9393004 3/3: Merge branch 'master' into externals/swiper

2021-05-21 Thread Basil L. Contovounesios
branch: externals/swiper
commit 9393004f49d4f1552ed91c6aaa2e6cbeca7375bd
Merge: 6f17f80 a5eade0
Author: Basil L. Contovounesios 
Commit: Basil L. Contovounesios 

Merge branch 'master' into externals/swiper
---
 swiper.el | 40 ++--
 1 file changed, 26 insertions(+), 14 deletions(-)

diff --git a/swiper.el b/swiper.el
index 7e4f7ed..fe4fbb7 100644
--- a/swiper.el
+++ b/swiper.el
@@ -332,19 +332,28 @@ If the input is empty, select the previous history 
element instead."
(avy-push-mark))
   (avy--done
 
+(defun swiper--avy-index (pos)
+  "Return `ivy--index' for `avy' candidate at minibuffer POS."
+  ;; Position in original buffer.
+  (let ((opos (get-text-property pos 'point)))
+(or
+ ;; Find `swiper-isearch' index based on buffer position.
+ (and opos (cl-position opos ivy--all-candidates))
+ ;; Find `swiper' index based on line number.
+ (let ((nlines (count-lines (point-min) (point-max
+   (+ (car (ivy--minibuffer-index-bounds
+ivy--index ivy--length ivy-height))
+  (line-number-at-pos pos)
+  (if (or (= nlines (1+ ivy-height))
+  (< ivy--length ivy-height))
+  0
+(- ivy-height nlines))
+  -2)
+
 (defun swiper--avy-goto (candidate)
   (cond ((let ((win (cdr-safe candidate)))
(and win (window-minibuffer-p win)))
- (let ((nlines (count-lines (point-min) (point-max
-   (ivy-set-index
-(+ (car (ivy--minibuffer-index-bounds
- ivy--index ivy--length ivy-height))
-   (line-number-at-pos (car candidate))
-   (if (or (= nlines (1+ ivy-height))
-   (< ivy--length ivy-height))
-   0
- (- ivy-height nlines))
-   -2)))
+ (setq ivy--index (swiper--avy-index (car candidate)))
  (ivy--exhibit)
  (ivy-done)
  (ivy-call))
@@ -355,16 +364,19 @@ If the input is empty, select the previous history 
element instead."
 
 ;;;###autoload
 (defun swiper-avy ()
-  "Jump to one of the current swiper candidates."
+  "Jump to one of the current swiper candidates with `avy'."
   (interactive)
   (unless (require 'avy nil 'noerror)
-(error "Package avy isn't installed"))
+(user-error "Package avy isn't installed"))
   (cl-case (length ivy-text)
 (0
  (user-error "Need at least one char of input"))
 (1
- (let ((swiper-min-highlight 1))
-   (swiper--update-input-ivy
+ ;; FIXME: `swiper--update-input-ivy' expects string candidates,
+ ;; but `swiper-isearch' now uses buffer positions.
+ (when (stringp (ivy-state-current ivy-last))
+   (let ((swiper-min-highlight 1))
+ (swiper--update-input-ivy)
   (swiper--avy-goto (swiper--avy-candidate)))
 
 (declare-function mc/create-fake-cursor-at-point "ext:multiple-cursors-core")



[elpa] externals/swiper updated (6f17f80 -> 9393004)

2021-05-21 Thread Basil L. Contovounesios
blc pushed a change to branch externals/swiper.

  from  6f17f80   Merge branch 'master' into externals/swiper
  adds  e8ac2e2   Consider character widths when inserting prompt
  adds  7c5d49f   Improve manual line wrapping in long prompts
   new  f6b46bc   Fix swiper-avy error with swiper-isearch (#2873)
   new  a5eade0   Fix swiper-avy indexing in swiper-isearch (#2873)
   new  9393004   Merge branch 'master' into externals/swiper


Summary of changes:
 swiper.el | 40 ++--
 1 file changed, 26 insertions(+), 14 deletions(-)



[elpa] externals/org updated (846801e -> 52b0979)

2021-05-21 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  846801e   manual: More capitalization
   new  21eb69c   org-agenda-files: Work with relative file paths
   new  52b0979   Merge branch 'maint'


Summary of changes:
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[elpa] externals-release/org 21eb69c: org-agenda-files: Work with relative file paths

2021-05-21 Thread ELPA Syncer
branch: externals-release/org
commit 21eb69c413681f7a3ef5d512685ade706045bd02
Author: Sun Lin 
Commit: Nicolas Goaziou 

org-agenda-files: Work with relative file paths

* lisp/org.el (org-agenda-files): Make sure org-agenda-files work with 
relative
file paths.

TINYCHANGE
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 25dce46..a8b584e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15355,7 +15355,7 @@ used by the agenda files.  If ARCHIVE is `ifmode', do 
this only if
 (if (file-directory-p f)
 (directory-files
  f t org-agenda-file-regexp)
-  (list f)))
+  (list (expand-file-name f org-directory
   files)))
 (when org-agenda-skip-unavailable-files
   (setq files (delq nil



[elpa] externals/org 52b0979: Merge branch 'maint'

2021-05-21 Thread ELPA Syncer
branch: externals/org
commit 52b09799cfba0a847e93c9e21883266570644245
Merge: 846801e 21eb69c
Author: Nicolas Goaziou 
Commit: Nicolas Goaziou 

Merge branch 'maint'
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0cd88d3..1bd9e02 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15451,7 +15451,7 @@ used by the agenda files.  If ARCHIVE is `ifmode', do 
this only if
 (if (file-directory-p f)
 (directory-files
  f t org-agenda-file-regexp)
-  (list f)))
+  (list (expand-file-name f org-directory
   files)))
 (when org-agenda-skip-unavailable-files
   (setq files (delq nil