Browse files

Correctly complete filenames after .R, .RUN, etc.

If not in a quote, do not complete filenames with spaces
Since these are not parsed correctly.
  • Loading branch information...
1 parent 985427d commit acbe01c2a5ae30790eba0d3869a80eeac0f7e6bd @jdtsmith committed Aug 3, 2010
Showing with 6 additions and 6 deletions.
  1. +6 −6 idlw-shell.el
12 idlw-shell.el
@@ -2274,10 +2274,7 @@ keywords."
'(".R" ".RU" ".RUN" ".RN" ".RNE" ".RNEW"
;; We are in a command line with an executive command
- (save-restriction
- ;; Avoid matching the command and following space itself.
- (narrow-to-region (car (cddr exec-cmd)) (point))
- (idlwave-shell-complete-filename)))
+ (idlwave-shell-complete-filename (not (idlwave-in-quote))))
((car-safe exec-cmd)
(setq idlwave-completion-help-info
@@ -2316,13 +2313,16 @@ keywords."
(if entry (setq link (cdr entry)))) ;; setting dynamic variable!!!
(t (error "This should not happen")))))
-(defun idlwave-shell-complete-filename (&optional arg)
+(defun idlwave-shell-complete-filename (&optional nospace)
"Complete a file name at point if after a file name.
We assume that we are after a file name when completing one of the
args of an executive .run, .rnew or .compile."
;; CWD might have changed, resync, to set default directory
- (let ((comint-file-name-chars idlwave-shell-file-name-chars))
+ (let ((comint-file-name-chars
+ (if (and nospace (string-match "[ ]" idlwave-shell-file-name-chars))
+ (replace-match "" nil t idlwave-shell-file-name-chars)
+ idlwave-shell-file-name-chars)))
(defun idlwave-shell-executive-command ()

0 comments on commit acbe01c

Please sign in to comment.