Q: how do I get smartparens not to insert a pair of ``LaTeX'' quotes?
The goal
I set up smartparens to insert a pair of quotation marks unless point is just before a word or just after it, where * is point:
some text * some more text ==> some text "*" some more text *some text ==> "*some text some text* ==> some text"* I have it set up for text-mode and org-mode like so:
(sp-local-pair '(text-mode org-mode) "\"" nil :unless '(sp-point-before-word-p sp-point-after-word-p)) The problem
LaTeX is goofy with ``double quotes'' and `single quotes'. That is: double quotes are done with two backticks on the front and two ticks at the end. This doesn't work:
(sp-local-pair '(latex-mode) "\"" nil :unless '(sp-point-before-word-p sp-point-after-word-p)) The ugly "solution"
After much tinkering, the following works somewhat:
(with-eval-after-load "latex" (sp-local-pair '(latex-mode) "`" nil :unless '(sp-point-before-word-p)) (sp-local-pair '(latex-mode) "'" nil :unless '(sp-point-after-word-p)) (sp-local-pair '(latex-mode) "``" nil :unless '(sp-point-before-word-p)) (sp-local-pair '(latex-mode) "''" nil :unless '(sp-point-after-word-p))) But that seems a little ludicrous for such simple functionality. It's also far from perfect, in that I get new and sometimes baffling errors from yasnippet, of all things.
The mournful appeal
Am I missing some simple, LaTeX-specific way of doing this?
smartparensinserts pairs of parentheses, quotes, etc. When I enter", it gives me a pair of LaTeX quotes. I want it to do that except when point is just before the start of a word (when I want it to insert just the opening quote) or just after the end of a word (when I want it to insert just the closing quote).C-q "in the special situations?