all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pascal Bourguignon <pjb@informatimago.com>
Subject: forward-sexp and quote
Date: 20 Jan 2003 02:33:48 +0100	[thread overview]
Message-ID: <87r8b8fvur.fsf@thalassa.informatimago.com> (raw)



(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

             reply	other threads:[~2003-01-20  1:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-20  1:33 Pascal Bourguignon [this message]
2003-01-21 18:17 ` forward-sexp and quote Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2003-01-20  1:52 Pascal Bourguignon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r8b8fvur.fsf@thalassa.informatimago.com \
    --to=pjb@informatimago.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.