From 16ec99702c9a785e9c3cbded60b2b920b01d488b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Harald=20J=C3=B6rg?= Date: Fri, 12 Aug 2022 17:15:19 +0200 Subject: [PATCH] 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' --- etc/NEWS | 6 ++++++ lisp/progmodes/gud.el | 13 +++++++------ 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. 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 --- 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. (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) -- 2.39.5