Making a backtick produce just a backtick
In system preferences, keyboard layouts, there's three UK "variants":
Layout Variants
------ --------
English (UK) Default
English (UK) English (UK, extended WinKeys)
English (UK) English (UK, international with dead keys)
My keyboard has windows keys, so I'd selected the second variant during the install process, as seemed reasonable.
In fact, the difference between "Default" and the "extended WinKeys" variant seems to have nothing to do with the Windows keys at all. The "extended WinKeys" variant actually makes many changes to the AltGr key behaviour, most of them for the better, for example, the AltGr-shifted apostrophe and circumflex keys add the acute and circumflex accent to the next letter that's pressed, rather than the random results that the "Default" variant gives.
However, the "extended Winkeys" variant also corrects the AltGr-shifted backtick, and returns a broken-bar as is printed on the key rather the incorrect solid-bar provided by "Default". That in turn means that the AltGr-backtick can't be used to add the grave accent to the next letter, as would be consistent with the "extended Winkeys" variant, so somebody evidently decided to just replace the backtick with that function.
Since any UK Linux user would use the Compose-key functionality to write accented letters, nobody knows about the differences between these keyboard variants and it just catches people out. In the various forums that mention the backtick-key giving this unexpected behaviour, everybody was mystified about why it happened.
This is the sort of thing that this bug causes. If I wanted to display the content of a shell script that somewhere on the path, I might type:
$ cat `which zegrep`
But instead, I get:
$ cat ẁhich zegrep
...the backtick and "w" combine into w-with-grave
This is the mapping of the backtick key with the UK "extended WinKeys" layout:
$ xmodmap -pke | grep "keycode 49"
keycode 49 = dead_grave notsign grave notsign brokenbar notsign bar bar
And if you change the keyboard layout to UK "Default", the dead_grave key mapping gets shifted to the third position, which is the "mode_shifted" position (enabled by a Mode_shift key if you had one defined on your keyboard) which makes much more sense:
$ xmodmap -pke | grep "keycode 49"
keycode 49 = grave notsign dead_grave notsign bar bar brokenbar notsign
I'm thinking that I should report a bug, since evidently other people run into this, but I'm not sure what to recommend. Maybe rename "UK, extended WinKeys" to "UK, deadkeys via AltGr", so that people generally wouldn't select it unless they knew what "deadkeys" were and specifically wanted that behaviour. Or shift the dead_grave function to the AltGr-shifted position on the backtick key, which would make it consistent with the other deadkeys.
Anyway, just goto the keyboard layouts, add a new layout and select the UK Default keyboard.