[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
forward-sexp and quote
From: |
Pascal Bourguignon |
Subject: |
forward-sexp and quote |
Date: |
20 Jan 2003 02:33:48 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
(forward-sexp 1) eats quotes and backquotes, but (forward-sexp -1) doesn't.
.'(a b c) --(forward-sexp 1)--> '(a b c). --(forward-sexp -1)--> '.(a b c)
(dot showing the point).
The bug can be traced to scan-sexp which is a built-in.
(show (version))
==> "GNU Emacs 21.2.1 (i686-pc-linux-gnu, X toolkit)
of 2002-10-26 on thalassa"
(progn
(find-file "*bug*")
(emacs-lisp-mode)
(erase-buffer)
(mapc (lambda (s)
(let ((before (point))
after)
(goto-char (point-max))
(insert "\n")
(insert s)
(goto-char before)
(forward-sexp 1)
(forward-sexp -1)
(setq after (point))
(goto-char (point-max))
(insert (format "\nbefore=%S\nafter =%S\n\n" before after))))
'("' (a b c)" "'(a b c)")))
' (a b c)
before=1
after =4
'(a b c)
before=31
after =32
--
__Pascal_Bourguignon__ http://www.informatimago.com/
----------------------------------------------------------------------
There is a fault in reality. Do not adjust your minds. -- Salman Rushdie
- forward-sexp and quote,
Pascal Bourguignon <=