all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* perldb and gud-print
@ 2003-09-11 19:06 Mario Lang
  2003-09-17 19:06 ` Nick Roberts
  0 siblings, 1 reply; 2+ messages in thread
From: Mario Lang @ 2003-09-11 19:06 UTC (permalink / raw)


Hi.

While playing with M-x perldb, I noticed that gud-print (C-x C-a C-p)
currently evaluates the expression at point, rather than printing the result
of evaluating it.  Just evaluating an expression is not very useful
since as long as the expression has no side-effects, no output is produced
in the GUD buffer.  If C-x C-a C-p would actually print the result of
evaluating the expression, one could simply place point on some variable
name in the source-buffer and execute gud-print to see the current value
of that variable.  With the current version of gud-print, simply no
output is generated at all.

Is there any reason why gud-print should not print the result of evaluating
the expression with perldb?  If not, please install attached patch.

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.5383
diff -u -r1.5383 ChangeLog
--- lisp/ChangeLog	10 Sep 2003 20:09:17 -0000	1.5383
+++ lisp/ChangeLog	11 Sep 2003 18:44:32 -0000
@@ -1,3 +1,8 @@
+2003-09-11  Mario Lang  <mlang@delysid.org>
+
+	* progmodes/gud.el (perldb): Change gud-print from just "%e" to "p %e"
+	to actually print the expression at point, not just evaluate it.
+
 2003-09-10  Mario Lang  <mlang@delysid.org>
 
 	* battery.el: Update Commentary and Copyright.
Index: lisp/progmodes/gud.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/gud.el,v
retrieving revision 1.6
diff -u -r1.6 gud.el
--- lisp/progmodes/gud.el	1 Sep 2003 15:45:35 -0000	1.6
+++ lisp/progmodes/gud.el	11 Sep 2003 18:44:39 -0000
@@ -1261,7 +1261,7 @@
 ;  (gud-def gud-finish "finish"       "\C-f" "Finish executing current function.")
 ;  (gud-def gud-up     "up %p"        "<" "Up N stack frames (numeric arg).")
 ;  (gud-def gud-down   "down %p"      ">" "Down N stack frames (numeric arg).")
-  (gud-def gud-print  "%e"           "\C-p" "Evaluate perl expression at point.")
+  (gud-def gud-print  "p %e"           "\C-p" "Evaluate perl expression at point.")
 
   (setq comint-prompt-regexp "^  DB<+[0-9]+>+ ")
   (setq paragraph-start comint-prompt-regexp)

-- 
Thanks,
  Mario | Debian Developer <URL:http://debian.org/>
        | Get my public key via finger mlang@db.debian.org
        | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44

^ permalink raw reply	[flat|nested] 2+ messages in thread

* perldb and gud-print
  2003-09-11 19:06 perldb and gud-print Mario Lang
@ 2003-09-17 19:06 ` Nick Roberts
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Roberts @ 2003-09-17 19:06 UTC (permalink / raw)
  Cc: emacs-devel


 > Is there any reason why gud-print should not print the result of evaluating
 > the expression with perldb?  If not, please install attached patch.

I have installed this patch. Note, however, that gud-print in perldb uses
gud-find-c-expr to parse the expression. This means that: 

1) Scalars like, $days, are parsed correctly (I've just discovered that this
is a valid name for a data type in C).

2) Array elements, like, $days[28] are paresed correctly.

3) Entire arrays like, @days, are not parsed correctly.

4) Entire hashes like, %days, and single values like, $days{'Feb'}, are not
   parsed correctly.

I have written a function, gud-find-fortran-expr (with some help) for
Fortran. Would you like to write a 'gud-find-perl-expr' to make a better
job of parsing Perl expressions? (Not trivial!)

Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-17 19:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-11 19:06 perldb and gud-print Mario Lang
2003-09-17 19:06 ` Nick Roberts

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.