From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Mirko" Newsgroups: gmane.emacs.help Subject: Re: yasq: unable to edebug-defun Date: 15 Dec 2006 07:55:44 -0800 Organization: http://groups.google.com Message-ID: <1166198144.214233.78100@73g2000cwn.googlegroups.com> References: <1166128326.307683.186800@n67g2000cwd.googlegroups.com> <1166188617.839990.291590@j72g2000cwa.googlegroups.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1166200900 3275 80.91.229.10 (15 Dec 2006 16:41:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Dec 2006 16:41:40 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 15 17:41:39 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GvG7r-0004O6-Uv for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Dec 2006 17:41:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GvG7r-0007AW-5J for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Dec 2006 11:41:35 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!73g2000cwn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 132 Original-NNTP-Posting-Host: 208.218.238.20 Original-X-Trace: posting.google.com 1166198192 28307 127.0.0.1 (15 Dec 2006 15:56:32 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 15 Dec 2006 15:56:32 +0000 (UTC) In-Reply-To: <1166188617.839990.291590@j72g2000cwa.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 73g2000cwn.googlegroups.com; posting-host=208.218.238.20; posting-account=zJ4b2Q0AAAB5wLprz3WGnkfVsRyuZtK0 Original-Xref: shelby.stanford.edu gnu.emacs.help:143973 Original-To: help-gnu-emacs@gnu.org 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:39579 Archived-At: 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