[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nice-single-quote
From: |
Andreas Röhler |
Subject: |
Re: nice-single-quote |
Date: |
Fri, 16 Apr 2010 13:48:41 +0200 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
Thien-Thi Nguyen wrote:
> Greetings earthlings,
>
> I've taken a fancy to the Unicode
>
> #x2018 -- LEFT SINGLE QUOTATION MARK
> #x2019 -- RIGHT SINGLE QUOTATION MARK
>
> for quoting sexps in various non-user-message text (comments,
> ChangeLog, NEWS, etc). Please find below a simple command that
> inserts these, as well as my preferred keybinding. Example usage:
>
> Originally
> // Use super-foo
>
> Type C-'
> // Use super-‘foo’
>
> Some seconds later, after more typing
> // Use super-‘foo’ to bar LAX (laughter)
>
> Type C-u 2 C-'
> // Use super-‘foo’ to bar ‘LAX (laughter)’
>
> (The fragments are from a buffer in C mode, w/ point always at eol.)
>
> thi
>
> _______________________________________________________________________
> ;; Copyright (C) 2010 Thien-Thi Nguyen
> ;; This program is provided under GNU GPLv3+.
>
> (defun nice-single-quote (&optional n)
> "Insert ‘ and ’ around the last N sexps; leave point at end.
> N defaults to 1."
> (interactive "p")
> (save-excursion
> (backward-sexp (or n 1))
> (insert "‘"))
> (insert "’"))
>
> (global-set-key [(control ?')] 'nice-single-quote)
>
>
> _______________________________________________
> gnu-emacs-sources mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources
>
Hi Thien,
thanks.
Have a question:
What about "'"
Is there a way to discriminate it verbally from your chars?
Maybe have look for example at
ar-singlequote-alnum-atpt, from
https://code.launchpad.net/~a-roehler/s-x-emacs-werkstatt/thing-at-point-utils.el
Should I rename it?
Thanks again
Andreas