emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 9ffb6ce 5/5: Quoting fixes in lisp/internationa


From: Oleh Krehel
Subject: Re: [Emacs-diffs] master 9ffb6ce 5/5: Quoting fixes in lisp/international and lisp/leim
Date: Tue, 01 Sep 2015 13:40:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

David Kastrup <address@hidden> writes:

> Has anything like that been proposed?  I repeat the documentation help
> from the `quote' macro:
>
>     quote is a special form in ‘C source code’.
>
>     (quote ARG)
>
>     Return the argument, without evaluating it.  ‘(quote x)’ yields ‘x’.
>     Warning: ‘quote’ does not construct its return value, but just returns
>     the value that was pre-constructed by the Lisp reader (see info node
>     ‘(elisp)Printed Representation’).
>     This means that ’(a . b) is not identical to (cons ’a ’b): the former
>     does not cons.  Quoting should be reserved for constants that will
>     never be modified by side-effects, unless you like self-modifying code.
>     See the common pitfall in info node ‘(elisp)Rearrangement’ for an example
>     of unexpected results when a quoted object is modified.
>
> It contains both quote marks as well as Lisp quote characters.
> Executing the given examples yields "void variable ’"&"Trailing garbage
> following expression" and "void variable ’a" respectively.
>
> Info does not have this problem because Texinfo markup marks code
> passages separately, and for those, ` and ' are not substituted.
>
> So this just can't work in DOC strings until we have decided on separate
> markup for either ` and ' or code in general.

This could be solved in a variety of ways while keeping to ASCII.  For
instance, either "''" or "\'" could translate into "'" unconditionally.

I would prefer the way Markdown does it: `(cons 'a 'b)` translates into
<code>(cons 'a 'b)</code>. I've been using a similar style for org-mode,
only with different escape chars:

- =(cons 'a 'b)= to denote code
- ~C-a C-k~ to denote keyboard sequences



reply via email to

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