• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/progmodes/

Lines Matching +defs:comint +defs:file +defs:name +defs:prefix

10 ;; This file is part of GNU Emacs.
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
32 ;; Warsaw <bwarsaw@cen.com> hacked the mode to use comint.el. Shane Hartman
45 (require 'comint)
50 (defvar gdb-server-prefix)
66 (defcustom gud-key-prefix "\C-x\C-a"
71 (global-set-key (concat gud-key-prefix "\C-l") 'gud-refresh)
76 (defvar gud-find-file nil)
77 (put 'gud-find-file 'permanent-local t)
85 (defvar gud-comint-buffer nil)
133 (with-current-buffer gud-comint-buffer
134 (if (string-equal gud-target-name "emacs")
135 (comint-stop-subjob)
136 (comint-interrupt-subjob))))
185 'gud-target-name gud-comint-buffer) "emacs")
213 :name "Gud")
254 ([menu-bar file] . undefined))))
262 ;; Will inherit from comint-mode via define-derived-mode.
292 (defun gud-file-name (f)
293 "Transform a relative file name to an absolute file name.
295 (if (file-exists-p f) (expand-file-name f)
299 (let ((path (expand-file-name f (car directories))))
300 (if (file-exists-p path)
306 (defun gud-find-file (file)
307 ;; Don't get confused by double slashes in the name that comes from GDB.
308 (while (string-match "//+" file)
309 (setq file (replace-match "/" t t file)))
311 (buf (funcall (or gud-find-file 'gud-file-name) file)))
313 (setq buf (and (file-readable-p buf) (find-file-noselect buf 'nowarn))))
339 ;; GUD prefix.
346 %f -- Name (without directory) of current source file.
347 %F -- Name (without directory or extension) of current source file.
348 %d -- Directory of current source file.
353 %c -- Fully qualified class name derived from the expression
356 The `current' source file is the file of the current buffer (if
357 we're in a C file) or the source file current at the last break or
360 source file) or the source line number at the last break or step (if
370 ,(if key `(global-set-key (vconcat gud-key-prefix ,key) ',func))))
387 ;;<name>
388 ;; comint-prompt-regexp
389 ;; gud-<name>-massage-args
390 ;; gud-<name>-marker-filter
391 ;; gud-<name>-find-file
396 ;; The job of the marker-filter method is to detect file/line markers in
403 ;; The job of the find-file method is to visit and return the buffer indicated
404 ;; by the car of gud-tag-frame. This may be a file name, a tag name, or
414 t means that there is no stack, and we are in display-file mode.")
450 :visible (not (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
453 :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
456 :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
460 :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
472 (gud-speedbar-buttons gud-comint-buffer))
479 (when (and gud-comint-buffer
480 ;; gud-comint-buffer might be killed
481 (buffer-name gud-comint-buffer))
499 0 (length expr) 'face font-lock-variable-name-face expr)
575 'speedbar-file-face
593 (defcustom gud-gdb-command-name "gdb --annotate=3"
684 '(("\C-i" . comint-dynamic-complete-filename))
690 (cmd-name (gud-val 'command-name minor-mode)))
695 (concat (or cmd-name (symbol-name minor-mode))
698 (let ((file nil))
699 (dolist (f (directory-files default-directory) file)
700 (if (and (file-executable-p f)
701 (not (file-directory-p f))
702 (or (not file)
703 (file-newer-than-file-p f file)))
704 (setq file f)))))))
717 directory and source-file directory for your debugger. By
724 `gud-gdb-command-name' for all future sessions. You need to use
729 (when (and gud-comint-buffer
730 (buffer-name gud-comint-buffer)
731 (get-buffer-process gud-comint-buffer)
732 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
767 (setq comint-prompt-regexp "^(.*gdb[+]?) *")
768 (setq paragraph-start comint-prompt-regexp)
799 (setq command (buffer-substring (comint-line-beginning-position) end))))
834 ;; Let comint handle the rest.
835 (comint-dynamic-simple-complete command-word complete-list)))
849 (if (string-match comint-prompt-regexp string)
889 (let ((name nil) (num nil))
902 name (match-string 2 e))
907 (list name num (match-string 1 e)
909 (list name num))
921 (with-current-buffer gud-comint-buffer
922 (if (and (eq gud-comint-buffer buffer)
926 (not (looking-at comint-prompt-regexp))))
941 (accept-process-output (get-buffer-process gud-comint-buffer)))
952 (defvar gud-sdb-needs-tags (not (file-exists-p "/var"))
998 (defun gud-sdb-find-file (f)
999 (if gud-sdb-needs-tags (find-tag-noselect f) (find-file-noselect f)))
1005 and source-file directory for your debugger."
1010 (not (and (boundp 'tags-file-name)
1011 (stringp tags-file-name)
1012 (file-exists-p tags-file-name))))
1015 (gud-common-init command-line nil 'gud-sdb-marker-filter 'gud-sdb-find-file)
1027 (setq comint-prompt-regexp "\\(^\\|\n\\)\\*")
1028 (setq paragraph-start comint-prompt-regexp)
1044 The file names should be absolute, or relative to the directory
1051 (defun gud-dbx-massage-args (file args)
1066 "stopped in .* at line \\([0-9]*\\) in file \"\\([^\"]*\\)\""
1069 "signal .* in .* at line \\([0-9]*\\) in file \"\\([^\"]*\\)\""
1100 (defvar gud-dbx-command-name
1150 ;; The dbx in IRIX is a pain. It doesn't print the file name when
1153 ;; to be with a `file' command, although the current line number is
1157 ;; `printf' and `file' commands as a pseudo marker which we can
1159 ;; the gdb marker but you can't get the file name without a newline...
1200 (if (or (string-match comint-prompt-regexp string)
1214 ;; prod dbx into printing out the line number and file
1215 ;; name in a form we can grok as below
1216 (process-send-string (get-buffer-process gud-comint-buffer)
1217 "printf \"\032\032%1d:\",(int)$curline;file\n"))
1224 (let ((file (match-string 1 result)))
1225 (if (file-exists-p file)
1232 (let ((file (gud-file-name (match-string 2 result))))
1233 (if (and file (file-exists-p file))
1235 (cons file
1249 ;; (0) Stopped at line 10, routine main(argc=1, argv=0xeffff0e0), file t.c
1254 ;; Stopped at line 13, routine main(argc=1, argv=0xeffff0e0), file t.c
1258 ;; Frame 21, line 974, routine command_loop(), file keyboard.c
1267 " line \\([0-9]+\\), routine .*, file \\([^ \t\n]+\\)"))
1293 and source-file directory for your debugger."
1322 (gud-def gud-up "up %p; printf \"\032\032%1d:\",(int)$curline;file\n"
1324 (gud-def gud-down "down %p; printf \"\032\032%1d:\",(int)$curline;file\n"
1327 (process-send-string (get-buffer-process gud-comint-buffer)
1328 "printf \"\032\032%1d:\",(int)$curline;file\n"))
1332 (gud-def gud-break "file \"%d%f\"\nstop at %l"
1335 (process-send-string (get-buffer-process gud-comint-buffer)
1347 (setq comint-prompt-regexp "^[^)\n]*dbx) *")
1348 (setq paragraph-start comint-prompt-regexp)
1364 The file names should be absolute, or relative to the directory
1371 (defun gud-xdb-massage-args (file args)
1383 (if (or (string-match comint-prompt-regexp string)
1394 (file (gud-file-name (match-string 1 result))))
1395 (if file
1396 (setq gud-last-frame (cons file line))))))
1403 and source-file directory for your debugger.
1425 (setq comint-prompt-regexp "^>")
1426 (setq paragraph-start comint-prompt-regexp)
1436 (defun gud-perldb-massage-args (file args)
1463 ;; This is the program name.
1526 (defcustom gud-perldb-command-name "perl -d"
1535 and source-file directory for your debugger."
1538 (concat (or (buffer-file-name) "-e 0") " "))))
1556 (setq comint-prompt-regexp "^ DB<+[0-9]+>+ ")
1557 (setq paragraph-start comint-prompt-regexp)
1568 ;; Either file or function name may be omitted: "> <string>(0)?()"
1571 (defvar gud-pdb-marker-regexp-file-group 1)
1593 (let ((file (match-string gud-pdb-marker-regexp-file-group
1598 (if (string-equal file "<string>")
1600 (cons file line)))
1632 (defcustom gud-pdb-command-name "pdb"
1633 "File name for executing the Python debugger.
1634 This should be an executable on your path, or an absolute file name."
1642 and source-file directory for your debugger."
1661 ;; (setq comint-prompt-regexp "^(.*pdb[+]?) *")
1662 (setq comint-prompt-regexp "^(Pdb) *")
1663 (setq paragraph-start comint-prompt-regexp)
1688 ;; type any jdb switches followed by the name of the class you'd like to debug.
1690 ;; for the name of the class to debug (e.g. "COM.the-kind.ddavies.CoolClass").
1740 ;; every file ending in ".java" in these directories parses without error.
1749 ;; defined by which .java file without analyzing all the .java files.
1750 ;; If anyone knows why JavaSoft didn't put the source file names in
1757 (defcustom gud-jdb-command-name "jdb"
1765 The file pathname is obtained by converting the fully qualified
1807 source file information.")
1813 ;; List of Java source file directories.
1816 The file names should be absolute, or relative to the current
1823 file from which the class originated. This allows gud mode to keep
1829 ;; Association list of fully qualified class names (package + class name)
1834 ;; This is used to hold a source file during analysis.
1846 (when (file-directory-p d)
1959 ;; Find the package and class definitions in Java source file FILE. Assumes
1962 (defun gud-jdb-analyze-source (buf file)
1965 (insert-file-contents file nil nil nil t)
2034 (message "Error parsing file %s." file)
2038 (defun gud-jdb-build-class-source-alist-for-file (file)
2041 (cons c file))
2042 (gud-jdb-analyze-source gud-jdb-analysis-buffer file)))
2053 'gud-jdb-build-class-source-alist-for-file
2060 (defun gud-jdb-massage-args (file args)
2101 ;; Search for an association with P, a fully qualified class name, in
2103 ;; qualified file name of the source file which produced the class.
2104 (defun gud-jdb-find-source-file (p)
2111 "Find source file corresponding to fully qualified class p.
2116 (;; Replace dots with slashes and append ".java" to generate file
2117 ;; name relative to classpath
2123 ;; name string. These start with a "$"
2131 found-file)
2133 (not (setq found-file
2134 (file-readable-p
2137 (if found-file (concat (car cplist) "/" filename)))))
2141 Set to `gud-jdb-find-source-using-classpath' or `gud-jdb-find-source-file'
2150 (mapcar 'file-truename
2180 (let (file-found)
2219 ;; 1) does not have a "[n] " prefix (not part of a stack backtrace)
2220 ;; 2) does have an "[n] " prefix and n is the lowest prefix seen
2225 ;; (<file-name> . <line-number>) .
2235 (if (setq file-found
2238 (cons file-found
2245 (message "Could not find source file.")))
2250 (if (string-match comint-prompt-regexp gud-marker-acc)
2254 ;; file information is not within the last 3/4
2264 (defvar gud-jdb-command-name "jdb" "Command that executes the Java debugger.")
2276 original source file access method.
2319 (setq comint-prompt-regexp "^> \\|^[^ ]+\\[[0-9]+\\] ")
2320 (setq paragraph-start comint-prompt-regexp)
2332 ;; as the source file list.
2338 (fset 'gud-jdb-find-source 'gud-jdb-find-source-file)))
2356 ;; source file to set a breakpoint, we want the buffer to end up like
2360 ;; Breakpoint 1 at 0x92: file make-docfile.c, line 49.
2392 (define-derived-mode gud-mode comint-mode "Debugger"
2404 \\[gud-break] sets a breakpoint at the current file and line. In the
2405 GUD buffer, the current file and line are those of the last breakpoint or
2406 step. In a source buffer, they are the buffer's file and current line.
2408 \\[gud-remove] removes breakpoints on the current file and line.
2415 and then update the source window with the current file and position.
2435 with the prefix C-c, and in all buffers through the prefix C-x C-a.
2438 themselves the appropriate number of times if you give a prefix
2445 comint mode, which see."
2450 (make-local-variable 'comint-prompt-regexp)
2452 (set (make-local-variable 'comint-input-ignoredups) t)
2466 (defvar gud-target-name "--unknown--"
2467 "The apparent name of the program being debugged in a gud buffer.")
2475 &optional find-file)
2479 ;; Extract the file name from WORDS
2481 ;; Later on we will put the modified file name arg back there.
2482 (file-word (let ((w (cdr words)))
2488 (file-subst
2489 (and file-word (substitute-in-file-name file-word)))
2491 ;; If a directory was specified, expand the file name.
2493 ;; A file name without directory is literally valid
2494 ;; only if the file exists in ., and in that case,
2496 (file (and file-word
2497 (if (file-name-directory file-subst)
2498 (expand-file-name file-subst)
2499 file-subst)))
2500 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
2507 ;; Set default-directory to the file's directory.
2508 (and file-word
2511 ;; In that case, either the file is found in the current directory,
2515 (file-name-directory file)
2516 (setq default-directory (file-name-directory file)))
2519 ;; Put the substituted and expanded file name back in its place.
2524 (setcar w file)))
2525 (apply 'make-comint (concat "gud" filepart) program nil
2526 (if massage-args (funcall massage-args file args) args))
2527 ;; Since comint clobbered the mode, we don't set it until now.
2529 (set (make-local-variable 'gud-target-name)
2530 (and file-word (file-name-nondirectory file))))
2532 (if find-file (set (make-local-variable 'gud-find-file) find-file))
2542 (setq gud-comint-buffer (current-buffer))))
2555 (if (buffer-name (process-buffer proc))
2579 (comint-update-fence)
2581 ;; Save the process output, checking for source file markers.
2584 ;; Don't display the specified file
2592 ;; Let the comint filter do the actual insertion.
2593 ;; That lets us inherit various comint features.
2594 (comint-output-filter proc output))
2598 ;; in case the source file is our current buffer.
2617 (cond ((null (buffer-name (process-buffer proc)))
2619 ;; Stop displaying an arrow in a source file.
2623 (string-equal speedbar-initial-expansion-list-name "GUD"))
2625 speedbar-previously-used-expansion-list-name))
2630 ;; Stop displaying an arrow in a source file.
2632 (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
2646 (symbol-name (process-status proc))))
2649 (insert ?\n mode-name " " msg)
2652 (insert ?\n mode-name " " msg)))
2669 (unless (eq buffer gud-comint-buffer)
2677 Obeying it means displaying in another window the specified file and line."
2685 ;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen
2692 (defun gud-display-line (true-file line)
2695 (with-current-buffer gud-comint-buffer
2696 (gud-find-file true-file)))
2706 (unless (or (verify-visited-file-modtime buffer) gud-keep-buffer)
2709 (buffer-name)))
2741 (let ((insource (not (eq (current-buffer) gud-comint-buffer)))
2751 (setq subst (file-name-nondirectory (if insource
2752 (buffer-file-name)
2755 (setq subst (file-name-sans-extension
2756 (file-name-nondirectory (if insource
2757 (buffer-file-name)
2760 (setq subst (file-name-directory (if insource
2761 (buffer-file-name)
2779 (buffer-file-name)
2824 (let ((proc (get-buffer-process gud-comint-buffer)))
2828 (set-buffer gud-comint-buffer)
2836 (if (looking-at comint-prompt-regexp)
2839 (apply comint-input-sender (list proc command))
2863 (with-current-buffer gud-comint-buffer
2865 (goto-char (process-mark (get-buffer-process gud-comint-buffer)))
2867 (when (looking-at comint-prompt-regexp)
2870 (unless (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
3016 "Find fully qualified class in file F at line LINE.
3018 `gud-jdb-sourcepath') list(s) to derive a file
3021 pathname standards using file-truename.
3025 class of the file (using s to separate nested class ids)."
3030 (fbuffer (get-file-buffer f))
3032 (setq f (file-name-sans-extension (file-truename f)))
3052 (if (and fbuffer (equal (symbol-file 'java-mode) "cc-mode"))
3072 ;; definition. Find class name
3088 (message "gud-find-class: class for file %s not found!" f))
3094 (message "gud-find-class: class for file %s not found in gud-jdb-class-source-alist!" f)
3111 '(("^define\\s-+\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-function-name-face))
3112 ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face))
3255 (if (and gud-comint-buffer
3256 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
3257 (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
3262 (unless (eq buffer gud-comint-buffer)
3266 (buffer-name))))
3371 (> (prefix-numeric-value arg) 0)))
3410 gud-comint-buffer
3411 (buffer-name gud-comint-buffer); might be killed
3412 (setq process (get-buffer-process gud-comint-buffer))
3444 gdb-server-prefix "macro expand " expr "\n")