From 047659199210514f3d88cfc9c8943f2fdc89a81d Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Fri, 5 Sep 2014 23:06:02 -0700 Subject: [PATCH] fix(emacs/lean-company): override company--window-width Override 'company--window-width' to be 0.95 * window-body-width. This partially solves the problem of issue #137. --- src/emacs/lean-company.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/emacs/lean-company.el b/src/emacs/lean-company.el index 9550430e3..01a0e928b 100644 --- a/src/emacs/lean-company.el +++ b/src/emacs/lean-company.el @@ -35,6 +35,7 @@ triggers a completion immediately." (let ((line-number (line-number-at-pos))) (lean-server-send-cmd-sync (lean-cmd-findp line-number prefix) (lambda (candidates) + (lean-server-debug "executing continuation for FINDP") (-map 'company-lean--make-candidate candidates))))) (defun company-lean--location (arg) @@ -72,4 +73,9 @@ triggers a completion immediately." (location (company-lean--location arg)) (sorted t))) +(defadvice company--window-width + (after lean-company--window-width activate) + (when (eq major-mode 'lean-mode) + (setq ad-return-value (truncate (* 0.95 (window-body-width)))))) + (provide 'lean-company)