[elpa] externals/vertico 75f33e3: Introduce vertico--metadata-get
branch: externals/vertico commit 75f33e36204f8a72d0b8cde81e04d3350a848981 Author: Daniel Mendler Commit: Daniel Mendler Introduce vertico--metadata-get --- vertico.el | 44 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/vertico.el b/vertico.el index 31a9569..98d27d6 100644 --- a/vertico.el +++ b/vertico.el @@ -241,10 +241,10 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and PRED." (defun vertico--affixate (candidates) "Annotate CANDIDATES with annotation function." - (if-let (aff (or (completion-metadata-get vertico--metadata 'affixation-function) + (if-let (aff (or (vertico--metadata-get 'affixation-function) (plist-get completion-extra-properties :affixation-function))) (funcall aff candidates) -(if-let (ann (or (completion-metadata-get vertico--metadata 'annotation-function) +(if-let (ann (or (vertico--metadata-get 'annotation-function) (plist-get completion-extra-properties :annotation-function))) (mapcar (lambda (cand) (let ((suffix (or (funcall ann cand) ""))) @@ -302,9 +302,13 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and PRED." (cons (apply #'completion-all-completions args) hl)) (cons (apply #'completion-all-completions args) hl -(defun vertico--sort-function (metadata) - "Return the sorting function given the completion METADATA." - (or (completion-metadata-get metadata 'display-sort-function) vertico-sort-function)) +(defun vertico--metadata-get (prop) + "Return PROP from completion metadata." + (completion-metadata-get vertico--metadata prop)) + +(defun vertico--sort-function () + "Return the sorting function." + (or (vertico--metadata-get 'display-sort-function) vertico-sort-function)) (defun vertico--filter-files (files) "Filter FILES by `completion-ignored-extensions'." @@ -313,8 +317,8 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and PRED." "\\)\\'"))) (or (seq-remove (lambda (x) (string-match-p re x)) files) files))) -(defun vertico--recompute-candidates (pt content metadata) - "Recompute candidates given PT, CONTENT and METADATA." +(defun vertico--recompute-candidates (pt content) + "Recompute candidates given PT and CONTENT." ;; Redisplay the minibuffer such that the input becomes immediately ;; visible before the expensive candidate recomputation is performed (Issue #89). ;; Do not redisplay during initialization, since this leads to flicker. @@ -332,15 +336,14 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and PRED." (t (cons 0 (length after)) (field (substring content (car bounds) (+ pt (cdr bounds ;; `minibuffer-completing-file-name' has been obsoleted by the completion category - (completing-file (eq 'file (completion-metadata-get metadata 'category))) + (completing-file (eq 'file (vertico--metadata-get 'category))) (`(,all . ,hl) (vertico--all-completions content minibuffer-completion-table minibuffer-completion-predicate -pt metadata)) +pt vertico--metadata)) (base (or (when-let (z (last all)) (prog1 (cdr z) (setcdr z nil))) 0)) (base-str (substring content 0 base)) (def (or (car-safe minibuffer-default) minibuffer-default)) - (sort (vertico--sort-function metadata)) (groups)) ;; Reset the history hash table (unless (equal base-str vertico--history-base) @@ -351,14 +354,14 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and PRED." (when completing-file (setq all (vertico--filter-files all))) ;; Sort using the `display-sort-function' or the Vertico sort functions -(when sort (setq all (funcall sort all))) +(setq all (funcall (or (vertico--sort-function) #'identity) all)) ;; Move special candidates: "field" appears at the top, before "field/", before default value (when (stringp def) (setq all (vertico--move-to-front def all))) (when (and completing-file (not (string-suffix-p "/" field))) (setq all (vertico--move-to-front (concat field "/") all))) (setq all (vertico--move-to-front field all)) -(when-let (group-fun (and all (completion-metadata-get metadata 'group-function))) +(when-let (group-fun (and all (vertico--metadata-get 'group-function))) (setq groups (vertico--group-by group-fun all) all (car groups))) (list base (length all) ;; Default value is missing from collection @@ -420,13 +423,14 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and PRED
[elpa] externals/corfu 8aba98c: Cleanup and linting
branch: externals/corfu commit 8aba98c044a20446a2bbe45c5927c988c300e123 Author: Daniel Mendler Commit: Daniel Mendler Cleanup and linting --- corfu.el | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/corfu.el b/corfu.el index d2a4be3..b5d6077 100644 --- a/corfu.el +++ b/corfu.el @@ -377,7 +377,9 @@ completion began less than that number of seconds ago." (make-frame-visible corfu--frame))) (defun corfu--popup-show (pos off lines &optional curr lo bar) - "Show LINES as popup at POS, with CURR highlighted and scrollbar from LO to LO+BAR." + "Show LINES as popup at POS - OFF. +The current candidate CURR is highlighted. +A scroll bar is displayed from LO to LO+BAR." (let* ((ch (default-line-height)) (cw (default-font-width)) (mw (ceiling (* cw corfu-margin-width))) @@ -509,7 +511,7 @@ completion began less than that number of seconds ago." (redisplay) (pcase-let* ((before (substring str 0 pt)) (after (substring str pt)) - (metadata (completion-metadata before table pred)) + (corfu--metadata (completion-metadata before table pred)) ;; bug#47678: `completion-boundaries` fails for `partial-completion` ;; if the cursor is moved between the slashes of "~//". ;; See also vertico.el which has the same issue. @@ -520,15 +522,15 @@ completion began less than that number of seconds ago." after) (t (cons 0 (length after)) (field (substring str (car bounds) (+ pt (cdr bounds - (completing-file (eq (corfu--metadata-get metadata 'category) 'file)) - (`(,all . ,hl) (corfu--all-completions str table pred pt metadata)) + (completing-file (eq (corfu--metadata-get 'category) 'file)) + (`(,all . ,hl) (corfu--all-completions str table pred pt corfu--metadata)) (base (or (when-let (z (last all)) (prog1 (cdr z) (setcdr z nil))) 0))) ;; Filter the ignored file extensions. We cannot use modified predicate for this filtering, ;; since this breaks the special casing in the `completion-file-name-table' for `file-exists-p' ;; and `file-directory-p'. (when completing-file (setq all (corfu--filter-files all))) -(setq all (if-let (sort (corfu--metadata-get metadata 'display-sort-function)) +(setq all (if-let (sort (corfu--metadata-get 'display-sort-function)) (funcall sort all) (sort all #'corfu--sort-predicate))) (unless (equal field "") @@ -536,7 +538,7 @@ completion began less than that number of seconds ago." (when (and completing-file (not (string-suffix-p "/" field))) (setq all (corfu--move-to-front (concat field "/") all))) (setq all (corfu--move-to-front field all))) -(list base (length all) all hl metadata))) +(list base (length all) all hl corfu--metadata))) (defun corfu--update-candidates (str pt table pred) "Update candidates from STR, PT, TABLE and PRED." @@ -566,10 +568,10 @@ completion began less than that number of seconds ago." (defun corfu--affixate (cands) "Annotate CANDS with annotation function." (setq cands -(if-let (aff (or (corfu--metadata-get corfu--metadata 'affixation-function) +(if-let (aff (or (corfu--metadata-get 'affixation-function) (plist-get corfu--extra :affixation-function))) (funcall aff cands) - (if-let (ann (or (corfu--metadata-get corfu--metadata 'annotation-function) + (if-let (ann (or (corfu--metadata-get 'annotation-function) (plist-get corfu--extra :annotation-function))) (mapcar (lambda (cand) (let ((suffix (or (funcall ann cand) ""))) @@ -590,11 +592,11 @@ completion began less than that number of seconds ago." cands)) cands) -;; XXX Do not use `completion-metadata-get' in order to avoid Marginalia. -;; The Marginalia annotators are way to heavy for the Corfu popup! -(defun corfu--metadata-get (metadata prop) - "Return PROP from METADATA." - (cdr (assq prop metadata))) +(defun corfu--metadata-get (prop) + "Return PROP from completion metadata." + ;; Note: Do not use `completion-metadata-get' in order to avoid Marginalia. + ;; The Marginalia annotators are too heavy for the Corfu popup! + (cdr (assq prop corfu--metadata))) (defun corfu--format-candidates (cands) "Format annotated CANDS." @@ -963,8 +965,9 @@ completion began less than that number of seconds ago." ((and `(,fun ,beg ,end ,table . ,plist) (guard (integer-or-marker-p beg)) (guard (<= beg (point) end)) -(let len (or (plist-get plist :company-prefix-length) (- (point) beg))) -(guard (or (eq len t) (>= len corfu-auto-pre
[elpa] externals/org e961125: oc: Fix docstring typos
branch: externals/org commit e961125768292fe1ab33b2e717879a286f63ff50 Author: Nicolas Goaziou Commit: Nicolas Goaziou oc: Fix docstring typos * lisp/oc.el (org-cite-make-insert-processor): Fix typos in docstring. Fill mostly under 60 characters. --- lisp/oc.el | 40 ++-- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/lisp/oc.el b/lisp/oc.el index 41fd688..ce89f7b 100644 --- a/lisp/oc.el +++ b/lisp/oc.el @@ -1523,38 +1523,42 @@ Citation keys are strings without the leading \"@\"." (defun org-cite-make-insert-processor (select-key select-style) "Build a function appropriate as an insert processor. -SELECT-KEY is a function called with one argument. When it is nil, the function -should return a citation key as a string, or nil. Otherwise, the function -should return a list of such keys, or nil. The keys should not have any leading -\"@\" character. +SELECT-KEY is a function called with one argument. When it is +nil, the function should return a citation key as a string, or +nil. Otherwise, the function should return a list of such keys, +or nil. The keys should not have any leading \"@\" character. -SELECT-STYLE is a function called with one argument, the citation object being -edited or constructed so far. It should return a style string, or nil. +SELECT-STYLE is a function called with one argument, the citation +object being edited or constructed so far. It should return +a style string, or nil. -The return value is a function of two arguments: CONTEXT and ARG. CONTEXT is -either a citation reference, a citation object, or nil. ARG is a prefix -argument. +The return value is a function of two arguments: CONTEXT and ARG. +CONTEXT is either a citation reference, a citation object, or +nil. ARG is a prefix argument. -The generated function inserts or edit a citation at point. More specifically, +The generated function inserts or edits a citation at point. +More specifically, On a citation reference: -- on the prefix or right before th \"@\" character, insert a new reference - before the current one, +- on the prefix or right before th \"@\" character, insert + a new reference before the current one, - on the suffix, insert it after the reference, - otherwise, update the cite key, preserving both affixes. -When ARG is non-nil, remove the reference, possibly removing the whole -citation if it contains a single reference. +When ARG is non-nil, remove the reference, possibly removing +the whole citation if it contains a single reference. On a citation object: - on the style part, offer to update it, -- on the global prefix, add a new reference before the first one, -- on the global suffix, add a new reference after the last one, +- on the global prefix, add a new reference before the first + one, +- on the global suffix, add a new reference after the last + one. - Elsewhere, insert a citation at point. When ARG is non-nil, offer to complete - style in addition to references." + Elsewhere, insert a citation at point. When ARG is non-nil, + offer to complete style in addition to references." (unless (and (functionp select-key) (functionp select-style)) (error "Wrong argument type(s)")) (lambda (context arg)
[nongnu] elpa/clojure-mode ac17cac 1/2: Add @magnars to the list of authors
branch: elpa/clojure-mode commit ac17cac6800cbbcef4d3a03b745c28b3dd8d3222 Author: Bozhidar Batsov Commit: Bozhidar Batsov Add @magnars to the list of authors After all, he's the person behind all the refactoring code that used to leave in clj-refactor.el originally. --- README.md | 2 +- clojure-mode.el | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f708ea2..dd1c0a5 100644 --- a/README.md +++ b/README.md @@ -535,7 +535,7 @@ An extensive changelog is available [here](CHANGELOG.md). ## License Copyright © 2007-2021 Jeffrey Chu, Lennart Staflin, Phil Hagelberg, Bozhidar -Batsov, Artur Malabarba and [contributors][]. +Batsov, Artur Malabarba, Magnar Sveen and [contributors][]. Distributed under the GNU General Public License; type C-h C-c to view it. diff --git a/clojure-mode.el b/clojure-mode.el index 4d7f046..2efd460 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -1,13 +1,14 @@ ;;; clojure-mode.el --- Major mode for Clojure code -*- lexical-binding: t; -*- ;; Copyright © 2007-2013 Jeffrey Chu, Lennart Staflin, Phil Hagelberg -;; Copyright © 2013-2021 Bozhidar Batsov, Artur Malabarba +;; Copyright © 2013-2021 Bozhidar Batsov, Artur Malabarba, Magnar Sveen ;; ;; Authors: Jeffrey Chu ;; Lennart Staflin ;; Phil Hagelberg ;; Bozhidar Batsov ;; Artur Malabarba +;; Magnar Sveen ;; Maintainer: Bozhidar Batsov ;; URL: http://github.com/clojure-emacs/clojure-mode ;; Keywords: languages clojure clojurescript lisp
[nongnu] elpa/clojure-mode updated (feb03a6 -> c1c4d9f)
elpasync pushed a change to branch elpa/clojure-mode. from feb03a6 Recognize babashka projects new ac17cac Add @magnars to the list of authors new c1c4d9f Update my email Summary of changes: README.md | 2 +- clojure-mode-extra-font-locking.el | 2 +- clojure-mode.el| 7 --- test/clojure-mode-external-interaction-test.el | 2 +- test/clojure-mode-font-lock-test.el| 2 +- test/clojure-mode-indentation-test.el | 2 +- test/clojure-mode-safe-eval-test.el| 2 +- test/clojure-mode-syntax-test.el | 2 +- test/clojure-mode-util-test.el | 2 +- test/utils/test-helper.el | 2 +- 10 files changed, 13 insertions(+), 12 deletions(-)
[nongnu] elpa/clojure-mode c1c4d9f 2/2: Update my email
branch: elpa/clojure-mode commit c1c4d9f8a10667e7a695d39b9385b45c0143fdb9 Author: Bozhidar Batsov Commit: Bozhidar Batsov Update my email --- clojure-mode-extra-font-locking.el | 2 +- clojure-mode.el| 4 ++-- test/clojure-mode-external-interaction-test.el | 2 +- test/clojure-mode-font-lock-test.el| 2 +- test/clojure-mode-indentation-test.el | 2 +- test/clojure-mode-safe-eval-test.el| 2 +- test/clojure-mode-syntax-test.el | 2 +- test/clojure-mode-util-test.el | 2 +- test/utils/test-helper.el | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clojure-mode-extra-font-locking.el b/clojure-mode-extra-font-locking.el index 89ca6c6..9811faf 100644 --- a/clojure-mode-extra-font-locking.el +++ b/clojure-mode-extra-font-locking.el @@ -2,7 +2,7 @@ ;; Copyright © 2014-2021 Bozhidar Batsov ;; -;; Author: Bozhidar Batsov +;; Author: Bozhidar Batsov ;; URL: http://github.com/clojure-emacs/clojure-mode ;; Version: 3.0.0 ;; Keywords: languages, lisp diff --git a/clojure-mode.el b/clojure-mode.el index 2efd460..a3aa43b 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -6,10 +6,10 @@ ;; Authors: Jeffrey Chu ;; Lennart Staflin ;; Phil Hagelberg -;; Bozhidar Batsov +;; Bozhidar Batsov ;; Artur Malabarba ;; Magnar Sveen -;; Maintainer: Bozhidar Batsov +;; Maintainer: Bozhidar Batsov ;; URL: http://github.com/clojure-emacs/clojure-mode ;; Keywords: languages clojure clojurescript lisp ;; Version: 5.13.0 diff --git a/test/clojure-mode-external-interaction-test.el b/test/clojure-mode-external-interaction-test.el index f6dba50..f8c8caf 100644 --- a/test/clojure-mode-external-interaction-test.el +++ b/test/clojure-mode-external-interaction-test.el @@ -1,6 +1,6 @@ ;;; clojure-mode-external-interaction-test.el --- Clojure Mode interactions with external packages test suite -*- lexical-binding: t; -*- -;; Copyright (C) 2014-2021 Bozhidar Batsov +;; Copyright (C) 2014-2021 Bozhidar Batsov ;; This file is not part of GNU Emacs. diff --git a/test/clojure-mode-font-lock-test.el b/test/clojure-mode-font-lock-test.el index 5e2b63a..da9cae2 100644 --- a/test/clojure-mode-font-lock-test.el +++ b/test/clojure-mode-font-lock-test.el @@ -1,7 +1,7 @@ ;;; clojure-mode-font-lock-test.el --- Clojure Mode: Font lock test suite ;; -*- lexical-binding: t; -*- -;; Copyright (C) 2014-2021 Bozhidar Batsov +;; Copyright (C) 2014-2021 Bozhidar Batsov ;; This file is not part of GNU Emacs. diff --git a/test/clojure-mode-indentation-test.el b/test/clojure-mode-indentation-test.el index 61e4867..c1c918a 100644 --- a/test/clojure-mode-indentation-test.el +++ b/test/clojure-mode-indentation-test.el @@ -1,6 +1,6 @@ ;;; clojure-mode-indentation-test.el --- Clojure Mode: indentation tests -*- lexical-binding: t; -*- -;; Copyright (C) 2015-2021 Bozhidar Batsov +;; Copyright (C) 2015-2021 Bozhidar Batsov ;; This file is not part of GNU Emacs. diff --git a/test/clojure-mode-safe-eval-test.el b/test/clojure-mode-safe-eval-test.el index 39c94ed..47b7c5b 100644 --- a/test/clojure-mode-safe-eval-test.el +++ b/test/clojure-mode-safe-eval-test.el @@ -1,6 +1,6 @@ ;;; clojure-mode-safe-eval-test.el --- Clojure Mode: safe eval test suite -*- lexical-binding: t; -*- -;; Copyright (C) 2014-2021 Bozhidar Batsov +;; Copyright (C) 2014-2021 Bozhidar Batsov ;; Copyright (C) 2021 Rob Browning ;; This file is not part of GNU Emacs. diff --git a/test/clojure-mode-syntax-test.el b/test/clojure-mode-syntax-test.el index 174b93e..2b03b04 100644 --- a/test/clojure-mode-syntax-test.el +++ b/test/clojure-mode-syntax-test.el @@ -1,6 +1,6 @@ ;;; clojure-mode-syntax-test.el --- Clojure Mode: syntax related tests -*- lexical-binding: t; -*- -;; Copyright (C) 2015-2021 Bozhidar Batsov +;; Copyright (C) 2015-2021 Bozhidar Batsov ;; This file is not part of GNU Emacs. diff --git a/test/clojure-mode-util-test.el b/test/clojure-mode-util-test.el index da7aec0..2ff86f2 100644 --- a/test/clojure-mode-util-test.el +++ b/test/clojure-mode-util-test.el @@ -1,6 +1,6 @@ ;;; clojure-mode-util-test.el --- Clojure Mode: util test suite -*- lexical-binding: t; -*- -;; Copyright (C) 2014-2021 Bozhidar Batsov +;; Copyright (C) 2014-2021 Bozhidar Batsov ;; This file is not part of GNU Emacs. diff --git a/test/utils/test-helper.el b/test/utils/test-helper.el index d822fef..a8fb38d 100644 --- a/test/utils/test-helper.el +++ b/test/utils/test-helper.el @@ -1,6 +1,6 @@ ;;; test-helper.el --- Clojure Mode: Non-interactive unit-test setup -*- lexical-binding: t; -*- -;; Copyright (C) 2014-2021 Bozhidar Batsov +;; Copyright (C) 2014-2021 Bozhidar Batsov ;; This file is not part of GNU Emacs.
[elpa] externals/corfu cc1c4fe 2/3: Do not trim annotations
branch: externals/corfu commit cc1c4fe150cd240a502521c6ca44fdfed2eb1803 Author: Daniel Mendler Commit: Daniel Mendler Do not trim annotations --- corfu.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/corfu.el b/corfu.el index 210b6be..a4927dc 100644 --- a/corfu.el +++ b/corfu.el @@ -601,12 +601,10 @@ A scroll bar is displayed from LO to LO+BAR." (setq cands (cl-loop for c in cands collect (cl-loop for s in c collect - (string-trim (replace-regexp-in-string "[ \t]*\n[ \t]*" " " s) + (replace-regexp-in-string "[ \t]*\n[ \t]*" " " s (let* ((cw (cl-loop for x in cands maximize (string-width (car x (pw (cl-loop for x in cands maximize (string-width (cadr x (sw (cl-loop for x in cands maximize (string-width (caddr x - (pw (if (> pw 0) (1+ pw) 0)) - (sw (if (> sw 0) (1+ sw) 0)) (width (+ pw cw sw))) (when (< width corfu-min-width) (setq cw (+ cw (- corfu-min-width width))
[elpa] externals/corfu updated (8aba98c -> ca297fe)
elpasync pushed a change to branch externals/corfu. from 8aba98c Cleanup and linting new 12833c7 Use cl-loop new cc1c4fe Do not trim annotations new ca297fe corfu--popup-show: Take width as argument Summary of changes: corfu.el | 66 ++-- 1 file changed, 31 insertions(+), 35 deletions(-)
[elpa] externals/corfu 12833c7 1/3: Use cl-loop
branch: externals/corfu commit 12833c7a933390361f2ce78c9709e9db68118222 Author: Daniel Mendler Commit: Daniel Mendler Use cl-loop --- corfu.el | 51 --- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/corfu.el b/corfu.el index b5d6077..210b6be 100644 --- a/corfu.el +++ b/corfu.el @@ -573,23 +573,21 @@ A scroll bar is displayed from LO to LO+BAR." (funcall aff cands) (if-let (ann (or (corfu--metadata-get 'annotation-function) (plist-get corfu--extra :annotation-function))) - (mapcar (lambda (cand) -(let ((suffix (or (funcall ann cand) ""))) - (list cand "" -;; The default completion UI adds the `completions-annotations' face -;; if no other faces are present. We use a custom `corfu-annotations' -;; face to allow further styling which fits better for popups. -(if (text-property-not-all 0 (length suffix) 'face nil suffix) -suffix - (propertize suffix 'face 'corfu-annotations) - cands) -(mapcar (lambda (cand) (list cand "" "")) cands + (cl-loop for cand in cands collect + (let ((suffix (or (funcall ann cand) ""))) + (list cand "" + ;; The default completion UI adds the `completions-annotations' face + ;; if no other faces are present. We use a custom `corfu-annotations' + ;; face to allow further styling which fits better for popups. + (if (text-property-not-all 0 (length suffix) 'face nil suffix) + suffix + (propertize suffix 'face 'corfu-annotations) +(cl-loop for cand in cands collect (list cand "" "") (when-let (dep (plist-get corfu--extra :company-deprecated)) -(mapc (pcase-lambda ((and x `(,c . ,_))) -(when (funcall dep c) - (setcar x (setq c (substring c))) - (add-face-text-property 0 (length c) 'corfu-deprecated 'append c))) - cands)) +(cl-loop for x in cands for (c . _) = x do + (when (funcall dep c) + (setcar x (setq c (substring c))) + (add-face-text-property 0 (length c) 'corfu-deprecated 'append c cands) (defun corfu--metadata-get (prop) @@ -615,17 +613,16 @@ A scroll bar is displayed from LO to LO+BAR." width corfu-min-width)) ;; -4 because of margins and some additional safety (setq width (min width corfu-max-width (- (frame-width) 4))) -(cons pw (mapcar (pcase-lambda (`(,cand ,prefix ,suffix)) - (truncate-string-to-width -(concat prefix -(make-string (- pw (string-width prefix)) ?\s) -cand -(make-string (+ (- cw (string-width cand)) -(- sw (string-width suffix))) - ?\s) -suffix) -width)) - cands +(cons pw (cl-loop for (cand prefix suffix) in cands collect + (truncate-string-to-width + (concat prefix + (make-string (- pw (string-width prefix)) ?\s) + cand + (make-string (+ (- cw (string-width cand)) + (- sw (string-width suffix))) +?\s) + suffix) + width) (defun corfu--show-candidates (beg end str) "Update display given BEG, END and STR."
[elpa] externals/corfu ca297fe 3/3: corfu--popup-show: Take width as argument
branch: externals/corfu commit ca297fe46eb94ed98ec48581ecb8d8ff6fe98bb9 Author: Daniel Mendler Commit: Daniel Mendler corfu--popup-show: Take width as argument --- corfu.el | 31 --- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/corfu.el b/corfu.el index a4927dc..82fd2fe 100644 --- a/corfu.el +++ b/corfu.el @@ -376,8 +376,9 @@ completion began less than that number of seconds ago." (set-frame-size corfu--frame width height t) (make-frame-visible corfu--frame))) -(defun corfu--popup-show (pos off lines &optional curr lo bar) +(defun corfu--popup-show (pos off width lines &optional curr lo bar) "Show LINES as popup at POS - OFF. +WIDTH is the width of the popup. The current candidate CURR is highlighted. A scroll bar is displayed from LO to LO+BAR." (let* ((ch (default-line-height)) @@ -389,7 +390,6 @@ A scroll bar is displayed from LO to LO+BAR." (sbar (concat (propertize " " 'display `(space :width (,(- mw bw (propertize " " 'face 'corfu-bar 'display `(space :width (,bw) - (width (cl-loop for x in lines maximize (string-width x))) (row 0) (pos (posn-x-y (posn-at-point pos))) (x (or (car pos) 0)) @@ -611,16 +611,17 @@ A scroll bar is displayed from LO to LO+BAR." width corfu-min-width)) ;; -4 because of margins and some additional safety (setq width (min width corfu-max-width (- (frame-width) 4))) -(cons pw (cl-loop for (cand prefix suffix) in cands collect - (truncate-string-to-width - (concat prefix - (make-string (- pw (string-width prefix)) ?\s) - cand - (make-string (+ (- cw (string-width cand)) - (- sw (string-width suffix))) -?\s) - suffix) - width) +(list pw width + (cl-loop for (cand prefix suffix) in cands collect + (truncate-string-to-width +(concat prefix +(make-string (- pw (string-width prefix)) ?\s) +cand +(make-string (+ (- cw (string-width cand)) +(- sw (string-width suffix))) + ?\s) +suffix) +width) (defun corfu--show-candidates (beg end str) "Update display given BEG, END and STR." @@ -631,13 +632,13 @@ A scroll bar is displayed from LO to LO+BAR." (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))) - (`(,pw . ,fcands) (corfu--format-candidates (corfu--affixate cands + (`(,pw ,width ,fcands) (corfu--format-candidates (corfu--affixate cands ;; Nonlinearity at the end and the beginning (when (/= start 0) (setq lo (max 1 lo))) (when (/= last corfu--total) (setq lo (min (- corfu-count bar 2) lo))) -(corfu--popup-show (+ beg corfu--base) pw fcands curr +(corfu--popup-show (+ beg corfu--base) pw width fcands curr (and (> corfu--total corfu-count) lo) bar) (when (>= curr 0) (corfu--echo-documentation (nth corfu--index corfu--candidates)) @@ -717,7 +718,7 @@ A scroll bar is displayed from LO to LO+BAR." (if (and corfu--auto-start (numberp corfu-quit-no-match)) (< (- (float-time) corfu--auto-start) corfu-quit-no-match) (eq t corfu-quit-no-match - (corfu--popup-show beg 0 '(#("No match" 0 8 (face italic ;; => Show confirmation popup + (corfu--popup-show beg 0 8 '(#("No match" 0 8 (face italic ;; => Confirmation popup t (defun corfu--pre-command ()
[elpa] externals/org 494c203: org-element-at-point: Fix breakage when called at the end of section
branch: externals/org commit 494c20363968899f80bd42306730f568c25331f3 Author: Ihor Radchenko Commit: Ihor Radchenko org-element-at-point: Fix breakage when called at the end of section * lisp/org-element.el (org-element-at-point): Do no unconditionally return first matching cached element when point is within blank lines after section element and CACHED-ONLY is non-nil. Fixes https://list.orgmode.org/smbl59$qjm$1...@ciao.gmane.io/T/#u --- lisp/org-element.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 54e1b4d..c98e95b 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -7511,9 +7511,6 @@ element ending there." (and (org-element-property :contents-begin element) (>= pom (org-element-property :begin element)) (< pom (org-element-property :contents-begin element))) - (and (org-element-property :contents-end element) - (< pom (org-element-property :end element)) - (>= pom (org-element-property :contents-end element))) (and (not (org-element-property :contents-end element)) (>= pom (org-element-property :begin element)) (< pom (org-element-property :end element)))
[elpa] externals/corfu updated (ca297fe -> 33a4aac)
elpasync pushed a change to branch externals/corfu. from ca297fe corfu--popup-show: Take width as argument new 2d8353c Replace corfu-margin-width with corfu-left/right-margin-width new 33a4aac Fix right margin formatting Summary of changes: corfu.el | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-)
[elpa] externals/corfu 33a4aac 2/2: Fix right margin formatting
branch: externals/corfu commit 33a4aac2348a5f3b035b3c6ed0c779bf11da21f5 Author: Daniel Mendler Commit: Daniel Mendler Fix right margin formatting --- corfu.el | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/corfu.el b/corfu.el index b381a10..0352957 100644 --- a/corfu.el +++ b/corfu.el @@ -390,7 +390,8 @@ A scroll bar is displayed from LO to LO+BAR." (lm (ceiling (* cw corfu-left-margin-width))) (rm (ceiling (* cw corfu-right-margin-width))) (bw (ceiling (min rm (* cw corfu-bar-width - (margin (and (> lm 0) (propertize " " 'display `(space :width (,lm) + (lmargin (and (> lm 0) (propertize " " 'display `(space :width (,lm) + (rmargin (and (> rm 0) (propertize " " 'display `(space :width (,rm) (sbar (when (> bw 0) (concat (propertize " " 'display `(space :align-to (- right (,rm (propertize " " 'display `(space :width (,(- rm bw @@ -403,7 +404,8 @@ A scroll bar is displayed from LO to LO+BAR." (- x lm (* cw off)) y (+ (* width cw) lm rm) (* (length lines) ch) (mapconcat (lambda (line) - (let ((str (concat margin line (and lo (<= lo row (+ lo bar)) sbar + (let ((str (concat lmargin line + (if (and lo (<= lo row (+ lo bar))) sbar rmargin (when (eq row curr) (add-face-text-property 0 (length str) 'corfu-current 'append str))
[elpa] externals/corfu 2d8353c 1/2: Replace corfu-margin-width with corfu-left/right-margin-width
branch: externals/corfu commit 2d8353c1c4ba454f24c6ce6058c388e7bad588f5 Author: Daniel Mendler Commit: Daniel Mendler Replace corfu-margin-width with corfu-left/right-margin-width --- corfu.el | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/corfu.el b/corfu.el index 82fd2fe..b381a10 100644 --- a/corfu.el +++ b/corfu.el @@ -86,8 +86,12 @@ completion began less than that number of seconds ago." "List of modes excluded by `corfu-global-mode'." :type '(repeat symbol)) -(defcustom corfu-margin-width 0.6 - "Width of the margin in units of the character width." +(defcustom corfu-left-margin-width 0.5 + "Width of the left margin in units of the character width." + :type 'float) + +(defcustom corfu-right-margin-width 0.5 + "Width of the right margin in units of the character width." :type 'float) (defcustom corfu-bar-width 0.2 @@ -383,24 +387,23 @@ The current candidate CURR is highlighted. A scroll bar is displayed from LO to LO+BAR." (let* ((ch (default-line-height)) (cw (default-font-width)) - (mw (ceiling (* cw corfu-margin-width))) - (bw (ceiling (* cw (min corfu-margin-width corfu-bar-width - (margin (propertize " " 'display `(space :width (,mw - (align (propertize " " 'display `(space :align-to (- right (,mw) - (sbar (concat -(propertize " " 'display `(space :width (,(- mw bw -(propertize " " 'face 'corfu-bar 'display `(space :width (,bw) + (lm (ceiling (* cw corfu-left-margin-width))) + (rm (ceiling (* cw corfu-right-margin-width))) + (bw (ceiling (min rm (* cw corfu-bar-width + (margin (and (> lm 0) (propertize " " 'display `(space :width (,lm) + (sbar (when (> bw 0) + (concat (propertize " " 'display `(space :align-to (- right (,rm + (propertize " " 'display `(space :width (,(- rm bw + (propertize " " 'face 'corfu-bar 'display `(space :width (,bw)) (row 0) (pos (posn-x-y (posn-at-point pos))) (x (or (car pos) 0)) (y (or (cdr pos) 0))) (corfu--make-frame - (- x mw (* cw off)) y - (+ (* width cw) mw mw) (* (length lines) ch) + (- x lm (* cw off)) y + (+ (* width cw) lm rm) (* (length lines) ch) (mapconcat (lambda (line) - (let ((str (concat margin line align - (if (and lo (<= lo row (+ lo bar))) - sbar margin + (let ((str (concat margin line (and lo (<= lo row (+ lo bar)) sbar (when (eq row curr) (add-face-text-property 0 (length str) 'corfu-current 'append str))
[elpa] externals/javaimp f2b61a6: Add javaimp-handler-regexp-alist
branch: externals/javaimp commit f2b61a6b3c0a61984b0251c5b7041cb802390f04 Author: Filipp Gunbin Commit: Filipp Gunbin Add javaimp-handler-regexp-alist * javaimp.el (javaimp-handler-regexp-alist): New var. (javaimp-visit-project): Use it. --- javaimp.el | 91 ++ 1 file changed, 50 insertions(+), 41 deletions(-) diff --git a/javaimp.el b/javaimp.el index 03bfed8..c739064 100644 --- a/javaimp.el +++ b/javaimp.el @@ -173,6 +173,12 @@ gradlew program, it is used in preference." ;; Variables +(defvar javaimp-handler-regexp-alist + '(("\\`build.gradle" . ,#'javaimp--gradle-visit) +("\\`pom.xml\\'" . ,#'javaimp--maven-visit)) + "Alist of file name patterns vs corresponding handler function. +A handler function takes one argument, a FILE.") + (defvar javaimp-project-forest nil "Visited projects") @@ -212,50 +218,53 @@ https://docs.gradle.org/current/userguide/java_library_plugin.html\ ;;;###autoload -(defun javaimp-visit-project (dir) - "Loads a project and its submodules. DIR should point to a -directory containing pom.xml / build.gradle[.kts]. +(defun javaimp-visit-project (file) + "Loads a project and its submodules from FILE. +FILE should have a handler as per `javaimp-handler-regexp-alist'. +Interactively, finds suitable files in this directory and parent +directories, and offers them as completion alternatives for FILE, +topmost first. After being processed by this command, the module tree becomes known to javaimp and `javaimp-add-import' may be called inside -any module file." - (interactive "DVisit Gradle or Maven project in directory: ") - (setq dir (file-name-as-directory (expand-file-name dir))) - (if-let ((build-file -(seq-find #'file-exists-p - (mapcar (lambda (f) -(concat dir f)) - '("build.gradle" "build.gradle.kts" -"pom.xml") - (progn -;; Forget previous tree(s) loaded from this build file, if -;; any. Additional project trees (see below) have the same -;; file-orig, so there may be several here. -(when-let ((existing-list -(seq-filter (lambda (node) - (equal (javaimp-module-file-orig - (javaimp-node-contents node)) -build-file)) -javaimp-project-forest))) - (if (y-or-n-p "Forget already loaded project(s)?") - (setq javaimp-project-forest -(seq-remove (lambda (node) - (memq node existing-list)) -javaimp-project-forest)) -(user-error "Aborted"))) -(let ((trees (funcall (if (string-match - "gradle" (file-name-nondirectory build-file)) - #'javaimp--gradle-visit -#'javaimp--maven-visit) - build-file))) - (push (car trees) javaimp-project-forest) - (dolist (node (cdr trees)) -(when (y-or-n-p - (format "Include additional project tree rooted at %S?" - (javaimp-module-id (javaimp-node-contents node - (push node javaimp-project-forest))) - (message "Loaded tree for %s" dir))) -(error "Could not find build file in directory %s" dir))) +any module's source file." + (interactive + (let ((file-regexp (mapconcat #'car javaimp-handler-regexp-alist "\\|")) + (cur-dir (expand-file-name default-directory)) + files parent) + (while (setq files (append (directory-files cur-dir t file-regexp) files) + ;; Prevent infloop on root + parent (file-name-directory (directory-file-name cur-dir)) + cur-dir (unless (string= parent cur-dir) parent))) + (read-file-name "Visit project from file: " nil files t))) + (setq file (expand-file-name file)) + (let ((handler (or (assoc-default (file-name-nondirectory file) +javaimp-handler-regexp-alist +#'string-match) + (user-error "No handler for file: %s" file +;; Forget previous tree(s) loaded from this build file, if any. +;; Additional project trees (see below) have the same file-orig, +;; so there may be several here. +(when-let ((existing-list +(seq-filter (lambda (node) + (equal (javaimp-module-file-orig + (javaimp-node-contents node)) +file)) +javaimp-project-forest))) + (if (y-or-n-p "Forget already loaded project(s)?") + (setq javaimp-pr
[elpa] externals/javaimp fce5fa9: Fix for previous commit
branch: externals/javaimp commit fce5fa9dc4c604d88eae7997ec6c18cccd49fd76 Author: Filipp Gunbin Commit: Filipp Gunbin Fix for previous commit --- javaimp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javaimp.el b/javaimp.el index c739064..50e49a7 100644 --- a/javaimp.el +++ b/javaimp.el @@ -236,7 +236,7 @@ any module's source file." ;; Prevent infloop on root parent (file-name-directory (directory-file-name cur-dir)) cur-dir (unless (string= parent cur-dir) parent))) - (read-file-name "Visit project from file: " nil files t))) + (list (read-file-name "Visit project from file: " nil files t (setq file (expand-file-name file)) (let ((handler (or (assoc-default (file-name-nondirectory file) javaimp-handler-regexp-alist
[elpa] externals/javaimp 7de7b2b: And one more fix
branch: externals/javaimp commit 7de7b2b872bd464086c0e0c4e97198b175f0c723 Author: Filipp Gunbin Commit: Filipp Gunbin And one more fix --- javaimp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javaimp.el b/javaimp.el index 50e49a7..ed4cc16 100644 --- a/javaimp.el +++ b/javaimp.el @@ -174,7 +174,7 @@ gradlew program, it is used in preference." ;; Variables (defvar javaimp-handler-regexp-alist - '(("\\`build.gradle" . ,#'javaimp--gradle-visit) + `(("\\`build.gradle" . ,#'javaimp--gradle-visit) ("\\`pom.xml\\'" . ,#'javaimp--maven-visit)) "Alist of file name patterns vs corresponding handler function. A handler function takes one argument, a FILE.")
[elpa] externals/corfu 0eac0f7: Add corfu-kind-formatter (#75)
branch: externals/corfu commit 0eac0f7406b56607b1435b1bfa5eb8c50d495269 Author: Daniel Mendler Commit: GitHub Add corfu-kind-formatter (#75) --- README.org | 2 +- corfu.el | 23 ++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.org b/README.org index 6eef653..89a99e7 100644 --- a/README.org +++ b/README.org @@ -49,6 +49,7 @@ - Show candidate documentation/signature string in the echo area. - Deprecated candidates are crossed out in the display. - Support for annotations (~annotation-function~, ~affixation-function~). + - Icons can be provided by an external package via ~corfu-kind-formatter~. * Configuration @@ -158,7 +159,6 @@ - Corfu falls back to the default Completion buffer on non-graphical displays, since Corfu requires child frames. - The abort handling could be improved, for example the input could be undone. - - Some Company metadata extensions are not supported (~company-kind~, ~company-match~). - No sorting by history, since ~completion-at-point~ does not maintain a history (See branch =history= for a possible solution). diff --git a/corfu.el b/corfu.el index 0352957..3b9a34e 100644 --- a/corfu.el +++ b/corfu.el @@ -102,6 +102,13 @@ completion began less than that number of seconds ago." "Show documentation string in the echo area after that number of seconds." :type '(choice boolean float)) +(defcustom corfu-kind-formatter nil + "Formatting function for candidate kind. +The function takes a symbol corresponding to the kind of the candidate +and must return a string. This function can be used to display icons in +front of the candidates." + :type '(choice function (const nil))) + (defcustom corfu-auto-prefix 3 "Minimum length of prefix for auto completion." :type 'integer) @@ -588,12 +595,15 @@ A scroll bar is displayed from LO to LO+BAR." suffix (propertize suffix 'face 'corfu-annotations) (cl-loop for cand in cands collect (list cand "" "") - (when-let (dep (plist-get corfu--extra :company-deprecated)) + (let ((dep (plist-get corfu--extra :company-deprecated)) +(kind (and corfu-kind-formatter (plist-get corfu--extra :company-kind (cl-loop for x in cands for (c . _) = x do - (when (funcall dep c) + (when kind + (setf (cadr x) (funcall corfu-kind-formatter (funcall kind c + (when (and dep (funcall dep c)) (setcar x (setq c (substring c))) - (add-face-text-property 0 (length c) 'corfu-deprecated 'append c - cands) + (add-face-text-property 0 (length c) 'corfu-deprecated 'append c))) +(cons kind cands))) (defun corfu--metadata-get (prop) "Return PROP from completion metadata." @@ -637,7 +647,10 @@ A scroll bar is displayed from LO to LO+BAR." (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))) - (`(,pw ,width ,fcands) (corfu--format-candidates (corfu--affixate cands + (`(,kind . ,acands) (corfu--affixate cands)) + (`(,pw ,width ,fcands) (corfu--format-candidates acands)) + ;; Disable the left margin if a kind function is specified. + (corfu-left-margin-width (if kind 0 corfu-left-margin-width))) ;; Nonlinearity at the end and the beginning (when (/= start 0) (setq lo (max 1 lo)))
[elpa] externals/consult 57dc1ad: Adjust consult--grep-match-regexp in order to support -[ABC] grep options (Fix #466)
branch: externals/consult commit 57dc1adfdc0feafc71c6f418ff7aa1adbe47a5fd Author: Daniel Mendler Commit: Daniel Mendler Adjust consult--grep-match-regexp in order to support -[ABC] grep options (Fix #466) The options -A, -B and -C can be passed to grep and ripgrep to show context around the matching lines. The regexp had to be adjusted since the returned lines have the form "file\0line-content" in contrast to "file\0line\0content" or "file\0line:content". --- consult.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consult.el b/consult.el index a3a8b47..3c94657 100644 --- a/consult.el +++ b/consult.el @@ -218,7 +218,7 @@ See `consult--multi' for a description of the source values." :type 'integer) (defconst consult--grep-match-regexp - "\\`\\(?:\\./\\)?\\([^\n\0]+\\)\0\\([0-9]+\\)[:\0]" + "\\`\\(?:\\./\\)?\\([^\n\0]+\\)\0\\([0-9]+\\)[-:\0]" "Regexp used to match file and line of grep output.") (defcustom consult-grep-args
[elpa] externals/corfu 9d71246: corfu--popup-show: More robust right margin
branch: externals/corfu commit 9d71246945d59015255ea7845c619ef49c14c5fe Author: Daniel Mendler Commit: Daniel Mendler corfu--popup-show: More robust right margin --- corfu.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corfu.el b/corfu.el index 3b9a34e..6e9fc47 100644 --- a/corfu.el +++ b/corfu.el @@ -398,7 +398,7 @@ A scroll bar is displayed from LO to LO+BAR." (rm (ceiling (* cw corfu-right-margin-width))) (bw (ceiling (min rm (* cw corfu-bar-width (lmargin (and (> lm 0) (propertize " " 'display `(space :width (,lm) - (rmargin (and (> rm 0) (propertize " " 'display `(space :width (,rm) + (rmargin (and (> rm 0) (propertize " " 'display `(space :align-to right (sbar (when (> bw 0) (concat (propertize " " 'display `(space :align-to (- right (,rm (propertize " " 'display `(space :width (,(- rm bw
[elpa] externals/eev a62710c: Added `ee-1stclassvideos-info'.
branch: externals/eev commit a62710cb1e91579075076f74fc3ff715199bd8a1 Author: Eduardo Ochs Commit: Eduardo Ochs Added `ee-1stclassvideos-info'. --- ChangeLog | 7 +++ VERSION | 4 +- eev-intro.el | 183 +- eev-on-windows.el | 97 ++--- eev-tlinks.el | 4 ++ eev-videolinks.el | 103 +- eev.el| 2 +- 7 files changed, 355 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43ce8be..36247fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ +2021-11-10 Eduardo Ochs + + * eev-intro.el (find-windows-beginner-intro): several new + sections. + 2021-11-09 Eduardo Ochs + * eev-videolinks.el (ee-1stclassvideos-info): new variable. + * eev-intro.el (find-video-links-intro): added the sections 9, 10, and 11. (find-windows-beginner-intro): almost totally rewritten. diff --git a/VERSION b/VERSION index 97804d0..f2fff1d 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -Tue Nov 9 03:53:48 GMT 2021 -Tue Nov 9 00:53:48 -03 2021 +Thu Nov 11 02:59:14 GMT 2021 +Wed Nov 10 23:59:14 -03 2021 diff --git a/eev-intro.el b/eev-intro.el index bd863de..ae4359e 100644 --- a/eev-intro.el +++ b/eev-intro.el @@ -19,7 +19,7 @@ ;; ;; Author: Eduardo Ochs ;; Maintainer: Eduardo Ochs -;; Version:20211109 +;; Version:2020 ;; Keywords: e-scripts ;; ;; Latest version: <http://angg.twu.net/eev-current/eev-intro.el> @@ -1975,7 +1975,7 @@ or by using the menu bar (the relevant options are under See: (find-enode \"Tool Bars\") (find-enode \"Menu Bar\") - (find-emacs-keys-intro \"3. Cutting & pasting\") + (find-eev-quick-intro \"5.2. Cutting and pasting\") @@ -12943,8 +12943,8 @@ tecnhical details, see: 6. Video links == -If you're on Windows please start by configuring your browser and -the path to it, as described here: +If you're on Windows you need to start by configuring your +browser and the path to it, as described here: (find-video-links-intro) (find-video-links-intro \"3. `find-youtube-video'\") @@ -12996,9 +12996,11 @@ sexps with `M-e'. (delete-file \"~/bin/wget.exe\") (delete-file \"~/bin/pdftotext.exe\") (delete-file \"~/bin/lua52.exe\") + (delete-file \"~/bin/lua52.dll\") (ee-download-with-eww \"http://angg.twu.net/2021-oficina/wget.exe\"; \"~/bin/\") (ee-download-with-eww \"http://angg.twu.net/2021-oficina/pdftotext.exe\"; \"~/bin/\") (ee-download-with-eww \"http://angg.twu.net/2021-oficina/lua52.exe\"; \"~/bin/\") + (ee-download-with-eww \"http://angg.twu.net/2021-oficina/lua52.dll\"; \"~/bin/\") The sexps in the block above only need to be executed once - you don't need to execute them at each Emacs session. You can test if @@ -13015,8 +13017,18 @@ they worked by running the sexps below: 7.1. `ee-use-windows' - +If you are on Windows you should run this: + + (ee-use-windows) + +Its source code is here: + + (find-eev \"eev-on-windows.el\" \"ee-use-windows\") + +Most of what it does is explained in the next sections. + + - (find-eev \"eev-on-windows.el\") 7.2. Testing wget.exe @@ -13044,54 +13056,165 @@ with `M-x brep': (find-psne-intro \"3. The new way: `M-x brep'\") -Note that due to the +`M-x brep' uses `eepitch-shell', that on Windows runs cmd.exe by +default, but in the last section we ran `ee-use-windows', that +redefines `eepitch-shell' to makes it use Eshell instead of +cmd.exe - and it also makes the command \"wget\" in eshell run +~/bin/wget.exe. - (eepitch-shell2) +Eev also uses wget in the function `find-wget' and its variants +`find-wgeta', `find-wget-elisp', and `find-wgeta-elisp'. Try the +tests here, and check that they work: - (find-eev \"eev-on-windows.el\" \"ee-use-eshell\") + (find-eev \"eev-plinks.el\" \"find-wget\") + (find-eev \"eev-plinks.el\" \"find-wget\" \"Tests:\") - (find-eev \"eev-plinks.el\" \"find-wget\") - (find-eev \"eev-plinks.el\" \"find-wget\" \"Tests:\") +7.3. Lua + +`ee-use-windows' also redefine `eepitch-lua51' to make it run +~/bin/lua52.exe, that you downloaded in section 7, and it runs +`ee-use-youtube-videos', that you've run explicitly in section 6. +Try this link to a video: -7.3. Testing psne-ing -- + (find-eevtestblsvideo \"2:33\" \"if I run f8 here I start a new Lua interpreter\")
[elpa] externals/consult updated (57dc1ad -> f47a2cb)
elpasync pushed a change to branch externals/consult. from 57dc1ad Adjust consult--grep-match-regexp in order to support -[ABC] grep options (Fix #466) new bd0e74d consult-grep: Improve handling of context lines new f47a2cb Update changelog Summary of changes: CHANGELOG.org | 2 ++ consult.el| 21 - 2 files changed, 18 insertions(+), 5 deletions(-)
[elpa] externals/consult bd0e74d 1/2: consult-grep: Improve handling of context lines
branch: externals/consult commit bd0e74d026d721c5f8ed71e98ba54d4605002e1c Author: Daniel Mendler Commit: Daniel Mendler consult-grep: Improve handling of context lines * Add face consult-grep-context * Filter out empty context lines --- consult.el | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/consult.el b/consult.el index 3c94657..fd0bf7c 100644 --- a/consult.el +++ b/consult.el @@ -218,7 +218,7 @@ See `consult--multi' for a description of the source values." :type 'integer) (defconst consult--grep-match-regexp - "\\`\\(?:\\./\\)?\\([^\n\0]+\\)\0\\([0-9]+\\)[-:\0]" + "\\`\\(?:\\./\\)?\\([^\n\0]+\\)\0\\([0-9]+\\)\\([-:\0]\\)" "Regexp used to match file and line of grep output.") (defcustom consult-grep-args @@ -372,6 +372,10 @@ Used by `consult-completion-in-region', `consult-yank' and `consult-history'.") '((t :inherit font-lock-function-name-face)) "Face used to highlight files in `consult-buffer'.") +(defface consult-grep-context + '((t :inherit shadow)) + "Face used to highlight grep context in `consult-grep'.") + (defface consult-bookmark '((t :inherit font-lock-constant-face)) "Face used to highlight bookmarks in `consult-buffer'.") @@ -4084,19 +4088,26 @@ BUILDER is the command argument builder." (let (result) (save-match-data (dolist (str action) - (when (string-match consult--grep-match-regexp str) + (when (and (string-match consult--grep-match-regexp str) + ;; Filter out empty context lines + (or (/= (aref str (match-beginning 3)) ?-) + (/= (match-end 0) (length str (let* ((file (match-string 1 str)) (line (match-string 2 str)) + (ctx (= (aref str (match-beginning 3)) ?-)) (content (substring str (match-end 0))) - (file-len (length file))) + (file-len (length file)) + (line-len (length line))) (when (> (length content) consult-grep-max-columns) (setq content (substring content 0 consult-grep-max-columns))) (when highlight (funcall highlight content)) - (setq str (concat file ":" line ":" content)) + (setq str (concat file ":" line (if ctx "-" ":") content)) ;; Store file name in order to avoid allocations in `consult--grep-group' (add-text-properties 0 file-len `(face consult-file consult--grep-file ,file) str) - (put-text-property (1+ file-len) (+ 1 file-len (length line)) 'face 'consult-line-number str) + (put-text-property (1+ file-len) (+ 1 file-len line-len) 'face 'consult-line-number str) + (when ctx +(add-face-text-property (+ 1 file-len line-len) (length str) 'consult-grep-context 'append str)) (push str result) (funcall async (nreverse result (t (funcall async action))
[elpa] externals/consult f47a2cb 2/2: Update changelog
branch: externals/consult commit f47a2cb7d9e44e90e77ad0cfb374ddfaf88d162c Author: Daniel Mendler Commit: Daniel Mendler Update changelog --- CHANGELOG.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.org b/CHANGELOG.org index 9437dbe..3e91dff 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -8,6 +8,8 @@ - =consult-register=: Add support for file register values. - Rename =consult-isearch= to =consult-isearch-history=. The command is a history browsing command and not a replacement for Isearch. +- =consult-grep= support -[ABC] grep options +- Add =consult-grep-context= face * Version 0.12 (2021-10-11)