From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Adam Cohen Newsgroups: gmane.emacs.bugs Subject: mark-sexp bug in emacs 21.3.50.1 Date: Tue, 28 Dec 2004 12:33:05 -0500 Message-ID: Reply-To: Adam Cohen NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1104255294 23040 80.91.229.6 (28 Dec 2004 17:34:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 28 Dec 2004 17:34:54 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 28 18:34:46 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CjLF7-0003Kq-00 for ; Tue, 28 Dec 2004 18:34:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CjLPy-0004hF-UP for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Dec 2004 12:45:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CjLPW-0004VX-RZ for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2004 12:45:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CjLPT-0004So-9Y for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2004 12:45:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CjLPR-0004SA-9O for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2004 12:45:25 -0500 Original-Received: from [64.233.170.192] (helo=rproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CjLDW-0000O1-ET for bug-gnu-emacs@gnu.org; Tue, 28 Dec 2004 12:33:06 -0500 Original-Received: by rproxy.gmail.com with SMTP id j1so470493rnf for ; Tue, 28 Dec 2004 09:33:05 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=kA3w/8u+vvSkHQF1ChrntDA7UXT8c6VC8mBhtOfW6U4iuXGdYRVTu7uZ7ADG8aS6xEhw3SheQLi8+cC7SRV6FtsRD3yXhBYQPcIgigJphcx8h2A78LNJgcG166xTwS8fOi971hItM4F6MkBRPchV+fq9BG4treMvkrgPD0K+vyE= Original-Received: by 10.38.89.49 with SMTP id m49mr70237rnb; Tue, 28 Dec 2004 09:33:05 -0800 (PST) Original-Received: by 10.38.97.64 with HTTP; Tue, 28 Dec 2004 09:33:05 -0800 (PST) Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:10240 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:10240 I created the following function definition so that I can select all the text in between two parentheses, including the parentheses themselves, but unfortunately it doesn't work as expected: ;;the following is from my .emacs file (defun select-to-matching-brace () "Selects text in between matching braces, including the braces themselves." (interactive) (backward-up-list) (mark-sexp) ) (global-set-key (kbd "M-RET") 'select-to-matching-brace) For example, if I place the cursor in between [test test] with the following text: [[[test test] test] test] and then hit M-RET three times, the mark ends up selecting the following: [[[test test] test and it misses the trailing "] test]". What should've happened is that the first time I hit M-RET, it should've selected "[test test]", the second time I pressed M-RET, it should've selected "[[test test] test]" and the third time I hit M-RET, it should've selected everything. To better illustrate what I'm talking about, you can check out a small movie I made here: . The strange thing is, if I manually type "M-x select-to-matching-brace" three times, it works perfectly. It's only when bound to a key that the function fails. I've tried binding it to another key, but I still get the same problem. I'm using the copy of emacs provided by the fink package manager on OS X 10.3.4 (GNU Emacs 21.3.50.1 powerpc-apple-darwin7.4.0, X toolkit, Xaw3d scroll bars) and this same behaviour occurs with the Carbon emacs from Andrew Choi (also v 21.3.50.1). However, it does _not_ occur with the copy of emacs provided by Apple for OS X 10.3 (GNU Emacs 21.2.1 powerpc-apple-darwin7.0 of 2003-09-28). I've also tried loading only the above configuration file, just to make sure that it wasn't something else in my .emacs file that was causing it to mess up. Anyways, if anyone has any suggestions, please let me know, cause I'd really love to get this working. Thanks in advance, Adam