summaryrefslogtreecommitdiff
path: root/lisp/tooltip.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2012-08-14 21:48:39 +0300
committerEli Zaretskii <eliz@gnu.org>2012-08-14 21:48:39 +0300
commitba025fbd446b8c72735617713a0f0037388ae3f4 (patch)
treefcbdd4b55fe00ca6aec347a61f9b76acf69fcc5a /lisp/tooltip.el
parent9b8d51650b04c184e53c1c5dc703bb11eed7317e (diff)
downloademacs-ba025fbd446b8c72735617713a0f0037388ae3f4.tar.gz
Fix and improve GUD Tooltip mode.
lisp/tooltip.el (tooltip-identifier-from-point): Don't treat tokens inside comments and strings as identifiers. lisp/progmodes/gud.el (gud-tooltip-print-command): Quote the expression to evaluate. This allows to evaluate expressions with embedded whitespace. (gud-tooltip-tips): Add a blank before the newline in the message-box text, for the benefit of message-box emulation on MS-Windows. lisp/progmodes/gdb-mi.el (gdb-tooltip-print): Don't ignore error messages from GDB, pop them up in a tooltip to give feedback to user. (gdb-tooltip-print-1): Quote the expression to evaluate. This allows to evaluate expressions with embedded whitespace. (gdb-inferior-io--init-proc): Don't send "-inferior-tty" command if the TTY name is nil or empty (which happens when communicating with the inferior via pipes, e.g. on MS-Windows). (gdb-internals): If GDB sends a "&\n" empty debugging message, don't send that to the GUD buffer. doc/emacs/building.texi (Debugger Operation): Correct and improve documentation of the GUD Tooltip mode.
Diffstat (limited to 'lisp/tooltip.el')
-rw-r--r--lisp/tooltip.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 9d0fbaae9d8..a57054acdd6 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -25,6 +25,8 @@
;;; Code:
+(require 'syntax)
+
(defvar comint-prompt-regexp)
(defgroup tooltip nil
@@ -277,8 +279,11 @@ Value is nil if no identifier exists at point. Identifier extraction
is based on the current syntax table."
(save-excursion
(goto-char point)
- (let ((start (progn (skip-syntax-backward "w_") (point))))
- (unless (looking-at "[0-9]")
+ (let* ((start (progn (skip-syntax-backward "w_") (point)))
+ (pstate (syntax-ppss)))
+ (unless (or (looking-at "[0-9]")
+ (nth 3 pstate)
+ (nth 4 pstate))
(skip-syntax-forward "w_")
(when (> (point) start)
(buffer-substring start (point)))))))