<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks for all suggestions.<div>yasnippet from   <a href="http://code.google.com/p/yasnippet/">http://code.google.com/p/yasnippet/</a><div>works great.</div><div>Jan</div><div><br></div><div><br><div><div>On Feb 7, 2009, at 2:55 PM, M A wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Sat, Feb 7, 2009 at 12:38 AM, Jan Rosinski <<a href="mailto:jrosinsk@gmail.com">jrosinsk@gmail.com</a>> wrote:<br><blockquote type="cite">I was trying to define, unsuccessfully, abbrev of \frac{}{} to be triggered<br></blockquote><blockquote type="cite">by \f<br></blockquote><blockquote type="cite">with the cursor between the first braces at the end, in the local latex<br></blockquote><blockquote type="cite">mode.<br></blockquote><blockquote type="cite">I can do it with fr as a trigger but \f does not work.<br></blockquote><blockquote type="cite">Eventually, I would like to have several such abbrevs for the math. Is it<br></blockquote><blockquote type="cite">possible with<br></blockquote><blockquote type="cite">the prefix \ ? If not, what is the best solution? Concrete examples are the<br></blockquote><blockquote type="cite">best. Thanks.<br></blockquote><blockquote type="cite"><br></blockquote><br>In emacs abbrevs only work, I believe, on word characters, which rules<br>out using \ in<br>the key for the abbrev. I would recommend trying out yasnippet, which<br>is what I use<br>these day since it is both easy to define a "snippet" and to move the<br>point (cursor)<br>around. For instance, you would put the following text in a file in<br>your snippet directory<br>for latex mode,<br><br>#key:\f<br>#name: \frac{}{}<br># --<br>\frac{$1}{$2}$0<br><br>(without a newline after $0), then after typing \f you press TAB it<br>expands into \frac{}{}<br>placing the cursor between the first two braces. Press TAB again and<br>the cursor moves<br>between the second pair of braces. Press TAB a third time and the<br>cursor is placed after<br>the last brace. There does appear to be a bug where \f does not expand<br>if the \ is the first<br>character on the line, but otherwise it works for me. You can find yasnippet at<br><a href="http://code.google.com/p/yasnippet/">http://code.google.com/p/yasnippet/</a><br><br>MarkA<br>_____________________________________________________________<br>MacOSX-Emacs mailing list<br>MacOSX-Emacs@email.esm.psu.edu<br>http://email.esm.psu.edu/mailman/listinfo/macosx-emacs<br>List Archives: http://dir.gmane.org/gmane.emacs.macintosh.osx<br></div></blockquote></div><br></div></div></body></html>