branch: elpa/popup
commit a651fa0bf412a74659feb30162941fc1b8969048
Merge: de70ea8 7817f1e
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>
Merge pull request #59 from auto-complete/add-unstrip-parameter
Add 'nostrip' parameter to 'popup-tip'(#42)
---
README.md | 6 ++++--
popup.el | 7 +++++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index f1bbbf0..f4b1814 100644
--- a/README.md
+++ b/README.md
@@ -246,17 +246,19 @@ something about what cursor points to.
popup-tip string &key point around width height min-height
truncate margin margin-left margin-right scroll-bar parent
- parent-offset nowait prompt
+ parent-offset nowait nostrip prompt
Show a tooltip with message `STRING` at `POINT`. This function is
synchronized unless `NOWAIT` specified. Almost all arguments are same as
-`popup-create` except for `TRUNCATE`, `NOWAIT`, and `PROMPT`.
+`popup-create` except for `TRUNCATE`, `NOWAIT`, `NOSTRIP` and `PROMPT`.
If `TRUNCATE` is non-nil, the tooltip can be truncated.
If `NOWAIT` is non-nil, this function immediately returns the tooltip
instance without entering event loop.
+If `NOSTRIP` is non-nil, `STRING` properties are not stripped.
+
`PROMPT` is a prompt string used when reading events during the event
loop.
diff --git a/popup.el b/popup.el
index b1f8f2e..74f3faa 100644
--- a/popup.el
+++ b/popup.el
@@ -1004,6 +1004,7 @@ HELP-DELAY is a delay of displaying helps."
parent
parent-offset
nowait
+ nostrip
prompt
&aux tip lines)
"Show a tooltip of STRING at POINT. This function is
@@ -1018,8 +1019,10 @@ tooltip instance without entering event loop.
PROMPT is a prompt string when reading events during event loop."
(if (bufferp string)
(setq string (with-current-buffer string (buffer-string))))
- ;; TODO strip text (mainly face) properties
- (setq string (substring-no-properties string))
+
+ (unless nostrip
+ ;; TODO strip text (mainly face) properties
+ (setq string (substring-no-properties string)))
(and (eq margin t) (setq margin 1))
(or margin-left (setq margin-left margin))