gud.el: invoke 'perldb' with '-E' instead of '-e'
authorHarald Jörg <haj@posteo.de>
Fri, 12 Aug 2022 15:15:19 +0000 (17:15 +0200)
committerHarald Jörg <haj@posteo.de>
Fri, 12 Aug 2022 15:29:20 +0000 (17:29 +0200)
* 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'

etc/NEWS
lisp/progmodes/gud.el

index 2747cec18c5d68d2a869c45b4071c823ec0c657e..be647f6bbbc234992a0d301fe92f2b9101fa4ff3 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1250,6 +1250,12 @@ be used as a file-local variable.
 If given a prefix, it will query the user for an argument to use for
 the run/continue command.
 
+---
+*** 'perldb' now recognizes '-E'
+As of Perl 5.10, 'perl -E 0' behaves like 'perl -e 0' but also activates
+all optional features of the Perl version in use.  'perldb' now uses
+this invocation as its default.
+
 ** Customize
 
 ---
index be43effed7d07d91977df2106126f14b000c9e8e..ccc5720575766dada941780e84eddac4e8d98b55 100644 (file)
@@ -1577,16 +1577,17 @@ into one that invokes an Emacs-enabled debugging session.
         (seen-e nil)
         (shift (lambda () (push (pop args) new-args))))
 
-    ;; Pass all switches and -e scripts through.
+    ;; Pass all switches and -E/-e scripts through.
     (while (and args
                (string-match "^-" (car args))
                (not (equal "-" (car args)))
                (not (equal "--" (car args))))
-      (when (equal "-e" (car args))
+      (when (or (equal "-E" (car args)) (equal "-e" (car args)))
        ;; -e goes with the next arg, so shift one extra.
-       (or (funcall shift)
-           ;; -e as the last arg is an error in Perl.
-           (error "No code specified for -e"))
+       (funcall shift)
+       (or args
+           ;; -E (or -e) as the last arg is an error in Perl.
+           (error "No code specified for %s" (car new-args)))
        (setq seen-e t))
       (funcall shift))
 
@@ -1697,7 +1698,7 @@ The directory containing the perl program becomes the initial
 working directory and source-file directory for your debugger."
   (interactive
    (list (gud-query-cmdline 'perldb
-                           (concat (or (buffer-file-name) "-e 0") " "))))
+                           (concat (or (buffer-file-name) "-E 0") " "))))
 
   (gud-common-init command-line 'gud-perldb-massage-args
                   'gud-perldb-marker-filter)