all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mark-sexp bug in emacs 21.3.50.1
@ 2004-12-28 17:33 Adam Cohen
  0 siblings, 0 replies; only message in thread
From: Adam Cohen @ 2004-12-28 17:33 UTC (permalink / raw)


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:
<http://www.crackaddict.com/~adam/emacs.mov>.  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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-28 17:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-28 17:33 mark-sexp bug in emacs 21.3.50.1 Adam Cohen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.