[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company ff6107bde3 04/30: company-inhibit-inside-symbol
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company ff6107bde3 04/30: company-inhibit-inside-symbols: New option |
Date: |
Sat, 13 Jul 2024 00:57:49 -0400 (EDT) |
branch: externals/company
commit ff6107bde343d9c16ae4cad3847af3705ea1c09c
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
company-inhibit-inside-symbols: New option
---
NEWS.md | 2 ++
company.el | 13 ++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/NEWS.md b/NEWS.md
index 699d404ca3..fc883bc254 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -4,6 +4,8 @@
* Completion works inside symbols
(#[340](https://github.com/company-mode/company-mode/issues/340)).
+* New user option `company-inhibit-inside-symbols`. Set it to `t` to switch
+ closer to the previous behavior.
* `company-elisp` has been removed. It's not needed since Emacs 24.4, with all
of its features having been incorporated into the built-in Elisp completion.
* `company-files` shows shorter completions. Previously, the popup spanned
diff --git a/company.el b/company.el
index b04ec86976..d62ae5c56a 100644
--- a/company.el
+++ b/company.el
@@ -674,6 +674,14 @@ happens. The value of nil means no idle completion."
(const :tag "immediate (0)" 0)
(number :tag "seconds")))
+(defcustom company-inhibit-inside-symbols nil
+ "Non-nil to inhibit idle completion when typing in the middle of a symbol.
+The symbol is in a generalized sense, indicated by the `prefix' backend
+action returning a non-empty SUFFIX element. When this variable is
+non-nil, completion inside symbol will onlytriggered by an explicit command
+invocation, such as \\[company-complete-common]."
+ :type 'boolean)
+
(defcustom company-begin-commands '(self-insert-command
org-self-insert-command
orgtbl-self-insert-command
@@ -2289,7 +2297,10 @@ For more details see `company-insertion-on-trigger' and
(company-call-backend 'prefix)))
(company--multi-backend-adapter backend 'prefix)))
(when entity
- (when (company--good-prefix-p entity min-prefix)
+ (when (and (company--good-prefix-p entity min-prefix)
+ (or (not company-inhibit-inside-symbols)
+ company--manual-action
+ (zerop (length (company--suffix-str entity)))))
(let ((ignore-case (company-call-backend 'ignore-case)))
;; Keep this undocumented, esp. while only 1 backend needs it.
(company-call-backend 'set-min-prefix min-prefix)
- [elpa] externals/company updated (8d2ca28a16 -> 31f7ad52e4), ELPA Syncer, 2024/07/13
- [elpa] externals/company 22551866cc 03/30: Switch to non-obsolete function, ELPA Syncer, 2024/07/13
- [elpa] externals/company b5db1934ce 08/30: company--capf-post-completion: Make sure to replace the suffix, ELPA Syncer, 2024/07/13
- [elpa] externals/company 01e82364bf 23/30: company-post-command: Refresh more often, ELPA Syncer, 2024/07/13
- [elpa] externals/company 78ed92db96 14/30: Fix "Attempt to modify read-only object", ELPA Syncer, 2024/07/13
- [elpa] externals/company ff6107bde3 04/30: company-inhibit-inside-symbols: New option,
ELPA Syncer <=
- [elpa] externals/company 426e1830ff 06/30: company--unique-match-p: Also include suffix, ELPA Syncer, 2024/07/13
- [elpa] externals/company d7e77b9673 01/30: #1106 #340 Complete inside symbols, ELPA Syncer, 2024/07/13
- [elpa] externals/company 7ed2baeedd 05/30: Merge branch 'master' into completion_inside_symbol, ELPA Syncer, 2024/07/13
- [elpa] externals/company ebe5244443 07/30: Merge branch 'master' into completion_inside_symbol, ELPA Syncer, 2024/07/13
- [elpa] externals/company 10fcb21d46 09/30: Remove suffix after completion by company-dabbrev-code too, ELPA Syncer, 2024/07/13
- [elpa] externals/company 2fefdc7ce3 02/30: Fix test failures, ELPA Syncer, 2024/07/13
- [elpa] externals/company 436b0d6247 10/30: New backend command `adjust-boundaries`, ELPA Syncer, 2024/07/13
- [elpa] externals/company 477799b362 18/30: Make suffix matching use "proper suffix" logic by default, ELPA Syncer, 2024/07/13
- [elpa] externals/company a011dbd892 27/30: Update company-files tests, ELPA Syncer, 2024/07/13
- [elpa] externals/company 277640481a 19/30: Render the "preview" overlay over the matching suffix text, ELPA Syncer, 2024/07/13