[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company c625b2ccc7 2/3: #1497 Better document the chang
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company c625b2ccc7 2/3: #1497 Better document the change |
Date: |
Tue, 5 Nov 2024 12:57:43 -0500 (EST) |
branch: externals/company
commit c625b2ccc77beb0ab7f60ca9b212655d5f9d927a
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
#1497 Better document the change
---
NEWS.md | 7 +++++++
company.el | 7 ++++++-
doc/company.texi | 1 +
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/NEWS.md b/NEWS.md
index d1e28f99dd..e19eebbb5d 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,13 @@
# Next
+* Completion is restarted if it enters a new "field" at the end, as indicated
by
+ the `adjust-boundaries` backend action
+ (#[1497](https://github.com/company-mode/company-mode/pull/1497)). This
+ benefits file name (and directory) completion. The user option
+ `company-files-chop-trailing-slash` has been removed, and the
+ `post-completion` handler in `company-files` has been removed as well.
+
* Handle the case when the current c-a-p-f function changes mid-session
(#[1494](https://github.com/company-mode/company-mode/pull/1494)).
diff --git a/company.el b/company.el
index f4d3ff586b..3023da6068 100644
--- a/company.el
+++ b/company.el
@@ -2598,6 +2598,7 @@ For more details see `company-insertion-on-trigger' and
(delete-region (point) (+ (point) (length suffix))))
(let ((tick (buffer-chars-modified-tick))
(backend company-backend))
+ ;; Call backend's `post-completion' and run other hooks, then exit.
(company-cancel result)
;; Try restarting completion, to see if we moved into a new field.
;; Most commonly, this would be after entering a dir in file completion.
@@ -3087,7 +3088,11 @@ For use in the `select-mouse' frontend action.
`let'-bound.")
(company-complete-selection)))
(defun company-complete-selection ()
- "Insert the selected candidate."
+ "Insert the selected candidate.
+
+Restart completion if a new field is entered. A field is indicated by
+`adjust-boundaries' as implemented in the backend. If both adjusted prefix
+and adjusted suffix are empty strings, that means a new field."
(interactive)
(when (and (company-manual-begin) company-selection)
(let ((result (nth company-selection company-candidates)))
diff --git a/doc/company.texi b/doc/company.texi
index 020075a173..9b9eb02397 100644
--- a/doc/company.texi
+++ b/doc/company.texi
@@ -332,6 +332,7 @@ Select the previous candidate
@cindex complete
@findex company-complete-selection
Insert the selected candidate (@code{company-complete-selection}).
+Restart completion if a new field is entered.
@item TAB
@itemx <tab>