Skip to content

Commit

Permalink
Fix to use pos-tip under MS Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutov authored and Tomohiro Matsuyama committed Jan 11, 2011
1 parent 75482c7 commit 7f8efe8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
18 changes: 10 additions & 8 deletions auto-complete.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions doc/changes.ja.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
------------
Expand Down
1 change: 1 addition & 0 deletions doc/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
------------
Expand Down
4 changes: 4 additions & 0 deletions doc/manual.ja.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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`の場合は無制限です。
Expand Down
4 changes: 4 additions & 0 deletions doc/manual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7f8efe8

Please sign in to comment.