unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Edebug: not stopping at a function's start. Documentation amendment.
@ 2015-09-21 15:49 Alan Mackenzie
  2015-09-21 19:02 ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Mackenzie @ 2015-09-21 15:49 UTC (permalink / raw)
  To: emacs-devel; +Cc: Paul Pogonyshev

Hello, Emacs.

In bug #21365, Paul Pogonyshev was asking for a feature in Edebug,
whereby execution would not stop at the beginning of an instrumented
function, only at a breakpoint.  I've been wanting this for several
years, too.

It turns out that the feature is already available by setting
`edebug-initial-mode', but is disguised by obscure documentation.  This
documentation describes how the feature is implemented rather than what
the user sees and must do.

I have rewritten the pertinent paragraph in edebug.texi as follows to
fix this, and also moved the paragraph a wee bit higher up.

Any objections to me committing this?



diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi
index 9080bf7..e086be3 100644
--- a/doc/lispref/edebug.texi
+++ b/doc/lispref/edebug.texi
@@ -281,6 +281,15 @@ can still stop the program by typing @kbd{S}, or any editing command.
 In general, the execution modes earlier in the above list run the
 program more slowly or stop sooner than the modes later in the list.
 
+When you enter a new Edebug level, Edebug will normally stop at the
+first instrumented function it encounters.  If you prefer to stop only
+at a break point, or not at all (for example, when gathering coverage
+data), change the value of @code{edebug-initial-mode} from its default
+@code{step} to @code{go} or @code{Go-nonstop}, or one of its other
+values (@pxref{Edebug Options}).  Note that you may reenter the same
+Edebug level several times if, for example, an instrumented function
+is called several times from one command.
+
 While executing or tracing, you can interrupt the execution by typing
 any Edebug command.  Edebug stops the program at the next stop point and
 then executes the command you typed.  For example, typing @kbd{t} during
@@ -300,13 +309,6 @@ executing a keyboard macro outside of Edebug does not affect commands
 inside Edebug.  This is usually an advantage.  See also the
 @code{edebug-continue-kbd-macro} option in @ref{Edebug Options}.
 
-When you enter a new Edebug level, the initial execution mode comes
-from the value of the variable @code{edebug-initial-mode}
-(@pxref{Edebug Options}).  By default, this specifies step mode.  Note
-that you may reenter the same Edebug level several times if, for
-example, an instrumented function is called several times from one
-command.
-
 @defopt edebug-sit-for-seconds
 This option specifies how many seconds to wait between execution steps
 in trace mode or continue mode.  The default is 1 second.


By the way, has anybody any idea why git diff is putting source text on
the same lines as the line numbers?  (I upgraded to git-2.4.9 very
recently).

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: Edebug: not stopping at a function's start. Documentation amendment.
  2015-09-21 15:49 Edebug: not stopping at a function's start. Documentation amendment Alan Mackenzie
@ 2015-09-21 19:02 ` Paul Eggert
  2015-09-22 12:50   ` Alan Mackenzie
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2015-09-21 19:02 UTC (permalink / raw)
  To: Alan Mackenzie, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

On 09/21/2015 08:49 AM, Alan Mackenzie wrote:
> I have rewritten the pertinent paragraph in edebug.texi as follows to
> fix this, and also moved the paragraph a wee bit higher up.

Thanks, looks good.

> By the way, has anybody any idea why git diff is putting source text on
> the same lines as the line numbers?

Git took that idea from GNU diff -p, which puts function names after the 
"@@" in hunk headers.  Git's default function-name-extraction rules 
don't work well for .texi files, though.  I just now installed the 
attached patch, which should improve the situation after you do your 
next ./autogen.sh.  This patch also should improve git diff's handling 
of .el files.

[-- Attachment #2: 0001-Improve-git-diff-hunk-headers-for-.el-.texi.patch --]
[-- Type: text/x-patch, Size: 1610 bytes --]

From 1d170207e4ff99756412057d96099ab917a14d57 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 21 Sep 2015 11:56:01 -0700
Subject: [PATCH] Improve git diff hunk headers for .el, .texi

Problem reported by Alan Mackenzie in:
http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00826.html
* .gitattributes (*.el, *.texi): New patterns.
* autogen.sh: Configure diff.elisp.xfuncname and
diff.texinfo.xfuncname if using Git.
---
 .gitattributes |  4 ++++
 autogen.sh     | 16 ++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/.gitattributes b/.gitattributes
index 21af4e6..ac26a2b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -44,3 +44,7 @@ doc/misc/texinfo.tex -whitespace=blank-at-eol
 *.sig binary
 *.tiff binary
 etc/e/eterm-color binary
+
+# Hooks for non-default diff hunk headers; see autogen.sh.
+*.el diff=elisp
+*.texi diff=texinfo
diff --git a/autogen.sh b/autogen.sh
index bc9c5a0..926915c 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -216,8 +216,20 @@ autoreconf -fi -I m4 || exit $?
 ## cause 'make' to needlessly run 'autoheader'.
 echo timestamp > src/stamp-h.in || exit
 
-## Install Git hooks, if using Git.
-if test -d .git/hooks; then
+
+## Configure Git, if using Git.
+if test -d .git; then
+
+    # Configure 'git diff' hunk header format.
+
+    git config 'diff.elisp.xfuncname' \
+	'^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)' || exit
+    git config 'diff.texinfo.xfuncname' \
+	'^@node[[:space:]]+([^,[:space:]][^,]+)' || exit
+
+
+    # Install Git hooks.
+
     tailored_hooks=
     sample_hooks=
 
-- 
2.1.0


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

* Re: Edebug: not stopping at a function's start. Documentation amendment.
  2015-09-21 19:02 ` Paul Eggert
@ 2015-09-22 12:50   ` Alan Mackenzie
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Mackenzie @ 2015-09-22 12:50 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

Hello, Paul.

On Mon, Sep 21, 2015 at 12:02:19PM -0700, Paul Eggert wrote:
> On 09/21/2015 08:49 AM, Alan Mackenzie wrote:
> > I have rewritten the pertinent paragraph in edebug.texi as follows to
> > fix this, and also moved the paragraph a wee bit higher up.

> Thanks, looks good.

Thank you.  I've committed it.

> > By the way, has anybody any idea why git diff is putting source text on
> > the same lines as the line numbers?

> Git took that idea from GNU diff -p, which puts function names after the 
> "@@" in hunk headers.  Git's default function-name-extraction rules 
> don't work well for .texi files, though.  I just now installed the 
> attached patch, which should improve the situation after you do your 
> next ./autogen.sh.  This patch also should improve git diff's handling 
> of .el files.

It does indeed work for .texi files.

-- 
Alan Mackenzie (Nuremberg, Germany).



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

end of thread, other threads:[~2015-09-22 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 15:49 Edebug: not stopping at a function's start. Documentation amendment Alan Mackenzie
2015-09-21 19:02 ` Paul Eggert
2015-09-22 12:50   ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).