Thanks for your reply. This doesn't quite address what I was after: almost, but not quite.

In case it's of use to others I'm going to explain what I wanted again, then how I have a sort-of solution, or more accurately a solution that raises another problem in it's place.

I was asking for a means to set up LyX so that whenever I type a single quote ('), the single quote would be treated as a "smart" quote, i.e. LyX would interpret it as an open or close quote as appropriate.

(I was not trying to set some key sequence to generate a smart single quote, I already knew how to do that--that's actually what I wanted to *stop* having to do, a key sequence is already set for generating a "smart" single quote by default. I was trying to get a single quote to be treated as a smart quote without having to remember to type a "special" key sequence.)

Furthermore, what I really wanted was to still get a "straight" quote, using a key sequence. The overall effect wanted was that of having a key sequence that might by default generate a "smart quote", generate a straight quote and have the quote character default to a smart quote. This can be achieved with the double quotes; I was trying to achieve the same with a single quote.


If you try set "'" to be the "mapped" key in the fashion BH describes, LyX will complain that:

   Shortcut `'' is already bound to:
   self-insert
   You need to remove that binding before creating a new one.

These "self-insert" bindings seem to be set in a file held within the application bundle, so "strictly speaking" this solution should be out of bounds to an end user. Ideally what would nice was a means to have "'" act as a "smart quote" through the user interface, and hopefully in a way I will not have keep manually updating the binding each time I update LyX. This doesn't seem to be possible at present.

My eventual sort-of solution was to edit the latinkeys.bind file (in the 'bind' directory of the Resources section of the application), so that

   \bind "quoteright"         "self-insert"

now reads:

   \bind "quoteright"         "quote-insert single"

This certainly makes all single quotes appear as "smart quotes", except now I can't find a way to map cmd-' (or whatever) to generate a "straight" quote, as it insists on generating a "quote-insert single"!

While I suspect there will be a solution to this somehow, this does suggest to me that the system for applying character mappings has some weaknesses.


Grant


On Thu, Mar 19, 2009 at 9:53 PM, Grant Jacobs <[email protected]> wrote:

 Is there a means to make "smart" *single* quotes the default in the same way
 as is done for double quotes?

LyX > Preferences > Editing > Shortcuts

1. Enter "quote" in the "Show key-bindings containing" field
2. select "quote-insert single"
3. click the "Modify button"
4. click the "Clear" button on the dialog that pops up
5. type the key you want to bind smart single quotes to
6. click "OK"
7. click "Save"

Bennett


--
-------------------------------------------------------------------
Grant Jacobs Ph.D.                                     BioinfoTools
ph. +64 3 478 0095  (office, after 10am)               PO Box 6129,
or  +64 27 601 5917 (mobile)                               Dunedin,
[email protected]                               NEW ZEALAND.
Bioinformatics tools: deriving knowledge from biological data Bioinformatics tools - software development - consulting - training
 18 years experience in bioinformatics ready to solve your problem
Check out the website for more details: http://www.bioinfotools.com

Reply via email to