Mercurial > emacs
changeset 26294:b1d85e2a1cae
(gud-perldb-massage-args): Massage correctly in the
presence of perl switches other than "-e".
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 01 Nov 1999 21:10:27 +0000 |
parents | 65861669b393 |
children | d479e0daeb07 |
files | lisp/gud.el |
diffstat | 1 files changed, 20 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/gud.el Mon Nov 01 21:05:14 1999 +0000 +++ b/lisp/gud.el Mon Nov 01 21:10:27 1999 +0000 @@ -1185,13 +1185,26 @@ (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