summaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorOmar Antolín <omar.antolin@gmail.com>2022-10-23 12:07:40 -0500
committerOmar Antolín <omar.antolin@gmail.com>2022-10-23 12:07:40 -0500
commit531372bd5486a3bcf46ca6689e7a0bd0f1f8e359 (patch)
tree6895737fe901b53c23e752a81a7b1ef504bbd80e /README.org
parentfbf969e3ae0ee96c37ac27550d7869d5d9de1c61 (diff)
Name advice function, link to u/hvis's comment
Diffstat (limited to 'README.org')
-rw-r--r--README.org21
1 files changed, 11 insertions, 10 deletions
diff --git a/README.org b/README.org
index d27ffc6..a660016 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