() Andreas Röhler <[email protected]>
() Mon, 19 Apr 2010 10:47:55 +0200

   > (add-to-list 'insert-pair-alist '(?\' ?\‘ ?\’))
   > (global-set-key [(super ?')] 'insert-pair)

This is nice, too, but different from ‘nice-single-quote’
in that point is left between the quotes instead of afterwards.

nice-single-quote:

  bef: foo-!-
  aft: ‘foo’-!-

insert-pair:

  bef: foo-!-
  aft: foo ‘-!-’

insert-pair with a prefix arg -1:

  bef: foo-!-
  aft: ‘-!-foo’

In the examples, ‘-!-’ represents the cursor position (point).
So, i conclude that ‘nice-single-quote’ is still a uniquely
useful composition of primitive insertion/motion commands.
BTW, the updated (non-rt) version is for situations like so:

  bef:  // Do the deed if *required-!-
  aft0: // Do the deed ‘if *required’-!-
  aft1: // Do the deed if *‘required’-!-
  aft2: // Do the deed if ‘*required’-!-

Here (in C mode), invocation 0 is with prefix arg 2 and it goes
too far.  Invocation 1 and 2 (after undo and w/o prefix arg) DTRT.

(In any case, i agree the term "single quote" is ambiguous;
perhaps it is better to call the command ‘nice-2018-2019’.
That's unambiguous but ugly, but such is life...)

thi


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

Reply via email to