[elpa] externals/vertico 31d0191: Improve formatting of flat display

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 31d01916a09a3a7dc2b5f640dfaaac5d09dfbef8
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve formatting of flat display
---
 extensions/vertico-flat.el | 67 +-
 1 file changed, 42 insertions(+), 25 deletions(-)

diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el
index 10ac579..8e5a473 100644
--- a/extensions/vertico-flat.el
+++ b/extensions/vertico-flat.el
@@ -32,36 +32,56 @@
 
 (require 'vertico)
 
-(defvar vertico-flat--group-format nil)
+(defcustom vertico-flat-separator
+  (list (propertize "{" 'face 'minibuffer-prompt)
+(propertize " | " 'face 'minibuffer-prompt)
+(propertize "}" 'face 'minibuffer-prompt))
+  "Separator strings."
+  :type '(list string string string)
+  :group 'vertico)
 
 (defun vertico-flat--display (candidates)
   "Display CANDIDATES horizontally."
   (move-overlay vertico--candidates-ov (point-max) (point-max))
-  (when (>= vertico--index 0)
-(setq candidates
-  (seq-drop-while (lambda (cand)
-(let ((face (get-text-property 0 'face cand)))
-  (not (if (listp face)
-   (memq 'vertico-current face)
- (eq 'vertico-current face)
-  candidates)))
-  (setq candidates
-(seq-map-indexed (lambda (cand idx)
-   (string-trim
-(replace-regexp-in-string
- "[ \t]+" (if (= idx 0) #(" " 0 1 (face 
vertico-current)) " ")
- (substring cand 0 -1
- candidates))
   (overlay-put
vertico--candidates-ov 'after-string
(concat #(" " 0 1 (cursor t))
(if candidates
-   (concat "{" (string-join candidates " | ") "}")
+   (concat (car vertico-flat-separator)
+   (string-join candidates (cadr vertico-flat-separator))
+   (caddr vertico-flat-separator))
  "[No match]"
 
-(defun vertico-flat--affixate (_ candidates)
-  "Return CANDIDATES without adding annotations."
-  candidates)
+(defun vertico-flat--format-candidates (_metadata)
+  "Format candidates."
+  (let* ((index vertico--index)
+ (count vertico-count)
+ (candidates (nthcdr vertico--index vertico--candidates))
+ (width (- (window-width)
+   (length (car vertico-flat-separator))
+   (length (caddr vertico-flat-separator))
+   (point-max)
+   (if vertico--count-ov
+   (length (overlay-get vertico--count-ov 'before-string))
+ 0)))
+ (result))
+(while (and candidates (> width 0) (> count 0))
+  (let ((cand (car candidates)))
+(when (string-match-p "\n" cand)
+  (setq cand (vertico--truncate-multiline cand width)))
+(setq cand (string-trim
+(replace-regexp-in-string
+ "[ \t]+" (if (= index vertico--index) #(" " 0 1 (face 
vertico-current)) " ")
+ (vertico--format-candidate cand "" "" index 
vertico--index
+(setq index (1+ index)
+  count (1- count)
+  width (- width (string-width cand) (length (cadr 
vertico-flat-separator
+(when (or (not result) (> width 0))
+  (push cand result))
+(pop candidates)))
+(unless (or (= vertico--total 0) (= index vertico--total))
+  (push "…" result))
+(nreverse result)))
 
 ;;;###autoload
 (define-minor-mode vertico-flat-mode
@@ -69,13 +89,10 @@
   :global t
   (cond
(vertico-flat-mode
-(setq vertico-flat--group-format vertico-group-format
-  vertico-group-format nil)
-(advice-add #'vertico--affixate :override #'vertico-flat--affixate)
+(advice-add #'vertico--format-candidates :override 
#'vertico-flat--format-candidates)
 (advice-add #'vertico--display-candidates :override 
#'vertico-flat--display))
(t
-(setq vertico-group-format vertico-flat--group-format)
-(advice-remove #'vertico--affixate #'vertico-flat--affixate)
+(advice-remove #'vertico--format-candidates 
#'vertico-flat--format-candidates)
 (advice-remove #'vertico--display-candidates #'vertico-flat--display
 
 (provide 'vertico-flat)



[nongnu] elpa/sly 41f4d65: Fix #457: be careful when setting lisp-indent-function early

2021-07-10 Thread ELPA Syncer
branch: elpa/sly
commit 41f4d650485217aa1f2afa7c159418f103a09231
Author: João Távora 
Commit: João Távora 

Fix #457: be careful when setting lisp-indent-function early

Probably better to just `require` sly-cl-indent.el at this point.
Better yet, that file could just be put in Emacs as it provides better
offline indentation anyway.

* sly.el (sly--lisp-indent-function): New helper.
(sly-editing-mode): Use it.
---
 sly.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sly.el b/sly.el
index cbb042b..a2a2ba4 100644
--- a/sly.el
+++ b/sly.el
@@ -592,12 +592,18 @@ interactive command.\".")
   ;; See gh#166
   (set (make-local-variable 'company-tooltip-align-annotations) t))
 
+(defun sly--lisp-indent-function (&rest args)
+  (let ((fn (if (fboundp 'sly-common-lisp-indent-function)
+#'sly-common-lisp-indent-function
+  #'lisp-indent-function)))
+(apply fn args)))
+
 ;;;###autoload
 (define-minor-mode sly-editing-mode
   "Minor mode for editing `lisp-mode' buffers."
   nil nil nil
   (sly-mode 1)
-  (setq-local lisp-indent-function 'sly-common-lisp-indent-function))
+  (setq-local lisp-indent-function #'sly--lisp-indent-function))
 
 (define-minor-mode sly-popup-buffer-mode
   "Minor mode for all read-only SLY buffers"



[elpa] externals/vertico updated (31d0191 -> 12a3d83)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/vertico.

  from  31d0191   Improve formatting of flat display
   new  8be38e6   Simplify vertico--remove-face
   new  12a3d83   Rework vertico-indexed


Summary of changes:
 extensions/vertico-indexed.el | 18 ++
 vertico.el| 20 ++--
 2 files changed, 20 insertions(+), 18 deletions(-)



[elpa] externals/vertico 8be38e6 1/2: Simplify vertico--remove-face

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 8be38e6e5d7f88bd25f19287a4e5c84d6a1235f0
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify vertico--remove-face
---
 vertico.el | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/vertico.el b/vertico.el
index bff75a1..f1bae01 100644
--- a/vertico.el
+++ b/vertico.el
@@ -520,16 +520,16 @@ See `resize-mini-windows' for documentation."
 (defun vertico--prompt-selection ()
   "Highlight the prompt if selected."
   (let ((inhibit-modification-hooks t))
-(vertico--add-face 'vertico-current (minibuffer-prompt-end) (point-max)
-   (and (< vertico--index 0) 
(vertico--allow-prompt-selection-p)
+(if (and (< vertico--index 0) (vertico--allow-prompt-selection-p))
+(add-face-text-property (minibuffer-prompt-end) (point-max) 
'vertico-current 'append)
+  (vertico--remove-face (minibuffer-prompt-end) (point-max) 
'vertico-current
 
-(defun vertico--add-face (face beg end add &optional obj)
-  "Add FACE between BEG and END from OBJ if ADD is t, otherwise remove."
+(defun vertico--remove-face (beg end face &optional obj)
+  "Remove FACE between BEG and END from OBJ."
   (while (< beg end)
-(let* ((val (get-text-property beg 'face obj))
-   (faces (remq face (if (listp val) val (list val
-   (next (next-single-property-change beg 'face obj end)))
-  (add-text-properties beg next `(face ,(if add (cons face faces) faces)) 
obj)
+(let ((val (get-text-property beg 'face obj))
+  (next (next-single-property-change beg 'face obj end)))
+  (put-text-property beg next 'face (remq face (if (listp val) val (list 
val))) obj)
   (setq beg next
 
 (defun vertico--exhibit ()
@@ -680,13 +680,13 @@ When the prefix argument is 0, the group order is reset."
 (defun vertico--candidate (&optional hl)
   "Return current candidate string with optional highlighting if HL is 
non-nil."
   (let ((content (minibuffer-contents)))
-(vertico--add-face 'vertico-current 0 (length content) nil content)
+(vertico--remove-face 0 (length content) 'vertico-current content)
 (if (>= vertico--index 0)
 (let ((cand (nth vertico--index vertico--candidates)))
   ;;; XXX Drop the completions-common-part face which is added by 
`completion--twq-all'.
   ;; This is a hack in Emacs and should better be fixed in Emacs 
itself, the corresponding
   ;; code is already marked with a FIXME. Should this be reported as a 
bug?
-  (vertico--add-face 'completions-common-part 0 (length cand) nil cand)
+  (vertico--remove-face 0 (length cand) 'completions-common-part cand)
   (concat (substring content 0 vertico--base)
   (if hl (car (funcall vertico--highlight (list cand))) cand)))
   content)))



[elpa] externals/vertico 12a3d83 2/2: Rework vertico-indexed

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 12a3d83356395cc9af845b60e4a53dd9923ff978
Author: Daniel Mendler 
Commit: Daniel Mendler 

Rework vertico-indexed
---
 extensions/vertico-indexed.el | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/extensions/vertico-indexed.el b/extensions/vertico-indexed.el
index cbd8298..28e4a79 100644
--- a/extensions/vertico-indexed.el
+++ b/extensions/vertico-indexed.el
@@ -50,10 +50,12 @@
prefix)
suffix index start))
 
-(defun vertico-indexed--goto ()
-  "Goto candidate given by `current-prefix-arg'."
-  (when current-prefix-arg
-(vertico--goto (+ vertico-indexed--start (prefix-numeric-value 
current-prefix-arg)
+(defun vertico-indexed--handle-prefix (orig)
+  "Handle prefix argument before calling ORIG function."
+  (let ((vertico--index (if current-prefix-arg
+(+ vertico-indexed--start (prefix-numeric-value 
current-prefix-arg))
+  vertico--index)))
+(funcall orig)))
 
 ;;;###autoload
 (define-minor-mode vertico-indexed-mode
@@ -62,12 +64,12 @@
   (cond
(vertico-indexed-mode
 (advice-add #'vertico--format-candidate :around 
#'vertico-indexed--format-candidate)
-(advice-add #'vertico-insert :before #'vertico-indexed--goto)
-(advice-add #'vertico-exit :before #'vertico-indexed--goto))
+(advice-add #'vertico-insert :around #'vertico-indexed--handle-prefix)
+(advice-add #'vertico-exit :around #'vertico-indexed--handle-prefix))
(t
 (advice-remove #'vertico--format-candidate 
#'vertico-indexed--format-candidate)
-(advice-remove #'vertico-insert #'vertico-indexed--goto)
-(advice-remove #'vertico-exit #'vertico-indexed--goto
+(advice-remove #'vertico-insert #'vertico-indexed--handle-prefix)
+(advice-remove #'vertico-exit #'vertico-indexed--handle-prefix
 
 (provide 'vertico-indexed)
 ;;; vertico-indexed.el ends here



[elpa] externals/ioccur 2ee58f3 2/6: Create README.md

2021-07-10 Thread monnier--- via
branch: externals/ioccur
commit 2ee58f31d9d91422e9d5279aae3d5fd46dcee3aa
Author: Thierry Volpiatto 
Commit: Thierry Volpiatto 

Create README.md
---
 README.md | 4 
 1 file changed, 4 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 000..7673724
--- /dev/null
+++ b/README.md
@@ -0,0 +1,4 @@
+ioccur
+==
+
+incremental occur for Emacs



[elpa] externals/ioccur 2e4f83b 1/6: * ioccur.el: Merge Stefan changes from ELPA.

2021-07-10 Thread monnier--- via
branch: externals/ioccur
commit 2e4f83ba72bc7d0225606176de2ef7a970ca301c
Author: Stefan Monnier 
Commit: Thierry Volpiatto 

* ioccur.el: Merge Stefan changes from ELPA.
Mark unused arg.
(ioccur-print-line): Remove unused `regexp' arg.
(ioccur-find-buffer-matching1): Remove redundant "with hist".
(savehist-save-minibuffer-history): Declare.
(ioccur-goto-line): Simplify and make sure `org-reveal' is defined.
(ioccur-jump): Remove unused var `back-search-fn'.
---
 ioccur.el | 34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/ioccur.el b/ioccur.el
index d2b2a3c..521d3de 100644
--- a/ioccur.el
+++ b/ioccur.el
@@ -1,6 +1,6 @@
 ;;; ioccur.el --- Incremental occur
 
-;; Copyright (C) 2010-2012  Free Software Foundation, Inc.
+;; Copyright (C) 2010-2013  Free Software Foundation, Inc.
 
 ;; Author: Thierry Volpiatto 
 ;; X-URL: https://github.com/thierryvolpiatto/ioccur
@@ -253,7 +253,7 @@ Special commands:
 
 ;; Compatibility
 (unless (fboundp 'window-system)
-  (defun window-system (&optional arg)
+  (defun window-system (&optional _arg)
 window-system))
 
 ;;; Iterators.
@@ -329,7 +329,7 @@ Special commands:
   when (funcall ioccur-search-function regexp (point-at-eol) t)
   do (ioccur-print-line
   (buffer-substring (point-at-bol) (point-at-eol))
-  count (match-string 0) regexp)
+  count (match-string 0))
   do (forward-line 1))
 
 
@@ -353,7 +353,7 @@ If ALL is non--nil highlight the whole string STR."
 (buffer-string))
 (error nil)))
 
-(defun ioccur-print-line (line nline match regexp)
+(defun ioccur-print-line (line nline match)
   "Prepare and insert a matched LINE at line number NLINE in `ioccur-buffer'."
   (with-current-buffer ioccur-buffer
 (let* ((lineno (int-to-string (1+ nline)))
@@ -430,7 +430,7 @@ The buffer completion list is provided by one of:
 depending on which `ioccur-buffer-completion-use-ido' you have choosen."
   ;; Remove doublons maybe added by minibuffer in `ioccur-history'.
   (setq ioccur-history
-(loop with hist for i in ioccur-history
+(loop for i in ioccur-history
when (not (member i hist)) collect i into hist
finally return hist))
 
@@ -463,6 +463,8 @@ depending on which `ioccur-buffer-completion-use-ido' you 
have choosen."
 
   (find-buffer
 
+(defvar savehist-save-minibuffer-history)
+
 ;;;###autoload
 (defun ioccur-find-buffer-matching (regexp)
   "Find all buffers containing a text matching REGEXP.
@@ -511,14 +513,12 @@ See `ioccur-find-buffer-matching1'."
 
 (defun ioccur-goto-line (lineno)
   "Goto LINENO without modifying outline visibility if needed."
-  (flet ((gotoline (numline)
-   (goto-char (point-min)) (forward-line (1- numline
-(if (or (eq major-mode 'org-mode)
-outline-minor-mode)
-(progn
-  (gotoline lineno)
-  (org-reveal))
-(gotoline lineno
+  (goto-char (point-min))
+  (forward-line (1- lineno))
+  (if (and (fboundp 'org-reveal)
+   (or (derived-mode-p 'org-mode)
+   outline-minor-mode))
+  (org-reveal)))
 
 (defun ioccur-forward-line (n)
   "Forward N lines but empty one's."
@@ -564,9 +564,7 @@ See `ioccur-find-buffer-matching1'."
   "Jump to line in other buffer and put an overlay on it.
 Move point to first occurence of `ioccur-pattern'."
   (let* ((line   (buffer-substring (point-at-bol) (point-at-eol)))
- (pos(string-to-number line))
- (back-search-fn (if (eq ioccur-search-function 're-search-forward)
- 're-search-backward 'search-backward)))
+ (pos(string-to-number line)))
 (unless (string= line "")
   (if win-conf
   (set-window-configuration win-conf)
@@ -881,6 +879,8 @@ START-POINT is the point where we start searching in 
buffer."
 
 (defun ioccur-print-buffer (regexp)
   "Pretty Print results matching REGEXP in `ioccur-buffer'."
+  ;; FIXME: Why force tooltip-mode?  What about sessions with both GUI and
+  ;; tty frames?
   (unless (window-system) (setq tooltip-use-echo-area t) (tooltip-mode 1))
   (let* ((cur-method (if (eq ioccur-search-function 're-search-forward)
  "Regexp" "Literal"))
@@ -917,7 +917,7 @@ M-p/n or tab/S-tab History."))
 (if (string= regexp "")
 (progn (erase-buffer) (insert title "\n\n"))
 (erase-buffer)
-(condition-case err
+(condition-case _
 (ioccur-print-results regexp)
   (error (setq wrong-regexp t)))
 (goto-char (point-min))



[elpa] externals/ioccur 59350b2 4/6: Use lexical-binding and cl-lib

2021-07-10 Thread monnier--- via
branch: externals/ioccur
commit 59350b2066d61444f93c8a51b16353e746486e4c
Author: Stefan Monnier 
Commit: Thierry Volpiatto 

Use lexical-binding and cl-lib

Also remove redundant (or dangling) `:group` args.

* ioccur.el: (ioccur-iter-list): Make it a function.
(ioccur-iter-next): Simplify into an alias.
(ioccur-print-results, ioccur-read-search-input): Use pcase.
(ioccur-dired): Check that we're inside a dired buffer.
(ioccur): Tweak the wdired save&restore code.
---
 ioccur.el | 438 +++---
 1 file changed, 220 insertions(+), 218 deletions(-)

diff --git a/ioccur.el b/ioccur.el
index 521d3de..e88ca3d 100644
--- a/ioccur.el
+++ b/ioccur.el
@@ -1,22 +1,22 @@
-;;; ioccur.el --- Incremental occur
+;;; ioccur.el --- Incremental occur  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2010-2013  Free Software Foundation, Inc.
+;; Copyright (C) 2010-2020  Free Software Foundation, Inc.
 
-;; Author: Thierry Volpiatto 
+;; Author: Thierry Volpiatto 
 ;; X-URL: https://github.com/thierryvolpiatto/ioccur
 ;; Version: 2.4
-;; Compatibility: GNU Emacs >=22.3
+;; Package-Requires: ((emacs "24") (cl-lib "0.5"))
 
 ;; 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 the Free Software Foundation; either version 3, or
 ;; (at your option) any later version.
-;; 
+;;
 ;; This program is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 ;; General Public License for more details.
-;; 
+;;
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program; if not, see .
 
@@ -49,7 +49,7 @@
 
 ;;; Code:
 (require 'derived)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
 (require 'outline)
 (eval-when-compile (require 'wdired))
 
@@ -84,12 +84,10 @@
 ;;; User variables.
 (defcustom ioccur-search-delay 0.5
   "During incremental searching, display is updated all these seconds."
-  :group 'ioccur
   :type  'integer)
 
 (defcustom ioccur-search-prompt "Pattern: "
   "Prompt used for `ioccur-occur'."
-  :group 'ioccur
   :type  'string)
 
 (defcustom ioccur-mode-line-string
@@ -102,52 +100,44 @@ S-/Tab:Hist,C-v/t:Scroll,C-d/u:Follow,C-w:Yank tap")
 
   "Minimal documentation of `ioccur' commands displayed in mode-line.
 Set it to nil to remove doc in mode-line."
-  :group 'ioccur
   :type  'string)
 
 (defcustom ioccur-length-line 80
   "Length of the line displayed in ioccur buffer.
 When set to nil lines displayed in `ioccur-buffer' will not be modified.
 See `ioccur-truncate-line'."
-  :group 'ioccur
   :type 'integer)
 
 (defcustom ioccur-max-length-history 100
   "Maximum number of element stored in `ioccur-history'."
-  :group 'ioccur
   :type 'integer)
 
 (defcustom ioccur-buffer-completion-use-ido nil
   "Use ido to choose buffers in `ioccur-find-buffer-matching'."
-  :group 'ioccur
   :type 'symbol)
 
-(defcustom ioccur-default-search-function 're-search-forward
+(defcustom ioccur-default-search-function #'re-search-forward
   "Default search function.
 Use here one of `re-search-forward' or `search-forward'."
-  :group 'ioccur
   :type 'symbol)
 
 (defcustom ioccur-highlight-match-p t
   "Highlight matchs in `ioccur-buffer' when non--nil."
-  :group 'ioccur
   :type 'boolean)
 
 (defcustom ioccur-fontify-buffer-p nil
   "Fontify `ioccur-current-buffer' when non--nil.
 This allow to have syntactic coloration in `ioccur-buffer' but
 it slow down the start of ioccur at first time on large buffers."
-  :group 'ioccur
   :type 'boolean)
 
 (defcustom ioccur-case-fold-search 'smart
-  "Add 'smart' option to `case-fold-search'.
+  "Add smart option to `case-fold-search'.
 When smart is enabled, Ignore case in the search strings
 if pattern contains no uppercase characters.
 Otherwise, with a nil or t value, the behavior is same as
 `case-fold-search'.
-Default value is smart, other possible values are nil and t."
-  :group 'ioccur
+Default value is `smart', other possible values are nil and t."
   :type 'symbol)
 
 (defvar ioccur-read-char-or-event-skip-read-key nil
@@ -161,43 +151,35 @@ Deprecated, should be used only in old Emacs versions.")
 ;;; Faces.
 (defface ioccur-overlay-face
 '((t (:background "Green4" :underline t)))
-  "Face for highlight line in ioccur buffer."
-  :group 'ioccur-faces)
+  "Face for highlight line in ioccur buffer.")
 
 (defface ioccur-match-overlay-face
 '((t (:background "Indianred4" :underline t)))
-  "Face for highlight line in matched buffer."
-  :group 'ioccur-faces)
+  "Face for highlight line in matched buffer.")
 
 (defface ioccur-title-face
 '((t (:background "Dodgerblue4")))
-  "Face for highlight incremental buffer title."
-  :group 'ioccur-faces)
+  "Face for highlight in

[elpa] externals/ioccur updated (95bbe13 -> f7d858b)

2021-07-10 Thread monnier--- via
monnier pushed a change to branch externals/ioccur.

  from  95bbe13   * packages/ioccur/ioccur.el: Use lexical-binding and 
cl-lib
   new  2e4f83b   * ioccur.el: Merge Stefan changes from ELPA. Mark unused 
arg. (ioccur-print-line): Remove unused `regexp' arg. 
(ioccur-find-buffer-matching1): Remove redundant "with hist". 
(savehist-save-minibuffer-history): Declare. (ioccur-goto-line): Simplify and 
make sure `org-reveal' is defined. (ioccur-jump): Remove unused var 
`back-search-fn'.
   new  2ee58f3   Create README.md
   new  4c0ef99   * README.md: Update.
   new  59350b2   Use lexical-binding and cl-lib
   new  fde594d   Merge remote-tracking branch 'elpa/externals/ioccur'
   new  f7d858b   Update my email address


Summary of changes:
 README.md | 7 +++
 ioccur.el | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 README.md



[elpa] externals/ioccur 4c0ef99 3/6: * README.md: Update.

2021-07-10 Thread monnier--- via
branch: externals/ioccur
commit 4c0ef992a6fcd2aed62e3866d56650463108ab5a
Author: Thierry Volpiatto 
Commit: Thierry Volpiatto 

* README.md: Update.
---
 README.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README.md b/README.md
index 7673724..cb3faa3 100644
--- a/README.md
+++ b/README.md
@@ -2,3 +2,6 @@ ioccur
 ==
 
 incremental occur for Emacs
+
+Probably you will want to use and enhanced version supporting multiples 
buffers and more
+by using the [helm](https://github.com/emacs-helm/helm) version.



[elpa] externals/ioccur fde594d 5/6: Merge remote-tracking branch 'elpa/externals/ioccur'

2021-07-10 Thread monnier--- via
branch: externals/ioccur
commit fde594db0ed50aadf7d229958a68b095a51fde83
Merge: 59350b2 95bbe13
Author: Thierry Volpiatto 
Commit: Thierry Volpiatto 

Merge remote-tracking branch 'elpa/externals/ioccur'



[elpa] externals/ioccur f7d858b 6/6: Update my email address

2021-07-10 Thread monnier--- via
branch: externals/ioccur
commit f7d858baf010ca4a3760078490d587d1a1b98abc
Author: Thierry Volpiatto 
Commit: Thierry Volpiatto 

Update my email address
---
 ioccur.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ioccur.el b/ioccur.el
index e88ca3d..dffca7a 100644
--- a/ioccur.el
+++ b/ioccur.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2010-2020  Free Software Foundation, Inc.
 
-;; Author: Thierry Volpiatto 
+;; Author: Thierry Volpiatto 
 ;; X-URL: https://github.com/thierryvolpiatto/ioccur
 ;; Version: 2.4
 ;; Package-Requires: ((emacs "24") (cl-lib "0.5"))



[elpa] externals/vertico updated (12a3d83 -> dc65ca9)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/vertico.

  from  12a3d83   Rework vertico-indexed
   new  3e82c21   Higher priority for the hook
   new  dc65ca9   Add extension vertico-mouse


Summary of changes:
 README.org  |  1 +
 extensions/vertico-mouse.el | 86 +
 vertico.el  |  2 +-
 3 files changed, 88 insertions(+), 1 deletion(-)
 create mode 100644 extensions/vertico-mouse.el



[elpa] externals/vertico dc65ca9 2/2: Add extension vertico-mouse

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit dc65ca91b43c977045a962fcc3cb8a6bc38c9a07
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add extension vertico-mouse
---
 README.org  |  1 +
 extensions/vertico-mouse.el | 86 +
 2 files changed, 87 insertions(+)

diff --git a/README.org b/README.org
index ed8773c..e3f05a5 100644
--- a/README.org
+++ b/README.org
@@ -157,6 +157,7 @@
   - 
[[https://github.com/minad/vertico/blob/main/extensions/vertico-directory.el][vertico-directory.el]]:
 Commands for Ido-like directory navigation
   - 
[[https://github.com/minad/vertico/blob/main/extensions/vertico-flat.el][vertico-flat.el]]:
 Enable =vertico-flat-mode= to enable a flat, horizontal display
   - 
[[https://github.com/minad/vertico/blob/main/extensions/vertico-indexed.el][vertico-indexed.el]]:
 Select indexed candidates with prefix arguments
+  - 
[[https://github.com/minad/vertico/blob/main/extensions/vertico-mouse.el][vertico-mouse.el]]:
 Mouse support for scrolling and candidate selection
   - 
[[https://github.com/minad/vertico/blob/main/extensions/vertico-quick.el][vertico-quick.el]]:
 Select using Avy-style quick keys
   - 
[[https://github.com/minad/vertico/blob/main/extensions/vertico-repeat.el][vertico-repeat.el]]:
 The command =vertico-repeat= repeats the last completion session
   - 
[[https://github.com/minad/vertico/blob/main/extensions/vertico-reverse.el][vertico-reverse.el]]:
 Enable =vertico-reverse-mode= to reverse the display
diff --git a/extensions/vertico-mouse.el b/extensions/vertico-mouse.el
new file mode 100644
index 000..5c1831f
--- /dev/null
+++ b/extensions/vertico-mouse.el
@@ -0,0 +1,86 @@
+;;; vertico-mouse.el --- Mouse support for Vertico -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021  Free Software Foundation, Inc.
+
+;; Author: Daniel Mendler 
+;; Maintainer: Daniel Mendler 
+;; Created: 2021
+;; Version: 0.1
+;; Package-Requires: ((emacs "27.1"))
+;; Homepage: https://github.com/minad/vertico
+
+;; This file is part of GNU Emacs.
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; This package is a Vertico extension, which adds mouse support.
+
+;;; Code:
+
+(require 'vertico)
+
+(defface vertico-mouse
+  '((t :inherit highlight))
+  "Face used for mouse highlighting."
+  :group 'vertico
+  :group 'faces)
+
+(defun vertico--mouse-candidate-map (index)
+  "Return keymap for candidate with INDEX."
+  (let ((map (make-sparse-keymap)))
+(define-key map [mouse-1] (lambda ()
+(interactive)
+(let ((vertico--index index))
+  (vertico-exit
+(define-key map [mouse-3] (lambda ()
+(interactive)
+(let ((vertico--index index))
+  (vertico-insert
+map))
+
+(defun vertico-mouse--format-candidate (orig cand prefix suffix index start)
+  "Format candidate, see `vertico--format-candidate' for arguments."
+  (setq cand (funcall orig cand prefix suffix index start))
+  (when (equal suffix "")
+(setq cand (concat (substring cand 0 -1)
+   (propertize " " 'display '(space :align-to right))
+   "\n"))
+(when (= index vertico--index)
+  (add-face-text-property 0 (length cand) 'vertico-current 'append cand)))
+  (add-text-properties 0 (1- (length cand))
+   `(mouse-face vertico-mouse keymap 
,(vertico--mouse-candidate-map index))
+   cand)
+  cand)
+
+(defun vertico-mouse--setup ()
+  "Setup mouse scrolling."
+  (setq-local mwheel-scroll-up-function #'vertico-next
+  mwheel-scroll-down-function #'vertico-previous))
+
+;;;###autoload
+(define-minor-mode vertico-mouse-mode
+  "Mouse support for Vertico."
+  :global t
+  (cond
+   (vertico-mouse-mode
+(advice-add #'vertico--format-candidate :around 
#'vertico-mouse--format-candidate)
+(advice-add #'vertico--setup :after #'vertico-mouse--setup))
+   (t
+(advice-remove #'vertico--format-candidate 
#'vertico-mouse--format-candidate)
+(advice-remove #'vertico--setup #'vertico-reverse--setup
+
+(provide 'vertico-mouse)
+;;; vertico-mouse.el ends here



[elpa] externals/vertico 3e82c21 1/2: Higher priority for the hook

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 3e82c21d6ff8e3186871352e5bfd08a49bdbc9e5
Author: Daniel Mendler 
Commit: Daniel Mendler 

Higher priority for the hook
---
 vertico.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vertico.el b/vertico.el
index f1bae01..205fce5 100644
--- a/vertico.el
+++ b/vertico.el
@@ -703,7 +703,7 @@ When the prefix argument is 0, the group order is reset."
   completion-auto-help nil
   completion-show-inline-help nil)
   (use-local-map vertico-map)
-  (add-hook 'post-command-hook #'vertico--exhibit -99 'local))
+  (add-hook 'post-command-hook #'vertico--exhibit -90 'local))
 
 (defun vertico--advice (orig &rest args)
   "Advice for ORIG completion function, receiving ARGS."



[elpa] externals/vertico updated (dc65ca9 -> be6d80c)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/vertico.

  from  dc65ca9   Add extension vertico-mouse
   new  1c63fd7   vertico-indexed: Check index range
   new  be6d80c   Improve vertico--format-candidates, such that start 
argument is correct


Summary of changes:
 extensions/vertico-indexed.el | 10 ++---
 vertico.el| 51 +--
 2 files changed, 37 insertions(+), 24 deletions(-)



[elpa] externals/vertico 1c63fd7 1/2: vertico-indexed: Check index range

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 1c63fd7fabcf13b6d87b845f5ae0e2ef5f865fb6
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-indexed: Check index range
---
 extensions/vertico-indexed.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/extensions/vertico-indexed.el b/extensions/vertico-indexed.el
index 28e4a79..7f8a430 100644
--- a/extensions/vertico-indexed.el
+++ b/extensions/vertico-indexed.el
@@ -39,11 +39,12 @@
   :group 'vertico
   :group 'faces)
 
-(defvar-local vertico-indexed--start 0)
+(defvar-local vertico-indexed--min 0)
+(defvar-local vertico-indexed--max 0)
 
 (defun vertico-indexed--format-candidate (orig cand prefix suffix index start)
   "Format candidate, see `vertico--format-candidate' for arguments."
-  (setq-local vertico-indexed--start start)
+  (setq vertico-indexed--min start vertico-indexed--max index)
   (funcall orig cand
(concat (propertize (format "%-2s " (- index start))
'face 'vertico-indexed)
@@ -55,7 +56,10 @@
   (let ((vertico--index (if current-prefix-arg
 (+ vertico-indexed--start (prefix-numeric-value 
current-prefix-arg))
   vertico--index)))
-(funcall orig)))
+(if (or (< vertico--index vertico-indexed--min)
+(> vertico--index vertico-indexed--max))
+(message "Index out of range")
+  (funcall orig
 
 ;;;###autoload
 (define-minor-mode vertico-indexed-mode



[elpa] externals/vertico be6d80c 2/2: Improve vertico--format-candidates, such that start argument is correct

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit be6d80c6628d592fee47d2aa4fa3f57fd7ecacd9
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve vertico--format-candidates, such that start argument is correct
---
 vertico.el | 51 ++-
 1 file changed, 30 insertions(+), 21 deletions(-)

diff --git a/vertico.el b/vertico.el
index 205fce5..3816bb9 100644
--- a/vertico.el
+++ b/vertico.el
@@ -231,7 +231,7 @@ See `resize-mini-windows' for documentation."
   suffix
 (propertize suffix 'face 
'completions-annotations)
 candidates)
-  candidates)))
+  (mapcar (lambda (cand) (list cand "" "")) candidates
 
 (defun vertico--move-to-front (elem list)
   "Move ELEM to front of LIST."
@@ -439,34 +439,43 @@ See `resize-mini-windows' for documentation."
  (group-format (and group-fun vertico-group-format (concat 
vertico-group-format "\n")))
  (start (min (max 0 (- vertico--index (/ vertico-count 2) (if 
group-format -1 0)))
  (max 0 (- vertico--total vertico-count
- (index start)
  (candidates
-  (thread-last (seq-subseq vertico--candidates index
-   (min (+ index vertico-count) 
vertico--total))
+  (thread-last (seq-subseq vertico--candidates start
+   (min (+ start vertico-count) 
vertico--total))
 (funcall vertico--highlight)
 (vertico--affixate metadata)))
- (max-width (- (window-width) 4))
- (curr-line 0) (title) (lines))
-(dolist (cand candidates)
-  (let ((prefix "") (suffix ""))
-(when (consp cand)
-  (setq prefix (cadr cand) suffix (caddr cand) cand (car cand)))
-(when-let (new-title (and group-format (funcall group-fun cand nil)))
+ (curr-line 0) (lines))
+;; Compute group titles
+(let ((index start) (title))
+  (dolist (cand candidates)
+(when-let (new-title (and group-format (funcall group-fun (car cand) 
nil)))
   (unless (equal title new-title)
 (push (format group-format (setq title new-title)) lines))
-  (setq cand (funcall group-fun cand 'transform)))
+  (setcar cand (funcall group-fun (car cand) 'transform)))
 (when (= index vertico--index)
   (setq curr-line (length lines)))
-(when (string-match-p "\n" cand)
-  (setq cand (vertico--truncate-multiline cand max-width)))
-(push (vertico--format-candidate cand prefix suffix index start) lines)
+(push (cons index cand) lines)
 (setq index (1+ index
-(setq lines (nreverse lines) index (length lines))
-(while (> index vertico-count)
-  (if (< curr-line (/ index 2))
-  (nbutlast lines)
-(setq curr-line (1- curr-line) lines (cdr lines)))
-  (setq index (1- index)))
+;; Drop excess lines
+(setq lines (nreverse lines))
+(let ((count (length lines)))
+  (while (> count vertico-count)
+(if (< curr-line (/ count 2))
+(nbutlast lines)
+  (setq curr-line (1- curr-line) lines (cdr lines)))
+(setq count (1- count
+;; Format candidates
+(let ((max-width (- (window-width) 4))
+  (line lines) (start))
+  (while line
+(pcase (car line)
+  (`(,index ,cand ,prefix ,suffix)
+   (setq start (or start index))
+   (when (string-match-p "\n" cand)
+ (setq cand (vertico--truncate-multiline cand max-width)))
+   (setcar line (vertico--format-candidate cand prefix suffix index 
start))
+   (setq index (1+ index
+(pop line)))
 lines))
 
 (defun vertico--display-candidates (lines)



[elpa] externals/consult 90876de 2/2: consult-completion-in-region: Check for ./ and ../

2021-07-10 Thread ELPA Syncer
branch: externals/consult
commit 90876de33a9dee7743000736de5c9704a7c84e8e
Author: Daniel Mendler 
Commit: Daniel Mendler 

consult-completion-in-region: Check for ./ and ../
---
 consult.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/consult.el b/consult.el
index 4350814..adf59ea 100644
--- a/consult.el
+++ b/consult.el
@@ -2114,7 +2114,7 @@ These configuration options are supported:
  (lambda (_inp cand)
(substitute-in-file-name cand)))
 ;; Ensure that ./ prefix is kept for the shell 
(#356)
-((string-prefix-p "./" initial)
+((string-match-p "\\`\\.\\.?/" initial)
  (lambda (_inp cand)
(setq cand (file-relative-name 
(substitute-in-file-name cand)))
(if (string-match-p "\\`\\.\\.?/" cand) cand 
(concat "./" cand



[elpa] externals/consult updated (f17db95 -> 90876de)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/consult.

  from  f17db95   consult-completing-read-multiple: Update history 
accordingly
   new  05c9664   consult-completion-in-region: Ensure that ./ and ../ 
prefix is kept for shell (Fix #356)
   new  90876de   consult-completion-in-region: Check for ./ and ../


Summary of changes:
 consult.el | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)



[elpa] externals/consult 05c9664 1/2: consult-completion-in-region: Ensure that ./ and ../ prefix is kept for shell (Fix #356)

2021-07-10 Thread ELPA Syncer
branch: externals/consult
commit 05c96647572b16979b538daa31a181d944ecc16b
Author: Daniel Mendler 
Commit: Daniel Mendler 

consult-completion-in-region: Ensure that ./ and ../ prefix is kept for 
shell (Fix #356)
---
 consult.el | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/consult.el b/consult.el
index 9badfbb..4350814 100644
--- a/consult.el
+++ b/consult.el
@@ -2108,9 +2108,20 @@ These configuration options are supported:
(consult--insertion-preview start end)
;; transformation function
(if (eq category 'file)
-   (if (file-name-absolute-p initial)
-   (lambda (_inp cand) (substitute-in-file-name 
cand))
- (lambda (_inp cand) (file-relative-name 
(substitute-in-file-name cand
+   (cond
+;; Transform absolute file names
+((file-name-absolute-p initial)
+ (lambda (_inp cand)
+   (substitute-in-file-name cand)))
+;; Ensure that ./ prefix is kept for the shell 
(#356)
+((string-prefix-p "./" initial)
+ (lambda (_inp cand)
+   (setq cand (file-relative-name 
(substitute-in-file-name cand)))
+   (if (string-match-p "\\`\\.\\.?/" cand) cand 
(concat "./" cand
+;; Simplify relative file names
+(t
+ (lambda (_inp cand)
+   (file-relative-name (substitute-in-file-name 
cand)
  (lambda (_inp cand) cand))
;; candidate function
(apply-partially #'run-hook-with-args-until-success



[elpa] externals/vertico feebaba 1/2: vertico-quick: Ensure that quick key space is not trimmed

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit feebabaae3ddb27719bdca903ab76e0138dcb8cd
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-quick: Ensure that quick key space is not trimmed
---
 extensions/vertico-quick.el | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index a179f5a..e237d02 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -64,7 +64,9 @@
   (let* ((fst (length vertico-quick1))
  (snd (length vertico-quick2))
  (len (+ fst snd))
- (idx (- index start)))
+ (idx (- index start))
+ ;; Ensure that space is not trimmed by `vertico-flat-mode'
+ (sp (propertize "_" 'display `(space :width 1
 (funcall orig cand
  (concat
   (if (>= idx fst)
@@ -73,16 +75,16 @@
 (push (cons (+ (lsh first 16) second) index) 
vertico-quick--list)
 (cond
  ((eq first vertico-quick--first)
-  (concat " " (propertize (char-to-string second) 'face 
'vertico-quick1)))
+  (concat sp (propertize (char-to-string second) 'face 
'vertico-quick1)))
  (vertico-quick--first
-  "   ")
+  (concat sp sp))
  (t
   (concat (propertize (char-to-string first) 'face 
'vertico-quick1)
   (propertize (char-to-string second) 'face 
'vertico-quick2)
 (let ((first (elt vertico-quick1 (mod idx fst
   (push (cons first index) vertico-quick--list)
   (if vertico-quick--first
-  "  "
+  (concat sp " ")
 (concat (propertize (char-to-string first) 'face 
'vertico-quick1) " "
   (make-string (max 1 (- (length prefix) 2)) ?\s))
  suffix index start)))



[elpa] externals/vertico e5a1c4e 2/2: vertico-quick: Fix space

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit e5a1c4ed8da3ef63709a9eaccba320c245f95b04
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-quick: Fix space
---
 extensions/vertico-quick.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index e237d02..7b11f5c 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -66,7 +66,8 @@
  (len (+ fst snd))
  (idx (- index start))
  ;; Ensure that space is not trimmed by `vertico-flat-mode'
- (sp (propertize "_" 'display `(space :width 1
+ (sp #("_" 0 1 (display (space :width 1
+ (sp2 #("__" 0 2 (display (space :width 2)
 (funcall orig cand
  (concat
   (if (>= idx fst)
@@ -77,7 +78,7 @@
  ((eq first vertico-quick--first)
   (concat sp (propertize (char-to-string second) 'face 
'vertico-quick1)))
  (vertico-quick--first
-  (concat sp sp))
+  sp2)
  (t
   (concat (propertize (char-to-string first) 'face 
'vertico-quick1)
   (propertize (char-to-string second) 'face 
'vertico-quick2)



[elpa] externals/vertico updated (be6d80c -> e5a1c4e)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/vertico.

  from  be6d80c   Improve vertico--format-candidates, such that start 
argument is correct
   new  feebaba   vertico-quick: Ensure that quick key space is not trimmed
   new  e5a1c4e   vertico-quick: Fix space


Summary of changes:
 extensions/vertico-quick.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)



[nongnu] elpa/markdown-mode 604dc79 1/2: Fix #578

2021-07-10 Thread ELPA Syncer
branch: elpa/markdown-mode
commit 604dc79ecb7e89974e51403c60d530c2e3771958
Author: Jimmy Yuen Ho Wong 
Commit: Jimmy Yuen Ho Wong 

Fix #578

- Deep copy the imenu index tree to prevent nativecomp JIT from optimizing 
the
  cdr out
---
 CHANGES.md   | 1 +
 markdown-mode.el | 1 +
 2 files changed, 2 insertions(+)

diff --git a/CHANGES.md b/CHANGES.md
index 12cf68a..c40210f 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -32,6 +32,7 @@
 -   Improve `markdown-insert-{bold,italic}` when region starts with 
spaces[GH-613][]
 
 *   Bug fixes:
+-   Fix issue with `nil` being returned from 
`markdown-imenu-create-nested-index` [GH-578][]
 -   Fix remaining flyspell overlay in code block or comment issue 
[GH-311][]
 -   Fix inline URL regular expression which starts/ends with spaces 
[GH-514][]
 -   Fix GFM italic fontification for one character [GH-524][]
diff --git a/markdown-mode.el b/markdown-mode.el
index 502eb26..18465a1 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -5682,6 +5682,7 @@ See `imenu-create-index-function' and 
`imenu--index-alist' for details."
  (setcdr sibling-alist alist)
  (setq cur-alist alist))
(setq cur-level level)
+  (setq root (copy-tree root))
   ;; Footnotes
   (let ((fn (markdown-get-defined-footnotes)))
 (if (or (zerop (length fn))



[nongnu] elpa/markdown-mode 359347b 2/2: Merge pull request #624 from wyuenho/fix-circular-list

2021-07-10 Thread ELPA Syncer
branch: elpa/markdown-mode
commit 359347b2bb15f8d7ef819692ac79759ccfe2c85d
Merge: 1c7d29d 604dc79
Author: Shohei YOSHIDA 
Commit: GitHub 

Merge pull request #624 from wyuenho/fix-circular-list

Fix #578 flatten circular list in nested imenu index
---
 CHANGES.md   | 1 +
 markdown-mode.el | 1 +
 2 files changed, 2 insertions(+)

diff --git a/CHANGES.md b/CHANGES.md
index 12cf68a..c40210f 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -32,6 +32,7 @@
 -   Improve `markdown-insert-{bold,italic}` when region starts with 
spaces[GH-613][]
 
 *   Bug fixes:
+-   Fix issue with `nil` being returned from 
`markdown-imenu-create-nested-index` [GH-578][]
 -   Fix remaining flyspell overlay in code block or comment issue 
[GH-311][]
 -   Fix inline URL regular expression which starts/ends with spaces 
[GH-514][]
 -   Fix GFM italic fontification for one character [GH-524][]
diff --git a/markdown-mode.el b/markdown-mode.el
index 502eb26..18465a1 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -5682,6 +5682,7 @@ See `imenu-create-index-function' and 
`imenu--index-alist' for details."
  (setcdr sibling-alist alist)
  (setq cur-alist alist))
(setq cur-level level)
+  (setq root (copy-tree root))
   ;; Footnotes
   (let ((fn (markdown-get-defined-footnotes)))
 (if (or (zerop (length fn))



[elpa] externals/consult 48acf06: consult--static-if: Specify lexical scoping

2021-07-10 Thread ELPA Syncer
branch: externals/consult
commit 48acf068da5120768873d2598481c7f27577c9de
Author: Daniel Mendler 
Commit: Daniel Mendler 

consult--static-if: Specify lexical scoping
---
 consult.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/consult.el b/consult.el
index adf59ea..8769127 100644
--- a/consult.el
+++ b/consult.el
@@ -615,7 +615,7 @@ The line beginning/ending BEG/END is bound in BODY."
 (defmacro consult--static-if (cond then &rest else)
   "If COND yields non-nil at compile time, do THEN, else do ELSE."
   (declare (indent 2))
-  (if (eval cond) then (macroexp-progn else)))
+  (if (eval cond 'lexical) then (macroexp-progn else)))
 
 (defun consult--display-width (string)
   "Compute width of STRING taking display and invisible properties into 
account."



[elpa] externals/vertico updated (e5a1c4e -> 07ecea8)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/vertico.

  from  e5a1c4e   vertico-quick: Fix space
   new  e7b38d5   Move vertico--tidy-shadowed-file to vertico-directory-tidy
   new  72db698   README: Add vertico-directory to example configuration
   new  07ecea8   Document the chosen hook priority


Summary of changes:
 README.org  | 10 ++
 extensions/vertico-directory.el | 15 ++-
 vertico.el  | 14 +++---
 3 files changed, 27 insertions(+), 12 deletions(-)



[elpa] externals/vertico 72db698 2/3: README: Add vertico-directory to example configuration

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 72db6980ed6d37570205b52dfc497d1f9396d1fd
Author: Daniel Mendler 
Commit: Daniel Mendler 

README: Add vertico-directory to example configuration
---
 README.org | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/README.org b/README.org
index e3f05a5..be24218 100644
--- a/README.org
+++ b/README.org
@@ -57,6 +57,16 @@
   ;; (setq vertico-cycle t)
   )
 
+;; Configure directory extension
+(use-package vertico-directory
+  ;; More convenient directory navigation commands
+  :bind (:map vertico-map
+  ("RET" . vertico-directory-enter)
+  ("DEL" . vertico-directory-delete-char)
+  ("M-DEL" . vertico-directory-delete-word))
+  ;; Tidy shadowed file names
+  :hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
+
 ;; Use the `orderless' completion style.
 ;; Enable `partial-completion' for files to allow path expansion.
 ;; You may prefer to use `initials' instead of `partial-completion'.



[elpa] externals/vertico e7b38d5 1/3: Move vertico--tidy-shadowed-file to vertico-directory-tidy

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit e7b38d55dee2f4d56be36e508089943364309766
Author: Daniel Mendler 
Commit: Daniel Mendler 

Move vertico--tidy-shadowed-file to vertico-directory-tidy
---
 extensions/vertico-directory.el | 15 ++-
 vertico.el  | 11 ---
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/extensions/vertico-directory.el b/extensions/vertico-directory.el
index a1cf87d..283297e 100644
--- a/extensions/vertico-directory.el
+++ b/extensions/vertico-directory.el
@@ -28,11 +28,13 @@
 
 ;; This package is a Vertico extension, which provides Ido-like
 ;; directory navigation commands. The commands can be bound in the
-;; `vertico-map'.
+;; `vertico-map'. Furthermore a cleanup function for shadowed file paths
+;; is provided.
 ;;
 ;; (define-key vertico-map "\r" #'vertico-directory-enter)
 ;; (define-key vertico-map "\d" #'vertico-directory-delete-char)
 ;; (define-key vertico-map "\M-\d" #'vertico-directory-delete-word)
+;; (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)
 
 ;;; Code:
 
@@ -87,5 +89,16 @@
   (forward-word -1)
   (delete-region pt (point)
 
+;;;###autoload
+(defun vertico-directory-tidy ()
+  "Tidy shadowed file name, see `rfn-eshadow-overlay'."
+  (when (and (eq this-command #'self-insert-command)
+ (bound-and-true-p rfn-eshadow-overlay)
+ (overlay-buffer rfn-eshadow-overlay)
+ (= (point) (point-max))
+ (or (>= (- (point) (overlay-end rfn-eshadow-overlay)) 2)
+ (eq ?/ (char-before (- (point) 2)
+(delete-region (overlay-start rfn-eshadow-overlay) (overlay-end 
rfn-eshadow-overlay
+
 (provide 'vertico-directory)
 ;;; vertico-directory.el ends here
diff --git a/vertico.el b/vertico.el
index 3816bb9..58798b4 100644
--- a/vertico.el
+++ b/vertico.el
@@ -516,16 +516,6 @@ See `resize-mini-windows' for documentation."
 (overlay-put vertico--count-ov 'priority 1)
 (overlay-put vertico--count-ov 'before-string (vertico--format-count
 
-(defun vertico--tidy-shadowed-file ()
-  "Tidy shadowed file name, see `rfn-eshadow-overlay'."
-  (when (and (eq this-command #'self-insert-command)
- (bound-and-true-p rfn-eshadow-overlay)
- (overlay-buffer rfn-eshadow-overlay)
- (= (point) (point-max))
- (or (>= (- (point) (overlay-end rfn-eshadow-overlay)) 2)
- (eq ?/ (char-before (- (point) 2)
-(delete-region (overlay-start rfn-eshadow-overlay) (overlay-end 
rfn-eshadow-overlay
-
 (defun vertico--prompt-selection ()
   "Highlight the prompt if selected."
   (let ((inhibit-modification-hooks t))
@@ -543,7 +533,6 @@ See `resize-mini-windows' for documentation."
 
 (defun vertico--exhibit ()
   "Exhibit completion UI."
-  (vertico--tidy-shadowed-file)
   (let* ((buffer-undo-list t) ;; Overlays affect point position and undo list!
  (pt (max 0 (- (point) (minibuffer-prompt-end
  (content (minibuffer-contents-no-properties))



[elpa] externals/vertico 07ecea8 3/3: Document the chosen hook priority

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 07ecea8889903756224d3dbf4f18235f1289200b
Author: Daniel Mendler 
Commit: Daniel Mendler 

Document the chosen hook priority
---
 vertico.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/vertico.el b/vertico.el
index 58798b4..49922e6 100644
--- a/vertico.el
+++ b/vertico.el
@@ -701,6 +701,9 @@ When the prefix argument is 0, the group order is reset."
   completion-auto-help nil
   completion-show-inline-help nil)
   (use-local-map vertico-map)
+  ;; Use -90 to ensure that the exhibit hook runs early such that the
+  ;; candidates are available for Consult preview. It works, but besides
+  ;; that I'dont have a specific reason for this particular value.
   (add-hook 'post-command-hook #'vertico--exhibit -90 'local))
 
 (defun vertico--advice (orig &rest args)



[elpa] externals/vertico 788002f: vertico-flat/quick: Minor cleanup

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 788002fe7d537b31f1e0be53b0f85196cf296a4f
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-flat/quick: Minor cleanup
---
 extensions/vertico-flat.el  | 15 +++
 extensions/vertico-quick.el |  9 -
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el
index 8e5a473..c6366df 100644
--- a/extensions/vertico-flat.el
+++ b/extensions/vertico-flat.el
@@ -35,9 +35,10 @@
 (defcustom vertico-flat-separator
   (list (propertize "{" 'face 'minibuffer-prompt)
 (propertize " | " 'face 'minibuffer-prompt)
-(propertize "}" 'face 'minibuffer-prompt))
+(propertize "}" 'face 'minibuffer-prompt)
+(propertize "…" 'face 'minibuffer-prompt))
   "Separator strings."
-  :type '(list string string string)
+  :type '(list string string string string)
   :group 'vertico)
 
 (defun vertico-flat--display (candidates)
@@ -57,13 +58,11 @@
   (let* ((index vertico--index)
  (count vertico-count)
  (candidates (nthcdr vertico--index vertico--candidates))
- (width (- (window-width)
+ (width (- (window-width) 4
(length (car vertico-flat-separator))
(length (caddr vertico-flat-separator))
-   (point-max)
-   (if vertico--count-ov
-   (length (overlay-get vertico--count-ov 'before-string))
- 0)))
+   (length (cadddr vertico-flat-separator))
+   (car (posn-col-row (posn-at-point (1- (point-max)))
  (result))
 (while (and candidates (> width 0) (> count 0))
   (let ((cand (car candidates)))
@@ -80,7 +79,7 @@
   (push cand result))
 (pop candidates)))
 (unless (or (= vertico--total 0) (= index vertico--total))
-  (push "…" result))
+  (push (cadddr vertico-flat-separator) result))
 (nreverse result)))
 
 ;;;###autoload
diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index 7b11f5c..22ba3d0 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -94,11 +94,10 @@
 (defun vertico-quick-jump ()
   "Jump to candidate using quick keys."
   (interactive)
-  (cl-letf* ((vertico-quick--list nil)
- (key nil)
- (orig-format (symbol-function #'vertico--format-candidate))
- ((symbol-function #'vertico--format-candidate)
-  (apply-partially #'vertico-quick--format-candidate orig-format)))
+  (cl-letf ((vertico-quick--list nil) (key nil)
+((symbol-function #'vertico--format-candidate)
+ (apply-partially #'vertico-quick--format-candidate
+  (symbol-function #'vertico--format-candidate
 (vertico--exhibit)
 (setq key (read-key))
 (when (seq-position vertico-quick2 key)



[elpa] externals/vertico updated (788002f -> 180f54d)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/vertico.

  from  788002f   vertico-flat/quick: Minor cleanup
   new  949987f   vertico-quick/flat: Minor fixes
   new  11fcf91   vertico-quick: Check that first key matches
   new  5c8bf98   vertico-flat: Use plist for configuration
   new  18d768d   Simplify vertico-quick
   new  180f54d   Ensure that vertico-quick and vertico-flat are compatible


Summary of changes:
 extensions/vertico-flat.el  | 36 --
 extensions/vertico-quick.el | 54 ++---
 2 files changed, 46 insertions(+), 44 deletions(-)



[elpa] externals/vertico 11fcf91 2/5: vertico-quick: Check that first key matches

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 11fcf91a3aaaf6eb24a24ef3b443986addff468a
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-quick: Check that first key matches
---
 extensions/vertico-quick.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index 80f8e13..72a5c07 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -73,7 +73,8 @@
   (if (>= idx fst)
   (let ((first (elt vertico-quick2 (mod (/ (- idx fst) len) 
snd)))
 (second (elt (concat vertico-quick1 vertico-quick2) 
(mod (- idx fst) len
-(push (cons (+ (lsh first 16) second) index) 
vertico-quick--list)
+(push (cons first t) vertico-quick--list)
+(push (cons (+ first (lsh second 16)) index) 
vertico-quick--list)
 (cond
  ((eq first vertico-quick--first)
   (concat sp (propertize (char-to-string second) 'face 
'vertico-quick1)))
@@ -100,11 +101,12 @@
   (symbol-function #'vertico--format-candidate
 (vertico--exhibit)
 (setq key (read-key))
-(when (seq-position vertico-quick2 key)
+(when (and (alist-get key vertico-quick--list)
+   (seq-position vertico-quick2 key))
   (let ((vertico-quick--first key)
 (vertico-quick--list))
 (vertico--exhibit))
-  (setq key (+ (lsh key 16) (read-key
+  (setq key (+ key (lsh (read-key) 16
 (when-let (idx (alist-get key vertico-quick--list))
   (setq vertico--index idx
 



[elpa] externals/vertico 18d768d 4/5: Simplify vertico-quick

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 18d768d10c0d35fa9ae89cf1cb274a60387420f2
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify vertico-quick
---
 extensions/vertico-quick.el | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index 72a5c07..69dce8b 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -64,10 +64,7 @@
   (let* ((fst (length vertico-quick1))
  (snd (length vertico-quick2))
  (len (+ fst snd))
- (idx (- index start))
- ;; Ensure that space is not trimmed by `vertico-flat-mode'
- (sp #("_" 0 1 (display (space :width 1
- (sp2 #("__" 0 2 (display (space :width 2)
+ (idx (- index start)))
 (funcall orig cand
  (concat
   (if (>= idx fst)
@@ -77,16 +74,15 @@
 (push (cons (+ first (lsh second 16)) index) 
vertico-quick--list)
 (cond
  ((eq first vertico-quick--first)
-  (concat sp (propertize (char-to-string second) 'face 
'vertico-quick1)))
- (vertico-quick--first
-  sp2)
+  (concat " " (propertize (char-to-string second) 'face 
'vertico-quick1)))
+ (vertico-quick--first "  ")
  (t
   (concat (propertize (char-to-string first) 'face 
'vertico-quick1)
   (propertize (char-to-string second) 'face 
'vertico-quick2)
 (let ((first (elt vertico-quick1 (mod idx fst
   (push (cons first index) vertico-quick--list)
   (if vertico-quick--first
-  (concat sp " ")
+  "  "
 (concat (propertize (char-to-string first) 'face 
'vertico-quick1) " "
   (make-string (max 1 (- (length prefix) 2)) ?\s))
  suffix index start)))



[elpa] externals/vertico 949987f 1/5: vertico-quick/flat: Minor fixes

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 949987fbf7b38973951678564b01b193beada9f6
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-quick/flat: Minor fixes
---
 extensions/vertico-flat.el  | 2 +-
 extensions/vertico-quick.el | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el
index c6366df..75ba4de 100644
--- a/extensions/vertico-flat.el
+++ b/extensions/vertico-flat.el
@@ -55,7 +55,7 @@
 
 (defun vertico-flat--format-candidates (_metadata)
   "Format candidates."
-  (let* ((index vertico--index)
+  (let* ((index (max 0 vertico--index))
  (count vertico-count)
  (candidates (nthcdr vertico--index vertico--candidates))
  (width (- (window-width) 4
diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index 22ba3d0..80f8e13 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -56,7 +56,7 @@
   :type 'string
   :group 'vertico)
 
-(defvar-local vertico-quick--list 0)
+(defvar-local vertico-quick--list nil)
 (defvar-local vertico-quick--first nil)
 
 (defun vertico-quick--format-candidate (orig cand prefix suffix index start)



[elpa] externals/vertico 5c8bf98 3/5: vertico-flat: Use plist for configuration

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 5c8bf98565855c54c3466e3e8db88d456b345f1e
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-flat: Use plist for configuration
---
 extensions/vertico-flat.el | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el
index 75ba4de..706af81 100644
--- a/extensions/vertico-flat.el
+++ b/extensions/vertico-flat.el
@@ -32,13 +32,14 @@
 
 (require 'vertico)
 
-(defcustom vertico-flat-separator
-  (list (propertize "{" 'face 'minibuffer-prompt)
-(propertize " | " 'face 'minibuffer-prompt)
-(propertize "}" 'face 'minibuffer-prompt)
-(propertize "…" 'face 'minibuffer-prompt))
-  "Separator strings."
-  :type '(list string string string string)
+(defcustom vertico-flat-format
+  '(:left  #("{" 0 1 (face minibuffer-prompt))
+:separator #(" | " 0 3 (face minibuffer-prompt))
+:right #("}" 0 1 (face minibuffer-prompt))
+:ellipsis  #("…" 0 1 (face minibuffer-prompt))
+:no-match  "[No match]")
+  "Formatting strings."
+  :type 'plist
   :group 'vertico)
 
 (defun vertico-flat--display (candidates)
@@ -48,10 +49,10 @@
vertico--candidates-ov 'after-string
(concat #(" " 0 1 (cursor t))
(if candidates
-   (concat (car vertico-flat-separator)
-   (string-join candidates (cadr vertico-flat-separator))
-   (caddr vertico-flat-separator))
- "[No match]"
+   (concat (plist-get vertico-flat-format :left)
+   (string-join candidates (plist-get vertico-flat-format 
:separator))
+   (plist-get vertico-flat-format :right))
+ (plist-get vertico-flat-format :no-match)
 
 (defun vertico-flat--format-candidates (_metadata)
   "Format candidates."
@@ -59,9 +60,10 @@
  (count vertico-count)
  (candidates (nthcdr vertico--index vertico--candidates))
  (width (- (window-width) 4
-   (length (car vertico-flat-separator))
-   (length (caddr vertico-flat-separator))
-   (length (cadddr vertico-flat-separator))
+   (length (plist-get vertico-flat-format :left))
+   (length (plist-get vertico-flat-format :separator))
+   (length (plist-get vertico-flat-format :right))
+   (length (plist-get vertico-flat-format :ellipsis))
(car (posn-col-row (posn-at-point (1- (point-max)))
  (result))
 (while (and candidates (> width 0) (> count 0))
@@ -74,12 +76,12 @@
  (vertico--format-candidate cand "" "" index 
vertico--index
 (setq index (1+ index)
   count (1- count)
-  width (- width (string-width cand) (length (cadr 
vertico-flat-separator
+  width (- width (string-width cand) (length (plist-get 
vertico-flat-format :separator
 (when (or (not result) (> width 0))
   (push cand result))
 (pop candidates)))
 (unless (or (= vertico--total 0) (= index vertico--total))
-  (push (cadddr vertico-flat-separator) result))
+  (push (plist-get vertico-flat-format :ellipsis) result))
 (nreverse result)))
 
 ;;;###autoload



[elpa] externals/vertico 180f54d 5/5: Ensure that vertico-quick and vertico-flat are compatible

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 180f54d933db295a2d5eac1c73eac23fdfa2e8aa
Author: Daniel Mendler 
Commit: Daniel Mendler 

Ensure that vertico-quick and vertico-flat are compatible
---
 extensions/vertico-quick.el | 46 +++--
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index 69dce8b..e75e1fe 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -64,28 +64,30 @@
   (let* ((fst (length vertico-quick1))
  (snd (length vertico-quick2))
  (len (+ fst snd))
- (idx (- index start)))
-(funcall orig cand
- (concat
-  (if (>= idx fst)
-  (let ((first (elt vertico-quick2 (mod (/ (- idx fst) len) 
snd)))
-(second (elt (concat vertico-quick1 vertico-quick2) 
(mod (- idx fst) len
-(push (cons first t) vertico-quick--list)
-(push (cons (+ first (lsh second 16)) index) 
vertico-quick--list)
-(cond
- ((eq first vertico-quick--first)
-  (concat " " (propertize (char-to-string second) 'face 
'vertico-quick1)))
- (vertico-quick--first "  ")
- (t
-  (concat (propertize (char-to-string first) 'face 
'vertico-quick1)
-  (propertize (char-to-string second) 'face 
'vertico-quick2)
-(let ((first (elt vertico-quick1 (mod idx fst
-  (push (cons first index) vertico-quick--list)
-  (if vertico-quick--first
-  "  "
-(concat (propertize (char-to-string first) 'face 
'vertico-quick1) " "
-  (make-string (max 1 (- (length prefix) 2)) ?\s))
- suffix index start)))
+ (idx (- index start))
+ (keys (if (>= idx fst)
+   (let ((first (elt vertico-quick2 (mod (/ (- idx fst) len) 
snd)))
+ (second (elt (concat vertico-quick1 vertico-quick2) 
(mod (- idx fst) len
+ (push (cons first t) vertico-quick--list)
+ (push (cons (+ first (lsh second 16)) index) 
vertico-quick--list)
+ (cond
+  ((eq first vertico-quick--first)
+   (concat " " (propertize (char-to-string second) 'face 
'vertico-quick1)))
+  (vertico-quick--first "  ")
+  (t
+   (concat (propertize (char-to-string first) 'face 
'vertico-quick1)
+   (propertize (char-to-string second) 'face 
'vertico-quick2)
+ (let ((first (elt vertico-quick1 (mod idx fst
+   (push (cons first index) vertico-quick--list)
+   (if vertico-quick--first
+   "  "
+ (concat (propertize (char-to-string first) 'face 
'vertico-quick1) " "))
+(if (bound-and-true-p vertico-flat-mode)
+(setq keys (replace-regexp-in-string " " "" keys)
+  cand (string-trim cand)
+  cand (substring cand (min (length cand) (length keys
+  (setq keys (concat keys (make-string (max 1 (- (length prefix) 2)) 
?\s
+(funcall orig cand keys suffix index start)))
 
 ;;;###autoload
 (defun vertico-quick-jump ()



[elpa] externals/vertico 5188e0e: vertico-quick: Add modus colors

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 5188e0efd20ac902f5eb5981287d83ebb90208c3
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-quick: Add modus colors
---
 extensions/vertico-quick.el | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el
index e75e1fe..6da93e3 100644
--- a/extensions/vertico-quick.el
+++ b/extensions/vertico-quick.el
@@ -35,13 +35,21 @@
 (require 'vertico)
 
 (defface vertico-quick1
-  '((t :weight bold :background "#d5baff" :foreground "black"))
+  'class color) (min-colors 88) (background dark))
+ :background "#7042a2" :weight bold :foreground "white")
+(((class color) (min-colors 88) (background light))
+ :weight bold :background "#d5baff" :foreground "black")
+(t :background "magenta" :foreground "white"))
   "Face used for the first quick key."
   :group 'vertico
   :group 'faces)
 
 (defface vertico-quick2
-  '((t :weight bold :background "#8ae4f2" :foreground "black"))
+  'class color) (min-colors 88) (background dark))
+ :background "#004065" :weight bold :foreground "white")
+(((class color) (min-colors 88) (background light))
+ :weight bold :background "#8ae4f2" :foreground "black")
+(t :background "blue" :foreground "white"))
   "Face used for the second quick key."
   :group 'vertico
   :group 'faces)



[elpa] externals/consult 2d8751a: project buffers: Check default directory instead of buffer-file-name (Fix #357)

2021-07-10 Thread ELPA Syncer
branch: externals/consult
commit 2d8751a5a73d36da7550c06ae5ca67fe12520bcf
Author: Daniel Mendler 
Commit: Daniel Mendler 

project buffers: Check default directory instead of buffer-file-name (Fix 
#357)
---
 consult.el | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/consult.el b/consult.el
index 8769127..e3f13b4 100644
--- a/consult.el
+++ b/consult.el
@@ -3507,10 +3507,12 @@ If NORECORD is non-nil, do not record the buffer switch 
in the buffer list."
 ,(lambda ()
(when-let (root (consult--project-root))
  (mapcar #'buffer-name
- (seq-filter (lambda (x)
-   (when-let (file (buffer-file-name x))
- (string-prefix-p root file)))
- (consult--cached-buffers))
+ (seq-filter
+  (lambda (x)
+(string-prefix-p
+ root
+ (expand-file-name (buffer-local-value 'default-directory 
x
+  (consult--cached-buffers))
   "Project buffer candidate source for `consult-buffer'.")
 
 (defvar consult--source-project-file



[elpa] externals/js2-mode updated (4eaf98e -> 3bbff3c)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/js2-mode.

  from  4eaf98e   Support for dynamic imports and `import.meta`
   new  fc82b04   Support private class members
   new  3bbff3c   Use memq instead of member


Summary of changes:
 NEWS.md |  2 ++
 js2-mode.el | 39 ++-
 tests/parser.el | 12 
 3 files changed, 40 insertions(+), 13 deletions(-)



[elpa] externals/js2-mode fc82b04 1/2: Support private class members

2021-07-10 Thread ELPA Syncer
branch: externals/js2-mode
commit fc82b042fd12d8bb4d66750d4f392d40431d8a87
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Support private class members

Resolves #537
---
 NEWS.md |  2 ++
 js2-mode.el | 33 +++--
 tests/parser.el | 12 
 3 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 932d99d..224a034 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,8 @@
 
 ## Next
 
+* Support for private class memebers
+  ([#537](https://github.com/mooz/js2-mode/issues/537)).
 * Support for dynamic imports and `import.meta`
   ([#547](https://github.com/mooz/js2-mode/issues/547)).
 * Support for trailing comma in arrow function parameters
diff --git a/js2-mode.el b/js2-mode.el
index a3630b6..35b741c 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -657,7 +657,9 @@ which doesn't seem particularly useful, but Rhino permits 
it."
 (defvar js2-EXPON 175)
 (defvar js2-NULLISH-COALESCING 176) ; nullish coalescing (obj.value ?? 
obj.defaultValue ?? 0))
 
-(defconst js2-num-tokens (1+ js2-NULLISH-COALESCING))
+(defvar js2-PRIVATE_NAME 177)  ; this.#bar();
+
+(defconst js2-num-tokens (1+ js2-PRIVATE_NAME))
 
 (defconst js2-debug-print-trees nil)
 
@@ -5898,6 +5900,7 @@ the token is flagged as such."
 During operation, creates an instance of `js2-token' struct, sets
 its relevant fields and puts it into `js2-ti-tokens'."
   (let (identifier-start
+identifier-private
 is-unicode-escape-start c
 contains-escape escape-val str result base
 look-for-slash continue tt legacy-octal
@@ -5943,7 +5946,10 @@ its relevant fields and puts it into `js2-ti-tokens'."
  (js2-unget-char)
  (setq c ?\\)))
   (t
-   (when (setq identifier-start (js2-identifier-start-p c))
+   (when (setq identifier-start (or (js2-identifier-start-p c)
+(and
+ (eq c ?#)
+ (setq identifier-private t
  (setq js2-ts-string-buffer nil)
  (js2-add-to-string c
  (when identifier-start
@@ -6003,7 +6009,11 @@ its relevant fields and puts it into `js2-ti-tokens'."
(throw 'return (js2-tt-code result
;; If we want to intern these as Rhino does, just use (intern str)
(setf (js2-token-string token) str)
-   (throw 'return js2-NAME)); end identifier/kwd check
+   (throw 'return
+  (if identifier-private
+  js2-PRIVATE_NAME
+js2-NAME)
+  )); end identifier/kwd check
  ;; is it a number?
  (when (or (js2-digit-p c)
(and (eq c ?.) (js2-digit-p (js2-peek-char
@@ -8021,7 +8031,7 @@ string is NAME.  Returns nil and keeps current token 
otherwise."
   "Consume token and return t if next token is a valid property name.
 If `js2-language-version' is >= 180, a keyword or reserved word
 is considered valid name as well."
-  (if (eq js2-NAME (js2-get-prop-name-token))
+  (if (memq (js2-get-prop-name-token) `(,js2-NAME ,js2-PRIVATE_NAME))
   t
 (js2-unget-token)
 nil))
@@ -10514,7 +10524,7 @@ Last token parsed must be `js2-RB'."
 tt (js2-get-prop-name-token))
   (cond
;; handles: name, ns::name, ns::*, ns::[expr]
-   ((= tt js2-NAME)
+   ((or (= tt js2-NAME) (= tt js2-PRIVATE_NAME))
 (setq ref (js2-parse-property-name -1 nil member-type-flags)))
;; handles: *, *::name, *::*, *::[expr]
((= tt js2-MUL)
@@ -11062,7 +11072,7 @@ expression)."
(= js2-NAME tt)
(member prop '("get" "set" "async"))
(member (js2-peek-token 'KEYWORD_IS_NAME)
-   (list js2-NAME js2-STRING js2-NUMBER js2-LB)))
+   (list js2-NAME js2-PRIVATE_NAME js2-STRING 
js2-NUMBER js2-LB)))
   (setq previous-token (js2-current-token)
 tt (js2-get-prop-name-token
   (cond
@@ -11073,7 +11083,7 @@ expression)."
 (setq after-comma nil
   elem (js2-make-unary nil js2-TRIPLEDOT 'js2-parse-assign-expr)))
;; Found a key/value property (of any sort)
-   ((member tt (list js2-NAME js2-STRING js2-NUMBER js2-LB))
+   ((member tt (list js2-NAME js2-PRIVATE_NAME js2-STRING js2-NUMBER 
js2-LB))
 (setq after-comma nil
   elem (js2-parse-named-prop tt previous-token class-p))
 (if (and (null elem)
@@ -11137,7 +11147,7 @@ expression)."
 (defun js2-parse-named-prop (tt previous-token &optional class-p)
   "Parse a name, string, or getter/setter object property.
 When `js2-is-in-destructuring' is t, forms like {a, b, c} will be permitted."
-  (let ((key (js2-parse-prop-name tt))
+  (let ((key (js2-parse-prop-name tt class-p))
 (prop (and previous-token (js2-to

[elpa] externals/js2-mode 3bbff3c 2/2: Use memq instead of member

2021-07-10 Thread ELPA Syncer
branch: externals/js2-mode
commit 3bbff3c1064dfd43143c03b8e05bb9bcb387a842
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Use memq instead of member

TBH, perf improvement is within the margin of error.
---
 js2-mode.el | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/js2-mode.el b/js2-mode.el
index 35b741c..d72f4ec 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -11071,8 +11071,8 @@ expression)."
 (when (and (>= js2-language-version 200)
(= js2-NAME tt)
(member prop '("get" "set" "async"))
-   (member (js2-peek-token 'KEYWORD_IS_NAME)
-   (list js2-NAME js2-PRIVATE_NAME js2-STRING 
js2-NUMBER js2-LB)))
+   (memq (js2-peek-token 'KEYWORD_IS_NAME)
+ `(,js2-NAME ,js2-PRIVATE_NAME ,js2-STRING ,js2-NUMBER 
,js2-LB)))
   (setq previous-token (js2-current-token)
 tt (js2-get-prop-name-token
   (cond
@@ -11083,7 +11083,7 @@ expression)."
 (setq after-comma nil
   elem (js2-make-unary nil js2-TRIPLEDOT 'js2-parse-assign-expr)))
;; Found a key/value property (of any sort)
-   ((member tt (list js2-NAME js2-PRIVATE_NAME js2-STRING js2-NUMBER 
js2-LB))
+   ((memq tt `(,js2-NAME ,js2-PRIVATE_NAME ,js2-STRING ,js2-NUMBER 
,js2-LB))
 (setq after-comma nil
   elem (js2-parse-named-prop tt previous-token class-p))
 (if (and (null elem)
@@ -11235,9 +11235,9 @@ string or expression."
  ((and (>= js2-language-version 200)
(if class-p
(and (setq tt (js2-peek-token-or-eol))
-(member tt (list js2-EOL js2-RC js2-SEMI)))
+(memq tt `(,js2-EOL ,js2-RC ,js2-SEMI)))
  (and (setq tt (js2-peek-token))
-  (member tt (list js2-COMMA js2-RC))
+  (memq tt `(,js2-COMMA ,js2-RC))
   (js2-name-node-p prop
   (setq result (make-js2-object-prop-node
 :pos pos



[elpa] externals/vertico updated (5188e0e -> d57f2d7)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/vertico.

  from  5188e0e   vertico-quick: Add modus colors
   new  0823fad   vertico-flat: Resize window
   new  9bb746c   Revert "vertico-flat: Resize window"
   new  d57f2d7   vertico-flat: Add highlighting


Summary of changes:
 extensions/vertico-flat.el | 1 +
 1 file changed, 1 insertion(+)



[elpa] externals/vertico 0823fad 1/3: vertico-flat: Resize window

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 0823fad4f6bc7d03c28f3a072c3f1d3f49c397b9
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-flat: Resize window
---
 extensions/vertico-flat.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el
index 706af81..ff9dc4b 100644
--- a/extensions/vertico-flat.el
+++ b/extensions/vertico-flat.el
@@ -52,7 +52,10 @@
(concat (plist-get vertico-flat-format :left)
(string-join candidates (plist-get vertico-flat-format 
:separator))
(plist-get vertico-flat-format :right))
- (plist-get vertico-flat-format :no-match)
+ (plist-get vertico-flat-format :no-match
+  (let ((window-resize-pixelwise t)
+(window-min-height 1))
+(window-resize nil (- (window-height)
 
 (defun vertico-flat--format-candidates (_metadata)
   "Format candidates."



[elpa] externals/vertico d57f2d7 3/3: vertico-flat: Add highlighting

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit d57f2d762f64655f3e65fba9e88c5831b6e54582
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-flat: Add highlighting
---
 extensions/vertico-flat.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el
index 706af81..98044d4 100644
--- a/extensions/vertico-flat.el
+++ b/extensions/vertico-flat.el
@@ -68,6 +68,7 @@
  (result))
 (while (and candidates (> width 0) (> count 0))
   (let ((cand (car candidates)))
+(setq cand (car (funcall vertico--highlight (list cand
 (when (string-match-p "\n" cand)
   (setq cand (vertico--truncate-multiline cand width)))
 (setq cand (string-trim



[elpa] externals/vertico 9bb746c 2/3: Revert "vertico-flat: Resize window"

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 9bb746c9536ab2a7a2bfd7d42ba778766283f5ef
Author: Daniel Mendler 
Commit: Daniel Mendler 

Revert "vertico-flat: Resize window"

This reverts commit 0823fad4f6bc7d03c28f3a072c3f1d3f49c397b9.
---
 extensions/vertico-flat.el | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/extensions/vertico-flat.el b/extensions/vertico-flat.el
index ff9dc4b..706af81 100644
--- a/extensions/vertico-flat.el
+++ b/extensions/vertico-flat.el
@@ -52,10 +52,7 @@
(concat (plist-get vertico-flat-format :left)
(string-join candidates (plist-get vertico-flat-format 
:separator))
(plist-get vertico-flat-format :right))
- (plist-get vertico-flat-format :no-match
-  (let ((window-resize-pixelwise t)
-(window-min-height 1))
-(window-resize nil (- (window-height)
+ (plist-get vertico-flat-format :no-match)
 
 (defun vertico-flat--format-candidates (_metadata)
   "Format candidates."



[elpa] externals/which-key 1e1b7cb 1/2: Remove some obsolete variables/functions

2021-07-10 Thread ELPA Syncer
branch: externals/which-key
commit 1e1b7cb6f0b17835876ce772e1bce9d43e7cafbb
Author: Justin Burkett 
Commit: Justin Burkett 

Remove some obsolete variables/functions
---
 which-key.el | 29 -
 1 file changed, 29 deletions(-)

diff --git a/which-key.el b/which-key.el
index ff0db27..a493557 100644
--- a/which-key.el
+++ b/which-key.el
@@ -140,16 +140,6 @@ remapped given the currently active keymaps."
   :group 'which-key
   :type 'boolean)
 
-(defvar which-key-key-replacement-alist nil)
-(make-obsolete-variable 'which-key-key-replacement-alist
-'which-key-replacement-alist "2016-11-21")
-(defvar which-key-description-replacement-alist nil)
-(make-obsolete-variable 'which-key-description-replacement-alist
-'which-key-replacement-alist "2016-11-21")
-(defvar which-key-key-based-description-replacement-alist nil)
-(make-obsolete-variable 'which-key-key-based-description-replacement-alist
-'which-key-replacement-alist "2016-11-21")
-
 (defcustom which-key-replacement-alist
   (delq nil
 `(((nil . "which-key-show-next-page-no-cycle") . (nil . "wk next pg"))
@@ -666,9 +656,6 @@ update.")
   "select-window" "switch-frame" "-state"
   "which-key"
 
-(make-obsolete-variable 'which-key-prefix-name-alist nil "2016-10-05")
-(make-obsolete-variable 'which-key-prefix-title-alist nil "2016-10-05")
-
 (defvar which-key--pages-obj nil)
 (cl-defstruct which-key--pages
   pages
@@ -1008,22 +995,6 @@ addition KEY-SEQUENCE REPLACEMENT pairs) to apply."
 (put 'which-key-add-major-mode-key-based-replacements
  'lisp-indent-function 'defun)
 
-(defalias 'which-key-add-prefix-title 'which-key-add-key-based-replacements)
-(make-obsolete 'which-key-add-prefix-title
-   'which-key-add-key-based-replacements
-   "2016-10-05")
-
-(defalias 'which-key-declare-prefixes 'which-key-add-key-based-replacements)
-(make-obsolete 'which-key-declare-prefixes
-   'which-key-add-key-based-replacements
-   "2016-10-05")
-
-(defalias 'which-key-declare-prefixes-for-mode
-  'which-key-add-major-mode-key-based-replacements)
-(make-obsolete 'which-key-declare-prefixes-for-mode
-   'which-key-add-major-mode-key-based-replacements
-   "2016-10-05")
-
 (defun which-key-define-key-recursively (map key def &optional at-root)
   "Recursively bind KEY in MAP to DEF on every level of MAP except the first.
 If AT-ROOT is non-nil the binding is also placed at the root of MAP."



[elpa] externals/which-key c39c747 2/2: Merge remote-tracking branch 'origin/master'

2021-07-10 Thread ELPA Syncer
branch: externals/which-key
commit c39c747a0922d78db76bf7bad791b1154395a7f4
Merge: 1e1b7cb 2537514
Author: Justin Burkett 
Commit: Justin Burkett 

Merge remote-tracking branch 'origin/master'
---
 .gitignore |  5 +
 which-key-tests.el | 45 -
 2 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/.gitignore b/.gitignore
index de0966b..5998b43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,10 @@
 *~
 *.elc
+
+# Autogenerated by GNU ELPA scripts
+/which-key-autoloads.el
+/which-key-pkg.el
+
 # Used to setup library paths for emacs -Q
 private-test-setup.el
 /.cask/
diff --git a/which-key-tests.el b/which-key-tests.el
index 877f009..cce75ce 100644
--- a/which-key-tests.el
+++ b/which-key-tests.el
@@ -1,6 +1,6 @@
 ;;; which-key-tests.el --- Tests for which-key.el -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2017  Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021  Free Software Foundation, Inc.
 
 ;; Author: Justin Burkett 
 ;; Maintainer: Justin Burkett 
@@ -26,12 +26,11 @@
 
 (require 'which-key)
 (require 'ert)
-(require 'evil)
 
 (ert-deftest which-key-test--keymap-based-bindings ()
   (let ((map (make-sparse-keymap))
 (prefix-map (make-sparse-keymap)))
-(define-key prefix-map "x" 'ignore)
+(define-key prefix-map "x" #'ignore)
 (define-key map "\C-a" 'complete)
 (define-key map "\C-b" prefix-map)
 (which-key-add-keymap-based-replacements map
@@ -68,8 +67,8 @@
   (let ((which-key-replacement-alist
  '((("C-c [a-d]" . nil) . ("C-c a" . "c-c a"))
(("C-c .+" . nil) . ("C-c *" . "c-c *"
-(test-mode-1 t)
-(test-mode-2 nil)
+(test-mode-1 't)
+(test-mode-2 'nil)
 which-key-allow-multiple-replacements)
 (which-key-add-key-based-replacements
   "C-c ." "test ."
@@ -141,12 +140,16 @@
   (should (equal (which-key--extract-key "M-a a .. c") "a .. c")))
 
 (ert-deftest which-key-test--get-keymap-bindings ()
+  (skip-unless (require 'evil nil t))
+  (defvar evil-local-mode)
+  (defvar evil-state)
+  (declare-function evil-define-key* "ext:evil")
   (let ((map (make-sparse-keymap))
 (evil-local-mode t)
 (evil-state 'normal)
 which-key-replacement-alist)
 (define-key map [which-key-a] '(which-key "blah"))
-(define-key map "b" 'ignore)
+(define-key map "b" #'ignore)
 (define-key map "c" "c")
 (define-key map "dd" "dd")
 (define-key map "eee" "eee")
@@ -198,58 +201,58 @@
 (let ((which-key-sort-uppercase-first t))
   (should
(equal
-(mapcar 'car (sort (copy-sequence keys) 'which-key-key-order))
+(mapcar #'car (sort (copy-sequence keys) #'which-key-key-order))
 '("SPC" "A" "B" "a" "b" "p" "C-a"
 (let (which-key-sort-uppercase-first)
   (should
(equal
-(mapcar 'car (sort (copy-sequence keys) 'which-key-key-order))
+(mapcar #'car (sort (copy-sequence keys) #'which-key-key-order))
 '("SPC" "a" "b" "p" "A" "B" "C-a"
 (let ((which-key-sort-uppercase-first t))
   (should
(equal
-(mapcar 'car (sort (copy-sequence keys) 'which-key-key-order-alpha))
+(mapcar #'car (sort (copy-sequence keys) #'which-key-key-order-alpha))
 '("SPC" "A" "a" "B" "b" "p" "C-a"
 (let (which-key-sort-uppercase-first)
   (should
(equal
-(mapcar 'car (sort (copy-sequence keys) 'which-key-key-order-alpha))
+(mapcar #'car (sort (copy-sequence keys) #'which-key-key-order-alpha))
 '("SPC" "a" "A" "b" "B" "p" "C-a"
 (let ((which-key-sort-uppercase-first t))
   (should
(equal
-(mapcar 'car (sort (copy-sequence keys)
-   'which-key-prefix-then-key-order))
+(mapcar #'car (sort (copy-sequence keys)
+#'which-key-prefix-then-key-order))
 '("SPC" "A" "B" "a" "b" "C-a" "p"
 (let (which-key-sort-uppercase-first)
   (should
(equal
-(mapcar 'car (sort (copy-sequence keys)
-   'which-key-prefix-then-key-order))
+(mapcar #'car (sort (copy-sequence keys)
+#'which-key-prefix-then-key-order))
 '("SPC" "a" "b" "A" "B" "C-a" "p"
 (let ((which-key-sort-uppercase-first t))
   (should
(equal
 (mapcar 'car (sort (copy-sequence keys)
-   'which-key-prefix-then-key-order-reverse))
+   #'which-key-prefix-then-key-order-reverse))
 '("p" "SPC" "A" "B" "a" "b" "C-a"
 (let (which-key-sort-uppercase-first)
   (should
(equal
-(mapcar 'car (sort (copy-sequence keys)
-   'which-key-prefix-then-key-order-reverse))
+(mapcar #'car (sort (copy-sequence keys)
+#'which-key-prefix-then-key-order-reverse))
 '("p" "SPC" "a" "b" "A" "B" "C-a")))

[elpa] externals/vertico updated (d57f2d7 -> 0e4a9bd)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/vertico.

  from  d57f2d7   vertico-flat: Add highlighting
   new  34197f3   vertico--format-candidates: Cleanup
   new  b612cb3   vertico-mouse: Improve wheel scrolling
   new  0e4a9bd   vertico-mouse: Remove unused variable


Summary of changes:
 extensions/vertico-mouse.el | 12 ++--
 vertico.el  | 22 +++---
 2 files changed, 21 insertions(+), 13 deletions(-)



[elpa] externals/vertico 34197f3 1/3: vertico--format-candidates: Cleanup

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 34197f3191034295ecdf88b4bb9de2473ef57c66
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico--format-candidates: Cleanup
---
 vertico.el | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/vertico.el b/vertico.el
index 49922e6..2d4492b 100644
--- a/vertico.el
+++ b/vertico.el
@@ -435,18 +435,18 @@ See `resize-mini-windows' for documentation."
 
 (defun vertico--format-candidates (metadata)
   "Format current candidates with METADATA."
-  (let* ((group-fun (completion-metadata-get metadata 'group-function))
- (group-format (and group-fun vertico-group-format (concat 
vertico-group-format "\n")))
- (start (min (max 0 (- vertico--index (/ vertico-count 2) (if 
group-format -1 0)))
- (max 0 (- vertico--total vertico-count
- (candidates
-  (thread-last (seq-subseq vertico--candidates start
-   (min (+ start vertico-count) 
vertico--total))
-(funcall vertico--highlight)
-(vertico--affixate metadata)))
- (curr-line 0) (lines))
+  (let ((curr-line 0) (lines))
 ;; Compute group titles
-(let ((index start) (title))
+(let* ((start (min (max 0 (- vertico--index (/ vertico-count 2) (1- (mod 
vertico-count 2
+   (max 0 (- vertico--total vertico-count
+   (index start) (title)
+   (group-fun (completion-metadata-get metadata 'group-function))
+   (group-format (and group-fun vertico-group-format (concat 
vertico-group-format "\n")))
+   (candidates
+(thread-last (seq-subseq vertico--candidates start
+ (min (+ start vertico-count) 
vertico--total))
+  (funcall vertico--highlight)
+  (vertico--affixate metadata
   (dolist (cand candidates)
 (when-let (new-title (and group-format (funcall group-fun (car cand) 
nil)))
   (unless (equal title new-title)



[elpa] externals/vertico b612cb3 2/3: vertico-mouse: Improve wheel scrolling

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit b612cb3949c2e205e3be5703c0f556774559420f
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-mouse: Improve wheel scrolling
---
 extensions/vertico-mouse.el | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/extensions/vertico-mouse.el b/extensions/vertico-mouse.el
index 5c1831f..a76932b 100644
--- a/extensions/vertico-mouse.el
+++ b/extensions/vertico-mouse.el
@@ -65,10 +65,19 @@
cand)
   cand)
 
+(defun vertico-mouse--scroll-up (n)
+  "Scroll up by N lines."
+  (setq vertico-mouse--start nil)
+  (vertico--goto (max 0 (+ vertico--index n
+
+(defun vertico-mouse--scroll-down (n)
+  "Scroll down by N lines."
+  (vertico-mouse--scroll-up (- n)))
+
 (defun vertico-mouse--setup ()
   "Setup mouse scrolling."
-  (setq-local mwheel-scroll-up-function #'vertico-next
-  mwheel-scroll-down-function #'vertico-previous))
+  (setq-local mwheel-scroll-up-function #'vertico-mouse--scroll-up
+  mwheel-scroll-down-function #'vertico-mouse--scroll-down))
 
 ;;;###autoload
 (define-minor-mode vertico-mouse-mode



[elpa] externals/vertico 0e4a9bd 3/3: vertico-mouse: Remove unused variable

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit 0e4a9bd7af7792ef68e3c161f28a4d77b4cff474
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-mouse: Remove unused variable
---
 extensions/vertico-mouse.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/extensions/vertico-mouse.el b/extensions/vertico-mouse.el
index a76932b..23a7758 100644
--- a/extensions/vertico-mouse.el
+++ b/extensions/vertico-mouse.el
@@ -67,7 +67,6 @@
 
 (defun vertico-mouse--scroll-up (n)
   "Scroll up by N lines."
-  (setq vertico-mouse--start nil)
   (vertico--goto (max 0 (+ vertico--index n
 
 (defun vertico-mouse--scroll-down (n)



[elpa] externals/corfu defab30: Make corfu buffer read only to prevent accidential modifications

2021-07-10 Thread ELPA Syncer
branch: externals/corfu
commit defab3067527276b81e2e9ac67f81c430e092f8c
Author: Daniel Mendler 
Commit: Daniel Mendler 

Make corfu buffer read only to prevent accidential modifications
---
 corfu.el | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/corfu.el b/corfu.el
index e50512d..085dad1 100644
--- a/corfu.el
+++ b/corfu.el
@@ -239,7 +239,8 @@ filter string with spaces is allowed."
 (right-fringe-width . nil)
 (left-margin-width . 0)
 (right-margin-width . 0)
-(fringes-outside-margins . 0))
+(fringes-outside-margins . 0)
+(buffer-read-only . t))
   "Default child frame buffer parameters.")
 
 ;; Function adapted from posframe.el by tumashu
@@ -275,7 +276,8 @@ filter string with spaces is allowed."
   (dolist (var corfu--buffer-parameters)
 (set (make-local-variable (car var)) (cdr var)))
   (setq-local face-remapping-alist fr)
-  (let ((inhibit-modification-hooks t))
+  (let ((inhibit-modification-hooks t)
+(inhibit-read-only t))
 (erase-buffer)
 (insert content)
 (goto-char (point-min
@@ -343,7 +345,8 @@ filter string with spaces is allowed."
   (when (frame-live-p corfu--frame)
 (make-frame-invisible corfu--frame)
 (with-current-buffer (window-buffer (frame-root-window corfu--frame))
-  (erase-buffer)))
+  (let ((inhibit-read-only t))
+(erase-buffer
   (remove-hook 'window-configuration-change-hook #'corfu--popup-hide))
 
 (defun corfu--move-to-front (elem list)



[elpa] externals/vertico bb9ab12: Fix vertico-indexed

2021-07-10 Thread ELPA Syncer
branch: externals/vertico
commit bb9ab1213d99c55e46d1caaf9214a0bedaaa6643
Author: Daniel Mendler 
Commit: Daniel Mendler 

Fix vertico-indexed
---
 extensions/vertico-indexed.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extensions/vertico-indexed.el b/extensions/vertico-indexed.el
index 7f8a430..c7c2859 100644
--- a/extensions/vertico-indexed.el
+++ b/extensions/vertico-indexed.el
@@ -54,7 +54,7 @@
 (defun vertico-indexed--handle-prefix (orig)
   "Handle prefix argument before calling ORIG function."
   (let ((vertico--index (if current-prefix-arg
-(+ vertico-indexed--start (prefix-numeric-value 
current-prefix-arg))
+(+ vertico-indexed--min (prefix-numeric-value 
current-prefix-arg))
   vertico--index)))
 (if (or (< vertico--index vertico-indexed--min)
 (> vertico--index vertico-indexed--max))



[elpa] externals/corfu updated (defab30 -> 4f426ab)

2021-07-10 Thread ELPA Syncer
elpasync pushed a change to branch externals/corfu.

  from  defab30   Make corfu buffer read only to prevent accidential 
modifications
   new  d42fadc   Extract corfu--make-buffer function
   new  44d49d5   Close popup on click
   new  4f426ab   corfu--popup-hide-on-click: Redirect focus


Summary of changes:
 corfu.el | 46 +++---
 1 file changed, 35 insertions(+), 11 deletions(-)



[elpa] externals/corfu 44d49d5 2/3: Close popup on click

2021-07-10 Thread ELPA Syncer
branch: externals/corfu
commit 44d49d5ccc376f5a8c7280f76cd7a4eff0fa54a0
Author: Daniel Mendler 
Commit: Daniel Mendler 

Close popup on click
---
 corfu.el | 8 
 1 file changed, 8 insertions(+)

diff --git a/corfu.el b/corfu.el
index 15f279c..2bf47af 100644
--- a/corfu.el
+++ b/corfu.el
@@ -243,11 +243,19 @@ filter string with spaces is allowed."
 (buffer-read-only . t))
   "Default child frame buffer parameters.")
 
+(defun corfu--popup-hide-on-click ()
+  "Close if mouse events land in the popup."
+  (when (mouse-event-p last-input-event)
+(select-frame (frame-parent corfu--frame) 'norecord)
+(corfu--popup-hide)
+(setq this-command #'ignore)))
+
 (defun corfu--make-buffer (content)
   "Create corfu buffer with CONTENT."
   (let ((fr face-remapping-alist)
 (buffer (get-buffer-create " *corfu*")))
 (with-current-buffer buffer
+  (add-hook 'pre-command-hook #'corfu--popup-hide-on-click nil 'local)
   (dolist (var corfu--buffer-parameters)
 (set (make-local-variable (car var)) (cdr var)))
   (setq-local face-remapping-alist fr)



[elpa] externals/corfu d42fadc 1/3: Extract corfu--make-buffer function

2021-07-10 Thread ELPA Syncer
branch: externals/corfu
commit d42fadcfed963036b1285f90865cff31f1768046
Author: Daniel Mendler 
Commit: Daniel Mendler 

Extract corfu--make-buffer function
---
 corfu.el | 27 ---
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/corfu.el b/corfu.el
index 085dad1..15f279c 100644
--- a/corfu.el
+++ b/corfu.el
@@ -243,6 +243,21 @@ filter string with spaces is allowed."
 (buffer-read-only . t))
   "Default child frame buffer parameters.")
 
+(defun corfu--make-buffer (content)
+  "Create corfu buffer with CONTENT."
+  (let ((fr face-remapping-alist)
+(buffer (get-buffer-create " *corfu*")))
+(with-current-buffer buffer
+  (dolist (var corfu--buffer-parameters)
+(set (make-local-variable (car var)) (cdr var)))
+  (setq-local face-remapping-alist fr)
+  (let ((inhibit-modification-hooks t)
+(inhibit-read-only t))
+(erase-buffer)
+(insert content)
+(goto-char (point-min
+buffer))
+
 ;; Function adapted from posframe.el by tumashu
 (defun corfu--make-frame (x y width height content)
   "Show child frame at X/Y with WIDTH/HEIGHT and CONTENT."
@@ -262,7 +277,6 @@ filter string with spaces is allowed."
  'resize-mode)))
  (after-make-frame-functions)
  (edge (window-inside-pixel-edges))
- (fr face-remapping-alist)
  (lh (default-line-height))
  (x (max 0 (min (+ (car edge) x
(- (alist-get 'child-frame-border-width 
corfu--frame-parameters)))
@@ -271,16 +285,7 @@ filter string with spaces is allowed."
  (y (if (> (+ yb height lh lh) (frame-pixel-height))
 (- yb height lh 1)
   yb))
- (buffer (get-buffer-create " *corfu*")))
-(with-current-buffer buffer
-  (dolist (var corfu--buffer-parameters)
-(set (make-local-variable (car var)) (cdr var)))
-  (setq-local face-remapping-alist fr)
-  (let ((inhibit-modification-hooks t)
-(inhibit-read-only t))
-(erase-buffer)
-(insert content)
-(goto-char (point-min
+ (buffer (corfu--make-buffer content)))
 (unless (and (frame-live-p corfu--frame)
  (eq (frame-parent corfu--frame) (window-frame)))
   (when corfu--frame (delete-frame corfu--frame))



[elpa] externals/corfu 4f426ab 3/3: corfu--popup-hide-on-click: Redirect focus

2021-07-10 Thread ELPA Syncer
branch: externals/corfu
commit 4f426ab92665cdc622dd6bd7a45549c93362fae7
Author: Daniel Mendler 
Commit: Daniel Mendler 

corfu--popup-hide-on-click: Redirect focus
---
 corfu.el | 25 ++---
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/corfu.el b/corfu.el
index 2bf47af..9ab3592 100644
--- a/corfu.el
+++ b/corfu.el
@@ -243,19 +243,30 @@ filter string with spaces is allowed."
 (buffer-read-only . t))
   "Default child frame buffer parameters.")
 
-(defun corfu--popup-hide-on-click ()
-  "Close if mouse events land in the popup."
-  (when (mouse-event-p last-input-event)
-(select-frame (frame-parent corfu--frame) 'norecord)
-(corfu--popup-hide)
-(setq this-command #'ignore)))
+(defvar corfu--mouse-ignore-map
+  (let ((map (make-sparse-keymap)))
+(dolist (k '(mouse-1 down-mouse-1 drag-mouse-1 double-mouse-1 
triple-mouse-1
+ mouse-2 down-mouse-2 drag-mouse-2 double-mouse-2 
triple-mouse-2
+ mouse-3 down-mouse-3 drag-mouse-3 double-mouse-3 
triple-mouse-3
+ mouse-4 down-mouse-4 drag-mouse-4 double-mouse-4 
triple-mouse-4
+ mouse-5 down-mouse-5 drag-mouse-5 double-mouse-5 
triple-mouse-5
+ mouse-6 down-mouse-6 drag-mouse-6 double-mouse-6 
triple-mouse-6
+ mouse-7 down-mouse-7 drag-mouse-7 double-mouse-7 
triple-mouse-7))
+  (define-key map (vector k) #'ignore))
+map)
+  "Ignore all mouse clicks.")
+
+(defun corfu--popup-redirect-focus ()
+  "Redirect focus from popup."
+  (redirect-frame-focus corfu--frame (frame-parent corfu--frame)))
 
 (defun corfu--make-buffer (content)
   "Create corfu buffer with CONTENT."
   (let ((fr face-remapping-alist)
 (buffer (get-buffer-create " *corfu*")))
 (with-current-buffer buffer
-  (add-hook 'pre-command-hook #'corfu--popup-hide-on-click nil 'local)
+  (add-hook 'pre-command-hook #'corfu--popup-redirect-focus nil 'local)
+  (use-local-map corfu--mouse-ignore-map)
   (dolist (var corfu--buffer-parameters)
 (set (make-local-variable (car var)) (cdr var)))
   (setq-local face-remapping-alist fr)