aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Jörg2022-08-12 17:15:19 +0200
committerHarald Jörg2022-08-12 17:29:20 +0200
commit16ec99702c9a785e9c3cbded60b2b920b01d488b (patch)
tree9cb244a3f90d47b1d657f009e57a1b411948bd0f
parente0045ba2bce11bb4cf93210c8ff1588b0893b74b (diff)
downloademacs-16ec99702c9a785e9c3cbded60b2b920b01d488b.tar.gz
emacs-16ec99702c9a785e9c3cbded60b2b920b01d488b.zip
gud.el: invoke 'perldb' with '-E' instead of '-e'
* lisp/progmodes/gud.el (gud-perldb-massage-args): Allow '-E' switch and use it as a default in favor of '-e' * etc/NEWS ('perldb' now recognizes '-E') New entry in section 'Gud'
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/progmodes/gud.el13
2 files changed, 13 insertions, 6 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 2747cec18c5..be647f6bbbc 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1250,6 +1250,12 @@ be used as a file-local variable.
1250If given a prefix, it will query the user for an argument to use for 1250If given a prefix, it will query the user for an argument to use for
1251the run/continue command. 1251the run/continue command.
1252 1252
1253---
1254*** 'perldb' now recognizes '-E'
1255As of Perl 5.10, 'perl -E 0' behaves like 'perl -e 0' but also activates
1256all optional features of the Perl version in use. 'perldb' now uses
1257this invocation as its default.
1258
1253** Customize 1259** Customize
1254 1260
1255--- 1261---
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index be43effed7d..ccc57205757 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1577,16 +1577,17 @@ into one that invokes an Emacs-enabled debugging session.
1577 (seen-e nil) 1577 (seen-e nil)
1578 (shift (lambda () (push (pop args) new-args)))) 1578 (shift (lambda () (push (pop args) new-args))))
1579 1579
1580 ;; Pass all switches and -e scripts through. 1580 ;; Pass all switches and -E/-e scripts through.
1581 (while (and args 1581 (while (and args
1582 (string-match "^-" (car args)) 1582 (string-match "^-" (car args))
1583 (not (equal "-" (car args))) 1583 (not (equal "-" (car args)))
1584 (not (equal "--" (car args)))) 1584 (not (equal "--" (car args))))
1585 (when (equal "-e" (car args)) 1585 (when (or (equal "-E" (car args)) (equal "-e" (car args)))
1586 ;; -e goes with the next arg, so shift one extra. 1586 ;; -e goes with the next arg, so shift one extra.
1587 (or (funcall shift) 1587 (funcall shift)
1588 ;; -e as the last arg is an error in Perl. 1588 (or args
1589 (error "No code specified for -e")) 1589 ;; -E (or -e) as the last arg is an error in Perl.
1590 (error "No code specified for %s" (car new-args)))
1590 (setq seen-e t)) 1591 (setq seen-e t))
1591 (funcall shift)) 1592 (funcall shift))
1592 1593
@@ -1697,7 +1698,7 @@ The directory containing the perl program becomes the initial
1697working directory and source-file directory for your debugger." 1698working directory and source-file directory for your debugger."
1698 (interactive 1699 (interactive
1699 (list (gud-query-cmdline 'perldb 1700 (list (gud-query-cmdline 'perldb
1700 (concat (or (buffer-file-name) "-e 0") " ")))) 1701 (concat (or (buffer-file-name) "-E 0") " "))))
1701 1702
1702 (gud-common-init command-line 'gud-perldb-massage-args 1703 (gud-common-init command-line 'gud-perldb-massage-args
1703 'gud-perldb-marker-filter) 1704 'gud-perldb-marker-filter)