• You are not logged in.

    backtick for AUCTeX in Emacs?

    • Started by Porgy
    • 7 Replies:
    • Reputation: 0
    • Registered: 16-Jun-2014
    • Posts: 31

    Hello there,
    I've installed Emacs on my HP laptop's Windows 7 (32-bit) partition where I also have a TeXLive 2013/2015 distribution. I've started experimenting and tweaking Emacs and I've found that when using Colemak, Emacs doesn't recognize neither backtick (`) nor tilde (~) as given in the Colemak layout, i.e. next to number 1. So far I've managed to work around tilde (I've set a global key for F2) but cannot find a way to set backtick. Backtick would really be useful because when in LaTeX mode with AUCTeX I can easily write greek letters or generally speaking I could easily get math symbols. If I press C-h c followed by that backtick/tilde key, Emacs replies with M-6. I thought I could post this issue here on Colemak Forum since you people wrote the key mappings. I also have an open question in emacs.stackexchange.com but so far no workable solution.
    Can anyone help me out in this, please?

    Last edited by Porgy (02-Oct-2015 12:48:39)
    Offline
    • 0
    • Reputation: 0
    • Registered: 17-Sep-2015
    • Posts: 12

    As a workaround, consider changing the backtick prefix to something else, as you did for tilde.  You can do this by changing the value of LaTeX-math-abbrev-prefix before loading AUCTeX.  For example, I have the following in my startup file:

    (setq LaTeX-math-abbrev-prefix  "'")
    ; ...
    (load-library "auctex.el")

    See also the documentation of LaTeX-math-abbrev-prefix.

    Offline
    • 0
    • Reputation: 0
    • Registered: 16-Jun-2014
    • Posts: 31

    I just copy/pasted both your lines in my .emacs file but the second one was giving some problem upon restarting Emacs, so I commented it out. Now Emacs is working as it should, no errors soon after launching it. For example, in LaTeX-mode I just have to type ' m (no Ctlr or Meta key involved) in a math environment and Emacs immediately substitutes it with lowercase Greek letter µ ('mu').

    EDIT
    There's a problem now that I've been trying out some stuff. If I want to type the word ain't, EMACS keeps giving me the greek letter 'tau'. What do I do?

    Last edited by Porgy (02-Oct-2015 12:48:26)
    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,361

    Hang on – aren't the backtick and tilde defined as dead keys in the standard Colemak? In that case, this would explain your troubles.

    In my Colemak[eD] I've kept non-deadkey versions of all common symbols, so these symbols should work as you're used to.

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 16-Jun-2014
    • Posts: 31

    As hinted by 509, I worked around the problem with this:

    (setq LaTeX-math-abbrev-prefix  "|")

    Hopefully, this symbol (pipe?) won't be colliding with other shortcuts or commands, at least in the near future.

    DreymaR said:

    In my Colemak[eD] I've kept non-deadkey versions of all common symbols, so these symbols should work as you're used to.

    I don't know why Emacs doesn't see them. Outside of Emacs these two symbols are fine, it's Emacs that interprets it as M-9 M-6. If I want backtick and press the key next to key '1', Emacs' cursor stops blinking for a few seconds and then types 'sssssssssssss' or 'aaaaaaaaaaaaaa' or whatever other key I pressed after backtick. All I need it for, is to work with AUCTeX math-mode so that I can get the Greek letters and some common math symbols easily and readily.

    Offline
    • 0
    • Reputation: 0
    • Registered: 17-Sep-2015
    • Posts: 12

    Hopefully, this symbol (pipe?) won't be colliding with other shortcuts or commands, at least in the near future.

    You have more options, for example, to use the F2 key as prefix:

    (setq LaTeX-math-abbrev-prefix  "<f2>")

    For the syntax, see the build-in documentation of function edmacro-mode.

    As far as I can tell from the .klc file from the Colemak download page, backtick and tilde on the key in upper left corner are not dead keys.  Still, I believe DreymaR is on the right track: There are dead variants of of these same symbols elsewhere, using the same codepoint.  Probably Emacs is confused by that.  The difference between dead and non-dead in .klc is an @ sign appended to the codepoint for dead keys.

    In my little used MSKLC implementation of AdNW uses the combining variant of grave and tilde (0300 and 0303).  Maybe it is worth trying the same for Colemak.

    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,361

    Codepoints to use as names for dead keys in a MSKLC file is a tricky business. You'd want to use the combining diacritic, ideally, but support for non-ASCII code points is shoddy so you can't (well, maybe sometimes but not always).

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 16-Jun-2014
    • Posts: 31
    509 said:

    You have more options, for example, to use the F2 key as prefix: [...]

    I've alreadey assigned F2 key to tilde (" (global-set-key [f2] "~") ").
    I'm getting confused now with all this dead-key business, I think I'll manage things this way for now.

    Offline
    • 0