I want to be able to change a global keybinding by calling an Emacs function.
The command in question is:
gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']"
This Linux shell command sets the keybinding for changing between applications.
When I call shell-command
within Emacs and enter the above command, the expected result always happens: application switching becomes bound to Super-Tab.
The correct form for a simple shell-command is (shell-command "command")
. I have successfully tested that this works by evaluating (shell-command "ls")
.
However, when I evaluate the function
(shell-command "gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']"")
instead of this working as it does when I offer this string directly to shell-command prompt, I receive the error message: eval-region: Invalid read syntax: "]"
.
I have tried every syntactic variation of this command that I can think of and read threads and blog posts discussing simple uses of shell-command, but I have found nothing applicable to this problem.
I would be grateful for any advice.
(shell-command "gsettings set org.gnome.desktop.wm.keybindings switch-applications \"['<Super>Tab']\"")
? Otherwise the string representing your command is ending prematurely at the first double quotes.