commit | author | age
|
5cb5f7
|
1 |
;ELC |
C |
2 |
;;; Compiled |
|
3 |
;;; in Emacs version 26.1 |
|
4 |
;;; with all optimizations. |
|
5 |
|
|
6 |
;;; This file contains utf-8 non-ASCII characters, |
|
7 |
;;; and so cannot be loaded into Emacs 22 or earlier. |
|
8 |
(and (boundp 'emacs-version) |
|
9 |
(< (aref emacs-version (1- (length emacs-version))) ?A) |
|
10 |
(string-lessp emacs-version "23") |
|
11 |
(error "`%s' was compiled for Emacs 23 or later" #$)) |
|
12 |
|
|
13 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
14 |
|
|
15 |
|
|
16 |
(defconst pos-tip-version "0.4.6") |
|
17 |
(byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\314\315\304\301&\210\310\316\317\320\314\315\304\301&\210\310\321\302\322\314\323\304\301&\210\310\324\302\325\314\326\304\301&\210\310\327\302\330\314\331\304\301&\210\310\332\302\333\314\334\304\301&\207" [custom-declare-group pos-tip nil "Show tooltip at point" :group faces :prefix "pos-tip-" custom-declare-variable pos-tip-border-width 1 "Outer border width of pos-tip's tooltip." :type integer pos-tip-internal-border-width 2 "Text margin of pos-tip's tooltip." pos-tip-foreground-color "Default foreground color of pos-tip's tooltip.\nWhen `nil', look up the foreground color of the `tooltip' face." (choice (const :tag "Default" nil) string) pos-tip-background-color "Default background color of pos-tip's tooltip.\nWhen `nil', look up the background color of the `tooltip' face." (choice (const :tag "Default" nil) string) pos-tip-tab-width "Tab width used for `pos-tip-split-string' and `pos-tip-fill-string'\nto expand tab characters. nil means use default value of `tab-width'." (choice (const :tag "Default" nil) integer) pos-tip-use-relative-coordinates "Non-nil means tooltip location is calculated as a coordinates\nrelative to the top left corner of frame. In this case the tooltip\nwill always be displayed within the frame.\n\nNote that this variable is automatically set to non-nil if absolute\ncoordinates can't be obtained by `pos-tip-compute-pixel-position'." boolean] 8) |
|
18 |
#@228 The name of the window system that FRAME is displaying through. |
|
19 |
The value is a symbol---for instance, 'x' for X windows. |
|
20 |
The value is nil if Emacs is using a text-only terminal. |
|
21 |
|
|
22 |
FRAME defaults to the currently selected frame. |
|
23 |
(defalias 'pos-tip-window-system #[(&optional frame) "\302\206 \303 !\211\203 \304=?\205 \202 \305\306\302D\")\207" [frame type framep selected-frame t signal wrong-type-argument] 5 (#$ . 1913)]) |
|
24 |
#@128 Return a Nth power of 2 if OBJECT is a positive integer. |
|
25 |
Otherwise return 0. Omitting N means return 1 for a positive integer. |
|
26 |
(defalias 'pos-tip-normalize-natnum #[(object &optional n) "\302\303!\203 \304V\203 \305\202 \304 \206 \304\"\207" [object n ash natnump 0 1] 3 (#$ . 2352)]) |
|
27 |
#@60 The latest result of `pos-tip-frame-top-left-coordinates'. |
|
28 |
(defvar pos-tip-saved-frame-coordinates '(0 . 0) (#$ . 2649)) |
|
29 |
#@108 The latest result of `pos-tip-calibrate-frame-offset'. This value |
|
30 |
is used for non-X graphical environment. |
|
31 |
(defvar pos-tip-frame-offset nil (#$ . 2777)) |
|
32 |
#@308 Array of the results of `pos-tip-calibrate-frame-offset'. They are |
|
33 |
recorded only when `pos-tip-frame-top-left-coordinates' is called for a |
|
34 |
non-X but graphical frame. |
|
35 |
|
|
36 |
The 2nd and 4th elements are the values for frames having a menu bar. |
|
37 |
The 3rd and 4th elements are the values for frames having a tool bar. |
|
38 |
(defvar pos-tip-frame-offset-array [nil nil nil nil] (#$ . 2937)) |
|
39 |
#@346 Return the pixel coordinates of FRAME as a cons cell (LEFT . TOP), |
|
40 |
which are relative to top left corner of screen. |
|
41 |
|
|
42 |
Return nil if failing to acquire the coordinates. |
|
43 |
|
|
44 |
If FRAME is omitted, use selected-frame. |
|
45 |
|
|
46 |
Users can also get the frame coordinates by referring the variable |
|
47 |
`pos-tip-saved-frame-coordinates' just after calling this function. |
|
48 |
(defalias 'pos-tip-frame-top-left-coordinates #[(&optional frame) "\306!\211\204 \307\310\"\202\240 \311=\203a \3121\\ r\313\314!q\210\315\316 \210\317 \210\320\315\321\315\f\322\323\324\325\"\324\326\"#&\210eb\210\327\330!\210\331\332\327\333!\334 \"!\331\332\327\335!\334 \"!B\211*0\202\240 \210\315\202\240 \336\324\337\"\340\"\336\324\341\"\342\"\\'('H\206\202 ('\343!I\211)\205\237 \344\324\345\"!)@\\\344\324\346\"!)A\\B\211*)\207" [frame winsys case-fold-search shell-file-name shell-command-switch pos-tip-saved-frame-coordinates pos-tip-window-system error "text-only frame: %S" x (error) get-buffer-create " *xwininfo*" nil buffer-disable-undo erase-buffer call-process t format "xwininfo -display %s -id %s" frame-parameter display window-id search-forward "\n Absolute" string-to-number buffer-substring-no-properties "X: " line-end-position "Y: " pos-tip-normalize-natnum menu-bar-lines 0 tool-bar-lines 1 pos-tip-calibrate-frame-offset eval left top index pos-tip-frame-offset-array offset] 13 (#$ . 3317)]) |
|
49 |
#@370 Return the pixel coordinates of FRAME1 relative to FRAME2 |
|
50 |
as a cons cell (LEFT . TOP). |
|
51 |
|
|
52 |
W32-FRAME non-nil means both of frames are under `w32' window system. |
|
53 |
|
|
54 |
FRAME-COORD1 and FRAME-COORD2, if given, specify the absolute |
|
55 |
coordinates of FRAME1 and FRAME2, respectively, which make the |
|
56 |
calculations faster if the frames have different heights of menu bars |
|
57 |
and tool bars. |
|
58 |
(defalias 'pos-tip-frame-relative-position #[(frame1 frame2 &optional w32-frame frame-coord1 frame-coord2) "\306\307\310\"!\306\307 \310\"!=\203@ \n\204$ \306\307\311\"!\306\307 \311\"!=\203@ \312\307\313\"!\312\307 \313\"!Z\312\307\314\"!\312\307 \314\"!ZB\207\204K \315\316!)
\204V \315\316 !)@
@ZA
AZB\207" [frame1 frame2 w32-frame frame-coord1 pos-tip-saved-frame-coordinates frame-coord2 pos-tip-normalize-natnum frame-parameter menu-bar-lines tool-bar-lines eval left top nil pos-tip-frame-top-left-coordinates] 6 (#$ . 4717)]) |
|
59 |
#@129 Non-nil indicates the latest result of `pos-tip-compute-pixel-position' |
|
60 |
was upper than the location specified by the arguments. |
|
61 |
(defvar pos-tip-upperside-p nil (#$ . 5639)) |
|
62 |
#@150 Display pixel size effective for showing tooltip in MS-Windows desktop. |
|
63 |
This doesn't include the taskbar area, so isn't same as actual display size. |
|
64 |
(defvar pos-tip-w32-saved-max-width-height nil (#$ . 5819)) |
|
65 |
#@1765 Return pixel position of POS in WINDOW like (X . Y), which indicates |
|
66 |
the absolute or relative coordinates of bottom left corner of the object. |
|
67 |
|
|
68 |
Omitting POS and WINDOW means use current position and selected window, |
|
69 |
respectively. |
|
70 |
|
|
71 |
If PIXEL-WIDTH and PIXEL-HEIGHT are given, this function assumes these |
|
72 |
values as the size of small window like tooltip which is located around the |
|
73 |
object at POS. These values are used to adjust the location in order that |
|
74 |
the tooltip won't disappear by sticking out of the display. By referring |
|
75 |
the variable `pos-tip-upperside-p' after calling this function, user can |
|
76 |
examine whether the tooltip will be located above the specified position. |
|
77 |
|
|
78 |
If FRAME-COORDINATES is omitted or nil, automatically obtain the absolute |
|
79 |
coordinates of the top left corner of frame which WINDOW is on. Here, |
|
80 |
`top left corner of frame' represents the origin of `window-pixel-edges' |
|
81 |
and its coordinates are essential for calculating the return value as |
|
82 |
absolute coordinates. If a cons cell like (LEFT . TOP), specifies the |
|
83 |
frame absolute location and makes the calculation slightly faster, but can |
|
84 |
be used only when it's clear that frame is in the specified position. Users |
|
85 |
can get the latest values of frame coordinates for using in the next call |
|
86 |
by referring the variable `pos-tip-saved-frame-coordinates' just after |
|
87 |
calling this function. Otherwise, FRAME-COORDINATES `relative' means return |
|
88 |
pixel coordinates of the object relative to the top left corner of the frame. |
|
89 |
This is the same effect as `pos-tip-use-relative-coordinates' is non-nil. |
|
90 |
|
|
91 |
DX specifies horizontal offset in pixel. |
|
92 |
|
|
93 |
DY specifies vertical offset in pixel. This makes the calculations done |
|
94 |
without considering the height of object at POS, so the object might be |
|
95 |
hidden by the tooltip. |
|
96 |
(defalias 'pos-tip-compute-pixel-position #[(&optional pos window pixel-width pixel-height frame-coordinates dx dy) "\306\206 \307 !\310 !\311=\206 \f\312=\206 \n\205
?\211\n\203) \313\2029 \f\2069 \314 !\2069 \315\211\n\316'\317(\206D \320!\")\321)!A\211*\205f \322*\"\206f \323\315!\205f \322*\"+)\3248\262\206\221 \325(\206{ \320!\315#\211,\205\214 ,@,A@B)\206\221 \326-\327'@\330!@-@.\206\244 \331$/\327'A\332!A@\324+8\206\272 -A#\21101\206 +@\206 r\333!q\210)\203\344 2\204\344 )\3348\262A\202\335\336!\203\2033\331U\204\337\340 !\34143\"_!\202\340 !)\\5\342\21167\n\203$\343 !6\344 !7\202=\n\2033
@6
A7\202=\345 !6\346 !758\206E\331\\7V9\331/6:\206V\331Z^]\3319\203u1\203i7\202k08\206q\331Z\202w5].
B\207" [window frame w32-frame pos-tip-use-relative-coordinates frame-coordinates pos-tip-w32-saved-max-width-height window-frame selected-window pos-tip-window-system w32 relative (0 . 0) pos-tip-frame-top-left-coordinates t (0 . 0) posn-at-point window-point posn-actual-col-row window-line-height redisplay 2 pos-visible-in-window-p (0 . 0) + window-inside-pixel-edges 0 window-pixel-edges window-buffer 9 boundp text-scale-mode round frame-char-height expt nil frame-pixel-width frame-pixel-height x-display-pixel-width x-display-pixel-height frame-coord pos posn line line-height geom x-y dx x y0 dy header-line-format text-scale-mode-amount text-scale-mode-step y xmax ymax pixel-height pos-tip-upperside-p pixel-width] 7 (#$ . 6036)]) |
|
97 |
#@28 Cancel timeout of tooltip. |
|
98 |
(defalias 'pos-tip-cancel-timer #[nil "\301\302\"\207" [timer-list mapc #[(timer) "\301H\302=\205 \303!\207" [timer 5 x-hide-tip cancel-timer] 2]] 3 (#$ . 9356)]) |
|
99 |
#@131 Move out mouse pointer if it is inside region (LEFT RIGHT TOP BOTTOM) |
|
100 |
in FRAME. Return new mouse position like (FRAME . (X . Y)). |
|
101 |
(defalias 'pos-tip-avoid-mouse #[(left right top bottom &optional frame) "\204 \306 \307\310!!r\311\216\312 @\313\"\210\314 +\211\211A\242\n@\nA=\203\334 \f\247\203\334 \315!\316!\\\317V\203I \fZT\202K T\315!W\203^ \fZ\202` \317V\203q
ZT\202s T\316!W\203\206
Z\202\210 ^^^\211\320V\203\332 U\203\255 \317Z\202\320 U\203\274 T\202\320 U\203\314 \317Z\202\320 T\321\f
#\210\322\323!\210.\n\205\344 \f
B,B\207" [frame save-selected-window--state mpos mframe mx my selected-frame internal--before-with-selected-window frame-selected-window #[nil "\301!\207" [save-selected-window--state internal--after-with-selected-window] 2] select-window norecord mouse-pixel-position frame-pixel-width frame-pixel-height 2 -2 set-mouse-pixel-position sit-for 0.0001 large-number left dl right dr top dt bottom db d] 5 (#$ . 9557)]) |
|
102 |
#@222 Compute the foreground color to use for tooltip. |
|
103 |
|
|
104 |
TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR). |
|
105 |
If it is nil, use `pos-tip-foreground-color' or the foreground color of the |
|
106 |
`tooltip' face. |
|
107 |
(defalias 'pos-tip-compute-foreground-color #[(tip-color) "\302!\203
\303\304\"\206 \242\206 \206 \305\306!\207" [tip-color pos-tip-foreground-color facep face-attribute :foreground face-foreground tooltip] 3 (#$ . 10600)]) |
|
108 |
#@222 Compute the background color to use for tooltip. |
|
109 |
|
|
110 |
TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR). |
|
111 |
If it is nil, use `pos-tip-background-color' or the background color of the |
|
112 |
`tooltip' face. |
|
113 |
(defalias 'pos-tip-compute-background-color #[(tip-color) "\302!\203
\303\304\"\206 \243\206 \206 \305\306!\207" [tip-color pos-tip-background-color facep face-attribute :background face-background tooltip] 3 (#$ . 11060)]) |
|
114 |
#@1218 Show STRING in a tooltip at POS in WINDOW. |
|
115 |
Analogous to `pos-tip-show' except don't propertize STRING by `pos-tip' face. |
|
116 |
|
|
117 |
PIXEL-WIDTH and PIXEL-HEIGHT specify the size of tooltip, if given. These |
|
118 |
are used to adjust the tooltip position in order that it doesn't disappear by |
|
119 |
sticking out of the display, and also used to prevent it from vanishing by |
|
120 |
overlapping with mouse pointer. |
|
121 |
|
|
122 |
Note that this function itself doesn't calculate tooltip size because the |
|
123 |
character width and height specified by faces are unknown. So users should |
|
124 |
calculate PIXEL-WIDTH and PIXEL-HEIGHT by using `pos-tip-tooltip-width' and |
|
125 |
`pos-tip-tooltip-height', or use `pos-tip-show' instead, which can |
|
126 |
automatically calculate tooltip size. |
|
127 |
|
|
128 |
See `pos-tip-show' for details. |
|
129 |
|
|
130 |
Example: |
|
131 |
|
|
132 |
(defface my-tooltip |
|
133 |
'((t |
|
134 |
:background "gray85" |
|
135 |
:foreground "black" |
|
136 |
:inherit variable-pitch)) |
|
137 |
"Face for my tooltip.") |
|
138 |
|
|
139 |
(defface my-tooltip-highlight |
|
140 |
'((t |
|
141 |
:background "blue" |
|
142 |
:foreground "white" |
|
143 |
:inherit my-tooltip)) |
|
144 |
"Face for my tooltip highlighted.") |
|
145 |
|
|
146 |
(let ((str (propertize " foo \n bar \n baz " 'face 'my-tooltip))) |
|
147 |
(put-text-property 6 11 'face 'my-tooltip-highlight str) |
|
148 |
(pos-tip-show-no-propertize str 'my-tooltip)) |
|
149 |
(defalias 'pos-tip-show-no-propertize #[(string &optional tip-color pos window timeout pixel-width pixel-height frame-coordinates dx dy) "\204 \306 \307!\310 !\211\311=\n\312=
\206) 4\313=\206) \f\205) 5?\31467849:&
\203B \315\211;@<;A=\203W <\202] <>@Z?\203i =\202o =>AZ@?@BA\316B!C\317B!D\206\213 ?E\320 \321\"F\322GH\\\323\"I\203\245 \323\202\246 \3247\206\303 \203\266 \325 !\202\303 \f\203\300 5@\202\303 \326 !IZ\327 !\245\\8\206\323 \330 !IZ\331 !\245BJ\332!Kr\333\216\334K@\335\"\210\336 +\211L@M\337N\204 E\203VLA@\204VLA@\203M =\204\340\341 !A@!O\322O\211AO\242OA@\\\342\"P\322O\211AO\242OA@\\\342\"Q M\343MPQ#\210\344\345!\210+\202LA@\203M =\204\346 M\f4$R?R@\\?@RA\\@)7\203\2468\203\246\347?\350?7\f\203\231\351\202\232\324#@\2118\\M%L\352SM\353GB\354HB\355E?\205\303\356<B\357=BD\360\320 \360\"BCF\205\324\321FBCC;\205\337\361CBCD;\205\352\362DBC%BBT\205\373T\324V\205\373TE\205?LA@ZE\205@LAAZ&\210T\203%T\324X\203%\363 \210A.\207" [window frame winsys x-frame w32-frame pos-tip-use-relative-coordinates selected-window window-frame pos-tip-window-system x w32 relative pos-tip-compute-pixel-position t pos-tip-compute-foreground-color pos-tip-compute-background-color frame-parameter line-spacing ash 1 0 frame-pixel-width x-display-pixel-width frame-char-width x-display-pixel-height frame-char-height internal--before-with-selected-window #[nil "\301!\207" [save-selected-window--state internal--after-with-selected-window] 2] select-window norecord mouse-pixel-position nil window-inside-pixel-edges window-list -1 set-mouse-pixel-position sit-for 0.0001 pos-tip-frame-relative-position pos-tip-avoid-mouse + 3 x-show-tip border-width internal-border-width append left top font foreground-color background-color pos-tip-cancel-timer frame-coordinates pos-tip-w32-saved-max-width-height pos pixel-width pixel-height dx dy x-y ax ay pos-tip-saved-frame-coordinates rx ry retval tip-color fg bg use-dxdy spacing pos-tip-border-width pos-tip-internal-border-width border x-max-tooltip-size save-selected-window--state mpos mframe default-frame-alist edges mx my rel-coord string timeout] 13 (#$ . 11521)]) |
|
150 |
#@893 Split STRING into fixed width strings. Return a list of these strings. |
|
151 |
|
|
152 |
WIDTH specifies the width of filling each paragraph. WIDTH nil means use |
|
153 |
the width of currently selected frame. Note that this function doesn't add any |
|
154 |
padding characters at the end of each row. |
|
155 |
|
|
156 |
MARGIN, if non-nil, specifies left margin width which is the number of spece |
|
157 |
characters to add at the beginning of each row. |
|
158 |
|
|
159 |
The optional fourth argument JUSTIFY specifies which kind of justification |
|
160 |
to do: `full', `left', `right', `center', or `none'. A value of t means handle |
|
161 |
each paragraph as specified by its text properties. Omitting JUSTIFY means |
|
162 |
don't perform justification, word wrap and kinsoku shori (禁則処理). |
|
163 |
|
|
164 |
SQUEEZE nil means leave whitespaces other than line breaks untouched. |
|
165 |
|
|
166 |
MAX-ROWS, if given, specifies maximum number of elements of return value. |
|
167 |
The elements exceeding this number are discarded. |
|
168 |
(defalias 'pos-tip-split-string #[(string &optional width margin justify squeeze max-rows) "\306\307!rq\210\310\216 \206 \n\206 \311
\206 \312\313\314\211\314c\210\315ed\"\210\203E \316ed?$\210\202K \317\320\"eb\210`\314\210`{\203e B\202\217
P\321\f\"\211BGGU\204\217 G\314O\211\204e )`dW\322\323!\210\204N \203\250 \324\"\202\252 \237.\n\207" [#1=#:temp-buffer pos-tip-tab-width tab-width width fill-column margin generate-new-buffer " *temp*" #[nil "\301!\205 |