[Top][All Lists]

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

[ELPA] New package: cycle-quotes.el

From: Simen Heggestøyl
Subject: [ELPA] New package: cycle-quotes.el
Date: Sat, 04 Jun 2016 13:00:23 +0200


I'd like to offer a package I've written, cycle-quotes.el, for GNU ELPA.

It's a convenience package providing a command to cycle between
different string quoting styles. For instance, in JavaScript, there's
three string quote characters: ", ` and '. In a JavaScript buffer, with
point located someplace within the string, the `cycle-quotes' command
will cycle between these quote styles each time the command is called:

  --> "Hi, it's me!" --> `Hi, it's me!` --> 'Hi, it\'s me!' --
 |                                                            |

As seen in the above example, it handles escaping and unescaping of
quote characters inside the string.

I've been using the package privately for some time now and found it
useful, so maybe others will find it useful too.

There is a similar package available from MELPA, toggle-quotes.el, but
it works differently. toggle-quotes.el toggles between the " and '
quotes, while cycle-quotes.el uses the current mode's syntax table to
determine which quote characters to cycle between (so it's able to
support an arbitrary number of quote styles).

-- Simen

Attachment: cycle-quotes-test.el
Description: Text Data

Attachment: cycle-quotes.el
Description: Text Data

reply via email to

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