• 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

13 ;; This file is part of GNU Emacs.
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
51 ;; Follow the instructions in the INSTALL file of the distribution.
52 ;; In short, put this file on your load path and add the following
53 ;; lines to your .emacs file:
61 ;; The newest version of this file can be found on the maintainers
78 ;; keybindings in the prefix map. There bindings are available anyway - so
96 (require 'comint)
120 :prefix "idlwave-shell"
128 This variable is used to initialize `comint-prompt-regexp' in the
131 This is a fine thing to set in your `.emacs' file."
135 (defcustom idlwave-shell-process-name "idl"
137 process output is made by surrounding this name with `*'s."
181 ;; FIXME: add comint-input-ring-size?
193 (defcustom idlwave-shell-temp-pro-prefix "/tmp/idltemp"
194 "*The prefix for temporary IDL files used when compiling regions.
196 The full temporary file name is obtained by using `make-temp-file'
197 so that the name will be unique among multiple Emacs processes."
207 (defcustom idlwave-shell-prefix-key "\C-c\C-d"
208 "*The prefix key for the debugging map `idlwave-shell-mode-prefix-map'.
214 (defcustom idlwave-shell-activate-prefix-keybindings t
215 "Non-nil means, the debug commands will be bound to the prefix key.
216 The prefix key itself is given in the option `idlwave-shell-prefix-key'.
232 (defcustom idlwave-shell-electric-zap-to-file t
234 file at which point is stopped. This takes point away from the shell
245 "*Non-nil means, use use `file-truename' when looking for buffers.
246 If this variable is non-nil, Emacs will use the function `file-truename' to
247 resolve symbolic links in the file paths printed by e.g., STOP commands.
249 However, when a file is already visited under a different name, IDLWAVE will
252 the same file. However, IDLWAVE no longer makes this mistake, so it is safe
257 (defcustom idlwave-shell-file-name-chars "~/A-Za-z0-9+:_.$#%={}\\- "
258 "The characters allowed in file names, as a string.
259 Used for file name completion. Must not contain `'', `,' and `\"'
271 The command is `C-c C-d C-f' and accepts as a prefix the window nr.
282 :prefix "idlwave-shell"
294 The file `idlwave-shell-command-history-file' is used to save and restore
299 (defcustom idlwave-shell-command-history-file "idlwhist"
300 "The file in which the command history of the idlwave shell is saved.
302 `comint-input-ring-size'.
306 :type 'file)
361 (defcustom idlwave-shell-comint-settings
362 '((comint-scroll-to-bottom-on-input . t)
363 (comint-scroll-to-bottom-on-output . t)
364 (comint-scroll-show-maximum-output . nil)
365 (comint-prompt-read-only . t))
367 "Alist of special settings for the comint variables in the IDLWAVE Shell.
368 Each entry is a cons cell with the name of a variable and a value.
463 :prefix "idlwave-shell"
594 (defvar comint-last-input-start)
595 (defvar comint-last-input-end)
598 (defvar idlwave-shell-temp-pro-file nil
599 "Absolute pathname for temporary IDL file for compiling regions")
601 (defvar idlwave-shell-temp-rinfo-save-file nil
602 "Absolute pathname for temporary IDL file save file for routine_info.
606 (defun idlwave-shell-temp-file (type)
607 "Return a temp file, creating it if necessary.
609 TYPE is either 'pro' or 'rinfo', and `idlwave-shell-temp-pro-file' or
610 `idlwave-shell-temp-rinfo-save-file' is set (respectively)."
613 (or idlwave-shell-temp-rinfo-save-file
614 (setq idlwave-shell-temp-rinfo-save-file
615 (idlwave-shell-make-temp-file idlwave-shell-temp-pro-prefix))))
617 (or idlwave-shell-temp-pro-file
618 (setq idlwave-shell-temp-pro-file
619 (idlwave-shell-make-temp-file idlwave-shell-temp-pro-prefix))))
620 (t (error "Wrong argument (idlwave-shell-temp-file): %s"
621 (symbol-name type)))))
624 (defun idlwave-shell-make-temp-file (prefix)
625 "Create a temporary file."
626 ; Hard coded make-temp-file for Emacs<21
627 (if (fboundp 'make-temp-file)
628 (make-temp-file prefix)
629 (let (file
630 (temp-file-dir (if (boundp 'temporary-file-directory)
631 temporary-file-directory
635 (setq file
636 (make-temp-name
637 (expand-file-name prefix temp-file-dir)))
639 (write-region "" nil file nil 'silent nil)
640 (write-region "" nil file nil 'silent nil 'excl))
642 (file-already-exists t))
643 ;; the file was somehow created by someone else between
644 ;; `make-temp-name' and `write-region', let's try again.
646 file)))
663 (defvar idlwave-shell-last-save-and-action-file nil
664 "The last file which was compiled with `idlwave-shell-save-and-...'.")
681 ;; are reloading this file.
777 The name of the buffer is made by surrounding `idlwave-shell-process-name
779 (concat "*" idlwave-shell-process-name "*"))
804 These are the messages containing file and line information where
815 messages containing file and line information of a current
822 These are IDL messages containing file and line information where
838 ] Go to next breakpoint in file.
839 [ Go to previous breakpoint in file.
853 Examining Expressions (with prefix for examining the region):
895 editing are available via the comint-mode key bindings, by default
903 strings, it completes file names. Abbreviations are also expanded
923 `C-c C-d' prefix are available for most commands in the *idl* buffer
931 line of that procedure file is displayed with an overlay in another
951 Turning on `idlwave-shell-mode' runs `comint-mode-hook' and
968 (unless (file-name-absolute-p idlwave-shell-command-history-file)
969 (setq idlwave-shell-command-history-file
970 (expand-file-name idlwave-shell-command-history-file
974 ;; comint
975 (setq comint-prompt-regexp idlwave-shell-prompt-pattern)
976 (setq comint-process-echoes t)
979 (setq comint-input-autoexpand nil)
980 ; (setq comint-input-ring-size 64)
981 (make-local-variable 'comint-completion-addsuffix)
983 (setq comint-completion-addsuffix '("/" . ""))
984 (setq comint-input-ignoredups t)
986 (setq mode-name "IDL-Shell")
995 mode-name
1023 ;; Make sure comint-last-input-end does not go to beginning of
1025 (set-marker comint-last-input-end (point))
1044 ;; Set the optional comint variables
1045 (when idlwave-shell-comint-settings
1046 (let ((list idlwave-shell-comint-settings) entry)
1051 (unless (memq 'comint-carriage-motion
1052 (default-value 'comint-output-filter-functions))
1054 (add-hook 'comint-output-filter-functions
1061 (goto-char comint-last-output-start)
1065 (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m nil 'local))
1070 (remove-hook 'comint-output-filter-functions 'py-pdbtrack-track-stack-file)
1085 (stringp idlwave-shell-command-history-file))
1086 (set (make-local-variable 'comint-input-ring-file-name)
1087 idlwave-shell-command-history-file)
1088 (if (file-regular-p idlwave-shell-command-history-file)
1089 (comint-read-input-ring)))
1109 "Get the path lists, writing to file unless NO-WRITE is set."
1196 When called with a prefix ARG, or when `idlwave-shell-use-dedicated-frame'
1200 The command to run comes from variable `idlwave-shell-explicit-file-name',
1225 (unless (comint-check-proc (idlwave-shell-buffer))
1226 (let* ((prg (or idlwave-shell-explicit-file-name "idl"))
1227 (buf (apply 'make-comint
1228 idlwave-shell-process-name prg nil
1376 (set-marker comint-last-input-start (point))
1377 (set-marker comint-last-input-end (point))
1378 (comint-simple-send proc cmd)
1398 (comint-send-string proc (char-to-string c)))))
1463 (comint-send-string proc (char-to-string c))))
1468 "When in last line of process buffer, do `comint-previous-input'.
1477 (comint-previous-input arg)
1492 ;; Newer versions of comint.el changed the name of comint-filter to
1493 ;; comint-output-filter.
1494 (defun idlwave-shell-comint-filter (process string) nil)
1495 (if (fboundp 'comint-output-filter)
1496 (fset 'idlwave-shell-comint-filter (symbol-function 'comint-output-filter))
1497 (fset 'idlwave-shell-comint-filter (symbol-function 'comint-filter)))
1501 (eq (process-status idlwave-shell-process-name) 'run))
1526 (if (eq (process-status idlwave-shell-process-name) 'run)
1543 (idlwave-shell-comint-filter proc string))
1589 comint-last-input-end))))
1600 (idlwave-shell-comint-filter proc full-output)
1608 (idlwave-shell-comint-filter
1642 (stringp idlwave-shell-command-history-file))
1644 (comint-write-input-ring)
1667 ;; in module and file names. I am not sure if it will be necessary to
1672 The 1st pair matches the file name, the second pair matches the line
1687 (defvar idlwave-shell-file-line-message
1689 "\\(" ; program name group (1)
1692 "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2)
1693 "\\)" ; end program name group (1)
1700 "\\(" ; file name group (5)
1701 "[^ \t\n]+" ; file names can contain any non-white
1702 "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*" ; continuation lines file name (6)
1705 "*A regular expression to parse out the file name and line number.
1706 The 1st group should match the subroutine name.
1708 The 5th group is the file name.
1710 in IDL5 which inserts random linebreaks in long module and file names.")
1746 ;; Grab the file and line state info.
1761 ;; Grab the file and line state info.
1810 "Parse IDL message for the subroutine, file name and line number."
1813 ;or file names.
1819 ;1. The procedure name can be split and will be restored.
1823 ;This function can still break when the file name ends on an end line
1825 ;the first part of that garbage will be added to the file name.
1827 ;without this last part - thus the function only breaks if file name
1828 ;plus garbage match an existing regular file. This is hopefully very
1834 (let (number procedure file)
1836 (string-match idlwave-shell-file-line-message string))
1839 file (match-string 5 string))
1844 (setq file (idlwave-shell-repair-file-name file))
1846 ;; If we have a file, return the frame list
1847 (if file
1848 (list (idlwave-shell-file-name file)
1851 ;; No success finding a file
1860 (defun idlwave-shell-repair-file-name (file)
1861 "Repair a file name string by taking out all linebreaks.
1863 file name."
1866 (if (string-match "^%" file)
1867 (setq file (substring file 0 (match-beginning 0))))
1869 (while (string-match "[ \t]*\n[ \t]*" file start)
1870 (setq file1 (concat file1 (substring file start (match-beginning 0)))
1872 (setq file2 (concat file1 (substring file start)))
1874 ((file-regular-p file2) file2)
1875 ((file-regular-p file1) file1)
1876 ;; If we cannot veryfy the existence of the file, we return the shorter
1877 ;; name. The idea behind this is that this may be a relative file name
1879 ;; If it is a relative file name, it hopefully is short.
1920 (let ((n (if n (prefix-numeric-value n) 0)))
1955 With prefix ARG, exit without confirmation."
1994 (setq dirs (mapcar 'file-name-as-directory dirs))
1996 (setq sysdir (file-name-as-directory
2004 sep sep-re file type spec specs name cs key keys class entry)
2034 name (nth 0 specs)
2036 file (nth 2 specs)
2043 (setq name (idlwave-sintern-routine-or-method name class t)
2045 file (if (equal file "") nil file)
2057 (cond ((string= name "$MAIN$")) ; ignore this one
2060 (or t (null file)
2061 (not (idlwave-rinfo-assq name 'pro class
2064 ;;(not (idlwave-rinfo-assq name 'pro class
2067 (setq entry (list name 'pro class
2069 (if file
2071 (file-name-nondirectory file)
2073 (file-name-directory file)))))
2075 (if file
2081 (or t (not file)
2082 (not (idlwave-rinfo-assq name 'fun class
2085 ;; (not (idlwave-rinfo-assq name 'fun class
2088 (setq entry (list name 'fun class
2090 (if file
2092 (file-name-nondirectory file)
2094 (file-name-directory file)))))
2096 (if file
2114 (setq default-directory (file-name-as-directory dir))))))
2214 "Complete a file name at point if after a file name.
2215 We assume that we are after a file name when completing one of the
2219 (let ((comint-file-name-chars idlwave-shell-file-name-chars))
2220 (comint-dynamic-complete-as-filename)))
2223 "Return the name of the current executive command, if any."
2231 "Return t if in a string and after what could be a file name."
2234 ;; Skip backwards over file name chars
2235 (skip-chars-backward idlwave-shell-file-name-chars limit)
2244 (skip-chars-backward idlwave-shell-file-name-chars limit)
2333 (set-buffer (idlwave-find-file-noselect (car frame) 'shell))
2345 "Check that frame is for an existing file."
2346 (file-readable-p (car frame)))
2358 "display frame file in other window with overlay arrow.
2360 frame is a list of file name, line number, and subroutine name. if
2379 (error (concat "invalid frame - unable to access file: " (car frame)))
2389 (let* ((buffer (idlwave-find-file-noselect (car frame) 'shell))
2390 (select-shell (equal (buffer-name) (idlwave-shell-buffer)))
2459 (if (or (and idlwave-shell-electric-zap-to-file electric)
2460 (and (equal (buffer-name) (idlwave-shell-buffer))
2466 "Step one source line. If given prefix argument ARG, step ARG source lines."
2477 If given prefix argument ARG, step ARG source lines.
2525 (concat "Okay to recompile file "
2526 (idlwave-shell-bp-get bp 'file) "?")))
2532 (concat ".run \"" (idlwave-shell-bp-get bp 'file) "\"") nil
2567 "Run .GO. This starts the main program of the last compiled file."
2602 "Return a list containing the current file name and line point is in.
2608 (list (idlwave-shell-file-name (buffer-file-name))
2616 "Return the name of the module for the current file.
2617 Returns nil if unable to obtain a module name."
2621 ;; In pro file
2627 (name (idlwave-make-full-name (nth 2 module) (car module)))
2629 (list (upcase name) type)))))))
2691 "Look for a module name near point and set a break point for it.
2698 (name (car module))
2702 (setq module (idlwave-make-full-name class name))
2704 (idlwave-shell-set-bp-in-module name type class))
2708 (defun idlwave-shell-set-bp-in-module (name type class)
2711 (let* ((module (idlwave-make-full-name class name))
2712 (source-file
2717 (nth 3 (idlwave-best-rinfo-assoc name type class
2720 (if (or (not source-file)
2721 (not (file-regular-p source-file))
2723 (or (idlwave-get-buffer-visiting source-file)
2724 (find-file-noselect source-file)))))
2726 (message "The source file for module %s is probably not compiled"
2742 (message "Cannot find module %s in file %s" module source-file)
2792 (file (car frame))
2799 (when (string= file (car (car bp)))
2900 With prefix arg, or if transient mode set and the region is defined,
2903 With double prefix arg ARG prompt for an expression.
3016 (t (symbol-name help))))
3188 ;; seems to be a variable - delimit its name
3273 A breakpoint is a cons cell \(\(file line\) . \(\(index module\) data\)\)
3276 file - full path file name.
3300 Copies the region to a temporary file `idlwave-shell-temp-pro-file'
3301 and issues the IDL .run command for the file. Because the
3307 If there is a prefix argument, display IDL process."
3311 (set-buffer (idlwave-find-file-noselect
3312 (idlwave-shell-temp-file 'pro) 'tmp))
3323 idlwave-shell-temp-pro-file "\"")
3333 If there is a prefix argument, display IDL process.
3344 (if (stringp idlwave-shell-temp-pro-file)
3347 idlwave-shell-temp-pro-file)))
3350 (delete-file idlwave-shell-temp-pro-file))
3352 (if (stringp idlwave-shell-temp-rinfo-save-file)
3354 (delete-file idlwave-shell-temp-rinfo-save-file)
3396 particular value to retrieve. ITEM can be 'file, 'line, 'index,
3403 ((eq item 'file) (nth 0 (car bp)))
3438 "\\s-+\\(Uncompiled\\|" ; 3-6 either uncompiled or routine name
3444 "\\s-+\\(\\S-+\\)")) ; 16 File name
3445 file line index module
3453 indmap '(1 2 3 4))) ;index module line file
3457 indmap '(1 6 2 16)))) ; index module line file
3463 file (idlwave-shell-file-name (match-string (nth 3 indmap))))
3473 (list (cons (list file line)
3509 (cons frame ;; (file line)
3518 If an equivalency is found, return the IDL internal source name.
3521 ((bp-file (idlwave-shell-bp-get bp 'file))
3523 (internal-file-list
3526 (if (and internal-file-list
3527 (equal bp-file (nth 0 internal-file-list)))
3528 (nth 1 internal-file-list)
3529 bp-file)))
3615 considered the new breakpoint if the file name of frame matches."
3627 (equal (idlwave-shell-bp-get (setq bpl (car bpl)) 'file)
3628 (idlwave-shell-bp-get bp 'file)))
3705 (intern (concat (symbol-name type)
3868 Also with prefix arg, ask for the command. You can also use the command
3881 (ring-ref comint-input-ring 0)))
3885 "Save file and run it in IDL.
3886 Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL.
3887 When called from the shell buffer, re-run the file which was last handled by
3893 "Save file and run it in IDL.
3894 Runs `save-buffer' and sends '.COMPILE' command for the associated file to IDL.
3895 When called from the shell buffer, re-compile the file which was last handled by
3901 "Save file and batch it in IDL.
3902 Runs `save-buffer' and sends a '@file' command for the associated file to IDL.
3903 When called from the shell buffer, re-batch the file which was last handled by
3909 "Save file and compile it in IDL.
3910 Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL.
3911 When called from the shell buffer, re-compile the file which was last
3924 (setq idlwave-shell-last-save-and-action-file (buffer-file-name)))
3925 (idlwave-shell-last-save-and-action-file
3927 idlwave-shell-last-save-and-action-file))
3931 (t (setq idlwave-shell-last-save-and-action-file
3932 (read-file-name "File: ")))))
3933 (if (file-regular-p idlwave-shell-last-save-and-action-file)
3941 idlwave-shell-last-save-and-action-file
3944 ,idlwave-shell-last-save-and-action-file)
3947 (let ((msg (format "No such file %s"
3948 idlwave-shell-last-save-and-action-file)))
3949 (setq idlwave-shell-last-save-and-action-file nil)
3952 (defun idlwave-shell-maybe-update-routine-info (&optional wait file)
3959 (idlwave-shell-update-routine-info t nil wait file)))
3968 (module name . (source-file-truename idlwave-internal-filename)).")
3971 "Determine the source file for a given module.
3989 (setcdr old (list (idlwave-shell-file-name filename) filename))
3993 (list (idlwave-shell-file-name filename)
4008 (module name . (source-file-truename idlwave-internal-filename))."
4046 (buffer-substring ; name
4052 (idlwave-shell-file-name internal-filename)
4092 (idlwave-shell-file-name
4111 (defun idlwave-shell-file-name (name)
4112 "If `idlwave-shell-use-truename' is non-nil, convert file name to true name.
4113 Otherwise, just expand the file name."
4118 (file-truename name def-dir)
4119 (expand-file-name name def-dir))))
4123 (defvar idlwave-shell-mode-map (copy-keymap comint-mode-map)
4126 (defvar idlwave-shell-mode-prefix-map (make-sparse-keymap))
4127 (fset 'idlwave-shell-mode-prefix-map idlwave-shell-mode-prefix-map)
4128 (defvar idlwave-mode-prefix-map (make-sparse-keymap))
4129 (fset 'idlwave-mode-prefix-map idlwave-mode-prefix-map)
4136 ;(define-key idlwave-shell-mode-map "\M-?" 'comint-dynamic-list-completions)
4137 ;(define-key idlwave-shell-mode-map "\t" 'comint-dynamic-complete)
4139 (define-key idlwave-shell-mode-map "\C-w" 'comint-kill-region)
4154 (define-key idlwave-shell-mode-map idlwave-shell-prefix-key
4197 ;; If `idlwave-shell-activate-prefix-keybindings' is non-nil, the
4198 ;; first key in the list gets bound the C-c C-d prefix map. If
4258 ;; The regular prefix keymap.
4259 (when (and idlwave-shell-activate-prefix-keybindings k1)
4261 (define-key idlwave-shell-mode-prefix-map k1 cmd))
4262 (define-key idlwave-mode-prefix-map k1 cmd))
4297 ; Enter the prefix map in two places.
4298 (fset 'idlwave-debug-map idlwave-mode-prefix-map)
4299 (fset 'idlwave-shell-debug-map idlwave-shell-mode-prefix-map)
4322 Non-null prefix argument turns on the mode.
4323 Null prefix argument turns off the mode.
4378 buffer-file-name
4407 idlwave-shell-last-save-and-action-file)]
4410 idlwave-shell-last-save-and-action-file)]
4413 idlwave-shell-last-save-and-action-file)]
4556 static char * file[] = {
4574 static char * file[] = {
4593 static char * file[] = {
4612 static char * file[] = {
4631 static char * file[] = {
4650 static char * file[] = {
4669 static char * file[] = {