summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar AntolĂ­n Camarena <omar.antolin@gmail.com>2022-10-23 12:08:27 -0500
committerGitHub <noreply@github.com>2022-10-23 12:08:27 -0500
commitb355ef6d386134f16eafe17051e9fafcfbea9cad (patch)
tree9aa739c87e348e60c233c562e6df29e0a32c99bc
parent6b86527b30ef96e047d97e314ac640a410891d1f (diff)
parent531372bd5486a3bcf46ca6689e7a0bd0f1f8e359 (diff)
Merge pull request #65 from narendraj9/patch-1
Add note about custom styles for `company-capf'
-rw-r--r--README.org14
-rw-r--r--orderless.texi13
2 files changed, 27 insertions, 0 deletions
diff --git a/README.org b/README.org
index f90b0a7..e9c166d 100644
--- a/README.org
+++ b/README.org
@@ -396,6 +396,20 @@ But there are a couple of points of discomfort:
#+end_src
(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:
+
+#+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 a5acd38..80cfb5f 100644
--- a/orderless.texi
+++ b/orderless.texi
@@ -466,6 +466,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