all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Somehow strange behaviour of `mark-sexp'
@ 2014-02-13 15:04 Thorsten Jolitz
  0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Jolitz @ 2014-02-13 15:04 UTC (permalink / raw
  To: help-gnu-emacs


Hi List, 

when doing 'C-h v mark-sexp' I see this (excerpt):

,-----------------------------------------------------------------
| mark-sexp is an interactive compiled Lisp function in `lisp.el'.
| 
| It is bound to C-M-@, C-M-SPC.
`-----------------------------------------------------------------

Now, moving point to the beginning of C-M-@ and calling ` mark-sexp',

,-----
| C-M-
`-----

is marked. When moving point to the @ at the end of C-M-@ and calling
`mark-sexp',

,-----------
| @, C-M-SPC
`-----------

is marked, which I found a bit counter-intuitive.

PS 1

`forward-sexp' acts like that too

PS 2

I'm working on the console

-- 
cheers,
Thorsten





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Somehow strange behaviour of `mark-sexp'
       [not found] <mailman.14952.1392303843.10748.help-gnu-emacs@gnu.org>
@ 2014-02-13 16:02 ` Barry Margolin
  2014-02-13 16:22   ` Thorsten Jolitz
  2014-02-13 20:15   ` Thorsten Jolitz
  0 siblings, 2 replies; 4+ messages in thread
From: Barry Margolin @ 2014-02-13 16:02 UTC (permalink / raw
  To: help-gnu-emacs

In article <mailman.14952.1392303843.10748.help-gnu-emacs@gnu.org>,
 Thorsten Jolitz <tjolitz@gmail.com> wrote:

> Hi List, 
> 
> when doing 'C-h v mark-sexp' I see this (excerpt):
> 
> ,-----------------------------------------------------------------
> | mark-sexp is an interactive compiled Lisp function in `lisp.el'.
> | 
> | It is bound to C-M-@, C-M-SPC.
> `-----------------------------------------------------------------
> 
> Now, moving point to the beginning of C-M-@ and calling ` mark-sexp',
> 
> ,-----
> | C-M-
> `-----
> 
> is marked. When moving point to the @ at the end of C-M-@ and calling
> `mark-sexp',
> 
> ,-----------
> | @, C-M-SPC
> `-----------
> 
> is marked, which I found a bit counter-intuitive.
> 
> PS 1
> 
> `forward-sexp' acts like that too
> 
> PS 2
> 
> I'm working on the console

@, is part of backquote syntax, it unquotes the sexp following it. So it 
thinks @, C-M-SPC is @, unquoting the variable C-M-SPC, and that's a 
sexp.

I'm not sure why you would expect sensible behavior from a command 
intended for dealing with Lisp code in the *Help* buffer, which is just 
plain text.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Somehow strange behaviour of `mark-sexp'
  2014-02-13 16:02 ` Somehow strange behaviour of `mark-sexp' Barry Margolin
@ 2014-02-13 16:22   ` Thorsten Jolitz
  2014-02-13 20:15   ` Thorsten Jolitz
  1 sibling, 0 replies; 4+ messages in thread
From: Thorsten Jolitz @ 2014-02-13 16:22 UTC (permalink / raw
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

> In article <mailman.14952.1392303843.10748.help-gnu-emacs@gnu.org>,
>  Thorsten Jolitz <tjolitz@gmail.com> wrote:
>
>> Hi List, 
>> 
>> when doing 'C-h v mark-sexp' I see this (excerpt):
>> 
>> ,-----------------------------------------------------------------
>> | mark-sexp is an interactive compiled Lisp function in `lisp.el'.
>> | 
>> | It is bound to C-M-@, C-M-SPC.
>> `-----------------------------------------------------------------
>> 
>> Now, moving point to the beginning of C-M-@ and calling ` mark-sexp',
>> 
>> ,-----
>> | C-M-
>> `-----
>> 
>> is marked. When moving point to the @ at the end of C-M-@ and calling
>> `mark-sexp',
>> 
>> ,-----------
>> | @, C-M-SPC
>> `-----------
>> 
>> is marked, which I found a bit counter-intuitive.
>> 
>> PS 1
>> 
>> `forward-sexp' acts like that too
>> 
>> PS 2
>> 
>> I'm working on the console
>
> @, is part of backquote syntax, it unquotes the sexp following it. So it 
> thinks @, C-M-SPC is @, unquoting the variable C-M-SPC, and that's a 
> sexp.

Ok, I see. 


> I'm not sure why you would expect sensible behavior from a command 
> intended for dealing with Lisp code in the *Help* buffer, which is just 
> plain text.

not necessarily sensible behaviour, but mark-sexp works quite well on
all kinds of "things at point", so I probably like its useful behaviour
even in contexts outside its original scope. 

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Somehow strange behaviour of `mark-sexp'
  2014-02-13 16:02 ` Somehow strange behaviour of `mark-sexp' Barry Margolin
  2014-02-13 16:22   ` Thorsten Jolitz
@ 2014-02-13 20:15   ` Thorsten Jolitz
  1 sibling, 0 replies; 4+ messages in thread
From: Thorsten Jolitz @ 2014-02-13 20:15 UTC (permalink / raw
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

> I'm not sure why you would expect sensible behavior from a command 
> intended for dealing with Lisp code in the *Help* buffer, which is just 
> plain text.

As vi(m) users keep telling us, actual editing is much less frequent
task than navigation etc., and they like the fact they can do navigation
etc. very conveniently with one-key commands in read-only mode in their
modal editor. 

I wrote navi-mode.el for this vi(m)-like experience when working with
org-mode or source-code buffers in emacs - one-key commands in read-only
mode for navigation, structure editing and a kind of remote-control of
the associated source buffer.

The remote-control commands were restricted to act on outline subtrees
before, but today I generalized them to act on the 'thing-at-point',
wether an outline-subtree or an sexp - using mark-sexp.

Now you can mark, copy, kill, query-replace, isearch, yank (and probably
more) not only outline-subtrees but also defuns, lisp expressions and
even plain-text words directly from the *Navi* buffer without switching
to the associated source-buffer ... thanks to mark-sexp's quite sensible
behaviour even outside its original scope.

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-13 20:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.14952.1392303843.10748.help-gnu-emacs@gnu.org>
2014-02-13 16:02 ` Somehow strange behaviour of `mark-sexp' Barry Margolin
2014-02-13 16:22   ` Thorsten Jolitz
2014-02-13 20:15   ` Thorsten Jolitz
2014-02-13 15:04 Thorsten Jolitz

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.