[nongnu] elpa/org-contrib f46a697 1/2: lisp/org-mac-link.el: Add a maintainer and a homepage

2021-05-19 Thread ELPA Syncer
branch: elpa/org-contrib
commit f46a6970a8a320b011702125746bb386fab971ea
Author: Bastien Guerry 
Commit: Bastien Guerry 

lisp/org-mac-link.el: Add a maintainer and a homepage
---
 lisp/org-mac-link.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/org-mac-link.el b/lisp/org-mac-link.el
index d887128..b94df7b 100644
--- a/lisp/org-mac-link.el
+++ b/lisp/org-mac-link.el
@@ -8,6 +8,8 @@
 ;;  Daniil Frumin 
 ;;  Alan Schmitt 
 ;;  Mike McLean 
+;; Maintainer: Aimé Bertrand 
+;; Homepage: https://sr.ht/~aimebertrand/org-mac-link/
 ;;
 ;; This file is not part of GNU Emacs.
 ;;



[nongnu] elpa/org-contrib e69be2c 2/2: README*: Announce org-mac-link.el will be removed from next release

2021-05-19 Thread ELPA Syncer
branch: elpa/org-contrib
commit e69be2c33885033e9706148568a2250c19587cb8
Author: Bastien Guerry 
Commit: Bastien Guerry 

README*: Announce org-mac-link.el will be removed from next release
---
 README.md  | 1 +
 README.org | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/README.md b/README.md
index e585bc8..cbdc10d 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,7 @@ find after the "Homepage:" keyword in the files themselves:
 -   **ol-notmuch.el:** Links to notmuch messages
 -   **ob-julia.el:** org-babel functions for julia code evaluation
 -   **org-notify.el:** Notifications for Org-mode
+-   **org-mac-link.el:** Insert org-mode links to items selected in various 
Mac apps
 
 
 # Other files
diff --git a/README.org b/README.org
index aca30e0..2fb00d9 100644
--- a/README.org
+++ b/README.org
@@ -36,6 +36,8 @@ find after the "Homepage:" keyword in the files themselves:
 - ol-notmuch.el :: Links to notmuch messages
 - ob-julia.el :: org-babel functions for julia code evaluation
 - org-notify.el :: Notifications for Org-mode
+- org-mac-link.el :: Insert org-mode links to items selected in various Mac 
apps
+
 
 ** Other files
 *** Org utils



[nongnu] elpa/org-contrib updated (c3347d3 -> e69be2c)

2021-05-19 Thread ELPA Syncer
elpasync pushed a change to branch elpa/org-contrib.

  from  c3347d3   org-mac-link.el: Add support for qutebrowser
   new  f46a697   lisp/org-mac-link.el: Add a maintainer and a homepage
   new  e69be2c   README*: Announce org-mac-link.el will be removed from 
next release


Summary of changes:
 README.md| 1 +
 README.org   | 2 ++
 lisp/org-mac-link.el | 2 ++
 3 files changed, 5 insertions(+)



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

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit d2e9d8b8f0c000dd0d7bed4714e297e38b9cc3d8
Merge: 1a5a326 ab9f2af
Author: Bastien 
Commit: Bastien 

Merge branch 'maint'



[elpa] externals/org updated (53fd5b7 -> 3c241ab)

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

  from  53fd5b7   ob-comint.el, ob-python.el: Async session evaluation
   new  038aff3   * lisp/org-clock.el (org-clock-get-table-data): Use 
proper closures
   new  71c4031   * lisp/org-colview.el (org-columns-map): Use proper 
closures
   new  1a5a326   * lisp/org-timer.el (org-timer--run-countdown-timer): Use 
closures
   new  ab9f2af   lisp/org.el: Bump version number
   new  d2e9d8b   Merge branch 'maint'
   new  6524301   mk/server.mk: Complete and fix 9802877fb
   new  3c241ab   Merge branch 'maint'


Summary of changes:
 lisp/org-clock.el   | 26 +++
 lisp/org-colview.el | 60 ++---
 lisp/org-timer.el   | 17 ---
 mk/server.mk|  2 +-
 4 files changed, 53 insertions(+), 52 deletions(-)



[elpa] externals-release/org 6524301 2/2: mk/server.mk: Complete and fix 9802877fb

2021-05-19 Thread ELPA Syncer
branch: externals-release/org
commit 652430128896e690dc6ef2a83891a1209094b3da
Author: Bastien 
Commit: Bastien 

mk/server.mk: Complete and fix 9802877fb
---
 mk/server.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/server.mk b/mk/server.mk
index 30bc3b8..e9bda08 100644
--- a/mk/server.mk
+++ b/mk/server.mk
@@ -38,7 +38,7 @@ ORGFULL   = README COPYING lisp/ \
etc/ contrib/ doc/ testing/
 ORGFULL  := $(ORGFULL:%/=%/*)
 ORGELPA   = README_ELPA COPYING etc/ORG-NEWS lisp/ \
-   doc/dir doc/org doc/orgguide doc/orgcard.pdf \
+   doc/dir doc/org.info doc/orgguide.info doc/orgcard.pdf \
etc/styles/ org-pkg.el
 ORGELPA  := $(ORGELPA:%/=%/*)
 ORGELPAPLUS := $(ORGELPA:org-pkg%=org-plus-contrib-pkg%)



[elpa] externals/org 71c4031 2/5: * lisp/org-colview.el (org-columns-map): Use proper closures

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit 71c40314f571964dc5bacdccfcb71bdb7221ef05
Author: Stefan Monnier 
Commit: Bastien 

* lisp/org-colview.el (org-columns-map): Use proper closures

Also prefer #' to quote function names.

(org-columns-map): Use derived-mode-p.
---
 lisp/org-colview.el | 60 ++---
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 0a1c02d..2e1c29a 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -162,20 +162,20 @@ See `org-columns-summary-types' for details.")
   (org-overview)
   (org-content))
 
-(org-defkey org-columns-map "c" 'org-columns-content)
-(org-defkey org-columns-map "o" 'org-overview)
-(org-defkey org-columns-map "e" 'org-columns-edit-value)
-(org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo)
-(org-defkey org-columns-map "\C-c\C-c" 'org-columns-toggle-or-columns-quit)
-(org-defkey org-columns-map "\C-c\C-o" 'org-columns-open-link)
-(org-defkey org-columns-map "v" 'org-columns-show-value)
-(org-defkey org-columns-map "q" 'org-columns-quit)
-(org-defkey org-columns-map "r" 'org-columns-redo)
-(org-defkey org-columns-map "g" 'org-columns-redo)
-(org-defkey org-columns-map [left] 'backward-char)
-(org-defkey org-columns-map "\M-b" 'backward-char)
-(org-defkey org-columns-map "a" 'org-columns-edit-allowed)
-(org-defkey org-columns-map "s" 'org-columns-edit-attributes)
+(org-defkey org-columns-map "c"#'org-columns-content)
+(org-defkey org-columns-map "o"#'org-overview)
+(org-defkey org-columns-map "e"#'org-columns-edit-value)
+(org-defkey org-columns-map "\C-c\C-t" #'org-columns-todo)
+(org-defkey org-columns-map "\C-c\C-c" #'org-columns-toggle-or-columns-quit)
+(org-defkey org-columns-map "\C-c\C-o" #'org-columns-open-link)
+(org-defkey org-columns-map "v"#'org-columns-show-value)
+(org-defkey org-columns-map "q"#'org-columns-quit)
+(org-defkey org-columns-map "r"#'org-columns-redo)
+(org-defkey org-columns-map "g"#'org-columns-redo)
+(org-defkey org-columns-map [left] #'backward-char)
+(org-defkey org-columns-map "\M-b" #'backward-char)
+(org-defkey org-columns-map "a"#'org-columns-edit-allowed)
+(org-defkey org-columns-map "s"#'org-columns-edit-attributes)
 (org-defkey org-columns-map "\M-f"
(lambda () (interactive) (goto-char (1+ (point)
 (org-defkey org-columns-map [right]
@@ -187,7 +187,7 @@ See `org-columns-summary-types' for details.")
(while (and (org-invisible-p2) (not (eobp)))
  (beginning-of-line 2))
(move-to-column col)
-   (if (eq major-mode 'org-agenda-mode)
+   (if (derived-mode-p 'org-agenda-mode)
(org-agenda-do-context-action)
 (org-defkey org-columns-map [up]
(lambda () (interactive)
@@ -198,20 +198,20 @@ See `org-columns-summary-types' for details.")
(move-to-column col)
(if (eq major-mode 'org-agenda-mode)
(org-agenda-do-context-action)
-(org-defkey org-columns-map [(shift right)] 'org-columns-next-allowed-value)
-(org-defkey org-columns-map "n" 'org-columns-next-allowed-value)
-(org-defkey org-columns-map [(shift left)] 'org-columns-previous-allowed-value)
-(org-defkey org-columns-map "p" 'org-columns-previous-allowed-value)
-(org-defkey org-columns-map "<" 'org-columns-narrow)
-(org-defkey org-columns-map ">" 'org-columns-widen)
-(org-defkey org-columns-map [(meta right)] 'org-columns-move-right)
-(org-defkey org-columns-map [(meta left)] 'org-columns-move-left)
-(org-defkey org-columns-map [(shift meta right)] 'org-columns-new)
-(org-defkey org-columns-map [(shift meta left)] 'org-columns-delete)
+(org-defkey org-columns-map [(shift right)] #'org-columns-next-allowed-value)
+(org-defkey org-columns-map "n" #'org-columns-next-allowed-value)
+(org-defkey org-columns-map [(shift left)] 
#'org-columns-previous-allowed-value)
+(org-defkey org-columns-map "p" #'org-columns-previous-allowed-value)
+(org-defkey org-columns-map "<" #'org-columns-narrow)
+(org-defkey org-columns-map ">" #'org-columns-widen)
+(org-defkey org-columns-map [(meta right)] #'org-columns-move-right)
+(org-defkey org-columns-map [(meta left)]  #'org-columns-move-left)
+(org-defkey org-columns-map [(shift meta right)] #'org-columns-new)
+(org-defkey org-columns-map [(shift meta left)]  #'org-columns-delete)
 (dotimes (i 10)
   (org-defkey org-columns-map (number-to-string i)
- `(lambda () (interactive)
-(org-columns-next-allowed-value nil ,i
+ (lambda () (interactive)
+   (org-columns-next-allowed-value nil i
 
 (easy-menu-define org-columns-menu org-columns-map "Org Column Menu"
   '("Column"
@@ -490,7 +490,7 @@ for the duration of the command.")
   (org-add-props " " nil 'display `(space :align-to ,linum-offset))
   (org-a

[elpa] externals-release/org ab9f2af 1/2: lisp/org.el: Bump version number

2021-05-19 Thread ELPA Syncer
branch: externals-release/org
commit ab9f2af34fef9286b4906df9f72eff7973eeca11
Author: Bastien 
Commit: Bastien 

lisp/org.el: Bump version number

* lisp/org.el: Bump version number.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index eb0c808..25dce46 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8,7 +8,7 @@
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: https://orgmode.org
 
-;; Version: 9.4.5
+;; Version: 9.4.6
 
 ;; This file is part of GNU Emacs.
 ;;



[elpa] externals/org 038aff3 1/5: * lisp/org-clock.el (org-clock-get-table-data): Use proper closures

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit 038aff34db3f7e6e0a01b784f6854df02083fc27
Author: Stefan Monnier 
Commit: Bastien 

* lisp/org-clock.el (org-clock-get-table-data): Use proper closures

Also, prefer #' to quote function names
---
 lisp/org-clock.el | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 42c5dae..5480a37 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -549,8 +549,8 @@ of a different task.")
   "Marker pointing to the task that has been interrupted by the current 
clock.")
 
 (defvar org-clock-mode-line-map (make-sparse-keymap))
-(define-key org-clock-mode-line-map [mode-line mouse-2] 'org-clock-goto)
-(define-key org-clock-mode-line-map [mode-line mouse-1] 'org-clock-menu)
+(define-key org-clock-mode-line-map [mode-line mouse-2] #'org-clock-goto)
+(define-key org-clock-mode-line-map [mode-line mouse-1] #'org-clock-menu)
 
 (defun org-clock--translate (s language)
   "Translate string S into using string LANGUAGE.
@@ -1419,12 +1419,12 @@ the default behavior."
   (setq org-clock-mode-line-timer
 (run-with-timer org-clock-update-period
 org-clock-update-period
-'org-clock-update-mode-line)))
+#'org-clock-update-mode-line)))
 (when org-clock-idle-timer
   (cancel-timer org-clock-idle-timer)
   (setq org-clock-idle-timer nil))
 (setq org-clock-idle-timer
-  (run-with-timer 60 60 'org-resolve-clocks-if-idle))
+  (run-with-timer 60 60 #'org-resolve-clocks-if-idle))
 (message "Clock starts at %s - %s" ts org--msg-extra)
 (run-hooks 'org-clock-in-hook))
 
@@ -1721,7 +1721,7 @@ to, overriding the existing value of 
`org-clock-out-switch-to-state'."
  (unless (org-clocking-p)
(setq org-clock-current-task nil)))
 
-(add-hook 'org-clock-out-hook 'org-clock-remove-empty-clock-drawer)
+(add-hook 'org-clock-out-hook #'org-clock-remove-empty-clock-drawer)
 
 (defun org-clock-remove-empty-clock-drawer ()
   "Remove empty clock drawers in current subtree."
@@ -2017,7 +2017,7 @@ Use `\\[org-clock-remove-overlays]' to remove the subtree 
times."
  (when time (org-clock-put-overlay time)
;; Arrange to remove the overlays upon next change.
(when org-remove-highlights-with-change
- (add-hook 'before-change-functions 'org-clock-remove-overlays
+ (add-hook 'before-change-functions #'org-clock-remove-overlays
nil 'local
 (let* ((h (/ org-clock-file-total-minutes 60))
   (m (- org-clock-file-total-minutes (* 60 h
@@ -2068,7 +2068,7 @@ If NOREMOVE is nil, remove this function from the
 (setq org-clock-overlays nil)
 (unless noremove
   (remove-hook 'before-change-functions
-  'org-clock-remove-overlays 'local
+  #'org-clock-remove-overlays 'local
 
 ;;;###autoload
 (defun org-clock-out-if-current ()
@@ -2953,12 +2953,12 @@ PROPERTIES: The list properties specified in the 
`:properties' parameter
 (save-excursion
   (org-clock-sum ts te
 (when matcher
-  `(lambda ()
- (let* ((todo (org-get-todo-state))
-(tags-list (org-get-tags))
-(org-scanner-tags tags-list)
-(org-trust-scanner-tags t))
-   (funcall ,matcher todo tags-list nil)
+  (lambda ()
+(let* ((todo (org-get-todo-state))
+   (tags-list (org-get-tags))
+   (org-scanner-tags tags-list)
+   (org-trust-scanner-tags t))
+  (funcall matcher todo tags-list nil)
   (goto-char (point-min))
   (setq st t)
   (while (or (and (bobp) (prog1 st (setq st nil))



[elpa] externals-release/org updated (857ae36 -> 6524301)

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

  from  857ae36   org.el (org-src--contents-for-write-back): Indent blank 
lines
   new  ab9f2af   lisp/org.el: Bump version number
   new  6524301   mk/server.mk: Complete and fix 9802877fb


Summary of changes:
 lisp/org.el  | 2 +-
 mk/server.mk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



[elpa] externals/org 1a5a326 3/5: * lisp/org-timer.el (org-timer--run-countdown-timer): Use closures

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit 1a5a326f106fa34b07b737c769308cbdfaeeb94d
Author: Stefan Monnier 
Commit: Bastien 

* lisp/org-timer.el (org-timer--run-countdown-timer): Use closures
---
 lisp/org-timer.el | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index 60c6fa6..67b8c46 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -366,7 +366,7 @@ VALUE can be `on', `off', or `paused'."
(setq org-timer-mode-line-timer nil))
  (when org-timer-display
(setq org-timer-mode-line-timer
-(run-with-timer 1 1 'org-timer-update-mode-line))
+(run-with-timer 1 1 #'org-timer-update-mode-line))
 
 (defun org-timer-update-mode-line ()
   "Update the timer time in the mode line."
@@ -456,14 +456,15 @@ using three `C-u' prefix arguments."
   "Start countdown timer that will last SECS.
 TITLE will be appended to the notification message displayed when
 time is up."
-  (let ((msg (format "%s: time out" title)))
+  (let ((msg (format "%s: time out" title))
+(sound org-clock-sound))
 (run-with-timer
- secs nil `(lambda ()
-(setq org-timer-countdown-timer nil
-  org-timer-start-time nil)
-(org-notify ,msg ,org-clock-sound)
-(org-timer-set-mode-line 'off)
-(run-hooks 'org-timer-done-hook)
+ secs nil (lambda ()
+   (setq org-timer-countdown-timer nil
+ org-timer-start-time nil)
+   (org-notify msg sound)
+   (org-timer-set-mode-line 'off)
+   (run-hooks 'org-timer-done-hook)
 
 (defun org-timer--get-timer-title ()
   "Construct timer title.



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

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit 3c241ab5fd3e24e6c649045e86aebc8f4d8c0c73
Merge: d2e9d8b 6524301
Author: Bastien 
Commit: Bastien 

Merge branch 'maint'
---
 mk/server.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/server.mk b/mk/server.mk
index 30bc3b8..e9bda08 100644
--- a/mk/server.mk
+++ b/mk/server.mk
@@ -38,7 +38,7 @@ ORGFULL   = README COPYING lisp/ \
etc/ contrib/ doc/ testing/
 ORGFULL  := $(ORGFULL:%/=%/*)
 ORGELPA   = README_ELPA COPYING etc/ORG-NEWS lisp/ \
-   doc/dir doc/org doc/orgguide doc/orgcard.pdf \
+   doc/dir doc/org.info doc/orgguide.info doc/orgcard.pdf \
etc/styles/ org-pkg.el
 ORGELPA  := $(ORGELPA:%/=%/*)
 ORGELPAPLUS := $(ORGELPA:org-pkg%=org-plus-contrib-pkg%)



[elpa] externals/corfu a56e80e: Eglot seems to return candidates with newlines

2021-05-19 Thread Protesilaos Stavrou
branch: externals/corfu
commit a56e80e152a555afebe6b8ca1d0963ce4cb93b5f
Author: Daniel Mendler 
Commit: Daniel Mendler 

Eglot seems to return candidates with newlines

Remove alignment code for now. First I have to understand better the 
different
formats returned from the backends.
---
 corfu.el | 25 +++--
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/corfu.el b/corfu.el
index 3dcfeb3..ef403f7 100644
--- a/corfu.el
+++ b/corfu.el
@@ -436,19 +436,16 @@ Set to nil in order to disable confirmation."
   "Return PROP from METADATA."
   (cdr (assq prop metadata)))
 
-(defun corfu--format-candidate ()
-  "Format candidates."
-  (let ((mw (ceiling (* corfu-margin-width (frame-char-width)
-(lambda (c)
-  (if (consp c)
-  (concat
-   (cadr c) (car c)
-   (propertize " " 'display
-   `(space :align-to (- right ,(length (caddr c)) (,mw
-   (if (text-property-not-all 0 (length (caddr c)) 'face nil (caddr c))
-   (caddr c)
- (propertize (caddr c) 'face 'completions-annotations)))
-c
+(defun corfu--format-candidate (cand)
+  "Format annotated CAND string."
+  (replace-regexp-in-string
+   "[ \t]*\n[ \t]*" " "
+   (if (consp cand)
+   (concat (cadr cand) (car cand)
+   (if (text-property-not-all 0 (length (caddr cand)) 'face nil 
(caddr cand))
+   (caddr cand)
+ (propertize (caddr cand) 'face 'completions-annotations)))
+ cand)))
 
 (defun corfu--show-candidates (beg end str metadata)
   "Update display given BEG, END, STR and METADATA."
@@ -459,7 +456,7 @@ Set to nil in order to disable confirmation."
  (bar (ceiling (* corfu-count corfu-count) corfu--total))
  (lo (min (- corfu-count bar 1) (floor (* corfu-count start) 
corfu--total)))
  (cands (funcall corfu--highlight (seq-subseq corfu--candidates start 
last)))
- (ann-cands (mapcar (corfu--format-candidate) (corfu--annotate 
metadata cands
+ (ann-cands (mapcar #'corfu--format-candidate (corfu--annotate 
metadata cands
 ;; Nonlinearity at the end and the beginning
 (when (/= start 0)
   (setq lo (max 1 lo)))



[elpa] externals/vertico 030b964: vertico--flatten-string: Handle display space properties correctly

2021-05-19 Thread Protesilaos Stavrou
branch: externals/vertico
commit 030b9644efd5c289c635ced17c73b5c72cf362f6
Author: Daniel Mendler 
Commit: Daniel Mendler 

vertico--flatten-string: Handle display space properties correctly
---
 vertico.el | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/vertico.el b/vertico.el
index b7a62e5..29ba089 100644
--- a/vertico.el
+++ b/vertico.el
@@ -335,11 +335,13 @@
   "Flatten STR with display or invisible PROP."
   (let ((end (length str)) (pos 0) (chunks))
 (while (< pos end)
-  (let ((next (next-single-property-change pos prop str end)))
-(if-let (val (get-text-property pos prop str))
-(when (and (eq prop 'display) (stringp val))
-  (push val chunks))
-  (push (substring str pos next) chunks))
+  (let ((next (next-single-property-change pos prop str end))
+(val (get-text-property pos prop str)))
+(cond
+ ((and val (eq prop 'display) (stringp val))
+  (push val chunks))
+ ((not (and val (eq prop 'invisible)))
+  (push (substring str pos next) chunks)))
 (setq pos next)))
 (apply #'concat (nreverse chunks
 



[elpa] externals/org updated (3c241ab -> cf30f71)

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

  from  3c241ab   Merge branch 'maint'
   new  a8134b2   Backport commit af68b4956 from Emacs
   new  08d7b35   Backport commit 4e240bf09 from Emacs
   new  64689d9   Backport commit 5746fd57a from Emacs
   new  ca300ad   Backport commit 09ed51b9c from Emacs
   new  cf30f71   Merge branch 'km/from-emacs-master'


Summary of changes:
 lisp/org-mouse.el | 88 +++
 1 file changed, 43 insertions(+), 45 deletions(-)



[elpa] externals/org 64689d9 3/5: Backport commit 5746fd57a from Emacs

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit 64689d9bb7e2fe5974321c1e33590bcea17e7e56
Author: Stefan Monnier 
Commit: Kyle Meyer 

Backport commit 5746fd57a from Emacs

* lisp/org-mouse.el: Make use of lexical scoping.
(org-mouse-todo-menu): Simplify by eta-reduction.
(org-mouse-popup-global-menu): Remove redundant `eval`.
(org-mouse-keyword-menu, org-mouse-keyword-replace-menu)
(org-mouse-tag-menu, org-mouse-match-closure): Use proper closures.

lisp/org/org-mouse.el: Make use of lexical scoping
5746fd57ab7c9d27bcc6220f2b9faaba2982deba
Stefan Monnier
Tue May 18 19:51:26 2021 -0400
---
 lisp/org-mouse.el | 88 +++
 1 file changed, 43 insertions(+), 45 deletions(-)

diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el
index 5c222ea..57281dd 100644
--- a/lisp/org-mouse.el
+++ b/lisp/org-mouse.el
@@ -167,14 +167,12 @@ indirectly, for example, through the agenda buffer.")
 
 (defcustom org-mouse-punctuation ":"
   "Punctuation used when inserting text by drag and drop."
-  :group 'org-mouse
   :type 'string)
 
 (defcustom org-mouse-features
   '(context-menu yank-link activate-stars activate-bullets activate-checkboxes)
   "The features of org-mouse that should be activated.
 Changing this variable requires a restart of Emacs to get activated."
-  :group 'org-mouse
   :type '(set :greedy t
  (const :tag "Mouse-3 shows context menu" context-menu)
  (const :tag "C-mouse-1 and mouse-3 move trees" move-tree)
@@ -292,19 +290,19 @@ argument.  If it is a string, it is interpreted as the 
format
 string to (format ITEMFORMAT keyword).  If it is neither a string
 nor a function, elements of KEYWORDS are used directly."
   (mapcar
-   `(lambda (keyword)
+   (lambda (keyword)
   (vector (cond
-  ((functionp ,itemformat) (funcall ,itemformat keyword))
-  ((stringp ,itemformat) (format ,itemformat keyword))
+  ((functionp itemformat) (funcall itemformat keyword))
+  ((stringp itemformat) (format itemformat keyword))
   (t keyword))
- (list 'funcall ,function keyword)
+ (list 'funcall function keyword)
  :style (cond
- ((null ,selected) t)
- ((functionp ,selected) 'toggle)
+ ((null selected) t)
+ ((functionp selected) 'toggle)
  (t 'radio))
- :selected (if (functionp ,selected)
-   (and (funcall ,selected keyword) t)
- (equal ,selected keyword
+ :selected (if (functionp selected)
+   (and (funcall selected keyword) t)
+ (equal selected keyword
keywords))
 
 (defun org-mouse-remove-match-and-spaces ()
@@ -344,12 +342,12 @@ string to (format ITEMFORMAT keyword).  If it is neither 
a string
 nor a function, elements of KEYWORDS are used directly."
   (setq group (or group 0))
   (let ((replace (org-mouse-match-closure
- (if nosurround 'replace-match
-   'org-mouse-replace-match-and-surround
+ (if nosurround #'replace-match
+   #'org-mouse-replace-match-and-surround
 (append
  (org-mouse-keyword-menu
   keywords
-  `(lambda (keyword) (funcall ,replace keyword t t nil ,group))
+  (lambda (keyword) (funcall replace keyword t t nil group))
   (match-string group)
   itemformat)
  `(["None" org-mouse-remove-match-and-spaces
@@ -416,7 +414,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
(let ((kwds org-todo-keywords-1))
  (org-mouse-keyword-menu
   kwds
-  `(lambda (kwd) (org-todo kwd))
+  #'org-todo
   (lambda (kwd) (equal state kwd))
 
 (defun org-mouse-tag-menu ()   ;todo
@@ -424,14 +422,14 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
   (append
(let ((tags (org-get-tags nil t)))
  (org-mouse-keyword-menu
-  (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
-  `(lambda (tag)
+  (sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp)
+  (lambda (tag)
 (org-mouse-set-tags
- (sort (if (member tag (quote ,tags))
-   (delete tag (quote ,tags))
- (cons tag (quote ,tags)))
-   'string-lessp)))
-  `(lambda (tag) (member tag (quote ,tags)))
+ (sort (if (member tag tags)
+   (delete tag tags)
+ (cons tag tags))
+   #'string-lessp)))
+  (lambda (tag) (member tag tags))
   ))
'("--"
  ["Align Tags Here" (org-align-tags) t]
@@ -500,7 +498,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
  ["Check TODOs" org-show-todo-tree t]
  ("Check Tags"
   ,@(org-mouse-keyword-menu
-(sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
+(sort (mapcar #'car (org-get-buffer-tags)) #'string

[elpa] externals/org a8134b2 1/5: Backport commit af68b4956 from Emacs

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit a8134b2c58dfa20d02b2381d141e066512231a95
Author: Stefan Monnier 
Commit: Kyle Meyer 

Backport commit af68b4956 from Emacs

* lisp/org-clock.el (org-clock-get-table-data): Use proper closures.

lisp/org/org-clock.el (org-clock-get-table-data): Use proper closures
af68b49565671821361d089ae9a68af32d760e2c
Stefan Monnier
Tue May 18 19:32:35 2021 -0400

[km: This was independently applied to master in 038aff34d.]
---
 lisp/org-clock.el | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 251ad97..1283970 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -539,8 +539,8 @@ of a different task.")
   "Marker pointing to the task that has been interrupted by the current 
clock.")
 
 (defvar org-clock-mode-line-map (make-sparse-keymap))
-(define-key org-clock-mode-line-map [mode-line mouse-2] 'org-clock-goto)
-(define-key org-clock-mode-line-map [mode-line mouse-1] 'org-clock-menu)
+(define-key org-clock-mode-line-map [mode-line mouse-2] #'org-clock-goto)
+(define-key org-clock-mode-line-map [mode-line mouse-1] #'org-clock-menu)
 
 (defun org-clock--translate (s language)
   "Translate string S into using string LANGUAGE.
@@ -1414,12 +1414,12 @@ the default behavior."
   (setq org-clock-mode-line-timer
 (run-with-timer org-clock-update-period
 org-clock-update-period
-'org-clock-update-mode-line)))
+#'org-clock-update-mode-line)))
 (when org-clock-idle-timer
   (cancel-timer org-clock-idle-timer)
   (setq org-clock-idle-timer nil))
 (setq org-clock-idle-timer
-  (run-with-timer 60 60 'org-resolve-clocks-if-idle))
+  (run-with-timer 60 60 #'org-resolve-clocks-if-idle))
 (message "Clock starts at %s - %s" ts org--msg-extra)
 (run-hooks 'org-clock-in-hook))
 
@@ -1716,7 +1716,7 @@ to, overriding the existing value of 
`org-clock-out-switch-to-state'."
  (unless (org-clocking-p)
(setq org-clock-current-task nil)))
 
-(add-hook 'org-clock-out-hook 'org-clock-remove-empty-clock-drawer)
+(add-hook 'org-clock-out-hook #'org-clock-remove-empty-clock-drawer)
 
 (defun org-clock-remove-empty-clock-drawer ()
   "Remove empty clock drawers in current subtree."
@@ -2012,7 +2012,7 @@ Use `\\[org-clock-remove-overlays]' to remove the subtree 
times."
  (when time (org-clock-put-overlay time)
;; Arrange to remove the overlays upon next change.
(when org-remove-highlights-with-change
- (add-hook 'before-change-functions 'org-clock-remove-overlays
+ (add-hook 'before-change-functions #'org-clock-remove-overlays
nil 'local
 (let* ((h (/ org-clock-file-total-minutes 60))
   (m (- org-clock-file-total-minutes (* 60 h
@@ -2063,7 +2063,7 @@ If NOREMOVE is nil, remove this function from the
 (setq org-clock-overlays nil)
 (unless noremove
   (remove-hook 'before-change-functions
-  'org-clock-remove-overlays 'local
+  #'org-clock-remove-overlays 'local
 
 ;;;###autoload
 (defun org-clock-out-if-current ()
@@ -2932,12 +2932,12 @@ PROPERTIES: The list properties specified in the 
`:properties' parameter
 (save-excursion
   (org-clock-sum ts te
 (when matcher
-  `(lambda ()
- (let* ((todo (org-get-todo-state))
-(tags-list (org-get-tags))
-(org-scanner-tags tags-list)
-(org-trust-scanner-tags t))
-   (funcall ,matcher todo tags-list nil)
+  (lambda ()
+(let* ((todo (org-get-todo-state))
+   (tags-list (org-get-tags))
+   (org-scanner-tags tags-list)
+   (org-trust-scanner-tags t))
+  (funcall matcher todo tags-list nil)
   (goto-char (point-min))
   (setq st t)
   (while (or (and (bobp) (prog1 st (setq st nil))



[elpa] externals/org 08d7b35 2/5: Backport commit 4e240bf09 from Emacs

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit 08d7b359b8b1eb2c77c8d2944e46d19305d8bed0
Author: Stefan Monnier 
Commit: Kyle Meyer 

Backport commit 4e240bf09 from Emacs

* lisp/org-colview.el (org-columns-map): Use proper closures
(org-columns-map): Use derived-mode-p.

lisp/org/org-colview.el (org-columns-map): Use proper closures
4e240bf09678a41055e46fb16a798541d58d372e
Stefan Monnier
Tue May 18 19:36:54 2021 -0400

[km: This was independently applied to master in 71c40314f.]
---
 lisp/org-colview.el | 60 ++---
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 75056d4..2f03906 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -162,20 +162,20 @@ See `org-columns-summary-types' for details.")
   (org-overview)
   (org-content))
 
-(org-defkey org-columns-map "c" 'org-columns-content)
-(org-defkey org-columns-map "o" 'org-overview)
-(org-defkey org-columns-map "e" 'org-columns-edit-value)
-(org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo)
-(org-defkey org-columns-map "\C-c\C-c" 'org-columns-toggle-or-columns-quit)
-(org-defkey org-columns-map "\C-c\C-o" 'org-columns-open-link)
-(org-defkey org-columns-map "v" 'org-columns-show-value)
-(org-defkey org-columns-map "q" 'org-columns-quit)
-(org-defkey org-columns-map "r" 'org-columns-redo)
-(org-defkey org-columns-map "g" 'org-columns-redo)
-(org-defkey org-columns-map [left] 'backward-char)
-(org-defkey org-columns-map "\M-b" 'backward-char)
-(org-defkey org-columns-map "a" 'org-columns-edit-allowed)
-(org-defkey org-columns-map "s" 'org-columns-edit-attributes)
+(org-defkey org-columns-map "c"#'org-columns-content)
+(org-defkey org-columns-map "o"#'org-overview)
+(org-defkey org-columns-map "e"#'org-columns-edit-value)
+(org-defkey org-columns-map "\C-c\C-t" #'org-columns-todo)
+(org-defkey org-columns-map "\C-c\C-c" #'org-columns-toggle-or-columns-quit)
+(org-defkey org-columns-map "\C-c\C-o" #'org-columns-open-link)
+(org-defkey org-columns-map "v"#'org-columns-show-value)
+(org-defkey org-columns-map "q"#'org-columns-quit)
+(org-defkey org-columns-map "r"#'org-columns-redo)
+(org-defkey org-columns-map "g"#'org-columns-redo)
+(org-defkey org-columns-map [left] #'backward-char)
+(org-defkey org-columns-map "\M-b" #'backward-char)
+(org-defkey org-columns-map "a"#'org-columns-edit-allowed)
+(org-defkey org-columns-map "s"#'org-columns-edit-attributes)
 (org-defkey org-columns-map "\M-f"
(lambda () (interactive) (goto-char (1+ (point)
 (org-defkey org-columns-map [right]
@@ -187,7 +187,7 @@ See `org-columns-summary-types' for details.")
(while (and (org-invisible-p2) (not (eobp)))
  (beginning-of-line 2))
(move-to-column col)
-   (if (eq major-mode 'org-agenda-mode)
+   (if (derived-mode-p 'org-agenda-mode)
(org-agenda-do-context-action)
 (org-defkey org-columns-map [up]
(lambda () (interactive)
@@ -198,20 +198,20 @@ See `org-columns-summary-types' for details.")
(move-to-column col)
(if (eq major-mode 'org-agenda-mode)
(org-agenda-do-context-action)
-(org-defkey org-columns-map [(shift right)] 'org-columns-next-allowed-value)
-(org-defkey org-columns-map "n" 'org-columns-next-allowed-value)
-(org-defkey org-columns-map [(shift left)] 'org-columns-previous-allowed-value)
-(org-defkey org-columns-map "p" 'org-columns-previous-allowed-value)
-(org-defkey org-columns-map "<" 'org-columns-narrow)
-(org-defkey org-columns-map ">" 'org-columns-widen)
-(org-defkey org-columns-map [(meta right)] 'org-columns-move-right)
-(org-defkey org-columns-map [(meta left)] 'org-columns-move-left)
-(org-defkey org-columns-map [(shift meta right)] 'org-columns-new)
-(org-defkey org-columns-map [(shift meta left)] 'org-columns-delete)
+(org-defkey org-columns-map [(shift right)] #'org-columns-next-allowed-value)
+(org-defkey org-columns-map "n" #'org-columns-next-allowed-value)
+(org-defkey org-columns-map [(shift left)] 
#'org-columns-previous-allowed-value)
+(org-defkey org-columns-map "p" #'org-columns-previous-allowed-value)
+(org-defkey org-columns-map "<" #'org-columns-narrow)
+(org-defkey org-columns-map ">" #'org-columns-widen)
+(org-defkey org-columns-map [(meta right)] #'org-columns-move-right)
+(org-defkey org-columns-map [(meta left)]  #'org-columns-move-left)
+(org-defkey org-columns-map [(shift meta right)] #'org-columns-new)
+(org-defkey org-columns-map [(shift meta left)]  #'org-columns-delete)
 (dotimes (i 10)
   (org-defkey org-columns-map (number-to-string i)
- `(lambda () (interactive)
-(org-columns-next-allowed-value nil ,i
+ (lambda () (interactive)
+   (org-columns-next-allowed-value nil i

[elpa] externals/org ca300ad 4/5: Backport commit 09ed51b9c from Emacs

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit ca300ada2186bf8e1937ece3ac848d36b5f931c6
Author: Stefan Monnier 
Commit: Kyle Meyer 

Backport commit 09ed51b9c from Emacs

* lisp/org-timer.el (org-timer--run-countdown-timer): Use closures.

lisp/org/org-timer.el (org-timer--run-countdown-timer): Use closures
09ed51b9c89390059ccae30c0ae5dc39bc20523b
Stefan Monnier
Tue May 18 19:54:38 2021 -0400

[km: This was independently applied to master with 1a5a326f1.]
---
 lisp/org-timer.el | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index b6802fe..852d185 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -366,7 +366,7 @@ VALUE can be `on', `off', or `paused'."
(setq org-timer-mode-line-timer nil))
  (when org-timer-display
(setq org-timer-mode-line-timer
-(run-with-timer 1 1 'org-timer-update-mode-line))
+(run-with-timer 1 1 #'org-timer-update-mode-line))
 
 (defun org-timer-update-mode-line ()
   "Update the timer time in the mode line."
@@ -456,14 +456,15 @@ using three `C-u' prefix arguments."
   "Start countdown timer that will last SECS.
 TITLE will be appended to the notification message displayed when
 time is up."
-  (let ((msg (format "%s: time out" title)))
+  (let ((msg (format "%s: time out" title))
+(sound org-clock-sound))
 (run-with-timer
- secs nil `(lambda ()
-(setq org-timer-countdown-timer nil
-  org-timer-start-time nil)
-(org-notify ,msg ,org-clock-sound)
-(org-timer-set-mode-line 'off)
-(run-hooks 'org-timer-done-hook)
+ secs nil (lambda ()
+   (setq org-timer-countdown-timer nil
+ org-timer-start-time nil)
+   (org-notify msg sound)
+   (org-timer-set-mode-line 'off)
+   (run-hooks 'org-timer-done-hook)
 
 (defun org-timer--get-timer-title ()
   "Construct timer title.



[elpa] externals/org cf30f71 5/5: Merge branch 'km/from-emacs-master'

2021-05-19 Thread ELPA Syncer
branch: externals/org
commit cf30f71178ca062caa27417dd9f7e18f56e60265
Merge: 3c241ab ca300ad
Author: Kyle Meyer 
Commit: Kyle Meyer 

Merge branch 'km/from-emacs-master'
---
 lisp/org-mouse.el | 88 +++
 1 file changed, 43 insertions(+), 45 deletions(-)

diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el
index bca95f3..b318670 100644
--- a/lisp/org-mouse.el
+++ b/lisp/org-mouse.el
@@ -167,14 +167,12 @@ indirectly, for example, through the agenda buffer.")
 
 (defcustom org-mouse-punctuation ":"
   "Punctuation used when inserting text by drag and drop."
-  :group 'org-mouse
   :type 'string)
 
 (defcustom org-mouse-features
   '(context-menu yank-link activate-stars activate-bullets activate-checkboxes)
   "The features of org-mouse that should be activated.
 Changing this variable requires a restart of Emacs to get activated."
-  :group 'org-mouse
   :type '(set :greedy t
  (const :tag "Mouse-3 shows context menu" context-menu)
  (const :tag "C-mouse-1 and mouse-3 move trees" move-tree)
@@ -292,19 +290,19 @@ argument.  If it is a string, it is interpreted as the 
format
 string to (format ITEMFORMAT keyword).  If it is neither a string
 nor a function, elements of KEYWORDS are used directly."
   (mapcar
-   `(lambda (keyword)
+   (lambda (keyword)
   (vector (cond
-  ((functionp ,itemformat) (funcall ,itemformat keyword))
-  ((stringp ,itemformat) (format ,itemformat keyword))
+  ((functionp itemformat) (funcall itemformat keyword))
+  ((stringp itemformat) (format itemformat keyword))
   (t keyword))
- (list 'funcall ,function keyword)
+ (list 'funcall function keyword)
  :style (cond
- ((null ,selected) t)
- ((functionp ,selected) 'toggle)
+ ((null selected) t)
+ ((functionp selected) 'toggle)
  (t 'radio))
- :selected (if (functionp ,selected)
-   (and (funcall ,selected keyword) t)
- (equal ,selected keyword
+ :selected (if (functionp selected)
+   (and (funcall selected keyword) t)
+ (equal selected keyword
keywords))
 
 (defun org-mouse-remove-match-and-spaces ()
@@ -344,12 +342,12 @@ string to (format ITEMFORMAT keyword).  If it is neither 
a string
 nor a function, elements of KEYWORDS are used directly."
   (setq group (or group 0))
   (let ((replace (org-mouse-match-closure
- (if nosurround 'replace-match
-   'org-mouse-replace-match-and-surround
+ (if nosurround #'replace-match
+   #'org-mouse-replace-match-and-surround
 (append
  (org-mouse-keyword-menu
   keywords
-  `(lambda (keyword) (funcall ,replace keyword t t nil ,group))
+  (lambda (keyword) (funcall replace keyword t t nil group))
   (match-string group)
   itemformat)
  `(["None" org-mouse-remove-match-and-spaces
@@ -416,7 +414,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
(let ((kwds org-todo-keywords-1))
  (org-mouse-keyword-menu
   kwds
-  `(lambda (kwd) (org-todo kwd))
+  #'org-todo
   (lambda (kwd) (equal state kwd))
 
 (defun org-mouse-tag-menu ()   ;todo
@@ -424,14 +422,14 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
   (append
(let ((tags (org-get-tags nil t)))
  (org-mouse-keyword-menu
-  (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
-  `(lambda (tag)
+  (sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp)
+  (lambda (tag)
 (org-mouse-set-tags
- (sort (if (member tag (quote ,tags))
-   (delete tag (quote ,tags))
- (cons tag (quote ,tags)))
-   'string-lessp)))
-  `(lambda (tag) (member tag (quote ,tags)))
+ (sort (if (member tag tags)
+   (delete tag tags)
+ (cons tag tags))
+   #'string-lessp)))
+  (lambda (tag) (member tag tags))
   ))
'("--"
  ["Align Tags Here" (org-align-tags) t]
@@ -500,7 +498,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
  ["Check TODOs" org-show-todo-tree t]
  ("Check Tags"
   ,@(org-mouse-keyword-menu
-(sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
+(sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp)
  (lambda (tag) (org-tags-sparse-tree nil tag)))
   "--"
   ["Custom Tag ..." org-tags-sparse-tree t])
@@ -510,16 +508,16 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
  ["Display TODO List" org-todo-list t]
  ("Display Tags"
   ,@(org-mouse-keyword-menu
-(sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
+(sort (mapcar #'car (org-get-buffer-tags)) #'string-lessp)
  (lambda (

[elpa] externals/eglot a0a6218 01/10: Fix #670: make eglot-current-server work in notification handlers

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit a0a6218af2dfb476573b2e564f43ab82bfcaaca2
Author: João Távora 
Commit: João Távora 

Fix #670: make eglot-current-server work in notification handlers

* eglot.el (eglot--connect): Ensure `eglot--cached-server` bound
when calling notification/request methods.
---
 eglot.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eglot.el b/eglot.el
index 20f5995..f926709 100644
--- a/eglot.el
+++ b/eglot.el
@@ -945,7 +945,8 @@ This docstring appeases checkdoc, that's all."
   (format "*%s stderr*" readable-name))
  :file-handler t)))
  (spread (lambda (fn) (lambda (server method params)
-(apply fn server method (append params nil)
+(let ((eglot--cached-server server))
+ (apply fn server method (append params 
nil))
  (server
   (apply
#'make-instance class



[elpa] externals/eglot updated (fc221c8 -> 1ac06d0)

2021-05-19 Thread monnier--- via
monnier pushed a change to branch externals/eglot.

  from  fc221c8   Overhaul bug reporting template
   new  a0a6218   Fix #670: make eglot-current-server work in notification 
handlers
   new  efac602   Fix #673: declare eglot--cached-server before use
   new  9330397   Close #677: switch default langserver for OCaml to 
ocamllsp
   new  c6e05e0   Per #677: mention ocaml-lsp in the README
   new  98943f1   Add a completion-category-defaults entry
   new  6f27bc1   Allow LSP languageId to be overridden via 
eglot-server-programs
   new  3f1ad3b   Close #685: Fix Emacs 28 warning by avoiding positional 
args in define-minor-mode
   new  40bba97   Per #687: provide context for finer project-find-functions
   new  b06589b   Fix #679: correct path/URI when using TRAMP from MS 
Windows
   new  1ac06d0   Fix #76: manage cross-referenced files outside project in 
same server


Summary of changes:
 NEWS.md|  10 +++
 README.md  |  17 -
 eglot-tests.el |  28 ++--
 eglot.el   | 197 +++--
 4 files changed, 182 insertions(+), 70 deletions(-)



[elpa] externals/eglot efac602 02/10: Fix #673: declare eglot--cached-server before use

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit efac602ac4cc8422c8c95f1e931c90bad3bee310
Author: João Távora 
Commit: João Távora 

Fix #673: declare eglot--cached-server before use

Per #670.

Otherwise the dynamic binding of it in in eglot--connect won't work.

* eglot.el (eglot--cached-server): Move up.
---
 eglot.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eglot.el b/eglot.el
index f926709..3373be2 100644
--- a/eglot.el
+++ b/eglot.el
@@ -907,6 +907,9 @@ Each function is passed the server as an argument")
  " "))
 contact))
 
+(defvar-local eglot--cached-server nil
+  "A cached reference to the current EGLOT server.")
+
 (defun eglot--connect (managed-major-mode project class contact)
   "Connect to MANAGED-MAJOR-MODE, PROJECT, CLASS and CONTACT.
 This docstring appeases checkdoc, that's all."
@@ -1378,9 +1381,6 @@ For example, to keep your Company customization use
  (push (cons ',symbol (symbol-value ',symbol)) eglot--saved-bindings)
  (setq-local ,symbol ,binding)))
 
-(defvar-local eglot--cached-server nil
-  "A cached reference to the current EGLOT server.")
-
 (defun eglot-managed-p ()
   "Tell if current buffer is managed by EGLOT."
   eglot--managed-mode)



[elpa] externals/eglot 9330397 03/10: Close #677: switch default langserver for OCaml to ocamllsp

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit 933039761e91b536bf321ab84a0e7e616160ad1d
Author: Steve Purcell 
Commit: GitHub 

Close #677: switch default langserver for OCaml to ocamllsp

The repo for ocaml-language-server has been archived and inactive
for quite some time:

   https://github.com/ocaml-lsp/ocaml-language-server

Meanwhile, ocaml-lsp is the generally-preferred option, and is actively
maintained in the ocaml org itself:

   https://github.com/ocaml/ocaml-lsp/

* eglot.el (eglot-server-programs): switch caml-mode  entry.
---
 eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eglot.el b/eglot.el
index 3373be2..3348054 100644
--- a/eglot.el
+++ b/eglot.el
@@ -105,7 +105,7 @@
 language-server/bin/php-language-server.php"))
 ((c++-mode c-mode) . ("ccls"))
 ((caml-mode tuareg-mode reason-mode)
- . ("ocaml-language-server" "--stdio"))
+ . ("ocamllsp"))
 (ruby-mode
  . ("solargraph" "socket" "--port" :autoport))
 (haskell-mode



[elpa] externals/eglot 3f1ad3b 07/10: Close #685: Fix Emacs 28 warning by avoiding positional args in define-minor-mode

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit 3f1ad3bd1bf6c2ccef61c3ca606ef69962ae6e55
Author: Steve Purcell 
Commit: GitHub 

Close #685: Fix Emacs 28 warning by avoiding positional args in 
define-minor-mode

* eglot.el (eglot--managed-mode): Avoid positional args.

Co-authored-by: João Távora 
---
 eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eglot.el b/eglot.el
index b191763..29024ad 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1440,7 +1440,7 @@ Use `eglot-managed-p' to determine if current buffer is 
managed.")
 
 (define-minor-mode eglot--managed-mode
   "Mode for source buffers managed by some EGLOT project."
-  nil nil eglot-mode-map
+  :init-value nil :lighter nil :keymap eglot-mode-map
   (cond
(eglot--managed-mode
 (add-hook 'after-change-functions 'eglot--after-change nil t)



[elpa] externals/eglot b06589b 09/10: Fix #679: correct path/URI when using TRAMP from MS Windows

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit b06589b393844c31c17962497e621a72e0e78e01
Author: Jim Porter <826865+jimpor...@users.noreply.github.com>
Commit: GitHub 

Fix #679: correct path/URI when using TRAMP from MS Windows

Co-authored-by: João Távora 

* eglot.el (eglot--connect): Ensure drive letter doesn't sneak into
rootPath.  (eglot--path-to-uri): Only add a leading "/" for local MS
Windows paths. (eglot--uri-to-path): Only remove leading "/" from
local MS Windows paths.
---
 eglot.el | 35 +--
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/eglot.el b/eglot.el
index fc82367..f17e795 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1046,8 +1046,8 @@ This docstring appeases checkdoc, that's all."
   (emacs-pid))
 ;; Maybe turn trampy `/ssh:foo@bar:/path/to/baz.py'
 ;; into `/path/to/baz.py', so LSP groks it.
-:rootPath (expand-file-name
-   (file-local-name default-directory))
+:rootPath (file-local-name
+   (expand-file-name default-directory))
 :rootUri (eglot--path-to-uri default-directory)
 :initializationOptions 
(eglot-initialization-options
 server)
@@ -1274,24 +1274,31 @@ If optional MARKER, return a marker instead"
 
 (defun eglot--path-to-uri (path)
   "URIfy PATH."
-  (concat "file://" (if (eq system-type 'windows-nt) "/")
-  (url-hexify-string
-   ;; Again watch out for trampy paths.
-   (directory-file-name (file-local-name (file-truename path))) 
-   eglot--uri-path-allowed-chars)))
+  (let ((truepath (file-truename path)))
+(concat "file://"
+;; Add a leading "/" for local MS Windows-style paths.
+(if (and (eq system-type 'windows-nt)
+ (not (file-remote-p truepath)))
+"/")
+(url-hexify-string
+ ;; Again watch out for trampy paths.
+ (directory-file-name (file-local-name truepath))
+ eglot--uri-path-allowed-chars
 
 (defun eglot--uri-to-path (uri)
   "Convert URI to file path, helped by `eglot--current-server'."
   (when (keywordp uri) (setq uri (substring (symbol-name uri) 1)))
-  (let* ((retval (url-filename (url-generic-parse-url (url-unhex-string uri
- (normalized (if (and (eq system-type 'windows-nt)
-  (cl-plusp (length retval)))
- (substring retval 1)
-   retval))
- (server (eglot-current-server))
+  (let* ((server (eglot-current-server))
  (remote-prefix (and server
  (file-remote-p
-  (project-root (eglot--project server))
+  (project-root (eglot--project server)
+ (retval (url-filename (url-generic-parse-url (url-unhex-string uri
+ ;; Remove the leading "/" for local MS Windows-style paths.
+ (normalized (if (and (not remote-prefix)
+  (eq system-type 'windows-nt)
+  (cl-plusp (length retval)))
+ (substring retval 1)
+   retval)))
 (concat remote-prefix normalized)))
 
 (defun eglot--snippet-expansion-fn ()



[elpa] externals/eglot c6e05e0 04/10: Per #677: mention ocaml-lsp in the README

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit c6e05e0f29b539a6863dc309855bf4d480eb1d66
Author: João Távora 
Commit: GitHub 

Per #677: mention ocaml-lsp in the README

* README.md (Connecting to a server): mention ocaml-lsp
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index c5716bc..2927ab8 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,7 @@ find-library` can help you tell if that happened.
 * Elm's [elm-language-server][elm-language-server]
 * Kotlin's [kotlin-language-server][kotlin-language-server]
 * Go's [gopls][gopls]
-* Ocaml's [ocaml-language-server][ocaml-language-server]
+* Ocaml's [ocaml-lsp][ocaml-lsp]
 * R's [languageserver][r-languageserver]
 * Dart's [dart_language_server][dart_language_server]
 * Elixir's [elixir-ls][elixir-ls]
@@ -546,7 +546,7 @@ Under the hood:
 [kotlin-language-server]: https://github.com/fwcd/KotlinLanguageServer
 [gopls]: https://github.com/golang/tools/tree/master/gopls
 [eclipse-jdt]: https://github.com/eclipse/eclipse.jdt.ls
-[ocaml-language-server]: https://github.com/freebroccolo/ocaml-language-server
+[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp/
 [r-languageserver]: https://cran.r-project.org/package=languageserver
 [dart_language_server]: https://github.com/natebosch/dart_language_server
 [elixir-ls]: https://github.com/elixir-lsp/elixir-ls



[elpa] externals/eglot 6f27bc1 06/10: Allow LSP languageId to be overridden via eglot-server-programs

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit 6f27bc18ebfb9449d3254f852e84c1cf139f3a85
Author: Steve Purcell 
Commit: GitHub 

Allow LSP languageId to be overridden via eglot-server-programs

Close #678. Per #677

* eglot-tests.el (eglot--guessing-contact): Add
GUESSED-LANG-ID-SYM param.
(eglot-server-programs-guess-lang): New test.

* eglot.el (eglot-server-programs): Augment entries for caml-mode
and tuareg-mode. Enhance docstring.
(eglot--lookup-mode): New helper.
(eglot--guess-contact): Call eglot--lookup-mode.
(eglot, eglot-reconnect): Pass language-id to eglot--connect
(eglot--connect): Receive LANGUAGE-ID
(eglot--TextDocumentItem): Simplify.  Use
`eglot--current-server-or-lose'

* README.md (Handling quirky servers): Mention new feature.

Co-authored-by: João Távora 
---
 README.md  |  7 +
 eglot-tests.el | 28 +++-
 eglot.el   | 80 +++---
 3 files changed, 88 insertions(+), 27 deletions(-)

diff --git a/README.md b/README.md
index 2927ab8..0ad6d46 100644
--- a/README.md
+++ b/README.md
@@ -180,6 +180,13 @@ get [cquery][cquery] working:
 See `eglot.el`'s section on Java's JDT server for an even more
 sophisticated example.
 
+Similarly, some servers require the language identifier strings they
+are sent by `eglot` to match the exact strings used by VSCode. `eglot`
+usually guesses these identifiers from the major mode name
+(e.g. `elm-mode` → `"elm"`), but the mapping can be overridden using
+the `:LANGUAGE-ID` element in the syntax of `eglot-server-programs` if
+necessary.
+
 
 
 ## TRAMP support
diff --git a/eglot-tests.el b/eglot-tests.el
index 6e9ceeb..1309f87 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -935,7 +935,8 @@ pyls prefers autopep over yafp, despite its README stating 
the contrary."
 
 (cl-defmacro eglot--guessing-contact ((interactive-sym
prompt-args-sym
-   guessed-class-sym guessed-contact-sym)
+   guessed-class-sym guessed-contact-sym
+   &optional guessed-lang-id-sym)
   &body body)
   "Evaluate BODY twice, binding results of `eglot--guess-contact'.
 
@@ -943,10 +944,10 @@ INTERACTIVE-SYM is bound to the boolean passed to
 `eglot--guess-contact' each time. If the user would have been
 prompted, PROMPT-ARGS-SYM is bound to the list of arguments that
 would have been passed to `read-shell-command', else nil.
-GUESSED-CLASS-SYM and GUESSED-CONTACT-SYM are bound to the useful
-return values of `eglot--guess-contact'. Unless the server
-program evaluates to \"a-missing-executable.exe\", this macro
-will assume it exists."
+GUESSED-CLASS-SYM, GUESSED-CONTACT-SYM and GUESSED-LANG-ID-SYM
+are bound to the useful return values of
+`eglot--guess-contact'. Unless the server program evaluates to
+\"a-missing-executable.exe\", this macro will assume it exists."
   (declare (indent 1) (debug t))
   (let ((i-sym (cl-gensym)))
 `(dolist (,i-sym '(nil t))
@@ -960,7 +961,8 @@ will assume it exists."
((symbol-function 'read-shell-command)
 (lambda (&rest args) (setq ,prompt-args-sym args) "")))
(cl-destructuring-bind
-   (_ _ ,guessed-class-sym ,guessed-contact-sym)
+   (_ _ ,guessed-class-sym ,guessed-contact-sym
+  ,(or guessed-lang-id-sym '_))
(eglot--guess-contact ,i-sym)
  ,@body))
 
@@ -1051,6 +1053,20 @@ will assume it exists."
   (should (equal guessed-class 'eglot-lsp-server))
   (should (equal guessed-contact '("some-executable"))
 
+(ert-deftest eglot-server-programs-guess-lang ()
+  (let ((major-mode 'foo-mode))
+(let ((eglot-server-programs '((foo-mode . ("prog-executable")
+  (eglot--guessing-contact (_ _ _ _ guessed-lang)
+(should (equal guessed-lang "foo"
+(let ((eglot-server-programs '(((foo-mode :language-id "bar")
+. ("prog-executable")
+  (eglot--guessing-contact (_ _ _ _ guessed-lang)
+(should (equal guessed-lang "bar"
+(let ((eglot-server-programs '(((baz-mode (foo-mode :language-id "bar"))
+. ("prog-executable")
+  (eglot--guessing-contact (_ _ _ _ guessed-lang)
+(should (equal guessed-lang "bar"))
+
 (defun eglot--glob-match (glob str)
   (funcall (eglot--glob-compile glob t t) str))
 
diff --git a/eglot.el b/eglot.el
index 122a76b..b191763 100644
--- a/eglot.el
+++ b/eglot.el
@@ -104,7 +104,8 @@
  . ("php" "vendor/felixfbecker/\
 language-server/bin/php-language-server.php"))
 ((c++-mode c-mode) . ("ccls"))
-((caml-mode tuareg-mode reason-mode)
+  

[elpa] externals/eglot 98943f1 05/10: Add a completion-category-defaults entry

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit 98943f1bef771849f292209868bc9540430d4e0d
Author: Augusto Stoffel 
Commit: João Távora 

Add a completion-category-defaults entry

Setting completion-styles buffer-locally is harder to customize and
can break some completion UIs.

Emacs bug#48073

* eglot.el: Add a completion-category-defaults entry, if applicable.
(eglot--managed-mode): Don't set `completion-styles'
(eglot-completion-at-point): Add style metadata to
completion table.
---
 eglot.el | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/eglot.el b/eglot.el
index 3348054..122a76b 100644
--- a/eglot.el
+++ b/eglot.el
@@ -222,6 +222,10 @@ let the buffer grow forever."
   :type '(choice (const :tag "Don't show confirmation prompt" nil)
  (symbol :tag "Show confirmation prompt" 'confirm)))
 
+;; Customizable via `completion-category-overrides'.
+(when (assoc 'flex completion-styles-alist)
+  (add-to-list 'completion-category-defaults '(eglot (styles flex basic
+
 
 ;;; Constants
 ;;;
@@ -1421,8 +1425,6 @@ Use `eglot-managed-p' to determine if current buffer is 
managed.")
 (eglot--setq-saving flymake-diagnostic-functions '(eglot-flymake-backend))
 (eglot--setq-saving company-backends '(company-capf))
 (eglot--setq-saving company-tooltip-align-annotations t)
-(when (assoc 'flex completion-styles-alist)
-  (eglot--setq-saving completion-styles '(flex basic)))
 (unless (eglot--stay-out-of-p 'imenu)
   (add-function :before-until (local 'imenu-create-index-function)
 #'eglot-imenu))
@@ -2166,7 +2168,8 @@ is not active."
(get-text-property 0 'eglot--lsp-item c)
:sortText)
   "")
-   (metadata `(metadata . ((display-sort-function . 
,sort-completions
+   (metadata `(metadata (category . eglot)
+(display-sort-function . ,sort-completions)))
resp items (cached-proxies :none)
(proxies
 (lambda ()



[elpa] externals/eglot 40bba97 08/10: Per #687: provide context for finer project-find-functions

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit 40bba97b0ab81ea3e70884b754d59a2e5af5e5f5
Author: João Távora 
Commit: GitHub 

Per #687: provide context for finer project-find-functions

* eglot.el (eglot--guess-contact): Use eglot--current-project.
(eglot): Adjust docstring.
(eglot-lsp-context): New variable.
(eglot--current-project): New helper.
(eglot--maybe-activate-editing-mode, eglot--eclipse-jdt-contact):
Use eglot--current-project.
---
 eglot.el | 32 +++-
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/eglot.el b/eglot.el
index 29024ad..fc82367 100644
--- a/eglot.el
+++ b/eglot.el
@@ -777,7 +777,6 @@ be guessed."
((not guessed-mode)
 (eglot--error "Can't guess mode to manage for `%s'" 
(current-buffer)))
(t guessed-mode)))
- (project (or (project-current) `(transient . ,default-directory)))
  (lang-id-and-guess (eglot--lookup-mode guessed-mode))
  (language-id (car lang-id-and-guess))
  (guess (cdr lang-id-and-guess))
@@ -827,7 +826,21 @@ be guessed."
 :test #'equal
   guess
   (eglot--error "Couldn't guess for `%s'!" managed-mode
-(list managed-mode project class contact language-id)))
+(list managed-mode (eglot--current-project) class contact language-id)))
+
+(defvar eglot-lsp-context)
+(put 'eglot-lsp-context 'variable-documentation
+ "Dynamically non-nil when searching for projects in LSP context.")
+
+(defun eglot--current-project ()
+  "Return a project object for Eglot's LSP purposes.
+This relies on `project-current' and thus on
+`project-find-functions'.  Functions in the latter
+variable (which see) can query the value `eglot-lsp-context' to
+decide whether a given directory is a project containing a
+suitable root directory for a given LSP server's purposes."
+  (let ((eglot-lsp-context t))
+(or (project-current) `(transient . ,default-directory
 
 ;;;###autoload
 (defun eglot (managed-major-mode project class contact language-id
@@ -844,13 +857,16 @@ exchanged periodically to provide enhanced code-analysis 
via
 
 Interactively, the command attempts to guess MANAGED-MAJOR-MODE
 from current buffer, CLASS and CONTACT from
-`eglot-server-programs' and PROJECT from `project-current'.  If
-it can't guess, the user is prompted.  With a single
+`eglot-server-programs' and PROJECT from
+`project-find-functions'.  The search for active projects in this
+context binds `eglot-lsp-context' (which see).
+
+If it can't guess, the user is prompted.  With a single
 \\[universal-argument] prefix arg, it always prompt for COMMAND.
 With two \\[universal-argument] prefix args, also prompts for
 MANAGED-MAJOR-MODE.
 
-PROJECT is a project instance as returned by `project-current'.
+PROJECT is a project object as returned by `project-current'.
 
 CLASS is a subclass of `eglot-lsp-server'.
 
@@ -1537,8 +1553,7 @@ If it is activated, also signal textDocument/didOpen."
 eglot--cached-server
 (setq eglot--cached-server
   (cl-find major-mode
-   (gethash (or (project-current)
-`(transient . ,default-directory))
+   (gethash (eglot--current-project)
 eglot--servers-by-project)
:key #'eglot--major-mode
   (setq eglot--unreported-diagnostics `(:just-opened . nil))
@@ -2939,9 +2954,8 @@ If INTERACTIVE, prompt user for details."
   ((string= system-type "darwin") "config_mac")
   ((string= system-type "windows-nt") "config_win")
   (t "config_linux"
-   (project (or (project-current) `(transient . ,default-directory)))
(workspace
-(expand-file-name (md5 (project-root project))
+(expand-file-name (md5 (project-root (eglot--current-project)))
   (concat user-emacs-directory
   "eglot-eclipse-jdt-cache"
   (unless jar



[elpa] externals/eglot 1ac06d0 10/10: Fix #76: manage cross-referenced files outside project in same server

2021-05-19 Thread monnier--- via
branch: externals/eglot
commit 1ac06d0bcc247fb19df6eceb57e2ea3d534806ec
Author: Michael Livshin 
Commit: João Távora 

Fix #76: manage cross-referenced files outside project in same server

Close #686, Close #695.

Co-authored-by: João Távora 

* eglot.el (eglot-extend-to-xref): new defcustom, default to
nil.
(eglot--servers-by-xrefed-file): new hash table, mapping file names
to servers.
(eglot--managed-mode): use eglot-current-server, instead of
eglot--cached-server directly.
(eglot--current-server-or-lose): ditto.
(eglot--maybe-activate-editing-mode): ditto.
(eglot-current-server): move all cached-server update logic here -- if
eglot--cached-server is nil, try to find it using current project or
(optionally) xref location.
(eglot--xref-make-match): record the xref location.

* README.md (Customization): Mention new defcustom.

* NEWS.md: Mention new feature
---
 NEWS.md   | 10 ++
 README.md |  6 ++
 eglot.el  | 32 +---
 3 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index d060ad4..03a22bc 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -7,6 +7,13 @@ Thanks to Brian Cully for the minimalist approach.
 (also thanks to Felipe Lema who conducted many early experiments in
 [#463][github#463])
 
+# Manage cross-referenced files outside project ([#76][github#76], 
([#686][github#686], ([#695][github#695])
+
+This is activated by a new customization option
+`eglot-extend-to-xref`, which defaults to nil.
+
+Thanks to Michael Livshin for the investigation an elegant solution.
+
 # Code action shortcuts ([#411][github#411])
 
 `M-x eglot-code-actions` accepts an optional `action-kind` argument,
@@ -214,6 +221,7 @@ and now said bunch of references-->
 [github#68]: https://github.com/joaotavora/eglot/issues/68
 [github#73]: https://github.com/joaotavora/eglot/issues/73
 [github#74]: https://github.com/joaotavora/eglot/issues/74
+[github#76]: https://github.com/joaotavora/eglot/issues/76
 [github#80]: https://github.com/joaotavora/eglot/issues/80
 [github#81]: https://github.com/joaotavora/eglot/issues/81
 [github#82]: https://github.com/joaotavora/eglot/issues/82
@@ -263,3 +271,5 @@ and now said bunch of references-->
 [github#494]: https://github.com/joaotavora/eglot/issues/494
 [github#637]: https://github.com/joaotavora/eglot/issues/637
 [github#643]: https://github.com/joaotavora/eglot/issues/643
+[github#686]: https://github.com/joaotavora/eglot/issues/686
+[github#695]: https://github.com/joaotavora/eglot/issues/695
diff --git a/README.md b/README.md
index 0ad6d46..302c7f6 100644
--- a/README.md
+++ b/README.md
@@ -319,6 +319,12 @@ lisp:
 - `eglot-stay-out-of`: List of Emacs features that Eglot shouldn't
   automatically try to manage on users' behalf.  Useful when you need
   non-LSP Flymake or Company backends.  See docstring for examples.
+  
+- `eglot-extend-to-xref`: If non-nil and `xref-find-definitions` lands
+  you in a file outside your project -- like a system-installed
+  library or header file -- transiently consider it managed by the
+  same LSP server.  That file is still outside your project
+  (i.e. `project-find-file` won't find it).
 
 # How does Eglot work?
 
diff --git a/eglot.el b/eglot.el
index f17e795..db468d8 100644
--- a/eglot.el
+++ b/eglot.el
@@ -237,6 +237,10 @@ let the buffer grow forever."
   :type '(choice (const :tag "Don't show confirmation prompt" nil)
  (symbol :tag "Show confirmation prompt" 'confirm)))
 
+(defcustom eglot-extend-to-xref nil
+  "If non-nil, activate Eglot in cross-referenced non-project files."
+  :type 'boolean)
+
 ;; Customizable via `completion-category-overrides'.
 (when (assoc 'flex completion-styles-alist)
   (add-to-list 'completion-category-defaults '(eglot (styles flex basic
@@ -832,6 +836,9 @@ be guessed."
 (put 'eglot-lsp-context 'variable-documentation
  "Dynamically non-nil when searching for projects in LSP context.")
 
+(defvar eglot--servers-by-xrefed-file
+  (make-hash-table :test 'equal :weakness 'value))
+
 (defun eglot--current-project ()
   "Return a project object for Eglot's LSP purposes.
 This relies on `project-current' and thus on
@@ -1495,7 +1502,7 @@ Use `eglot-managed-p' to determine if current buffer is 
managed.")
 #'eglot-imenu))
 (flymake-mode 1)
 (eldoc-mode 1)
-(cl-pushnew (current-buffer) (eglot--managed-buffers 
eglot--cached-server)))
+(cl-pushnew (current-buffer) (eglot--managed-buffers 
(eglot-current-server
(t
 (remove-hook 'after-change-functions 'eglot--after-change t)
 (remove-hook 'before-change-functions 'eglot--before-change t)
@@ -1533,11 +1540,19 @@ Use `eglot-managed-p' to determine if current buffer is 
managed.")
 
 (defun eglot-current-server ()
   "Return logical EGLOT server for current buffer, nil if none."
-  eglot--cached-server)
+  (setq eglot--cached-server
+

[elpa] externals/realgud cde79dd 2/2: Merge pull request #294 from realgud/revert-293-master

2021-05-19 Thread monnier--- via
branch: externals/realgud
commit cde79dd47f25617959c6cfa059e198a565b91f77
Merge: 34557f8 27b4235
Author: R. Bernstein 
Commit: GitHub 

Merge pull request #294 from realgud/revert-293-master

Revert "Fix focus lose in source buffer after invoking debugger command."
---
 realgud/common/track.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/realgud/common/track.el b/realgud/common/track.el
index 38adfe9..a655d9d 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -421,7 +421,8 @@ encountering a new loc."
  ;;'realgud-overlay-arrow1)
  ;;)
  (realgud-window-update-position srcbuf 
realgud-overlay-arrow1)))
-   ))
+   )
+ (if cmd-window (select-window cmd-window)))
  ; else
  (with-current-buffer srcbuf
(realgud-window-src srcbuf)



[elpa] externals/realgud 27b4235 1/2: Revert "Fix focus lose in source buffer after invoking debugger command."

2021-05-19 Thread monnier--- via
branch: externals/realgud
commit 27b4235610e654ddd817d456d7867c6eadbdef2e
Author: R. Bernstein 
Commit: GitHub 

Revert "Fix focus lose in source buffer after invoking debugger command."
---
 realgud/common/track.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/realgud/common/track.el b/realgud/common/track.el
index 38adfe9..a655d9d 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -421,7 +421,8 @@ encountering a new loc."
  ;;'realgud-overlay-arrow1)
  ;;)
  (realgud-window-update-position srcbuf 
realgud-overlay-arrow1)))
-   ))
+   )
+ (if cmd-window (select-window cmd-window)))
  ; else
  (with-current-buffer srcbuf
(realgud-window-src srcbuf)



[elpa] externals/sql-indent 53ee1f7: Syntax after a JOIN statement is now 'select-table (#99)

2021-05-19 Thread monnier--- via
branch: externals/sql-indent
commit 53ee1f7a9940908bbd6d3d52541927ef1c5e625a
Author: Alex Harsányi 
Commit: Alex Harsányi 

Syntax after a JOIN statement is now 'select-table (#99)

Updated scanning to recognize a position just before or just after a JOIN
statement as being a new table definition with a 'select-table syntax.

This changes indentation around JOIN statements and existing tests had to
change, but overall it will result in better control over the indentation
rules.

Also updated CI build to use GNU Emacs 27.1
---
 .github/workflows/main.yml  |   2 +-
 sql-indent-test.el  |   9 +
 sql-indent.el   |  57 +++-
 sql-indent.org  |   4 +-
 test-data/m-syn.eld | 124 
 test-data/pr17-io-default.eld   |   2 +-
 test-data/pr17-io-left.eld  |   2 +-
 test-data/pr17-io-right.eld |   2 +-
 test-data/pr17-syn.eld  |  22 +-
 test-data/pr60-syn.eld  |  16 +-
 test-data/pr64-syn.eld  | 120 
 test-data/pr67-syn.eld  | 660 
 test-data/pr68-syn.eld  |  25 +-
 test-data/pr70-syn.eld  | 116 +++
 test-data/pr73-syn.eld  | 100 +++---
 test-data/pr75-oracle-syn.eld   |  20 +-
 test-data/pr75-postgres-syn.eld |  46 +--
 test-data/pr85-syn.eld  |  96 +++---
 test-data/pr99-syn.eld  | 150 +
 test-data/pr99.sql  |  64 
 20 files changed, 951 insertions(+), 686 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 7424994..1b15c3b 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -10,7 +10,7 @@ jobs:
 strategy:
   matrix:
 emacs_version:
-  - 26.3
+  - 27.1
 steps:
 - uses: purcell/setup-emacs@master
   with:
diff --git a/sql-indent-test.el b/sql-indent-test.el
index 57929d4..266a8bd 100644
--- a/sql-indent-test.el
+++ b/sql-indent-test.el
@@ -252,6 +252,10 @@ information read from DATA-FILE (as generated by
 (select-column sqlind-indent-select-column
sqlind-align-comma)
 (select-column-continuationsqlind-indent-select-column)
+(select-table  sqlind-indent-select-table
+   sqlind-lineup-joins-to-anchor
+   sqlind-lineup-open-paren-to-anchor
+   sqlind-align-comma)
 (select-table-continuation sqlind-indent-select-table
sqlind-lineup-joins-to-anchor
sqlind-lineup-open-paren-to-anchor
@@ -474,4 +478,9 @@ information read from DATA-FILE (as generated by
"test-data/pr97.sql"
"test-data/pr97-syn.eld"))
 
+(ert-deftest sqlind-ert-pr99 ()
+  (sqlind-ert-check-file-syntax
+   "test-data/pr99.sql"
+   "test-data/pr99-syn.eld"))
+
 ;;; sql-indent-test.el ends here
diff --git a/sql-indent.el b/sql-indent.el
index 44fbb37..c528f78 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -1135,7 +1135,9 @@ statement is found."
 ;; condition
 (goto-char pos)
 (when (or (looking-at sqlind-join-condition-regexp)
-  (progn (forward-word -1) (looking-at 
sqlind-select-join-regexp)))
+  (progn (forward-word -1)
+  (and (sqlind-same-level-statement (point) 
pos)
+   (looking-at 
sqlind-select-join-regexp
   ;; look for the join start, that will be the anchor
(let ((jstart (sqlind-find-join-start (point) start)))
  (when jstart
@@ -1144,15 +1146,44 @@ statement is found."
   ;; if this line starts with a ',' or the previous line starts
   ;; with a ',', we have a new table
   (goto-char pos)
+   ;; NOTE: the combination of tests and movement operations in
+   ;; the when clause is not ideal...
   (when (or (looking-at ",")
+ (looking-at sqlind-select-join-regexp)
+ (looking-at "join\\b")
 (progn
(sqlind-backward-syntactic-ws)
-  (looking-at ",")))
+   (or (looking-at ",")
+   (progn
+ (forward-word -1)
+ (or (looking-at sqlind-select-join-regexp)
+ (looking-at "join\\b")
+ (looking-at "from\\b"))
 (throw 'finished (cons 'select-table match-pos)))
 
-  ;; otherwise, we continue the table definition from the
-  ;; previous line.
-  (throw 'finished (cons 'select-table-continuati

[elpa] externals/shell-command+ 0e3978a 1/9: Fix shell-command+--command-regexp once again

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 0e3978a2351477b6babbe301946e4bfef74fdcd3
Author: Philip K 
Commit: Philip K 

Fix shell-command+--command-regexp once again
---
 shell-command+.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shell-command+.el b/shell-command+.el
index 0e39798..211cfd5 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -92,9 +92,9 @@ handlers if the symbol (eg. `man') is contained in the list."
   ;; allow whitespace after indicator
   (* space)
   ;; actual command (and command name)
-  (group (? (group (+? not-newline))
-(+ space))
- (+ not-newline))
+  (group (group (+ (not space)))
+ (* space)
+ (*? not-newline))
   eos)
   "Regular expression to parse `shell-command+' input.")
 



[elpa] externals/shell-command+ 683cb7d 6/9: Set URL header to repository

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 683cb7df6ec72840a239374d0aee75c29a6a51d6
Author: Philip K 
Commit: Philip K 

Set URL header to repository
---
 shell-command+.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell-command+.el b/shell-command+.el
index cd54424..ba6565d 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -6,7 +6,7 @@
 ;; Version: 2.1.0
 ;; Keywords: unix, processes, convenience
 ;; Package-Requires: ((emacs "24.1"))
-;; URL: http://elpa.gnu.org/packages/shell-command+.html
+;; URL: https://git.sr.ht/~zge/bang
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by



[elpa] externals/shell-command+ updated (c31f5f5 -> 7d818ba)

2021-05-19 Thread monnier--- via
monnier pushed a change to branch externals/shell-command+.

  from  c31f5f5   Bump version to 2.1.0
   new  0e3978a   Fix shell-command+--command-regexp once again
   new  1a775bc   Explicitly require em-unix
   new  96cb9c0   Change example in Commentary section from make to man
   new  07c55d1   Remove "Features" section in README
   new  2de1712   Update old parts of README
   new  683cb7d   Set URL header to repository
   new  5fbe4d8   Strip away all trailing whitespace
   new  2895bc0   Extract parsing into shell-command+-parse
   new  7d818ba   Create shell-command+-tests.el


Summary of changes:
 README.md   |  50 +--
 shell-command+-tests.el | 158 
 shell-command+.el   |  93 
 3 files changed, 227 insertions(+), 74 deletions(-)
 create mode 100644 shell-command+-tests.el



[elpa] externals/shell-command+ 5fbe4d8 7/9: Strip away all trailing whitespace

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 5fbe4d89e6672224d86f0851be431c0eced0c5cb
Author: Philip K 
Commit: Philip K 

Strip away all trailing whitespace
---
 shell-command+.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/shell-command+.el b/shell-command+.el
index ba6565d..c482449 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -95,8 +95,10 @@ handlers if the symbol (eg. `man') is contained in the list."
   (* space)
   ;; actual command (and command name)
   (group (group (+ (not space)))
- (* space)
+ (*? space)
  (*? not-newline))
+  ;; ignore all trailing whitespace
+  (* space)
   eos)
   "Regular expression to parse `shell-command+' input.")
 



[elpa] externals/shell-command+ 07c55d1 4/9: Remove "Features" section in README

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 07c55d1db2ca0ce2b88e3f99cc662c4322de98a1
Author: Philip K 
Commit: Philip K 

Remove "Features" section in README
---
 README.md | 28 
 1 file changed, 28 deletions(-)

diff --git a/README.md b/README.md
index 5532f95..2d861c4 100644
--- a/README.md
+++ b/README.md
@@ -7,34 +7,6 @@ to run commands on regions or whole buffers, among other 
things.
 `shell-command+` has been based on a function named `bang` by [Leah
 Neukirchen][leah].
 
-Features
-
-
-Usually `shell-command+` acts just like `shell-command`, but in
-certain cases, `shell-command+` pre-processes the input. Here are a
-few examples of what that might look like:
-
-   > wc -l
-
-Count all lines in a buffer, and display the result in the
-minibuffer.
-
-   .. < ls -l
-
-Replace the current region (or buffer in no region is selected)
-with a directory listing of the parent directory.
-
-   | tr -d a-z
-
-Delete all instances of the charachters a, b, c, ..., z, in the
-selected region (or buffer, if no region was selected).
-
-   .../src make
-
-Run Eshell's make (via `compile`) in the parent's parent
-directory, and then in `src`.
-
-
 How to use
 --
 



[elpa] externals/shell-command+ 96cb9c0 3/9: Change example in Commentary section from make to man

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 96cb9c03646e118dd65de9efc68f99459b1ce24f
Author: Philip K 
Commit: Philip K 

Change example in Commentary section from make to man
---
 shell-command+.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/shell-command+.el b/shell-command+.el
index 51acf3d..cd54424 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -50,10 +50,11 @@
 ;; selected region (or buffer, if no region was selected).
 ;;
 ;;
-;; ... make
+;; man fprintf
 ;;
-;; Run Eshell's make (via `compile') in the parent's parent
-;; directory.
+;; Open a man-page using Emacs default man page viewer.  This feature
+;; is based on `eshell', and can be customized using
+;; `shell-command+-use-eshell'.
 ;;
 ;; See `shell-command+'s docstring for more details on how it's input
 ;; is interpreted..



[elpa] externals/shell-command+ 1a775bc 2/9: Explicitly require em-unix

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 1a775bc5c7b3551d8ad2afe65adee0746e014129
Author: Philip K 
Commit: Philip K 

Explicitly require em-unix

Without this, eshell/... functions are not defined, and shell-command+
cannot check if they exist.
---
 shell-command+.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/shell-command+.el b/shell-command+.el
index 211cfd5..51acf3d 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -60,6 +60,7 @@
 
 (eval-when-compile (require 'rx))
 (require 'eshell)
+(require 'em-unix)
 
 ;;; Code:
 



[elpa] externals/shell-command+ 7d818ba 9/9: Create shell-command+-tests.el

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 7d818ba273273ec6ef126eab64e9f26faeb702f8
Author: Philip K 
Commit: Philip K 

Create shell-command+-tests.el
---
 shell-command+-tests.el | 158 
 1 file changed, 158 insertions(+)

diff --git a/shell-command+-tests.el b/shell-command+-tests.el
new file mode 100644
index 000..e4c54e2
--- /dev/null
+++ b/shell-command+-tests.el
@@ -0,0 +1,158 @@
+;;; shell-command+-tests.el --- Tests for shell-command+  -*- lexical-binding: 
t; -*-
+
+;; Copyright (C) 2021  Philip Kaludercic
+
+;; Author: Philip Kaludercic 
+
+;; 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 .
+
+;;; Code:
+
+(require 'ert)
+(require 'shell-command+)
+(require 'pcase)
+
+(ert-deftest sc+-basic ()
+  "Make sure a simple command is recognized."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "command")))
+(should (null path))
+(should (null mode))
+(should (string= command "command"))
+(should (string= rest "command"
+
+(ert-deftest sc+-basic2 ()
+  "Make sure a simple command with an argument is recognized."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "command arg")))
+(should (null path))
+(should (null mode))
+(should (string= command "command"))
+(should (string= rest "command arg"
+
+(ert-deftest sc+-basic3 ()
+  "Make sure a simple command with an argument is recognized."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "command arg arg2")))
+(should (null path))
+(should (null mode))
+(should (string= command "command"))
+(should (string= rest "command arg arg2"
+
+(ert-deftest sc+-path ()
+  "Make sure a simple command with an argument is recognized."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "... command arg arg2")))
+(should (string= path "..."))
+(should (null mode))
+(should (string= command "command"))
+(should (string= rest "command arg arg2"
+
+(ert-deftest sc+-path2 ()
+  "Make sure a simple command with an argument is recognized."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse ".../dir command arg arg2")))
+(should (string= path ".../dir"))
+(should (null mode))
+(should (string= command "command"))
+(should (string= rest "command arg arg2"
+
+(ert-deftest sc+-input ()
+  "Make sure input is recognized."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "< command arg arg2")))
+(should (null path))
+(should (eq mode 'input))
+(should (string= command "command"))
+(should (string= rest "command arg arg2"
+
+(ert-deftest sc+-output ()
+  "Make sure output is recognized."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "> command arg arg2")))
+(should (null path))
+(should (eq mode 'output))
+(should (string= command "command"))
+(should (string= rest "command arg arg2"
+
+(ert-deftest sc+-pipe ()
+  "Make sure pipe is recognized."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "| command arg arg2")))
+(should (null path))
+(should (eq mode 'pipe))
+(should (string= command "command"))
+(should (string= rest "command arg arg2"
+
+(ert-deftest sc+-input-and-path ()
+  "Check if input and path conflict."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "... < command arg arg2")))
+(should (string= "..." path))
+(should (eq mode 'input))
+(should (string= command "command"))
+(should (string= rest "command arg arg2"
+
+(ert-deftest sc+-output-and-path ()
+  "Check if output and path conflict."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "... > command arg arg2")))
+(should (string= "..." path))
+(should (eq mode 'output))
+(should (string= command "command"))
+(should (string= rest "command arg arg2"
+
+(ert-deftest sc+-pipe-and-path ()
+  "Check if pipe and path conflict."
+  (pcase-let* ((`(,path ,mode ,command ,rest)
+(shell-command+-parse "... | command arg arg2")))
+(should (string= "..." path))
+(should (eq mode 'pipe))
+(should (str

[elpa] externals/shell-command+ 2de1712 5/9: Update old parts of README

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 2de1712abfc3963762b6b97460c43f40ddb15577
Author: Philip K 
Commit: Philip K 

Update old parts of README
---
 README.md | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 2d861c4..d7e6add 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-`bang.el`
-=
+`shell-command+.el`
+===
 
 `shell-command+` is a `shell-command` substitute that makes it easier
 to run commands on regions or whole buffers, among other things.
@@ -17,8 +17,6 @@ invoking
 
 Bind the command `shell-command+` to any key, for example `M-!`.
 
-Bug reports and patches should be sent to my [public inbox].
-
 Using [`setup`][setup] I configure `shell-command+` as so:
 
 ~~~elisp
@@ -29,14 +27,22 @@ Using [`setup`][setup] I configure `shell-command+` as so:
   (:global "M-!" shell-command+))
 ~~~
 
+Bugs
+
+
+Bugs or comments can be submitted to my [public inbox][mail].  Note
+that non-trivial contributions require a [copyright assignment][ca] to
+the FSF.
+
 Copying
 ---
 
-`bang.el` is distributed under the [CC0 1.0 Universal (CC0 1.0) Public
-Domain Dedication][cc0] license.
+`shell-command+.el` is distributed under the [GPL v3][gpl3] license.
 
 [leah]: http://leahneukirchen.org/dotfiles/.emacs
 [ELPA]: http://elpa.gnu.org/packages/shell-command+.html
-[public inbox]: https://lists.sr.ht/~zge/public-inbox
+[mail]: https://lists.sr.ht/~zge/public-inbox
 [setup]: http://elpa.gnu.org/packages/setup.html
-[cc0]: https://creativecommons.org/publicdomain/zero/1.0/deed
+[ca]: 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html#Copyright-Assignment
+[gpl3]: https://www.gnu.org/licenses/gpl-3.0.en.html
+



[elpa] externals/shell-command+ 2895bc0 8/9: Extract parsing into shell-command+-parse

2021-05-19 Thread monnier--- via
branch: externals/shell-command+
commit 2895bc04cf7a27b9bc519aa034a6f47fd138d91d
Author: Philip K 
Commit: Philip K 

Extract parsing into shell-command+-parse
---
 shell-command+.el | 75 ---
 1 file changed, 44 insertions(+), 31 deletions(-)

diff --git a/shell-command+.el b/shell-command+.el
index c482449..7d309d3 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -60,6 +60,7 @@
 ;; is interpreted..
 
 (eval-when-compile (require 'rx))
+(eval-when-compile (require 'pcase))
 (require 'eshell)
 (require 'em-unix)
 
@@ -115,6 +116,29 @@ proper upwards directory pointers.  This means that '' 
becomes
   (mapconcat #'identity (make-list (1- (length sub)) "..") "/"))
 path)))
 
+(defun shell-command+-parse (command)
+  "Return parsed representation of COMMAND."
+  (save-match-data
+(unless (string-match shell-command+--command-regexp command)
+  (error "Invalid command"))
+(list (match-string-no-properties 1 command)
+  (cond ((match-string-no-properties 2 command) ;<
+ 'input)
+((match-string-no-properties 3 command) ;>
+ 'output)
+((match-string-no-properties 4 command) ;|
+ 'pipe))
+  (match-string-no-properties 6 command)
+  (condition-case nil
+  (replace-regexp-in-string
+   (rx (* ?\\ ?\\) (or ?\\ (group "%")))
+   buffer-file-name
+   (match-string-no-properties 5 command)
+   nil nil 1)
+(error (match-string-no-properties 5 command))
+
+(shell-command+-parse "ls %")
+
 ;;;###autoload
 (defun shell-command+ (command beg end)
   "Intelligently execute string COMMAND in inferior shell.
@@ -141,37 +165,26 @@ between BEG and END.  Otherwise the whole buffer is 
processed."
   (interactive (list (read-shell-command shell-command+-prompt)
  (if (use-region-p) (region-beginning) (point-min))
  (if (use-region-p) (region-end) (point-max
-  (save-match-data
-(unless (string-match shell-command+--command-regexp command)
-  (error "Invalid command"))
-(let ((path (match-string-no-properties 1 command))
-  (cmd (match-string-no-properties 6 command))
-  (rest (condition-case nil
-(replace-regexp-in-string
- (rx (* ?\\ ?\\) (or ?\\ (group "%")))
- buffer-file-name
- (match-string-no-properties 5 command)
- nil nil 1)
-  (error (match-string-no-properties 5 command)
-  (let ((default-directory (shell-command+-expand-path (or path "."
-(cond ((match-string-no-properties 2 command) ;<
-   (delete-region beg end)
-   (shell-command rest t shell-command-default-error-buffer)
-   (exchange-point-and-mark))
-  ((match-string-no-properties 3 command) ;>
-   (shell-command-on-region
-beg end rest nil nil
-shell-command-default-error-buffer t))
-  ((match-string-no-properties 4 command) ;|
-   (shell-command-on-region
-beg end rest t t
-shell-command-default-error-buffer t))
-  ((and (or (eq shell-command+-use-eshell t)
-(memq (intern cmd) shell-command+-use-eshell))
-(intern-soft (concat "eshell/" cmd)))
-   (eshell-command rest (and current-prefix-arg t)))
-  (t (shell-command rest (and current-prefix-arg t)
-shell-command-default-error-buffer)))
+  (pcase-let* ((`(,path ,mode ,command ,rest) (shell-command+-parse command))
+   (default-directory (shell-command+-expand-path (or path "."
+(cond ((eq mode 'input)
+   (delete-region beg end)
+   (shell-command rest t shell-command-default-error-buffer)
+   (exchange-point-and-mark))
+  ((eq mode 'output)
+   (shell-command-on-region
+beg end rest nil nil
+shell-command-default-error-buffer t))
+  ((eq mode 'pipe)  ;|
+   (shell-command-on-region
+beg end rest t t
+shell-command-default-error-buffer t))
+  ((and (or (eq shell-command+-use-eshell t)
+(memq (intern command) shell-command+-use-eshell))
+(intern-soft (concat "eshell/" command)))
+   (eshell-command rest (and current-prefix-arg t)))
+  (t (shell-command rest (and current-prefix-arg t)
+shell-command-default-error-buffer)
 
 (provide 'shell-command+)
 



[elpa] main 53dcde7: * elpa-packages (shell-command+): Fix URL

2021-05-19 Thread monnier--- via
branch: main
commit 53dcde797e84c8458948914a679111829f38e3e2
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packages (shell-command+): Fix URL
---
 elpa-packages | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elpa-packages b/elpa-packages
index 7210c19..86ae8a4 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -325,7 +325,7 @@
  ("seq":url nil)
  ("setup"  :url "https://git.sr.ht/~zge/setup";)
  ("shelisp":url nil)
- ("shell-command+" :url "https://git.sr.ht/~zge/bang/tree/shell-command+";)
+ ("shell-command+" :url "https://git.sr.ht/~zge/bang";)
  ("shell-quasiquote"   :url nil)
  ("shen-mode"  :url nil)
  ("sisu-mode"  :url nil)



[elpa] externals/hyperbole ad26432: Makefile (kotl-autoloads.el) Revert deletion of $(PRELOADS)

2021-05-19 Thread ELPA Syncer
branch: externals/hyperbole
commit ad26432f63f3b73415aa513463902a34a8577d18
Author: Bob Weiner 
Commit: Bob Weiner 

Makefile (kotl-autoloads.el) Revert deletion of $(PRELOADS)

This is needed to define make-directory-autoloads in pre-Emacs 28.
---
 ChangeLog | 7 ++-
 Makefile  | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 36d1f28..a7525c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
-2021-05-18  Bob Weiner  
+2021-05-19  Bob Weiner  
+
+* Makefile (kotl/kotl-autoloads.el): Revert commit that removed
+PRELOADS (needed to define make-directory-autoloads in pre-
+Emacs 28.
 
+2021-05-18  Bob Weiner  
 
 * kotl/kotl-mode.el (kotl-mode:example): Update to allow for
 an optional directory or absolute file path.  Prompt for
diff --git a/Makefile b/Makefile
index 9c55112..fcbd2e1 100644
--- a/Makefile
+++ b/Makefile
@@ -340,7 +340,7 @@ hyperbole-autoloads.el: $(EL_COMPILE)
$(EMACS) $(BATCHFLAGS) $(PRELOADS) --debug --eval "(progn (setq 
generated-autoload-file (expand-file-name \"hyperbole-autoloads.el\") 
backup-inhibited t) (let (find-file-hooks) (make-directory-autoloads \".\" 
generated-autoload-file)))"
 
 kotl/kotl-autoloads.el: $(EL_KOTL)
-   $(EMACS) $(BATCHFLAGS) --eval "(progn (setq generated-autoload-file 
(expand-file-name \"kotl/kotl-autoloads.el\") backup-inhibited t) (let 
(find-file-hooks) (make-directory-autoloads \"kotl/\" 
generated-autoload-file)))"
+   $(EMACS) $(BATCHFLAGS) $(PRELOADS) --debug --eval "(progn (setq 
generated-autoload-file (expand-file-name \"kotl/kotl-autoloads.el\") 
backup-inhibited t) (let (find-file-hooks) (make-directory-autoloads \"kotl/\" 
generated-autoload-file)))"
 
 # Used for ftp.gnu.org tarball distributions.
 $(pkg_dir)/hyperbole-$(HYPB_VERSION).tar.gz: