Next: , Previous: , Up: Text   [Contents][Index]


25.5 Quotation Marks

One common way to quote is the typewriter convention, which quotes using straight apostrophes 'like this' or double-quotes "like this". Another common way is the curved quote convention, which uses left and right single or double quotation marks ‘like this’ or “like this”. In text files, typewriter quotes are simple and portable; curved quotes are less ambiguous and typically look nicer.

Electric Quote mode makes it easier to type curved quotes. As you type characters it optionally converts ` to , ' to , `` to , and '' to .

You can customize the behavior of Electric Quote mode by customizing variables that control where it is active. It is active in text paragraphs if electric-quote-paragraph is non-nil, in programming-language comments if electric-quote-comment is non-nil, and in programming-language strings if electric-quote-string is non-nil. The default is nil for electric-quote-string and t for the other variables.

Electric Quote mode is disabled by default. To toggle it, type M-x electric-quote-mode. To toggle it in a single buffer, use M-x electric-quote-local-mode. To suppress it for a single use, type C-q ` or C-q ' instead of ` or '. To insert a curved quote even when Electric Quote is disabled or inactive, you can type C-x 8 [ for , C-x 8 ] for , C-x 8 { for , and C-x 8 } for . See Inserting Text.