gnu-emacs-sources
[Top][All Lists]
Advanced

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

Re: nice-single-quote


From: Thien-Thi Nguyen
Subject: Re: nice-single-quote
Date: Mon, 19 Apr 2010 13:27:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

() Andreas Röhler <address@hidden>
() 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




reply via email to

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