[elpa] branch scratch/javaimp-list deleted (was b65b4db)

2021-05-28 Thread Filipp Gunbin
fgunbin pushed a change to branch scratch/javaimp-list.

   was  b65b4db   wip

This change permanently discards the following revisions:

  discards  b65b4db   wip



[elpa] branch scratch/javaimp-list created (now b9280ed)

2021-05-28 Thread Filipp Gunbin
fgunbin pushed a change to branch scratch/javaimp-list.

at  b9280ed   *** empty log message ***

This branch includes the following new commits:

   new  295c799   merge
   new  ac2efd7   *** empty log message ***
   new  b9280ed   *** empty log message ***




[elpa] scratch/javaimp-list ac2efd7 2/3: *** empty log message ***

2021-05-28 Thread Filipp Gunbin
branch: scratch/javaimp-list
commit ac2efd70483b0e12adebda64c743511ce989ccca
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

*** empty log message ***
---
 javaimp-list.el | 10 +-
 javaimp.el  |  6 +++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/javaimp-list.el b/javaimp-list.el
index c638753..df3ac28 100644
--- a/javaimp-list.el
+++ b/javaimp-list.el
@@ -53,6 +53,7 @@ buffer."
(pmid (and pm (javaimp-module-id pm)))
(root (javaimp--get-root node))
 
+   ;; TODO use digits, as in proced
(depth (let ((ptr node)
 (res 0))
 (while (setq ptr (javaimp-node-parent ptr))
@@ -117,11 +118,18 @@ buffer."
   tabulated-list-entries))
   (tabulated-list-init-header))
 
-;; TODO only top-level
+;; TODO option to forget everything loaded from the same file
 (defun javaimp-list--forget-project ()
   "Forget project tree containing project at point."
   (interactive)
 
+  ;; TODO go to top-level
+  (setq javaimp-project-forest
+   (seq-remove (lambda (node)
+ (equal (javaimp-module-file-orig (javaimp-node-contents 
node))
+build-file))
+   javaimp-project-forest))
+
   (let ((pos (point)))
 (delete-process (tabulated-list-get-id))
 (revert-buffer)
diff --git a/javaimp.el b/javaimp.el
index ce92a4b..80c5983 100644
--- a/javaimp.el
+++ b/javaimp.el
@@ -58,9 +58,9 @@
 ;; (setq javaimp-additional-source-dirs '("generated-sources/thrift"))
 ;; (add-hook 'java-mode-hook
 ;;   (lambda ()
-;; (local-set-key "\C-ci" 'javaimp-add-import)
-;; (local-set-key "\C-co" 'javaimp-organize-imports)))
-;; (global-set-key (kbd "C-c j v") 'javaimp-visit-project)
+;; (local-set-key "\C-ci" #'javaimp-add-import)
+;; (local-set-key "\C-co" #'javaimp-organize-imports)))
+;; (global-set-key (kbd "C-c j v") #'javaimp-visit-project)
 ;;
 
 ;;; News:



[elpa] scratch/javaimp-list 295c799 1/3: merge

2021-05-28 Thread Filipp Gunbin
branch: scratch/javaimp-list
commit 295c799a9e0132f463761d7f4b4f8a1b5e604186
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

merge
---
 javaimp-list.el | 137 
 javaimp-util.el |  38 
 javaimp.el  |  47 +++
 3 files changed, 182 insertions(+), 40 deletions(-)

diff --git a/javaimp-list.el b/javaimp-list.el
new file mode 100644
index 000..c638753
--- /dev/null
+++ b/javaimp-list.el
@@ -0,0 +1,137 @@
+
+;; Listing projects
+
+(defun javaimp-list-projects (buffer)
+  (unless (bufferp buffer)
+(setq buffer (get-buffer-create "*Javaimp Projects*")))
+  (with-current-buffer buffer
+(javaimp-list-mode)
+(javaimp-list-projects--refresh)
+(tabulated-list-print))
+  (display-buffer buffer)
+  nil)
+
+(defvar javaimp-list-mode-map
+  (let ((map (make-sparse-keymap)))
+(define-key map (kbd "C-d") 'javaimp-list-forget-project)
+(define-key map (kbd "RET") 'javaimp-list-display-project)
+(define-key map [?i] 'javaimp-list-display-project)
+map))
+
+(define-derived-mode javaimp-list-mode tabulated-list-print
+  "Javaimp Project List"
+  "Major mode for listing the projects known by Javaimp."
+  (setq tabulated-list-format [("Artifact" 20 #'javaimp-list--artifact-lessp)
+   ("Group" 20 #'javaimp-list-group-lessp)
+   ("Version" 7 #'nil)
+   ("Build file" (length "build.gradle.kts") nil)
+   ("Loaded at" 10 t)
+   ("Directory" 0 nil)
+   ])
+  (setq tabulated-list-sort-key (cons "Artifact" nil))
+  (add-hook 'tabulated-list-revert-hook #'javaimp-list--refresh nil t))
+
+(defun javaimp-list--artifact-lessp (entry1 entry2)
+  ;; TODO sort only by roots
+  nil
+  )
+(defun javaimp-list--group-lessp (entry1 entry2)
+  ;; TODO sort only by roots
+  nil
+  )
+
+(defun javaimp-list--refresh ()
+  "Recompute the list of projects for the Javaimp Project List
+buffer."
+  (setq tabulated-list-entries nil)
+
+  (dolist (node (javaimp--collect-nodes-from-tree javaimp-project-forest))
+(let* ((m (javaimp-node-contents node))
+   (pm (and (javaimp-node-parent node)
+(javaimp-node-contents (javaimp-node-parent node
+   (mid (javaimp-module-id m))
+   (pmid (and pm (javaimp-module-id pm)))
+   (root (javaimp--get-root node))
+
+   (depth (let ((ptr node)
+(res 0))
+(while (setq ptr (javaimp-node-parent ptr))
+  (setq res (1+ res)))
+res))
+   (artifact (concat (make-string depth ?-) (javaimp-id-artifact mid)))
+
+   ;; show group and version only if different from parent
+   (group (if (and pmid
+   (javaimp-id-group mid)
+   (javaimp-id-group pmid)
+   (equal (javaimp-id-group mid) (javaimp-id-group 
pmid)))
+  "*"
+(javaimp-id-group mid)))
+   (version (if (and pmid
+ (javaimp-id-version mid)
+ (javaimp-id-version pmid)
+ (equal (javaimp-id-version mid) 
(javaimp-id-version pmid)))
+"*"
+  (javaimp-id-version mid)))
+
+   ;; buttonize filename only if file exists
+   (basename (file-name-nondirectory (javaimp-module-file m)))
+   (file (if (file-exists-p (javaimp-module-file m))
+ `(,basename
+   face link
+   follow-link t
+   help-echo "Visit file"
+   action ,(lambda (_btn)
+ (find-file (javaimp-module-file m
+   (propertize basename 'face 'warning)))
+
+   (time-format
+(let ((daystart-dec (decode-time)))
+  (setf (decoded-time-second daystart-dec) 0)
+  (setf (decoded-time-minute daystart-dec) 0)
+  (setf (decoded-time-hour daystart-dec) 0)
+  (if (time-less-p (javaimp-module-load-ts m)
+   (encode-time daystart-dec))
+  "%c" "%X")))
+   (load-ts time-format (javaimp-module-load-ts m))
+
+   (absdir (file-name-directory (javaimp-module-file m)))
+   ;; show dir relatively to root if have parent
+   (dir-name
+(if pm
+(let ((root-dir (file-name-directory
+ (javaimp-module-file
+  (javaimp-node-contents root)
+  (file-relative-name dir root-dir))
+  absdir))
+   (dir `(,dir-name
+  face link
+  follow-link t
+  help-echo "Visit direct

[elpa] scratch/javaimp-list b9280ed 3/3: *** empty log message ***

2021-05-28 Thread Filipp Gunbin
branch: scratch/javaimp-list
commit b9280edc002b0cff2dd6086f5a2a5ef0f55b7387
Author: Filipp Gunbin 
Commit: Filipp Gunbin 

*** empty log message ***
---
 javaimp-list.el | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/javaimp-list.el b/javaimp-list.el
index df3ac28..9eb3cba 100644
--- a/javaimp-list.el
+++ b/javaimp-list.el
@@ -13,13 +13,12 @@
 
 (defvar javaimp-list-mode-map
   (let ((map (make-sparse-keymap)))
-(define-key map (kbd "C-d") 'javaimp-list-forget-project)
-(define-key map (kbd "RET") 'javaimp-list-display-project)
-(define-key map [?i] 'javaimp-list-display-project)
+(define-key map "d" 'javaimp-list-forget-project)
+(define-key map "m" 'javaimp-list-display-project)
+(define-key map "i" 'javaimp-list-display-project)
 map))
 
-(define-derived-mode javaimp-list-mode tabulated-list-print
-  "Javaimp Project List"
+(define-derived-mode javaimp-list-mode tabulated-list-mode "Javaimp Project 
List"
   "Major mode for listing the projects known by Javaimp."
   (setq tabulated-list-format [("Artifact" 20 #'javaimp-list--artifact-lessp)
("Group" 20 #'javaimp-list-group-lessp)
@@ -28,7 +27,9 @@
("Loaded at" 10 t)
("Directory" 0 nil)
])
-  (setq tabulated-list-sort-key (cons "Artifact" nil))
+  ;; (setq tabulated-list-sort-key (cons "Artifact" nil))
+  ;; tabulated-list-entries if function; tabulated-list-printer; 
tabulated-list-padding
+  (setq buffer-undo-list t)
   (add-hook 'tabulated-list-revert-hook #'javaimp-list--refresh nil t))
 
 (defun javaimp-list--artifact-lessp (entry1 entry2)
@@ -59,7 +60,7 @@ buffer."
 (while (setq ptr (javaimp-node-parent ptr))
   (setq res (1+ res)))
 res))
-   (artifact (concat (make-string depth ?-) (javaimp-id-artifact mid)))
+   (artifact (concat (make-string depth ? ) (javaimp-id-artifact mid)))
 
;; show group and version only if different from parent
(group (if (and pmid
@@ -116,6 +117,7 @@ buffer."
  artifact (or group "--") (or version "--")
  dir file load-ts))
   tabulated-list-entries))
+  ;; TODO sort by group / artifact
   (tabulated-list-init-header))
 
 ;; TODO option to forget everything loaded from the same file
@@ -140,6 +142,7 @@ buffer."
 
 (defun javaimp-list--display-project ()
   "Display detailed information for project at point."
+  ;;
   ;; TODO detailed, with-output-to-temp-buffer
 
   )



[elpa] externals/vertico updated (25e0672 -> 7dc2f01)

2021-05-28 Thread Protesilaos Stavrou
protesilaos pushed a change to branch externals/vertico.

  from  25e0672   Version 0.11
   new  ad7438f   Add vertico--remote-p, check default-directory (Fix #48)
   new  2cd32c3   Minor spelling fix (#46)
   new  591a5d7   Minor simplification
   new  7dc2f01   Use 1-


Summary of changes:
 README.org |  2 +-
 vertico.el | 26 ++
 2 files changed, 15 insertions(+), 13 deletions(-)



[elpa] externals/vertico ad7438f 1/4: Add vertico--remote-p, check default-directory (Fix #48)

2021-05-28 Thread Protesilaos Stavrou
branch: externals/vertico
commit ad7438f18b22590e8161fe9d600e16feb2637de0
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add vertico--remote-p, check default-directory (Fix #48)
---
 vertico.el | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vertico.el b/vertico.el
index 8f95473..1b39b01 100644
--- a/vertico.el
+++ b/vertico.el
@@ -310,13 +310,17 @@
   (setcdr (cdar group-list) (caadr group-list)) ;; Link groups
   (setq group-list (cdr group-list)))
 
+(defun vertico--remote-p (path)
+  "Return t if PATH is a remote path."
+  (string-match-p "\\`/[^/|:]+:" (substitute-in-file-name path)))
+
 (defun vertico--update-candidates (pt content bounds metadata)
   "Preprocess candidates given PT, CONTENT, BOUNDS and METADATA."
   (pcase
   ;; If Tramp is used, do not compute the candidates in an interruptible 
fashion,
   ;; since this will break the Tramp password and user name prompts (See 
#23).
   (if (and (eq 'file (completion-metadata-get metadata 'category))
-   (string-match-p "\\`/[^/|:]+:" (substitute-in-file-name 
content)))
+   (or (vertico--remote-p content) (vertico--remote-p 
default-directory)))
   (vertico--recompute-candidates pt content bounds metadata)
   ;; bug#38024: Icomplete uses `while-no-input-ignore-events' to 
repair updating issues
 (let ((while-no-input-ignore-events '(selection-request))



[elpa] externals/vertico 591a5d7 3/4: Minor simplification

2021-05-28 Thread Protesilaos Stavrou
branch: externals/vertico
commit 591a5d7d0aac1509403ed39a10645aec12cde656
Author: Daniel Mendler 
Commit: Daniel Mendler 

Minor simplification
---
 vertico.el | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/vertico.el b/vertico.el
index 1b39b01..26ad1d8 100644
--- a/vertico.el
+++ b/vertico.el
@@ -471,14 +471,12 @@
   "Exhibit completion UI."
   (vertico--tidy-shadowed-file)
   (let* ((pt (max 0 (- (point) (minibuffer-prompt-end
- (metadata (completion-metadata (buffer-substring-no-properties
- (minibuffer-prompt-end)
- (+ (minibuffer-prompt-end) pt))
-minibuffer-completion-table
-minibuffer-completion-predicate))
  (content (minibuffer-contents-no-properties))
  (before (substring content 0 pt))
  (after (substring content pt))
+ (metadata (completion-metadata before
+minibuffer-completion-table
+minibuffer-completion-predicate))
  ;; bug#47678: `completion-boundaries` fails for `partial-completion`
  ;; if the cursor is moved between the slashes of "~//".
  ;; See also marginalia.el which has the same issue.



[elpa] externals/vertico 7dc2f01 4/4: Use 1-

2021-05-28 Thread Protesilaos Stavrou
branch: externals/vertico
commit 7dc2f0130f0fe6bd674f4f060dff76bc18889211
Author: Daniel Mendler 
Commit: Daniel Mendler 

Use 1-

Weird naming?
---
 vertico.el | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/vertico.el b/vertico.el
index 26ad1d8..668827a 100644
--- a/vertico.el
+++ b/vertico.el
@@ -407,8 +407,8 @@
 (while (> index vertico-count)
   (if (< current-line (/ index 2))
   (nbutlast lines)
-(setq current-line (- current-line 1) lines (cdr lines)))
-  (setq index (- index 1)))
+(setq current-line (1- current-line) lines (cdr lines)))
+  (setq index (1- index)))
 lines))
 
 (defun vertico--display-candidates (lines)
@@ -507,7 +507,7 @@
   (setq vertico--keep t
 vertico--index
 (max (if (or (vertico--allow-prompt-selection-p) (not 
vertico--candidates)) -1 0)
- (min index (- vertico--total 1)
+ (min index (1- vertico--total)
 
 (defun vertico-first ()
   "Go to first candidate, or to the prompt when the first candidate is 
selected."
@@ -517,7 +517,7 @@
 (defun vertico-last ()
   "Go to last candidate."
   (interactive)
-  (vertico--goto (- vertico--total 1)))
+  (vertico--goto (1- vertico--total)))
 
 (defun vertico-scroll-down ()
   "Go back by one page."
@@ -542,8 +542,8 @@
   (interactive)
   (vertico--goto
(if (and vertico-cycle (= vertico--index (if 
(vertico--allow-prompt-selection-p) -1 0)))
-   (- vertico--total 1)
- (- vertico--index 1
+   (1- vertico--total)
+ (1- vertico--index
 
 (defun vertico-exit (&optional arg)
   "Exit minibuffer with current candidate or input if prefix ARG is given."



[elpa] externals/vertico 2cd32c3 2/4: Minor spelling fix (#46)

2021-05-28 Thread Protesilaos Stavrou
branch: externals/vertico
commit 2cd32c387755b854d06f1b5298436912a91647bf
Author: Manuel Uberti 
Commit: GitHub 

Minor spelling fix (#46)

Really, really minor.
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 835f4fa..f0b7a52 100644
--- a/README.org
+++ b/README.org
@@ -183,7 +183,7 @@ follow a similar philosophy:
   vertical display. In contrast to Vertico, the candidates are rotated such 
that
   the current candidate always appears at the top. From my perspective,
   candidate rotation feels a bit less intuitive than the UI of Vertico or
-  Selectrum. Note that Emacs 28 offers an built-in ~icomplete-vertical-mode~.
+  Selectrum. Note that Emacs 28 offers a built-in ~icomplete-vertical-mode~.
 
 * Problematic completion commands
 



[elpa] externals/corfu 3f5f16c: Use 1-

2021-05-28 Thread Protesilaos Stavrou
branch: externals/corfu
commit 3f5f16c83788d003cd69a033b98238ddf935
Author: Daniel Mendler 
Commit: Daniel Mendler 

Use 1-
---
 corfu.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/corfu.el b/corfu.el
index 714818a..21ac8ea 100644
--- a/corfu.el
+++ b/corfu.el
@@ -540,7 +540,7 @@ Set to nil in order to disable confirmation."
 
 (defun corfu--goto (index)
   "Go to candidate with INDEX."
-  (setq corfu--index (max -1 (min index (- corfu--total 1)
+  (setq corfu--index (max -1 (min index (1- corfu--total)
 
 (defun corfu-next ()
   "Go to next candidate."
@@ -555,8 +555,8 @@ Set to nil in order to disable confirmation."
   (interactive)
   (corfu--goto
(if (and corfu-cycle (< corfu--index 0))
-   (- corfu--total 1)
- (- corfu--index 1
+   (1- corfu--total)
+ (1- corfu--index
 
 (defun corfu-scroll-down ()
   "Go back by one page."
@@ -576,7 +576,7 @@ Set to nil in order to disable confirmation."
 (defun corfu-last ()
   "Go to last candidate."
   (interactive)
-  (corfu--goto (- corfu--total 1)))
+  (corfu--goto (1- corfu--total)))
 
 (defun corfu--restore-on-next-command ()
   "Restore window configuration before next command."



[elpa] branch externals/consult created (now d214c27)

2021-05-28 Thread monnier--- via
monnier pushed a change to branch externals/consult.

at  d214c27   consult-flymake: Fix status indicator

This branch includes the following new commits:

   new  3d22ce3   initial commit
   new  3d15b5a   readme: more info
   new  da25817   add faces
   new  4083091   add consult-register
   new  1978335   add consult-theme
   new  6ed6ecb   matter of taste - replace cl-loop by maps
   new  9137e5e   better naming convention, consult-something
   new  ed2374f   renamings
   new  08c798d   improve readme
   new  fdb2f13   remove column number from consult-mark (too much noise)
   new  4dd765d   todo: is there a generic replacement for 
selectrum-should-sort-p?
   new  65ede51   add consult-line
   new  dec9b75   update readme
   new  7c27fc8   add other-window variants
   new  fe37af4   update readme
   new  7ef474d   consult-buffer only narrows if there are bookmarks/views
   new  319e9b7   add consult-bookmark
   new  d1a20b6   comment
   new  1453088   add binding to readme
   new  50b884a   fix some warnings
   new  98825fd   add consult-apropos
   new  1aa0ba5   fix font-locking for consult-line
   new  8370425   expand readme
   new  f877b7d   update description
   new  b6c100b   allow customization of properties
   new  c7cb009   add consult-command-history and consult-minibuffer-history
   new  f3fa44c   clarify readme
   new  b2728c0   add consult-minor-mode
   new  00b88f5   add todos
   new  6f0e49a   improve consult-register
   new  8d0a860   add note about ivy/helm to the readme
   new  62a2321   add todos
   new  c93873c   add consult--read
   new  0e8ed52   improve readme
   new  08307ec   perform alist handling in consult--read, better error 
handling
   new  3823780   consult--yank-read macro
   new  4f1aa33   improve consult-line
   new  d256386   todo
   new  3429242   consult-line: use 'display for prefix, remove 
consult-property custom vars
   new  0b04ac9   only consult--buffer is still selectrum dependent...
   new  6ecf2a1   tweak fonts a little bit
   new  099df6f   use display for consult-minor-mode prefix
   new  b0d11b0   renamings
   new  ed9121f   add "fix" to consult-line
   new  277c014   add support for category metadata (useful for action 
support)
   new  1479592   fix #3
   new  fea9d0a   update readme
   new  f6a0412   add consult-face
   new  c89b0ac   add consult-outline
   new  19e42aa   remove some todos
   new  ea5f09a   reduce code duplication of consult-mark and 
consult-outline
   new  96a1882   improve readme
   new  03752a6   add images
   new  79755cc   change consult--read api
   new  d08dc0b   improve error handling
   new  f3ef2be   shorter title
   new  b1728b1   todo: consult--buffer is broken
   new  bc646aa   fix consult--buffer
   new  fe47eca   update links
   new  60e5f92   add consult--preview for theme
   new  ee520c4   simplify consult--preview macro
   new  db41b9f   add buffer preview support
   new  1c86c5e   renaming
   new  86eeede   consult-line: use current line as default candidate
   new  432c9c8   Revert "consult-line: use current line as default 
candidate"
   new  997e2da   add missing declare-function
   new  4f4eecf   consult--read: add lookup argument
   new  89d8ee9   Revert "simplify consult--preview macro"
   new  477d717   add preview argument to consult--read
   new  31d817d   more flexible preview callback function
   new  18382d6   implement preview for outline, mark and line
   new  e1e91a2   comments
   new  7ece8a1   readme
   new  31e47f4   reorder a bit of the code, change section in the readme 
about how things will be packaged up
   new  61f8c63   add myself to the author header line and as maintainer
   new  6857d06   fix buffer preview for consult-buffer-other-window
   new  46f2d12   refactoring
   new  757eb84   cleanup consult--preview
   new  57a3178   consult-line, consult-outline, consult-mark: use markers 
in order to allow recursive editing of preview
   new  c0a0a19   readme
   new  96bed4c   expand readme
   new  ffee297   prevent consult-line etc inside the minibuffer
   new  acdcba7   preview: add support for icomplete
   new  7e2e485   add simpler variant of consult--buffer which works with 
completing-read
   new  a98a6e4   go over the todos again
   new  3933977   cleaning up
   new  8a6e63c   add todo
   new  d2f08de   use delete-dups which is O(n)
   new  10812b4   some refactor, ensure that consult-mark works with 
narrowing
   new  98060bd   add preview support for default emacs completion
   new  aee4623   move some todos to github issues for discussion
   new  dde4a9c   optimize consult-line, consult-mark, consult-outline fo

[elpa] branch externals/marginalia created (now 529aee6)

2021-05-28 Thread monnier--- via
monnier pushed a change to branch externals/marginalia.

at  529aee6   Require subr-x only at compile time

This branch includes the following new commits:

   new  237a620   initial prototype
   new  84f0fde   add marginalia-command-annotate
   new  a6dfb38   add todos
   new  863e07b   experimental: remove selectrum-specifics (may not work 
out!)
   new  bdbbee2   add very basic readme
   new  eecc6e2   Get key binding active in next window instead of in the 
minibuffer
   new  e863b6c   Show key bindings from minibuffer-selected-window
   new  6077206   Ignore byte-compiled files, autoloads and *-pkg.el files
   new  4780a6a   marginalia works with icomplete-vertical now!
   new  c47576c   add configuration example
   new  0c090f3   improve readme
   new  548bf39   more explicit name for marginalia-command-annotate
   new  2f849d8   Simplify marginalia--completion-metadata-get
   new  28defd6   Introduce new name "annotator" for annotation functions
   new  6537c37   Shorten first line of docstring using our "annotator" term
   new  80fa320   Introduce list of classifiers
   new  69ec4d7   Remove unused function
   new  59d65af   Add basic classifiers: orginal category, symbols, by 
words in prompt
   new  e2af1d3   Make marginalia-prompt-categories an alist of regexps and 
categories
   new  1c8ef02   Remove unused marginalia--metadata function
   new  c97911b   All classifiers from Embark have been imported, remove 
TODO
   new  bcb6bbb   Correct slight imprecision in docstring
   new  0cb98a0   Remove default value from prompt before matching
   new  7d3f018   Add annotations for files and buffers
   new  0f1e763   rename some variables for consistency, update readme
   new  9ca180b   richer formatting of file and buffer annotations
   new  7fe8f71   improve buffer annotation formatting
   new  cd95c65   buffer annotation: add read-only status
   new  ca21d30   fix typo in the readme
   new  6c8b158   add license
   new  4ba9804   Fix bug: file annotations were only shown for current 
directory
   new  f9ca52c   Fallback for when full candidate is requested outside of 
minibuffer
   new  3210152   add comment to marginalia--full-candidate
   new  6789da8   fix typo in marginalia-set-command-annotator
   new  655f03b   introduce marginalia-annotators-(light|heavy), remove 
marginalia-set-command-annotator
   new  675e680   improve annotator defcustoms
   new  b6d2e22   fix typo
   new  78023eb   update readme
   new  4cb6d2b   marginalia-annotate-file: add modes, user and group
   new  ed74ca9   add marginalia-toggle-annotators
   new  472b47a   add comment to marginalia-toggle-annotators
   new  c05face   Improve marginalia-toggle-annotators if invoked from 
minibuffer
   new  f39556b   fix marginalia--full-candidate for selectrum
   new  f7adb62   fix #14
   new  c8c3f87   Rename toggle -> cycle, improve documenation
   new  8be2daf   marginalia-annotate-file: remove unnecessary offset which 
only costs space for no reason
   new  fe5d5db   add faces: marginalia-file-modes, marginalia-file-owner
   new  376ccc5   Revert "fix marginalia--full-candidate for selectrum"
   new  1269445   marginalia-annotate-command-binding: cache key binding
   new  6567947   marginalia-annotate-command-binding: use a hash table per 
buffer
   new  57b1176   marginalia-annotate-command-binding: only store the 
binding in the hash table
   new  ccefc57   marginalia-annotate-command-binding: add comment
   new  85a2693   marginalia-annotate-package: show package archive
   new  c574a26   more colors!
   new  65da400   marginalia-annotate-package: show package version
   new  501a3b3   simplify marginalia--align
   new  642e25d   replace marginalia-separator-width by marginalia-separator
   new  2805127   introduce a small dsl marginalia--fields which helps with 
formatting
   new  17d539c   whitespace and comment adjustments
   new  2eec2dc   fix warnings
   new  dfbaa7f   marginalia-annotate-package: show installed status 
instead of archive
   new  14dce57   scale field widths such that annotations look better on 
smaller windows
   new  4a5ada6   smaller variable field
   new  2f1bb7c   do not overwrite the face weights as per recommendation 
by @purcell
   new  597186d   add marginalia-annotate-minor-mode
   new  f083852   readme: add embark and consult links
   new  783cb49   improve marginalia-minor-mode
   new  d0afe4a   add melpa badge
   new  d2a7923   improve marginalia-annotate-package, do not show nil for 
builtins
   new  75e9e9b   add marginalia-annotate-charset
   new  4ffd1a9   add marginalia-annotate-input-method
   new  31ba78b   add marginalia-annotate-coding-system
   new  ef325fc   In symbol annotator skip 

[elpa] externals/marginalia 237a620 001/241: initial prototype

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 237a6206cff95a15db5b29293ab0a4987eceeb41
Author: Daniel Mendler 
Commit: Daniel Mendler 

initial prototype
---
 marginalia.el | 269 ++
 1 file changed, 269 insertions(+)

diff --git a/marginalia.el b/marginalia.el
new file mode 100644
index 000..f49d179
--- /dev/null
+++ b/marginalia.el
@@ -0,0 +1,269 @@
+;;; marginalia.el --- Enrich existing commands with completion annotations -*- 
lexical-binding: t -*-
+
+;; Author: Omar Antolín Camarena, Daniel Mendler
+;; Maintainer: Omar Antolín Camarena, Daniel Mendler
+;; Created: 2020
+;; License: GPL-3.0-or-later
+;; Version: 0.1
+;; Package-Requires: ((emacs "26.1"))
+;; Homepage: https://github.com/minad/marginalia
+
+;; 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:
+
+;; Enrich existing commands with completion annotations
+
+;;; Code:
+
+(require 'subr-x)
+
+ Customization
+
+(defgroup marginalia nil
+  "Enrich existing commands with completion annotations."
+  :group 'convenience
+  :prefix "marginalia-")
+
+(defface marginalia-key
+  '((t :inherit font-lock-keyword-face :weight normal))
+  "Face used to highlight keys in `marginalia-mode'."
+  :group 'marginalia)
+
+(defface marginalia-variable
+  '((t :inherit marginalia-key))
+  "Face used to highlight variable values in `marginalia-mode'."
+  :group 'marginalia)
+
+(defface marginalia-annotation
+  '((t :inherit completions-annotations :weight normal))
+  "Face used to highlight documentation string in `marginalia-mode'."
+  :group 'marginalia)
+
+(defcustom marginalia-annotation-width 80
+  "Width of annotation string."
+  :type 'integer
+  :group 'marginalia)
+
+(defcustom marginalia-annotate-alist
+  '((command . marginalia-annotate-command-binding)
+(customize-group . marginalia-annotate-customize-group)
+(variable . marginalia-annotate-variable)
+(face . marginalia-annotate-face)
+(symbol . marginalia-annotate-symbol)
+(variable . marginalia-annotate-variable)
+(package . marginalia-annotate-package))
+  "Associating categories with annotation functions for minibuffer completion.
+The annotation function must return a string,
+which is appended to the completion candidate.
+Annotations are only shown if `marginalia-mode' is enabled."
+  :type '(alist :key-type symbol :value-type function)
+  :group 'marginalia)
+
+(defcustom marginalia-category-alist
+  '((execute-extended-command . command)
+(customize-face . face)
+(customize-face-other-window . face)
+(customize-group . customize-group)
+(customize-group-other-window . customize-group)
+(customize-option . variable)
+(customize-option-other-window . variable)
+(customize-set-variable . variable)
+(customize-variable . variable)
+(customize-variable-other-window . variable)
+(describe-function . symbol)
+(describe-variable . variable)
+(describe-face . face)
+(describe-symbol . symbol)
+(helpful-callable . symbol)
+(helpful-command . symbol)
+(helpful-function . symbol)
+(helpful-macro . symbol)
+(helpful-symbol . symbol)
+(helpful-variable . variable)
+(describe-package . package)
+(package-install . package)
+(package-delete . package)
+(package-reinstall . package))
+  "Associate commands with a completion category."
+  :type '(alist :key-type symbol :value-type symbol)
+  :group 'marginalia)
+
+ Pre-declarations for external packages
+
+(defvar selectrum-highlight-candidates-function)
+(defvar package--builtins)
+(defvar package-alist)
+(defvar package-archive-contents)
+(declare-function package-desc-summary "package")
+(declare-function package--from-builtin "package")
+
+ Marginalia mode
+
+(defvar marginalia--this-command nil
+  "Last command symbol saved in order to allow annotations.")
+
+(defun marginalia--truncate (str width)
+  "Truncate string STR to WIDTH."
+  (truncate-string-to-width (car (split-string str "\n")) width 0 32 "…"))
+
+(defun marginalia-annotate-command-binding (cand)
+  "Annotate command CAND with keybinding."
+  ;; Taken from Emacs 28, read-extended-command--annotation
+  (when-let* ((binding (where-is-internal (intern cand) overriding-local-map 
t))
+  (desc (and (not (stringp binding)) (key-description binding
+(pro

[elpa] externals/marginalia bdbbee2 005/241: add very basic readme

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit bdbbee231afb17a2a1019c87fc5f545a9fb7494a
Author: Daniel Mendler 
Commit: Daniel Mendler 

add very basic readme
---
 README.md   |   7 +++
 marginalia-mode.png | Bin 0 -> 113999 bytes
 2 files changed, 7 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 000..a17d30b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,7 @@
+# marginalia.el - Marginalia for completions
+
+This package provides `marginalia-mode` which adds marginalia (annotations) to 
the minibuffer completions.
+The annotations are added based on the completion category.
+Furthermore the package allows to associate completion categories to commands.
+
+![marginalia-mode with 
Selectrum](https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true)
diff --git a/marginalia-mode.png b/marginalia-mode.png
new file mode 100644
index 000..a28f1c5
Binary files /dev/null and b/marginalia-mode.png differ



[elpa] externals/marginalia a6dfb38 003/241: add todos

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit a6dfb38738bddf7aaf25654d26ffe0faa6cefed7
Author: Daniel Mendler 
Commit: Daniel Mendler 

add todos
---
 marginalia.el | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index c1c08a4..68130d9 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -229,6 +229,12 @@ PROP is the property which is looked up."
   "Setup minibuffer for `marginalia-mode'.
 Remember `this-command' for annotation and replace highlighting function."
   (setq-local marginalia--this-command this-command)
+  ;; TODO we use selectrum-highlight-candidates-function here because 
annotation faces
+  ;; are overwritten if we use the Emacs annotation-function with selectrum is 
used.
+  ;; While this is consistent with the behavior of the Completions buffer, it 
is not
+  ;; what I want e.g. for marginalia-annotate-face!
+  ;; How to proceed?
+  ;; See https://github.com/raxod502/selectrum/pull/249
   (when (boundp 'selectrum-highlight-candidates-function)
 (let ((orig selectrum-highlight-candidates-function))
   (setq-local selectrum-highlight-candidates-function
@@ -265,6 +271,7 @@ Remember `this-command' for annotation and replace 
highlighting function."
 ;; https://github.com/oantolin/icomplete-vertical/issues/16
 (advice-add #'completion-metadata-get :around 
#'marginalia--completion-metadata-get)))
 
+;; TODO better name? there is also the name clash problem with 
marginalia-annotate-command
 ;;;###autoload
 (defun marginalia-command-annotate (cmd ann)
   "Modify marginalia configuration such that annotation function ANN is used 
for command CMD."



[elpa] externals/marginalia 863e07b 004/241: experimental: remove selectrum-specifics (may not work out!)

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 863e07be931d39047d3d043861384262526a9dfa
Author: Daniel Mendler 
Commit: Daniel Mendler 

experimental: remove selectrum-specifics (may not work out!)

See https://github.com/raxod502/selectrum/pull/249
---
 marginalia.el | 21 -
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 68130d9..f158d22 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -104,7 +104,6 @@ Annotations are only shown if `marginalia-mode' is enabled."
 
  Pre-declarations for external packages
 
-(defvar selectrum-highlight-candidates-function)
 (defvar package--builtins)
 (defvar package-alist)
 (defvar package-archive-contents)
@@ -215,9 +214,8 @@ PROP is the property which is looked up."
   ;; TODO add more category classifiers from Embark
   (pcase prop
 ('annotation-function
- (or (and (not (bound-and-true-p selectrum-mode)) ;; TODO Still using the 
selectrum-highlighting function
-  (when-let (cat (marginalia--category-type))
-(alist-get cat marginalia-annotate-alist)))
+ (or (when-let (cat (marginalia--category-type))
+   (alist-get cat marginalia-annotate-alist))
  (funcall fun metadata prop)))
 ('category
  (or (and marginalia--this-command
@@ -227,19 +225,8 @@ PROP is the property which is looked up."
 
 (defun marginalia--minibuffer-setup ()
   "Setup minibuffer for `marginalia-mode'.
-Remember `this-command' for annotation and replace highlighting function."
-  (setq-local marginalia--this-command this-command)
-  ;; TODO we use selectrum-highlight-candidates-function here because 
annotation faces
-  ;; are overwritten if we use the Emacs annotation-function with selectrum is 
used.
-  ;; While this is consistent with the behavior of the Completions buffer, it 
is not
-  ;; what I want e.g. for marginalia-annotate-face!
-  ;; How to proceed?
-  ;; See https://github.com/raxod502/selectrum/pull/249
-  (when (boundp 'selectrum-highlight-candidates-function)
-(let ((orig selectrum-highlight-candidates-function))
-  (setq-local selectrum-highlight-candidates-function
-  (lambda (input candidates)
-(marginalia--annotate-candidates (funcall orig input 
candidates)))
+Remember `this-command' for annotation."
+  (setq-local marginalia--this-command this-command))
 
 (defun marginalia--metadata ()
   "Return current minibuffer completion metadata."



[elpa] externals/marginalia c47576c 010/241: add configuration example

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit c47576cf1a9a03af46722f8639647477c4ff9622
Author: Daniel Mendler 
Commit: Daniel Mendler 

add configuration example
---
 README.md | 21 +
 1 file changed, 21 insertions(+)

diff --git a/README.md b/README.md
index a17d30b..704c2a2 100644
--- a/README.md
+++ b/README.md
@@ -5,3 +5,24 @@ The annotations are added based on the completion category.
 Furthermore the package allows to associate completion categories to commands.
 
 ![marginalia-mode with 
Selectrum](https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true)
+
+## Configuration
+
+~~~ elisp
+;; Enable richer annotations using the Marginalia package
+(use-package marginalia
+  ;; The :init configuration is always executed (Not lazy!)
+  :init t
+
+  ;; Must be in the :init section of use-package such that the mode gets
+  ;; enabled right away. Note that this forces loading the package.
+  (marginalia-mode)
+
+  ;; Enable richer annotations for M-x.
+  ;; Only keybindings are shown by default, in order to reduce noise for this 
very common command.
+  ;; * marginalia-annotate-symbol: Annotate with the documentation string
+  ;; * marginalia-annotate-command-binding (default): Annotate only with the 
keybinding
+  ;; * marginalia-annotate-command-full: Annotate with the keybinding and the 
documentation string
+  ;; (setf (alist-get 'command marginalia-annotate-alist) 
#'marginalia-annotate-command-full)
+)
+~~~



[elpa] externals/marginalia 84f0fde 002/241: add marginalia-command-annotate

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 84f0fdea5e04d6413fc3db96181e7e2e2beaa162
Author: Daniel Mendler 
Commit: Daniel Mendler 

add marginalia-command-annotate
---
 marginalia.el | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index f49d179..c1c08a4 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -73,7 +73,7 @@ Annotations are only shown if `marginalia-mode' is enabled."
   :type '(alist :key-type symbol :value-type function)
   :group 'marginalia)
 
-(defcustom marginalia-category-alist
+(defcustom marginalia-command-category-alist
   '((execute-extended-command . command)
 (customize-face . face)
 (customize-face-other-window . face)
@@ -221,7 +221,7 @@ PROP is the property which is looked up."
  (funcall fun metadata prop)))
 ('category
  (or (and marginalia--this-command
-  (alist-get marginalia--this-command marginalia-category-alist))
+  (alist-get marginalia--this-command 
marginalia-command-category-alist))
  (funcall fun metadata prop)))
 (_ (funcall fun metadata prop
 
@@ -265,5 +265,15 @@ Remember `this-command' for annotation and replace 
highlighting function."
 ;; https://github.com/oantolin/icomplete-vertical/issues/16
 (advice-add #'completion-metadata-get :around 
#'marginalia--completion-metadata-get)))
 
+;;;###autoload
+(defun marginalia-command-annotate (cmd ann)
+  "Modify marginalia configuration such that annotation function ANN is used 
for command CMD."
+  (setq marginalia-command-category-alist
+(cons (cons cmd cmd)
+  (assq-delete-all cmd marginalia-command-category-alist)))
+  (setq marginalia-command-category-alist
+(cons (cons cmd ann)
+  (assq-delete-all cmd marginalia-annotate-alist
+
 (provide 'marginalia)
 ;;; marginalia.el ends here



[elpa] externals/marginalia e2af1d3 019/241: Make marginalia-prompt-categories an alist of regexps and categories

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit e2af1d34fe73e143a800e366fbb06ac6e2826c5b
Author: Omar Antolín 
Commit: Omar Antolín 

Make marginalia-prompt-categories an alist of regexps and categories
---
 marginalia.el | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 1770403..53be877 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -87,12 +87,13 @@ determine it."
   :group 'marginalia)
 
 (defcustom marginalia-prompt-categories
-  '((group . customize-group) (M-x . command) package face variable)
-  "Words whose presence in a minibuffer prompt determins the category.
-The words should be given either as a symbol which if found in
-the prompt is the category name, or as a dotted pair of symbols,
-the presence of the first indicating the second is the category."
-  :type '(repeat (choice symbol (cons symbol symbol)))
+  '(("\\" . customize-group)
+("\\" . command)
+("\\" . package)
+("\\" . face)
+("\\" . variable))
+  "Associates regexps to match against minibuffer prompts with categories."
+  :type '(alist :key-type regexp :value-type symbol)
   :group 'marginalia)
 
 (defcustom marginalia-command-category-alist nil
@@ -224,11 +225,12 @@ the presence of the first indicating the second is the 
category."
   'symbol)))
 
 (defun marginalia-classify-by-prompt ()
-  "Determine category by a special word in prompt."
+  "Determine category by matching regexps against the minibuffer prompt.
+This runs through the `marginalia-prompt-categories' alist
+looking for a regexp that matches the prompt."
   (when-let ((prompt (minibuffer-prompt)))
-(cl-loop for spec in marginalia-prompt-categories
- for (word . category) = (if (consp spec) spec (cons spec spec))
- when (string-match-p (format "\\<%s\\>" word) prompt)
+(cl-loop for (regexp . category) in marginalia-prompt-categories
+ when (string-match-p regexp prompt)
  return category)))
 
 (defun marginalia--completion-metadata-get (metadata prop)



[elpa] externals/marginalia 4780a6a 009/241: marginalia works with icomplete-vertical now!

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 4780a6a9070f4f0d260d06374876b2f1f3fc9810
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia works with icomplete-vertical now!
---
 marginalia.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 3ee86c4..77cfc2a 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -256,8 +256,6 @@ Remember `this-command' for annotation."
 (add-hook 'minibuffer-setup-hook #'marginalia--minibuffer-setup)
 
 ;; Replace the metadata function.
-;; TODO unfortunately annotations are not shown in the icomplete-vertical 
minibuffer it seem
-;; https://github.com/oantolin/icomplete-vertical/issues/16
 (advice-add #'completion-metadata-get :around 
#'marginalia--completion-metadata-get)))
 
 ;; TODO better name? there is also the name clash problem with 
marginalia-annotate-command



[elpa] externals/marginalia 28defd6 014/241: Introduce new name "annotator" for annotation functions

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 28defd6ecc794abab5c8a43a537da8ec03ab9b47
Author: Omar Antolín 
Commit: Omar Antolín 

Introduce new name "annotator" for annotation functions
---
 README.md |  2 +-
 marginalia.el | 14 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 2342af9..ff58798 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,6 @@ specify a completion category themselves.
   ;; * marginalia-annotate-symbol: Annotate with the documentation string
   ;; * marginalia-annotate-command-binding (default): Annotate only with the 
keybinding
   ;; * marginalia-annotate-command-full: Annotate with the keybinding and the 
documentation string
-  ;; (setf (alist-get 'command marginalia-annotate-alist) 
#'marginalia-annotate-command-full)
+  ;; (setf (alist-get 'command marginalia-annotator-alist) 
#'marginalia-annotate-command-full)
 )
 ~~~
diff --git a/marginalia.el b/marginalia.el
index f7963bb..423ce49 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -58,7 +58,7 @@
   :type 'integer
   :group 'marginalia)
 
-(defcustom marginalia-annotate-alist
+(defcustom marginalia-annotator-alist
   '((command . marginalia-annotate-command-binding)
 (customize-group . marginalia-annotate-customize-group)
 (variable . marginalia-annotate-variable)
@@ -203,11 +203,11 @@ Annotations are only shown if `marginalia-mode' is 
enabled."
 (defun marginalia--annotate-candidates (candidates)
   "Annotate CANDIDATES with richer information."
   (if-let* ((cat (marginalia--category-type))
-(annotate (alist-get cat marginalia-annotate-alist)))
+(annotate (alist-get cat marginalia-annotator-alist)))
   (mapcar (lambda (cand) (concat cand (funcall annotate cand))) candidates)
 candidates))
 
-(defun marginalia--completion-metadata-get (metadata prop)
+(defun marginalia--completion-metadata-get (_metadata prop)
   "Advice for `completion-metadata-get'.
 Replaces the category and annotation function.
 FUN is the original function.
@@ -217,7 +217,7 @@ PROP is the property which is looked up."
   (pcase prop
 ('annotation-function
  (when-let (cat (marginalia--category-type))
-   (alist-get cat marginalia-annotate-alist)))
+   (alist-get cat marginalia-annotator-alist)))
 ('category
  (and marginalia--this-command
   (alist-get marginalia--this-command 
marginalia-command-category-alist)
@@ -256,14 +256,14 @@ Remember `this-command' for annotation."
 (advice-add #'completion-metadata-get :before-until 
#'marginalia--completion-metadata-get)))
 
 ;;;###autoload
-(defun marginalia-set-command-annotation (cmd ann)
-  "Modify marginalia configuration such that annotation function ANN is used 
for command CMD."
+(defun marginalia-set-command-annotator (cmd ann)
+  "Configure marginalia so that annotator ANN is used for command CMD."
   (setq marginalia-command-category-alist
 (cons (cons cmd cmd)
   (assq-delete-all cmd marginalia-command-category-alist)))
   (setq marginalia-command-category-alist
 (cons (cons cmd ann)
-  (assq-delete-all cmd marginalia-annotate-alist
+  (assq-delete-all cmd marginalia-annotator-alist
 
 (provide 'marginalia)
 ;;; marginalia.el ends here



[elpa] externals/marginalia 6077206 008/241: Ignore byte-compiled files, autoloads and *-pkg.el files

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 60772065330862d594be75b572a1882baf1c5d65
Author: Omar Antolín 
Commit: Omar Antolín 

Ignore byte-compiled files, autoloads and *-pkg.el files
---
 .gitignore | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..cb62d01
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.elc
+*-autoloads.el
+*-pkg.el



[elpa] externals/marginalia eecc6e2 006/241: Get key binding active in next window instead of in the minibuffer

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit eecc6e257695cd35a912c91aa635dad083b8a0a8
Author: Omar Antolín 
Commit: Omar Antolín 

Get key binding active in next window instead of in the minibuffer
---
 marginalia.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index f158d22..f05c919 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -122,7 +122,9 @@ Annotations are only shown if `marginalia-mode' is enabled."
 (defun marginalia-annotate-command-binding (cand)
   "Annotate command CAND with keybinding."
   ;; Taken from Emacs 28, read-extended-command--annotation
-  (when-let* ((binding (where-is-internal (intern cand) overriding-local-map 
t))
+  (when-let* ((binding
+   (with-current-buffer (window-buffer (next-window))
+ (where-is-internal (intern cand) overriding-local-map t)))
   (desc (and (not (stringp binding)) (key-description binding
 (propertize (format " (%s)" desc) 'face 'marginalia-key)))
 



[elpa] externals/marginalia e863b6c 007/241: Show key bindings from minibuffer-selected-window

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit e863b6cc855a1c5af3ac2594cb002d7e69b81a50
Author: Omar Antolín 
Commit: Omar Antolín 

Show key bindings from minibuffer-selected-window

After a discussion on Github we decided it was better to show the key
bindings active in:

(window-buffer (minibuffer-selected-window))

rather than:

(window-buffer (next-window))

These should agree most of the time, but if the annotation function
somehow gets called from outside the minibuffer the first expression
should reduce to the current: (minibuffer-selected-window) returns nil
and then window-buffer gives you the buffer of (selected-window).
---
 marginalia.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index f05c919..3ee86c4 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -123,7 +123,7 @@ Annotations are only shown if `marginalia-mode' is enabled."
   "Annotate command CAND with keybinding."
   ;; Taken from Emacs 28, read-extended-command--annotation
   (when-let* ((binding
-   (with-current-buffer (window-buffer (next-window))
+   (with-current-buffer (window-buffer 
(minibuffer-selected-window))
  (where-is-internal (intern cand) overriding-local-map t)))
   (desc (and (not (stringp binding)) (key-description binding
 (propertize (format " (%s)" desc) 'face 'marginalia-key)))



[elpa] externals/marginalia ed74ca9 040/241: add marginalia-toggle-annotators

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit ed74ca9457a78f7019d9e32ffad87aa50694aac2
Author: Daniel Mendler 
Commit: Daniel Mendler 

add marginalia-toggle-annotators
---
 marginalia.el | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index bf2963d..f1900a4 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -95,12 +95,14 @@
   :group 'marginalia)
 
 (defcustom marginalia-annotators
-  'marginalia-annotators-light
+  '(marginalia-annotators-light marginalia-annotators-heavy)
   "Choose an annotator association list for minibuffer completion.
+The first entry in the list is used for annotations.
+You can toggle between the annotators using `marginalia-toggle-annotators'.
 Annotations are only shown if `marginalia-mode' is enabled."
-  :type '(choice (const :tag "Light" marginalia-annotators-light)
- (const :tag "Heavy" marginalia-annotators-heavy)
- (symbol :tag "Other"))
+  :type '(repeat (choice (const :tag "Light" marginalia-annotators-light)
+ (const :tag "Heavy" marginalia-annotators-heavy)
+ (symbol :tag "Other")))
   :group 'marginalia)
 
 (defcustom marginalia-annotators-light
@@ -380,7 +382,7 @@ PROP is the property which is looked up."
 ('annotation-function
  (when-let (cat (completion-metadata-get metadata 'category))
;; we do want the advice triggered for completion-metadata-get
-   (alist-get cat (symbol-value marginalia-annotators
+   (alist-get cat (symbol-value (car marginalia-annotators)
 ('category
  (let ((marginalia--original-category (alist-get 'category metadata)))
;; using alist-get in the line above bypasses any advice on
@@ -409,5 +411,11 @@ Remember `this-command' for annotation."
 ;; Replace the metadata function.
 (advice-add #'completion-metadata-get :before-until 
#'marginalia--completion-metadata-get)))
 
+(defun marginalia-toggle-annotators ()
+  "Toggle between annotators in `marginalia-annotators'."
+  (interactive)
+  (setq marginalia-annotators (append (cdr marginalia-annotators)
+  (list (car marginalia-annotators)
+
 (provide 'marginalia)
 ;;; marginalia.el ends here



[elpa] externals/marginalia c05face 042/241: Improve marginalia-toggle-annotators if invoked from minibuffer

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit c05face289026223e800df97ae2b3ec0d22a12e6
Author: Daniel Mendler 
Commit: Daniel Mendler 

Improve marginalia-toggle-annotators if invoked from minibuffer

If the toggler is invoked from the minibuffer only toggle
the annotations locally. If invoked from another global context,
toggle the annotations globally.
---
 marginalia.el | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 675f19a..ee761f5 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -419,8 +419,15 @@ Remember `this-command' for annotation."
 (defun marginalia-toggle-annotators ()
   "Toggle between annotators in `marginalia-annotators'."
   (interactive)
-  (setq marginalia-annotators (append (cdr marginalia-annotators)
-  (list (car marginalia-annotators)
+  (let ((annotators (append (cdr marginalia-annotators)
+(list (car marginalia-annotators)
+;; If `marginalia-toggle-annotators' has been invoked from inside the 
minibuffer, only change
+;; the annotators locally. This is useful if the command is used as an 
action. If the command is
+;; not triggered from inside the minibuffer, toggle the annotator 
globally. Hopefully this is
+;; not too confusing.
+(if (minibufferp)
+(setq-local marginalia-annotators annotators)
+  (setq marginalia-annotators annotators
 
 (provide 'marginalia)
 ;;; marginalia.el ends here



[elpa] externals/marginalia 6537c37 015/241: Shorten first line of docstring using our "annotator" term

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 6537c379f1e9155919cc3a4f2afea6c2ee8152a4
Author: Omar Antolín 
Commit: Omar Antolín 

Shorten first line of docstring using our "annotator" term
---
 marginalia.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 423ce49..7559307 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -66,8 +66,8 @@
 (symbol . marginalia-annotate-symbol)
 (variable . marginalia-annotate-variable)
 (package . marginalia-annotate-package))
-  "Associating categories with annotation functions for minibuffer completion.
-The annotation function must return a string,
+  "Associate categories with annotators for minibuffer completion.
+Each annotation function must return a string,
 which is appended to the completion candidate.
 Annotations are only shown if `marginalia-mode' is enabled."
   :type '(alist :key-type symbol :value-type function)



[elpa] externals/marginalia 0c090f3 011/241: improve readme

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 0c090f310e720385200f5056085b24d216efaf04
Author: Daniel Mendler 
Commit: Daniel Mendler 

improve readme
---
 README.md | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 704c2a2..2342af9 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,14 @@
-# marginalia.el - Marginalia for completions
+# marginalia.el - Marginalia in the minibuffer
 
-This package provides `marginalia-mode` which adds marginalia (annotations) to 
the minibuffer completions.
-The annotations are added based on the completion category.
-Furthermore the package allows to associate completion categories to commands.
+This package provides `marginalia-mode` which adds marginalia to the minibuffer
+completions. [Marginalia](https://en.wikipedia.org/wiki/Marginalia) are marks 
or
+annotations placed at the margin of the page of a book or in this case helpful
+colorful annotations placed at the margin of the minibuffer for your completion
+candidates. The annotations are added based on the completion category. For
+example `find-file` reports the `file` category and `M-x` reports the `command`
+category. Furthermore the package allows to associate completion categories to
+commands, since many commands (in contrast to `find-file` and `M-x`) do not
+specify a completion category themselves.
 
 ![marginalia-mode with 
Selectrum](https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true)
 



[elpa] externals/marginalia 4cb6d2b 039/241: marginalia-annotate-file: add modes, user and group

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 4cb6d2bbbdecbbb20fecaf7d28b6ab41b5a6463a
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-file: add modes, user and group
---
 marginalia.el | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 2ca6f56..bf2963d 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -318,12 +318,19 @@ using `minibuffer-force-complete' on the candidate CAND."
 
 (defun marginalia-annotate-file (cand)
   "Annotate file CAND with its size and modification time."
-  (when-let ((attributes (file-attributes (marginalia--full-candidate cand
+  (when-let ((attributes (file-attributes (marginalia--full-candidate cand) 
'string)))
 (concat
- (marginalia--align 7 ;; size
-marginalia-separator-width
+ (marginalia--align 10 marginalia-separator-width ;; modes
+12 marginalia-separator-width ;; user:group
+7 marginalia-separator-width ;; size
 12 ;; date
 20) ;; offset
+ (file-attribute-modes attributes)
+ (marginalia--separator)
+ (format "%12s" (format "%s:%s"
+(file-attribute-user-id attributes)
+(file-attribute-group-id attributes)))
+ (marginalia--separator)
  (propertize (format "%7s" (file-size-human-readable (file-attribute-size 
attributes)))
  'face 'marginalia-size)
  (marginalia--separator)



[elpa] externals/marginalia 59d65af 018/241: Add basic classifiers: orginal category, symbols, by words in prompt

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 59d65afcb4d8c898a6ddbf611103d6e74f14a782
Author: Omar Antolín 
Commit: Omar Antolín 

Add basic classifiers: orginal category, symbols, by words in prompt
---
 marginalia.el | 84 +++
 1 file changed, 50 insertions(+), 34 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index f7695a1..1770403 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -30,6 +30,7 @@
 ;;; Code:
 
 (require 'subr-x)
+(eval-when-compile (require 'cl-lib))
 
  Customization
 
@@ -74,7 +75,10 @@ Annotations are only shown if `marginalia-mode' is enabled."
   :group 'marginalia)
 
 (defcustom marginalia-classifiers
-  '(marginalia-classify-by-command-name)
+  '(marginalia-classify-by-command-name
+marginalia-classify-original-category
+marginalia-classify-by-prompt
+marginalia-classify-symbol)
   "List of functions to determine current completion category.
 Each function should take no arguments and return a symbol
 indicating the category, or nil to indicate it could not
@@ -82,31 +86,16 @@ determine it."
   :type 'hook
   :group 'marginalia)
 
-(defcustom marginalia-command-category-alist
-  '((execute-extended-command . command)
-(customize-face . face)
-(customize-face-other-window . face)
-(customize-group . customize-group)
-(customize-group-other-window . customize-group)
-(customize-option . variable)
-(customize-option-other-window . variable)
-(customize-set-variable . variable)
-(customize-variable . variable)
-(customize-variable-other-window . variable)
-(describe-function . symbol)
-(describe-variable . variable)
-(describe-face . face)
-(describe-symbol . symbol)
-(helpful-callable . symbol)
-(helpful-command . symbol)
-(helpful-function . symbol)
-(helpful-macro . symbol)
-(helpful-symbol . symbol)
-(helpful-variable . variable)
-(describe-package . package)
-(package-install . package)
-(package-delete . package)
-(package-reinstall . package))
+(defcustom marginalia-prompt-categories
+  '((group . customize-group) (M-x . command) package face variable)
+  "Words whose presence in a minibuffer prompt determins the category.
+The words should be given either as a symbol which if found in
+the prompt is the category name, or as a dotted pair of symbols,
+the presence of the first indicating the second is the category."
+  :type '(repeat (choice symbol (cons symbol symbol)))
+  :group 'marginalia)
+
+(defcustom marginalia-command-category-alist nil
   "Associate commands with a completion category."
   :type '(alist :key-type symbol :value-type symbol)
   :group 'marginalia)
@@ -124,6 +113,9 @@ determine it."
 (defvar marginalia--this-command nil
   "Last command symbol saved in order to allow annotations.")
 
+(defvar marginalia--original-category nil
+  "Original category reported by completion metadata.")
+
 (defun marginalia--truncate (str width)
   "Truncate string STR to WIDTH."
   (truncate-string-to-width (car (split-string str "\n")) width 0 32 "…"))
@@ -214,19 +206,47 @@ determine it."
   (and marginalia--this-command
(alist-get marginalia--this-command marginalia-command-category-alist)))
 
-(defun marginalia--completion-metadata-get (_metadata prop)
+(defun marginalia-classify-original-category ()
+  "Return original category reported by completion metadata."
+  marginalia--original-category)
+
+(defun marginalia-classify-symbol ()
+  "Determine if currently completing symbols."
+  (when-let ((mct minibuffer-completion-table))
+(when (or (eq mct 'help--symbol-completion-table)
+  (obarrayp mct)
+  (and (consp mct) (symbolp (car mct))) ; assume list of symbols
+  ;; imenu from an Emacs Lisp buffer produces symbols
+  (and (eq marginalia--this-command 'imenu)
+   (with-current-buffer
+   (window-buffer (minibuffer-selected-window))
+ (derived-mode-p 'emacs-lisp-mode
+  'symbol)))
+
+(defun marginalia-classify-by-prompt ()
+  "Determine category by a special word in prompt."
+  (when-let ((prompt (minibuffer-prompt)))
+(cl-loop for spec in marginalia-prompt-categories
+ for (word . category) = (if (consp spec) spec (cons spec spec))
+ when (string-match-p (format "\\<%s\\>" word) prompt)
+ return category)))
+
+(defun marginalia--completion-metadata-get (metadata prop)
   "Advice for `completion-metadata-get'.
 Replaces the category and annotation function.
-FUN is the original function.
 METADATA is the metadata.
 PROP is the property which is looked up."
   ;; TODO add more category classifiers from Embark
   (pcase prop
 ('annotation-function
- (when-let (cat (marginalia--category-type))
+ (when-let (cat (completion-metadata-get metadata 'category))
+   ;; we do want the advice triggered for completion-metadata-get
(alist

[elpa] externals/marginalia 80fa320 016/241: Introduce list of classifiers

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 80fa320fd14c741f6c8fb152cf0a9b4f0d0b1a7e
Author: Omar Antolín 
Commit: Omar Antolín 

Introduce list of classifiers

The new variable marginalia-classifiers will contain functions that
are run one after another to attempt to determine the category
metadatum. The existing logic for determining the category has been
moved into marginalia-classify-by-command-name.
---
 marginalia.el | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 7559307..0b6dd71 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -73,6 +73,15 @@ Annotations are only shown if `marginalia-mode' is enabled."
   :type '(alist :key-type symbol :value-type function)
   :group 'marginalia)
 
+(defcustom marginalia-classifiers
+  '(marginalia-classify-by-command-name)
+  "List of functions to determine current completion category.
+Each function should take no arguments and return a symbol
+indicating the category, or nil to indicate it could not
+determine it."
+  :type 'hook
+  :group 'marginalia)
+
 (defcustom marginalia-command-category-alist
   '((execute-extended-command . command)
 (customize-face . face)
@@ -207,6 +216,11 @@ Annotations are only shown if `marginalia-mode' is 
enabled."
   (mapcar (lambda (cand) (concat cand (funcall annotate cand))) candidates)
 candidates))
 
+(defun marginalia-classify-by-command-name ()
+  "Lookup category for current command."
+  (and marginalia--this-command
+   (alist-get marginalia--this-command marginalia-command-category-alist)))
+
 (defun marginalia--completion-metadata-get (_metadata prop)
   "Advice for `completion-metadata-get'.
 Replaces the category and annotation function.
@@ -219,8 +233,7 @@ PROP is the property which is looked up."
  (when-let (cat (marginalia--category-type))
(alist-get cat marginalia-annotator-alist)))
 ('category
- (and marginalia--this-command
-  (alist-get marginalia--this-command 
marginalia-command-category-alist)
+ (run-hook-with-args-until-success 'marginalia-classifiers
 
 (defun marginalia--minibuffer-setup ()
   "Setup minibuffer for `marginalia-mode'.



[elpa] externals/marginalia 1c8ef02 020/241: Remove unused marginalia--metadata function

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 1c8ef02fee972cfbc014d554b1a6af4644c3afed
Author: Omar Antolín 
Commit: Omar Antolín 

Remove unused marginalia--metadata function
---
 marginalia.el | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 53be877..68111b5 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -255,13 +255,6 @@ PROP is the property which is looked up."
 Remember `this-command' for annotation."
   (setq-local marginalia--this-command this-command))
 
-(defun marginalia--metadata ()
-  "Return current minibuffer completion metadata."
-  (completion-metadata
-   (buffer-substring-no-properties (field-beginning) (point))
-   minibuffer-completion-table
-   minibuffer-completion-predicate))
-
 ;;;###autoload
 (define-minor-mode marginalia-mode
   "Annotate completion candidates with richer information."



[elpa] externals/marginalia 57b1176 051/241: marginalia-annotate-command-binding: only store the binding in the hash table

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 57b117681e65194afb9b0dc0594e40e281a81326
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-command-binding: only store the binding in the hash 
table

No need to cache anything else, the slowness is purely due to 
where-is-internal.
---
 marginalia.el | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 78f4007..c0f4b37 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -226,11 +226,9 @@ determine it."
   (cl-do-all-symbols (sym)
 (when (commandp sym)
   (when-let (key (where-is-internal sym nil t))
-(puthash sym
- (propertize (format " (%s)" (key-description key))
- 'face 'marginalia-key)
- marginalia-annotate-command-binding--hash)
-(gethash (intern cand) marginalia-annotate-command-binding--hash)))
+(puthash sym key marginalia-annotate-command-binding--hash)
+(when-let (binding (gethash (intern cand) 
marginalia-annotate-command-binding--hash))
+  (propertize (format " (%s)" (key-description binding)) 'face 
'marginalia-key
 
 (defun marginalia-annotate-command-full (cand)
   "Annotate command CAND with the keybinding and its documentation string."



[elpa] externals/marginalia 0cb98a0 023/241: Remove default value from prompt before matching

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 0cb98a0ee22a4d0d614fadbd21555b1a0b1e2350
Author: Omar Antolín 
Commit: Omar Antolín 

Remove default value from prompt before matching
---
 marginalia.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index cb88f6e..a977b4c 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -229,6 +229,8 @@ determine it."
 This runs through the `marginalia-prompt-categories' alist
 looking for a regexp that matches the prompt."
   (when-let ((prompt (minibuffer-prompt)))
+(setq prompt
+  (replace-regexp-in-string "(.*default.*)\\|\\[.*\\]" "" prompt))
 (cl-loop for (regexp . category) in marginalia-prompt-categories
  when (string-match-p regexp prompt)
  return category)))



[elpa] externals/marginalia 655f03b 035/241: introduce marginalia-annotators-(light|heavy), remove marginalia-set-command-annotator

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 655f03b0223dcadc30d7a0d9b573239bac22036e
Author: Daniel Mendler 
Commit: Daniel Mendler 

introduce marginalia-annotators-(light|heavy), remove 
marginalia-set-command-annotator
---
 marginalia.el | 36 +++-
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 98b38de..de4ec8d 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -95,6 +95,15 @@
   :group 'marginalia)
 
 (defcustom marginalia-annotators
+  'marginalia-annotators-light
+  "Associate categories with annotators for minibuffer completion.
+Each annotation function must return a string,
+which is appended to the completion candidate.
+Annotations are only shown if `marginalia-mode' is enabled."
+  :type 'symbol
+  :group 'marginalia)
+
+(defvar marginalia-annotators-light
   '((command . marginalia-annotate-command-binding)
 (customize-group . marginalia-annotate-customize-group)
 (variable . marginalia-annotate-variable)
@@ -102,12 +111,15 @@
 (symbol . marginalia-annotate-symbol)
 (variable . marginalia-annotate-variable)
 (package . marginalia-annotate-package))
-  "Associate categories with annotators for minibuffer completion.
-Each annotation function must return a string,
-which is appended to the completion candidate.
-Annotations are only shown if `marginalia-mode' is enabled."
-  :type '(alist :key-type symbol :value-type function)
-  :group 'marginalia)
+  "Lightweight annotator functions.")
+
+(defvar marginalia-annotators-heavy
+  (append
+   '((file . marginalia-annotate-file)
+ (buffer . marginalia-annotate-buffer)
+ (command . marginalia-annotate-command-full))
+   marginalia-annotators-light)
+  "Heavy annotator functions.")
 
 (defcustom marginalia-classifiers
   '(marginalia-classify-by-command-name
@@ -348,7 +360,7 @@ PROP is the property which is looked up."
 ('annotation-function
  (when-let (cat (completion-metadata-get metadata 'category))
;; we do want the advice triggered for completion-metadata-get
-   (alist-get cat marginalia-annotators)))
+   (alist-get cat (symbol-value marginalia-annotators
 ('category
  (let ((marginalia--original-category (alist-get 'category metadata)))
;; using alist-get in the line above bypasses any advice on
@@ -377,15 +389,5 @@ Remember `this-command' for annotation."
 ;; Replace the metadata function.
 (advice-add #'completion-metadata-get :before-until 
#'marginalia--completion-metadata-get)))
 
-;;;###autoload
-(defun marginalia-set-command-annotator (cmd ann)
-  "Configure marginalia so that annotator ANN is used for command CMD."
-  (setq marginalia-command-categories
-(cons (cons cmd cmd)
-  (assq-delete-all cmd marginalia-command-categories)))
-  (setq marginalia-annotators
-(cons (cons cmd ann)
-  (assq-delete-all cmd marginalia-annotators
-
 (provide 'marginalia)
 ;;; marginalia.el ends here



[elpa] externals/marginalia 69ec4d7 017/241: Remove unused function

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 69ec4d7257cfae9f449ac58653e1884ffb09c46d
Author: Omar Antolín 
Commit: Omar Antolín 

Remove unused function

This is probably a (renamed) remnant from consult
---
 marginalia.el | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 0b6dd71..f7695a1 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -209,13 +209,6 @@ determine it."
   (when-let (doc (documentation-property (intern cand) 'group-documentation))
 (marginalia--annotation doc)))
 
-(defun marginalia--annotate-candidates (candidates)
-  "Annotate CANDIDATES with richer information."
-  (if-let* ((cat (marginalia--category-type))
-(annotate (alist-get cat marginalia-annotator-alist)))
-  (mapcar (lambda (cand) (concat cand (funcall annotate cand))) candidates)
-candidates))
-
 (defun marginalia-classify-by-command-name ()
   "Lookup category for current command."
   (and marginalia--this-command



[elpa] externals/marginalia 2f849d8 013/241: Simplify marginalia--completion-metadata-get

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 2f849d8ff80907c26c82e8584a3e283172d62bac
Author: Omar Antolín 
Commit: Omar Antolín 

Simplify marginalia--completion-metadata-get

The new simpler function is :before-until advice (the previous
function was :around advice).
---
 marginalia.el | 15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 8cea9cf..f7963bb 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -207,7 +207,7 @@ Annotations are only shown if `marginalia-mode' is enabled."
   (mapcar (lambda (cand) (concat cand (funcall annotate cand))) candidates)
 candidates))
 
-(defun marginalia--completion-metadata-get (fun metadata prop)
+(defun marginalia--completion-metadata-get (metadata prop)
   "Advice for `completion-metadata-get'.
 Replaces the category and annotation function.
 FUN is the original function.
@@ -216,14 +216,11 @@ PROP is the property which is looked up."
   ;; TODO add more category classifiers from Embark
   (pcase prop
 ('annotation-function
- (or (when-let (cat (marginalia--category-type))
-   (alist-get cat marginalia-annotate-alist))
- (funcall fun metadata prop)))
+ (when-let (cat (marginalia--category-type))
+   (alist-get cat marginalia-annotate-alist)))
 ('category
- (or (and marginalia--this-command
-  (alist-get marginalia--this-command 
marginalia-command-category-alist))
- (funcall fun metadata prop)))
-(_ (funcall fun metadata prop
+ (and marginalia--this-command
+  (alist-get marginalia--this-command 
marginalia-command-category-alist)
 
 (defun marginalia--minibuffer-setup ()
   "Setup minibuffer for `marginalia-mode'.
@@ -256,7 +253,7 @@ Remember `this-command' for annotation."
 (add-hook 'minibuffer-setup-hook #'marginalia--minibuffer-setup)
 
 ;; Replace the metadata function.
-(advice-add #'completion-metadata-get :around 
#'marginalia--completion-metadata-get)))
+(advice-add #'completion-metadata-get :before-until 
#'marginalia--completion-metadata-get)))
 
 ;;;###autoload
 (defun marginalia-set-command-annotation (cmd ann)



[elpa] externals/marginalia 472b47a 041/241: add comment to marginalia-toggle-annotators

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 472b47a7624edbb67fda6372a61769b8b5424708
Author: Daniel Mendler 
Commit: Daniel Mendler 

add comment to marginalia-toggle-annotators
---
 marginalia.el | 5 +
 1 file changed, 5 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index f1900a4..675f19a 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -411,6 +411,11 @@ Remember `this-command' for annotation."
 ;; Replace the metadata function.
 (advice-add #'completion-metadata-get :before-until 
#'marginalia--completion-metadata-get)))
 
+;; If you want to toggle between annotators while being in the minibuffer, the 
completion-system
+;; should refresh the candidate list. Currently there is no support for this 
in marginalia, but it
+;; is possible to advice the `marginalia-toggle-annotators' function with the 
necessary refreshing
+;; logic. See the discussion in https://github.com/minad/marginalia/issues/10 
for reference.
+;;;###autoload
 (defun marginalia-toggle-annotators ()
   "Toggle between annotators in `marginalia-annotators'."
   (interactive)



[elpa] externals/marginalia b6d2e22 037/241: fix typo

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit b6d2e22807ea0388754b70fee9765d4d9ab1dea6
Author: Daniel Mendler 
Commit: Daniel Mendler 

fix typo
---
 marginalia.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index ec95406..2ca6f56 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -98,8 +98,8 @@
   'marginalia-annotators-light
   "Choose an annotator association list for minibuffer completion.
 Annotations are only shown if `marginalia-mode' is enabled."
-  :type '(choice (const :tag "Light" marginalia-annotator-light)
- (const :tag "Heavy" marginalia-annotator-heavy)
+  :type '(choice (const :tag "Light" marginalia-annotators-light)
+ (const :tag "Heavy" marginalia-annotators-heavy)
  (symbol :tag "Other"))
   :group 'marginalia)
 



[elpa] externals/marginalia ca21d30 029/241: fix typo in the readme

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit ca21d30bf03924c63129a0caee14e051d2b70cdc
Author: Daniel Mendler 
Commit: Daniel Mendler 

fix typo in the readme
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index bb18692..71aad71 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ specified by the variable `marginalia-classifiers`.
 ;; Enable richer annotations using the Marginalia package
 (use-package marginalia
   ;; The :init configuration is always executed (Not lazy!)
-  :init t
+  :init
 
   ;; Must be in the :init section of use-package such that the mode gets
   ;; enabled right away. Note that this forces loading the package.



[elpa] externals/marginalia c97911b 021/241: All classifiers from Embark have been imported, remove TODO

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit c97911bb38dc2ce19c1b36f72125e6c478e6c1be
Author: Omar Antolín 
Commit: Omar Antolín 

All classifiers from Embark have been imported, remove TODO
---
 marginalia.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 68111b5..0c1eabf 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -238,7 +238,6 @@ looking for a regexp that matches the prompt."
 Replaces the category and annotation function.
 METADATA is the metadata.
 PROP is the property which is looked up."
-  ;; TODO add more category classifiers from Embark
   (pcase prop
 ('annotation-function
  (when-let (cat (completion-metadata-get metadata 'category))



[elpa] externals/marginalia 85a2693 053/241: marginalia-annotate-package: show package archive

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 85a26934249863f48e8b203145aa27f9079a9af6
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-package: show package archive
---
 marginalia.el | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 98a8621..db9e6be 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -64,6 +64,11 @@
   "Face used to highlight dates in `marginalia-mode'."
   :group 'marginalia)
 
+(defface marginalia-archive
+  '((t :inherit marginalia-key))
+  "Face used to highlight package archives in `marginalia-mode'."
+  :group 'marginalia)
+
 (defface marginalia-size
   '((t :inherit font-lock-constant-face :weight normal))
   "Face used to highlight sizes in `marginalia-mode'."
@@ -285,7 +290,15 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 (if-let (built-in (assq pkg package--builtins))
 (package--from-builtin built-in)
   (car (alist-get pkg package-archive-contents))
-(marginalia--documentation (package-desc-summary desc
+(concat
+ (marginalia--align 8 ;; archive
+marginalia-separator-width
+marginalia-documentation-width)
+ (propertize (format "%-8s" (package-desc-archive desc))
+ 'face 'marginalia-archive)
+ (marginalia--separator)
+ (propertize (package-desc-summary desc)
+ 'face 'marginalia-documentation
 
 (defun marginalia-annotate-customize-group (cand)
   "Annotate customization group CAND with its documentation string."



[elpa] externals/marginalia 4ba9804 031/241: Fix bug: file annotations were only shown for current directory

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 4ba98045dd33bcf1396a888dbbae2dc801dce7c5
Author: Omar Antolín Camarena 
Commit: Omar Antolín Camarena 

Fix bug: file annotations were only shown for current directory

The file annotations where only being displayed for files in the
current directory. This was because the candidates in file completion
are not the full path, but rather just the last path component.
The function file-attributes wants either a full path or a path
relative to the current directory.

To fix this bug I added a general function to calculate the "full
candidate", i.e, what the minibuffer contents would be if a given
candidate is chosen. For most types of completion, the completion
candidates are already full candidates. The main exception is file
name completion, where the candidates are one path component of the
full candidate, which is a full path. (There are other exceptions,
such as environment variable name completion inside file name
completion.)
---
 marginalia.el | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 9ae5354..862867a 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -262,9 +262,29 @@ determine it."
 "")
   marginalia-file-name-width
 
+(defun marginalia--full-candidate (cand)
+  "Return completion candidate CAND in full.
+For some completion tables, the completion candidates offered are
+meant to be only a part of the full minibuffer contents. For
+example, during file name completion the candidates are one path
+component of a full file path.
+
+This function returns what would be the minibuffer contents after
+using `minibuffer-force-complete' on the candidate CAND."
+  (let* ((contents (minibuffer-contents))
+ (pt (- (point) (minibuffer-prompt-end)))
+ (bounds (completion-boundaries
+  (substring contents 0 pt)
+  minibuffer-completion-table
+  minibuffer-completion-predicate
+  (substring contents pt
+(concat (substring contents 0 (car bounds))
+cand
+(substring contents (+ pt (cdr bounds))
+
 (defun marginalia-annotate-file (cand)
   "Annotate file CAND with its size and modification time."
-  (when-let (attributes (file-attributes cand))
+  (when-let ((attributes (file-attributes (marginalia--full-candidate cand
 (concat
  (marginalia--align 7 ;; size
 marginalia-separator-width



[elpa] externals/marginalia 2f1bb7c 064/241: do not overwrite the face weights as per recommendation by @purcell

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 2f1bb7c7cb205ce10a04751b0f8f2d8d5929fcd7
Author: Daniel Mendler 
Commit: Daniel Mendler 

do not overwrite the face weights as per recommendation by @purcell

see https://github.com/melpa/melpa/pull/7274
---
 marginalia.el | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 69929c6..763ed12 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -40,12 +40,12 @@
   :prefix "marginalia-")
 
 (defface marginalia-key
-  '((t :inherit font-lock-keyword-face :weight normal))
+  '((t :inherit font-lock-keyword-face))
   "Face used to highlight keys in `marginalia-mode'."
   :group 'marginalia)
 
 (defface marginalia-documentation
-  '((t :inherit completions-annotations :weight normal))
+  '((t :inherit completions-annotations))
   "Face used to highlight documentation string in `marginalia-mode'."
   :group 'marginalia)
 
@@ -75,22 +75,22 @@
   :group 'marginalia)
 
 (defface marginalia-size
-  '((t :inherit font-lock-constant-face :weight normal))
+  '((t :inherit font-lock-constant-face))
   "Face used to highlight sizes in `marginalia-mode'."
   :group 'marginalia)
 
 (defface marginalia-file-name
-  '((t :inherit marginalia-documentation :slant normal))
+  '((t :inherit marginalia-documentation))
   "Face used to highlight file names in `marginalia-mode'."
   :group 'marginalia)
 
 (defface marginalia-file-modes
-  '((t :inherit font-lock-string-face :weight normal))
+  '((t :inherit font-lock-string-face))
   "Face used to highlight file modes in `marginalia-mode'."
   :group 'marginalia)
 
 (defface marginalia-file-owner
-  '((t :inherit font-lock-preprocessor-face :weight normal))
+  '((t :inherit font-lock-preprocessor-face))
   "Face used to highlight file owners in `marginalia-mode'."
   :group 'marginalia)
 



[elpa] externals/marginalia c574a26 054/241: more colors!

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit c574a26f4a35cd5b0d60b9668b99f79e1b0121a1
Author: Daniel Mendler 
Commit: Daniel Mendler 

more colors!
---
 marginalia.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index db9e6be..65c8552 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -75,17 +75,17 @@
   :group 'marginalia)
 
 (defface marginalia-file-name
-  '((t :inherit marginalia-documentation))
+  '((t :inherit marginalia-documentation :slant normal))
   "Face used to highlight file names in `marginalia-mode'."
   :group 'marginalia)
 
 (defface marginalia-file-modes
-  '((t :inherit marginalia-documentation))
+  '((t :inherit font-lock-string-face :weight normal))
   "Face used to highlight file modes in `marginalia-mode'."
   :group 'marginalia)
 
 (defface marginalia-file-owner
-  '((t :inherit marginalia-documentation))
+  '((t :inherit font-lock-preprocessor-face :weight normal))
   "Face used to highlight file owners in `marginalia-mode'."
   :group 'marginalia)
 



[elpa] externals/marginalia 0f1e763 025/241: rename some variables for consistency, update readme

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 0f1e763b0621c45ddfbdfebab3e05cb9eb5f23ae
Author: Daniel Mendler 
Commit: Daniel Mendler 

rename some variables for consistency, update readme
---
 README.md | 17 -
 marginalia.el | 16 
 2 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/README.md b/README.md
index ff58798..bb18692 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,23 @@
 # marginalia.el - Marginalia in the minibuffer
 
+![marginalia-mode with 
Selectrum](https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true)
+
 This package provides `marginalia-mode` which adds marginalia to the minibuffer
 completions. [Marginalia](https://en.wikipedia.org/wiki/Marginalia) are marks 
or
 annotations placed at the margin of the page of a book or in this case helpful
 colorful annotations placed at the margin of the minibuffer for your completion
 candidates. The annotations are added based on the completion category. For
 example `find-file` reports the `file` category and `M-x` reports the `command`
-category. Furthermore the package allows to associate completion categories to
-commands, since many commands (in contrast to `find-file` and `M-x`) do not
-specify a completion category themselves.
+category.
 
-![marginalia-mode with 
Selectrum](https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true)
+Since many commands do not report a completion category themselves, Marginalia
+provides a classifier system, which tries to guess the correct category based
+for example on the prompt (see the variable `marginalia-prompt-categories`).
+Usually these heuristic classifiers work well, but if they do not there is
+always the possibility to overwrite categories by command name. This way you 
can
+associate a fixed category with the completion initiated by the command (see 
the
+variable `marginalia-command-categories`). The list of available classifiers is
+specified by the variable `marginalia-classifiers`.
 
 ## Configuration
 
@@ -29,6 +36,6 @@ specify a completion category themselves.
   ;; * marginalia-annotate-symbol: Annotate with the documentation string
   ;; * marginalia-annotate-command-binding (default): Annotate only with the 
keybinding
   ;; * marginalia-annotate-command-full: Annotate with the keybinding and the 
documentation string
-  ;; (setf (alist-get 'command marginalia-annotator-alist) 
#'marginalia-annotate-command-full)
+  ;; (setf (alist-get 'command marginalia-annotators) 
#'marginalia-annotate-command-full)
 )
 ~~~
diff --git a/marginalia.el b/marginalia.el
index 47ced57..52aa5bf 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -59,7 +59,7 @@
   :type 'integer
   :group 'marginalia)
 
-(defcustom marginalia-annotator-alist
+(defcustom marginalia-annotators
   '((command . marginalia-annotate-command-binding)
 (customize-group . marginalia-annotate-customize-group)
 (variable . marginalia-annotate-variable)
@@ -96,7 +96,7 @@ determine it."
   :type '(alist :key-type regexp :value-type symbol)
   :group 'marginalia)
 
-(defcustom marginalia-command-category-alist nil
+(defcustom marginalia-command-categories nil
   "Associate commands with a completion category."
   :type '(alist :key-type symbol :value-type symbol)
   :group 'marginalia)
@@ -226,7 +226,7 @@ determine it."
 (defun marginalia-classify-by-command-name ()
   "Lookup category for current command."
   (and marginalia--this-command
-   (alist-get marginalia--this-command marginalia-command-category-alist)))
+   (alist-get marginalia--this-command marginalia-command-categories)))
 
 (defun marginalia-classify-original-category ()
   "Return original category reported by completion metadata."
@@ -264,7 +264,7 @@ PROP is the property which is looked up."
 ('annotation-function
  (when-let (cat (completion-metadata-get metadata 'category))
;; we do want the advice triggered for completion-metadata-get
-   (alist-get cat marginalia-annotator-alist)))
+   (alist-get cat marginalia-annotators)))
 ('category
  (let ((marginalia--original-category (alist-get 'category metadata)))
;; using alist-get in the line above bypasses any advice on
@@ -296,12 +296,12 @@ Remember `this-command' for annotation."
 ;;;###autoload
 (defun marginalia-set-command-annotator (cmd ann)
   "Configure marginalia so that annotator ANN is used for command CMD."
-  (setq marginalia-command-category-alist
+  (setq marginalia-command-categories
 (cons (cons cmd cmd)
-  (assq-delete-all cmd marginalia-command-category-alist)))
-  (setq marginalia-command-category-alist
+  (assq-delete-all cmd marginalia-command-categories)))
+  (setq marginalia-command-categories
 (cons (cons cmd ann)
-  (assq-delete-all cmd marginalia-annotator-alist
+  (assq-delete-all cmd marginalia-annotators
 
 (provide 'marginalia)
 ;;; marginalia.el ends here



[elpa] externals/marginalia 0bd8061 077/241: marginalia--fields: allow alignment to the right by using a negative width

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 0bd8061a44e9b100519123efcbd32030526c33a1
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia--fields: allow alignment to the right by using a negative width
---
 marginalia.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 4dabb30..1f323e1 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -253,7 +253,7 @@ FORMAT is a format string. This must be used if the field 
value is not a string.
 FACE is the name of the face, with which the field should be propertized.
 WIDTH is the format width. This can be specified as alternative to FORMAT."
   (cl-assert (not (and width format)))
-  (when width (setq format (format "%%-%ds" width)))
+  (when width (setq format (format "%%%ds" (- width
   (when format (setq field `(format ,format ,field)))
   (when truncate (setq field `(marginalia--truncate ,field ,truncate)))
   (when face (setq field `(propertize ,field 'face ,face)))



[elpa] externals/marginalia 17d539c 059/241: whitespace and comment adjustments

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 17d539cdb14e26698f91d0246a5836d3589240f6
Author: Daniel Mendler 
Commit: Daniel Mendler 

whitespace and comment adjustments
---
 marginalia.el | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 7c7c42b..49afb04 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -319,7 +319,6 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
(if (buffer-modified-p buffer) "*" " ")
(if (buffer-local-value 'buffer-read-only buffer) "%" " ")))
  ((buffer-local-value 'major-mode buffer) :width 30 :face 'marginalia-mode)
-
  ((if-let (file (buffer-file-name buffer))
   (abbreviate-file-name file) "")
   :truncate marginalia-file-name-width
@@ -407,13 +406,13 @@ METADATA is the metadata.
 PROP is the property which is looked up."
   (pcase prop
 ('annotation-function
+ ;; we do want the advice triggered for completion-metadata-get
  (when-let (cat (completion-metadata-get metadata 'category))
-   ;; we do want the advice triggered for completion-metadata-get
(alist-get cat (symbol-value (car marginalia-annotators)
 ('category
+ ;; using alist-get bypasses any advice on completion-metadata-get
+ ;; to avoid infinite recursion
  (let ((marginalia--original-category (alist-get 'category metadata)))
-   ;; using alist-get in the line above bypasses any advice on
-   ;; completion-metadata-get to avoid infinite recursion
(run-hook-with-args-until-success 'marginalia-classifiers)
 
 (defun marginalia--minibuffer-setup ()



[elpa] externals/marginalia 7d3719d 074/241: Fix advice skipping regexp for older Emacsen

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 7d3719d629647ee17cb72b785d6269ac4b9abc04
Author: Omar Antolín 
Commit: Omar Antolín 

Fix advice skipping regexp for older Emacsen

This is to fix my fix for issue #19
---
 marginalia.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index f83e3de..2020a3d 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -300,7 +300,7 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
(when-let ((doc (ignore-errors (documentation sym
  (replace-regexp-in-string
   (rx bos
-  (1+ (seq "This function has "
+  (1+ (seq (? "This function has ")
(or ":before" ":after" ":around" ":override" 
":before-while" ":before-until" ":after-while"  
":after-until" ":filter-args" ":filter-return")



[elpa] externals/marginalia 7fe8f71 027/241: improve buffer annotation formatting

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 7fe8f71f5270b8b45f29fdc3b33fadfe00fb4cc3
Author: Daniel Mendler 
Commit: Daniel Mendler 

improve buffer annotation formatting
---
 marginalia.el | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index e0501af..8549ba6 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -244,17 +244,15 @@ determine it."
   "Annotate buffer CAND with modification status, file name and major mode."
   (when-let (buffer (get-buffer cand))
 (concat
- (marginalia--align 30
-marginalia-separator-width
-1
+ (marginalia--align 2 ;; modification
+30 ;; mode
 marginalia-separator-width
 marginalia-file-name-width)
+ (if (buffer-modified-p buffer) "* " "  ")
  (propertize
-  (format "%30s" (buffer-local-value 'major-mode buffer))
+  (format "%-30s" (buffer-local-value 'major-mode buffer))
   'face 'marginalia-mode)
  (marginalia--separator)
- (if (buffer-modified-p buffer) "*" " ")
- (marginalia--separator)
  (marginalia--truncate
   (if-let (file (buffer-file-name buffer))
   (propertize (abbreviate-file-name file)



[elpa] externals/marginalia cd95c65 028/241: buffer annotation: add read-only status

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit cd95c652f237597a2cd297101ddd6d9b7aecc809
Author: Daniel Mendler 
Commit: Daniel Mendler 

buffer annotation: add read-only status
---
 marginalia.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 8549ba6..9ae5354 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -248,7 +248,9 @@ determine it."
 30 ;; mode
 marginalia-separator-width
 marginalia-file-name-width)
- (if (buffer-modified-p buffer) "* " "  ")
+ (if (buffer-modified-p buffer) "*" " ")
+ (if (buffer-local-value 'buffer-read-only buffer) "%" " ")
+ " "
  (propertize
   (format "%-30s" (buffer-local-value 'major-mode buffer))
   'face 'marginalia-mode)



[elpa] externals/marginalia 9f1b63b 086/241: add symbol class characters from Emacs 28

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 9f1b63b96b421974f5fad4df206338d8c916f3c4
Author: Daniel Mendler 
Commit: Daniel Mendler 

add symbol class characters from Emacs 28
---
 marginalia.el | 73 ++-
 1 file changed, 52 insertions(+), 21 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 8347565..8386480 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -329,24 +329,58 @@ This hash table is needed to speed up 
`marginalia-annotate-command'.")
   "\n")
   "Regexp to match lines about advice in function documentation strings.")
 
+;; Taken from advice--make-docstring, is this robust?
+(defun marginalia--advised (fun)
+  "Return t if function FUN is advised."
+  (let ((flist (indirect-function fun)))
+(advice--p (if (eq 'macro (car-safe flist)) (cdr flist) flist
+
+;; Symbol class characters from Emacs 28 
`help--symbol-completion-table-affixation'
+;; ! and * are our additions
+(defun marginalia--symbol-class (s)
+  "Return symbol class characters for symbol S.
+f function
+c command
+! advised
+m macro
+u custom
+v variable
+* modified
+a face"
+  (format
+   "%-6s"
+   (concat
+(when (fboundp s)
+  (concat
+   (cond
+((commandp s) "c")
+((eq (car-safe (symbol-function s)) 'macro) "m")
+(t "f"))
+   (when (marginalia--advised s) "!")))
+(when (boundp s)
+  (concat
+   (if (custom-variable-p s) "u" "v")
+   (when (and (boundp s) (not (equal (symbol-value s) (default-value s 
"*")))
+(when (facep s) "a")
+(when (and (fboundp 'cl-find-class) (cl-find-class s)) "t"
+
+(defun marginalia--function-doc (sym)
+  "Documentation string of function SYM."
+  (when-let (doc (ignore-errors (documentation sym)))
+(replace-regexp-in-string marginalia--advice-regexp "" doc)))
+
 (defun marginalia-annotate-symbol (cand)
   "Annotate symbol CAND with its documentation string."
   (when-let (sym (intern-soft cand))
-(let ((doc (or (cond
-((fboundp sym) (ignore-errors (documentation sym)))
-((facep sym) (documentation-property sym 
'face-documentation))
-(t (documentation-property sym 'variable-documentation)))
-   "")))
-  (concat
-   (marginalia-annotate-command cand)
-   (marginalia--fields
-((if (and (fboundp sym) (string-match-p marginalia--advice-regexp doc))
- "*" " ")
- :face 'marginalia-modified)
-((if (fboundp sym)
- (replace-regexp-in-string marginalia--advice-regexp "" doc)
-   doc)
- :truncate marginalia-truncate-width :face 
'marginalia-documentation))
+(concat
+ (marginalia-annotate-command cand)
+ (marginalia--fields
+  ((marginalia--symbol-class sym) :face 'marginalia-modified)
+  ((cond
+((fboundp sym) (marginalia--function-doc sym))
+((facep sym) (documentation-property sym 'face-documentation))
+(t (documentation-property sym 'variable-documentation)))
+   :truncate marginalia-truncate-width :face 'marginalia-documentation)
 
 (defun marginalia-annotate-imenu (cand)
   "Annotate imenu CAND with its documentation string."
@@ -359,9 +393,7 @@ This hash table is needed to speed up 
`marginalia-annotate-command'.")
   "Annotate variable CAND with its documentation string."
   (when-let (sym (intern-soft cand))
 (marginalia--fields
- ((if (and (boundp sym) (not (equal (symbol-value sym) (default-value 
sym
-  "*" " ")
-  :face 'marginalia-modified)
+ ((marginalia--symbol-class sym) :face 'marginalia-modified)
  ((if (boundp sym) (symbol-value sym) 'unbound)
   :truncate (/ marginalia-truncate-width 3) :format "%S" :face 
'marginalia-variable)
  ((documentation-property sym 'variable-documentation)
@@ -397,9 +429,8 @@ This hash table is needed to speed up 
`marginalia-annotate-command'.")
(propertize "On" 'face 'marginalia-on)
  (propertize "Off" 'face 'marginalia-off)) :width 3)
   (lighter-str :width 14 :face 'marginalia-lighter)
-  ((ignore-errors (documentation mode))
-   :truncate marginalia-truncate-width
-   :face 'marginalia-documentation)
+  ((marginalia--function-doc mode)
+   :truncate marginalia-truncate-width :face 'marginalia-documentation)
 
 (defun marginalia-annotate-package (cand)
   "Annotate package CAND with its description summary."



[elpa] externals/marginalia 3559cbb 095/241: update readme

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 3559cbb0e0cfedd5757ee76cf285bdb66fdc4aed
Author: Daniel Mendler 
Commit: Daniel Mendler 

update readme
---
 README.md | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 73a50d3..5178dd0 100644
--- a/README.md
+++ b/README.md
@@ -6,10 +6,13 @@ This package provides `marginalia-mode` which adds marginalia 
to the minibuffer
 completions. [Marginalia](https://en.wikipedia.org/wiki/Marginalia) are marks 
or
 annotations placed at the margin of the page of a book or in this case helpful
 colorful annotations placed at the margin of the minibuffer for your completion
-candidates. The annotations are added based on the completion category. For
-example `find-file` reports the `file` category and `M-x` reports the `command`
-category. You can choose between more or less detailed annotators, by
-setting the variable `marginalia-annotators`.
+candidates.
+
+The annotations are added based on the completion category. For example
+`find-file` reports the `file` category and `M-x` reports the `command`
+category. You can choose between more or less detailed annotators, by setting
+the variable `marginalia-annotators` or by invoking the command
+`marginalia-cycle-annotators`.
 
 Since many commands do not report a completion category themselves, Marginalia
 provides a classifier system, which tries to guess the correct category based



[elpa] externals/marginalia 5373a26 076/241: add marginalia-modified face

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 5373a2613c3fdee430b19df247617a8474d53b2e
Author: Daniel Mendler 
Commit: Daniel Mendler 

add marginalia-modified face
---
 marginalia.el | 33 -
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index b6d795d..4dabb30 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -99,6 +99,11 @@
   "Face used to highlight sizes in `marginalia-mode'."
   :group 'marginalia)
 
+(defface marginalia-modified
+  '((t :inherit font-lock-negation-char-face))
+  "Face used to highlight modification indicators in `marginalia-mode'."
+  :group 'marginalia)
+
 (defface marginalia-file-name
   '((t :inherit marginalia-documentation))
   "Face used to highlight file names in `marginalia-mode'."
@@ -303,18 +308,19 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 
 (defun marginalia-annotate-symbol (cand)
   "Annotate symbol CAND with its documentation string."
-  (when-let ((sym (intern-soft cand)))
-(marginalia--documentation
- (cond
-  ((fboundp sym)
-   (when-let ((doc (ignore-errors (documentation sym
- (if (string-match-p marginalia--advice-regexp doc)
- (concat "*"
- (replace-regexp-in-string
-  marginalia--advice-regexp "" doc))
-   (concat " " doc
-  ((facep sym) (documentation-property sym 'face-documentation))
-  (t (documentation-property sym 'variable-documentation))
+  (when-let* ((sym (intern-soft cand))
+  (doc (cond
+((fboundp sym) (ignore-errors (documentation sym)))
+((facep sym) (documentation-property sym 
'face-documentation))
+(t (documentation-property sym 'variable-documentation)
+(marginalia--fields
+ ((if (and (fboundp sym) (string-match-p marginalia--advice-regexp doc))
+  "*" " ")
+  :face 'marginalia-modified)
+ ((if (fboundp sym)
+  (replace-regexp-in-string marginalia--advice-regexp "" doc)
+doc)
+  :truncate marginalia-truncate-width :face 'marginalia-documentation
 
 (defun marginalia-annotate-variable (cand)
   "Annotate variable CAND with its documentation string."
@@ -391,7 +397,8 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 (marginalia--fields
  ((concat
(if (buffer-modified-p buffer) "*" " ")
-   (if (buffer-local-value 'buffer-read-only buffer) "%" " ")))
+   (if (buffer-local-value 'buffer-read-only buffer) "%" " "))
+  :face 'marginalia-modified)
  ((buffer-local-value 'major-mode buffer) :width 30 :face 'marginalia-mode)
  ((if-let (file (buffer-file-name buffer))
   (abbreviate-file-name file) "")



[elpa] externals/marginalia 6cd9768 098/241: minor optimization to marginalia--function-doc

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 6cd9768252574c9d3e3bc4e53dc5ba4c92678ab7
Author: Daniel Mendler 
Commit: Daniel Mendler 

minor optimization to marginalia--function-doc
---
 marginalia.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 2bff8cc..f1e0e4e 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -353,8 +353,11 @@ a face"
 
 (defun marginalia--function-doc (sym)
   "Documentation string of function SYM."
-  (when-let (doc (ignore-errors (documentation sym)))
-(replace-regexp-in-string marginalia--advice-regexp "" doc)))
+  (when-let (str (ignore-errors (documentation sym)))
+(save-match-data
+  (if (string-match marginalia--advice-regexp str)
+  (substring str (match-end 0))
+str
 
 (defun marginalia-annotate-symbol (cand)
   "Annotate symbol CAND with its documentation string."



[elpa] externals/marginalia 618fd9e 084/241: Improve formatting of environment variable annotation

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 618fd9e5349ea8545e1c4799b2944b33104f345d
Author: Omar Antolín 
Commit: Omar Antolín 

Improve formatting of environment variable annotation
---
 marginalia.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 1479fce..7f819ad 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -150,7 +150,7 @@ only with the annotations that come with Emacs) without 
disabling
 (minor-mode . marginalia-annotate-minor-mode)
 (symbol . marginalia-annotate-symbol)
 (variable . marginalia-annotate-variable)
-(environment-variable . getenv)
+(environment-variable . marginalia-annotate-environment-variable)
 (input-method . marginalia-annotate-input-method)
 (coding-system . marginalia-annotate-coding-system)
 (charset . marginalia-annotate-charset)
@@ -366,6 +366,12 @@ This hash table is needed to speed up 
`marginalia-annotate-command'.")
  ((documentation-property sym 'variable-documentation)
   :truncate marginalia-truncate-width :face 'marginalia-documentation
 
+(defun marginalia-annotate-environment-variable (cand)
+  "Annotate environment variable CAND with its current value."
+  (when-let (val (getenv cand))
+(marginalia--fields
+ (val :truncate marginalia-truncate-width :face 'marginalia-variable
+
 (defun marginalia-annotate-face (cand)
   "Annotate face CAND with documentation string and face example."
   (when-let (sym (intern-soft cand))



[elpa] externals/marginalia 675e680 036/241: improve annotator defcustoms

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 675e680aa527b0637f41a4183a7a33ae85428740
Author: Daniel Mendler 
Commit: Daniel Mendler 

improve annotator defcustoms
---
 marginalia.el | 29 +
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index de4ec8d..ec95406 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -96,14 +96,14 @@
 
 (defcustom marginalia-annotators
   'marginalia-annotators-light
-  "Associate categories with annotators for minibuffer completion.
-Each annotation function must return a string,
-which is appended to the completion candidate.
+  "Choose an annotator association list for minibuffer completion.
 Annotations are only shown if `marginalia-mode' is enabled."
-  :type 'symbol
+  :type '(choice (const :tag "Light" marginalia-annotator-light)
+ (const :tag "Heavy" marginalia-annotator-heavy)
+ (symbol :tag "Other"))
   :group 'marginalia)
 
-(defvar marginalia-annotators-light
+(defcustom marginalia-annotators-light
   '((command . marginalia-annotate-command-binding)
 (customize-group . marginalia-annotate-customize-group)
 (variable . marginalia-annotate-variable)
@@ -111,15 +111,28 @@ Annotations are only shown if `marginalia-mode' is 
enabled."
 (symbol . marginalia-annotate-symbol)
 (variable . marginalia-annotate-variable)
 (package . marginalia-annotate-package))
-  "Lightweight annotator functions.")
+  "Lightweight annotator functions.
+Associates completion categories with annotation functions.
+Each annotation function must return a string,
+which is appended to the completion candidate.
+See also `marginalia-annotators-heavy'."
+  :type '(alist :key-type symbol :value-type function)
+  :group 'marginalia)
 
-(defvar marginalia-annotators-heavy
+(defcustom marginalia-annotators-heavy
   (append
'((file . marginalia-annotate-file)
  (buffer . marginalia-annotate-buffer)
  (command . marginalia-annotate-command-full))
marginalia-annotators-light)
-  "Heavy annotator functions.")
+  "Heavy annotator functions.
+
+Associates completion categories with annotation functions.
+Each annotation function must return a string,
+which is appended to the completion candidate.
+See also `marginalia-annotators-light'."
+  :type '(alist :key-type symbol :value-type function)
+  :group 'marginalia)
 
 (defcustom marginalia-classifiers
   '(marginalia-classify-by-command-name



[elpa] externals/marginalia c0460b6 085/241: classify environment variable

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit c0460b68920143f3e3dac43bace7c901d3f76b0a
Author: Daniel Mendler 
Commit: Daniel Mendler 

classify environment variable
---
 marginalia.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/marginalia.el b/marginalia.el
index 7f819ad..8347565 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -198,6 +198,7 @@ determine it."
 ("\\" . command)
 ("\\" . package)
 ("\\" . face)
+("\\" . environment-variable)
 ("\\" . variable)
 ("\\" . input-method)
 ("\\" . charset)



[elpa] externals/marginalia 8be2daf 046/241: marginalia-annotate-file: remove unnecessary offset which only costs space for no reason

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 8be2dafd03302aa30f2714124a9abd36e6af227c
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-file: remove unnecessary offset which only costs space 
for no reason
---
 marginalia.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 01fde0d..a37cbdd 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -338,8 +338,7 @@ using `minibuffer-force-complete' on the candidate CAND."
  (marginalia--align 10 marginalia-separator-width ;; modes
 12 marginalia-separator-width ;; user:group
 7 marginalia-separator-width ;; size
-12 ;; date
-20) ;; offset
+12) ;; date
  (file-attribute-modes attributes)
  (marginalia--separator)
  (format "%12s" (format "%s:%s"



[elpa] externals/marginalia 78023eb 038/241: update readme

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 78023eba0f733ff1d377ba7f8f4e2f04166608a8
Author: Daniel Mendler 
Commit: Daniel Mendler 

update readme
---
 README.md | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 71aad71..61f4c7e 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,8 @@ annotations placed at the margin of the page of a book or in 
this case helpful
 colorful annotations placed at the margin of the minibuffer for your completion
 candidates. The annotations are added based on the completion category. For
 example `find-file` reports the `file` category and `M-x` reports the `command`
-category.
+category. You can choose between more or less detailed annotators, by
+setting the variable `marginalia-annotators`.
 
 Since many commands do not report a completion category themselves, Marginalia
 provides a classifier system, which tries to guess the correct category based
@@ -31,11 +32,8 @@ specified by the variable `marginalia-classifiers`.
   ;; enabled right away. Note that this forces loading the package.
   (marginalia-mode)
 
-  ;; Enable richer annotations for M-x.
-  ;; Only keybindings are shown by default, in order to reduce noise for this 
very common command.
-  ;; * marginalia-annotate-symbol: Annotate with the documentation string
-  ;; * marginalia-annotate-command-binding (default): Annotate only with the 
keybinding
-  ;; * marginalia-annotate-command-full: Annotate with the keybinding and the 
documentation string
-  ;; (setf (alist-get 'command marginalia-annotators) 
#'marginalia-annotate-command-full)
-)
+  ;; Enable richer, more heavy, annotations.
+  ;; E.g. M-x will show the documentation string additional to the keybinding.
+  ;; By default only the keybinding is shown as annotation.
+  (setq marginalia-annotators 'marginalia-annotators-heavy))
 ~~~



[elpa] externals/marginalia 4ac0f1f 096/241: rename variable

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 4ac0f1fab32cb76d08f972d903b6948585972056
Author: Daniel Mendler 
Commit: Daniel Mendler 

rename variable
---
 marginalia.el | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index cef1819..0198522 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -262,7 +262,7 @@ WIDTH is the format width. This can be specified as 
alternative to FORMAT."
 (marginalia--fields
  (str :truncate marginalia-truncate-width :face 
'marginalia-documentation
 
-(defvar-local marginalia-annotate-binding--hash nil
+(defvar-local marginalia--annotate-binding-hash nil
   "Hash table storing the keybinding of every command.
 This hash table is needed to speed up `marginalia-annotate-binding'.")
 
@@ -273,13 +273,13 @@ This hash table is needed to speed up 
`marginalia-annotate-binding'.")
 ;; `where-is-internal'. `where-is-internal' generates a lot of garbage, 
leading to garbage
 ;; collecting pauses when interacting with the minibuffer. See
 ;; https://github.com/minad/marginalia/issues/16.
-(unless marginalia-annotate-binding--hash
-  (setq marginalia-annotate-binding--hash (make-hash-table))
+(unless marginalia--annotate-binding-hash
+  (setq marginalia--annotate-binding-hash (make-hash-table))
   (mapatoms (lambda (sym)
   (when-let (key (and (commandp sym) (where-is-internal sym 
nil t)))
-(puthash sym key marginalia-annotate-binding--hash)
+(puthash sym key marginalia--annotate-binding-hash)
 (when-let* ((sym (intern-soft cand))
-(binding (gethash sym marginalia-annotate-binding--hash)))
+(binding (gethash sym marginalia--annotate-binding-hash)))
   (propertize (format " (%s)" (key-description binding)) 'face 
'marginalia-key
 
 ;; This annotator is consult-specific, it will annotate the `consult-buffer' 
command.



[elpa] externals/marginalia 69332ba 110/241: fix hex code formatting

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 69332ba7a47693ddf4f545c3dc180b1e9b9510b1
Author: Daniel Mendler 
Commit: Daniel Mendler 

fix hex code formatting
---
 marginalia.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 5d3ec98..c0f113c 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -457,7 +457,7 @@ Similar to `marginalia-annotate-symbol', but does not show 
symbol class."
 (concat
  (propertize (format " (%c)" char) 'face 'marginalia-char)
  (marginalia--fields
-  (char :format "%05x" :face 'marginalia-number)
+  (char :format "%06X" :face 'marginalia-number)
   ((char-code-property-description
 'general-category
 (get-char-code-property char 'general-category))



[elpa] externals/marginalia 88faa59 089/241: marginalia-annotate-variable: ensure that control characters are escaped

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 88faa59f8f91fa815e178838cdee3c8735a5b8c2
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-variable: ensure that control characters are escaped

otherwise newlines and bidi characters make problems
---
 marginalia.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index c34628b..0ceefa9 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -402,8 +402,11 @@ Similar to `marginalia-annotate-symbol', but does not show 
symbol class."
   (when-let (sym (intern-soft cand))
 (marginalia--fields
  ((marginalia--symbol-class sym) :face 'marginalia-modified)
- ((if (boundp sym) (symbol-value sym) 'unbound)
-  :truncate (/ marginalia-truncate-width 3) :format "%S" :face 
'marginalia-variable)
+ ((let ((print-escape-newlines t)
+(print-escape-control-characters t)
+(print-escape-multibyte t))
+(prin1-to-string (if (boundp sym) (symbol-value sym) 'unbound)))
+  :truncate (/ marginalia-truncate-width 3) :face 'marginalia-variable)
  ((documentation-property sym 'variable-documentation)
   :truncate marginalia-truncate-width :face 'marginalia-documentation
 



[elpa] externals/marginalia b0c24f7 088/241: introduce marginalia-annotate-command

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit b0c24f76e1b450dd178ae3ce54401dc43e43821d
Author: Daniel Mendler 
Commit: Daniel Mendler 

introduce marginalia-annotate-command

Like marginalia-annotate-symbol, but does not show symbol-class.
The symbol-class feels like unnecessary noise for M-x.
---
 marginalia.el | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 96375a1..c34628b 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -170,7 +170,7 @@ See also `marginalia-annotators-heavy'."
'((file . marginalia-annotate-file)
  (buffer . marginalia-annotate-buffer)
  (virtual-buffer . marginalia-annotate-virtual-buffer-full)
- (command . marginalia-annotate-symbol))
+ (command . marginalia-annotate-command))
marginalia-annotators-light)
   "Heavy annotator functions.
 
@@ -382,6 +382,14 @@ a face"
 (t (documentation-property sym 'variable-documentation)))
:truncate marginalia-truncate-width :face 'marginalia-documentation)
 
+(defun marginalia-annotate-command (cand)
+  "Annotate command CAND with its documentation string.
+Similar to `marginalia-annotate-symbol', but does not show symbol class."
+  (when-let (sym (intern-soft cand))
+(concat
+ (marginalia-annotate-binding cand)
+ (marginalia--documentation (marginalia--function-doc sym)
+
 (defun marginalia-annotate-imenu (cand)
   "Annotate imenu CAND with its documentation string."
   (when (provided-mode-derived-p (buffer-local-value 'major-mode



[elpa] externals/marginalia 1269445 049/241: marginalia-annotate-command-binding: cache key binding

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 126944545a148f3391318eb3c9f90946c885b2aa
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-command-binding: cache key binding

* See #16.
* This eliminates the annotation overhead entirely.
* Unfortunately we are back to showing minibuffer bindings again (Emacs 28 
behavior).
* It is not entirely clear to me why it is fast to loop once over
  all symbols doing the where-is-internal lookup.
  For some reason it is better to do the work in bulk.
  This is not uncommon for work depending on gc throughput.
* Should we add a different function marginalia-annotate-binding-exact
  and rename the caching function to marginalia-annotate-binding-fast?
  Then the user can select between the two functions via fset.
---
 marginalia.el | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 5215762..5122740 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -217,14 +217,18 @@ determine it."
   "Truncate string STR to WIDTH."
   (truncate-string-to-width (car (split-string str "\n")) width 0 32 "…"))
 
+(defvar marginalia-annotate-command-binding--init nil)
 (defun marginalia-annotate-command-binding (cand)
   "Annotate command CAND with keybinding."
-  ;; Taken from Emacs 28, read-extended-command--annotation
-  (when-let* ((binding
-   (with-current-buffer (window-buffer 
(minibuffer-selected-window))
- (where-is-internal (intern cand) overriding-local-map t)))
-  (desc (and (not (stringp binding)) (key-description binding
-(propertize (format " (%s)" desc) 'face 'marginalia-key)))
+  (unless marginalia-annotate-command-binding--init
+(setq marginalia-annotate-command-binding--init t)
+(cl-do-all-symbols (sym)
+  (when (commandp sym)
+(when-let (key (where-is-internal sym nil t))
+  (put sym 'marginalia--cached-binding
+   (propertize (format " (%s)" (key-description key))
+   'face 'marginalia-key))
+  (get (intern cand) 'marginalia--cached-binding))
 
 (defun marginalia-annotate-command-full (cand)
   "Annotate command CAND with the keybinding and its documentation string."



[elpa] externals/marginalia c8c3f87 045/241: Rename toggle -> cycle, improve documenation

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit c8c3f87c03101a0f18a0c923a85ffe4a70f23241
Author: Omar Antolín 
Commit: Omar Antolín 

Rename toggle -> cycle, improve documenation
---
 README.md |  3 ++-
 marginalia.el | 24 
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index 89c0b7c..4d7a2be 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@ specified by the variable `marginalia-classifiers`.
   ;; Prefer richer, more heavy, annotations over the lighter default variant.
   ;; E.g. M-x will show the documentation string additional to the keybinding.
   ;; By default only the keybinding is shown as annotation.
-  ;; Note that there is the command `marginalia-toggle-annotators` to switch 
between the annotators.
+  ;; Note that there is the command `marginalia-cycle-annotators` to 
+  ;; switch between the annotators.
   (setq marginalia-annotators '(marginalia-annotators-heavy 
marginalia-annotators-light)))
 ~~~
diff --git a/marginalia.el b/marginalia.el
index c6c70d4..01fde0d 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -98,10 +98,15 @@
   '(marginalia-annotators-light marginalia-annotators-heavy)
   "Choose an annotator association list for minibuffer completion.
 The first entry in the list is used for annotations.
-You can toggle between the annotators using `marginalia-toggle-annotators'.
-Annotations are only shown if `marginalia-mode' is enabled."
+You can cycle between the annotators using `marginalia-cycle-annotators'.
+Annotations are only shown if `marginalia-mode' is enabled.
+An entry of nil disables marginalia's annotations (leaving you
+only with the annotations that come with Emacs) without disabling
+`marginalia-mode'; this can be convenient for users of
+`marginalia-cycle-annotators'."
   :type '(repeat (choice (const :tag "Light" marginalia-annotators-light)
  (const :tag "Heavy" marginalia-annotators-heavy)
+ (const :tag "None" nil)
  (symbol :tag "Other")))
   :group 'marginalia)
 
@@ -419,19 +424,22 @@ Remember `this-command' for annotation."
 ;; Replace the metadata function.
 (advice-add #'completion-metadata-get :before-until 
#'marginalia--completion-metadata-get)))
 
-;; If you want to toggle between annotators while being in the minibuffer, the 
completion-system
+;; If you want to cycle between annotators while being in the minibuffer, the 
completion-system
 ;; should refresh the candidate list. Currently there is no support for this 
in marginalia, but it
-;; is possible to advice the `marginalia-toggle-annotators' function with the 
necessary refreshing
+;; is possible to advise the `marginalia-cycle-annotators' function with the 
necessary refreshing
 ;; logic. See the discussion in https://github.com/minad/marginalia/issues/10 
for reference.
 ;;;###autoload
-(defun marginalia-toggle-annotators ()
-  "Toggle between annotators in `marginalia-annotators'."
+(defun marginalia-cycle-annotators ()
+  "Cycle between annotators in `marginalia-annotators'.
+If called from the minibuffer the annotator cycling is local,
+that it is, it does not affect subsequent minibuffers.  When called
+from a regular buffer the effect is global."
   (interactive)
   (let ((annotators (append (cdr marginalia-annotators)
 (list (car marginalia-annotators)
-;; If `marginalia-toggle-annotators' has been invoked from inside the 
minibuffer, only change
+;; If `marginalia-cycle-annotators' has been invoked from inside the 
minibuffer, only change
 ;; the annotators locally. This is useful if the command is used as an 
action. If the command is
-;; not triggered from inside the minibuffer, toggle the annotator 
globally. Hopefully this is
+;; not triggered from inside the minibuffer, cycle the annotator globally. 
Hopefully this is
 ;; not too confusing.
 (if (minibufferp)
 (setq-local marginalia-annotators annotators)



[elpa] externals/marginalia bbde111 083/241: Annotate environment variables with their value

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit bbde1114d21676628c9f9209f9edb0b14e6d3939
Author: Omar Antolín 
Commit: Omar Antolín 

Annotate environment variables with their value
---
 marginalia.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/marginalia.el b/marginalia.el
index 48c2a8c..1479fce 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -150,6 +150,7 @@ only with the annotations that come with Emacs) without 
disabling
 (minor-mode . marginalia-annotate-minor-mode)
 (symbol . marginalia-annotate-symbol)
 (variable . marginalia-annotate-variable)
+(environment-variable . getenv)
 (input-method . marginalia-annotate-input-method)
 (coding-system . marginalia-annotate-coding-system)
 (charset . marginalia-annotate-charset)



[elpa] externals/marginalia b69be18 119/241: marginalia-annotate-variable: add local indicator

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit b69be1839c04375a115f81020ed4aafe0a3e
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-variable: add local indicator
---
 marginalia.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index 6b0a71e..ebaf784 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -368,6 +368,7 @@ m macro
 Variable:
 u custom
 v variable
+l local
 * modified
 
 Other:
@@ -385,6 +386,7 @@ t cl-type"
(when (marginalia--advised s) "!")))
 (when (boundp s)
   (concat
+   (when (local-variable-if-set-p s) "l")
(if (custom-variable-p s) "u" "v")
(when (and (boundp s) (default-boundp s) (not (equal (symbol-value s) 
(default-value s "*")))
 (when (facep s) "a")



[elpa] externals/marginalia 376ccc5 048/241: Revert "fix marginalia--full-candidate for selectrum"

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 376ccc548f56c2a9d086814231337b5a7198bea3
Author: Daniel Mendler 
Commit: Daniel Mendler 

Revert "fix marginalia--full-candidate for selectrum"

This reverts commit f39556bb45e0affd23da2b7b8c6841f68648fb7f.
---
 marginalia.el | 36 ++--
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 539f598..5215762 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -318,28 +318,20 @@ component of a full file path.
 
 This function returns what would be the minibuffer contents after
 using `minibuffer-force-complete' on the candidate CAND."
-  (or
-   ;; Selectrum allows access to the full-candidate via property
-   ;; TODO The generic method which follows, does not work yet with selectrum.
-   ;; https://github.com/raxod502/selectrum/issues/255
-   (get-text-property 0 'selectrum-candidate-full cand)
-
-   ;; When in the minibuffer, use the minibuffer contents to expand the 
candidate.
-   (and (minibufferp)
-(let* ((contents (minibuffer-contents))
-   (pt (- (point) (minibuffer-prompt-end)))
-   (bounds (completion-boundaries
-(substring contents 0 pt)
-minibuffer-completion-table
-minibuffer-completion-predicate
-(substring contents pt
-  (concat (substring contents 0 (car bounds))
-  cand
-  (substring contents (+ pt (cdr bounds))
-
-   ;; Not in a minibuffer, trust that cand already conveys all
-   ;; information, since there is nothing we can do.
-   cand))
+  (if (minibufferp)
+  (let* ((contents (minibuffer-contents))
+ (pt (- (point) (minibuffer-prompt-end)))
+ (bounds (completion-boundaries
+  (substring contents 0 pt)
+  minibuffer-completion-table
+  minibuffer-completion-predicate
+  (substring contents pt
+(concat (substring contents 0 (car bounds))
+cand
+(substring contents (+ pt (cdr bounds)
+;; not in a minibuffer, trust that cand already conveys all
+;; necessary information (there's not much else we can do)
+cand))
 
 (defun marginalia-annotate-file (cand)
   "Annotate file CAND with its size and modification time."



[elpa] externals/marginalia ed02f22 099/241: marginalia--align: only align text if non-empty

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit ed02f224527a49594aadf19763a41bbc88f7c664
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia--align: only align text if non-empty
---
 marginalia.el | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index f1e0e4e..55f3045 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -231,12 +231,13 @@ determine it."
 
 (defsubst marginalia--align (str)
   "Align STR at the right margin."
-  (concat " "
-  (propertize
-   " "
-   'display
-   `(space :align-to (- right-fringe ,(length str
-  str))
+  (unless (string-blank-p str)
+(concat " "
+(propertize
+ " "
+ 'display
+ `(space :align-to (- right-fringe ,(length str
+str)))
 
 (cl-defmacro marginalia--field (field &key truncate format face width)
   "Format FIELD as a string according to some options.



[elpa] externals/marginalia ef4fabf 106/241: add preliminary support for affixation-function

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit ef4fabfe16c2e1e1e479820229ebb8acebb24d3a
Author: Daniel Mendler 
Commit: Daniel Mendler 

add preliminary support for affixation-function
---
 marginalia.el | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index 281f37f..552c5c5 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -589,6 +589,12 @@ PROP is the property which is looked up."
  ;; we do want the advice triggered for completion-metadata-get
  (when-let (cat (completion-metadata-get metadata 'category))
(alist-get cat (symbol-value (car marginalia-annotators)
+('affixation-function
+ ;; We do want the advice triggered for `completion-metadata-get'.
+ ;; Return wrapper around `annotation-function'.
+ (when-let* ((cat (completion-metadata-get metadata 'category))
+ (annotate (alist-get cat (symbol-value (car 
marginalia-annotators)
+   (lambda (cands) (mapcar (lambda (x) (list x (funcall annotate x))) 
cands
 ('category
  ;; using alist-get bypasses any advice on completion-metadata-get
  ;; to avoid infinite recursion



[elpa] externals/marginalia f083852 066/241: readme: add embark and consult links

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit f083852b63d26120318f71c96c2787fadf4826a6
Author: Daniel Mendler 
Commit: Daniel Mendler 

readme: add embark and consult links
---
 README.md | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 4d7a2be..923cc88 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,14 @@ specified by the variable `marginalia-classifiers`.
 
 ## Configuration
 
+It is recommended to use Marginalia together with either the
+[Selectrum](https://github.com/raxod502/selectrum) or the
+[Icomplete-vertical](https://github.com/oantolin/icomplete-vertical) completion
+system. Furthermore Marginalia can be combined with
+[Embark](https://github.com/oantolin/embark) for action support and
+[Consult](https://github.com/minad/consult), which provides many useful
+commands.
+
 ~~~ elisp
 ;; Enable richer annotations using the Marginalia package
 (use-package marginalia
@@ -35,7 +43,7 @@ specified by the variable `marginalia-classifiers`.
   ;; Prefer richer, more heavy, annotations over the lighter default variant.
   ;; E.g. M-x will show the documentation string additional to the keybinding.
   ;; By default only the keybinding is shown as annotation.
-  ;; Note that there is the command `marginalia-cycle-annotators` to 
+  ;; Note that there is the command `marginalia-cycle-annotators` to
   ;; switch between the annotators.
   (setq marginalia-annotators '(marginalia-annotators-heavy 
marginalia-annotators-light)))
 ~~~



[elpa] externals/marginalia ccefc57 052/241: marginalia-annotate-command-binding: add comment

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit ccefc57c574aea6babc7c0ce2363a734d83fce59
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-command-binding: add comment
---
 marginalia.el | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index c0f4b37..98a8621 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -217,16 +217,22 @@ determine it."
   "Truncate string STR to WIDTH."
   (truncate-string-to-width (car (split-string str "\n")) width 0 32 "…"))
 
-(defvar-local marginalia-annotate-command-binding--hash nil)
+(defvar-local marginalia-annotate-command-binding--hash nil
+  "Hash table storing the keybinding of every command.
+This hash table is needed to speed up `marginalia-annotate-command-binding'.")
+
 (defun marginalia-annotate-command-binding (cand)
   "Annotate command CAND with keybinding."
   (with-current-buffer (window-buffer (minibuffer-selected-window))
+;; Precomputing the keybinding of every command is faster than looking it 
up every time using
+;; `where-is-internal'. `where-is-internal' generates a lot of garbage, 
leading to garbage
+;; collecting pauses when interacting with the minibuffer. See
+;; https://github.com/minad/marginalia/issues/16.
 (unless marginalia-annotate-command-binding--hash
   (setq marginalia-annotate-command-binding--hash (make-hash-table))
   (cl-do-all-symbols (sym)
-(when (commandp sym)
-  (when-let (key (where-is-internal sym nil t))
-(puthash sym key marginalia-annotate-command-binding--hash)
+(when-let (key (and (commandp sym) (where-is-internal sym nil t)))
+  (puthash sym key marginalia-annotate-command-binding--hash
 (when-let (binding (gethash (intern cand) 
marginalia-annotate-command-binding--hash))
   (propertize (format " (%s)" (key-description binding)) 'face 
'marginalia-key
 



[elpa] externals/marginalia e833584 103/241: improve marginalia-classify-symbol

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit e83358412594750d5e2621e38b70f77739d5abc5
Author: Daniel Mendler 
Commit: Daniel Mendler 

improve marginalia-classify-symbol

functions were recognized as symbol lists

fix #30
---
 marginalia.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 688fa60..3e35d4c 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -559,7 +559,7 @@ using `minibuffer-force-complete' on the candidate CAND."
   (when-let (mct minibuffer-completion-table)
 (when (or (eq mct 'help--symbol-completion-table)
   (obarrayp mct)
-  (and (consp mct) (symbolp (car mct ; assume list of symbols
+  (and (not (functionp mct)) (consp mct) (symbolp (car mct ; 
assume list of symbols
   'symbol)))
 
 (defun marginalia-classify-by-prompt ()



[elpa] externals/marginalia 14dce57 062/241: scale field widths such that annotations look better on smaller windows

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 14dce57bafcf6fc0984c717c1d6a9ac995b252fd
Author: Daniel Mendler 
Commit: Daniel Mendler 

scale field widths such that annotations look better on smaller windows
---
 marginalia.el | 41 +
 1 file changed, 17 insertions(+), 24 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index af8474e..2cac877 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -94,23 +94,10 @@
   "Face used to highlight file owners in `marginalia-mode'."
   :group 'marginalia)
 
-(defcustom marginalia-separator ""
-  "Field separator."
-  :type 'string
-  :group 'marginalia)
-
-(defcustom marginalia-documentation-width 80
-  "Width of documentation string."
-  :type 'integer
-  :group 'marginalia)
+(defcustom marginalia-truncate-width 80
+  "Maximum truncation width of annotation fields.
 
-(defcustom marginalia-file-name-width 80
-  "Width of file name."
-  :type 'integer
-  :group 'marginalia)
-
-(defcustom marginalia-variable-width 30
-  "Width of variable value annotation string."
+This value is adjusted in the `minibuffer-setup-hook' depending on the 
`window-width'."
   :type 'integer
   :group 'marginalia)
 
@@ -202,6 +189,9 @@ determine it."
 
  Marginalia mode
 
+(defvar marginalia--separator ""
+  "Field separator.")
+
 (defvar marginalia--this-command nil
   "Last command symbol saved in order to allow annotations.")
 
@@ -238,14 +228,14 @@ WIDTH is the format width. This can be specified as 
alternative to FORMAT."
 (defmacro marginalia--fields (&rest fields)
   "Format annotation FIELDS as a string with separators in between."
   `(marginalia--align (concat ,@(cdr (mapcan (lambda (field)
-   (list 'marginalia-separator 
`(marginalia--field ,@field)))
+   (list 'marginalia--separator 
`(marginalia--field ,@field)))
  fields)
 
 (defun marginalia--documentation (str)
   "Format documentation string STR."
   (when str
 (marginalia--fields
- (str :truncate marginalia-documentation-width :face 
'marginalia-documentation
+ (str :truncate marginalia-truncate-width :face 
'marginalia-documentation
 
 (defvar-local marginalia-annotate-command-binding--hash nil
   "Hash table storing the keybinding of every command.
@@ -287,8 +277,8 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 (when-let (doc (documentation-property sym 'variable-documentation))
   (marginalia--fields
((if (boundp sym) (symbol-value sym) 'unbound)
-:truncate marginalia-variable-width :format "%S" :face 
'marginalia-variable)
-   (doc :truncate marginalia-documentation-width :face 
'marginalia-documentation)
+:truncate (/ marginalia-truncate-width 2) :format "%S" :face 
'marginalia-variable)
+   (doc :truncate marginalia-truncate-width :face 
'marginalia-documentation)
 
 (defun marginalia-annotate-face (cand)
   "Annotate face CAND with documentation string and face example."
@@ -296,7 +286,7 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 (when-let (doc (documentation-property sym 'face-documentation))
   (marginalia--fields
("abcdefghijklmNOPQRSTUVWXYZ" :face sym)
-   (doc :truncate marginalia-documentation-width :face 
'marginalia-documentation)
+   (doc :truncate marginalia-truncate-width :face 
'marginalia-documentation)
 
 (defun marginalia-annotate-package (cand)
   "Annotate package CAND with its description summary."
@@ -311,7 +301,7 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
  ((if (package-installed-p desc)
   "installed"
 (package-desc-archive desc)) :width 9 :face 'marginalia-archive)
- ((package-desc-summary desc) :truncate marginalia-documentation-width 
:face 'marginalia-documentation
+ ((package-desc-summary desc) :truncate marginalia-truncate-width :face 
'marginalia-documentation
 
 (defun marginalia-annotate-customize-group (cand)
   "Annotate customization group CAND with its documentation string."
@@ -327,7 +317,7 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
  ((buffer-local-value 'major-mode buffer) :width 30 :face 'marginalia-mode)
  ((if-let (file (buffer-file-name buffer))
   (abbreviate-file-name file) "")
-  :truncate marginalia-file-name-width
+  :truncate marginalia-truncate-width
   :face 'marginalia-file-name
 
 ;; At some point we might want to revisit how this function is implemented. 
Maybe we come up with a
@@ -424,7 +414,10 @@ PROP is the property which is looked up."
 (defun marginalia--minibuffer-setup ()
   "Setup minibuffer for `marginalia-mode'.
 Remember `this-command' for annotation."
-  (setq-local marginalia--this-command this-command))
+  (let ((w (window-width)))
+(setq-l

[elpa] externals/marginalia 78f676e 122/241: marginalia-annotate-package: use package-desc-status

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 78f676e65343d8865e5b920afd3a6875458bfbc7
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-package: use package-desc-status
---
 marginalia.el | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index fc5038a..617a1e7 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -225,10 +225,9 @@ determine it."
 (defvar package-archive-contents)
 (declare-function package--from-builtin "package")
 (declare-function package-desc-archive "package")
-(declare-function package-desc-dir "package")
 (declare-function package-desc-summary "package")
 (declare-function package-desc-version "package")
-(declare-function package-installed-p "package")
+(declare-function package-desc-status "package")
 (declare-function package-version-join "package")
 
 (declare-function project-current "project")
@@ -500,9 +499,8 @@ Similar to `marginalia-annotate-symbol', but does not show 
symbol class."
 (marginalia--fields
  ((package-version-join (package-desc-version desc)) :width 16 :face 
'marginalia-version)
  ((cond
-   ((eq (package-desc-dir desc) 'builtin) (propertize "builtin" 'face 
'marginalia-installed))
-   ((not (package-desc-archive desc)) (propertize "installed" 'face 
'marginalia-installed))
-   (t (propertize (package-desc-archive desc) 'face 'marginalia-archive))) 
:width 9)
+   ((package-desc-archive desc) (propertize (package-desc-archive desc) 
'face 'marginalia-archive))
+   (t (propertize (or (package-desc-status desc) "orphan") 'face 
'marginalia-installed))) :width 10)
  ((package-desc-summary desc) :truncate marginalia-truncate-width :face 
'marginalia-documentation
 
 (defun marginalia-annotate-customize-group (cand)



[elpa] externals/marginalia 3360875 113/241: Rename marginalia-cycle-annotators to marginalia-cycle

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 3360875943e6084f134aebffad83878d71c367c5
Author: Daniel Mendler 
Commit: Daniel Mendler 

Rename marginalia-cycle-annotators to marginalia-cycle

* The name is still meaningful
* Shorter names take less space in the Embark which-key menu
---
 README.md |  9 -
 marginalia.el | 17 -
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/README.md b/README.md
index 117a4e8..0ddc568 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ The annotations are added based on the completion category. 
For example
 `find-file` reports the `file` category and `M-x` reports the `command`
 category. You can choose between more or less detailed annotators, by setting
 the variable `marginalia-annotators` or by invoking the command
-`marginalia-cycle-annotators`.
+`marginalia-cycle`.
 
 Since many commands do not report a completion category themselves, Marginalia
 provides a classifier system, which tries to guess the correct category based
@@ -40,10 +40,9 @@ commands.
 ~~~ elisp
 ;; Enable richer annotations using the Marginalia package
 (use-package marginalia
-  ;; When using the Embark package, you can bind `marginalia-cycle-annotators'
-  ;; as an Embark action!
+  ;; When using the Embark package, you can bind `marginalia-cycle' as an 
Embark action!
   ;; :bind (:map embark-general-map
-  ;;("A" . marginalia-cycle-annotators))
+  ;;("A" . marginalia-cycle))
 
   ;; The :init configuration is always executed (Not lazy!)
   :init
@@ -55,7 +54,7 @@ commands.
   ;; Prefer richer, more heavy, annotations over the lighter default variant.
   ;; E.g. M-x will show the documentation string additional to the keybinding.
   ;; By default only the keybinding is shown as annotation.
-  ;; Note that there is the command `marginalia-cycle-annotators` to
+  ;; Note that there is the command `marginalia-cycle` to
   ;; switch between the annotators.
   ;; (setq marginalia-annotators '(marginalia-annotators-heavy 
marginalia-annotators-light nil)))
 ~~~
diff --git a/marginalia.el b/marginalia.el
index 1d43b70..e8817ee 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -61,12 +61,12 @@ This value is adjusted in the `minibuffer-setup-hook' 
depending on the `window-w
   '(marginalia-annotators-light marginalia-annotators-heavy nil)
   "Choose an annotator association list for minibuffer completion.
 The first entry in the list is used for annotations.
-You can cycle between the annotators using `marginalia-cycle-annotators'.
+You can cycle between the annotators using `marginalia-cycle'.
 Annotations are only shown if `marginalia-mode' is enabled.
 An entry of nil disables marginalia's annotations (leaving you
 only with the annotations that come with Emacs) without disabling
 `marginalia-mode'; this can be convenient for users of
-`marginalia-cycle-annotators'."
+`marginalia-cycle'."
   :type '(repeat (choice (const :tag "Light" marginalia-annotators-light)
  (const :tag "Heavy" marginalia-annotators-heavy)
  (const :tag "None" nil)
@@ -669,19 +669,18 @@ Remember `this-command' for annotation."
 
 ;; If you want to cycle between annotators while being in the minibuffer, the 
completion-system
 ;; should refresh the candidate list. Currently there is no support for this 
in marginalia, but it
-;; is possible to advise the `marginalia-cycle-annotators' function with the 
necessary refreshing
-;; logic. See the discussion in https://github.com/minad/marginalia/issues/10 
for reference.
+;; is possible to advise the `marginalia-cycle' function with the necessary 
refreshing logic. See
+;; the discussion in https://github.com/minad/marginalia/issues/10 for 
reference.
 ;;;###autoload
-(defun marginalia-cycle-annotators ()
+(defun marginalia-cycle ()
   "Cycle between annotators in `marginalia-annotators'.
 If called from the minibuffer the annotator cycling is local,
 that it is, it does not affect subsequent minibuffers.  When called
 from a regular buffer the effect is global."
   (interactive)
-  ;; If `marginalia-cycle-annotators' has been invoked from inside the 
minibuffer, only change
-  ;; the annotators locally. This is useful if the command is used as an 
action. If the command is
-  ;; not triggered from inside the minibuffer, cycle the annotator globally. 
Hopefully this is
-  ;; not too confusing.
+  ;; If `marginalia-cycle' has been invoked from inside the minibuffer, only 
change the annotators
+  ;; locally. This is useful if the command is used as an action. If the 
command is not triggered
+  ;; from inside the minibuffer, cycle the annotator globally. Hopefully this 
is not too confusing.
   (if-let* ((win (active-minibuffer-window))
 (buf (window-buffer win)))
   (let ((a (buffer-local-value 'marginalia-annotators buf)))



[elpa] externals/marginalia 9d2f319 080/241: marginalia-annotate-variable: add modification indicator

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 9d2f3196d957fec33e6c47e139214f6b8b7b453e
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-variable: add modification indicator
---
 marginalia.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index fbca12e..73687cf 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -358,6 +358,9 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
   (let ((sym (intern cand)))
 (when-let (doc (documentation-property sym 'variable-documentation))
   (marginalia--fields
+   ((if (and (boundp sym) (not (equal (symbol-value sym) (default-value 
sym
+"*" " ")
+:face 'marginalia-modified)
((if (boundp sym) (symbol-value sym) 'unbound)
 :truncate (/ marginalia-truncate-width 3) :format "%S" :face 
'marginalia-variable)
(doc :truncate marginalia-truncate-width :face 
'marginalia-documentation)



[elpa] externals/marginalia 2b85b73 130/241: fix marginalia--full-candidate

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 2b85b73bca6e1610b86b0de8c2c4c414a9e99185
Author: Daniel Mendler 
Commit: Daniel Mendler 

fix marginalia--full-candidate

cc @oantolin

It is a bit ugly that we are now switching back and forth,
but running the annotators in the context of the original
window makes more sense for most annotators. It seems to be
less error-prone this way.
---
 marginalia.el | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 714ffca..56627e4 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -554,18 +554,19 @@ component of a full file path.
 
 This function returns what would be the minibuffer contents after
 using `minibuffer-force-complete' on the candidate CAND."
-  (if (minibufferp)
-  (let* ((contents (minibuffer-contents))
- (pt (- (point) (minibuffer-prompt-end)))
- (bounds (completion-boundaries
-  (substring contents 0 pt)
-  minibuffer-completion-table
-  minibuffer-completion-predicate
-  (substring contents pt
-(concat (substring contents 0 (car bounds))
-cand
-(substring contents (+ pt (cdr bounds)
-;; not in a minibuffer, trust that cand already conveys all
+  (if-let (win (active-minibuffer-window))
+  (with-selected-window win
+(let* ((contents (minibuffer-contents))
+   (pt (- (point) (minibuffer-prompt-end)))
+   (bounds (completion-boundaries
+(substring contents 0 pt)
+minibuffer-completion-table
+minibuffer-completion-predicate
+(substring contents pt
+  (concat (substring contents 0 (car bounds))
+  cand
+  (substring contents (+ pt (cdr bounds))
+;; no minibuffer is active, trust that cand already conveys all
 ;; necessary information (there's not much else we can do)
 cand))
 



[elpa] externals/marginalia 3ec73cd 138/241: Merry Christmas, MELPA!

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 3ec73cd5104cef843c0fc1f38ced9a0b6de71881
Author: Daniel Mendler 
Commit: Daniel Mendler 

Merry Christmas, MELPA!
---
 marginalia.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index 7bde8d0..d64cc3d 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -27,6 +27,8 @@
 
 ;; Enrich existing commands with completion annotations
 
+;; Merry Christmas!
+
 ;;; Code:
 
 (require 'subr-x)



[elpa] externals/marginalia 597186d 065/241: add marginalia-annotate-minor-mode

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 597186dad0952b808aa5b3a7715a0268ad00e35b
Author: Daniel Mendler 
Commit: Daniel Mendler 

add marginalia-annotate-minor-mode

* Works with describe-minor-mode, minor-mode-menu-from-indicator and 
consult-minor-mode-menu
* See 
https://github.com/minad/consult/commit/d7212861b3245e0ceb09009652698379c9465da3
---
 marginalia.el | 38 +-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 763ed12..20f5883 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -44,6 +44,21 @@
   "Face used to highlight keys in `marginalia-mode'."
   :group 'marginalia)
 
+(defface marginalia-lighter
+  '((t :inherit marginalia-size))
+  "Face used to highlight lighters in `marginalia-mode'."
+  :group 'marginalia)
+
+(defface marginalia-on
+  '((t :inherit success))
+  "Face used to signal enabled modes."
+  :group 'marginalia)
+
+(defface marginalia-off
+  '((t :inherit error))
+  "Face used to signal disabled modes."
+  :group 'marginalia)
+
 (defface marginalia-documentation
   '((t :inherit completions-annotations))
   "Face used to highlight documentation string in `marginalia-mode'."
@@ -122,6 +137,7 @@ only with the annotations that come with Emacs) without 
disabling
 (customize-group . marginalia-annotate-customize-group)
 (variable . marginalia-annotate-variable)
 (face . marginalia-annotate-face)
+(minor-mode . marginalia-annotate-minor-mode)
 (symbol . marginalia-annotate-symbol)
 (variable . marginalia-annotate-variable)
 (package . marginalia-annotate-package))
@@ -165,7 +181,8 @@ determine it."
 ("\\" . command)
 ("\\" . package)
 ("\\" . face)
-("\\" . variable))
+("\\" . variable)
+("\\" . minor-mode))
   "Associates regexps to match against minibuffer prompts with categories."
   :type '(alist :key-type regexp :value-type symbol)
   :group 'marginalia)
@@ -288,6 +305,25 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
("abcdefghijklmNOPQRSTUVWXYZ" :face sym)
(doc :truncate marginalia-truncate-width :face 
'marginalia-documentation)
 
+(defun marginalia-annotate-minor-mode (cand)
+  "Annotate minor-mode CAND with status and documentation string."
+  (let* ((ind
+  (with-selected-window
+  (or (minibuffer-selected-window) (selected-window))
+(lookup-minor-mode-from-indicator cand)))
+ (mode (or ind (intern cand)))
+ (lighter (cdr (assq mode minor-mode-alist)))
+ (lighter-str (and lighter (string-trim (format-mode-line (cons t 
lighter))
+(concat
+ (marginalia--fields
+  ((if (and (boundp mode) (symbol-value mode))
+   (propertize "On" 'face 'marginalia-on)
+ (propertize "Off" 'face 'marginalia-off)) :width 3)
+  ((or lighter-str "") :width 10 :face 'marginalia-lighter)
+  ((or (ignore-errors (documentation mode)) "")
+   :truncate marginalia-truncate-width
+   :face 'marginalia-documentation)
+
 (defun marginalia-annotate-package (cand)
   "Annotate package CAND with its description summary."
   (when-let* ((pkg (intern (replace-regexp-in-string "-[[:digit:]\\.-]+$" "" 
cand)))



[elpa] externals/marginalia dfbaa7f 061/241: marginalia-annotate-package: show installed status instead of archive

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit dfbaa7fe5a52de3297e0df782fb1a17f1daa8b43
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-package: show installed status instead of archive

archive is nil for installed packages
---
 marginalia.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 0e004a0..af8474e 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -196,6 +196,7 @@ determine it."
 (declare-function package-desc-summary "package")
 (declare-function package-desc-version "package")
 (declare-function package-desc-archive "package")
+(declare-function package-installed-p "package")
 (declare-function package-version-join "package")
 (declare-function package--from-builtin "package")
 
@@ -307,7 +308,9 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
   (car (alist-get pkg package-archive-contents))
 (marginalia--fields
  ((package-version-join (package-desc-version desc)) :width 16 :face 
'marginalia-version)
- ((package-desc-archive desc) :width 8 :face 'marginalia-archive)
+ ((if (package-installed-p desc)
+  "installed"
+(package-desc-archive desc)) :width 9 :face 'marginalia-archive)
  ((package-desc-summary desc) :truncate marginalia-documentation-width 
:face 'marginalia-documentation
 
 (defun marginalia-annotate-customize-group (cand)



[elpa] externals/marginalia 531fb6e 107/241: fix #27

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 531fb6e9a5070b9a94f80f19f7b0329c8b243d47
Author: Daniel Mendler 
Commit: Daniel Mendler 

fix #27
---
 marginalia.el | 18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 552c5c5..c0fa896 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -39,13 +39,20 @@
   :group 'convenience
   :prefix "marginalia-")
 
-
 (defcustom marginalia-truncate-width 80
   "Maximum truncation width of annotation fields.
 
 This value is adjusted in the `minibuffer-setup-hook' depending on the 
`window-width'."
   :type 'integer)
 
+(defcustom marginalia-separator-threshold 120
+  "Use wider separator for window widths larger than this value."
+  :type 'integer)
+
+(defcustom marginalia-margin-threshold 160
+  "Use whitespace margin for window widths larger than this value."
+  :type 'integer)
+
 (defcustom marginalia-annotators
   '(marginalia-annotators-light marginalia-annotators-heavy)
   "Choose an annotator association list for minibuffer completion.
@@ -219,6 +226,9 @@ determine it."
 (defvar marginalia--separator ""
   "Field separator.")
 
+(defvar marginalia--margin nil
+  "Right margin.")
+
 (defvar marginalia--this-command nil
   "Last command symbol saved in order to allow annotations.")
 
@@ -236,6 +246,8 @@ determine it."
 (defsubst marginalia--align (str)
   "Align STR at the right margin."
   (unless (string-blank-p str)
+(when marginalia--margin
+  (setq str (concat str marginalia--margin)))
 (concat " "
 (propertize
  " "
@@ -606,7 +618,9 @@ PROP is the property which is looked up."
 Remember `this-command' for annotation."
   (let ((w (window-width)))
 (setq-local marginalia-truncate-width (min (/ w 2) 
marginalia-truncate-width))
-(setq-local marginalia--separator (if (> w 100) "" " "))
+(setq-local marginalia--separator (if (> w marginalia-separator-threshold) 
"" " "))
+(setq-local marginalia--margin (when (> w marginalia-margin-threshold)
+   (make-string (- w 
marginalia-margin-threshold) 32)))
 (setq-local marginalia--this-command this-command)))
 
 ;;;###autoload



[elpa] externals/marginalia 6e8ba6d 079/241: add marginalia-annotate-imenu

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 6e8ba6de8250b134a431ba13406f143c38b78814
Author: Daniel Mendler 
Commit: Daniel Mendler 

add marginalia-annotate-imenu
---
 marginalia.el | 18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 97ee258..fbca12e 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -154,6 +154,7 @@ only with the annotations that come with Emacs) without 
disabling
 (coding-system . marginalia-annotate-coding-system)
 (charset . marginalia-annotate-charset)
 (package . marginalia-annotate-package)
+(imenu . marginalia-annotate-imenu)
 (virtual-buffer . marginalia-annotate-virtual-buffer-class))
   "Lightweight annotator functions.
 Associates completion categories with annotation functions.
@@ -205,7 +206,8 @@ determine it."
   :type '(alist :key-type regexp :value-type symbol)
   :group 'marginalia)
 
-(defcustom marginalia-command-categories nil
+(defcustom marginalia-command-categories
+  '((imenu . imenu))
   "Associate commands with a completion category."
   :type '(alist :key-type symbol :value-type symbol)
   :group 'marginalia)
@@ -344,6 +346,13 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 doc)
   :truncate marginalia-truncate-width :face 'marginalia-documentation
 
+(defun marginalia-annotate-imenu (cand)
+  "Annotate imenu CAND with its documentation string."
+  (when (provided-mode-derived-p (buffer-local-value 'major-mode
+ (window-buffer 
(minibuffer-selected-window)))
+ 'emacs-lisp-mode)
+(marginalia-annotate-symbol (replace-regexp-in-string "^.*? " "" cand
+
 (defun marginalia-annotate-variable (cand)
   "Annotate variable CAND with its documentation string."
   (let ((sym (intern cand)))
@@ -484,12 +493,7 @@ using `minibuffer-force-complete' on the candidate CAND."
   (when-let (mct minibuffer-completion-table)
 (when (or (eq mct 'help--symbol-completion-table)
   (obarrayp mct)
-  (and (consp mct) (symbolp (car mct))) ; assume list of symbols
-  ;; imenu from an Emacs Lisp buffer produces symbols
-  (and (eq marginalia--this-command 'imenu)
-   (with-current-buffer
-   (window-buffer (minibuffer-selected-window))
- (derived-mode-p 'emacs-lisp-mode
+  (and (consp mct) (symbolp (car mct ; assume list of symbols
   'symbol)))
 
 (defun marginalia-classify-by-prompt ()



[elpa] externals/marginalia 7d3f018 024/241: Add annotations for files and buffers

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 7d3f01891d53b071ac70aa58f763442ebf7724cc
Author: Omar Antolín 
Commit: Omar Antolín 

Add annotations for files and buffers

These are not turned on by default.

For files, use size and modification time.

For buffers, modification status, file (if there is one) and major
mode.

These were imported from embark, per issue #3.
---
 marginalia.el | 21 +
 1 file changed, 21 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index a977b4c..47ced57 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -202,6 +202,27 @@ determine it."
   (when-let (doc (documentation-property (intern cand) 'group-documentation))
 (marginalia--annotation doc)))
 
+(defun marginalia-annotate-buffer (cand)
+  "Annotate buffer CAND with modification status, file name and major mode."
+  (when-let ((buffer (get-buffer cand)))
+(marginalia--annotation
+ (format "%s%s (%s)"
+ (if (buffer-modified-p buffer) "*" "")
+ (if-let ((file-name (buffer-file-name buffer)))
+ (abbreviate-file-name file-name)
+   "")
+ (buffer-local-value 'major-mode buffer)
+
+(defun marginalia-annotate-file (cand)
+  "Annotate file CAND with its size and modification time."
+  (when-let ((attributes (file-attributes cand)))
+(marginalia--annotation
+ (format "%7s %s"
+ (file-size-human-readable (file-attribute-size attributes))
+ (format-time-string
+  "%b %e %k:%M"
+  (file-attribute-modification-time attributes))
+
 (defun marginalia-classify-by-command-name ()
   "Lookup category for current command."
   (and marginalia--this-command



[elpa] externals/marginalia 4a5ada6 063/241: smaller variable field

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 4a5ada6dce6d6dee2148ec79bfac9761efe39f03
Author: Daniel Mendler 
Commit: Daniel Mendler 

smaller variable field
---
 marginalia.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 2cac877..69929c6 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -277,7 +277,7 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 (when-let (doc (documentation-property sym 'variable-documentation))
   (marginalia--fields
((if (boundp sym) (symbol-value sym) 'unbound)
-:truncate (/ marginalia-truncate-width 2) :format "%S" :face 
'marginalia-variable)
+:truncate (/ marginalia-truncate-width 3) :format "%S" :face 
'marginalia-variable)
(doc :truncate marginalia-truncate-width :face 
'marginalia-documentation)
 
 (defun marginalia-annotate-face (cand)



[elpa] externals/marginalia fbd898d 087/241: rename marginalia-annotate-command to marginalia-annotate-binding

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit fbd898d68233d24813a7d7bc9fe8c477ed623382
Author: Daniel Mendler 
Commit: Daniel Mendler 

rename marginalia-annotate-command to marginalia-annotate-binding
---
 marginalia.el | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 8386480..96375a1 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -143,7 +143,7 @@ only with the annotations that come with Emacs) without 
disabling
   :group 'marginalia)
 
 (defcustom marginalia-annotators-light
-  '((command . marginalia-annotate-command)
+  '((command . marginalia-annotate-binding)
 (customize-group . marginalia-annotate-customize-group)
 (variable . marginalia-annotate-variable)
 (face . marginalia-annotate-face)
@@ -279,24 +279,24 @@ WIDTH is the format width. This can be specified as 
alternative to FORMAT."
 (marginalia--fields
  (str :truncate marginalia-truncate-width :face 
'marginalia-documentation
 
-(defvar-local marginalia-annotate-command--hash nil
+(defvar-local marginalia-annotate-binding--hash nil
   "Hash table storing the keybinding of every command.
-This hash table is needed to speed up `marginalia-annotate-command'.")
+This hash table is needed to speed up `marginalia-annotate-binding'.")
 
-(defun marginalia-annotate-command (cand)
+(defun marginalia-annotate-binding (cand)
   "Annotate command CAND with keybinding."
   (with-current-buffer (window-buffer (minibuffer-selected-window))
 ;; Precomputing the keybinding of every command is faster than looking it 
up every time using
 ;; `where-is-internal'. `where-is-internal' generates a lot of garbage, 
leading to garbage
 ;; collecting pauses when interacting with the minibuffer. See
 ;; https://github.com/minad/marginalia/issues/16.
-(unless marginalia-annotate-command--hash
-  (setq marginalia-annotate-command--hash (make-hash-table))
+(unless marginalia-annotate-binding--hash
+  (setq marginalia-annotate-binding--hash (make-hash-table))
   (cl-do-all-symbols (sym)
 (when-let (key (and (commandp sym) (where-is-internal sym nil t)))
-  (puthash sym key marginalia-annotate-command--hash
+  (puthash sym key marginalia-annotate-binding--hash
 (when-let* ((sym (intern-soft cand))
-(binding (gethash sym marginalia-annotate-command--hash)))
+(binding (gethash sym marginalia-annotate-binding--hash)))
   (propertize (format " (%s)" (key-description binding)) 'face 
'marginalia-key
 
 ;; This annotator is consult-specific, it will annotate the `consult-buffer' 
command.
@@ -373,7 +373,7 @@ a face"
   "Annotate symbol CAND with its documentation string."
   (when-let (sym (intern-soft cand))
 (concat
- (marginalia-annotate-command cand)
+ (marginalia-annotate-binding cand)
  (marginalia--fields
   ((marginalia--symbol-class sym) :face 'marginalia-modified)
   ((cond



[elpa] externals/marginalia 3c80428 141/241: fix #41

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 3c8042845c62b565c211e11d54defa093153b715
Author: Daniel Mendler 
Commit: Daniel Mendler 

fix #41
---
 marginalia.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index bc56ddd..af9da14 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -221,7 +221,6 @@ determine it."
  Pre-declarations for external packages
 
 (defvar package--builtins)
-(defvar package-alist)
 (defvar package-archive-contents)
 (declare-function package--from-builtin "package")
 (declare-function package-desc-archive "package")
@@ -485,9 +484,10 @@ Similar to `marginalia-annotate-symbol', but does not show 
symbol class."
 
 (defun marginalia-annotate-package (cand)
   "Annotate package CAND with its description summary."
-  (when-let* ((pkg (intern (replace-regexp-in-string "-[[:digit:]\\.-]+$" "" 
cand)))
+  (when-let* ((pkg-alist (and (bound-and-true-p package-alist) package-alist))
+  (pkg (intern-soft (replace-regexp-in-string "-[[:digit:]\\.-]+$" 
"" cand)))
   ;; taken from `describe-package-1'
-  (desc (or (car (alist-get pkg package-alist))
+  (desc (or (car (alist-get pkg pkg-alist))
 (if-let (built-in (assq pkg package--builtins))
 (package--from-builtin built-in)
   (car (alist-get pkg package-archive-contents))



[elpa] externals/marginalia 9ca180b 026/241: richer formatting of file and buffer annotations

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 9ca180b15cc53c4938fc43cde7f8f2fbe27ce0c2
Author: Daniel Mendler 
Commit: Daniel Mendler 

richer formatting of file and buffer annotations

* add marginalia--align
* add a few faces
---
 marginalia.el | 171 ++
 1 file changed, 113 insertions(+), 58 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 52aa5bf..e0501af 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -44,18 +44,53 @@
   "Face used to highlight keys in `marginalia-mode'."
   :group 'marginalia)
 
+(defface marginalia-documentation
+  '((t :inherit completions-annotations :weight normal))
+  "Face used to highlight documentation string in `marginalia-mode'."
+  :group 'marginalia)
+
 (defface marginalia-variable
   '((t :inherit marginalia-key))
   "Face used to highlight variable values in `marginalia-mode'."
   :group 'marginalia)
 
-(defface marginalia-annotation
-  '((t :inherit completions-annotations :weight normal))
-  "Face used to highlight documentation string in `marginalia-mode'."
+(defface marginalia-mode
+  '((t :inherit marginalia-key))
+  "Face used to highlight major modes in `marginalia-mode'."
+  :group 'marginalia)
+
+(defface marginalia-date
+  '((t :inherit marginalia-key))
+  "Face used to highlight dates in `marginalia-mode'."
+  :group 'marginalia)
+
+(defface marginalia-size
+  '((t :inherit font-lock-constant-face :weight normal))
+  "Face used to highlight sizes in `marginalia-mode'."
+  :group 'marginalia)
+
+(defface marginalia-file-name
+  '((t :inherit marginalia-documentation))
+  "Face used to highlight file names in `marginalia-mode'."
   :group 'marginalia)
 
-(defcustom marginalia-annotation-width 80
-  "Width of annotation string."
+(defcustom marginalia-documentation-width 80
+  "Width of documentation string."
+  :type 'integer
+  :group 'marginalia)
+
+(defcustom marginalia-file-name-width 80
+  "Width of file name."
+  :type 'integer
+  :group 'marginalia)
+
+(defcustom marginalia-separator-width 4
+  "Field separator width."
+  :type 'string
+  :group 'marginalia)
+
+(defcustom marginalia-variable-width 30
+  "Width of variable value annotation string."
   :type 'integer
   :group 'marginalia)
 
@@ -117,6 +152,25 @@ determine it."
 (defvar marginalia--original-category nil
   "Original category reported by completion metadata.")
 
+(defmacro marginalia--align (&rest align)
+  "Align annotations to ALIGN."
+  (concat " "
+  (propertize
+   " "
+   'display
+   `(space :align-to (- right-fringe ,@align)
+
+(defsubst marginalia--separator ()
+  "Return separator string."
+  (make-string marginalia-separator-width 32))
+
+(defun marginalia--documentation (str)
+  "Format documentation string STR."
+  (concat
+   (marginalia--align marginalia-documentation-width)
+   (propertize (marginalia--truncate str marginalia-documentation-width)
+   'face 'marginalia-documentation)))
+
 (defun marginalia--truncate (str width)
   "Truncate string STR to WIDTH."
   (truncate-string-to-width (car (split-string str "\n")) width 0 32 "…"))
@@ -136,16 +190,6 @@ determine it."
(marginalia-annotate-command-binding cand)
(marginalia-annotate-symbol cand)))
 
-(defun marginalia--annotation (ann)
-  "Format annotation string ANN."
-  (concat " "
-  (propertize
-   " "
-   'display
-   '(space :align-to (- right-fringe marginalia-annotation-width)))
-  (propertize (marginalia--truncate ann marginalia-annotation-width)
-  'face 'marginalia-annotation)))
-
 (defun marginalia-annotate-symbol (cand)
   "Annotate symbol CAND with its documentation string."
   (when-let (doc (let ((sym (intern cand)))
@@ -153,75 +197,86 @@ determine it."
 ((fboundp sym) (ignore-errors (documentation sym)))
 ((facep sym) (documentation-property sym 
'face-documentation))
 (t (documentation-property sym 'variable-documentation)
-(marginalia--annotation doc)))
+(marginalia--documentation doc)))
 
 (defun marginalia-annotate-variable (cand)
   "Annotate variable CAND with its documentation string."
   (let ((sym (intern cand)))
 (when-let (doc (documentation-property sym 'variable-documentation))
-  (concat " "
-  (propertize
-   " "
-   'display
-   '(space :align-to (- right-fringe marginalia-annotation-width 
30)))
-  (propertize (marginalia--truncate (format "%S" (if (boundp sym)
-  (symbol-value 
sym)
-'unbound))
- 40)
-  'face 'marginalia-variable)
-  ""
-  (propertize (marginalia--truncate doc 
marginalia-annotation-width)
-  'face 'marginalia-

[elpa] externals/marginalia 27cd29d 101/241: add buffer size annotation, fix #29

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 27cd29d8564c3577acd4d71faaa31da0cd79aaef
Author: Daniel Mendler 
Commit: Daniel Mendler 

add buffer size annotation, fix #29
---
 marginalia.el | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index e99595e..7c17376 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -470,10 +470,21 @@ Similar to `marginalia-annotate-symbol', but does not 
show symbol class."
   "Annotate coding system CAND with its description."
   (marginalia--documentation (coding-system-doc-string (intern cand
 
+(defun marginalia--buffer-bytes (buf)
+  "Return byte size of BUF."
+  (with-current-buffer buf
+(position-bytes (let ((max (point-max)))
+  (if (= (buffer-size) (- max (point-min)))
+  max ;; Buffer not narrowed
+(save-restriction
+  (widen)
+  (point-max)))
+
 (defun marginalia-annotate-buffer (cand)
   "Annotate buffer CAND with modification status, file name and major mode."
   (when-let (buffer (get-buffer cand))
 (marginalia--fields
+ ((file-size-human-readable (marginalia--buffer-bytes buffer)) :width 7 
:face 'marginalia-size)
  ((concat
(if (buffer-modified-p buffer) "*" " ")
(if (buffer-local-value 'buffer-read-only buffer) "%" " "))
@@ -528,7 +539,7 @@ using `minibuffer-force-complete' on the candidate CAND."
(file-attribute-modification-time attributes)) :face 
'marginalia-date
 
 (defun marginalia-annotate-project-file (cand)
-  "Annotate file CAND with its size, modification time and other attributes."  
+  "Annotate file CAND with its size, modification time and other attributes."
   (when-let ((project (project-current))
  (root (project-root project))
  (file (expand-file-name cand root)))



[elpa] externals/marginalia 785297d 075/241: Indicate advised functions with an asterisk

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 785297d9f98d4d23a1bf9f047e6aeca889e3f9ea
Author: Omar Antolín 
Commit: Omar Antolín 

Indicate advised functions with an asterisk

Part of the work on issue #19.

Should we apply a face to the asterisk?
---
 marginalia.el | 25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 2020a3d..b6d795d 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -291,6 +291,16 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
(marginalia-annotate-command-binding cand)
(marginalia-annotate-symbol cand)))
 
+(defconst marginalia--advice-regexp
+  (rx bos
+  (1+ (seq (? "This function has ")
+   (or ":before" ":after" ":around" ":override"
+   ":before-while" ":before-until" ":after-while"
+   ":after-until" ":filter-args" ":filter-return")
+   " advice: " (0+ nonl) "\n"))
+  "\n")
+  "Regexp to match lines about advice in function documentation strings.")
+
 (defun marginalia-annotate-symbol (cand)
   "Annotate symbol CAND with its documentation string."
   (when-let ((sym (intern-soft cand)))
@@ -298,16 +308,11 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
  (cond
   ((fboundp sym)
(when-let ((doc (ignore-errors (documentation sym
- (replace-regexp-in-string
-  (rx bos
-  (1+ (seq (? "This function has ")
-   (or ":before" ":after" ":around" ":override" 
-   ":before-while" ":before-until" ":after-while"  
-   ":after-until" ":filter-args" ":filter-return")
-   " advice: " (0+ nonl) "\n"))
-  "\n")
-  ""
-  doc)))
+ (if (string-match-p marginalia--advice-regexp doc)
+ (concat "*"
+ (replace-regexp-in-string
+  marginalia--advice-regexp "" doc))
+   (concat " " doc
   ((facep sym) (documentation-property sym 'face-documentation))
   (t (documentation-property sym 'variable-documentation))
 



[elpa] externals/marginalia d38a278 151/241: readme: do not export drawers

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit d38a27867bcec0bafa43e8d1bd3fd96a32b15d31
Author: Daniel Mendler 
Commit: Daniel Mendler 

readme: do not export drawers
---
 README.org  | 5 +
 marginalia.texi | 4 
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 5875c67..25b09a8 100644
--- a/README.org
+++ b/README.org
@@ -5,8 +5,11 @@
 #+TEXINFO_DIR_CATEGORY: Emacs
 #+TEXINFO_DIR_TITLE: Marginalia: (marginalia).
 #+TEXINFO_DIR_DESC: Marginalia in the minibuffer
+#+OPTIONS: d:nil
 
+:BADGE:
 
[[https://melpa.org/#/marginalia][file:https://melpa.org/packages/marginalia-badge.svg]]
+:END:
 
 * Introduction
 
@@ -36,8 +39,10 @@ category with the completion initiated by the command (see 
the variable
 =marginalia-command-categories=). The list of available classifiers is
 specified by the variable =marginalia-classifiers=.
 
+:SCREENSHOT:
 #+CAPTION: marginalia-mode with Selectrum
 [[https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true]]
+:END:
 
 * Configuration
 
diff --git a/marginalia.texi b/marginalia.texi
index 4f9f00a..f2fc173 100644
--- a/marginalia.texi
+++ b/marginalia.texi
@@ -22,8 +22,6 @@
 @ifnottex
 @node Top
 @top marginalia.el - Marginalia in the minibuffer
-
-@uref{https://melpa.org/#/marginalia, 
file:https://melpa.org/packages/marginalia-badge.svg}
 @end ifnottex
 
 @menu
@@ -60,8 +58,6 @@ category with the completion initiated by the command (see 
the variable
 @samp{marginalia-command-categories}). The list of available classifiers is
 specified by the variable @samp{marginalia-classifiers}.
 
-@uref{https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true}
-
 @node Configuration
 @chapter Configuration
 



[elpa] externals/marginalia 2805127 058/241: introduce a small dsl marginalia--fields which helps with formatting

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 2805127262320fbea43bb9b8b5e2cea37ebcb8f8
Author: Daniel Mendler 
Commit: Daniel Mendler 

introduce a small dsl marginalia--fields which helps with formatting
---
 marginalia.el | 150 --
 1 file changed, 73 insertions(+), 77 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 6865d5d..7c7c42b 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -204,25 +204,44 @@ determine it."
 (defvar marginalia--original-category nil
   "Original category reported by completion metadata.")
 
-(defun marginalia--align (&rest strs)
-  "Align STRS at the right margin."
-  (let ((str (apply #'concat strs)))
-(concat " "
-(propertize
- " "
- 'display
- `(space :align-to (- right-fringe ,(length str
-str)))
+(defsubst marginalia--truncate (str width)
+  "Truncate string STR to WIDTH."
+  (truncate-string-to-width (car (split-string str "\n")) width 0 32 "…"))
+
+(defsubst marginalia--align (str)
+  "Align STR at the right margin."
+  (concat " "
+  (propertize
+   " "
+   'display
+   `(space :align-to (- right-fringe ,(length str
+  str))
+
+(cl-defun marginalia--field (field &key truncate format face width)
+  "Format FIELD as a string according to some options.
+
+TRUNCATE is the truncation width.
+FORMAT is a format string. This must be used if the field value is not a 
string.
+FACE is the name of the face, with which the field should be propertized.
+WIDTH is the format width. This can be specified as alternative to FORMAT."
+  (cl-assert (not (and width format)))
+  (when width (setq format (format "%%-%ds" width)))
+  (when format (setq field `(format ,format ,field)))
+  (when truncate (setq field `(marginalia--truncate ,field ,truncate)))
+  (when face (setq field `(propertize ,field 'face ,face)))
+  (list 'marginalia-separator field))
+
+(defmacro marginalia--fields (&rest fields)
+  "Format annotation FIELDS as a string with separators in between."
+  `(marginalia--align (concat ,@(cdr (mapcan (lambda (field)
+   (apply #'marginalia--field 
field))
+ fields)
 
 (defun marginalia--documentation (str)
   "Format documentation string STR."
-  (marginalia--align
-   (propertize (marginalia--truncate str marginalia-documentation-width)
-   'face 'marginalia-documentation)))
-
-(defun marginalia--truncate (str width)
-  "Truncate string STR to WIDTH."
-  (truncate-string-to-width (car (split-string str "\n")) width 0 32 "…"))
+  (when str
+(marginalia--fields
+ (str :truncate marginalia-documentation-width :face 
'marginalia-documentation
 
 (defvar-local marginalia-annotate-command-binding--hash nil
   "Hash table storing the keybinding of every command.
@@ -251,36 +270,29 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 
 (defun marginalia-annotate-symbol (cand)
   "Annotate symbol CAND with its documentation string."
-  (when-let (doc (let ((sym (intern cand)))
-   (cond
-((fboundp sym) (ignore-errors (documentation sym)))
-((facep sym) (documentation-property sym 
'face-documentation))
-(t (documentation-property sym 'variable-documentation)
-(marginalia--documentation doc)))
+  (marginalia--documentation
+   (let ((sym (intern cand)))
+ (cond
+  ((fboundp sym) (ignore-errors (documentation sym)))
+  ((facep sym) (documentation-property sym 'face-documentation))
+  (t (documentation-property sym 'variable-documentation))
 
 (defun marginalia-annotate-variable (cand)
   "Annotate variable CAND with its documentation string."
   (let ((sym (intern cand)))
 (when-let (doc (documentation-property sym 'variable-documentation))
-  (marginalia--align
-   (propertize (marginalia--truncate (format "%S" (if (boundp sym)
-  (symbol-value sym)
-'unbound))
- marginalia-variable-width)
-   'face 'marginalia-variable)
-   marginalia-separator
-   (propertize (marginalia--truncate doc marginalia-documentation-width)
-   'face 'marginalia-documentation)
+  (marginalia--fields
+   ((if (boundp sym) (symbol-value sym) 'unbound)
+:truncate marginalia-variable-width :format "%S" :face 
'marginalia-variable)
+   (doc :truncate marginalia-documentation-width :face 
'marginalia-documentation)
 
 (defun marginalia-annotate-face (cand)
   "Annotate face CAND with documentation string and face example."
   (let ((sym (intern cand)))
 (when-let (doc (documentation-property sym 'face-documentation))
-  (marginalia--align
-   (propertize "abcd

[elpa] externals/marginalia f16d26a 082/241: marginalia-annotate-symbol: add keybindings to commands

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit f16d26a17bb93684dd0f099db6dc0400a743dcc3
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia-annotate-symbol: add keybindings to commands
---
 marginalia.el | 42 +++---
 1 file changed, 19 insertions(+), 23 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 5e75b8d..48c2a8c 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -143,7 +143,7 @@ only with the annotations that come with Emacs) without 
disabling
   :group 'marginalia)
 
 (defcustom marginalia-annotators-light
-  '((command . marginalia-annotate-command-binding)
+  '((command . marginalia-annotate-command)
 (customize-group . marginalia-annotate-customize-group)
 (variable . marginalia-annotate-variable)
 (face . marginalia-annotate-face)
@@ -169,7 +169,7 @@ See also `marginalia-annotators-heavy'."
'((file . marginalia-annotate-file)
  (buffer . marginalia-annotate-buffer)
  (virtual-buffer . marginalia-annotate-virtual-buffer-full)
- (command . marginalia-annotate-command-full))
+ (command . marginalia-annotate-symbol))
marginalia-annotators-light)
   "Heavy annotator functions.
 
@@ -277,32 +277,26 @@ WIDTH is the format width. This can be specified as 
alternative to FORMAT."
 (marginalia--fields
  (str :truncate marginalia-truncate-width :face 
'marginalia-documentation
 
-(defvar-local marginalia-annotate-command-binding--hash nil
+(defvar-local marginalia-annotate-command--hash nil
   "Hash table storing the keybinding of every command.
-This hash table is needed to speed up `marginalia-annotate-command-binding'.")
+This hash table is needed to speed up `marginalia-annotate-command'.")
 
-(defun marginalia-annotate-command-binding (cand)
+(defun marginalia-annotate-command (cand)
   "Annotate command CAND with keybinding."
   (with-current-buffer (window-buffer (minibuffer-selected-window))
 ;; Precomputing the keybinding of every command is faster than looking it 
up every time using
 ;; `where-is-internal'. `where-is-internal' generates a lot of garbage, 
leading to garbage
 ;; collecting pauses when interacting with the minibuffer. See
 ;; https://github.com/minad/marginalia/issues/16.
-(unless marginalia-annotate-command-binding--hash
-  (setq marginalia-annotate-command-binding--hash (make-hash-table))
+(unless marginalia-annotate-command--hash
+  (setq marginalia-annotate-command--hash (make-hash-table))
   (cl-do-all-symbols (sym)
 (when-let (key (and (commandp sym) (where-is-internal sym nil t)))
-  (puthash sym key marginalia-annotate-command-binding--hash
+  (puthash sym key marginalia-annotate-command--hash
 (when-let* ((sym (intern-soft cand))
-(binding (gethash sym 
marginalia-annotate-command-binding--hash)))
+(binding (gethash sym marginalia-annotate-command--hash)))
   (propertize (format " (%s)" (key-description binding)) 'face 
'marginalia-key
 
-(defun marginalia-annotate-command-full (cand)
-  "Annotate command CAND with the keybinding and its documentation string."
-  (concat
-   (marginalia-annotate-command-binding cand)
-   (marginalia-annotate-symbol cand)))
-
 ;; This annotator is consult-specific, it will annotate the `consult-buffer' 
command.
 (defun marginalia-annotate-virtual-buffer-class (cand)
   "Annotate virtual-buffer CAND with the buffer class."
@@ -341,14 +335,16 @@ This hash table is needed to speed up 
`marginalia-annotate-command-binding'.")
 ((facep sym) (documentation-property sym 
'face-documentation))
 (t (documentation-property sym 'variable-documentation)))
"")))
-  (marginalia--fields
-   ((if (and (fboundp sym) (string-match-p marginalia--advice-regexp doc))
-"*" " ")
-:face 'marginalia-modified)
-   ((if (fboundp sym)
-(replace-regexp-in-string marginalia--advice-regexp "" doc)
-  doc)
-:truncate marginalia-truncate-width :face 
'marginalia-documentation)
+  (concat
+   (marginalia-annotate-command cand)
+   (marginalia--fields
+((if (and (fboundp sym) (string-match-p marginalia--advice-regexp doc))
+ "*" " ")
+ :face 'marginalia-modified)
+((if (fboundp sym)
+ (replace-regexp-in-string marginalia--advice-regexp "" doc)
+   doc)
+ :truncate marginalia-truncate-width :face 
'marginalia-documentation))
 
 (defun marginalia-annotate-imenu (cand)
   "Annotate imenu CAND with its documentation string."



[elpa] externals/marginalia 88ba686 090/241: remove unnecessary :group specification

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 88ba6864278cdd01f622c4a6d0f3f000273f704c
Author: Daniel Mendler 
Commit: Daniel Mendler 

remove unnecessary :group specification
---
 marginalia.el | 69 ---
 1 file changed, 23 insertions(+), 46 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 0ceefa9..6686b4b 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -41,90 +41,73 @@
 
 (defface marginalia-key
   '((t :inherit font-lock-keyword-face))
-  "Face used to highlight keys in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight keys in `marginalia-mode'.")
 
 (defface marginalia-lighter
   '((t :inherit marginalia-size))
-  "Face used to highlight lighters in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight lighters in `marginalia-mode'.")
 
 (defface marginalia-on
   '((t :inherit success))
-  "Face used to signal enabled modes."
-  :group 'marginalia)
+  "Face used to signal enabled modes.")
 
 (defface marginalia-off
   '((t :inherit error))
-  "Face used to signal disabled modes."
-  :group 'marginalia)
+  "Face used to signal disabled modes.")
 
 (defface marginalia-documentation
   '((t :inherit completions-annotations))
-  "Face used to highlight documentation string in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight documentation string in `marginalia-mode'.")
 
 (defface marginalia-variable
   '((t :inherit marginalia-key))
-  "Face used to highlight variable values in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight variable values in `marginalia-mode'.")
 
 (defface marginalia-mode
   '((t :inherit marginalia-key))
-  "Face used to highlight major modes in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight major modes in `marginalia-mode'.")
 
 (defface marginalia-date
   '((t :inherit marginalia-key))
-  "Face used to highlight dates in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight dates in `marginalia-mode'.")
 
 (defface marginalia-version
   '((t :inherit marginalia-size))
-  "Face used to highlight package version in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight package version in `marginalia-mode'.")
 
 (defface marginalia-archive
   '((t :inherit warning))
-  "Face used to highlight package archives in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight package archives in `marginalia-mode'.")
 
 (defface marginalia-installed
   '((t :inherit success))
-  "Face used to highlight package status in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight package status in `marginalia-mode'.")
 
 (defface marginalia-size
   '((t :inherit font-lock-constant-face))
-  "Face used to highlight sizes in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight sizes in `marginalia-mode'.")
 
 (defface marginalia-modified
   '((t :inherit font-lock-negation-char-face))
-  "Face used to highlight modification indicators in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight modification indicators in `marginalia-mode'.")
 
 (defface marginalia-file-name
   '((t :inherit marginalia-documentation))
-  "Face used to highlight file names in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight file names in `marginalia-mode'.")
 
 (defface marginalia-file-modes
   '((t :inherit font-lock-string-face))
-  "Face used to highlight file modes in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight file modes in `marginalia-mode'.")
 
 (defface marginalia-file-owner
   '((t :inherit font-lock-preprocessor-face))
-  "Face used to highlight file owners in `marginalia-mode'."
-  :group 'marginalia)
+  "Face used to highlight file owners in `marginalia-mode'.")
 
 (defcustom marginalia-truncate-width 80
   "Maximum truncation width of annotation fields.
 
 This value is adjusted in the `minibuffer-setup-hook' depending on the 
`window-width'."
-  :type 'integer
-  :group 'marginalia)
+  :type 'integer)
 
 (defcustom marginalia-annotators
   '(marginalia-annotators-light marginalia-annotators-heavy)
@@ -139,8 +122,7 @@ only with the annotations that come with Emacs) without 
disabling
   :type '(repeat (choice (const :tag "Light" marginalia-annotators-light)
  (const :tag "Heavy" marginalia-annotators-heavy)
  (const :tag "None" nil)
- (symbol :tag "Other")))
-  :group 'marginalia)
+ (symbol :tag "Other"
 
 (defcustom marginalia-annotators-light
   '((command . marginalia-annotate-binding)
@@ -162,8 +144,7 @@ Associates completion categories with annotation functions.
 Each annotation function must return a string,
 which is appended to the completion candidate.
 See also `marginalia-annotators-heavy'."
-  :type '(alist :key-type symbol :value-type function)
-  :group 'marginalia)
+  :type '(alist :key-type symbol :

[elpa] externals/marginalia 3febe72 155/241: fix #45

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 3febe72777b7972bc40b15eb1eea0ab0f941a33c
Author: Daniel Mendler 
Commit: Daniel Mendler 

fix #45
---
 marginalia.el | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index d7164fd..d430f9e 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -222,15 +222,17 @@ determine it."
 
  Pre-declarations for external packages
 
+(declare-function bookmark-get-front-context-string "bookmark")
+(declare-function bookmark-get-filename "bookmark")
+
 (defvar package--builtins)
 (defvar package-archive-contents)
 (declare-function package--from-builtin "package")
 (declare-function package-desc-archive "package")
+(declare-function package-desc-status "package")
 (declare-function package-desc-summary "package")
 (declare-function package-desc-version "package")
-(declare-function package-desc-status "package")
 (declare-function package-version-join "package")
-
 (declare-function project-current "project")
 (declare-function project-root "project")
 



[elpa] externals/marginalia 74603c0 091/241: use mapatoms to fix the harmless unused variable warning

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 74603c012868a824729d647539ccda137fc71296
Author: Daniel Mendler 
Commit: Daniel Mendler 

use mapatoms to fix the harmless unused variable warning
---
 marginalia.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 6686b4b..7d74302 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -269,9 +269,9 @@ This hash table is needed to speed up 
`marginalia-annotate-binding'.")
 ;; https://github.com/minad/marginalia/issues/16.
 (unless marginalia-annotate-binding--hash
   (setq marginalia-annotate-binding--hash (make-hash-table))
-  (cl-do-all-symbols (sym)
-(when-let (key (and (commandp sym) (where-is-internal sym nil t)))
-  (puthash sym key marginalia-annotate-binding--hash
+  (mapatoms (lambda (sym)
+  (when-let (key (and (commandp sym) (where-is-internal sym 
nil t)))
+(puthash sym key marginalia-annotate-binding--hash)
 (when-let* ((sym (intern-soft cand))
 (binding (gethash sym marginalia-annotate-binding--hash)))
   (propertize (format " (%s)" (key-description binding)) 'face 
'marginalia-key



[elpa] externals/marginalia 56ad689 094/241: modify marginalia-annotate-imenu regexp such that it works with consult narrowing

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 56ad689886e618616f9ee282c3d8d57f8270450b
Author: Daniel Mendler 
Commit: Daniel Mendler 

modify marginalia-annotate-imenu regexp such that it works with consult 
narrowing
---
 marginalia.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 5c506d9..cef1819 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -378,7 +378,7 @@ Similar to `marginalia-annotate-symbol', but does not show 
symbol class."
   (when (provided-mode-derived-p (buffer-local-value 'major-mode
  (window-buffer 
(minibuffer-selected-window)))
  'emacs-lisp-mode)
-(marginalia-annotate-symbol (replace-regexp-in-string "^.*? " "" cand
+(marginalia-annotate-symbol (replace-regexp-in-string "^.* " "" cand
 
 (defun marginalia-annotate-variable (cand)
   "Annotate variable CAND with its documentation string."



[elpa] externals/marginalia 64fe724 182/241: readme: do not use drawers to prevent export

2021-05-28 Thread monnier--- via
branch: externals/marginalia
commit 64fe7245f1089a1d9f642432632085a0c5d8cfaf
Author: Daniel Mendler 
Commit: Daniel Mendler 

readme: do not use drawers to prevent export
---
 README.org | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/README.org b/README.org
index 943f0f1..bac92f0 100644
--- a/README.org
+++ b/README.org
@@ -5,14 +5,11 @@
 #+texinfo_dir_category: Emacs
 #+texinfo_dir_title: Marginalia: (marginalia).
 #+texinfo_dir_desc: Marginalia in the minibuffer
-#+options: d:nil
 
 #+html: https://upload.wikimedia.org/wikipedia/commons/4/4f/Marginalia_%285095211566%29.jpg";
 align="right" width="30%">
 
-:badge:
-[[https://melpa.org/#/marginalia][file:https://melpa.org/packages/marginalia-badge.svg]]
-[[https://stable.melpa.org/#/marginalia][file:https://stable.melpa.org/packages/marginalia-badge.svg]]
-:end:
+#+html: https://melpa.org/#/marginalia";>https://melpa.org/packages/marginalia-badge.svg"/>
+#+html: https://stable.melpa.org/#/marginalia";>https://stable.melpa.org/packages/marginalia-badge.svg"/>
 
 * Introduction
 
@@ -42,10 +39,7 @@ category with the completion initiated by the command (see 
the variable
 =marginalia-command-categories=). The list of available classifiers is
 specified by the variable =marginalia-classifiers=.
 
-:screenshot:
-#+caption: marginalia-mode with Selectrum
-[[https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true]]
-:end:
+#+html: https://github.com/minad/marginalia/blob/main/marginalia-mode.png?raw=true";>
 
 * Configuration
 



  1   2   3   >