unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Mirko" <mvukovic@nycap.rr.com>
Subject: Re: yasq: unable to edebug-defun
Date: 15 Dec 2006 07:55:44 -0800	[thread overview]
Message-ID: <1166198144.214233.78100@73g2000cwn.googlegroups.com> (raw)
In-Reply-To: <1166188617.839990.291590@j72g2000cwa.googlegroups.com>


Robert Thorpe wrote:
> Mirko wrote:
> > hello,
> >
> > This could be due to my incompetence, senility or just lack of emacs
> > knowledge: I cannot compile my defun's.  If I try to do either M-C-x or
> > C-u M-C-x, emacs tries to evaluate the defun in which my cursor
> > resides, instead of compiling it.
>
> That's the normal behaviour M-C-x evals a defun, which means it stores
> the code for the function inside emacs.
> C-u M-C-x evaluates it also instrumenting it for edebug.
>
> > I tried also M-x edebug-defun, but then the debugger immediately tries
> > to step through the function instead of instrumenting it.
>
> The debugger should not be triggered immediately.
> Maybe you have the wrong number of parenthesis in the buffer you're
> using, try turning on show-paren-mode to check.
>
> You have to have point at the end of some function Like
> (defun foo () (print "bar"))POINT then hit M-C-x.
>
> Bytecode compilation is only used through byte-compile-file normally.

Robert,

I tried your suggestions, and (other than learning about the
show-paren-mode) no luck.

Here is my example defun (this is for example only, I get similar
behavior with other defuns)

(defun map-to-buffer (map buffer)
(interactive)
(switch-to-buffer buffer)
(save-excursion
  (save-window-excursion
    (save-match-data
      (widen)
      (goto-char (point-min))
      (insert "\\begin{document}\n"
      (dump-map map)
      (goto-char (point-max))
      (insert "\n\\end{document")
      (indent-region (point-min) (point-max) nil)
      )))))

If I put it into *scratch* to avoid interference with other dangling
parenthesis (which I did not find) and put the point after the last
parenthesis and do M-C-x, I get:
Debugger entered--Lisp error: (void-variable map)
  (dump-map map)
  (insert "\\begin{document}\n" (dump-map map) (goto-char (point-max))
(insert "\n\\end{document") (indent-region (point-min) (point-max)
nil))
  (progn (widen) (goto-char (point-min)) (insert "\\begin{document}\n"
(dump-map map) (goto-char ...) (insert "\n\\end{document")
(indent-region ... ... nil)))
  (unwind-protect (progn (widen) (goto-char ...) (insert
"\\begin{document}\n" ... ... ... ...)) (set-match-data
save-match-data-internal (quote evaporate)))
  (let ((save-match-data-internal ...)) (unwind-protect (progn ... ...
...) (set-match-data save-match-data-internal ...)))
  (save-match-data (widen) (goto-char (point-min)) (insert
"\\begin{document}\n" (dump-map map) (goto-char ...) (insert
"\n\\end{document") (indent-region ... ... nil)))
  (save-window-excursion (save-match-data (widen) (goto-char ...)
(insert "\\begin{document}\n" ... ... ... ...)))
  (save-excursion (save-window-excursion (save-match-data ... ...
...)))
  eval((save-excursion (save-window-excursion (save-match-data ... ...
...))))
  eval-defun(nil)
  call-interactively(eval-defun)

If I do C-u M-C-x, then I get the pointer next to the (save-excursion
... statement.  That is not at the first executable statement
(switch-to-buffer buffer)

If I do a C-x C-e I get map-to-buffer in the message window (which is
what I would expect).

My key bindings are
M-C-x: eval-defun
C-x C-e: eval-last-sexp

The output of the emacs bug report (I still think it is some error in
my setup or actions) is:
In GNU Emacs 22.0.90.1 (i386-mingw-nt5.1.2600)
 of 2006-11-05 on NEUTRINO
X server distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags
-Ic:/Programme/GnuWin32/include'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  desktop-save-mode: t
  encoded-kbd-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t


Thanks,

Mirko

  reply	other threads:[~2006-12-15 15:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-14 20:32 yasq: unable to edebug-defun Mirko
2006-12-15 13:16 ` Robert Thorpe
2006-12-15 15:55   ` Mirko [this message]
2006-12-15 16:47     ` Robert Thorpe
2006-12-15 19:01       ` Mirko
2006-12-18 10:30         ` Robert Thorpe
2006-12-16 15:34     ` Johan Bockgård
2006-12-18 22:20     ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1166198144.214233.78100@73g2000cwn.googlegroups.com \
    --to=mvukovic@nycap.rr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).