[elpa] externals/aggressive-completion e57b3a3: Remove debug `message'; release 1.4

2021-04-05 Thread Tassilo Horn
branch: externals/aggressive-completion
commit e57b3a3b380e5d17c483585f3069b79014665be7
Author: Tassilo Horn 
Commit: Tassilo Horn 

Remove debug `message'; release 1.4
---
 aggressive-completion.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/aggressive-completion.el b/aggressive-completion.el
index 890c6cd..8859552 100644
--- a/aggressive-completion.el
+++ b/aggressive-completion.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Tassilo Horn 
 ;; Keywords: minibuffer completion
 ;; Package-Requires: ((emacs "27.1"))
-;; Version: 1.3
+;; Version: 1.4
 
 ;; This file is part of GNU Emacs.
 
@@ -77,7 +77,6 @@ If nil, only show the completion help."
 
 (defun aggressive-completion--do ()
   "Perform aggressive completion."
-  (message "last-command: %S" last-command)
   (when (window-minibuffer-p)
 (let* ((completions (completion-all-sorted-completions))
;; Don't ding if there are no completions, etc.



[elpa] externals/emms updated (de0c407 -> 488d38b)

2021-04-05 Thread Yoni Rabkin
yonirabkin pushed a change to branch externals/emms.

  from  de0c407   * emms.info: new info
   new  5fde053   * doc/emms.texinfo: mention cache reset
   new  779f563   * emms.info: update
   new  033de10   * NEWS: tell the people the news!
   new  9c2f1f1   * emms.el: version bump
   new  488d38b   * doc/developer-release.txt:


Summary of changes:
 NEWS  |   7 ++
 doc/developer-release.txt |   4 +-
 doc/emms.texinfo  |  12 +++-
 emms.el   |   2 +-
 emms.info | 178 --
 5 files changed, 112 insertions(+), 91 deletions(-)



[elpa] externals/emms 5fde053 1/5: * doc/emms.texinfo: mention cache reset

2021-04-05 Thread Yoni Rabkin
branch: externals/emms
commit 5fde053c4db0713e10be0260651b3f7a430db225
Author: Yoni Rabkin 
Commit: Yoni Rabkin 

* doc/emms.texinfo: mention cache reset
---
 doc/emms.texinfo | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/emms.texinfo b/doc/emms.texinfo
index fb86818..2638b3a 100644
--- a/doc/emms.texinfo
+++ b/doc/emms.texinfo
@@ -220,8 +220,8 @@ restart Emacs to let the changes have an effect.
 
 Now we will add all our music to a playlist by invoking @kbd{M-x
 emms-add-directory-tree RET ~/Music/ RET}. We do this because then
-Emms will read the tags of all your music files and caches them (this
-is also required for the Emms browser, @xref{The Browser}.)
+Emms will read the tags of all your music files and caches them (the
+cache is also required for the Emms browser, @xref{The Browser}.)
 
 To switch to the playlist buffer, invoke @kbd{M-x
 emms-playlist-mode-go} or simply @kbd{M-x emms}. You may see that some
@@ -945,13 +945,19 @@ methods and their use in this chapter.
 Fundamentally, info methods are Emacs Lisp functions that are called
 for each track to provide information for that track.  Current info
 methods in Emms are restricted to tracks that are files; they do not
-work with stream URLs (@pxref{Streaming Audio}).  Most of the methods
+work with stream URLs (@pxref{Streaming Audio}).  Some of the methods
 require installation of some additional software that Emms can then
 call to read metadata from disk (@pxref{Metadata Utilities}).
 Finally, some methods work only with a limited set of media file
 formats such as Ogg or MP3, while some methods support a wide variety
 of formats.
 
+If caching is enabled (it is by default) then the metadata for each
+track will be stored in the cache for faster retrieval. That means if
+you change info method and want updated tracks, you will have to reset
+the cache @kbd{M-x emms-cache-reset} and then repopulate with @kbd{M-x
+emms-add-directory-tree RET ~/Music/ RET} or similar.
+
 Automatic track information retrieval is enabled by default in the
 @code{emms-all} setup level (@pxref{Setup}).  That setup level
 configures Emms to use @code{emms-info-native} and



[elpa] externals/emms 033de10 3/5: * NEWS: tell the people the news!

2021-04-05 Thread Yoni Rabkin
branch: externals/emms
commit 033de10eec66a67b2e431f3ddf94fc75e17d611d
Author: Yoni Rabkin 
Commit: Yoni Rabkin 

* NEWS: tell the people the news!
---
 NEWS | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/NEWS b/NEWS
index 2e8592b..3774dd7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+News since version 6.3
+
+  - Native reading of file metadata via emms-info-native.
+  - emms-tag-editor: add pipe capability.
+  - Compatibility with lexical scoping.
+  - Improvements to the fine manual.
+
 News since version 6.2
 
   - Updated documentation



[elpa] externals/emms 779f563 2/5: * emms.info: update

2021-04-05 Thread Yoni Rabkin
branch: externals/emms
commit 779f563d6b381bcac6ef81cf1d3eb928379dd4f7
Author: Yoni Rabkin 
Commit: Yoni Rabkin 

* emms.info: update
---
 emms.info | 178 --
 1 file changed, 93 insertions(+), 85 deletions(-)

diff --git a/emms.info b/emms.info
index 4c46802..32238b4 100644
--- a/emms.info
+++ b/emms.info
@@ -195,8 +195,8 @@ restart Emacs to let the changes have an effect.
 
Now we will add all our music to a playlist by invoking 'M-x
 emms-add-directory-tree RET ~/Music/ RET'.  We do this because then Emms
-will read the tags of all your music files and caches them (this is also
-required for the Emms browser, *Note The Browser::.)
+will read the tags of all your music files and caches them (the cache is
+also required for the Emms browser, *Note The Browser::.)
 
To switch to the playlist buffer, invoke 'M-x emms-playlist-mode-go'
 or simply 'M-x emms'.  You may see that some tracks are displayed with
@@ -798,12 +798,18 @@ chapter.
Fundamentally, info methods are Emacs Lisp functions that are called
 for each track to provide information for that track.  Current info
 methods in Emms are restricted to tracks that are files; they do not
-work with stream URLs (*note Streaming Audio::).  Most of the methods
+work with stream URLs (*note Streaming Audio::).  Some of the methods
 require installation of some additional software that Emms can then call
 to read metadata from disk (*note Metadata Utilities::).  Finally, some
 methods work only with a limited set of media file formats such as Ogg
 or MP3, while some methods support a wide variety of formats.
 
+   If caching is enabled (it is by default) then the metadata for each
+track will be stored in the cache for faster retrieval.  That means if
+you change info method and want updated tracks, you will have to reset
+the cache 'M-x emms-cache-reset' and then repopulate with 'M-x
+emms-add-directory-tree RET ~/Music/ RET' or similar.
+
Automatic track information retrieval is enabled by default in the
 'emms-all' setup level (*note Setup::).  That setup level configures
 Emms to use 'emms-info-native' and 'emms-info-cueinfo' methods, as they
@@ -3891,36 +3897,38 @@ Variable Index
  Volume.   (line 42)
+* emms-history-file: Persistent Playlists.
+  (line  14)
+* emms-history-start-playing:Persistent Playlists.
+  (line  33)
+* emms-info-asynchronously:  Track Information.   (line  99)
+* emms-info-auto-update: Track Information.   (line  94)
+* emms-info-functions:   Track Information.   (line 105)
+* emms-lyrics-coding-system: Lyrics.  (line  36)
+* emms-lyrics-dir:   Lyrics.  (line  27)
+* emms-lyrics-display-format:Lyrics.  (line  32)
+* emms-lyrics-display-on-minibuffer: Lyrics.  (line  21)
+* emms-lyrics-display-on-modeline:   Lyrics.  (line  24)
+* emms-lyrics-scroll-p:  Lyrics.  (line  39)
+* emms-lyrics-scroll-timer-interval: Lyrics.  (line  42)
+* emms-player-finished-hook: Hooks.   (line  23)
+* emms-player-list:  User Variables.  (line   8)
+* emms-player-paused-hook:   Hooks.   (line  29)
+* emms-player-started-hook:  Hooks.   (line   9)
+* emms-player-stopped-hook:  Hooks.   (line  11)
+* emms-playlist-cleared-hook:Hooks.   (line  19)
+* emms-playlist-selection-changed-hook:  Hooks.   (line  17)
+* emms-playlist-source-inserted-hook:Hooks.   (line  14)
+* emms-repeat-playlist:  User Variables.  (line  15)
+* emms-show-format:  User Variables.  (line  11)
+* emms-sort-lessp-function:  User Variables.  (line  21)
+* emms-source-file-default-directory:Sources. (line  13)
+* emms-tag-editor-formats:   Editing Tracks.  (line  55)
+* emms-tag-editor-rename-format: Editing Tracks.  (line  73)
+* emms-tag-editor-tagfile-functions: Editing Tracks.  (line  63)
+* emms-track-description-function:   User Variables.  (line  19)
+* emms-volume-change-amount: Volume.  (line   9)
+* emms-volume-mode-timeout:  Volume.  (line  42)
 
 
 File: emms.info,  Node: Keybinding Index,  Prev: Variable Index,  Up: Top
@@ -3987,57 +3995,57 @@ Tag Table:
 Node: Top701
 Node: Introduction4336
 Node: Quickstart Guide5804
-Node: Installation8672
-Node: Compiling Emms9221
-Node: Setup9909
-Node: Configuration10895
-Node: Finding files and speed12370
-Node: Setup Examples13239
-Node: Getting 

[elpa] externals/emms 488d38b 5/5: * doc/developer-release.txt:

2021-04-05 Thread Yoni Rabkin
branch: externals/emms
commit 488d38b879867cf4c2df052cfda4a36a2ca1394f
Author: Yoni Rabkin 
Commit: Yoni Rabkin 

* doc/developer-release.txt:
---
 doc/developer-release.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/developer-release.txt b/doc/developer-release.txt
index d32e4ae..b39fcda 100644
--- a/doc/developer-release.txt
+++ b/doc/developer-release.txt
@@ -8,14 +8,14 @@ distributed via Emacs ELPA (https://elpa.gnu.org/).
 
 * Update the manual, then copy compiled emms.info to root directory
 
+* Update website (cvs commit -m "update website" index.html)
+
 * Push version updates to VCS
 
 * Tag release in VCS, for example `git tag -a 4.2 -m "4.2"'
 
 * Push tag to VCS if needed, for example `git push --tags origin "4.2"'
 
-* Update website (cvs commit -m "update website" index.html)
-
 * Push to GNU ELPA:
 
   - merge master into the Savannah "elpa" branch and push to Savannah



[elpa] externals/emms 9c2f1f1 4/5: * emms.el: version bump

2021-04-05 Thread Yoni Rabkin
branch: externals/emms
commit 9c2f1f1dd1a5a43ef455e8fe1c3729e11adc34d4
Author: Yoni Rabkin 
Commit: Yoni Rabkin 

* emms.el: version bump
---
 emms.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emms.el b/emms.el
index 4689b49..9785cf3 100644
--- a/emms.el
+++ b/emms.el
@@ -5,7 +5,7 @@
 
 ;; Author: Jorgen Schäfer , the Emms developers (see AUTHORS 
file)
 ;; Maintainer: Yoni Rabkin 
-;; Version: 6.03
+;; Version: 7.0
 ;; Keywords: emms, mp3, ogg, flac, music, mpeg, video, multimedia
 ;; Package-Type: multi
 ;; Package-Requires: ((cl-lib "0.5") (seq))



[elpa] externals/diff-hl updated (4bf77c6 -> 9d5a0d8)

2021-04-05 Thread ELPA Syncer
elpasync pushed a change to branch externals/diff-hl.

  from  4bf77c6   Fix recent perf regression in flydiff
   new  4b860c5   Add new option: diff-hl-show-staged-changes
   new  9d5a0d8   Rename functions for clarity


Summary of changes:
 diff-hl-flydiff.el   |   8 +--
 diff-hl-show-hunk.el |   2 +-
 diff-hl.el   | 142 +++
 test/diff-hl-test.el |  44 +++-
 4 files changed, 145 insertions(+), 51 deletions(-)



[nongnu] elpa/markdown-mode 8018c0c 1/3: Fix broken inline display of remote images

2021-04-05 Thread ELPA Syncer
branch: elpa/markdown-mode
commit 8018c0cce9fb4c0dd99e162ef6fdc16efa52f254
Author: Tejasvi S Tomar <45873379+teja...@users.noreply.github.com>
Commit: GitHub 

Fix broken inline display of remote images
---
 markdown-mode.el | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/markdown-mode.el b/markdown-mode.el
index 6775bfa..9aef99e 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -8525,11 +8525,10 @@ or \\[markdown-toggle-inline-images]."
 (let* ((start (match-beginning 0))
   (imagep (match-beginning 1))
   (end (match-end 0))
-  (file (match-string-no-properties 6))
-  (unhex_file (url-unhex-string file)))
+  (file (match-string-no-properties 6)))
   (when (and imagep
  (not (zerop (length file
-(unless (file-exists-p unhex_file)
+(unless (file-exists-p file)
   (let* ((download-file (funcall 
markdown-translate-filename-function file))
  (valid-url (ignore-errors
   (member (downcase (url-type 
(url-generic-parse-url download-file)))
@@ -8538,11 +8537,13 @@ or \\[markdown-toggle-inline-images]."
 (setq file (markdown--get-remote-image download-file))
   (when (not valid-url)
 ;; strip query parameter
-(setq file (replace-regexp-in-string "?.+\\'" "" file))
-(when (file-exists-p unhex_file)
-  (let* ((abspath (if (file-name-absolute-p unhex_file)
-  unhex_file
-(concat default-directory unhex_file)))
+(setq file (replace-regexp-in-string "?.+\\'" "" file))
+(unless (file-exists-p file)
+  (setq file (file (url-unhex-string file
+(when (file-exists-p file)
+  (let* ((abspath (if (file-name-absolute-p file)
+  file
+(concat default-directory file)))
  (image
   (cond ((and markdown-max-image-size
(image-type-available-p 'imagemagick))



[nongnu] elpa/markdown-mode a2a7eed 3/3: Merge pull request #606 from tejasvi/patch-1

2021-04-05 Thread ELPA Syncer
branch: elpa/markdown-mode
commit a2a7eed5ce8043e24d19b6cd3a74eac4a4add92b
Merge: f18d26d 13d26a6
Author: Shohei YOSHIDA 
Commit: GitHub 

Merge pull request #606 from tejasvi/patch-1

Fix broken inline display of remote images
---
 markdown-mode.el | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/markdown-mode.el b/markdown-mode.el
index 1737a7c..c93d051 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -8525,11 +8525,10 @@ or \\[markdown-toggle-inline-images]."
 (let* ((start (match-beginning 0))
   (imagep (match-beginning 1))
   (end (match-end 0))
-  (file (match-string-no-properties 6))
-  (unhex_file (url-unhex-string file)))
+  (file (match-string-no-properties 6)))
   (when (and imagep
  (not (zerop (length file
-(unless (file-exists-p unhex_file)
+(unless (file-exists-p file)
   (let* ((download-file (funcall 
markdown-translate-filename-function file))
  (valid-url (ignore-errors
   (member (downcase (url-type 
(url-generic-parse-url download-file)))
@@ -8538,11 +8537,13 @@ or \\[markdown-toggle-inline-images]."
 (setq file (markdown--get-remote-image download-file))
   (when (not valid-url)
 ;; strip query parameter
-(setq file (replace-regexp-in-string "?.+\\'" "" file))
-(when (file-exists-p unhex_file)
-  (let* ((abspath (if (file-name-absolute-p unhex_file)
-  unhex_file
-(concat default-directory unhex_file)))
+(setq file (replace-regexp-in-string "?.+\\'" "" file))
+(unless (file-exists-p file)
+  (setq file (url-unhex-string file)))
+(when (file-exists-p file)
+  (let* ((abspath (if (file-name-absolute-p file)
+  file
+(concat default-directory file)))
  (image
   (cond ((and markdown-max-image-size
(image-type-available-p 'imagemagick))



[nongnu] elpa/markdown-mode 13d26a6 2/3: Fix typo

2021-04-05 Thread ELPA Syncer
branch: elpa/markdown-mode
commit 13d26a6d4a02185a3801fc5cd7f0d2e4cd0ab6d7
Author: Tejasvi S Tomar <45873379+teja...@users.noreply.github.com>
Commit: GitHub 

Fix typo
---
 markdown-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/markdown-mode.el b/markdown-mode.el
index 9aef99e..c0e7bd0 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -8539,7 +8539,7 @@ or \\[markdown-toggle-inline-images]."
 ;; strip query parameter
 (setq file (replace-regexp-in-string "?.+\\'" "" file))
 (unless (file-exists-p file)
-  (setq file (file (url-unhex-string file
+  (setq file (url-unhex-string file)))
 (when (file-exists-p file)
   (let* ((abspath (if (file-name-absolute-p file)
   file



[elpa] externals/diff-hl 4b860c5 1/2: Add new option: diff-hl-show-staged-changes

2021-04-05 Thread ELPA Syncer
branch: externals/diff-hl
commit 4b860c5ee571429dd0e3210fd50058a29988b98d
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Add new option: diff-hl-show-staged-changes

Resolves #161
---
 diff-hl.el   | 131 ---
 test/diff-hl-test.el |  44 -
 2 files changed, 134 insertions(+), 41 deletions(-)

diff --git a/diff-hl.el b/diff-hl.el
index d643482..aa528bc 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -167,6 +167,11 @@ performance when viewing such files in certain conditions."
   (repeat :inline t (symbol :tag "mode"
   :group 'diff-hl)
 
+(defcustom diff-hl-show-staged-changes t
+  "Whether to include staged changes in the indicators.
+Only affects Git, it's the only backend that has staging area."
+  :type 'boolean)
+
 (defvar diff-hl-reference-revision nil
   "Revision to diff against.  nil means the most recent one.")
 
@@ -279,22 +284,31 @@ performance when viewing such files in certain 
conditions."
;; Diffing against an older revision.
diff-hl-reference-revision
 
+(declare-function vc-git-command "vc-git")
+
 (defun diff-hl-changes-buffer (file backend)
-  ;; FIXME: To diff against the staging area, call 'git diff-files -p'.
   (let ((buf-name " *diff-hl* "))
-(condition-case err
+(if (and (eq backend 'Git)
+ (not diff-hl-reference-revision)
+ (not diff-hl-show-staged-changes))
 (diff-hl-with-diff-switches
- (vc-call-backend backend 'diff (list file)
-  diff-hl-reference-revision nil
-  buf-name))
-  (error
-   ;; https://github.com/dgutov/diff-hl/issues/117
-   (when (string-match-p "\\`Failed (status 128)" (error-message-string 
err))
- (diff-hl-with-diff-switches
-  (vc-call-backend backend 'diff (list file)
-   "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
-   nil
-   buf-name)
+ (apply #'vc-git-command buf-name 1
+(list file)
+"diff-files"
+(cons "-p" (vc-switches 'git 'diff
+  (condition-case err
+  (diff-hl-with-diff-switches
+   (vc-call-backend backend 'diff (list file)
+diff-hl-reference-revision nil
+buf-name))
+(error
+ ;; https://github.com/dgutov/diff-hl/issues/117
+ (when (string-match-p "\\`Failed (status 128)" (error-message-string 
err))
+   (diff-hl-with-diff-switches
+(vc-call-backend backend 'diff (list file)
+ "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
+ nil
+ buf-name))
 buf-name))
 
 (defun diff-hl-changes ()
@@ -304,33 +318,37 @@ performance when viewing such files in certain 
conditions."
   (let ((state (vc-state file backend)))
 (cond
  ((diff-hl-modified-p state)
-  (let* (diff-auto-refine-mode res)
-(with-current-buffer (diff-hl-changes-buffer file backend)
-  (goto-char (point-min))
-  (unless (eobp)
-(ignore-errors
-  (diff-beginning-of-hunk t))
-(while (looking-at diff-hunk-header-re-unified)
-  (let ((line (string-to-number (match-string 3)))
-(len (let ((m (match-string 4)))
-   (if m (string-to-number m) 1)))
-(beg (point)))
-(diff-end-of-hunk)
-(let* ((inserts (diff-count-matches "^\\+" beg (point)))
-   (deletes (diff-count-matches "^-" beg (point)))
-   (type (cond ((zerop deletes) 'insert)
-   ((zerop inserts) 'delete)
-   (t 'change
-  (when (eq type 'delete)
-(setq len 1)
-(cl-incf line))
-  (push (list line len type) res))
-(nreverse res)))
+  (diff-hl-changes-from-buffer
+   (diff-hl-changes-buffer file backend)))
  ((eq state 'added)
   `((1 ,(line-number-at-pos (point-max)) insert)))
  ((eq state 'removed)
   `((1 ,(line-number-at-pos (point-max)) delete
 
+(defun diff-hl-changes-from-buffer (buf)
+  (with-current-buffer buf
+(let* (diff-auto-refine-mode res)
+  (goto-char (point-min))
+  (unless (eobp)
+(ignore-errors
+  (diff-beginning-of-hunk t))
+(while (looking-at diff-hunk-header-re-unified)
+  (let ((line (string-to-number (match-string 3)))
+(len (let ((m (match-string 4)))
+   (if m (string-to-number m) 1)))
+(beg (point)))
+(dif

[elpa] externals/diff-hl 9d5a0d8 2/2: Rename functions for clarity

2021-04-05 Thread ELPA Syncer
branch: externals/diff-hl
commit 9d5a0d8bf6efc125e5d37301a34b93e5b8e2873e
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Rename functions for clarity
---
 diff-hl-flydiff.el   |  8 
 diff-hl-show-hunk.el |  2 +-
 diff-hl.el   | 11 ++-
 test/diff-hl-test.el |  4 ++--
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el
index 4eefa49..1410b2c 100644
--- a/diff-hl-flydiff.el
+++ b/diff-hl-flydiff.el
@@ -40,9 +40,9 @@
 (defvar diff-hl-flydiff-timer nil)
 (make-variable-buffer-local 'diff-hl-flydiff-modified-tick)
 
-(defun diff-hl-flydiff-buffer-with-head (file &optional backend)
+(defun diff-hl-flydiff-changes-buffer (file &optional backend)
   (setq diff-hl-flydiff-modified-tick (buffer-chars-modified-tick))
-  (diff-hl-diff-buffer-with-head file " *diff-hl-diff*" backend))
+  (diff-hl-diff-buffer-with-reference file " *diff-hl-diff*" backend))
 
 (defun diff-hl-flydiff-update ()
   (unless (or
@@ -68,14 +68,14 @@ This is a global minor mode.  It alters how `diff-hl-mode' 
works."
 (advice-add 'diff-hl-modified-p :before-until
 #'diff-hl-flydiff/modified-p)
 (advice-add 'diff-hl-changes-buffer :override
-#'diff-hl-flydiff-buffer-with-head)
+#'diff-hl-flydiff-changes-buffer)
 (setq diff-hl-flydiff-timer
   (run-with-idle-timer diff-hl-flydiff-delay t 
#'diff-hl-flydiff-update)))
 
 (advice-remove 'diff-hl-overlay-modified #'ignore)
 
 (advice-remove 'diff-hl-modified-p #'diff-hl-flydiff/modified-p)
-(advice-remove 'diff-hl-changes-buffer #'diff-hl-flydiff-buffer-with-head)
+(advice-remove 'diff-hl-changes-buffer #'diff-hl-flydiff-changes-buffer)
 
 (and diff-hl-flydiff-timer
  (cancel-timer diff-hl-flydiff-timer
diff --git a/diff-hl-show-hunk.el b/diff-hl-show-hunk.el
index 2be7a06..f4945de 100644
--- a/diff-hl-show-hunk.el
+++ b/diff-hl-show-hunk.el
@@ -129,7 +129,7 @@ buffer."
  (line (line-number-at-pos))
  (dest-buffer "*diff-hl-show-hunk-diff-buffer*"))
 (with-current-buffer buffer
-  (diff-hl-diff-buffer-with-head (buffer-file-name buffer) dest-buffer)
+  (diff-hl-diff-buffer-with-reference (buffer-file-name buffer) 
dest-buffer)
   (switch-to-buffer dest-buffer)
   (diff-hl-diff-skip-to line)
   (setq vc-sentinel-movepoint (point)))
diff --git a/diff-hl.el b/diff-hl.el
index aa528bc..143122f 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -793,15 +793,15 @@ the user should be returned."
 
 (declare-function diff-no-select "diff")
 
-;; TODO: Consider simplifying given FILE always = buffer-file-name.
-(defun diff-hl-diff-buffer-with-head (file &optional dest-buffer backend)
-  "Compute the differences between FILE and its revision.
- The diffs are computed in the buffer DEST-BUFFER. This requires
+(defun diff-hl-diff-buffer-with-reference (file &optional dest-buffer backend)
+  "Compute the diff between the current buffer contents and reference.
+The diffs are computed in the buffer DEST-BUFFER. This requires
 the `diff-program' to be in your `exec-path'."
   (require 'diff)
   (vc-ensure-vc-buffer)
   (save-current-buffer
-(let* ((dest-buffer (or dest-buffer "*diff-hl-diff-bufer-with-head*"))
+(let* ((dest-buffer (or dest-buffer 
"*diff-hl-diff-buffer-with-reference*"))
+   (backend (or backend (vc-backend file)))
(temporary-file-directory
 (if (file-directory-p "/dev/shm/")
 "/dev/shm/"
@@ -825,6 +825,7 @@ the `diff-program' to be in your `exec-path'."
   (delete-matching-lines "^Diff finished.*")))
   (get-buffer-create dest-buffer
 
+;; TODO: Cache based on .git/index's mtime, maybe.
 (defun diff-hl-git-index-object-name (file)
   (with-temp-buffer
 (vc-git-command (current-buffer) 0 file "ls-files" "-s")
diff --git a/test/diff-hl-test.el b/test/diff-hl-test.el
index 4b8563b..df9f84c 100644
--- a/test/diff-hl-test.el
+++ b/test/diff-hl-test.el
@@ -151,13 +151,13 @@
 (let ((diff-hl-show-staged-changes t))
   (should
(equal (diff-hl-changes-from-buffer
-   (diff-hl-diff-buffer-with-head buffer-file-name nil 'Git))
+   (diff-hl-diff-buffer-with-reference buffer-file-name))
   '((1 1 insert)
 (12 1 insert)
 (let ((diff-hl-show-staged-changes nil))
   (should
(equal (diff-hl-changes-from-buffer
-   (diff-hl-diff-buffer-with-head buffer-file-name nil 'Git))
+   (diff-hl-diff-buffer-with-reference buffer-file-name))
   '((12 1 insert)))
 
 (defun diff-hl-run-tests ()



[nongnu] elpa/markdown-mode updated (f18d26d -> a2a7eed)

2021-04-05 Thread ELPA Syncer
elpasync pushed a change to branch elpa/markdown-mode.

  from  f18d26d   Merge pull request #607 from 
jrblevin/fix-use-package-sample
   new  8018c0c   Fix broken inline display of remote images
   new  13d26a6   Fix typo
   new  a2a7eed   Merge pull request #606 from tejasvi/patch-1


Summary of changes:
 markdown-mode.el | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)



[elpa] externals/vertico 99a355c 12/48: abort minibuffer session if while-no-input returns nil

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 99a355cf51d35c61d533d8cc23f8fdf9ccd03f9e
Author: Daniel Mendler 
Commit: Daniel Mendler 

abort minibuffer session if while-no-input returns nil
---
 minicomp.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/minicomp.el b/minicomp.el
index 2f5f283..dab744c 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -198,6 +198,7 @@
   "Preprocess candidates with INPUT string and METADATA."
   (pcase (let ((while-no-input-ignore-events '(selection-request)))
(while-no-input (minicomp--candidates input metadata)))
+('nil (abort-recursive-edit))
 (`(,base ,total ,candidates)
  (unless (and minicomp--keep (< minicomp--index 0))
(if-let* ((old (and candidates



[elpa] externals/vertico 27070bb 27/48: truncate long candidate strings

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 27070bba78d5f736944ac5fc0ccd071dbe90e074
Author: Daniel Mendler 
Commit: Daniel Mendler 

truncate long candidate strings
---
 minicomp.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index b1da4f4..cda90ce 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -287,7 +287,8 @@

minibuffer-completion-predicate "")))
 metadata
 candidates)))
- (title nil)
+ (max-width (- (* 2 (window-width)) 5))
+ (title)
  (formatted (propertize " " 'cursor t))
  (group (completion-metadata-get metadata 'x-group-function)))
 (dolist (ann-cand ann-candidates formatted)
@@ -309,8 +310,9 @@
  (replace-regexp-in-string "\n+" "⤶")
  (string-trim)
  (minicomp--replace-prop 'display (lambda (x) (if (stringp 
x) x "")))
- (minicomp--replace-prop 'invisible (lambda (_) ""
-(setq cand (concat prefix cand
+ (minicomp--replace-prop 'invisible (lambda (_) "")))
+  cand (truncate-string-to-width cand max-width 0 nil "…")
+  cand (concat prefix cand
(if (text-property-not-all 0 (length suffix) 'face 
nil suffix)
suffix
  (propertize suffix 'face 
'completions-annotations



[elpa] externals/vertico 333a0a2 29/48: use chunks for candidate formatting

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 333a0a2b85bad8a5f57ac769bb352ee5d48954c0
Author: Daniel Mendler 
Commit: Daniel Mendler 

use chunks for candidate formatting
---
 minicomp.el | 37 +++--
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index c650f37..6a0218a 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -199,14 +199,13 @@
 
 (defun minicomp--annotate (metadata candidates)
   "Annotate CANDIDATES with annotation function specified by METADATA."
-  (let ((aff (or (completion-metadata-get metadata 'affixation-function)
- (plist-get completion-extra-properties :affixation-function)))
-(ann (or (completion-metadata-get metadata 'annotation-function)
- (plist-get completion-extra-properties 
:annotation-function
-(cond
- (aff (funcall aff candidates))
- (ann (mapcar (lambda (cand) (list cand (or (funcall ann cand) ""))) 
candidates))
- (t candidates
+  (if-let (aff (or (completion-metadata-get metadata 'affixation-function)
+   (plist-get completion-extra-properties 
:affixation-function)))
+  (funcall aff candidates)
+(if-let (ann (or (completion-metadata-get metadata 'annotation-function)
+ (plist-get completion-extra-properties 
:annotation-function)))
+(mapcar (lambda (cand) (list cand (or (funcall ann cand) ""))) 
candidates)
+  candidates)))
 
 (defun minicomp--recompute-candidates (input metadata)
   "Recompute candidates with INPUT string and METADATA."
@@ -289,13 +288,13 @@
 candidates)))
  (max-width (- (* 2 (window-width)) 5))
  (title)
- (formatted #(" " 0 1 (cursor t)))
+ (chunks (list #(" " 0 1 (cursor t
  (group (completion-metadata-get metadata 'x-group-function)))
-(dolist (ann-cand ann-candidates formatted)
-  (setq formatted (concat formatted
-  (if (= index (1+ minicomp--index))
-  #("\n" 0 1 (face minicomp-current))
-"\n")))
+(dolist (ann-cand ann-candidates)
+  (push (if (= index (1+ minicomp--index))
+#("\n" 0 1 (face minicomp-current))
+  "\n")
+chunks)
   (let ((prefix "") (suffix "") (cand))
 (pcase ann-cand
   (`(,c ,s) (setq cand c suffix s))
@@ -303,8 +302,9 @@
   (_ (setq cand ann-cand)))
 (when-let (new-title (and minicomp-group-format group (caar (funcall 
group (list cand)
   (unless (equal title new-title)
-(setq formatted (concat formatted (format minicomp-group-format 
new-title) "\n")
-  title new-title)))
+(push (format minicomp-group-format new-title) chunks)
+(push "\n" chunks)
+(setq title new-title)))
 (setq cand (thread-last cand
  (replace-regexp-in-string "[\t ]+" " ")
  (replace-regexp-in-string "\n+" "⤶")
@@ -319,8 +319,9 @@
 (when (= index minicomp--index)
   (setq cand (concat cand))
   (add-face-text-property 0 (length cand) 'minicomp-current 'append 
cand))
-(setq formatted (concat formatted cand)
-  index (1+ index))
+(push cand chunks)
+(setq index (1+ index
+(apply #'concat (nreverse chunks
 
 (defun minicomp--display-candidates (str)
   "Update candidates overlay with STR."



[elpa] externals/vertico 8b760bc 30/48: Fix minicomp--index initialization

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 8b760bcaaf79d8f1bc9a348f628dd258ccdaca2d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Fix minicomp--index initialization
---
 minicomp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/minicomp.el b/minicomp.el
index 6a0218a..044498c 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -114,7 +114,7 @@
 (defvar-local minicomp--count-ov nil
   "Overlay showing the number of candidates.")
 
-(defvar-local minicomp--index 0
+(defvar-local minicomp--index -1
   "Index of current candidate or negative for prompt selection.")
 
 (defvar-local minicomp--input nil



[elpa] externals/vertico fa9e8dc 26/48: split functions

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit fa9e8dc18bdc7cdc112cbac03513fe277efb615f
Author: Daniel Mendler 
Commit: Daniel Mendler 

split functions
---
 minicomp.el | 58 --
 1 file changed, 32 insertions(+), 26 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 3771756..b1da4f4 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -208,7 +208,7 @@
  (ann (mapcar (lambda (cand) (list cand (or (funcall ann cand) ""))) 
candidates))
  (t candidates
 
-(defun minicomp--candidates (input metadata)
+(defun minicomp--recompute-candidates (input metadata)
   "Recompute candidates with INPUT string and METADATA."
   (let* ((all (completion-all-completions
input
@@ -238,10 +238,10 @@
   (setq all (mapcan #'cdr (funcall group all
 (list base total all)))
 
-(defun minicomp--recompute (input metadata)
+(defun minicomp--update-candidates (input metadata)
   "Preprocess candidates with INPUT string and METADATA."
   (pcase (let ((while-no-input-ignore-events '(selection-request)))
-   (while-no-input (minicomp--candidates input metadata)))
+   (while-no-input (minicomp--recompute-candidates input metadata)))
 ('nil (abort-recursive-edit))
 (`(,base ,total ,candidates)
  (unless (and minicomp--keep (< minicomp--index 0))
@@ -270,8 +270,8 @@
 (setq pos end)))
 (apply #'concat (nreverse chunks
 
-(defun minicomp--display (input metadata)
-  "Display current candidates with INPUT string and METADATA."
+(defun minicomp--format-candidates (input metadata)
+  "Format current candidates with INPUT string and METADATA."
   (let* ((index (min (max 0 (- minicomp--index (/ minicomp-count 2)))
  (max 0 (- minicomp--total minicomp-count
  (candidates (seq-subseq minicomp--candidates index
@@ -288,10 +288,10 @@
 metadata
 candidates)))
  (title nil)
- (displayed " ")
+ (formatted (propertize " " 'cursor t))
  (group (completion-metadata-get metadata 'x-group-function)))
-(dolist (ann-cand ann-candidates)
-  (setq displayed (concat displayed
+(dolist (ann-cand ann-candidates formatted)
+  (setq formatted (concat formatted
   (if (= index (1+ minicomp--index))
   (propertize "\n" 'face 'minicomp-current)
 "\n")))
@@ -302,7 +302,7 @@
   (_ (setq cand ann-cand)))
 (when-let (new-title (and minicomp-group-format group (caar (funcall 
group (list cand)
   (unless (equal title new-title)
-(setq displayed (concat displayed (format minicomp-group-format 
new-title) "\n")
+(setq formatted (concat formatted (format minicomp-group-format 
new-title) "\n")
   title new-title)))
 (setq cand (thread-last cand
  (replace-regexp-in-string "[\t ]+" " ")
@@ -317,29 +317,35 @@
 (when (= index minicomp--index)
   (setq cand (concat cand))
   (add-face-text-property 0 (length cand) 'minicomp-current 'append 
cand))
-(setq displayed (concat displayed cand)
-  index (1+ index
-(put-text-property 0 1 'cursor t displayed)
-(if (and (< minicomp--index 0) (not (minicomp--require-match)))
-(add-text-properties (minibuffer-prompt-end) (point-max) '(face 
minicomp-current))
-  (remove-text-properties (minibuffer-prompt-end) (point-max) '(face nil)))
-(move-overlay minicomp--candidates-ov (point-max) (point-max))
-(overlay-put minicomp--candidates-ov 'after-string displayed)
-(when minicomp-count-format
-  (move-overlay minicomp--count-ov (point-min) (point-min))
-  (overlay-put minicomp--count-ov 'before-string
-   (format (car minicomp-count-format)
-   (format (cdr minicomp-count-format)
-   (if (< minicomp--index 0) "*" (1+ 
minicomp--index))
-   minicomp--total))
+(setq formatted (concat formatted cand)
+  index (1+ index))
+
+(defun minicomp--display-candidates (str)
+  "Update candidates overlay with STR."
+  (move-overlay minicomp--candidates-ov (point-max) (point-max))
+  (overlay-put minicomp--candidates-ov 'after-string str))
+
+(defun minicomp--display-count ()
+  "Update count overlay."
+  (when minicomp-count-format
+(move-overlay minicomp--count-ov (point-min) (point-min))
+(overlay-put minicomp--count-ov 'before-string
+ (format (car minicomp-count-format)
+ (format (cdr minicomp-count-format)
+ (if (< minicomp--index 0) "*" (1+ 
minicomp--index))
+ minicomp--total)
 
 (defun minicomp--exhibit ()
   "Exhibit completion UI."
   (let ((metadata (completion--field-metadata (minibuffer-prompt-end)))
  

[elpa] externals/vertico 308670c 31/48: Fix confirmation: Use ignore-errors+read-char

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 308670c8233d4e418a178d5eb87be84bd8649abd
Author: Daniel Mendler 
Commit: Daniel Mendler 

Fix confirmation: Use ignore-errors+read-char
---
 minicomp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/minicomp.el b/minicomp.el
index 044498c..0ff3aac 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -409,7 +409,7 @@
minibuffer-completion-predicate)))
 (exit-minibuffer))
((eq minibuffer--require-match 'confirm)
-(when (eq (read-char-exclusive "Confirm") 13)
+(when (eq (ignore-errors (read-char "Confirm")) 13)
   (exit-minibuffer)))
(t (message "Match required"
 



[elpa] externals/vertico ed87a60 33/48: Require 27.1

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit ed87a6095aada8c3c8bce0afea960a621260e30f
Author: Daniel Mendler 
Commit: Daniel Mendler 

Require 27.1
---
 minicomp.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 692f396..c336839 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -5,7 +5,7 @@
 ;; Created: 2021
 ;; License: GPL-3.0-or-later
 ;; Version: 0.1
-;; Package-Requires: ((emacs "27"))
+;; Package-Requires: ((emacs "27.1"))
 ;; Homepage: https://github.com/minad/minicomp
 
 ;; This file is not part of GNU Emacs.
@@ -38,7 +38,7 @@
   (require 'subr-x))
 
 (defgroup minicomp nil
-  "Minimal completion system."
+  "Minimalistic vertical minibuffer completion system."
   :group 'convenience
   :prefix "minicomp-")
 



[elpa] externals/vertico d57d390 34/48: Support partial completion for files

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit d57d3904f2edf1c38827a7f90f91a2b756ce7369
Author: Daniel Mendler 
Commit: Daniel Mendler 

Support partial completion for files

Sorting by history does not yet work for partial completion.
It is difficult to support this efficiently.
---
 README.org  | 12 +---
 minicomp.el |  3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 6a7e554..90e28ab 100644
--- a/README.org
+++ b/README.org
@@ -24,7 +24,13 @@ Complementary packages, which are supported:
 * Configuration
 
 #+begin_src emacs-lisp
-(use-package minicomp
-  :init
-  (minicomp-mode))
+  (use-package minicomp
+:init
+(minicomp-mode))
+
+  (use-package orderless
+:init
+(setq completion-styles '(orderless)
+  completion-category-defaults nil
+  completion-category-overrides '((file (styles . 
(partial-completion))
 #+end_src
diff --git a/minicomp.el b/minicomp.el
index c336839..78dda0f 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -34,6 +34,7 @@
 ;;; Code:
 
 (require 'seq)
+(require 'cl-lib)
 (eval-when-compile
   (require 'subr-x))
 
@@ -231,7 +232,7 @@
  0))
  (total))
 (when (eq (completion-metadata-get metadata 'category) 'file)
-  (setq all (delete "../" (delete "./" all
+  (setq all (cl-delete-if (apply-partially #'string-match-p 
"\\(\\`\\|/\\)\\.?\\./\\'") all)))
 (setq total (length all)
   all (if (> total minicomp-sort-threshold)
   all



[elpa] externals/vertico afd0abf 41/48: Always pass again through completion style for highlighting

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit afd0abf0bae92ccfa334a263ff0d1d767c9550b4
Author: Daniel Mendler 
Commit: Daniel Mendler 

Always pass again through completion style for highlighting

* Calling the completion style on ten candidates is very cheap.
* We avoid the fragile orderless detection
---
 minicomp.el | 43 ++-
 1 file changed, 18 insertions(+), 25 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index c61d958..bc09332 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -109,9 +109,6 @@
 map)
   "Minibuffer keymap.")
 
-(defvar minicomp--highlight-function (lambda (_input _metadata cands) cands)
-  "Highlighting function.")
-
 (defvar-local minicomp--history-hash nil
   "History hash table.")
 
@@ -217,6 +214,21 @@
 (mapcar (lambda (cand) (list cand (or (funcall ann cand) ""))) 
candidates)
   candidates)))
 
+(defvar orderless-skip-highlighting)
+(defun minicomp--highlight (input metadata candidates)
+  "Pass CANDIDATES through the completion style specified by METADATA for 
highlighting with INPUT string."
+  (let* ((orderless-skip-highlighting)
+ (highlighted (nconc
+   (completion-all-completions input
+   candidates
+   nil
+   (length input)
+   metadata)
+   nil)))
+;; Check if everything went alright, all the candidates should still be 
present.
+(if (= (length highlighted) (length candidates))
+highlighted candidates)))
+
 (defun minicomp--recompute-candidates (input metadata)
   "Recompute candidates with INPUT string and METADATA."
   (let* ((ignore-re (concat "\\(?:\\`\\|/\\)\\.?\\./\\'"
@@ -291,8 +303,7 @@
  (ann-candidates
   (minicomp--annotate
metadata
-   (funcall
-minicomp--highlight-function
+   (minicomp--highlight
 (substring input
(car (completion-boundaries input 
minibuffer-completion-table

minibuffer-completion-predicate "")))
@@ -461,33 +472,15 @@
   (concat (substring content 0 minicomp--base)
   (nth minicomp--index minicomp--candidates)
 
-(defvar orderless-skip-highlighting)
 (defun minicomp--setup ()
   "Setup completion system."
   (setq minicomp--input t
 minicomp--candidates-ov (make-overlay (point-max) (point-max) nil t t)
 minicomp--count-ov (make-overlay (point-min) (point-min) nil t t))
-  (setq-local truncate-lines nil
+  (setq-local orderless-skip-highlighting t ;; Orderless optimization
+  truncate-lines nil
   resize-mini-windows 'grow-only
   max-mini-window-height 1.0)
-  ;; Optimize orderless filtering, skip highlighting
-  (when (and (boundp 'orderless-skip-highlighting)
- (equal (default-value 'completion-styles) '(orderless)))
-(setq-local orderless-skip-highlighting t
-minicomp--highlight-function
-(lambda (input metadata candidates)
-  ;; Pass once again through the completion style for 
highlighting
-  (let* ((orderless-skip-highlighting nil)
- (highlighted (nconc
-   (completion-all-completions input
-   candidates
-   nil
-   (length 
input)
-   metadata)
-   nil)))
-;; Check if everything went alright, all the candidates 
should still be present.
-(if (= (length highlighted) (length candidates))
-highlighted candidates)
   (use-local-map minicomp-map)
   (add-hook 'post-command-hook #'minicomp--exhibit -99 'local))
 



[elpa] externals/vertico c0606cf 39/48: Formatting

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit c0606cfed1eed4c1712235ba6be6ca2e08be8f2d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Formatting
---
 minicomp.el | 47 ++-
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 2df2b6f..728ac9e 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -174,12 +174,12 @@
   ((and (> len alen)
 (eq t (compare-strings adir 0 alen elem 0 
alen)))
(substring elem alen)
-(when file
-  (when-let (slash (string-match-p "/" file))
-(setq file (substring file 0 (1+ slash
-  (unless (gethash file minicomp--history-hash)
-(puthash file index minicomp--history-hash)))
-(setq index (1+ index
+  (when file
+(when-let (slash (string-match-p "/" file))
+  (setq file (substring file 0 (1+ slash
+(unless (gethash file minicomp--history-hash)
+  (puthash file index minicomp--history-hash)))
+  (setq index (1+ index
((not minicomp--history-hash)
 (let ((index 0)
   ;; History disabled if `minibuffer-history-variable' eq `t'.
@@ -236,11 +236,9 @@
(prog1 (cdr last)
  (setcdr last nil))
  0))
- (total))
-(setq total (length all)
-  all (if (> total minicomp-sort-threshold)
-  all
-(if-let (sort (completion-metadata-get metadata 
'display-sort-function))
+ (total (length all)))
+(when (<= total minicomp-sort-threshold)
+  (setq all (if-let (sort (completion-metadata-get metadata 
'display-sort-function))
 (funcall sort all)
   (minicomp--sort input all
 (when-let* ((def (cond
@@ -388,7 +386,7 @@
 minicomp--index
 (max (if (and (minicomp--require-match) minicomp--candidates)
  0 -1)
- (min index (- minicomp--total 1)
+ (min index (- minicomp--total 1)
 
 (defun minicomp-beginning-of-buffer ()
   "Go to first candidate."
@@ -512,8 +510,7 @@
 
 (defun minicomp--consult-candidate ()
   "Current candidate."
-  (when minicomp--input
-(minicomp--candidate)))
+  (and minicomp--input (minicomp--candidate)))
 
 (defun minicomp--consult-refresh ()
   "Refresh ui."
@@ -523,20 +520,20 @@
 
 (defun minicomp--embark-target ()
   "Return embark target."
-  (when minicomp--input
-(cons (completion-metadata-get (completion--field-metadata
-(minibuffer-prompt-end))
-   'category)
- (minicomp--candidate
+  (and minicomp--input
+   (cons (completion-metadata-get (completion--field-metadata
+   (minibuffer-prompt-end))
+  'category)
+(minicomp--candidate
 
 (defun minicomp--embark-candidates ()
   "Return embark candidates."
-  (when minicomp--input
-(cons (completion-metadata-get (completion--field-metadata
-(minibuffer-prompt-end))
-   'category)
-  ;; full candidates?
-  minicomp--candidates)))
+  (and minicomp--input
+   (cons (completion-metadata-get (completion--field-metadata
+   (minibuffer-prompt-end))
+  'category)
+ ;; full candidates?
+ minicomp--candidates)))
 
 (with-eval-after-load 'consult
   (add-hook 'consult--completion-candidate-hook #'minicomp--consult-candidate)



[elpa] externals/vertico 2cde6fd 40/48: Simplify

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 2cde6fd1e4bbf4ca1c128b0e5488db613e1d30d7
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify
---
 minicomp.el | 22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 728ac9e..c61d958 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -423,18 +423,16 @@
   (interactive "P")
   (unless arg
 (minicomp-insert))
-  (cond
-   ((let ((input (minibuffer-contents-no-properties)))
-  (or (memq minibuffer--require-match '(nil confirm-after-completion))
-  (equal "" input)
-  (test-completion input
-   minibuffer-completion-table
-   minibuffer-completion-predicate)))
-(exit-minibuffer))
-   ((eq minibuffer--require-match 'confirm)
-(when (eq (ignore-errors (read-char "Confirm")) 13)
-  (exit-minibuffer)))
-   (t (message "Match required"
+  (let ((input (minibuffer-contents-no-properties)))
+(if (or (memq minibuffer--require-match '(nil confirm-after-completion))
+(equal "" input)
+(test-completion input
+ minibuffer-completion-table
+ minibuffer-completion-predicate)
+(and (eq minibuffer--require-match 'confirm)
+ (eq (ignore-errors (read-char "Confirm")) 13)))
+(exit-minibuffer)
+  (message "Match required"
 
 (defun minicomp-exit-input ()
   "Exit minibuffer with input."



[elpa] externals/vertico 1a9b1b2 48/48: Update readme

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 1a9b1b21f796ea89c12edc4933aac428f52c449d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Update readme
---
 README.org | 49 +
 vertico.el |  8 
 2 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/README.org b/README.org
index 05f1c02..c11f5ff 100644
--- a/README.org
+++ b/README.org
@@ -5,24 +5,29 @@
 * Introduction
 
 This package provides a minimalistic vertical completion system, which is based
-on the default completion system. By reusing the default system, we achieve 
full
-compatibility with built-in Emacs commands and completion tables. Vertico is
-pretty bare-bone and only provides a minimal set of commands. The code base is
-less than 500 lines of code. If you are looking for a more full-featured
-package, you may be interested in 
[[https://github.com/raxod502/selectrum][Selectrum]]. Selectrum supports 
Avy-style quick
-keys, a horizontal display and a buffer display.
+on the default completion system. By reusing the default system, Vertico
+achieves full compatibility with built-in Emacs commands and completion tables.
+Vertico is pretty bare-bone and only provides a minimal set of commands. The
+code base is less than 500 lines of code.
 
-Complementary packages, which are fully supported:
+[[https://github.com/minad/vertico/blob/main/screenshot.svg?raw=true]]
 
-- [[https://github.com/minad/marginalia][Marginalia]]: Rich annotations in the 
minibuffer
-- [[https://github.com/minad/consult][Consult]]: Many useful search and 
navigation commands
-- [[https://github.com/oantolin/embark][Embark]]: Minibuffer actions and 
context menu
-- [[https://github.com/oantolin/orderless][Orderless]]: Advanced completion 
style
+* Features
 
-[[https://github.com/minad/vertico/blob/main/screenshot.svg?raw=true]]
+- Vertical display, which can be navigated with the arrow keys
+- Shows the index of the current candidate and the total number of candidates
+- Current candidate can be inserted with =TAB= and selected with =RET=
+- Non-existing candidates can be entered by moving the point to the prompt line
+- Candidates are sorted by history, string length and alphabetically
+- Long candidates with newlines are formatted to take up less space
+- Support for =annotation-function=, =affixation-function= and 
=x-group-function=
 
 * Configuration
 
+After installation, Vertico can be enabled with =M-x vertico-mode=. In order to
+configure Vertico and other packages in your init.el, you may want to use
+=use-package=. Here is an example configuration:
+
 #+begin_src emacs-lisp
   ;; Enable vertico
   (use-package vertico
@@ -42,3 +47,23 @@ Complementary packages, which are fully supported:
 (cons (concat "[CRM] " (car args)) (cdr args)))
   (advice-add #'completing-read-multiple :filter-args #'crm-indicator)
 #+end_src
+
+* Complementary packages
+
+Vertico works well together with a few complementary packages, which enrich the
+completion UI. These packages are fully supported:
+
+- [[https://github.com/minad/marginalia][Marginalia]]: Rich annotations in the 
minibuffer
+- [[https://github.com/minad/consult][Consult]]: Many useful search and 
navigation commands
+- [[https://github.com/oantolin/embark][Embark]]: Minibuffer actions and 
context menu
+- [[https://github.com/oantolin/orderless][Orderless]]: Advanced completion 
style
+
+* Alternatives
+
+- [[https://github.com/raxod502/selectrum][Selectrum]]: If you are looking for 
a more full-featured package, you may be
+  interested in Selectrum, which provides a similar UI as Vertico. Additionally
+  Selectrum supports Avy-style quick keys, a horizontal display and a
+  configurable buffer display.
+- [[https://github.com/oantolin/icomplete-vertical][Icomplete-vertical]]: This 
package enhances the Emacs builtin Icomplete with a
+  vertical display. In contrast to Vertico, the candidates are rotated such 
that
+  the current candidate always appears at the top.
diff --git a/vertico.el b/vertico.el
index e380f48..a5a11e0 100644
--- a/vertico.el
+++ b/vertico.el
@@ -28,10 +28,10 @@
 ;;; Commentary:
 
 ;; This package provides a minimalistic vertical completion system, which is
-;; based on the default completion system. By reusing the default system, we
-;; achieve full compatibility with built-in Emacs commands and completion
-;; tables. Vertico is pretty bare-bone and only provides a minimal set of
-;; commands.
+;; based on the default completion system. By reusing the default system,
+;; Vertico achieve full compatibility with built-in Emacs commands and
+;; completion tables. Vertico is pretty bare-bone and only provides a minimal
+;; set of commands.
 
 ;;; Code:
 



[elpa] externals/vertico f3c0e7c 35/48: tidy shadowed file names

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit f3c0e7cda44e97597b271f495c6ecaa65e32627b
Author: Daniel Mendler 
Commit: Daniel Mendler 

tidy shadowed file names
---
 minicomp.el | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 78dda0f..0bd51eb 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -33,8 +33,8 @@
 
 ;;; Code:
 
-(require 'seq)
 (require 'cl-lib)
+(require 'seq)
 (eval-when-compile
   (require 'subr-x))
 
@@ -231,7 +231,7 @@
  (setcdr last nil))
  0))
  (total))
-(when (eq (completion-metadata-get metadata 'category) 'file)
+(when minibuffer-completing-file-name
   (setq all (cl-delete-if (apply-partially #'string-match-p 
"\\(\\`\\|/\\)\\.?\\./\\'") all)))
 (setq total (length all)
   all (if (> total minicomp-sort-threshold)
@@ -348,8 +348,20 @@
  (if (< minicomp--index 0) "*" (1+ 
minicomp--index))
  minicomp--total)
 
+(defun minicomp--tidy-shadowed-file ()
+  "Tidy shadowed file name."
+  (when (and minibuffer-completing-file-name
+ (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 minicomp--exhibit ()
   "Exhibit completion UI."
+  (minicomp--tidy-shadowed-file)
   (let ((metadata (completion--field-metadata (minibuffer-prompt-end)))
 (input (minibuffer-contents-no-properties)))
 (unless (equal minicomp--input input)



[elpa] externals/vertico 3257082 07/48: always keep index when explicitly navigating

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 325708273500f86bfdf77afcc36086b4ea1f0e1b
Author: Daniel Mendler 
Commit: Daniel Mendler 

always keep index when explicitly navigating
---
 minicomp.el | 32 +++-
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index b138353..6ca97dc 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -195,14 +195,15 @@
   (pcase (let ((while-no-input-ignore-events '(selection-request)))
(while-no-input (minicomp--candidates input metadata)))
 (`(,base ,total ,candidates)
- (if-let* ((old (and candidates
- minicomp--keep
- (>= minicomp--index 0)
- (nth minicomp--index minicomp--candidates)))
-   (idx (seq-position candidates old)))
- (setq minicomp--index idx)
-   (setq minicomp--keep nil
- minicomp--index (if candidates 0 -1)))
+ (unless (and minicomp--keep (< minicomp--index 0))
+   (if-let* ((old (and candidates
+   minicomp--keep
+   (>= minicomp--index 0)
+   (nth minicomp--index minicomp--candidates)))
+ (idx (seq-position candidates old)))
+   (setq minicomp--index idx)
+ (setq minicomp--keep nil
+   minicomp--index (if candidates 0 -1
  (setq minicomp--base base
minicomp--input input
minicomp--total total
@@ -277,7 +278,6 @@
 
 (defun minicomp--exhibit ()
   "Exhibit completion UI."
-  (setq minicomp--keep (or minicomp--keep (> minicomp--index 0)))
   (let ((metadata (completion--field-metadata (minibuffer-prompt-end)))
 (input (minibuffer-contents-no-properties)))
 (unless (equal minicomp--input input)
@@ -287,34 +287,40 @@
 (defun minicomp-beginning-of-buffer ()
   "Go to first candidate."
   (interactive)
-  (setq minicomp--index (if (> minicomp--total 0) 0 -1)))
+  (setq minicomp--index (if (> minicomp--total 0) 0 -1)
+minicomp--keep t))
 
 (defun minicomp-end-of-buffer ()
   "Go to last candidate."
   (interactive)
-  (setq minicomp--index (- minicomp--total 1)))
+  (setq minicomp--index (- minicomp--total 1)
+minicomp--keep t))
 
 (defun minicomp-scroll-down ()
   "Go back by one page."
   (interactive)
+  (setq minicomp--keep t)
   (when (>= minicomp--index 0)
 (setq minicomp--index (max 0 (- minicomp--index minicomp-count)
 
 (defun minicomp-scroll-up ()
   "Go forward by one page."
   (interactive)
+  (setq minicomp--keep t)
   (when (>= minicomp--index 0)
 (setq minicomp--index (min (- minicomp--total 1) (+ minicomp--index 
minicomp-count)
 
 (defun minicomp-next ()
   "Go to next candidate."
   (interactive)
-  (setq minicomp--index (min (1+ minicomp--index) (- minicomp--total 1
+  (setq minicomp--index (min (1+ minicomp--index) (- minicomp--total 1))
+minicomp--keep t))
 
 (defun minicomp-previous ()
   "Go to previous candidate."
   (interactive)
-  (setq minicomp--index (max -1 (- minicomp--index 1
+  (setq minicomp--index (max -1 (- minicomp--index 1))
+minicomp--keep t))
 
 (defun minicomp-exit ()
   "Exit minibuffer with current candidate."



[elpa] externals/vertico e2472d1 13/48: simplify

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit e2472d110a7097659b5cd77d804a5b427306b931
Author: Daniel Mendler 
Commit: Daniel Mendler 

simplify
---
 minicomp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/minicomp.el b/minicomp.el
index dab744c..27b3006 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -217,7 +217,7 @@
 (defun minicomp--replace-prop (prop fun str)
   "Replace STR parts with PROP using FUN."
   (let ((len (length str)) (pos 0) (chunks))
-(while (not (= pos len))
+(while (/= pos len)
   (let ((end (next-single-property-change pos prop str len)))
 (push (if-let (val (get-text-property pos prop str))
   (funcall fun val)



[elpa] externals/vertico 406f8b8 44/48: vertico-insert: Insert only if a candidate is selected

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 406f8b82be7673ff35e95dcfa40ee0514984726a
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico-insert: Insert only if a candidate is selected

This keeps the undo information intact.
---
 vertico.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vertico.el b/vertico.el
index c7ebaba..4d071e4 100644
--- a/vertico.el
+++ b/vertico.el
@@ -460,7 +460,7 @@
 (defun vertico-insert ()
   "Insert current candidate in minibuffer."
   (interactive)
-  (let ((cand (vertico--candidate)))
+  (when-let (cand (and (>= vertico--index 0) (vertico--candidate)))
 (delete-minibuffer-contents)
 (insert cand)))
 



[elpa] externals/vertico af41b13 24/48: fix lexical scoping

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit af41b13bf1884b12f678ba5594e3efa17532d9c8
Author: Daniel Mendler 
Commit: Daniel Mendler 

fix lexical scoping
---
 minicomp.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/minicomp.el b/minicomp.el
index 55361fc..bf4e846 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -431,6 +431,7 @@
   (concat (substring content 0 minicomp--base)
   (nth minicomp--index minicomp--candidates)
 
+(defvar orderless-skip-highlighting)
 (defun minicomp--setup ()
   "Setup completion system."
   (setq-local truncate-lines nil)



[elpa] externals/vertico c4b3e8b 42/48: Simplify minicomp--flatten-prop

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit c4b3e8be2ffd58d578d0b9a9dddadd7fc8f7cdf5
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify minicomp--flatten-prop
---
 minicomp.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index bc09332..a66c7cb 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -282,15 +282,15 @@
minicomp--total total
minicomp--candidates candidates
 
-(defun minicomp--replace-prop (prop fun str)
-  "Replace STR parts with PROP using FUN."
+(defun minicomp--flatten-prop (prop insert str)
+  "Flatten STR with PROP, INSERT or remove."
   (let ((len (length str)) (pos 0) (chunks))
 (while (/= pos len)
   (let ((end (next-single-property-change pos prop str len)))
-(push (if-let (val (get-text-property pos prop str))
-  (funcall fun val)
-(substring str pos end))
-  chunks)
+(if-let (val (get-text-property pos prop str))
+(when (and insert (stringp val))
+  (push val chunks))
+  (push (substring str pos end) chunks))
 (setq pos end)))
 (apply #'concat (nreverse chunks
 
@@ -332,8 +332,8 @@
  (replace-regexp-in-string "[\t ]+" " ")
  (replace-regexp-in-string "[\t\n ]*\n[\t\n ]*" (car 
minicomp-truncation))
  (string-trim)
- (minicomp--replace-prop 'display (lambda (x) (if (stringp 
x) x "")))
- (minicomp--replace-prop 'invisible (lambda (_) "")))
+ (minicomp--flatten-prop 'display 'insert)
+ (minicomp--flatten-prop 'invisible nil))
   cand (truncate-string-to-width cand max-width 0 nil (cadr 
minicomp-truncation))
   cand (concat prefix cand
(if (text-property-not-all 0 (length suffix) 'face 
nil suffix)



[elpa] externals/vertico 4acc17e 38/48: Show !/0 if match is required

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 4acc17e8c5e1cb1b180750f15f6799ac2d505e10
Author: Daniel Mendler 
Commit: Daniel Mendler 

Show !/0 if match is required
---
 minicomp.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 8432940..2df2b6f 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -289,8 +289,7 @@
   (let* ((index (min (max 0 (- minicomp--index (/ minicomp-count 2)))
  (max 0 (- minicomp--total minicomp-count
  (candidates (seq-subseq minicomp--candidates index
- (min (+ index minicomp-count)
-  minicomp--total)))
+ (min (+ index minicomp-count) 
minicomp--total)))
  (ann-candidates
   (minicomp--annotate
metadata
@@ -349,7 +348,10 @@
 (overlay-put minicomp--count-ov 'before-string
  (format (car minicomp-count-format)
  (format (cdr minicomp-count-format)
- (if (< minicomp--index 0) "*" (1+ 
minicomp--index))
+ (cond
+  ((>= minicomp--index 0) (1+ minicomp--index))
+  ((minicomp--require-match) "!")
+  (t "*"))
  minicomp--total)
 
 (defun minicomp--tidy-shadowed-file ()
@@ -384,10 +386,8 @@
   "Go to INDEX."
   (setq minicomp--keep t
 minicomp--index
-(max
- (if (and (minicomp--require-match) (> minicomp--total 0))
- 0
-   -1)
+(max (if (and (minicomp--require-match) minicomp--candidates)
+ 0 -1)
  (min index (- minicomp--total 1)
 
 (defun minicomp-beginning-of-buffer ()



[elpa] externals/vertico 5bbddb0 03/48: add while-no-input-ignore-events

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 5bbddb0cdfa70efa912a72d038d7aa37c8a3b927
Author: Daniel Mendler 
Commit: Daniel Mendler 

add while-no-input-ignore-events

Thanks, @clemera
---
 minicomp.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/minicomp.el b/minicomp.el
index 3bd884d..f7fa5ba 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -188,7 +188,8 @@
 
 (defun minicomp--recompute (input metadata)
   "Preprocess candidates with INPUT string and METADATA."
-  (pcase (while-no-input (minicomp--candidates input metadata))
+  (pcase (let ((while-no-input-ignore-events '(selection-request)))
+   (while-no-input (minicomp--candidates input metadata)))
 (`(,base ,total ,candidates)
  (if-let* ((old (and candidates
  minicomp--keep



[elpa] externals/vertico 7fbaeaf 15/48: Add sorting by history for files

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 7fbaeaf06b988db85e9f38e2d410376997d493c5
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add sorting by history for files

cc @clemera, https://github.com/raxod502/selectrum/issues/502
---
 minicomp.el | 63 -
 1 file changed, 41 insertions(+), 22 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 27b3006..98c1ca6 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -90,6 +90,9 @@
 (defvar-local minicomp--history-hash nil
   "History hash table.")
 
+(defvar-local minicomp--history-dir nil
+  "Directory of `minicomp--history-hash'.")
+
 (defvar-local minicomp--candidates-ov nil
   "Overlay showing the candidates.")
 
@@ -120,24 +123,41 @@
   (and (= (cdr x) (cdr y))
(string< (car x) (car y)
 
-(defun minicomp--sort (candidates)
-  "Sort CANDIDATES by history position, length and alphabetically."
-  (unless minicomp--history-hash
-;; History disabled if `minibuffer-history-variable' eq `t'.
-(let ((list (and (not (eq minibuffer-history-variable t))
- (symbol-value minibuffer-history-variable)))
-  (hist-idx 0))
-  (setq minicomp--history-hash (make-hash-table :test #'equal
-:size (length list)))
-  ;; Store the history position first in a hashtable in order to
-  ;; allow O(1) history lookup.
-  (dolist (elem list)
-(unless (gethash elem minicomp--history-hash)
-  (puthash elem hist-idx minicomp--history-hash))
-(setq hist-idx (1+ hist-idx)
-  ;; Decorate each candidate with (hist-idx<<13) + length. This way we sort 
first by hist-idx and
-  ;; then by length. We assume that the candidates are shorter than 2**13 
characters and that the
-  ;; history is shorter than 2**16 entries.
+(defun minicomp--sort (input candidates)
+  "Sort CANDIDATES by history position, length and alphabetically, given 
current INPUT."
+  ;; Store the history position first in a hashtable in order to allow O(1) 
history lookup. File
+  ;; names get special treatment. In principle, completion tables with 
boundaries should also get
+  ;; special treatment, but files are the most important.
+  (let ((index 0)
+;; History disabled if `minibuffer-history-variable' eq `t'.
+(hist (and (not (eq minibuffer-history-variable t))
+   (symbol-value minibuffer-history-variable
+(if (eq minibuffer-history-variable 'file-name-history)
+  (let* ((dir (expand-file-name (substitute-in-file-name
+ (or (file-name-directory input)
+ default-directory
+ (adir (abbreviate-file-name dir)))
+(unless (equal minicomp--history-dir dir)
+  (setq minicomp--history-hash (make-hash-table :test #'equal :size 
(length hist))
+minicomp--history-dir dir)
+  (dolist (elem hist)
+(when-let (file (cond
+ ((string-prefix-p dir elem) (substring elem 
(length dir)))
+ ((string-prefix-p adir elem) (substring elem 
(length adir)
+  (when-let (slash (string-match-p "/" file))
+(setq file (substring file 0 (1+ slash
+  (unless (gethash file minicomp--history-hash)
+(puthash file index minicomp--history-hash)))
+(setq index (1+ index)
+  (unless minicomp--history-hash
+(setq minicomp--history-hash (make-hash-table :test #'equal :size 
(length hist)))
+(dolist (elem hist)
+  (unless (gethash elem minicomp--history-hash)
+(puthash elem index minicomp--history-hash))
+  (setq index (1+ index))
+  ;; Decorate each candidate with (index<<13) + length. This way we sort first 
by index and then by
+  ;; length. We assume that the candidates are shorter than 2**13 characters 
and that the history is
+  ;; shorter than 2**16 entries.
   (let ((cand candidates))
 (while cand
   (setcar cand (cons (car cand)
@@ -181,10 +201,9 @@
 (setq total (length all)
   all (if (> total minicomp-sort-threshold)
   all
-(funcall
- (or (completion-metadata-get metadata 'display-sort-function)
- #'minicomp--sort)
- all)))
+(if-let (sort (completion-metadata-get metadata 
'display-sort-function))
+(funcall sort all)
+  (minicomp--sort input all
 (when-let* ((def (cond
   ((stringp (car-safe minibuffer-default)) (car 
minibuffer-default))
   ((stringp minibuffer-default) minibuffer-default)))



[elpa] externals/vertico e8a3e96 16/48: Minor optimization

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit e8a3e965bdb781b96f9bfbfd5205379af0ffd567
Author: Daniel Mendler 
Commit: Daniel Mendler 

Minor optimization
---
 minicomp.el | 56 +---
 1 file changed, 33 insertions(+), 23 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 98c1ca6..5e6597e 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -128,33 +128,43 @@
   ;; Store the history position first in a hashtable in order to allow O(1) 
history lookup. File
   ;; names get special treatment. In principle, completion tables with 
boundaries should also get
   ;; special treatment, but files are the most important.
-  (let ((index 0)
-;; History disabled if `minibuffer-history-variable' eq `t'.
-(hist (and (not (eq minibuffer-history-variable t))
-   (symbol-value minibuffer-history-variable
-(if (eq minibuffer-history-variable 'file-name-history)
-  (let* ((dir (expand-file-name (substitute-in-file-name
- (or (file-name-directory input)
- default-directory
- (adir (abbreviate-file-name dir)))
-(unless (equal minicomp--history-dir dir)
-  (setq minicomp--history-hash (make-hash-table :test #'equal :size 
(length hist))
-minicomp--history-dir dir)
-  (dolist (elem hist)
-(when-let (file (cond
- ((string-prefix-p dir elem) (substring elem 
(length dir)))
- ((string-prefix-p adir elem) (substring elem 
(length adir)
+  (cond
+   ((eq minibuffer-history-variable 'file-name-history)
+(let ((dir (expand-file-name (substitute-in-file-name
+  (or (file-name-directory input)
+  default-directory)
+  (unless (equal minicomp--history-dir dir)
+(setq minicomp--history-hash (make-hash-table :test #'equal :size 
(length file-name-history))
+  minicomp--history-dir dir)
+(let* ((index 0)
+   (adir (abbreviate-file-name dir))
+   (dlen (length dir))
+   (alen (length adir)))
+  (dolist (elem file-name-history)
+(let* ((len (length elem))
+   (file (cond
+  ((and (> len dlen)
+(eq t (compare-strings dir 0 dlen elem 0 
dlen)))
+   (substring elem dlen))
+  ((and (> len alen)
+(eq t (compare-strings adir 0 alen elem 0 
alen)))
+   (substring elem alen)
+(when file
   (when-let (slash (string-match-p "/" file))
 (setq file (substring file 0 (1+ slash
   (unless (gethash file minicomp--history-hash)
 (puthash file index minicomp--history-hash)))
-(setq index (1+ index)
-  (unless minicomp--history-hash
-(setq minicomp--history-hash (make-hash-table :test #'equal :size 
(length hist)))
-(dolist (elem hist)
-  (unless (gethash elem minicomp--history-hash)
-(puthash elem index minicomp--history-hash))
-  (setq index (1+ index))
+(setq index (1+ index
+   ((not minicomp--history-hash)
+(let ((index 0)
+  ;; History disabled if `minibuffer-history-variable' eq `t'.
+  (hist (and (not (eq minibuffer-history-variable t))
+ (symbol-value minibuffer-history-variable
+  (setq minicomp--history-hash (make-hash-table :test #'equal :size 
(length hist)))
+  (dolist (elem hist)
+(unless (gethash elem minicomp--history-hash)
+  (puthash elem index minicomp--history-hash))
+(setq index (1+ index))
   ;; Decorate each candidate with (index<<13) + length. This way we sort first 
by index and then by
   ;; length. We assume that the candidates are shorter than 2**13 characters 
and that the history is
   ;; shorter than 2**16 entries.



[elpa] externals/vertico 933e938 06/48: Compute history hash table only once

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 933e938927ccb055224c0b6238a1001bb4c5c791
Author: Daniel Mendler 
Commit: Daniel Mendler 

Compute history hash table only once
---
 minicomp.el | 47 +--
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 91d223b..b138353 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -86,6 +86,9 @@
 map)
   "Minibuffer keymap.")
 
+(defvar-local minicomp--history-hash nil
+  "History hash table.")
+
 (defvar-local minicomp--candidates-ov nil
   "Overlay showing the candidates.")
 
@@ -118,31 +121,31 @@
 
 (defun minicomp--sort (candidates)
   "Sort CANDIDATES by history position, length and alphabetically."
-  ;; History disabled if `minibuffer-history-variable' eq `t'.
-  (let* ((list (and (not (eq minibuffer-history-variable t))
-(symbol-value minibuffer-history-variable)))
- (hist-len (length list))
- (hist (make-hash-table :test #'equal
-:size hist-len))
- (hist-idx 0)
- (cand candidates))
-;; Store the history position first in a hashtable in order to
-;; allow O(1) history lookup.
-(dolist (elem list)
-  (unless (gethash elem hist)
-(puthash elem hist-idx hist))
-  (setq hist-idx (1+ hist-idx)))
-;; Decorate each candidate with (hist-idx<<13) + length. This
-;; way we sort first by hist-idx and then by length. We assume
-;; that the candidates are not longer than 2**13 characters.
+  (unless minicomp--history-hash
+;; History disabled if `minibuffer-history-variable' eq `t'.
+(let ((list (and (not (eq minibuffer-history-variable t))
+ (symbol-value minibuffer-history-variable)))
+  (hist-idx 0))
+  (setq minicomp--history-hash (make-hash-table :test #'equal
+:size (length list)))
+  ;; Store the history position first in a hashtable in order to
+  ;; allow O(1) history lookup.
+  (dolist (elem list)
+(unless (gethash elem minicomp--history-hash)
+  (puthash elem hist-idx minicomp--history-hash))
+(setq hist-idx (1+ hist-idx)
+  ;; Decorate each candidate with (hist-idx<<13) + length. This way we sort 
first by hist-idx and
+  ;; then by length. We assume that the candidates are shorter than 2**13 
characters and that the
+  ;; history is shorter than 2**16 entries.
+  (let ((cand candidates))
 (while cand
   (setcar cand (cons (car cand)
- (+ (lsh (gethash (car cand) hist hist-len) 13)
+ (+ (lsh (gethash (car cand) minicomp--history-hash 
#x) 13)
 (length (car cand)
-  (setq cand (cdr cand)))
-(setq candidates (sort candidates #'minicomp--pred)
-  cand candidates)
-;; Drop decoration from the candidates
+  (setq cand (cdr cand
+  (setq candidates (sort candidates #'minicomp--pred))
+  ;; Drop decoration from the candidates
+  (let ((cand candidates))
 (while cand
   (setcar cand (caar cand))
   (setq cand (cdr cand



[elpa] externals/vertico f132f1b 10/48: improve prompt selection, add minicomp--goto

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit f132f1b6cf6203d7020560af0d576ade4d5a1cfe
Author: Daniel Mendler 
Commit: Daniel Mendler 

improve prompt selection, add minicomp--goto
---
 minicomp.el | 40 +++-
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 6995ee7..5b8f85c 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -272,7 +272,7 @@
 ann-candidates (cdr ann-candidates)
 index (1+ index)))
 (put-text-property 0 1 'cursor t displayed)
-(if (< minicomp--index 0)
+(if (and (< minicomp--index 0) (not (minicomp--require-match)))
 (add-text-properties (minibuffer-prompt-end) (point-max) '(face 
minicomp-current))
   (remove-text-properties (minibuffer-prompt-end) (point-max) '(face nil)))
 (move-overlay minicomp--count-ov (point-min) (point-min))
@@ -291,43 +291,49 @@
   (minicomp--recompute input metadata))
 (minicomp--display input metadata)))
 
+(defun minicomp--require-match ()
+  "Match is required."
+  (not (memq minibuffer--require-match '(nil confirm 
confirm-after-completion
+
+(defun minicomp--goto (index)
+  "Go to INDEX."
+  (setq minicomp--keep t
+minicomp--index
+(max
+ (if (and (minicomp--require-match) (> minicomp--total 0))
+ 0
+   -1)
+ (min index (- minicomp--total 1)
+
 (defun minicomp-beginning-of-buffer ()
   "Go to first candidate."
   (interactive)
-  (setq minicomp--index (if (> minicomp--total 0) 0 -1)
-minicomp--keep t))
+  (minicomp--goto 0))
 
 (defun minicomp-end-of-buffer ()
   "Go to last candidate."
   (interactive)
-  (setq minicomp--index (- minicomp--total 1)
-minicomp--keep t))
+  (minicomp--goto (- minicomp--total 1)))
 
 (defun minicomp-scroll-down ()
   "Go back by one page."
   (interactive)
-  (setq minicomp--keep t)
-  (when (>= minicomp--index 0)
-(setq minicomp--index (max 0 (- minicomp--index minicomp-count)
+  (minicomp--goto (max 0 (- minicomp--index minicomp-count
 
 (defun minicomp-scroll-up ()
   "Go forward by one page."
   (interactive)
-  (setq minicomp--keep t)
-  (when (>= minicomp--index 0)
-(setq minicomp--index (min (- minicomp--total 1) (+ minicomp--index 
minicomp-count)
+  (minicomp--goto (+ minicomp--index minicomp-count)))
 
 (defun minicomp-next ()
   "Go to next candidate."
   (interactive)
-  (setq minicomp--index (min (1+ minicomp--index) (- minicomp--total 1))
-minicomp--keep t))
+  (minicomp--goto (1+ minicomp--index)))
 
 (defun minicomp-previous ()
   "Go to previous candidate."
   (interactive)
-  (setq minicomp--index (max -1 (- minicomp--index 1))
-minicomp--keep t))
+  (minicomp--goto (- minicomp--index 1)))
 
 (defun minicomp-exit ()
   "Exit minibuffer with current candidate."
@@ -336,13 +342,13 @@
   (cond
((let ((input (minibuffer-contents-no-properties)))
   (or (not minibuffer--require-match)
-  (eq minibuffer-completion-confirm 'confirm-after-completion)
+  (eq minibuffer--require-match 'confirm-after-completion)
   (equal "" input)
   (test-completion input
minibuffer-completion-table
minibuffer-completion-predicate)))
 (exit-minibuffer))
-   ((eq minibuffer-completion-confirm 'confirm)
+   ((eq minibuffer--require-match 'confirm)
 (when (eq (read-char "Confirm") 13)
   (exit-minibuffer)))
(t (message "Match required"



[elpa] externals/vertico 866475c 05/48: increase threshold

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 866475c55f3a0b93ef8a3d4ae9a75ae057dae58c
Author: Daniel Mendler 
Commit: Daniel Mendler 

increase threshold
---
 minicomp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/minicomp.el b/minicomp.el
index e9204f3..91d223b 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -37,7 +37,7 @@
   :group 'convenience
   :prefix "minicomp-")
 
-(defcustom minicomp-sort-threshold 1
+(defcustom minicomp-sort-threshold 2
   "Candidates will only be sorted if there are fewer than this threshold."
   :type 'integer)
 



[elpa] externals/vertico f558f53 04/48: extract minicomp--pred

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit f558f53fbbc278350d91d2ddc9f87cfc736a85ba
Author: Daniel Mendler 
Commit: Daniel Mendler 

extract minicomp--pred

This seems to be faster than using a lambda. Is this possible? I am not 
familar
enough with the bytecode interpreter internals...

cc @clemera
---
 minicomp.el | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index f7fa5ba..e9204f3 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -110,6 +110,12 @@
 (defvar-local minicomp--keep nil
   "Keep current candidate index `minicomp--index'.")
 
+(defun minicomp--pred (x y)
+  "Compare X and Y."
+  (or (< (cdr x) (cdr y))
+  (and (= (cdr x) (cdr y))
+   (string< (car x) (car y)
+
 (defun minicomp--sort (candidates)
   "Sort CANDIDATES by history position, length and alphabetically."
   ;; History disabled if `minibuffer-history-variable' eq `t'.
@@ -134,12 +140,7 @@
  (+ (lsh (gethash (car cand) hist hist-len) 13)
 (length (car cand)
   (setq cand (cdr cand)))
-(setq candidates
-  (sort candidates
-(lambda (c1 c2)
-  (or (< (cdr c1) (cdr c2))
-  (and (= (cdr c1) (cdr c2))
-   (string< (car c1) (car c2))
+(setq candidates (sort candidates #'minicomp--pred)
   cand candidates)
 ;; Drop decoration from the candidates
 (while cand



[elpa] externals/vertico f835fb6 14/48: add readme

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit f835fb6c79cb5835caa45375eb229af759ad78ef
Author: Daniel Mendler 
Commit: Daniel Mendler 

add readme
---
 README.org | 28 
 1 file changed, 28 insertions(+)

diff --git a/README.org b/README.org
new file mode 100644
index 000..8873908
--- /dev/null
+++ b/README.org
@@ -0,0 +1,28 @@
+#+title: minicomp.el - Minimal vertical completion system
+#+author: Daniel Mendler
+#+language: en
+
+* Introduction
+
+This package provides a minimal vertical completion system, which is based on
+the default completion system. By reusing the default system, we achieve full
+compatibility with built-in Emacs commands and completion tables. The 
completion
+system is pretty bare-bone and only provides a minimal set of commands. The 
code
+base is less than 500 lines of code. If you are looking for a more 
full-featured
+package, you may be interested in 
[[https://github.com/raxod502/selectrum][Selectrum]]. Selectrum supports 
Avy-style
+selection keys, a horizontal display and a buffer display.
+
+Complementary packages, which are supported:
+
+- [[https://github.com/minad/marginalia][Marginalia]]: Annotations in the 
Minibuffer
+- [[https://github.com/minad/consult][Consult]]: Many useful search and 
navigation commands
+- [[https://github.com/oantolin/embark][Embark]]: Minibuffer actions and 
context menu
+- [[https://github.com/oantolin/orderless][Orderless]]: Advanced completion 
style
+
+* Configuration
+
+#+begin_src emacs-lisp
+(use-package minicomp
+  :init
+  (minicomp-mode))
+#+end_src



[elpa] externals/vertico c2bfea2 17/48: use candidate returned from affixation function

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit c2bfea267b6748091a77b2f67e06ce22c8ce2423
Author: Daniel Mendler 
Commit: Daniel Mendler 

use candidate returned from affixation function
---
 minicomp.el | 75 +++--
 1 file changed, 38 insertions(+), 37 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 5e6597e..fdcd4d3 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -262,48 +262,49 @@
  (candidates (seq-subseq minicomp--candidates index
  (min (+ index minicomp-count)
   minicomp--total)))
- (hl-candidates
-  (if (and (memq 'orderless completion-styles)
-   (fboundp 'orderless-highlight-matches))
-  (orderless-highlight-matches
-   (substring input
-  (car (completion-boundaries input 
minibuffer-completion-table
-  
minibuffer-completion-predicate "")))
-   candidates)
-candidates))
- (ann-candidates (minicomp--annotate metadata candidates))
+ (ann-candidates
+  (minicomp--annotate
+   metadata
+   (if (and (memq 'orderless completion-styles)
+(fboundp 'orderless-highlight-matches))
+   (orderless-highlight-matches
+(substring input
+   (car (completion-boundaries input 
minibuffer-completion-table
+   
minibuffer-completion-predicate "")))
+candidates)
+ candidates)))
  (title nil)
- (displayed (concat " " (and hl-candidates "\n")))
+ (displayed " ")
  (group (completion-metadata-get metadata 'x-group-function)))
-(dolist (cand hl-candidates)
-  (when-let (new-title (and minicomp-group-format group (caar (funcall 
group (list cand)
-(unless (equal title new-title)
-  (setq displayed (concat displayed (format minicomp-group-format 
new-title) "\n")
-title new-title)))
-  (setq cand (thread-last cand
-   (replace-regexp-in-string "[\t ]+" " ")
-   (replace-regexp-in-string "\n+" "⤶")
-   (string-trim)
-   (minicomp--replace-prop 'display (lambda (x) (if (stringp 
x) x "")))
-   (minicomp--replace-prop 'invisible (lambda (_) ""
-  (pcase-let ((`(,prefix . ,suffix) (pcase (car ann-candidates)
-  (`(,_ ,y) (cons nil y))
-  (`(,x ,_ ,y) (cons x y))
-  (_ (cons nil "")
+(dolist (ann-cand ann-candidates)
+  (setq displayed (concat displayed
+  (if (= index (1+ minicomp--index))
+  (propertize "\n" 'face 'minicomp-current)
+"\n")))
+  (let ((prefix "") (suffix "") (cand))
+(pcase ann-cand
+  (`(,c ,s) (setq cand c suffix s))
+  (`(,c ,p ,s) (setq cand c prefix p suffix s))
+  (_ (setq cand ann-cand)))
+(when-let (new-title (and minicomp-group-format group (caar (funcall 
group (list cand)
+  (unless (equal title new-title)
+(setq displayed (concat displayed (format minicomp-group-format 
new-title) "\n")
+  title new-title)))
+(setq cand (thread-last cand
+ (replace-regexp-in-string "[\t ]+" " ")
+ (replace-regexp-in-string "\n+" "⤶")
+ (string-trim)
+ (minicomp--replace-prop 'display (lambda (x) (if (stringp 
x) x "")))
+ (minicomp--replace-prop 'invisible (lambda (_) ""
 (setq cand (concat prefix cand
(if (text-property-not-all 0 (length suffix) 'face 
nil suffix)
suffix
- (propertize suffix 'face 
'completions-annotations)
-  (when (= index minicomp--index)
-(setq cand (concat cand))
-(add-face-text-property 0 (length cand) 'minicomp-current 'append 
cand))
-  (setq displayed (concat displayed cand
-  (when (cdr ann-candidates)
-(if (= index minicomp--index)
-(propertize "\n" 'face 'minicomp-current)
-  "\n")))
-ann-candidates (cdr ann-candidates)
-index (1+ index)))
+ (propertize suffix 'face 
'completions-annotations
+(when (= index minicomp--index)
+  (setq cand (concat cand))
+  (add-face-text-property 0 (length cand) 'minicomp-current 'append 
cand))
+(setq displayed (concat displayed cand)
+  index (1+ index
 

[elpa] externals/vertico 5f64f97 22/48: update readme

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 5f64f97a0233f7c3ada579360ce225a05122c0b3
Author: Daniel Mendler 
Commit: Daniel Mendler 

update readme
---
 README.org  | 10 +-
 minicomp.el |  8 ++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/README.org b/README.org
index 8873908..5e7c8b8 100644
--- a/README.org
+++ b/README.org
@@ -1,16 +1,16 @@
-#+title: minicomp.el - Minimal vertical completion system
+#+title: minicomp.el - Minimalistic vertical minibuffer completion system
 #+author: Daniel Mendler
 #+language: en
 
 * Introduction
 
-This package provides a minimal vertical completion system, which is based on
-the default completion system. By reusing the default system, we achieve full
+This package provides a vertical completion system, which is based on the
+default completion system. By reusing the default system, we achieve full
 compatibility with built-in Emacs commands and completion tables. The 
completion
 system is pretty bare-bone and only provides a minimal set of commands. The 
code
 base is less than 500 lines of code. If you are looking for a more 
full-featured
-package, you may be interested in 
[[https://github.com/raxod502/selectrum][Selectrum]]. Selectrum supports 
Avy-style
-selection keys, a horizontal display and a buffer display.
+package, you may be interested in 
[[https://github.com/raxod502/selectrum][Selectrum]]. Selectrum supports 
Avy-style quick
+keys, a horizontal display and a buffer display.
 
 Complementary packages, which are supported:
 
diff --git a/minicomp.el b/minicomp.el
index 69519a7..55361fc 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -1,4 +1,4 @@
-;;; minicomp.el --- Minimal completion system -*- lexical-binding: t -*-
+;;; minicomp.el --- Minimalistic vertical minibuffer completion system -*- 
lexical-binding: t -*-
 
 ;; Author: Daniel Mendler
 ;; Maintainer: Daniel Mendler
@@ -25,7 +25,11 @@
 
 ;;; Commentary:
 
-;; Minimal completion system.
+;; This package provides a vertical completion system, which is based on the
+;; default completion system. By reusing the default system, we achieve full
+;; compatibility with built-in Emacs commands and completion tables. The
+;; completion system is pretty bare-bone and only provides a minimal set of
+;; commands.
 
 ;;; Code:
 



[elpa] externals/vertico bafee15 19/48: add minicomp-exit-input

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit bafee1508360af568472ef57e2cd2a8fdc57b101
Author: Daniel Mendler 
Commit: Daniel Mendler 

add minicomp-exit-input
---
 minicomp.el | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 6a17f49..c5749a8 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -83,6 +83,7 @@
 (define-key map [remap previous-line-or-history-element] 
#'minicomp-previous)
 (define-key map [remap exit-minibuffer] #'minicomp-exit)
 (define-key map [remap kill-ring-save] #'minicomp-save)
+(define-key map [C-return] #'minicomp-exit-input)
 (define-key map "\t" #'minicomp-insert)
 map)
   "Minibuffer keymap.")
@@ -371,10 +372,11 @@
   (interactive)
   (minicomp--goto (- minicomp--index 1)))
 
-(defun minicomp-exit ()
-  "Exit minibuffer with current candidate."
-  (interactive)
-  (minicomp-insert)
+(defun minicomp-exit (&optional arg)
+  "Exit minibuffer with current candidate or input if prefix ARG is given."
+  (interactive "P")
+  (unless arg
+(minicomp-insert))
   (cond
((let ((input (minibuffer-contents-no-properties)))
   (or (not minibuffer--require-match)
@@ -389,6 +391,11 @@
   (exit-minibuffer)))
(t (message "Match required"
 
+(defun minicomp-exit-input ()
+  "Exit minibuffer with input."
+  (interactive)
+  (minicomp-exit t))
+
 (defun minicomp-save ()
   "Save current candidate to kill ring."
   (interactive)



[elpa] externals/vertico b5cfdd7 09/48: Handle completion boundaries

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit b5cfdd70990050d2acfbcf0c00a5e5eae6d9a5b3
Author: Daniel Mendler 
Commit: Daniel Mendler 

Handle completion boundaries
---
 minicomp.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/minicomp.el b/minicomp.el
index 0497931..6995ee7 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -232,7 +232,11 @@
  (hl-candidates
   (if (and (memq 'orderless completion-styles)
(fboundp 'orderless-highlight-matches))
-  (orderless-highlight-matches input candidates)
+  (orderless-highlight-matches
+   (substring input
+  (car (completion-boundaries input 
minibuffer-completion-table
+  
minibuffer-completion-predicate "")))
+   candidates)
 candidates))
  (ann-candidates (minicomp--annotate metadata candidates))
  (title nil)



[elpa] externals/vertico 94d9c4c 28/48: use literals

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 94d9c4c1a845bf9b73425b32ef11eea2044fb4af
Author: Daniel Mendler 
Commit: Daniel Mendler 

use literals
---
 minicomp.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index cda90ce..c650f37 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -289,12 +289,12 @@
 candidates)))
  (max-width (- (* 2 (window-width)) 5))
  (title)
- (formatted (propertize " " 'cursor t))
+ (formatted #(" " 0 1 (cursor t)))
  (group (completion-metadata-get metadata 'x-group-function)))
 (dolist (ann-cand ann-candidates formatted)
   (setq formatted (concat formatted
   (if (= index (1+ minicomp--index))
-  (propertize "\n" 'face 'minicomp-current)
+  #("\n" 0 1 (face minicomp-current))
 "\n")))
   (let ((prefix "") (suffix "") (cand))
 (pcase ann-cand



[elpa] externals/vertico 59538ff 32/48: Configurable truncation faces

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 59538ff2980d5a242478c1417f25d9336f7dea2c
Author: Daniel Mendler 
Commit: Daniel Mendler 

Configurable truncation faces
---
 minicomp.el | 40 
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 0ff3aac..692f396 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -63,11 +63,21 @@
   "Maximal number of candidates to show."
   :type 'integer)
 
+(defcustom minicomp-truncation
+  '(#("⤶" 0 1 (face minicomp-truncation))
+#("…" 0 1 (face minicomp-truncation)))
+  "Truncation replacement strings."
+  :type '(list string string))
+
 (defgroup minicomp-faces nil
   "Faces used by Minicomp."
   :group 'minicomp
   :group 'faces)
 
+(defface minicomp-truncation
+  '((t :inherit shadow))
+  "Face used to highlight truncation characters.")
+
 (defface minicomp-group-title
   '((t :inherit shadow :slant italic))
   "Face used for the title text of the candidate group headlines.")
@@ -307,17 +317,16 @@
 (setq title new-title)))
 (setq cand (thread-last cand
  (replace-regexp-in-string "[\t ]+" " ")
- (replace-regexp-in-string "\n+" "⤶")
+ (replace-regexp-in-string "[\t\n ]*\n[\t\n ]*" (car 
minicomp-truncation))
  (string-trim)
  (minicomp--replace-prop 'display (lambda (x) (if (stringp 
x) x "")))
  (minicomp--replace-prop 'invisible (lambda (_) "")))
-  cand (truncate-string-to-width cand max-width 0 nil "…")
+  cand (truncate-string-to-width cand max-width 0 nil (cadr 
minicomp-truncation))
   cand (concat prefix cand
(if (text-property-not-all 0 (length suffix) 'face 
nil suffix)
suffix
  (propertize suffix 'face 
'completions-annotations
 (when (= index minicomp--index)
-  (setq cand (concat cand))
   (add-face-text-property 0 (length cand) 'minicomp-current 'append 
cand))
 (push cand chunks)
 (setq index (1+ index
@@ -346,9 +355,9 @@
   (minicomp--update-candidates input metadata))
 (minicomp--display-candidates (minicomp--format-candidates input metadata))
 (minicomp--display-count)
-(if (and (< minicomp--index 0) (not (minicomp--require-match)))
-(add-text-properties (minibuffer-prompt-end) (point-max) '(face 
minicomp-current))
-  (remove-text-properties (minibuffer-prompt-end) (point-max) '(face 
nil)
+(if (or (>= minicomp--index 0) (minicomp--require-match))
+(remove-text-properties (minibuffer-prompt-end) (point-max) '(face 
nil))
+  (add-text-properties (minibuffer-prompt-end) (point-max) '(face 
minicomp-current)
 
 (defun minicomp--require-match ()
   "Match is required."
@@ -401,8 +410,7 @@
 (minicomp-insert))
   (cond
((let ((input (minibuffer-contents-no-properties)))
-  (or (not minibuffer--require-match)
-  (eq minibuffer--require-match 'confirm-after-completion)
+  (or (memq minibuffer--require-match '(nil confirm-after-completion))
   (equal "" input)
   (test-completion input
minibuffer-completion-table
@@ -443,14 +451,17 @@
 (defvar orderless-skip-highlighting)
 (defun minicomp--setup ()
   "Setup completion system."
-  (setq-local truncate-lines nil)
-  (setq-local resize-mini-windows 'grow-only)
-  (setq-local max-mini-window-height 1.0)
+  (setq minicomp--input t
+minicomp--candidates-ov (make-overlay (point-max) (point-max) nil t t)
+minicomp--count-ov (make-overlay (point-min) (point-min) nil t t))
+  (setq-local truncate-lines nil
+  resize-mini-windows 'grow-only
+  max-mini-window-height 1.0)
   ;; Optimize orderless filtering, skip highlighting
   (when (and (boundp 'orderless-skip-highlighting)
  (equal (default-value 'completion-styles) '(orderless)))
-(setq-local orderless-skip-highlighting t)
-(setq-local minicomp--highlight-function
+(setq-local orderless-skip-highlighting t
+minicomp--highlight-function
 (lambda (input metadata candidates)
   (let ((orderless-skip-highlighting nil))
 (nconc
@@ -460,9 +471,6 @@
  (length input)
  metadata)
  nil)
-  (setq minicomp--input t
-minicomp--candidates-ov (make-overlay (point-max) (point-max) nil t t)
-minicomp--count-ov (make-overlay (point-min) (point-min) nil t t))
   (use-local-map minicomp-map)
   (add-hook 'post-command-hook #'minicomp--exhibit -99 'local))
 



[elpa] externals/vertico f4bde3a 36/48: Ensure that orderless highlighting succeeds

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit f4bde3a1fb84b5df464093aeb8b3c1b226ab5b9f
Author: Daniel Mendler 
Commit: Daniel Mendler 

Ensure that orderless highlighting succeeds
---
 minicomp.el | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 0bd51eb..c7f9425 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -476,14 +476,18 @@
 (setq-local orderless-skip-highlighting t
 minicomp--highlight-function
 (lambda (input metadata candidates)
-  (let ((orderless-skip-highlighting nil))
-(nconc
- (completion-all-completions input
- candidates
- nil
- (length input)
- metadata)
- nil)
+  ;; Pass once again through the completion style for 
highlighting
+  (let* ((orderless-skip-highlighting nil)
+ (highlighted (nconc
+   (completion-all-completions input
+   candidates
+   nil
+   (length 
input)
+   metadata)
+   nil)))
+;; Check if everything went alright, all the candidates 
should still be present.
+(if (= (length highlighted) (length candidates))
+highlighted candidates)
   (use-local-map minicomp-map)
   (add-hook 'post-command-hook #'minicomp--exhibit -99 'local))
 



[elpa] externals/vertico 708f89d 46/48: Update copyright information

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 708f89d0ca2df11849d24c68da8c7ab8b0e27da8
Author: Daniel Mendler 
Commit: Daniel Mendler 

Update copyright information
---
 vertico.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vertico.el b/vertico.el
index b502620..d36b5ea 100644
--- a/vertico.el
+++ b/vertico.el
@@ -1,5 +1,7 @@
 ;;; vertico.el --- VERTical Interactive COmpletion -*- lexical-binding: t -*-
 
+;; Copyright (C) 2021  Free Software Foundation, Inc.
+
 ;; Author: Daniel Mendler
 ;; Maintainer: Daniel Mendler
 ;; Created: 2021
@@ -8,7 +10,7 @@
 ;; Package-Requires: ((emacs "27.1"))
 ;; Homepage: https://github.com/minad/vertico
 
-;; This file is not part of GNU Emacs.
+;; 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



[elpa] branch externals/vertico created (now 1a9b1b2)

2021-04-05 Thread Stefan Monnier
monnier pushed a change to branch externals/vertico.

at  1a9b1b2   Update readme

This branch includes the following new commits:

   new  9355d05   minicomp - initial commit
   new  06e5dfe   improve minibuffer resizing
   new  5bbddb0   add while-no-input-ignore-events
   new  f558f53   extract minicomp--pred
   new  866475c   increase threshold
   new  933e938   Compute history hash table only once
   new  3257082   always keep index when explicitly navigating
   new  9b81d8d   remove ./ and ../ from file completion candidates
   new  b5cfdd7   Handle completion boundaries
   new  f132f1b   improve prompt selection, add minicomp--goto
   new  4ce7c8d   use seq-subseq
   new  99a355c   abort minibuffer session if while-no-input returns nil
   new  e2472d1   simplify
   new  f835fb6   add readme
   new  7fbaeaf   Add sorting by history for files
   new  e8a3e96   Minor optimization
   new  c2bfea2   use candidate returned from affixation function
   new  1b75916   better orderless integration
   new  bafee15   add minicomp-exit-input
   new  9db7c78   add minicomp-count-format
   new  245944a   remap previous/next-line
   new  5f64f97   update readme
   new  cc3ba08   add screenshot
   new  af41b13   fix lexical scoping
   new  42823ce   Use read-char-exclusive to avoid error message
   new  fa9e8dc   split functions
   new  27070bb   truncate long candidate strings
   new  94d9c4c   use literals
   new  333a0a2   use chunks for candidate formatting
   new  8b760bc   Fix minicomp--index initialization
   new  308670c   Fix confirmation: Use ignore-errors+read-char
   new  59538ff   Configurable truncation faces
   new  ed87a60   Require 27.1
   new  d57d390   Support partial completion for files
   new  f3c0e7c   tidy shadowed file names
   new  f4bde3a   Ensure that orderless highlighting succeeds
   new  b7e6de9   Filter files with completion-ignored-extensions
   new  4acc17e   Show !/0 if match is required
   new  c0606cf   Formatting
   new  2cde6fd   Simplify
   new  afd0abf   Always pass again through completion style for 
highlighting
   new  c4b3e8b   Simplify minicomp--flatten-prop
   new  e429e06   Rename to vertico
   new  406f8b8   vertico-insert: Insert only if a candidate is selected
   new  7fdfd52   Formatting
   new  708f89d   Update copyright information
   new  eb5d617   Improve candidate sanitization
   new  1a9b1b2   Update readme




[elpa] externals/vertico 9355d05 01/48: minicomp - initial commit

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 9355d050d45cd8071c784225ce1d53ed567c7617
Author: Daniel Mendler 
Commit: Daniel Mendler 

minicomp - initial commit
---
 minicomp.el | 418 
 1 file changed, 418 insertions(+)

diff --git a/minicomp.el b/minicomp.el
new file mode 100644
index 000..5d4d789
--- /dev/null
+++ b/minicomp.el
@@ -0,0 +1,418 @@
+;;; minicomp.el --- Minimal completion system -*- lexical-binding: t -*-
+
+;; Author: Daniel Mendler
+;; Maintainer: Daniel Mendler
+;; Created: 2021
+;; License: GPL-3.0-or-later
+;; Version: 0.1
+;; Package-Requires: ((emacs "27"))
+;; Homepage: https://github.com/minad/minicomp
+
+;; This file is not 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:
+
+;; Minimal completion system.
+
+;;; Code:
+
+(eval-when-compile
+  (require 'subr-x))
+
+(defgroup minicomp nil
+  "Minimal completion system."
+  :group 'convenience
+  :prefix "minicomp-")
+
+(defcustom minicomp-sort-threshold 1
+  "Candidates will only be sorted if there are fewer than this threshold."
+  :type 'integer)
+
+(defcustom minicomp-group-format
+  (concat
+   #("" 0 4 (face minicomp-group-separator))
+   #(" %s " 0 4 (face minicomp-group-title))
+   #(" " 0 1 (face minicomp-group-separator display (space :align-to right
+  "Format string used for the group title."
+  :type '(choice (const nil) string))
+
+(defcustom minicomp-count 10
+  "Maximal number of candidates to show."
+  :type 'integer)
+
+(defgroup minicomp-faces nil
+  "Faces used by Minicomp."
+  :group 'minicomp
+  :group 'faces)
+
+(defface minicomp-group-title
+  '((t :inherit shadow :slant italic))
+  "Face used for the title text of the candidate group headlines.")
+
+(defface minicomp-group-separator
+  '((t :inherit shadow :strike-through t))
+  "Face used for the separator lines of the candidate groups.")
+
+(defface minicomp-current
+  '((t :inherit highlight :extend t))
+  "Face used to highlight the currently selected candidate.")
+
+(defvar minicomp-map
+  (let ((map (make-sparse-keymap)))
+(set-keymap-parent map minibuffer-local-map)
+(define-key map [remap beginning-of-buffer] #'minicomp-beginning-of-buffer)
+(define-key map [remap minibuffer-beginning-of-buffer] 
#'minicomp-beginning-of-buffer)
+(define-key map [remap end-of-buffer] #'minicomp-end-of-buffer)
+(define-key map [remap scroll-down-command] #'minicomp-scroll-down)
+(define-key map [remap scroll-up-command] #'minicomp-scroll-up)
+(define-key map [remap next-line-or-history-element] #'minicomp-next)
+(define-key map [remap previous-line-or-history-element] 
#'minicomp-previous)
+(define-key map [remap exit-minibuffer] #'minicomp-exit)
+(define-key map [remap kill-ring-save] #'minicomp-save)
+(define-key map "\t" #'minicomp-insert)
+map)
+  "Minibuffer keymap.")
+
+(defvar-local minicomp--candidates-ov nil
+  "Overlay showing the candidates.")
+
+(defvar-local minicomp--count-ov nil
+  "Overlay showing the number of candidates.")
+
+(defvar-local minicomp--index 0
+  "Index of current candidate or negative for prompt selection.")
+
+(defvar-local minicomp--input nil
+  "Current input string or t.")
+
+(defvar-local minicomp--candidates nil
+  "List of candidates.")
+
+(defvar-local minicomp--base 0
+  "Size of the base string, which is concatenated with the candidate.")
+
+(defvar-local minicomp--total 0
+  "Length of the candidate list `minicomp--candidates'.")
+
+(defvar-local minicomp--keep nil
+  "Keep current candidate index `minicomp--index'.")
+
+(defun minicomp--sort (candidates)
+  "Sort CANDIDATES by history position, length and alphabetically."
+  ;; History disabled if `minibuffer-history-variable' eq `t'.
+  (let* ((list (and (not (eq minibuffer-history-variable t))
+(symbol-value minibuffer-history-variable)))
+ (hist-len (length list))
+ (hist (make-hash-table :test #'equal
+:size hist-len))
+ (hist-idx 0)
+ (cand candidates))
+;; Store the history position first in a hashtable in order to
+;; allow O(1) history lookup.
+(dolist (elem list)
+  (unless (gethash elem hist)
+(puthash elem hist-idx hist))
+  (setq hist-idx (1+ hist-idx)))
+;; Decorate each candidate with (hist-idx<<13) + le

[elpa] externals/vertico 9b81d8d 08/48: remove ./ and ../ from file completion candidates

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 9b81d8dbba44cc27ef7260becd320f8b7d60a89b
Author: Daniel Mendler 
Commit: Daniel Mendler 

remove ./ and ../ from file completion candidates
---
 minicomp.el | 25 ++---
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 6ca97dc..0497931 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -174,21 +174,24 @@
(prog1 (cdr last)
  (setcdr last nil))
  0))
- (total (length all))
- (candidates (if (> total minicomp-sort-threshold)
- all
-   (funcall
-(or (completion-metadata-get metadata 
'display-sort-function)
-#'minicomp--sort)
-all
+ (total))
+(when (eq (completion-metadata-get metadata 'category) 'file)
+  (setq all (delete "../" (delete "./" all
+(setq total (length all)
+  all (if (> total minicomp-sort-threshold)
+  all
+(funcall
+ (or (completion-metadata-get metadata 'display-sort-function)
+ #'minicomp--sort)
+ all)))
 (when-let* ((def (cond
   ((stringp (car-safe minibuffer-default)) (car 
minibuffer-default))
   ((stringp minibuffer-default) minibuffer-default)))
-(rest (member def candidates)))
-  (setq candidates (nconc (list (car rest)) (delete def candidates
+(rest (member def all)))
+  (setq all (nconc (list (car rest)) (delete def all
 (when-let (group (completion-metadata-get metadata 'x-group-function))
-  (setq candidates (mapcan #'cdr (funcall group candidates
-(list base total candidates)))
+  (setq all (mapcan #'cdr (funcall group all
+(list base total all)))
 
 (defun minicomp--recompute (input metadata)
   "Preprocess candidates with INPUT string and METADATA."



[elpa] externals/vertico 4ce7c8d 11/48: use seq-subseq

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 4ce7c8d6a5770f12eb115712440f4155a2dbc5e0
Author: Daniel Mendler 
Commit: Daniel Mendler 

use seq-subseq
---
 minicomp.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index 5b8f85c..2f5f283 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -29,6 +29,7 @@
 
 ;;; Code:
 
+(require 'seq)
 (eval-when-compile
   (require 'subr-x))
 
@@ -228,7 +229,9 @@
   "Display current candidates with INPUT string and METADATA."
   (let* ((index (min (max 0 (- minicomp--index (/ minicomp-count 2)))
  (max 0 (- minicomp--total minicomp-count
- (candidates (seq-take (nthcdr index minicomp--candidates) 
minicomp-count))
+ (candidates (seq-subseq minicomp--candidates index
+ (min (+ index minicomp-count)
+  minicomp--total)))
  (hl-candidates
   (if (and (memq 'orderless completion-styles)
(fboundp 'orderless-highlight-matches))
@@ -280,7 +283,7 @@
 (overlay-put minicomp--candidates-ov 'after-string displayed)
 (overlay-put minicomp--count-ov 'before-string
  (format "%-6s " (format "%s/%s"
- (if (< minicomp--index 0) "*" 
minicomp--index)
+ (if (< minicomp--index 0) "*" (1+ 
minicomp--index))
  minicomp--total)
 
 (defun minicomp--exhibit ()



[elpa] externals/vertico 06e5dfe 02/48: improve minibuffer resizing

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 06e5dfe1d2a9e90f14a6eb4733a214b983cb1fe4
Author: Daniel Mendler 
Commit: Daniel Mendler 

improve minibuffer resizing
---
 minicomp.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/minicomp.el b/minicomp.el
index 5d4d789..3bd884d 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -353,10 +353,11 @@
 
 (defun minicomp--setup ()
   "Setup completion system."
+  (setq-local truncate-lines nil)
+  (setq-local resize-mini-windows 'grow-only)
   (setq-local max-mini-window-height 1.0)
   (when (boundp 'orderless-skip-highlighting)
 (setq-local orderless-skip-highlighting t))
-  ;;(setq-local truncate-lines t)
   (setq minicomp--input t
 minicomp--candidates-ov (make-overlay (point-max) (point-max))
 minicomp--count-ov (make-overlay (point-min) (point-min)))



[elpa] externals/vertico 9db7c78 20/48: add minicomp-count-format

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 9db7c7802d74acb6f5eacc93f323921ca041f2e3
Author: Daniel Mendler 
Commit: Daniel Mendler 

add minicomp-count-format
---
 minicomp.el | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index c5749a8..efc441f 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -42,6 +42,11 @@
   "Candidates will only be sorted if there are fewer than this threshold."
   :type 'integer)
 
+(defcustom minicomp-count-format
+  (cons "%-6s " "%s/%s")
+  "Format string used for the candidate count."
+  :type '(choice (const nil) (cons string string)))
+
 (defcustom minicomp-group-format
   (concat
#("" 0 4 (face minicomp-group-separator))
@@ -312,13 +317,15 @@
 (if (and (< minicomp--index 0) (not (minicomp--require-match)))
 (add-text-properties (minibuffer-prompt-end) (point-max) '(face 
minicomp-current))
   (remove-text-properties (minibuffer-prompt-end) (point-max) '(face nil)))
-(move-overlay minicomp--count-ov (point-min) (point-min))
 (move-overlay minicomp--candidates-ov (point-max) (point-max))
 (overlay-put minicomp--candidates-ov 'after-string displayed)
-(overlay-put minicomp--count-ov 'before-string
- (format "%-6s " (format "%s/%s"
- (if (< minicomp--index 0) "*" (1+ 
minicomp--index))
- minicomp--total)
+(when minicomp-count-format
+  (move-overlay minicomp--count-ov (point-min) (point-min))
+  (overlay-put minicomp--count-ov 'before-string
+   (format (car minicomp-count-format)
+   (format (cdr minicomp-count-format)
+   (if (< minicomp--index 0) "*" (1+ 
minicomp--index))
+   minicomp--total))
 
 (defun minicomp--exhibit ()
   "Exhibit completion UI."



[elpa] externals/vertico 245944a 21/48: remap previous/next-line

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 245944a68594078945a92f7f5269883a369cc449
Author: Daniel Mendler 
Commit: Daniel Mendler 

remap previous/next-line
---
 minicomp.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/minicomp.el b/minicomp.el
index efc441f..69519a7 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -84,6 +84,8 @@
 (define-key map [remap end-of-buffer] #'minicomp-end-of-buffer)
 (define-key map [remap scroll-down-command] #'minicomp-scroll-down)
 (define-key map [remap scroll-up-command] #'minicomp-scroll-up)
+(define-key map [remap next-line] #'minicomp-next)
+(define-key map [remap previous-line] #'minicomp-previous)
 (define-key map [remap next-line-or-history-element] #'minicomp-next)
 (define-key map [remap previous-line-or-history-element] 
#'minicomp-previous)
 (define-key map [remap exit-minibuffer] #'minicomp-exit)



[elpa] externals/vertico 1b75916 18/48: better orderless integration

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 1b75916f2d2361593a9ba900c17316b1de36620e
Author: Daniel Mendler 
Commit: Daniel Mendler 

better orderless integration
---
 minicomp.el | 34 --
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index fdcd4d3..6a17f49 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -87,6 +87,9 @@
 map)
   "Minibuffer keymap.")
 
+(defvar minicomp--highlight-function (lambda (_input _metadata cands) cands)
+  "Highlighting function.")
+
 (defvar-local minicomp--history-hash nil
   "History hash table.")
 
@@ -265,14 +268,13 @@
  (ann-candidates
   (minicomp--annotate
metadata
-   (if (and (memq 'orderless completion-styles)
-(fboundp 'orderless-highlight-matches))
-   (orderless-highlight-matches
-(substring input
-   (car (completion-boundaries input 
minibuffer-completion-table
-   
minibuffer-completion-predicate "")))
-candidates)
- candidates)))
+   (funcall
+minicomp--highlight-function
+(substring input
+   (car (completion-boundaries input 
minibuffer-completion-table
+   
minibuffer-completion-predicate "")))
+metadata
+candidates)))
  (title nil)
  (displayed " ")
  (group (completion-metadata-get metadata 'x-group-function)))
@@ -414,8 +416,20 @@
   (setq-local truncate-lines nil)
   (setq-local resize-mini-windows 'grow-only)
   (setq-local max-mini-window-height 1.0)
-  (when (boundp 'orderless-skip-highlighting)
-(setq-local orderless-skip-highlighting t))
+  ;; Optimize orderless filtering, skip highlighting
+  (when (and (boundp 'orderless-skip-highlighting)
+ (equal (default-value 'completion-styles) '(orderless)))
+(setq-local orderless-skip-highlighting t)
+(setq-local minicomp--highlight-function
+(lambda (input metadata candidates)
+  (let ((orderless-skip-highlighting nil))
+(nconc
+ (completion-all-completions input
+ candidates
+ nil
+ (length input)
+ metadata)
+ nil)
   (setq minicomp--input t
 minicomp--candidates-ov (make-overlay (point-max) (point-max))
 minicomp--count-ov (make-overlay (point-min) (point-min)))



[elpa] externals/vertico 42823ce 25/48: Use read-char-exclusive to avoid error message

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 42823cead1fc15fba6f6d0c7a2101b9f544022da
Author: Daniel Mendler 
Commit: Daniel Mendler 

Use read-char-exclusive to avoid error message
---
 minicomp.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index bf4e846..3771756 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -400,7 +400,7 @@
minibuffer-completion-predicate)))
 (exit-minibuffer))
((eq minibuffer--require-match 'confirm)
-(when (eq (read-char "Confirm") 13)
+(when (eq (read-char-exclusive "Confirm") 13)
   (exit-minibuffer)))
(t (message "Match required"
 
@@ -452,8 +452,8 @@
  metadata)
  nil)
   (setq minicomp--input t
-minicomp--candidates-ov (make-overlay (point-max) (point-max))
-minicomp--count-ov (make-overlay (point-min) (point-min)))
+minicomp--candidates-ov (make-overlay (point-max) (point-max) nil t t)
+minicomp--count-ov (make-overlay (point-min) (point-min) nil t t))
   (use-local-map minicomp-map)
   (add-hook 'post-command-hook #'minicomp--exhibit -99 'local))
 



[elpa] externals/vertico b7e6de9 37/48: Filter files with completion-ignored-extensions

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit b7e6de9aac1f5891fb4d466a75fb9beb4cd5c053
Author: Daniel Mendler 
Commit: Daniel Mendler 

Filter files with completion-ignored-extensions
---
 minicomp.el | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/minicomp.el b/minicomp.el
index c7f9425..8432940 100644
--- a/minicomp.el
+++ b/minicomp.el
@@ -33,7 +33,6 @@
 
 ;;; Code:
 
-(require 'cl-lib)
 (require 'seq)
 (eval-when-compile
   (require 'subr-x))
@@ -220,10 +219,17 @@
 
 (defun minicomp--recompute-candidates (input metadata)
   "Recompute candidates with INPUT string and METADATA."
-  (let* ((all (completion-all-completions
+  (let* ((ignore-re (concat "\\(?:\\`\\|/\\)\\.?\\./\\'"
+(and completion-ignored-extensions
+ (concat "\\|" (regexp-opt 
completion-ignored-extensions) "\\'"
+ (all (completion-all-completions
input
minibuffer-completion-table
-   minibuffer-completion-predicate
+   (if minibuffer-completing-file-name
+   (if-let (pred minibuffer-completion-predicate)
+   (lambda (x) (and (not (string-match-p ignore-re x)) 
(funcall pred x)))
+ (lambda (x) (not (string-match-p ignore-re x
+ minibuffer-completion-predicate)
(- (point) (minibuffer-prompt-end))
metadata))
  (base (if-let (last (last all))
@@ -231,8 +237,6 @@
  (setcdr last nil))
  0))
  (total))
-(when minibuffer-completing-file-name
-  (setq all (cl-delete-if (apply-partially #'string-match-p 
"\\(\\`\\|/\\)\\.?\\./\\'") all)))
 (setq total (length all)
   all (if (> total minicomp-sort-threshold)
   all



[elpa] externals/vertico 7fdfd52 45/48: Formatting

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit 7fdfd5245bb11a18ff487ff1a5e47a5719bd891d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Formatting
---
 vertico.el | 47 +--
 1 file changed, 21 insertions(+), 26 deletions(-)

diff --git a/vertico.el b/vertico.el
index 4d071e4..b502620 100644
--- a/vertico.el
+++ b/vertico.el
@@ -46,8 +46,7 @@
   "Candidates will only be sorted if there are fewer than this threshold."
   :type 'integer)
 
-(defcustom vertico-count-format
-  (cons "%-6s " "%s/%s")
+(defcustom vertico-count-format (cons "%-6s " "%s/%s")
   "Format string used for the candidate count."
   :type '(choice (const nil) (cons string string)))
 
@@ -64,30 +63,26 @@
   :type 'integer)
 
 (defcustom vertico-truncation
-  '(#("⤶" 0 1 (face vertico-truncation))
-#("…" 0 1 (face vertico-truncation)))
+  (cons #("⤶" 0 1 (face vertico-truncation))
+#("…" 0 1 (face vertico-truncation)))
   "Truncation replacement strings."
-  :type '(list string string))
+  :type '(cons string string))
 
 (defgroup vertico-faces nil
   "Faces used by Vertico."
   :group 'vertico
   :group 'faces)
 
-(defface vertico-truncation
-  '((t :inherit shadow))
+(defface vertico-truncation '((t :inherit shadow))
   "Face used to highlight truncation characters.")
 
-(defface vertico-group-title
-  '((t :inherit shadow :slant italic))
+(defface vertico-group-title '((t :inherit shadow :slant italic))
   "Face used for the title text of the candidate group headlines.")
 
-(defface vertico-group-separator
-  '((t :inherit shadow :strike-through t))
+(defface vertico-group-separator '((t :inherit shadow :strike-through t))
   "Face used for the separator lines of the candidate groups.")
 
-(defface vertico-current
-  '((t :inherit highlight :extend t))
+(defface vertico-current '((t :inherit highlight :extend t))
   "Face used to highlight the currently selected candidate.")
 
 (defvar vertico-map
@@ -140,16 +135,17 @@
   "Keep current candidate index `vertico--index'.")
 
 (defun vertico--pred (x y)
-  "Compare X and Y."
+  "Sorting predicate which compares X and Y."
   (or (< (cdr x) (cdr y))
   (and (= (cdr x) (cdr y))
(string< (car x) (car y)
 
 (defun vertico--sort (input candidates)
-  "Sort CANDIDATES by history position, length and alphabetically, given 
current INPUT."
-  ;; Store the history position first in a hashtable in order to allow O(1) 
history lookup. File
-  ;; names get special treatment. In principle, completion tables with 
boundaries should also get
-  ;; special treatment, but files are the most important.
+  "Sort CANDIDATES by history, length and alphabetically, given current INPUT."
+  ;; Store the history position first in a hashtable in order to allow O(1)
+  ;; history lookup. File names get special treatment. In principle, completion
+  ;; tables with boundaries should also get special treatment, but files are
+  ;; the most important.
   (cond
((eq minibuffer-history-variable 'file-name-history)
 (let ((dir (expand-file-name (substitute-in-file-name
@@ -216,7 +212,7 @@
 
 (defvar orderless-skip-highlighting)
 (defun vertico--highlight (input metadata candidates)
-  "Pass CANDIDATES through the completion style specified by METADATA for 
highlighting with INPUT string."
+  "Highlight CANDIDATES with INPUT using the completion style specified by 
METADATA."
   (let* ((orderless-skip-highlighting)
  (highlighted (nconc
(completion-all-completions input
@@ -334,7 +330,7 @@
  (string-trim)
  (vertico--flatten-prop 'display 'insert)
  (vertico--flatten-prop 'invisible nil))
-  cand (truncate-string-to-width cand max-width 0 nil (cadr 
vertico-truncation))
+  cand (truncate-string-to-width cand max-width 0 nil (cdr 
vertico-truncation))
   cand (concat prefix cand
(if (text-property-not-all 0 (length suffix) 'face 
nil suffix)
suffix
@@ -388,11 +384,11 @@
   (add-text-properties (minibuffer-prompt-end) (point-max) '(face 
vertico-current)
 
 (defun vertico--require-match ()
-  "Match is required."
+  "Return t if match is required."
   (not (memq minibuffer--require-match '(nil confirm 
confirm-after-completion
 
 (defun vertico--goto (index)
-  "Go to INDEX."
+  "Go to candidate with INDEX."
   (setq vertico--keep t
 vertico--index
 (max (if (and (vertico--require-match) vertico--candidates)
@@ -432,8 +428,7 @@
 (defun vertico-exit (&optional arg)
   "Exit minibuffer with current candidate or input if prefix ARG is given."
   (interactive "P")
-  (unless arg
-(vertico-insert))
+  (unless arg (vertico-insert))
   (let ((input (minibuffer-contents-no-properties)))
 (if (or (memq minibuffer--require-match '(nil confirm-after-completion))
 (equal "" input)
@@ -500,11 +495,11 @@
 (advice-remove #'completing-

[elpa] externals/vertico eb5d617 47/48: Improve candidate sanitization

2021-04-05 Thread Stefan Monnier
branch: externals/vertico
commit eb5d61764b19d1b137aedc9102455752e06c6b07
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve candidate sanitization
---
 vertico.el | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/vertico.el b/vertico.el
index d36b5ea..e380f48 100644
--- a/vertico.el
+++ b/vertico.el
@@ -64,10 +64,10 @@
   "Maximal number of candidates to show."
   :type 'integer)
 
-(defcustom vertico-truncation
-  (cons #("⤶" 0 1 (face vertico-truncation))
-#("…" 0 1 (face vertico-truncation)))
-  "Truncation replacement strings."
+(defcustom vertico-multiline
+  (cons #("⤶" 0 1 (face vertico-multiline))
+#("…" 0 1 (face vertico-multiline)))
+  "Replacements for multiline strings."
   :type '(cons string string))
 
 (defgroup vertico-faces nil
@@ -75,8 +75,8 @@
   :group 'vertico
   :group 'faces)
 
-(defface vertico-truncation '((t :inherit shadow))
-  "Face used to highlight truncation characters.")
+(defface vertico-multiline '((t :inherit shadow))
+  "Face used to highlight multiline replacement characters.")
 
 (defface vertico-group-title '((t :inherit shadow :slant italic))
   "Face used for the title text of the candidate group headlines.")
@@ -280,13 +280,13 @@
vertico--total total
vertico--candidates candidates
 
-(defun vertico--flatten-prop (prop insert str)
-  "Flatten STR with PROP, INSERT or remove."
+(defun vertico--flatten-string (prop str)
+  "Flatten STR with display or invisible PROP."
   (let ((len (length str)) (pos 0) (chunks))
 (while (/= pos len)
   (let ((end (next-single-property-change pos prop str len)))
 (if-let (val (get-text-property pos prop str))
-(when (and insert (stringp val))
+(when (and (eq prop 'display) (stringp val))
   (push val chunks))
   (push (substring str pos end) chunks))
 (setq pos end)))
@@ -326,13 +326,13 @@
 (push (format vertico-group-format new-title) chunks)
 (push "\n" chunks)
 (setq title new-title)))
-(setq cand (thread-last cand
- (replace-regexp-in-string "[\t ]+" " ")
- (replace-regexp-in-string "[\t\n ]*\n[\t\n ]*" (car 
vertico-truncation))
- (string-trim)
- (vertico--flatten-prop 'display 'insert)
- (vertico--flatten-prop 'invisible nil))
-  cand (truncate-string-to-width cand max-width 0 nil (cdr 
vertico-truncation))
+(when (string-match-p "\n" cand)
+  (setq cand (thread-last cand
+   (replace-regexp-in-string "[\t ]+" " ")
+   (replace-regexp-in-string "[\t\n ]*\n[\t\n ]*" (car 
vertico-multiline))
+   (replace-regexp-in-string "\\`[\t\n ]+\\|[\t\n ]+\\'" 
""))
+cand (truncate-string-to-width cand max-width 0 nil (cdr 
vertico-multiline
+(setq cand (vertico--flatten-string 'invisible 
(vertico--flatten-string 'display cand))
   cand (concat prefix cand
(if (text-property-not-all 0 (length suffix) 'face 
nil suffix)
suffix



[elpa] main 2ad43d6: * elpa-packages ("vertico"): New package

2021-04-05 Thread Stefan Monnier
branch: main
commit 2ad43d63a759f3f424215de0e2931d36322e5b31
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packages ("vertico"): New package

("f90-interface-browser", "smalltalk-mode"): Set upstream to nil,
since we're not tracking them any more.
("modus-vivendi-theme"): Place it as its correct lexicographic place.
---
 elpa-packages | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/elpa-packages b/elpa-packages
index 07e8b17..c4a7bdf 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -140,7 +140,7 @@
  ("excorporate":url nil)
  ("expand-region"  :url "https://github.com/magnars/expand-region.el";)
  ("exwm"   :url "https://github.com/ch11ng/exwm.git";)
- ("f90-interface-browser" :url "https://github.com/wence-/f90-iface";)
+ ("f90-interface-browser" :url nil) ;; Was 
"https://github.com/wence-/f90-iface";
  ("filladapt"  :url nil)
  ("flylisp":url nil)
  ("flymake":core "lisp/progmodes/flymake.el")
@@ -219,14 +219,14 @@
  ;; bug#46964: .
  ("modus-operandi-theme":url "https://gitlab.com/protesilaos/modus-themes";
   :branch "elpa/modus-operandi-theme")
- ("modus-vivendi-theme":url 
"https://gitlab.com/protesilaos/modus-themes";
-  :branch "elpa/modus-vivendi-theme")
  ("modus-themes"   :core ("etc/themes/modus-themes.el"
"etc/themes/modus-operandi-theme.el"
"etc/themes/modus-vivendi-theme.el"
"doc/misc/modus-themes.org"
"doc/misc/doclicense.texi")
   :doc "modus-themes.org")
+ ("modus-vivendi-theme":url 
"https://gitlab.com/protesilaos/modus-themes";
+  :branch "elpa/modus-vivendi-theme")
  ("multishell" :url "https://github.com/kenmanheimer/EmacsMultishell";)
  ("muse"   :url "https://github.com/alexott/muse";) ;FIXME: Not 
nearly in-sync
  ("myers"  :url nil)
@@ -320,7 +320,7 @@
  ("sisu-mode"  :url nil)
  ("slime-volleyball"   :url nil)
  ("sm-c-mode"  :url nil)
- ("smalltalk-mode" :url "git://git.sv.gnu.org/smalltalk")
+ ("smalltalk-mode" :url nil) ;; Was "git://git.sv.gnu.org/smalltalk"
  ("smart-yank" :url nil)
  ("sml-mode"   :url nil)
  ("so-long" :core "lisp/so-long.el")
@@ -370,6 +370,7 @@
  ("visual-fill":url nil)
  ("vlf":url "https://github.com/m00natic/vlfi";)
  ("verilog-mode":core "lisp/progmodes/verilog-mode.el")
+ ("vertico":url "https://github.com/minad/vertico";)
  ("wcheck-mode":url "https://github.com/tlikonen/wcheck-mode";)
  ("wconf"  :url "https://github.com/ilohmar/wconf";)
  ("web-server" :url "https://github.com/eschulte/emacs-web-server.git";)



[elpa] externals/excorporate updated (f59702d -> 0d46d8e)

2021-04-05 Thread Thomas Fitzsimmons
fitzsim pushed a change to branch externals/excorporate.

  from  f59702d   Specify time zone during item creation
   new  b14e881   Remove an outdated header comment
   new  b3c028f   Do not allow empty string as custom time zone
   new  0d46d8e   Add excorporate-disconnect interactive function


Summary of changes:
 excorporate-time-zones.el |  5 +++--
 excorporate.el| 52 ++-
 excorporate.texi  |  4 
 3 files changed, 54 insertions(+), 7 deletions(-)



[elpa] externals/excorporate b14e881 1/3: Remove an outdated header comment

2021-04-05 Thread Thomas Fitzsimmons
branch: externals/excorporate
commit b14e8815249ce6d014272e0512be411825f185a6
Author: Thomas Fitzsimmons 
Commit: Thomas Fitzsimmons 

Remove an outdated header comment

* excorporate.el: Remove an outdated header comment.
---
 excorporate.el | 4 
 1 file changed, 4 deletions(-)

diff --git a/excorporate.el b/excorporate.el
index 49ace9c..065521a 100644
--- a/excorporate.el
+++ b/excorporate.el
@@ -67,10 +67,6 @@
 ;; the main domain, e.g., autodiscover.domain.com.  Autodiscovery will
 ;; work in that case.
 
-;; Excorporate must be loaded before any other package that requires
-;; `soap-client'.  The version of `soap-client' that Excorporate
-;; bundles is backward compatible.
-
 ;; Acknowledgments:
 
 ;; Alexandru Harsanyi  provided help and



[elpa] externals/excorporate 0d46d8e 3/3: Add excorporate-disconnect interactive function

2021-04-05 Thread Thomas Fitzsimmons
branch: externals/excorporate
commit 0d46d8ea3e421413e7de88bd2627004a0bfab36e
Author: Thomas Fitzsimmons 
Commit: Thomas Fitzsimmons 

Add excorporate-disconnect interactive function

* excorporate.el (exco--retrieve-next-import): Add comment about
network process tracking.
(exco-disconnect): Delete server network processes.
(excorporate): Fix indentation.
(excorporate-disconnect): New interactive function.
* excorporate.texi (Configuration): Document
excorporate-disconnect.
---
 excorporate.el   | 48 +++-
 excorporate.texi |  4 
 2 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/excorporate.el b/excorporate.el
index 065521a..bd3a668 100644
--- a/excorporate.el
+++ b/excorporate.el
@@ -287,6 +287,9 @@ the FSM should transition to on success."
  (format "Failed to retrieve %s"
  import-url))
   (fsm-send fsm :unrecoverable-error))
+  ;; Here (get-buffer-process (current-buffer))
+  ;; is nil, so we can't track network processes
+  ;; to be used in exco-disconnect.
   ;; Success, parse WSDL.
   (plist-put state-data :retrying nil)
   (setf (soap-wsdl-xmlschema-imports wsdl) imports)
@@ -700,6 +703,22 @@ Examples are \"Exchange2010\", \"Exchange2010_SP1\",
   "Disconnect from a web service.
 IDENTIFIER is the mail address used to look up the connection."
   (exco--with-fsm identifier
+;; There does not seem to be a way to track network processes via
+;; URL callbacks, so search the process list and close matching
+;; connections.
+(let* ((url (plist-get (fsm-get-state-data fsm) :service-url))
+  (host (url-host (url-generic-parse-url url
+  (dolist (process (process-list))
+   (let* ((contact (process-contact process t))
+  (process-name (plist-get contact :name))
+  (process-host (plist-get contact :host))
+  (process-port (plist-get contact :service)))
+ (when (and (equal process-name host)
+(equal process-host host)
+(equal process-port 443))
+   (delete-process process)
+(let ((process (plist-get (fsm-get-state-data fsm) :process)))
+  (when process (delete-process process)))
 (setq exco--connection-identifiers
  (delete identifier exco--connection-identifiers))
 (remhash identifier exco--connections))
@@ -1221,7 +1240,7 @@ ARGUMENT is the prefix argument."
   (identifier
(if (y-or-n-p ask-2)
mail
- (cons mail(completing-read ask-3 (list url) nil nil url)
+ (cons mail (completing-read ask-3 (list url) nil nil url)
   (exco-connect identifier)))
((exco--string-or-string-pair-p excorporate-configuration)
 ;; A single string or a single pair.
@@ -1235,6 +1254,33 @@ ARGUMENT is the prefix argument."
(t
 (error "Excorporate: Invalid configuration"
 
+(defun excorporate-disconnect ()
+  "Disconnect a server connection."
+  (interactive)
+  (catch 'cancel
+(let ((identifier
+  (cond
+   ((= (length exco--connection-identifiers) 0)
+(exco--ensure-connection))
+   ((= (length exco--connection-identifiers) 1)
+(car exco--connection-identifiers))
+   (t
+(let* ((strings (mapcar (lambda (object)
+  (format "%s" object))
+exco--connection-identifiers))
+   (value (completing-read "Excorporate: Disconnect: "
+   strings nil t))
+   (return (when (equal value "") (throw 'cancel nil)))
+   (position (catch 'index
+   (let ((index 0))
+ (dolist (string strings)
+   (when (equal value string)
+ (throw 'index index))
+   (setq index (1+ index) ))
+  (nth position exco--connection-identifiers))
+  (exco-disconnect identifier)
+  (message "Excorporate: Disconnected %s" identifier
+
 (provide 'excorporate)
 
 ;;; excorporate.el ends here
diff --git a/excorporate.texi b/excorporate.texi
index 3390c19..c4a4a58 100644
--- a/excorporate.texi
+++ b/excorporate.texi
@@ -120,6 +120,10 @@ After saving the configuration, try @code{M-x excorporate} 
again.
 If neither autodiscovery nor specifying the EWS URL work,
 @pxref{Troubleshooting}.
 
+To disconnect:
+
+@code{M-x excorporate-disconnect}
+
 @node Usage
 @chapter Usage
 



[elpa] externals/excorporate b3c028f 2/3: Do not allow empty string as custom time zone

2021-04-05 Thread Thomas Fitzsimmons
branch: externals/excorporate
commit b3c028f737dbb0f1c666f5d118475c9504565e84
Author: Thomas Fitzsimmons 
Commit: Thomas Fitzsimmons 

Do not allow empty string as custom time zone

* excorporate-time-zones.el (excorporate-customize-time-zone):
Detect blank result from completing-read.
---
 excorporate-time-zones.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/excorporate-time-zones.el b/excorporate-time-zones.el
index 0a2cd80..3c9b53f 100644
--- a/excorporate-time-zones.el
+++ b/excorporate-time-zones.el
@@ -841,8 +841,9 @@
   (cons "Emacs Built-in"
 (hash-table-values exco--time-zone-olson-to-server))
   nil t)))
-(customize-save-variable 'excorporate-time-zone
-(if (equal zone "Emacs Built-in") nil zone
+(unless (equal zone "")
+  (customize-save-variable 'excorporate-time-zone
+  (if (equal zone "Emacs Built-in") nil zone)
 
 (defun exco-time-zone (&optional emacs-time-zone)
   "Return server style time zone string.



[nongnu] elpa/markdown-mode ac9ea26 2/2: Merge pull request #608 from jrblevin/simplify-sample-config

2021-04-05 Thread ELPA Syncer
branch: elpa/markdown-mode
commit ac9ea26b941eef512a3c206375a6404625c229ed
Merge: a2a7eed 288aff5
Author: Shohei YOSHIDA 
Commit: GitHub 

Merge pull request #608 from jrblevin/simplify-sample-config

Simplify sample config
---
 README.md | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/README.md b/README.md
index ed367a3..b3c21c3 100644
--- a/README.md
+++ b/README.md
@@ -79,9 +79,7 @@ example; adjust settings as desired):
 ```lisp
 (use-package markdown-mode
   :ensure t
-  :mode (("\\.md\\'" . markdown-mode)
- ("\\.markdown\\'" . markdown-mode)
- ("README\\.md\\'" . gfm-mode))
+  :mode ("README\\.md\\'" . gfm-mode)
   :init (setq markdown-command "multimarkdown"))
 ```
 



[nongnu] elpa/markdown-mode 288aff5 1/2: Simplify sample config

2021-04-05 Thread ELPA Syncer
branch: elpa/markdown-mode
commit 288aff5e6e6664f2c17f9012cefc8abc5c41a233
Author: Shohei YOSHIDA 
Commit: Shohei YOSHIDA 

Simplify sample config
---
 README.md | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/README.md b/README.md
index ed367a3..b3c21c3 100644
--- a/README.md
+++ b/README.md
@@ -79,9 +79,7 @@ example; adjust settings as desired):
 ```lisp
 (use-package markdown-mode
   :ensure t
-  :mode (("\\.md\\'" . markdown-mode)
- ("\\.markdown\\'" . markdown-mode)
- ("README\\.md\\'" . gfm-mode))
+  :mode ("README\\.md\\'" . gfm-mode)
   :init (setq markdown-command "multimarkdown"))
 ```
 



[elpa] externals/company f3aacd7: Reduce the default company-idle-delay

2021-04-05 Thread ELPA Syncer
branch: externals/company
commit f3aacd77d0135c09227400fef45c54b717d33f2e
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Reduce the default company-idle-delay
---
 NEWS.md| 1 +
 company.el | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS.md b/NEWS.md
index 38098ab..66915d5 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* `company-idle-delay` default reduced to 0.2 (seconds).
 * The minimum required version of Emacs is now 25.1.
 * Both built-in options for `company-format-margin-function` require Emacs
   compiled with SVG support.
diff --git a/company.el b/company.el
index 1acb46f..227df55 100644
--- a/company.el
+++ b/company.el
@@ -605,7 +605,7 @@ A character that is part of a valid completion never 
triggers auto-commit."
  (function :tag "Predicate function"))
   :package-version '(company . "0.9.14"))
 
-(defcustom company-idle-delay .5
+(defcustom company-idle-delay .2
   "The idle delay in seconds until completion starts automatically.
 The prefix still has to satisfy `company-minimum-prefix-length' before that
 happens.  The value of nil means no idle completion."



[elpa] externals/javaimp 4a64b0e: Miscellaneous fixes & improvements

2021-04-05 Thread Filipp Gunbin
branch: externals/javaimp
commit 4a64b0e32343149774054966b2ee77000c120663
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

Miscellaneous fixes & improvements

* javaimp-maven.el (javaimp--maven-visit): Fix bug when tree contains
subtrees rooted somewhere else: the function now returns list of
trees.  Invoke javaimp--maven-fill-modules-files on modules, and only
then build trees.
(javaimp--maven-fill-modules-files):  paths are now taken from
maven output, not from file.  When concatenating module path during
recursing, split it and rejoin with file-name-as-directory.  Fix
module-by-file lookup: use group if defined in file, use version if
defined in file.

* javaimp-util.el (javaimp-module): Add raw field.
(javaimp--split-native-path): Simplify with parse-colon-path.

* javaimp.el (javaimp-visit-project): Support multiple trees from a
single visit, ask about every additional one.

* Some formatting fixes.
---
 javaimp-gradle.el |  20 ++---
 javaimp-maven.el  | 230 ++
 javaimp-util.el   |   9 ++-
 javaimp.el|  43 +-
 4 files changed, 168 insertions(+), 134 deletions(-)

diff --git a/javaimp-gradle.el b/javaimp-gradle.el
index 4d683ab..85e3f2e 100644
--- a/javaimp-gradle.el
+++ b/javaimp-gradle.el
@@ -86,7 +86,8 @@ information."
 (cdr (assq 'build-dir alist
:dep-jars (javaimp--split-native-path (cdr (assq 'dep-jars alist)))
:load-ts (current-time)
-   :dep-jars-path-fetcher #'javaimp--gradle-fetch-dep-jars-path))
+   :dep-jars-path-fetcher #'javaimp--gradle-fetch-dep-jars-path
+   :raw nil))
 
 (defun javaimp--gradle-id-from-semi-separated (str)
   (when str
@@ -122,14 +123,15 @@ information."
 (javaimp--gradle-init-script-kotlin 
init-script-body)
   (javaimp--gradle-init-script 
init-script-body
  (local-gradlew (concat (file-name-directory file) "gradlew")))
-(javaimp--call-build-tool (if (file-exists-p local-gradlew)
-  local-gradlew
-javaimp-gradle-program)
-  handler
-  "-q"
-  "-b" (javaimp-cygpath-convert-maybe file)
-  "-I" (javaimp-cygpath-convert-maybe init-file)
-  task)))
+(javaimp--call-build-tool
+ (if (file-exists-p local-gradlew)
+ local-gradlew
+   javaimp-gradle-program)
+ handler
+ "-q"
+ "-b" (javaimp-cygpath-convert-maybe file)
+ "-I" (javaimp-cygpath-convert-maybe init-file)
+ task)))
 
 
 (defun javaimp--gradle-init-script (body)
diff --git a/javaimp-maven.el b/javaimp-maven.el
index 054bf11..37fc173 100644
--- a/javaimp-maven.el
+++ b/javaimp-maven.el
@@ -31,65 +31,75 @@ on `exec-path'."
 
 
 (defun javaimp--maven-visit (file)
-  "Calls `mvn help:effective-pom' on FILE,
+  "Calls \"mvn help:effective-pom\" on FILE,
 reads project structure from the output and records which files
-belong to which modules and other module information"
+belong to which modules and other module information.  Returns
+resulting module trees."
   (message "Visiting Maven POM file %s..." file)
-  (let* ((xml-tree (javaimp--call-build-tool javaimp-mvn-program
- 
#'javaimp--maven-effective-pom-handler
- "-f" 
(javaimp-cygpath-convert-maybe file)
- "help:effective-pom"))
-(projects (javaimp--maven-projects-from-xml xml-tree))
-(modules (mapcar (lambda (proj-elt)
+  (let* ((xml-tree (javaimp--call-build-tool
+javaimp-mvn-program
+#'javaimp--maven-effective-pom-handler
+"-f" (javaimp-cygpath-convert-maybe file)
+"help:effective-pom"))
+(projects (or (if (assq 'project xml-tree)
+   (list (assq 'project xml-tree))
+ (javaimp--xml-children (assq 'projects xml-tree) 
'project))
+   (user-error "No projects found")))
+(modules (mapcar (lambda (proj-elt)
 (javaimp--maven-module-from-xml proj-elt file))
-  projects))
-;; first module is always root
-(tree (javaimp--build-tree (car modules) nil modules)))
-(when tree
-  ;; Set files in a separate step after building the tree because "real"
-  ;; parent of a child (given by ) does not necessary contains the
-  ;; child in its .  This is rare, but happens.
-  (javaimp--maven-fill-modules-files file tree)
-  ;; check that no :file slot is empty
-  (let ((modules-without-files
-(mapcar #'javaimp-node-contents
-(javaimp

[elpa] externals/org updated (c881b60 -> 5a91a23)

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

  from  c881b60   Merge branch 'maint'
   new  702e782   org.el: Mark org-link-descriptive as buffer-local
   new  5a91a23   Merge branch 'maint'


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



[elpa] externals/org 5a91a23: Merge branch 'maint'

2021-04-05 Thread ELPA Syncer
branch: externals/org
commit 5a91a232f7d72b7ed16e4c6cf34d6a721b0bce86
Merge: c881b60 702e782
Author: Kyle Meyer 
Commit: Kyle Meyer 

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

diff --git a/lisp/org.el b/lisp/org.el
index 04da1af..675a614 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4804,6 +4804,7 @@ The following commands are available:
   (org-load-modules-maybe)
   (org-install-agenda-files-menu)
   (when org-link-descriptive (add-to-invisibility-spec '(org-link)))
+  (make-local-variable 'org-link-descriptive)
   (add-to-invisibility-spec '(org-hide-block . t))
   (setq-local outline-regexp org-outline-regexp)
   (setq-local outline-level 'org-outline-level)



[elpa] externals-release/org 702e782: org.el: Mark org-link-descriptive as buffer-local

2021-04-05 Thread ELPA Syncer
branch: externals-release/org
commit 702e782cb654c1a59f9e1b8ac92156e9fb7e7fd2
Author: Kyle Meyer 
Commit: Kyle Meyer 

org.el: Mark org-link-descriptive as buffer-local

* lisp/org.el (org-mode): Mark org-link-descriptive as buffer-local.

Calling org-toggle-link-display is an inherently buffer-local
operation because it works via the buffer-local
buffer-invisibility-spec, so toggling the global value leads to a
mismatched, invalid state in all other buffers.

Reported-by: Gustavo Barros 
Ref: https://orgmode.org/list/87lfeqzm3a@gmail.com
Reported-by: Ingo Lohmar 
Ref: https://orgmode.org/list/87pmzdhl4b@kenko.localhost.com
---
 lisp/org.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org.el b/lisp/org.el
index 97ff44c..ac627a2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4792,6 +4792,7 @@ The following commands are available:
   (org-load-modules-maybe)
   (org-install-agenda-files-menu)
   (when org-link-descriptive (add-to-invisibility-spec '(org-link)))
+  (make-local-variable 'org-link-descriptive)
   (add-to-invisibility-spec '(org-hide-block . t))
   (setq-local outline-regexp org-outline-regexp)
   (setq-local outline-level 'org-outline-level)