[elpa] externals/cape 0e14d8bcac 1/4: Rename internal function for consistency
branch: externals/cape commit 0e14d8bcac6ee324d1fc2164b5d501ce966e93b5 Author: Daniel Mendler Commit: Daniel Mendler Rename internal function for consistency --- cape-char.el| 2 +- cape-keyword.el | 2 +- cape.el | 32 +--- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/cape-char.el b/cape-char.el index ff82444955..7c0a292a3b 100644 --- a/cape-char.el +++ b/cape-char.el @@ -126,7 +126,7 @@ function acts like a Capf." method method) ((not ,pre-req) (cons (point) (point)) (append (list (car bounds) (cdr bounds) -(cape--table-with-properties ,hash :category ',capf)) +(cape--properties-table ,hash :category ',capf)) ,props))) ;;;###autoload (autoload 'cape-tex "cape-char" nil t) diff --git a/cape-keyword.el b/cape-keyword.el index 48a8015acc..775f652e48 100644 --- a/cape-keyword.el +++ b/cape-keyword.el @@ -407,7 +407,7 @@ If INTERACTIVE is nil the function acts like a capf." (when-let (keywords (cape--keyword-list)) (let ((bounds (cape--bounds 'symbol))) `(,(car bounds) ,(cdr bounds) - ,(cape--table-with-properties keywords :category 'cape-keyword) + ,(cape--properties-table keywords :category 'cape-keyword) ,@cape--keyword-properties) (provide 'cape-keyword) diff --git a/cape.el b/cape.el index fa4b43f53c..54a9ba4696 100644 --- a/cape.el +++ b/cape.el @@ -258,7 +258,7 @@ NAME is the name of the Capf, BEG and END are the input markers." (cape--debug-print result))) result))) -(cl-defun cape--table-with-properties (table &key category (sort t) &allow-other-keys) +(cl-defun cape--properties-table (table &key category (sort t) &allow-other-keys) "Create completion TABLE with properties. CATEGORY is the optional completion category. SORT should be nil to disable sorting." @@ -356,7 +356,7 @@ See also `consult-history' for a more flexible variant based on (setq history (ring-elements history))) (when history `(,bol ,(point) - ,(cape--table-with-properties history :sort nil) + ,(cape--properties-table history :sort nil) ,@cape--history-properties) ; cape-file @@ -466,7 +466,7 @@ If INTERACTIVE is nil the function acts like a Capf." (when (eq (char-after beg) ?') (setq beg (1+ beg) end (max beg end))) `(,beg ,end -,(cape--table-with-properties obarray :category 'symbol) +,(cape--properties-table obarray :category 'symbol) ,@cape--symbol-properties ; cape-elisp-block @@ -564,7 +564,7 @@ See the user options `cape-dabbrev-min-length' and (cape-interactive '((cape-dabbrev-min-length 0)) #'cape-dabbrev) (when-let ((bounds (cape--dabbrev-bounds))) `(,(car bounds) ,(cdr bounds) -,(cape--table-with-properties +,(cape--properties-table (completion-table-case-fold (cape--dynamic-table (car bounds) (cdr bounds) #'cape--dabbrev-list) (not (cape--case-fold-p dabbrev-case-fold-search))) @@ -613,7 +613,7 @@ INTERACTIVE is nil the function acts like a Capf." (cape-interactive #'cape-dict) (pcase-let ((`(,beg . ,end) (cape--bounds 'word))) `(,beg ,end -,(cape--table-with-properties +,(cape--properties-table (completion-table-case-fold (cape--dynamic-table beg end #'cape--dict-list) (not (cape--case-fold-p cape-dict-case-fold))) @@ -670,7 +670,7 @@ If INTERACTIVE is nil the function acts like a Capf." (when-let (abbrevs (cape--abbrev-list)) (let ((bounds (cape--bounds 'symbol))) `(,(car bounds) ,(cdr bounds) - ,(cape--table-with-properties abbrevs :category 'cape-abbrev) + ,(cape--properties-table abbrevs :category 'cape-abbrev) ,@cape--abbrev-properties) ; cape-line @@ -717,7 +717,7 @@ If INTERACTIVE is nil the function acts like a Capf." (if interactive (cape-interactive #'cape-line) `(,(pos-bol) ,(point) - ,(cape--table-with-properties (cape--line-list) :sort nil) + ,(cape--properties-table (cape--line-list) :sort nil) ,@cape--line-properties))) Capf combinators @@ -788,7 +788,7 @@ changed. The function `cape-company-to-capf' is experimental." (if (cape--company-call backend 'ignore-case) #'completion-table-case-fold #'identity) - (cape--table-with-properties + (cape--properties-table (cape--dynamic-table beg end (lambda (input) @@ -918,13 +918,15 @@ meaningful debugging output." (setq name (format "%s@%s" name (cl-incf cape--debug-id))) (pcase (funcall capf) (`(,beg ,end ,table . ,plist) - (let* (completion-ignore-case completion-regexp-list -
[elpa] externals/cape e0a05483cf 2/4: Add cape-capf-passthrough to disable completion style filtering
branch: externals/cape commit e0a05483cfd8f90189dfde0d7e1ffe0217e6317d Author: Daniel Mendler Commit: Daniel Mendler Add cape-capf-passthrough to disable completion style filtering This Capf transformer can be useful in rare scenarios like debugging or when the wrapped Capf wants to completely control filtering, without any interference from outer completion styles. For example `cape-capf-passthrough` can be useful in combination with `cape-company-to-capf`, such that filtering is completely left to the Company backend. A special case discussed recently with @dgutov involves `company-dabbrev` which nowadays uses completion styles itself for its internal filtering, where double filtering can be avoided via `cape-capf-passthrough`, see company-mode/company-mode/pull/1215. --- CHANGELOG.org | 2 ++ README.org| 3 ++- cape.el | 14 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 40de742171..86789d8f01 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -7,6 +7,8 @@ - =cape-emoji=: New Capf available on Emacs 29 and newer. - =cape-wrap-debug=, =cape-capf-debug=: New Capf transformers to add debug messages to a Capf. +- =cape-wrap-passthrough=, =cape-capf-passthrough=: New Capf transformers to defeat + completion style filtering. - =cape-capf-inside-faces=, =cape-wrap-inside-faces=: New transformer - Rename =cape-super-capf= to =cape-capf-super=. Add =cape-wrap-super= for consistency with other Capf combinators. diff --git a/README.org b/README.org index 4f60e4acaf..87dc824225 100644 --- a/README.org +++ b/README.org @@ -260,8 +260,9 @@ the Capf transformers with =defalias= to a function symbol. - ~cape-wrap-nonexclusive~, ~cape-capf-nonexclusive:~ Mark Capf as non-exclusive. - ~cape-wrap-noninterruptible~, ~cape-capf-noninterruptible:~ Protect a Capf which does not like to be interrupted. - ~cape-wrap-case-fold~, ~cape-capf-case-fold~: Create a Capf which is case insensitive. -- ~cape-wrap-properties~, ~cape-capf-properties~: Add completion properties to a Capf. +- ~cape-wrap-passthrough~, ~cape-capf-passthrough~: Defeat entire completion style filtering. - ~cape-wrap-predicate~, ~cape-capf-predicate~: Add candidate predicate to a Capf. +- ~cape-wrap-properties~, ~cape-capf-properties~: Add completion properties to a Capf. - ~cape-wrap-prefix-length~, ~cape-capf-prefix-length~: Enforce a minimal prefix length. - ~cape-wrap-super~, ~cape-capf-super~: Merge multiple Capfs into a Super-Capf. - ~cape-wrap-inside-comment~, ~cape-capf-inside-comment~: Ensure that Capf triggers only inside comment. diff --git a/cape.el b/cape.el index 54a9ba4696..8de943623a 100644 --- a/cape.el +++ b/cape.el @@ -187,6 +187,11 @@ BODY is the wrapping expression." (cape--wrapped-table cape--accept-all-table (or (eq action 'lambda +(defun cape--passthrough-table (table) + "Create completion TABLE disabling any filtering." + (cape--wrapped-table cape--passthrough-table +(let (completion-ignore-case completion-regexp-list (_ (setq str "")) + (defun cape--noninterruptible-table (table) "Create non-interruptible completion TABLE." (cape--wrapped-table cape--noninterruptible-table @@ -986,6 +991,13 @@ completion table is refreshed on every input change." (complete-with-action action table str pred))) ,@plist +;;;###autoload +(defun cape-wrap-passthrough (capf) + "Call CAPF and make sure that no completion style filtering takes place." + (pcase (funcall capf) +(`(,beg ,end ,table . ,plist) + `(,beg ,end ,(cape--passthrough-table table) ,@plist + ;;;###autoload (defun cape-wrap-properties (capf &rest properties) "Call CAPF and add additional completion PROPERTIES. @@ -1139,6 +1151,8 @@ This function can be used as an advice around an existing Capf." (cape--capf-wrapper noninterruptible) ;;;###autoload (autoload 'cape-capf-nonexclusive "cape") (cape--capf-wrapper nonexclusive) +;;;###autoload (autoload 'cape-capf-passthrough "cape") +(cape--capf-wrapper passthrough) ;;;###autoload (autoload 'cape-capf-predicate "cape") (cape--capf-wrapper predicate) ;;;###autoload (autoload 'cape-capf-prefix-length "cape")
[elpa] externals/cape 085287d793 3/4: Rename cape-interactive-capf to capf-capf-interactive
branch: externals/cape commit 085287d793ea2fd06b47ebcb6ab08e88533e5185 Author: Daniel Mendler Commit: Daniel Mendler Rename cape-interactive-capf to capf-capf-interactive --- CHANGELOG.org | 2 ++ README.org| 18 +- cape.el | 5 - 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 86789d8f01..d9bf74c326 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -12,6 +12,8 @@ - =cape-capf-inside-faces=, =cape-wrap-inside-faces=: New transformer - Rename =cape-super-capf= to =cape-capf-super=. Add =cape-wrap-super= for consistency with other Capf combinators. +- Rename =cape-interactive-capf= to =cape-capf-interactive= for consistency with + other Capf combinators. - Rename =cape-symbol= to =cape-elisp-symbol=. * Version 0.17 (2023-08-14) diff --git a/README.org b/README.org index 87dc824225..05e4b55b79 100644 --- a/README.org +++ b/README.org @@ -252,22 +252,22 @@ interaction. These can either be used as advices (=cape-wrap-*)= or to create a new Capf from an existing Capf (=cape-capf-*=). You can bind the Capfs created by the Capf transformers with =defalias= to a function symbol. -- ~cape-interactive-capf~, ~cape-interactive~: Create a Capf which can be called interactively. +- ~cape-capf-interactive~, ~cape-interactive~: Create a Capf which can be called interactively. - ~cape-wrap-accept-all~, ~cape-capf-accept-all~: Create a Capf which accepts every input as valid. +- ~cape-wrap-case-fold~, ~cape-capf-case-fold~: Create a Capf which is case insensitive. - ~cape-wrap-debug~, ~cape-capf-debug~: Create a Capf which prints debugging messages. -- ~cape-wrap-silent~, ~cape-capf-silent~: Wrap a chatty Capf and silence it. -- ~cape-wrap-purify~, ~cape-capf-purify~: Purify a broken Capf and ensure that it does not modify the buffer. +- ~cape-wrap-inside-comment~, ~cape-capf-inside-comment~: Ensure that Capf triggers only inside comment. +- ~cape-wrap-inside-faces~, ~cape-capf-inside-faces~: Ensure that Capf triggers only inside text with certain faces. +- ~cape-wrap-inside-string~, ~cape-capf-inside-string~: Ensure that Capf triggers only inside a string literal. - ~cape-wrap-nonexclusive~, ~cape-capf-nonexclusive:~ Mark Capf as non-exclusive. - ~cape-wrap-noninterruptible~, ~cape-capf-noninterruptible:~ Protect a Capf which does not like to be interrupted. -- ~cape-wrap-case-fold~, ~cape-capf-case-fold~: Create a Capf which is case insensitive. - ~cape-wrap-passthrough~, ~cape-capf-passthrough~: Defeat entire completion style filtering. - ~cape-wrap-predicate~, ~cape-capf-predicate~: Add candidate predicate to a Capf. -- ~cape-wrap-properties~, ~cape-capf-properties~: Add completion properties to a Capf. - ~cape-wrap-prefix-length~, ~cape-capf-prefix-length~: Enforce a minimal prefix length. +- ~cape-wrap-properties~, ~cape-capf-properties~: Add completion properties to a Capf. +- ~cape-wrap-purify~, ~cape-capf-purify~: Purify a broken Capf and ensure that it does not modify the buffer. +- ~cape-wrap-silent~, ~cape-capf-silent~: Wrap a chatty Capf and silence it. - ~cape-wrap-super~, ~cape-capf-super~: Merge multiple Capfs into a Super-Capf. -- ~cape-wrap-inside-comment~, ~cape-capf-inside-comment~: Ensure that Capf triggers only inside comment. -- ~cape-wrap-inside-faces~, ~cape-capf-inside-faces~: Ensure that Capf triggers only inside text with certain faces. -- ~cape-wrap-inside-string~, ~cape-capf-inside-string~: Ensure that Capf triggers only inside a string literal. In the following we show a few example configurations, which have come up on the [[https://github.com/minad/cape/issues][Cape]] or [[https://github.com/minad/corfu/issues][Corfu issue tracker]] or the [[https://github.com/minad/corfu/wiki][Corfu wiki.]] I use some of these tweaks in my @@ -303,7 +303,7 @@ personal configuration. ;; Example 6: Define interactive Capf which can be bound to a key. Here we wrap ;; the `elisp-completion-at-point' such that we can complete Elisp code ;; explicitly in arbitrary buffers. -(keymap-global-set "C-c p e" (cape-interactive-capf #'elisp-completion-at-point)) +(keymap-global-set "C-c p e" (cape-capf-interactive #'elisp-completion-at-point)) ;; Example 7: Ignore :keywords in Elisp completion. (defun ignore-elisp-keywords (sym) diff --git a/cape.el b/cape.el index 8de943623a..a41450bc50 100644 --- a/cape.el +++ b/cape.el @@ -837,7 +837,7 @@ changed. The function `cape-company-to-capf' is experimental." capfs ", ") ;;;###autoload -(defun cape-interactive-capf (capf) +(defun cape-capf-interactive (capf) "Create interactive completion function from CAPF." (lambda (&optional interactive) (interactive (list t)) @@ -1164,6 +1164,9 @@ This function can be used as an advice around an existing Capf." ;;;###autoload (autoload 'cape-capf-silent "cape") (cape--capf-wrapper silent) +;;;###autoload +(define-obsolete-functio
[elpa] externals/cape updated (bee13e568d -> abacb23115)
elpasync pushed a change to branch externals/cape. from bee13e568d Add cape-capf-inside-faces (Fix #96) new 0e14d8bcac Rename internal function for consistency new e0a05483cf Add cape-capf-passthrough to disable completion style filtering new 085287d793 Rename cape-interactive-capf to capf-capf-interactive new abacb23115 README: Sort transformers Summary of changes: CHANGELOG.org | 4 README.org | 33 + cape-char.el| 2 +- cape-keyword.el | 2 +- cape.el | 51 +++ 5 files changed, 58 insertions(+), 34 deletions(-)
[elpa] externals/cape abacb23115 4/4: README: Sort transformers
branch: externals/cape commit abacb231157e0c90e29bdda6d15b4b448e48ffbd Author: Daniel Mendler Commit: Daniel Mendler README: Sort transformers --- README.org | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.org b/README.org index 05e4b55b79..aa9bc07605 100644 --- a/README.org +++ b/README.org @@ -252,22 +252,22 @@ interaction. These can either be used as advices (=cape-wrap-*)= or to create a new Capf from an existing Capf (=cape-capf-*=). You can bind the Capfs created by the Capf transformers with =defalias= to a function symbol. +- ~cape-capf-accept-all~, ~cape-wrap-accept-all~: Create a Capf which accepts every input as valid. +- ~cape-capf-case-fold~, ~cape-wrap-case-fold~: Create a Capf which is case insensitive. +- ~cape-capf-debug~, ~cape-wrap-debug~: Create a Capf which prints debugging messages. +- ~cape-capf-inside-comment~, ~cape-wrap-inside-comment~: Ensure that Capf triggers only inside comment. +- ~cape-capf-inside-faces~, ~cape-wrap-inside-faces~: Ensure that Capf triggers only inside text with certain faces. +- ~cape-capf-inside-string~, ~cape-wrap-inside-string~: Ensure that Capf triggers only inside a string literal. - ~cape-capf-interactive~, ~cape-interactive~: Create a Capf which can be called interactively. -- ~cape-wrap-accept-all~, ~cape-capf-accept-all~: Create a Capf which accepts every input as valid. -- ~cape-wrap-case-fold~, ~cape-capf-case-fold~: Create a Capf which is case insensitive. -- ~cape-wrap-debug~, ~cape-capf-debug~: Create a Capf which prints debugging messages. -- ~cape-wrap-inside-comment~, ~cape-capf-inside-comment~: Ensure that Capf triggers only inside comment. -- ~cape-wrap-inside-faces~, ~cape-capf-inside-faces~: Ensure that Capf triggers only inside text with certain faces. -- ~cape-wrap-inside-string~, ~cape-capf-inside-string~: Ensure that Capf triggers only inside a string literal. -- ~cape-wrap-nonexclusive~, ~cape-capf-nonexclusive:~ Mark Capf as non-exclusive. -- ~cape-wrap-noninterruptible~, ~cape-capf-noninterruptible:~ Protect a Capf which does not like to be interrupted. -- ~cape-wrap-passthrough~, ~cape-capf-passthrough~: Defeat entire completion style filtering. -- ~cape-wrap-predicate~, ~cape-capf-predicate~: Add candidate predicate to a Capf. -- ~cape-wrap-prefix-length~, ~cape-capf-prefix-length~: Enforce a minimal prefix length. -- ~cape-wrap-properties~, ~cape-capf-properties~: Add completion properties to a Capf. -- ~cape-wrap-purify~, ~cape-capf-purify~: Purify a broken Capf and ensure that it does not modify the buffer. -- ~cape-wrap-silent~, ~cape-capf-silent~: Wrap a chatty Capf and silence it. -- ~cape-wrap-super~, ~cape-capf-super~: Merge multiple Capfs into a Super-Capf. +- ~cape-capf-nonexclusive~, ~cape-wrap-nonexclusive~: Mark Capf as non-exclusive. +- ~cape-capf-noninterruptible~, ~cape-wrap-noninterruptible~: Protect a Capf which does not like to be interrupted. +- ~cape-capf-passthrough~, ~cape-wrap-passthrough~: Defeat entire completion style filtering. +- ~cape-capf-predicate~, ~cape-wrap-predicate~: Add candidate predicate to a Capf. +- ~cape-capf-prefix-length~, ~cape-wrap-prefix-length~: Enforce a minimal prefix length. +- ~cape-capf-properties~, ~cape-wrap-properties~: Add completion properties to a Capf. +- ~cape-capf-purify~, ~cape-wrap-purify~: Purify a broken Capf and ensure that it does not modify the buffer. +- ~cape-capf-silent~, ~cape-wrap-silent~: Wrap a chatty Capf and silence it. +- ~cape-capf-super~, ~cape-wrap-super~: Merge multiple Capfs into a Super-Capf. In the following we show a few example configurations, which have come up on the [[https://github.com/minad/cape/issues][Cape]] or [[https://github.com/minad/corfu/issues][Corfu issue tracker]] or the [[https://github.com/minad/corfu/wiki][Corfu wiki.]] I use some of these tweaks in my
[elpa] externals/ement 8e6e9cd38d: Change/Fix: Clicking/jumping-to notifications
branch: externals/ement commit 8e6e9cd38de9093237435ad77583bc3b4fd0ea7e Author: Adam Porter Commit: Adam Porter Change/Fix: Clicking/jumping-to notifications --- ement-notifications.el | 45 - 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/ement-notifications.el b/ement-notifications.el index b1ba8fc059..0db5115009 100644 --- a/ement-notifications.el +++ b/ement-notifications.el @@ -62,15 +62,35 @@ is passed through `ement--make-event'." (declare-function ement-room-list "ement-room-list") (defvar ement-notifications-mode-map (let ((map (make-sparse-keymap))) +(define-key map (kbd "") #'ement-notifications-jump) +(define-key map [mouse-1] #'ement-notifications-jump-mouse) +(define-key map [mouse-2] #'ement-notifications-jump-mouse) (define-key map (kbd "S-") #'ement-notify-reply) (define-key map (kbd "M-g M-l") #'ement-room-list) (define-key map (kbd "M-g M-m") #'ement-notify-switch-to-mentions-buffer) (define-key map (kbd "M-g M-n") #'ement-notify-switch-to-notifications-buffer) (define-key map [remap scroll-down-command] #'ement-notifications-scroll-down-command) (define-key map [remap mwheel-scroll] #'ement-notifications-mwheel-scroll) -(make-composed-keymap (list map button-buffer-map) 'view-mode-map)) +(make-composed-keymap (list map) 'view-mode-map)) "Map for Ement notification buffers.") +(cl-defun ement-notifications-jump (&optional (pos (point))) + "Jump to Matrix event at POS." + (interactive) + (let ((session (get-text-property pos 'session)) +(room (get-text-property pos 'room)) +(event (get-text-property pos 'event))) +(ement-view-room room session) +(ement-room-goto-event event))) + +(defun ement-notifications-jump-mouse (event) + "Jump to Matrix event at EVENT." + (interactive "e") + (let ((pos (posn-point (event-start event +(if (button-at pos) +(push-button pos) + (ement-notifications-jump pos + (defvar ement-notifications-hook '(ement-notifications-log-to-buffer) "Functions called for `ement-notifications' notifications. Each function is called with two arguments, the session and the @@ -197,17 +217,24 @@ to `ement-api', which see." (inhibit-read-only t) (start) (end)) (ewoc-goto-node ement-ewoc new-node) -(setf start (point)) -(if-let (next-node (ewoc-next ement-ewoc new-node)) -(ewoc-goto-node ement-ewoc next-node) - (goto-char (point-max))) -(setf end (- (point) 2)) +;; Apply the button properties only to the room and sender names, +;; allowing buttons in the rest of the message to remain separate. +(setf start (point) + end (save-excursion +(re-search-forward (rx "> " +(add-text-properties start end '( button (t) + category default-button + action ement-notify-button-action)) +;; Apply the session, room, and event properties to the whole event. +(setf end (save-excursion +(if-let ((next-node (ewoc-next ement-ewoc new-node))) +(ewoc-location next-node) + (point-max (add-text-properties start end - (list 'action #'ement-notify-button-action - 'session session + (list 'session session 'room ement-room 'event event)) -;; Remove button face property. +;; Remove button face property from the whole event. (alter-text-property start end 'face (lambda (face) (pcase face
[elpa] externals/osm a8ebce9efc: README: Update configuration
branch: externals/osm commit a8ebce9efcd1d1c5a4f191cb3dbcf4a58b2f0fa0 Author: Daniel Mendler Commit: Daniel Mendler README: Update configuration --- README.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 87cec7ab05..a5b05bf538 100644 --- a/README.org +++ b/README.org @@ -55,13 +55,13 @@ Please take a look at the [[https://github.com/minad/osm/wiki][wiki]] for additi (osm-copyright t) ;; Display the copyright information :init - ;; Load Org link support + ;; Make sure that Org geo: link support is loaded (with-eval-after-load 'org (require 'osm-ol)) :config - ;; Add custom servers + ;; Add custom servers, see also https://github.com/minad/osm/wiki ;; (osm-add-server 'myserver ;; :name "My tile server" ;; :group "Custom"
[elpa] externals/debbugs 6403868b85: Minor debbugs update
branch: externals/debbugs commit 6403868b85444de9832904f7e941e456b49dc857 Author: Michael Albinus Commit: Michael Albinus Minor debbugs update * debbugs-gnu.el (debbugs-gnu-mode): Fix docstring. (Bug#66797) (debbugs-gnu-display-status): Adapt regexp for help echo. --- debbugs-gnu.el | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/debbugs-gnu.el b/debbugs-gnu.el index 39f7fe1eba..4692bf98b6 100644 --- a/debbugs-gnu.el +++ b/debbugs-gnu.el @@ -1221,6 +1221,9 @@ Interactively, it is non-nil with the prefix argument." (define-derived-mode debbugs-gnu-mode tabulated-list-mode "Debbugs" "Major mode for listing bug reports. +The bugs are taken from the cache when the list is refreshed. +In order to retrieve the actual bug status after it has been +modified on the debbugs server, consider typing \\`C-u g'. \\{debbugs-gnu-mode-map}" (set (make-local-variable 'debbugs-gnu-sort-state) 'number) @@ -1581,12 +1584,12 @@ interesting to you." (insert ";; Status\n") (pp status (current-buffer))) (goto-char (point-min)) -(while -(re-search-forward - (rx "(" - (| "cache_time" "last_modified" "fixed_date" "date" "log_modified") - " . " (group (1+ (any "." digit))) ")") - nil t) +(while (re-search-forward +(rx "(" +(| "cache_time" "date" "fixed_date" "found_date" + "last_modified" "log_modified" "unarchived") +" . " (group (1+ digit) (? "." (1+ digit))) ")") +nil t) (put-text-property (match-beginning 1) (match-end 1) 'help-echo (current-time-string (read (match-string 1)
[elpa] externals/hyperbole 69b4a495b9: Define and use new java-defun-prompt-regexp (#398)
branch: externals/hyperbole commit 69b4a495b9512e0c9936adf4efd6e3b1243e3c16 Author: Mats Lidell Commit: GitHub Define and use new java-defun-prompt-regexp (#398) Update provided by Alan Mackenzie. See Emacs bug#61436 --- ChangeLog | 4 hui-select.el | 35 --- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60790f4bdd..bc303aec67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2023-10-22 Mats Lidell +* hui-select.el (hui-java-defun-prompt-regexp): Add prompt regexp as +separate defconst. Update provided by Alan Mackenzie. Thanks. +(hui-select-initialize): Use new java regexp. + * test/hui-tests.el (hui-gbut-number-of-gebuts-from-mail-mode): Remove expected to fail. diff --git a/hui-select.el b/hui-select.el index 902b04c8bf..35d0b218d9 100644 --- a/hui-select.el +++ b/hui-select.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date:19-Oct-96 at 02:25:27 -;; Last-Mod: 3-Oct-23 at 22:59:57 by Mats Lidell +;; Last-Mod: 22-Oct-23 at 17:26:49 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -203,6 +203,36 @@ Used to include a final line when marking indented code.") :type 'boolean :group 'hyperbole-commands) +(defconst hui-java-defun-prompt-regexp + (let* ((space* "[ \t\n\r\f]*") + (space+ "[ \t\n\r\f]+") + (modifier* + (concat "\\(?:" + (regexp-opt '("abstract" "const" "default" "final" "native" +"private" "protected" "public" "static" +"strictfp" "synchronized" "threadsafe" +"transient" "volatile") + 'words) ; Compatible with XEmacs + space+ "\\)*")) + (ids-with-dots "[_$a-zA-Z][_$.a-zA-Z0-9]*") + (ids-with-dot-\[\] "[[_$a-zA-Z][][_$.a-zA-Z0-9]*") + (paren-exp "([^);{}]*)") + (generic-exp "<[^(){};]*>")) +(concat "^[ \t]*" +modifier* +"\\(?:" generic-exp space* "\\)?" +ids-with-dot-\[\] space+; first part of type +"\\(?:" ids-with-dot-\[\] space+ "\\)?" ; optional second part of type. +"\\(?:[_a-zA-Z][^][ \t:;.,{}()=<>]*"; defun name +"\\|" ids-with-dots +"\\)" space* +paren-exp +"\\(?:" space* "]\\)*" ; What's this for? +"\\(?:" space* "\\" space* ids-with-dot-\[\] + "\\(?:," space* ids-with-dot-\[\] "\\)*" +"\\)?" +space*))) + (defvar hui-select-previous nil) (defvar hui-select-prior-point nil) (defvar hui-select-prior-buffer nil) @@ -362,8 +392,7 @@ Also, add language-specific syntax setups to aid in thing selection." ;; opening or closing brace. This is all necessary since some ;; programmers don't put their function braces in the first column. (var:add-and-run-hook 'java-mode-hook (lambda () - (setq defun-prompt-regexp - "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*"))) + (setq defun-prompt-regexp hui-java-defun-prompt-regexp))) (var:add-and-run-hook 'c++-mode-hook (lambda () (setq defun-prompt-regexp "^[ \t]*\\(template\\s-*<[^>;.{}]+>\\s-*\\)?\\(\\(\\(auto\\|const\\|explicit\\|extern\\s-+\"[^\"]+\"\\|extern\\|friend\\|inline\\|mutable\\|overload\\|register\\|static\\|typedef\\|virtual\\)\\s-+\\)*\\(\\([[a-zA-Z0-9 ,]+>\\s-*[*&]*\\|[[a-zA-Z0-9]*\\(::[[a-zA-Z0-9]+\\)?\\s-*[*&]*\\)[*& \t\n\r]+\\)\\)?\\(\\(::\\|[[;{}]+>\\s-*[*&]*::\\|[[a-zA-Z0-9]*\\s-* [...]
[elpa] externals/urgrep 2c042198d1: Factor out common `urgrep--interpolate-arguments`
branch: externals/urgrep commit 2c042198d1b23dcc4c3974e89e2e1b88e63b0d28 Author: Jim Porter Commit: Jim Porter Factor out common `urgrep--interpolate-arguments` --- urgrep.el | 87 ++- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/urgrep.el b/urgrep.el index aaca38a92b..17cadbf715 100644 --- a/urgrep.el +++ b/urgrep.el @@ -212,6 +212,22 @@ one for each `:abbreviate' key found." (when tree (push (urgrep--maybe-shell-quote-argument tree) elems)) (string-join (nreverse elems) " "))) +(defun urgrep--interpolate-arguments (query tool props) + "Interpolate search arguments for QUERY using TOOL. +PROPS is an alist of extra properties corresponding to the +properties defined in the `urgrep-tools' entry for TOOL." + (let* ((arguments (urgrep--get-prop 'arguments tool)) + (abbrev (urgrep--get-prop 'abbreviations tool)) + (props `((executable . ,(urgrep--get-prop 'executable-name tool)) + (query . ,query) + ,@(mapcar (pcase-lambda (`(,k . ,v)) + (cons k (urgrep--get-prop-pcase + k tool v "-arguments"))) +props +(urgrep--flatten-arguments (cl-sublis props arguments) + abbrev))) + + (rx-define urgrep-regular-number (seq (any "1-9") (* digit))) @@ -272,34 +288,23 @@ CONTEXT, and COLOR are as in `urgrep-command'." "Get the command to run for QUERY when using git grep. Optional keys TOOL, REGEXP, CASE-FOLD, HIDDEN, FILES, DIRECTORY, CONTEXT, and COLOR are as in `urgrep-command'." - ;; XXX: This is very similar to the implementation in `urgrep-command', except - ;; that we do some extra work to generate pathspecs. Can we factor out some - ;; of this? - (let* ((arguments (urgrep--get-prop 'arguments tool)) - (abbrev (urgrep--get-prop 'abbreviations tool)) - (pathspecs - (if (and files directory) - (mapcan - (lambda (file) - (mapcar (lambda (dir) - (concat ":(glob)" (file-name-concat dir "**" file))) - directory)) - files) -(or files directory))) - (props `((executable . ,(urgrep--get-prop 'executable-name tool)) - (query . ,query) - ,@(mapcar (pcase-lambda (`(,k . ,v)) - (cons k (urgrep--get-prop-pcase - k tool v "-arguments"))) -`((regexp . ,regexp) - (case-fold . ,case-fold) - (hidden-file. ,hidden) - (pathspec . ,pathspecs) - (group . ,group) - (context. ,context) - (color . ,color)) -(urgrep--flatten-arguments (cl-sublis props arguments) - abbrev))) + (let ((pathspecs + (if (and files directory) + (mapcan + (lambda (file) +(mapcar (lambda (dir) + (concat ":(glob)" (file-name-concat dir "**" file))) +directory)) + files) + (or files directory +(urgrep--interpolate-arguments query tool + `((regexp . ,regexp) + (case-fold . ,case-fold) + (hidden-file . ,hidden) + (pathspec. ,pathspecs) + (group . ,group) + (context . ,context) + (color . ,color) (defun urgrep--rgrep-process-setup () "Set up environment variables for rgrep. @@ -641,23 +646,15 @@ COLOR: non-nil (the default) if the output should use color." :case-fold case-fold :hidden hidden :files files :directory directory :group group :context context :color color) - (let ((arguments (urgrep--get-prop 'arguments tool)) - (abbrev (urgrep--get-prop 'abbreviations tool)) - (props `((executable . ,(urgrep--get-prop 'executable-name tool)) - (query . ,query) - ,@(mapcar (pcase-lambda (`(,k . ,v)) - (cons k (urgrep--get-prop-pcase - k tool v "-arguments"))) -`((regexp . ,tool-re-syntax) - (case-fold . ,case-fold) - (hidden-file. ,hidden) - (file-wildcards . ,files) -
[nongnu] elpa/git-commit 1e55cd77da 1/2: magit-log--maybe-drop-color-graph: New function
branch: elpa/git-commit commit 1e55cd77da785533d3ed9a7ffbc0dca26441c8f0 Author: Jonas Bernoulli Commit: Jonas Bernoulli magit-log--maybe-drop-color-graph: New function --- lisp/magit-log.el | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lisp/magit-log.el b/lisp/magit-log.el index 106f0fb108..2147ab1223 100644 --- a/lisp/magit-log.el +++ b/lisp/magit-log.el @@ -1073,8 +1073,6 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (magit-section-update-highlight)) (current-buffer))) -(defvar-local magit-log--color-graph nil) - (defun magit-log-refresh-buffer () (let ((revs magit-buffer-revisions) (args magit-buffer-log-args) @@ -1089,20 +1087,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (concat "^" (regexp-opt magit-log-remove-graph-args)) it) args)) (setq args (remove "--graph" args))) -(if (member "--color" args) -(if (cond - ((not (member "--graph" args))) - ((not magit-log-color-graph-limit) nil) - ((not limit) - (message "Dropping --color because -n isn't set (see %s)" - 'magit-log-color-graph-limit)) - ((> limit magit-log-color-graph-limit) - (message "Dropping --color because -n is larger than %s" - 'magit-log-color-graph-limit))) -(progn (setq args (remove "--color" args)) - (setq magit-log--color-graph nil)) - (setq magit-log--color-graph t)) - (setq magit-log--color-graph nil)) +(setq args (magit-log--maybe-drop-color-graph args limit)) (when-let* ((limit limit) (limit (* 2 limit)) ; increase odds for complete graph (count (and (length= revs 1) @@ -1128,6 +1113,24 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (magit-insert-section (logbuf) (magit--insert-log t revs args files +(defvar-local magit-log--color-graph nil) + +(defun magit-log--maybe-drop-color-graph (args limit) + (if (member "--color" args) + (if (cond ((not (member "--graph" args))) +((not magit-log-color-graph-limit) nil) +((not limit) + (message "Dropping --color because -n isn't set (see %s)" + 'magit-log-color-graph-limit)) +((> limit magit-log-color-graph-limit) + (message "Dropping --color because -n is larger than %s" + 'magit-log-color-graph-limit))) + (progn (setq args (remove "--color" args)) + (setq magit-log--color-graph nil)) +(setq magit-log--color-graph t)) +(setq magit-log--color-graph nil)) + args) + (cl-defmethod magit-buffer-value (&context (major-mode magit-log-mode)) (append magit-buffer-revisions (if (and magit-buffer-revisions magit-buffer-log-files)
[nongnu] elpa/git-commit 631a1f9b9e 2/2: magit-log-select-refresh-buffer: Deal with --color argument
branch: elpa/git-commit commit 631a1f9b9ed3e2ff311ce2bcd9b987c1a3ccee0b Author: Jonas Bernoulli Commit: Jonas Bernoulli magit-log-select-refresh-buffer: Deal with --color argument Closes #5037 --- lisp/magit-log.el | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/magit-log.el b/lisp/magit-log.el index 2147ab1223..c408acb192 100644 --- a/lisp/magit-log.el +++ b/lisp/magit-log.el @@ -1689,7 +1689,10 @@ Type \\[magit-log-select-quit] to abort without selecting a commit." (setq magit-section-inhibit-markers t) (setq magit-section-insert-in-reverse t) (magit-insert-section (logbuf) -(magit--insert-log t magit-buffer-revisions magit-buffer-log-args))) +(magit--insert-log t magit-buffer-revisions + (magit-log--maybe-drop-color-graph + magit-buffer-log-args + (magit-log-get-commit-limit) (cl-defmethod magit-buffer-value (&context (major-mode magit-log-select-mode)) magit-buffer-revisions)
[nongnu] elpa/git-commit updated (598219a338 -> 631a1f9b9e)
elpasync pushed a change to branch elpa/git-commit. from 598219a338 magit-margin-overlay-conditions: Add certain Forge sections new 1e55cd77da magit-log--maybe-drop-color-graph: New function new 631a1f9b9e magit-log-select-refresh-buffer: Deal with --color argument Summary of changes: lisp/magit-log.el | 40 +++- 1 file changed, 23 insertions(+), 17 deletions(-)
[nongnu] elpa/magit updated (598219a338 -> 631a1f9b9e)
elpasync pushed a change to branch elpa/magit. from 598219a338 magit-margin-overlay-conditions: Add certain Forge sections adds 1e55cd77da magit-log--maybe-drop-color-graph: New function adds 631a1f9b9e magit-log-select-refresh-buffer: Deal with --color argument No new revisions were added by this update. Summary of changes: lisp/magit-log.el | 40 +++- 1 file changed, 23 insertions(+), 17 deletions(-)
[nongnu] elpa/magit-section updated (598219a338 -> 631a1f9b9e)
elpasync pushed a change to branch elpa/magit-section. from 598219a338 magit-margin-overlay-conditions: Add certain Forge sections adds 1e55cd77da magit-log--maybe-drop-color-graph: New function adds 631a1f9b9e magit-log-select-refresh-buffer: Deal with --color argument No new revisions were added by this update. Summary of changes: lisp/magit-log.el | 40 +++- 1 file changed, 23 insertions(+), 17 deletions(-)
[nongnu] elpa/sweeprolog 3521dc3e7b 1/2: Avoid possible race condition with tty top-level creation
branch: elpa/sweeprolog commit 3521dc3e7bd4098e472974f93ac292c63005eeb3 Author: Eshel Yaron Commit: Eshel Yaron Avoid possible race condition with tty top-level creation * sweeprolog.el (sweeprolog-top-level-buffer): Create the top-level thread before calling stty. --- sweeprolog.el | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sweeprolog.el b/sweeprolog.el index 0f56047d02..adbfe70159 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -3433,11 +3433,12 @@ top-level." (make-comint-in-buffer "sweeprolog-top-level" buf nil) (let* ((proc (get-buffer-process buf)) (tty (process-tty-name proc))) + (process-send-eof proc) + (sweeprolog--query-once "sweep" "sweep_top_level_start_pty" tty) + (unless comint-last-prompt buf (accept-process-output proc 1)) (when (eq system-type 'gnu/linux) ;; make sure the pty does not echo input -(call-process "stty" nil nil nil "-F" tty "-echo")) - (process-send-eof proc) - (sweeprolog--query-once "sweep" "sweep_top_level_start_pty" tty))) +(call-process "stty" nil nil nil "-F" tty "-echo" (unless sweeprolog-prolog-server-port (sweeprolog-start-prolog-server)) (make-comint-in-buffer "sweeprolog-top-level"
[nongnu] elpa/sweeprolog updated (4d1bb198d8 -> d89118a4f3)
elpasync pushed a change to branch elpa/sweeprolog. from 4d1bb198d8 Setup Xref in 'sweeprolog-top-level-mode' new 3521dc3e7b Avoid possible race condition with tty top-level creation new d89118a4f3 Announce recent changes in NEWS.org and bump version to 0.26.1 Summary of changes: NEWS.org | 17 + sweep.texi| 4 ++-- sweeprolog.el | 9 + 3 files changed, 24 insertions(+), 6 deletions(-)
[nongnu] elpa/sweeprolog d89118a4f3 2/2: Announce recent changes in NEWS.org and bump version to 0.26.1
branch: elpa/sweeprolog commit d89118a4f3c0e2df191524ab8b9da73b1069f64b Author: Eshel Yaron Commit: Eshel Yaron Announce recent changes in NEWS.org and bump version to 0.26.1 --- NEWS.org | 17 + sweep.texi| 4 ++-- sweeprolog.el | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/NEWS.org b/NEWS.org index 9c5bf08936..e5a5f6e6dc 100644 --- a/NEWS.org +++ b/NEWS.org @@ -11,6 +11,23 @@ SWI-Prolog in Emacs. For further details, please consult the manual: [[https://eshelyaron.com/sweep.html][https://eshelyaron.com/sweep.html]]. +* Version 0.26.1 on 2023-10-29 + +** Fix issue with top-level not starting correctly on GNU/Linux + +This is a bugfix release, addressing an issue introduced in Sweep +version 0.26.0 that could cause starting the Sweep top-level to fail +on GNU/Linux systems, with the following message: + +#+begin_quote +Process sweeprolog-top-level failed with code 0 +#+end_quote + +** Sweep now sets up Xref in top-level buffers + +Xref commands, such as ~M-.~ and ~M-?~, now use Sweep's +cross-reference backend also in top-level buffers. + * Version 0.26.0 on 2023-10-22 ** More fine-grained in-buffer completions diff --git a/sweep.texi b/sweep.texi index 711e903b54..6f617292e9 100644 --- a/sweep.texi +++ b/sweep.texi @@ -11,7 +11,7 @@ @c %**end of header @copying -This manual is for Sweep (version 0.26.0), an Emacs package providing +This manual is for Sweep (version 0.26.1), an Emacs package providing an embedded SWI-Prolog runtime inside of Emacs along with an advanced SWI-Prolog development environment. @@ -42,7 +42,7 @@ Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @node Top @top Sweep: SWI-Prolog Embedded in Emacs -This manual is for Sweep (version 0.26.0), an Emacs package providing +This manual is for Sweep (version 0.26.1), an Emacs package providing an embedded SWI-Prolog runtime inside of Emacs along with an advanced SWI-Prolog development environment. diff --git a/sweeprolog.el b/sweeprolog.el index adbfe70159..3387a0fdd5 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -6,7 +6,7 @@ ;; Maintainer: Eshel Yaron <~eshel/d...@lists.sr.ht> ;; Keywords: prolog languages extensions ;; URL: https://git.sr.ht/~eshel/sweep -;; Package-Version: 0.26.0 +;; Package-Version: 0.26.1 ;; Package-Requires: ((emacs "27.1") (compat "29.1.4.2")) ;; This file is NOT part of GNU Emacs.
[nongnu] elpa/xah-fly-keys 4365f77e40: xah-delete-current-file-make-backup better code.
branch: elpa/xah-fly-keys commit 4365f77e402065e12aa7a16a31dce4b06aad0e0c Author: Xah Lee Commit: Xah Lee xah-delete-current-file-make-backup better code. --- xah-fly-keys.el | 65 ++--- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/xah-fly-keys.el b/xah-fly-keys.el index d6c8d7d839..2825fc736d 100644 --- a/xah-fly-keys.el +++ b/xah-fly-keys.el @@ -4,7 +4,7 @@ ;; Author: Xah Lee ( http://xahlee.info/ ) ;; Maintainer: Xah Lee -;; Version: 24.13.20231025112537 +;; Version: 24.13.20231029144236 ;; Created: 2013-09-10 ;; Package-Requires: ((emacs "29")) ;; Keywords: convenience, emulations, vim, ergoemacs @@ -2345,7 +2345,9 @@ Version: 2023-03-21") • If the buffer is not a file, first save it to `xah-temp-dir-path' named untitled_‹datetime›_‹randomhex›.txt. If `universal-argument' is called first, call `kill-buffer'. -(this is useful when a file is changed by some other app, and auto refresh is on, and emacs goes into a loop asking to save.) +(this is useful when a file is modified, and then it is is changed +by some app outside emacs, and `auto-revert-mode' is on, then, emacs +goes into a loop asking to revert or save.) If the buffer is a file, add the path to the list `xah-recently-closed-buffers'. @@ -2723,36 +2725,37 @@ Backup filename is “‹name›~‹dateTimeStamp›~”. Existing file of the s Call `xah-open-last-closed' to open the backup file. URL `http://xahlee.info/emacs/emacs/elisp_delete-current-file.html' -Version: 2018-05-15 2023-06-05 2023-08-07 2023-08-11" - (interactive) - (if (eq major-mode 'dired-mode) - (message "In dired. Nothing is done.") -(let ((xfname buffer-file-name) - (xbuffname (buffer-name)) - xbackupPath) - (setq xbackupPath -(concat (if xfname xfname (format "%sxx" default-directory)) -(format "~%s~" (format-time-string "%Y-%m-%d_%H%M%S" - (if xfname - (progn -(save-buffer xfname) -(rename-file xfname xbackupPath t) -(kill-buffer xbuffname) -;; (dired-jump nil xbackupPath) -;; (revert-buffer t t t) -;; (dired-goto-file xbackupPath) -;; (dired-next-line 1) -(when (boundp 'xah-recently-closed-buffers) - (push (cons nil xbackupPath) xah-recently-closed-buffers) - (message "Deleted.\nBackup at \n%s\nCall `xah-open-last-closed' to open." xbackupPath))) +Version: 2018-05-15 2023-08-11 2023-10-28" + (interactive) + (when (eq major-mode 'dired-mode) +(user-error "%s: In dired. Nothing is done." real-this-command)) + (let ((xfname buffer-file-name) +(xbuffname (buffer-name)) +xbackupPath) +(setq xbackupPath + (concat (if xfname xfname (format "%sxx" default-directory)) + (format "~%s~" (format-time-string "%Y-%m-%d_%H%M%S" +(if xfname (progn - (widen) - (kill-new (buffer-string)) - (kill-buffer xbuffname)) -;; (when (eq major-mode 'dired-mode) (revert-buffer)) -)) -(when (eq major-mode 'dired-mode) - (revert-buffer + (save-buffer xfname) + (rename-file xfname xbackupPath t) + (kill-buffer xbuffname) + ;; (dired-jump nil xbackupPath) + ;; (revert-buffer t t t) + ;; (dired-goto-file xbackupPath) + ;; (dired-next-line 1) + (message "File deleted. +Backup at +%s +Call `xah-open-last-closed' to open." xbackupPath) + (when (boundp 'xah-recently-closed-buffers) +(push (cons nil xbackupPath) xah-recently-closed-buffers))) + (progn +(widen) +(kill-new (buffer-string)) +(kill-buffer xbuffname) +(message "non-file buffer killed. buffer text copied to `kill-ring'." + (when (eq major-mode 'dired-mode) (revert-buffer)))
[nongnu] elpa/xah-fly-keys 9be198feb1: xah-quote-lines removed begin end param, so that repeat-complex-command works.
branch: elpa/xah-fly-keys commit 9be198feb10f1d4e2d1287255b9a98c0ab090a38 Author: Xah Lee Commit: Xah Lee xah-quote-lines removed begin end param, so that repeat-complex-command works. --- xah-fly-keys.el | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/xah-fly-keys.el b/xah-fly-keys.el index 2825fc736d..4e11bce2c0 100644 --- a/xah-fly-keys.el +++ b/xah-fly-keys.el @@ -4,7 +4,7 @@ ;; Author: Xah Lee ( http://xahlee.info/ ) ;; Maintainer: Xah Lee -;; Version: 24.13.20231029144236 +;; Version: 24.14.20231029171846 ;; Created: 2013-09-10 ;; Package-Requires: ((emacs "29")) ;; Keywords: convenience, emulations, vim, ergoemacs @@ -1466,7 +1466,7 @@ Version: 2016-10-25 2023-07-10" (comment-or-uncomment-region xbegin xend) (forward-line ))) -(defun xah-quote-lines (Begin End QuoteL QuoteR Sep) +(defun xah-quote-lines (QuoteL QuoteR Sep) "Add quotes/brackets and separator (comma) to lines. Act on current block or selection. @@ -1491,7 +1491,7 @@ or In lisp code, QuoteL QuoteR Sep are strings. URL `http://xahlee.info/emacs/emacs/emacs_quote_lines.html' -Version: 2020-06-26 2023-08-05 2023-08-25 2023-09-19" +Version: 2020-06-26 2023-09-19 2023-10-29" (interactive (let ((xbrackets '( @@ -1514,14 +1514,10 @@ Version: 2020-06-26 2023-08-05 2023-08-25 2023-09-19" "other" )) (xcomma '("comma ," "semicolon ;" "none" "other")) - xp1 xp2 xbktChoice xsep xsepChoice xquoteL xquoteR) - (let ((xbds (xah-get-bounds-of-block-or-region))) - (setq xp1 (car xbds) xp2 (cdr xbds))) - + xbktChoice xsep xsepChoice xquoteL xquoteR) (let ((completion-ignore-case t)) (setq xbktChoice (completing-read "Quote to use:" xbrackets nil t nil nil (car xbrackets))) (setq xsepChoice (completing-read "line separator:" xcomma nil t nil nil (car xcomma - (cond ((string-equal xbktChoice "none") (setq xquoteL "" xquoteR "")) @@ -1538,8 +1534,10 @@ Version: 2020-06-26 2023-08-05 2023-08-25 2023-09-19" ((string-equal xsepChoice "none") "") ((string-equal xsepChoice "other") (read-string "Enter separator:")) (t xsepChoice))) - (list xp1 xp2 xquoteL xquoteR xsep))) - (let ((xp1 Begin) (xp2 End) (xquoteL QuoteL) (xquoteR QuoteR) (xsep Sep)) + (list xquoteL xquoteR xsep))) + (let (xp1 xp2 (xquoteL QuoteL) (xquoteR QuoteR) (xsep Sep)) +(let ((xbds (xah-get-bounds-of-block-or-region))) + (setq xp1 (car xbds) xp2 (cdr xbds))) (save-excursion (save-restriction (narrow-to-region xp1 xp2)
[elpa] externals/consult e03041b1f5: Fix consult-find for relative paths (Fix #885)
branch: externals/consult commit e03041b1f5019c2fe5fc54c68740df78603d60a0 Author: Daniel Mendler Commit: Daniel Mendler Fix consult-find for relative paths (Fix #885) --- consult.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consult.el b/consult.el index 0087163b80..924ef7922c 100644 --- a/consult.el +++ b/consult.el @@ -279,7 +279,7 @@ Can be either a string, or a list of strings or expressions." :type '(choice string (repeat (choice string sexp (defcustom consult-find-args - "find . -not ( -wholename */.* -prune )" + "find . -not ( -iwholename */.[a-z]* -prune )" "Command line arguments for find, see `consult-find'. The dynamically computed arguments are appended. Can be either a string, or a list of strings or expressions."
[elpa] externals/llm 749e5b6991 1/2: Implement token counting for vertex by querying API
branch: externals/llm commit 749e5b69917d640a0b3e6081459427e4d339508c Author: Andrew Hyatt Commit: Andrew Hyatt Implement token counting for vertex by querying API --- NEWS.org | 2 ++ README.org| 2 +- llm-vertex.el | 29 + 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/NEWS.org b/NEWS.org index 6ff8d1322f..0e82d93163 100644 --- a/NEWS.org +++ b/NEWS.org @@ -1,3 +1,5 @@ +* Version 0.6 +- Implement token counting for Google Cloud Vertex via their API. * Version 0.5 - Fixes for conversation context storage, requiring clients to handle ongoing conversations slightly differently. - Fixes for proper sync request http error code handling. diff --git a/README.org b/README.org index 674d0e0e13..b1b9536e76 100644 --- a/README.org +++ b/README.org @@ -70,7 +70,7 @@ For all callbacks, the callback will be executed in the buffer the function was - ~llm-chat-streaming provider prompt partial-callback response-callback error-callback~: Similar to ~llm-chat-async~, but request a streaming response. As the response is built up, ~partial-callback~ is called with the all the text retrieved up to the current point. Finally, ~reponse-callback~ is called with the complete text. - ~llm-embedding provider string~: With the user-chosen ~provider~, send a string and get an embedding, which is a large vector of floating point values. The embedding represents the semantic meaning of the string, and the vector can be compared against other vectors, where smaller distances between the vectors represent greater semantic similarity. - ~llm-embedding-async provider string vector-callback error-callback~: Same as ~llm-embedding~ but this is processed asynchronously. ~vector-callback~ is called with the vector embedding, and, in case of error, ~error-callback~ is called with the same arguments as in ~llm-chat-async~. -- ~llm-count-tokens provider string~: Count how many tokens are in ~string~. This may theoretically vary by ~provider~ but typically is always about the same. This gives an estimate only. +- ~llm-count-tokens provider string~: Count how many tokens are in ~string~. This may vary by ~provider~, because some provideres implement an API for this, but typically is always about the same. This gives an estimate if the provider has no API support. And the following helper functions: - ~llm-make-simple-chat-prompt text~: For the common case of just wanting a simple text prompt without the richness that ~llm-chat-prompt~ struct provides, use this to turn a string into a ~llm-chat-prompt~ that can be passed to the main functions above. diff --git a/llm-vertex.el b/llm-vertex.el index 4ad59ff33e..557507f3e3 100644 --- a/llm-vertex.el +++ b/llm-vertex.el @@ -313,6 +313,35 @@ If STREAMING is non-nil, use the URL for the streaming API." (llm-request-callback-in-buffer buf error-callback 'error (llm-vertex--error-message data)) +(defun llm-vertex--count-token-url (provider) + "Return the URL to use for the Vertex API. +PROVIDER is the llm provider. +MODEL " + (format "https://%s-aiplatform.googleapis.com/v1beta1/projects/%s/locations/%s/publishers/google/models/%s:countTokens"; + llm-vertex-gcloud-region + (llm-vertex-project provider) + llm-vertex-gcloud-region + (or (llm-vertex-embedding-model provider) "chat-bison"))) + +;; Token counts +;; https://cloud.google.com/vertex-ai/docs/generative-ai/get-token-count + +(defun llm-vertex--count-token-request (string) + "Create the data payload to count tokens in STRING." + `((instances . [((prompt . ,string))]))) + +(defun llm-vertex--count-tokens-extract-response (response) + "Extract the token count from the response." + (assoc-default 'totalTokens response)) + +(cl-defmethod llm-count-tokens ((provider llm-vertex) string) + (llm-vertex-refresh-key provider) + (llm-vertex--handle-response + (llm-request-sync (llm-vertex--count-token-url provider) + :headers `(("Authorization" . ,(format "Bearer %s" (llm-vertex-key provider + :data (llm-vertex--count-token-request string)) + #'llm-vertex--count-tokens-extract-response)) + (provide 'llm-vertex) ;;; llm-vertex.el ends here
[elpa] externals/llm updated (8f431fad9e -> 39e462d512)
elpasync pushed a change to branch externals/llm. from 8f431fad9e Bump version to 0.5.0 new 749e5b6991 Implement token counting for vertex by querying API new 39e462d512 Fixes to llm-vertex token counting Summary of changes: NEWS.org | 2 ++ README.org| 2 +- llm-vertex.el | 30 ++ 3 files changed, 33 insertions(+), 1 deletion(-)
[elpa] externals/llm 39e462d512 2/2: Fixes to llm-vertex token counting
branch: externals/llm commit 39e462d5125e615d8bf33edae6d69b851bc2d4fd Author: Andrew Hyatt Commit: Andrew Hyatt Fixes to llm-vertex token counting The previous version didn't account for the fact that the request is basically just a version of the chat (or embedding) request. --- llm-vertex.el | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/llm-vertex.el b/llm-vertex.el index 557507f3e3..dbd13fa144 100644 --- a/llm-vertex.el +++ b/llm-vertex.el @@ -313,6 +313,9 @@ If STREAMING is non-nil, use the URL for the streaming API." (llm-request-callback-in-buffer buf error-callback 'error (llm-vertex--error-message data)) +;; Token counts +;; https://cloud.google.com/vertex-ai/docs/generative-ai/get-token-count + (defun llm-vertex--count-token-url (provider) "Return the URL to use for the Vertex API. PROVIDER is the llm provider. @@ -321,14 +324,11 @@ MODEL " llm-vertex-gcloud-region (llm-vertex-project provider) llm-vertex-gcloud-region - (or (llm-vertex-embedding-model provider) "chat-bison"))) - -;; Token counts -;; https://cloud.google.com/vertex-ai/docs/generative-ai/get-token-count + (or (llm-vertex-chat-model provider) "chat-bison"))) -(defun llm-vertex--count-token-request (string) - "Create the data payload to count tokens in STRING." - `((instances . [((prompt . ,string))]))) +(defun llm-vertex--to-count-token-request (request) + "Return a version of REQUEST that is suitable for counting tokens." + (seq-filter (lambda (c) (not (equal (car c) "parameters"))) request)) (defun llm-vertex--count-tokens-extract-response (response) "Extract the token count from the response." @@ -339,7 +339,8 @@ MODEL " (llm-vertex--handle-response (llm-request-sync (llm-vertex--count-token-url provider) :headers `(("Authorization" . ,(format "Bearer %s" (llm-vertex-key provider - :data (llm-vertex--count-token-request string)) + :data (llm-vertex--to-count-token-request +(llm-vertex--chat-request-v1 (llm-make-simple-chat-prompt string #'llm-vertex--count-tokens-extract-response)) (provide 'llm-vertex)