unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* What is the difference between forward-list and forward-sexp?
@ 2013-11-01 14:40 Marcin Borkowski
  2013-11-01 15:05 ` Drew Adams
  2013-11-01 15:07 ` Jambunathan K
  0 siblings, 2 replies; 3+ messages in thread
From: Marcin Borkowski @ 2013-11-01 14:40 UTC (permalink / raw)
  To: GNU Emacs users list

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,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



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

* RE: What is the difference between forward-list and forward-sexp?
  2013-11-01 14:40 What is the difference between forward-list and forward-sexp? Marcin Borkowski
@ 2013-11-01 15:05 ` Drew Adams
  2013-11-01 15:07 ` Jambunathan K
  1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2013-11-01 15:05 UTC (permalink / raw)
  To: Marcin Borkowski, GNU Emacs users list

> the subject says it all.  A simple test (involving two *very* simple
> cases) didn't show any difference.

A list is a sexp, but not all sexps are lists.



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

* Re: What is the difference between forward-list and forward-sexp?
  2013-11-01 14:40 What is the difference between forward-list and forward-sexp? Marcin Borkowski
  2013-11-01 15:05 ` Drew Adams
@ 2013-11-01 15:07 ` Jambunathan K
  1 sibling, 0 replies; 3+ messages in thread
From: Jambunathan K @ 2013-11-01 15:07 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: GNU Emacs users list


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 <mbork@wmi.amu.edu.pl> 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,



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

end of thread, other threads:[~2013-11-01 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01 14:40 What is the difference between forward-list and forward-sexp? Marcin Borkowski
2013-11-01 15:05 ` Drew Adams
2013-11-01 15:07 ` Jambunathan K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).