From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Defining functions on the fly
Date: Mon, 15 Jun 2015 14:06:22 +0200 [thread overview]
Message-ID: <557EBFBE.7020502@easy-emacs.de> (raw)
In-Reply-To: <87r3pdqjd0.fsf@gnu.org>
Am 15.06.2015 um 13:52 schrieb Tassilo Horn:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> It's not about duplication, but derivation. The original DTRT in most
>> cases.
>>
>> Point of interest are the exceptions - see for example in Elixir
>>
>> https://github.com/elixir-lang/emacs-elixir/issues/185
>>
>> "\"foo\"" |> String.strip(?")
>>
>> Where the doublquote after question mark makes Emacs think it's a
>> string-start - which isn't.
> String recognition in emacs is usually done using syntax tables, so get
> the elixir syntax table right and then you don't need any workarounds.
> In this case, it seems plain syntax tables aren't enough, though, so the
> elisp docs explain how to override certain characters' syntax on demand.
>
> ,----[ (info "(elisp)Syntax Properties") ]
> | When the syntax table is not flexible enough to specify the syntax of a
> | language, you can override the syntax table for specific character
> | occurrences in the buffer, by applying a ‘syntax-table’ text property.
> | *Note Text Properties::, for how to apply text properties.
> `----
>
> So basically, you (or elixir-mode) will want to define a
> `syntax-propertize-function' which finds occurrences of ?" and gives "/"
> (character quote) syntax to the ? in which the usual "\"" (string
> quotes) syntax of `"' would be ineffective for this single double quote.
>
> ,----[ (info "(elisp)Syntax Class Table") ]
> | Character quotes: ‘/’
> | Characters used to quote the following character so that it loses
> | its normal syntactic meaning. This differs from an escape
> | character in that only the character immediately following is ever
> | affected.
> |
> | Characters in this class count as part of words if
> | ‘words-include-escapes’ is non-‘nil’. *Note Word Motion::.
> `----
>
> Bye,
> Tassilo
Thanks again. Will see if a better example comes across WRT original
question.
next prev parent reply other threads:[~2015-06-15 12:06 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.5020.1434360277.904.help-gnu-emacs@gnu.org>
2015-06-15 9:57 ` Defining functions on the fly Pascal J. Bourguignon
2015-06-15 11:21 ` Andreas Röhler
2015-06-15 11:52 ` Tassilo Horn
2015-06-15 12:06 ` Andreas Röhler [this message]
2015-06-15 12:43 ` Andreas Röhler
2015-06-15 23:51 ` Gene
2015-06-16 1:14 ` Stefan Monnier
2015-06-17 0:24 ` Gene
2015-06-17 1:12 ` Stefan Monnier
2015-06-16 5:47 ` Andreas Röhler
2015-06-15 9:24 Andreas Röhler
2015-06-15 9:32 ` Dmitry Gutov
2015-06-15 9:47 ` Alexis
2015-06-15 10:20 ` Andreas Röhler
2015-06-15 10:37 ` Alexis
2015-06-15 10:41 ` Michael Heerdegen
2015-06-15 10:42 ` Tassilo Horn
2015-06-15 11:01 ` Alexis
2015-06-15 11:19 ` Michael Heerdegen
2015-06-15 11:24 ` Tassilo Horn
2015-06-15 11:31 ` Michael Heerdegen
2015-06-15 10:00 ` Tassilo Horn
2015-06-15 10:33 ` Andreas Röhler
[not found] ` <mailman.5022.1434361680.904.help-gnu-emacs@gnu.org>
2015-06-15 12:52 ` Stefan Monnier
2015-06-16 5:59 ` Andreas Röhler
2015-06-16 7:01 ` Tassilo Horn
2015-06-16 9:22 ` Andreas Röhler
2015-06-16 11:12 ` Tassilo Horn
2015-06-16 11:40 ` Andreas Röhler
2015-06-16 13:10 ` Tassilo Horn
2015-06-16 15:46 ` Andreas Röhler
[not found] ` <mailman.5109.1434469628.904.help-gnu-emacs@gnu.org>
2015-06-16 22:34 ` Stefan Monnier
[not found] ` <mailman.5090.1434454815.904.help-gnu-emacs@gnu.org>
2015-06-16 16:13 ` Pascal J. Bourguignon
2015-06-16 18:30 ` Andreas Röhler
2015-06-16 9:42 ` Andreas Röhler
[not found] ` <mailman.5084.1434446560.904.help-gnu-emacs@gnu.org>
2015-06-16 9:50 ` Pascal J. Bourguignon
2015-06-16 10:26 ` Andreas Röhler
[not found] ` <mailman.5087.1434450412.904.help-gnu-emacs@gnu.org>
2015-06-16 11:35 ` Pascal J. Bourguignon
[not found] ` <mailman.5085.1434447782.904.help-gnu-emacs@gnu.org>
2015-06-16 22:32 ` Stefan Monnier
[not found] ` <mailman.5075.1434434385.904.help-gnu-emacs@gnu.org>
2015-06-16 22:23 ` Stefan Monnier
2015-06-17 6:13 ` Andreas Röhler
[not found] ` <mailman.5137.1434522533.904.help-gnu-emacs@gnu.org>
2015-06-17 14:30 ` Stefan Monnier
2015-06-17 16:40 ` Andreas Röhler
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=557EBFBE.7020502@easy-emacs.de \
--to=andreas.roehler@easy-emacs.de \
--cc=help-gnu-emacs@gnu.org \
/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.