diff --git a/auto-complete.el b/auto-complete.el index b600c2c..8b44a80 100644 --- a/auto-complete.el +++ b/auto-complete.el @@ -164,10 +164,11 @@ :type 'integer :group 'auto-complete) -(defcustom ac-quick-help-prefer-x t - "Prefer X tooltip than overlay popup for displaying quick help." +(defcustom ac-quick-help-prefer-pos-tip t + "Prefer native tooltip with pos-tip than overlay popup for displaying quick help." :type 'boolean :group 'auto-complete) +(defvaralias 'ac-quick-help-prefer-x 'ac-quick-help-prefer-pos-tip) (defcustom ac-candidate-limit nil "Limit number of candidates. Non-integer means no limit." @@ -1243,15 +1244,18 @@ that have been made before in this function." (pos-tip-hide)) t))))) +(defun ac-quick-help-use-pos-tip-p () + (and ac-quick-help-prefer-pos-tip + window-system + (featurep 'pos-tip))) + (defun ac-quick-help (&optional force) (interactive) (when (and (or force (null this-command)) (ac-menu-live-p) (null ac-quick-help)) (setq ac-quick-help - (funcall (if (and ac-quick-help-prefer-x - (eq window-system 'x) - (featurep 'pos-tip)) + (funcall (if (ac-quick-help-use-pos-tip-p) 'ac-pos-tip-show-quick-help 'popup-menu-show-quick-help) ac-menu nil @@ -1272,9 +1276,7 @@ that have been made before in this function." (let ((doc (popup-item-documentation (cdr ac-last-completion))) (point (marker-position (car ac-last-completion)))) (when (stringp doc) - (if (and ac-quick-help-prefer-x - (eq window-system 'x) - (featurep 'pos-tip)) + (if (ac-quick-help-use-pos-tip-p) (with-no-warnings (pos-tip-show doc nil point nil 0)) (popup-tip doc :point point diff --git a/doc/changes.ja.txt b/doc/changes.ja.txt index 9f2c522..1f32f25 100644 --- a/doc/changes.ja.txt +++ b/doc/changes.ja.txt @@ -32,6 +32,7 @@ v1.4の変更点 {#Changes_v1.4} * 頻度計算で稀に起こるエラー * 辞書のキャッシュ戦略の改善 * help-modeがおかしくなる問題を修正 ("help-setup-xref: Symbol's value as variable is void: help-xref-following") +* auto-completeがWindows上でpos-tipを使えなかった問題を修正 v1.3.1の変更点 {#Changes_v1.3.1} ------------ diff --git a/doc/changes.txt b/doc/changes.txt index 9a34f4d..d6e4d85 100644 --- a/doc/changes.txt +++ b/doc/changes.txt @@ -32,6 +32,7 @@ v1.4 Changes {#Changes_v1.4} * Rare completion frequency computation error * Improve dictionary caching sterategy * Fixed help-mode error ("help-setup-xref: Symbol's value as variable is void: help-xref-following") +* Fixed auto-complete couldn't use pos-tip on Windows v1.3.1 Changes {#Changes_v1.3.1} ------------ diff --git a/doc/manual.ja.txt b/doc/manual.ja.txt index dc6cd1b..1a9ca18 100644 --- a/doc/manual.ja.txt +++ b/doc/manual.ja.txt @@ -683,6 +683,10 @@ Tips クイックヘルプの行数を整数で指定します。 +### `ac-quick-help-prefer-pos-tip` ### + +auto-completeがクイックヘルプの表示にpos-tipによるネイティブのツールチップを使うかどうかです。non-nilなら追加で[pos-tip.el](http://www.emacswiki.org/emacs/PosTip)をインストールする必要があります。 + ### `ac-candidate-limit` ### 補完候補数を制限します。整数が指定されている場合は、その値を表示する補完候補数の上限にします。`nil`の場合は無制限です。 diff --git a/doc/manual.txt b/doc/manual.txt index 989ad40..dfe6d9e 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -679,6 +679,10 @@ Specify an integer of lines of completion menu. Specify an integer of lines of quick help. +### `ac-quick-help-prefer-pos-tip` ### + +Whether or not auto-complete prefers native tooltip with pos-tip than overlap popup for displaying quick help. If non-nil, you also need to install [pos-tip.el](http://www.emacswiki.org/emacs/PosTip) so that displaying tooltip can work well. + ### `ac-candidate-limit` ### Limit a number of candidates. Specifying an integer, the value will be a limit of candidates. `nil` means no limit.