branch: elpa/popup commit 7817f1ee96f38bfd588621d7e3fbe15df7087ce2 Author: Syohei YOSHIDA <syo...@gmail.com> Commit: Syohei YOSHIDA <syo...@gmail.com>
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))