]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/gud.el
(gud-common-init): Use absolute file so that
[gnu-emacs] / lisp / progmodes / gud.el
index dbb1aa8be99e8ba87a6912fca736ee6bbea18f74..f5e6218a432054224c6683ea502cc947b39681f6 100644 (file)
@@ -9,10 +9,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -507,8 +505,6 @@ required by the caller."
        ((memq minor-mode '(gdbmi gdba))
        (erase-buffer)
        (insert "Watch Expressions:\n")
-       (if gdb-speedbar-auto-raise
-           (raise-frame speedbar-frame))
        (let ((var-list gdb-var-list) parent)
          (while var-list
            (let* (char (depth 0) (start 0) (var (car var-list))
@@ -893,7 +889,7 @@ It is passed through FILTER before we look at it."
                    (string-match "^#\\([0-9]+\\) +[0-9a-fx]+ in \\([:0-9a-zA-Z_]+\\) (" e)
                    (string-match "^#\\([0-9]+\\) +\\([:0-9a-zA-Z_]+\\) (" e)))
              (if (not (string-match
-                       "at \\([-0-9a-zA-Z_.]+\\):\\([0-9]+\\)$" e))
+                       "at \\([-0-9a-zA-Z_/.]+\\):\\([0-9]+\\)$" e))
                  nil
                (setcar newlst
                        (list (nth 0 (car newlst))
@@ -905,7 +901,7 @@ It is passed through FILTER before we look at it."
            (setq newlst
                  (cons
                   (if (string-match
-                       "at \\([-0-9a-zA-Z_.]+\\):\\([0-9]+\\)$" e)
+                       "at \\([-0-9a-zA-Z_/.]+\\):\\([0-9]+\\)$" e)
                       (list name num (match-string 1 e)
                             (match-string 2 e))
                     (list name num))
@@ -2506,7 +2502,9 @@ comint mode, which see."
       (if w
          (setcar w
                  (if (file-remote-p default-directory)
-                     (setq file (file-name-nondirectory file))
+                     ;; Tramp has already been loaded if we are here.
+                     (setq file (tramp-file-name-localname
+                                 (tramp-dissect-file-name file)))
                    file))))
     (apply 'make-comint (concat "gud" filepart) program nil
           (if massage-args (funcall massage-args file args) args))
@@ -2689,10 +2687,10 @@ Obeying it means displaying in another window the specified file and line."
         (window (and buffer
                      (or (get-buffer-window buffer)
                          (if (memq gud-minor-mode '(gdbmi gdba))
-                             (or (if (get-buffer-window buffer 0)
-                                     (display-buffer buffer nil 0))
+                             (or (if (get-buffer-window buffer 'visible)
+                                     (display-buffer buffer nil 'visible))
                                  (unless (gdb-display-source-buffer buffer)
-                                   (gdb-display-buffer buffer nil))))
+                                   (gdb-display-buffer buffer nil 'visible))))
                          (display-buffer buffer))))
         (pos))
     (if buffer
@@ -3343,6 +3341,10 @@ ACTIVATEP non-nil means activate mouse motion events."
       (kill-local-variable 'gud-tooltip-mouse-motions-active)
       (kill-local-variable 'track-mouse))))
 
+(defvar tooltip-last-mouse-motion-event)
+(declare-function tooltip-hide "tooltip" (&optional ignored-arg))
+(declare-function tooltip-start-delayed-tip "tooltip" ())
+
 (defun gud-tooltip-mouse-motion (event)
   "Command handler for mouse movement events in `global-map'."
   (interactive "e")
@@ -3377,6 +3379,9 @@ With arg, dereference expr if ARG is positive, otherwise do not derereference."
 
 (define-obsolete-function-alias 'tooltip-gud-toggle-dereference
                                 'gud-tooltip-dereference "22.1")
+(defvar tooltip-use-echo-area)
+(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
+(declare-function tooltip-strip-prompt "tooltip" (process output))
 
 ; This will only display data that comes in one chunk.
 ; Larger arrays (say 400 elements) are displayed in
@@ -3399,6 +3404,8 @@ With arg, dereference expr if ARG is positive, otherwise do not derereference."
        (sdb (concat expr "/"))))
 
 (declare-function gdb-enqueue-input "gdb-ui" (item))
+(declare-function tooltip-expr-to-print "tooltip" (event))
+(declare-function tooltip-event-buffer "tooltip" (event))
 
 (defun gud-tooltip-tips (event)
   "Show tip for identifier or selection under the mouse.
@@ -3424,10 +3431,7 @@ This function must return nil if it doesn't handle EVENT."
          (if (and (eq gud-minor-mode 'gdba)
                   (not gdb-active-process))
              (progn
-               (with-current-buffer
-                   (window-buffer (let ((mouse (mouse-position)))
-                                    (window-at (cadr mouse)
-                                               (cddr mouse))))
+               (with-current-buffer (tooltip-event-buffer event)
                  (let ((define-elt (assoc expr gdb-define-alist)))
                    (unless (null define-elt)
                      (tooltip-show