I am using Emacs 25.2 on Mac OS X 10.12.4. I am trying to set the following command for the previous buffer command.
(global-set-key [(C s j)] 'previous-buffer)
My super key is the CMD key. This key binding works for the right CMD key but when I try with the left CMD key, I get the following message.
<C-s-268632074> is undefined
Why is my left CMD key treated differently?
This works at Debian for example:
(global-set-key [(control c)(super \))] 'MyCommand)
Related
After following instructions from https://www.emacswiki.org/emacs/EmacsMsWindowsIntegration
on starting emacs 27.1 as daemon in windows 10 where path\to\emacs is
"c:\emacs-27.1\bin\runemacs.exe --daemon , see here:
You can also open Explorer, type in shell:startup in the address bar, and press enter. In this startup >folder, create a shortcut by right clicking and selecting new->shortcut. When asked for location, put >the following: "X:\path\to\emacs\bin\runemacs.exe" --daemon where you have substituted the proper path >to runemacs.exe. This shortcut will run at startup. You can double click on the shortcut to start the >Emacs server if it is not already running.
Emacs daemon loads initialization file in c:/emacs-27.1/.config/emacs/init.el and properly so far defines ever function, only there are key-bindings initialized in the init and listed under describe-personal-keybindings that don't work when emacsclientw.exe starts.
They are bindings that were initially reserved for windows and decoded then recoded in the init.
This guy, for example, doesn't play nicely (nothing happens after C-m) in a client connected to a daemon, but works just fine when emacs is started with a frame.
(define-key input-decode-map [?\C-m] [C-m])
; translate it as synonymous with <apps> key
(define-key key-translation-map (kbd "<apps>") (kbd "<C-m>"))
;create a prefix command
(define-prefix-command 'super-keymap)
;set C-m as the prefix-command (note s- is also enabled now, so all C-m can be run with s-)
(global-set-key (kbd "<C-m>") super-keymap)
The same bug occurs after rebinding these guys C-[ and C-]
;rebind C-] keys
;rebind abort-recursive-edit, ESC will work on windows
(global-unset-key (kbd "C-]"))
(define-key input-decode-map (kbd "C-[") [control-bracketleft])
(bind-key [control-bracketleft] 'sp-backward-sexp)
(global-unset-key (kbd "C-]"))
(define-key input-decode-map (kbd "C-]") [control-bracketright])
(bind-key [control-bracketright] 'sp-forward-sexp)
The daemon doesn't of course open up a frame when it launches, hence likely it's in terminal mode. Maybe those keys on windows are not accessible from the same commands in terminal mode? Or is something else going on here?
Any takers?
Solution for me was to run the client with arguments.
pathTo/emacsclientw.exe -n -c -a "" -e "(rebind-keys)"
(defun rebind keys ()
(progn
(bind "C-x" 'bound-function-x')
(bind "C-y" 'bound-function-y')))
This question already has an answer here:
Why does Ctrl+. not work when I bind it to a command in Emacs?
(1 answer)
Closed 9 years ago.
I recently installed jedi from el-get master branch.
jedi binds C-. for jedi:key-goto-definition but it's only working in X mode. It fails to bind when launched with -nw(no X) mode in both Emacs23 and Emacs24.
So, I tested simple binding in scratch buffer and then evaluated by C-x C-e.
(global-set-key (kbd "C-.") 'find-name-dired)
It worked well in X mode, but failed in no x mode(-nw).
Do you have any idea?
Thanks in advance,
Edited
Here are some results of C-h k C-. after installing above command:
$ emacs -nw -q (without X)
. runs the command self-insert-command, which is an interactive
built-in function in `C source code'.
It is bound to many ordinary text characters.
(self-insert-command N)
$ emacs -q (With X)
C-. runs the command find-name-dired, which is an interactive
autoloaded Lisp function in `find-dired.el'.
It is bound to C-..
(find-name-dired DIR PATTERN)
The terminal can't represent C-.. Find another key sequence and use ut, e.g. C-c ..
How can change this behaviour:
C-s — start incremental search
type word — misprint the last character
Backspace — Oops! incremental search disappears, and I actually delete 1 character from the buffer.
to that one:
C-s — start incremental search
word — misprint the last character
Backspace — delete the last d character
type k — work — correct, and continue the search
I run Emacs in text terminal via SSH in PuTTY.
Operating system version: 2.6.16.60-0.58.1.1882.3.PTF.638363-smp #1 SMP Wed Dec 2 12:27:56 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux
Emacs version: GNU Emacs 23.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.14.6) of 2010-07-16
With the -q option, Backspace sent by PuTTY is just C-h, and it acts like C-h, but in my .emacsfile I it bind to delete-backward-char:
(global-set-key [(control h)] 'delete-backward-char)
Try this:
(define-key isearch-mode-map [(control h)] 'isearch-delete-char)
What you should do is configure PuTTY to send C-? (byte 127) for Backspace instead of C-h (byte 8). This is the setting that works best in most circumstances. See the
PuTTY manual.
If you changed the PuTTY setting to send C-h because some other application didn't work, check that your terminal settings are correct on the server. The setting is often correctly autodetected, but sometimes you may need to add stty erase '^?' to your shell configuration file (.bashrc or similar) on the server.
If you really absolutely have to have Backspace send C-h, then globally rebinding C-h isn't sufficient. Instead, add (normal-erase-is-backspace-mode 1) to your .emacs. See the Emacs manual.
How you should use Emacs:
C-s - start incremental search
type word - misprint the last character
M-e - goes into edit-search-word-thing-mode-in-minibuffer :-)
correct the typo
C-s - continue incremental search
I'm using python-mode 6.0.1 on OS X, emacs 23.3 (http://emacsformacosx.com/ version).
I'm trying to get C-c C-c to default to python 3.
I have the following in my .emacs:
(setq py-python-command "/usr/local/bin/python3")
And when I run C-h b py-python-command, it tells me the value is that (correctly).
However, running C-c C-c still opens 2.7.2.
I also tried adding:
(setq py-which-shell "/usr/local/bin/python3")
as suggested here: Both Python 2 and 3 in Emacs, but that doesn't change anything (py-which-shell does get changed, but it still launches 2.7.2).
Any ideas?
Try adding the following code to your Emacs init file:
(add-hook 'python-mode-hook
(lambda ()
(setq py-python-command "python3")
(setq py-default-interpreter "python3")))
py-default-interpreter for now is an alias only, delivered for backward compatibility
You might have encountered a bug.
Please file a report giving some example code at
https://bugs.launchpad.net/python-mode
Should the buffer code contain a shebang specifying pythonVERSION , than this takes precedence over default setting.
You may enforce executing buffer through specific pythonVERSION by calling
a command of class py-execute-buffer-pythonVERSION
See menu PyExec, entry Execute buffer ...
does anyone know how to enable Ctrl-o to switch to normal-mode for one command in viper-mode or vimpulse? In viper-mode it's bound to open-line (which is what it does for vanilla Emacs and in vimpulse it is bound to (vimpulse-jump-backward ARG). I'm using Viper-mode + vimpulse at level 2.
If you're in insert-mode and want to execute one Vimpulse command :
(vimpulse-imap "\C-o" 'viper-escape-to-vi)
(it is bound by default to C-z in insert-mode)