greetings earthlings,

fav non-soc noted: nothing gold can stay;
cmd prev quoted needs push to find the Way:
  bow to reality deferential,
  lose transparency referential,
but grok the suffering of all who must stray.

thi

___________________________________________________________________________
;; Copyright (C) 2010 Thien-Thi Nguyen
;; This program provided under GNU GPLv3+.

(defun nice-single-quote (&optional n)
  "Insert ‘ and ’ around the N sexps before point; leave point at end.
N defaults to 1.  Successive interactive calls (that set ‘last-command’)
behave differently, however: In that case, find the left single quote
and transpose it with the character preceding it."
  (interactive "p")
  (if (eq 'nice-single-quote last-command)
      (save-excursion
        (search-backward "‘")
        (transpose-chars 1))
    (save-excursion
      (backward-sexp (or n 1))
      (insert "‘"))
    (insert "’")))

;; This is more comfortable than ‘C-'’ following ‘M-/’.
(global-set-key [(meta ?')] 'nice-single-quote)


_______________________________________________
gnu-emacs-sources mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources

Reply via email to