Add debug logs in finish-completing functions

This commit is contained in:
Takafumi Arakaki 2012-07-23 20:33:46 +02:00
parent 96b4c554ac
commit 182cfe8672
2 changed files with 5 additions and 0 deletions

View file

@ -61,6 +61,8 @@ compatibility with `ein:completer-finish-completing-default'."
;; I don't need to check if the point is at right position, as in ;; I don't need to check if the point is at right position, as in
;; `ein:completer-finish-completing-default' because `auto-complete' ;; `ein:completer-finish-completing-default' because `auto-complete'
;; checks it anyway. ;; checks it anyway.
(ein:log 'debug "COMPLETER-FINISH-COMPLETING-AC: matched-text=%S matches=%S"
matched-text matches)
(setq ein:ac-direct-matches matches) ; let-binding won't work (setq ein:ac-direct-matches matches) ; let-binding won't work
(setq ein:ac-cache-matches (append matches ein:ac-cache-matches)) (setq ein:ac-cache-matches (append matches ein:ac-cache-matches))
(run-with-idle-timer 1 nil #'ein:ac-clear-cache) (run-with-idle-timer 1 nil #'ein:ac-clear-cache)

View file

@ -26,6 +26,7 @@
;;; Code: ;;; Code:
(require 'ein-utils) (require 'ein-utils)
(require 'ein-log)
(defun ein:completer-choose () (defun ein:completer-choose ()
(when (require 'auto-complete nil t) (when (require 'auto-complete nil t)
@ -42,9 +43,11 @@
(re-search-backward (concat matched-text "\\=")))) (re-search-backward (concat matched-text "\\="))))
(defun ein:completer-finish-completing (_dummy_ content) (defun ein:completer-finish-completing (_dummy_ content)
(ein:log 'debug "COMPLETER-FINISH-COMPLETING: content=%S" content)
(let ((matched-text (plist-get content :matched_text)) (let ((matched-text (plist-get content :matched_text))
(matches (plist-get content :matches)) (matches (plist-get content :matches))
(completer (ein:completer-choose))) (completer (ein:completer-choose)))
(ein:log 'debug "COMPLETER-FINISH-COMPLETING: completer=%s" completer)
(funcall completer matched-text matches))) (funcall completer matched-text matches)))
(defun ein:completer-finish-completing-default (matched-text matches) (defun ein:completer-finish-completing-default (matched-text matches)