[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/orderless 531372bd54 2/3: Name advice function, link to
From: |
ELPA Syncer |
Subject: |
[elpa] externals/orderless 531372bd54 2/3: Name advice function, link to u/hvis's comment |
Date: |
Sun, 23 Oct 2022 13:58:01 -0400 (EDT) |
branch: externals/orderless
commit 531372bd5486a3bcf46ca6689e7a0bd0f1f8e359
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>
Name advice function, link to u/hvis's comment
---
README.org | 21 +++++++++++----------
orderless.texi | 13 +++++++++++++
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/README.org b/README.org
index d27ffc6eeb..a6600164bf 100644
--- a/README.org
+++ b/README.org
@@ -388,17 +388,18 @@ But there are a couple of points of discomfort:
(Aren't dynamically scoped variables and the advice system nifty?)
- If you would like to use different =completion-styles= with =company-capf=
instead, you
- can add this to your config:
+If you would like to use different =completion-styles= with =company-capf=
instead, you
+can add this to your config:
- #+begin_src emacs-lisp
- ;;
https://www.reddit.com/r/emacs/comments/nichkl/how_to_use_different_completion_styles_in_the/
- (advice-add 'company-capf
- :around
- (lambda (capf-fn &rest args)
- (let ((completion-styles '(basic partial-completion)))
- (apply capf-fn args))))
- #+end_src
+#+begin_src emacs-lisp
+ ;; We follow a suggestion by company maintainer u/hvis:
+ ;; https://www.reddit.com/r/emacs/comments/nichkl/comment/gz1jr3s/
+ (defun company-completion-styles (capf-fn &rest args)
+ (let ((completion-styles '(basic partial-completion)))
+ (apply capf-fn args))
+
+ (advice-add 'company-capf :around #'company-completion-styles)
+#+end_src
* Related packages
diff --git a/orderless.texi b/orderless.texi
index 3b84d37e53..e4404c439d 100644
--- a/orderless.texi
+++ b/orderless.texi
@@ -460,6 +460,19 @@ face with this configuration:
(Aren't dynamically scoped variables and the advice system nifty?)
@end enumerate
+If you would like to use different @samp{completion-styles} with
@samp{company-capf} instead, you
+can add this to your config:
+
+@lisp
+;; We follow a suggestion by company maintainer u/hvis:
+;; https://www.reddit.com/r/emacs/comments/nichkl/comment/gz1jr3s/
+(defun company-completion-styles (capf-fn &rest args)
+ (let ((completion-styles '(basic partial-completion)))
+ (apply capf-fn args))
+
+(advice-add 'company-capf :around #'company-completion-styles)
+@end lisp
+
@node Related packages
@chapter Related packages