diff options
| author | Gerd Moellmann | 1999-11-04 20:52:05 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-11-04 20:52:05 +0000 |
| commit | a09754e6c6ca945105c1cbfc91d246dab551f501 (patch) | |
| tree | d16972bc7c27a55399e2840c2c5a47ac880814e8 | |
| parent | b7b66466a9e0ec45cd655ee3616716485304fe7c (diff) | |
| download | emacs-a09754e6c6ca945105c1cbfc91d246dab551f501.tar.gz emacs-a09754e6c6ca945105c1cbfc91d246dab551f501.zip | |
(gud-perldb-massage-args): Handle the case "perl -e 0"
the default when invoking perldb in a non-Perl buffer) and other
cases involving -e or --.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/gud.el | 49 |
2 files changed, 47 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29bfa1aeeab..83c1597fb1d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,17 @@ | |||
| 1 | 1999-11-04 John Tobey <jtobey@epsilondev.com> | ||
| 2 | |||
| 3 | * gud.el (gud-perldb-massage-args): Handle the case "perl -e 0", | ||
| 4 | the default when invoking perldb in a non-Perl buffer, and other | ||
| 5 | cases involving -e or --. | ||
| 6 | |||
| 1 | 1999-11-04 Gerd Moellmann <gerd@gnu.org> | 7 | 1999-11-04 Gerd Moellmann <gerd@gnu.org> |
| 2 | 8 | ||
| 9 | * simple.el (previous-matching-history-element) | ||
| 10 | (next-history-element): Use delete-field instead of erase-field. | ||
| 11 | |||
| 12 | * isearch.el (isearch-ring-advance-edit, isearch-complete-edit): | ||
| 13 | Use delete-field instead of erase-field. | ||
| 14 | |||
| 3 | * faces.el (secondary-selection): Change background to yellow. | 15 | * faces.el (secondary-selection): Change background to yellow. |
| 4 | 16 | ||
| 5 | * complete.el (PC-do-completion): Use minibuffer-prompt-end to | 17 | * complete.el (PC-do-completion): Use minibuffer-prompt-end to |
diff --git a/lisp/gud.el b/lisp/gud.el index 036515176ae..2cddf1a3f53 100644 --- a/lisp/gud.el +++ b/lisp/gud.el | |||
| @@ -1184,27 +1184,48 @@ directories if your program contains sources from more than one directory." | |||
| 1184 | ;;; History of argument lists passed to perldb. | 1184 | ;;; History of argument lists passed to perldb. |
| 1185 | (defvar gud-perldb-history nil) | 1185 | (defvar gud-perldb-history nil) |
| 1186 | 1186 | ||
| 1187 | ;; Convert a command line as would be typed normally to run a script | ||
| 1188 | ;; into one that invokes an Emacs-enabled debugging session. | ||
| 1189 | ;; "-d" in inserted as the first switch, and "-emacs" is inserted where | ||
| 1190 | ;; it will be $ARGV[0] (see perl5db.pl). | ||
| 1187 | (defun gud-perldb-massage-args (file args) | 1191 | (defun gud-perldb-massage-args (file args) |
| 1188 | (let (new-args) | 1192 | (let* ((new-args '("-d")) |
| 1193 | (seen-e nil) | ||
| 1194 | (shift (lambda () | ||
| 1195 | (setq new-args (cons (car args) new-args)) | ||
| 1196 | (setq args (cdr args))))) | ||
| 1189 | 1197 | ||
| 1198 | ;; Pass all switches and -e scripts through. | ||
| 1190 | (while (and args | 1199 | (while (and args |
| 1191 | (string-match "^-[^-]" (car args))) | 1200 | (string-match "^-" (car args)) |
| 1192 | (setq new-args (cons (car args) new-args)) | 1201 | (not (equal "-" (car args))) |
| 1193 | (setq args (cdr args))) | 1202 | (not (equal "--" (car args)))) |
| 1194 | 1203 | (when (equal "-e" (car args)) | |
| 1195 | (if args | 1204 | ;; -e goes with the next arg, so shift one extra. |
| 1196 | (progn | 1205 | (or (funcall shift) |
| 1197 | (setq new-args (cons (car args) new-args)) | 1206 | ;; -e as the last arg is an error in Perl. |
| 1198 | (setq args (cdr args))) | 1207 | (error "No code specified for -e.")) |
| 1199 | (setq new-args (cons "--" new-args))) | 1208 | (setq seen-e t)) |
| 1209 | (funcall shift)) | ||
| 1210 | |||
| 1211 | (when (not seen-e) | ||
| 1212 | (if (or (not args) | ||
| 1213 | (string-match "^-" (car args))) | ||
| 1214 | (error "Can't use stdin as the script to debug.")) | ||
| 1215 | ;; This is the program name. | ||
| 1216 | (funcall shift)) | ||
| 1217 | |||
| 1218 | ;; If -e specified, make sure there is a -- so -emacs is not taken | ||
| 1219 | ;; as -e macs. | ||
| 1220 | (if (and args (equal "--" (car args))) | ||
| 1221 | (funcall shift) | ||
| 1222 | (and seen-e (setq new-args (cons "--" new-args)))) | ||
| 1200 | 1223 | ||
| 1201 | (setq new-args (cons "-emacs" new-args)) | 1224 | (setq new-args (cons "-emacs" new-args)) |
| 1202 | |||
| 1203 | (while args | 1225 | (while args |
| 1204 | (setq new-args (cons (car args) new-args)) | 1226 | (funcall shift)) |
| 1205 | (setq args (cdr args))) | ||
| 1206 | 1227 | ||
| 1207 | (cons "-d" (nreverse new-args)))) | 1228 | (nreverse new-args))) |
| 1208 | 1229 | ||
| 1209 | ;; There's no guarantee that Emacs will hand the filter the entire | 1230 | ;; There's no guarantee that Emacs will hand the filter the entire |
| 1210 | ;; marker at once; it could be broken up across several strings. We | 1231 | ;; marker at once; it could be broken up across several strings. We |