[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the difference between forward-list and forward-sexp?

From: Jambunathan K
Subject: Re: What is the difference between forward-list and forward-sexp?
Date: Fri, 01 Nov 2013 20:37:37 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

I am not familiar with the technical details.  Let me share how I use
those two.


Diff. between C-M-f and C-M-n

sexp => An expression.

You can use C-M-f to move a symbol at a time.  C-M-n will look for a
parenthesis and skip past it.

    (defun message (msg)
      (message msg))

Put your cursor on the 'd' character of defun above and do a C-M-f and a
C-M-n.  You will see a difference.


Difference between M-f and C-M-f

M-f considers word as a unit.  C-M-f takes symbol as a unit.  Likewise
for M-k cuts a word and C-M-k will cut a symbol.

    (string-match "\\^" markers)

Put your cursor on the 's' of the string-match and do a M-f and C-M-f.
See what happens.

The above example is in elisp.  One can try the above exercise with C
symbols that have underscores in them.


Marcin Borkowski <> writes:

> Hi all,
> the subject says it all.  A simple test (involving two *very* simple
> cases) didn't show any difference.  The source code is quite similar,
> and (at least if forward-sexp-function is undefined) the difference
> boils down to calling scan-lists or scan-sexps.  These in turn are
> defined in the C source code, which I don't have on my disk (and I'm
> not fluent in C, so the source code wouldn't help me very much anyway).
> Best,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]