From: Gerd Moellmann Date: Mon, 1 Nov 1999 21:10:27 +0000 (+0000) Subject: (gud-perldb-massage-args): Massage correctly in the X-Git-Tag: emacs-pretest-21.0.90~6216 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f2eb772dca330671a1f88847f0ce8d64e5b5c6ca;p=emacs.git (gud-perldb-massage-args): Massage correctly in the presence of perl switches other than "-e". --- diff --git a/lisp/gud.el b/lisp/gud.el index edf4d028f05..036515176ae 100644 --- a/lisp/gud.el +++ b/lisp/gud.el @@ -1185,13 +1185,26 @@ directories if your program contains sources from more than one directory." (defvar gud-perldb-history nil) (defun gud-perldb-massage-args (file args) - (cond ((equal (car args) "-e") - (cons "-d" - (cons (car args) - (cons (nth 1 args) - (cons "--" (cons "-emacs" (cdr (cdr args)))))))) - (t - (cons "-d" (cons (car args) (cons "-emacs" (cdr args))))))) + (let (new-args) + + (while (and args + (string-match "^-[^-]" (car args))) + (setq new-args (cons (car args) new-args)) + (setq args (cdr args))) + + (if args + (progn + (setq new-args (cons (car args) new-args)) + (setq args (cdr args))) + (setq new-args (cons "--" new-args))) + + (setq new-args (cons "-emacs" new-args)) + + (while args + (setq new-args (cons (car args) new-args)) + (setq args (cdr args))) + + (cons "-d" (nreverse new-args)))) ;; There's no guarantee that Emacs will hand the filter the entire ;; marker at once; it could be broken up across several strings. We