X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/8c74a125c85da08e34dceedb271b71b5f09ce690..84b6d3df1ad4f84faaf2bdf511f184ae1716762e:/lisp/tooltip.el diff --git a/lisp/tooltip.el b/lisp/tooltip.el index 9d0fbaae9d..657951d7b7 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el @@ -1,6 +1,6 @@ ;;; tooltip.el --- show tooltip windows -;; Copyright (C) 1997, 1999-2012 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1999-2013 Free Software Foundation, Inc. ;; Author: Gerd Moellmann ;; Keywords: help c mouse tools @@ -25,6 +25,8 @@ ;;; Code: +(require 'syntax) + (defvar comint-prompt-regexp) (defgroup tooltip nil @@ -149,7 +151,7 @@ This variable is obsolete; instead of setting it to t, disable :group 'tooltip) (make-obsolete-variable 'tooltip-use-echo-area - "disable Tooltip mode instead" "24.1") + "disable Tooltip mode instead" "24.1" 'set) ;;; Variables that are not customizable. @@ -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)))))))