From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: yasq: unable to edebug-defun Date: Mon, 18 Dec 2006 15:20:46 -0700 Organization: IHS Message-ID: References: <1166128326.307683.186800@n67g2000cwd.googlegroups.com> <1166188617.839990.291590@j72g2000cwa.googlegroups.com> <1166198144.214233.78100@73g2000cwn.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1166480616 14624 80.91.229.2 (18 Dec 2006 22:23:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 18 Dec 2006 22:23:36 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 18 23:23:36 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GwQtI-0005O3-LS for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Dec 2006 23:23:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GwQtI-0000S2-0l for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Dec 2006 17:23:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GwQsQ-0008HZ-QD for help-gnu-emacs@gnu.org; Mon, 18 Dec 2006 17:22:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GwQsQ-0008GB-6f for help-gnu-emacs@gnu.org; Mon, 18 Dec 2006 17:22:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GwQsP-0008Fo-JM for help-gnu-emacs@gnu.org; Mon, 18 Dec 2006 17:22:29 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GwQsP-0006NQ-37 for help-gnu-emacs@gnu.org; Mon, 18 Dec 2006 17:22:29 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GwQrz-00053q-2p for help-gnu-emacs@gnu.org; Mon, 18 Dec 2006 23:22:04 +0100 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Dec 2006 23:22:03 +0100 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Dec 2006 23:22:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 139 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: <1166198144.214233.78100@73g2000cwn.googlegroups.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39712 Archived-At: Mirko wrote: > 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" You are missing a close parenthesis at the end of the `(insert ...' form. > (dump-map map) > (goto-char (point-max)) > (insert "\n\\end{document") I think you want a right brace after `"{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 -- Kevin