In older Emacs versions C-x 8 " a used to insert ä (LATIN CAPITAL LETTER A WITH DIAERESIS). Now, there is only C-x 8 RET to insert a Unicode character.
C-x 8 C-h tells me that there is only this single binding to ucs-insert with prefix C-x 8.
Is there a mode to get the olde combinations, too?
I am running 23.3.1 and have no choice to upgrade.
To locate the problem, I first C-x r t ;xyx;ed about half of the .emacs.el. It soon boiled down to an old library that happened to have:
(setq key-translation-map)
whose value was originally
(24 keymap
(56 . iso-transl-ctl-x-8-map)))
24 is also known as ^X and 56 as ?8.
What I still do not understand about this is this: After C-x C-eing (setq key-tranlation-map) all the C-x 8 combinations are undefined except C-x 8 RET. (Warning: don't try it with your working, loaded Emacs, take a fresh -qed one).
Related
I love the Emacs keyboard-macro functionality and I am using it a lot.
Sometimes, I don't want to just statically enter certain keyboard macros, but there should be a value there that will get changed in between. There is the feature of Emacs Macro counters (Macro counters in Emacs Manual).
The problem is that this counter always just counts up by one. Is there a way to specify the stepping size (i.e. move forward by 4 in each step)?
Thanks in advance for your help!
You can use kmacro-add-counter, bound to C-x C-k C-a.
For example to add 3 to the counter, use M-3 C-x C-k C-a.
Small full example: <f3> <f3> RET M-3 C-x C-k C-a <f4> <f4> <f4> <f4> will produce:
0
4
8
12
Alternative to kmacro
Sometimes, you can use tiny to do
what kmacro does in fewer keystrokes and with better undo context.
The above example can generated by entering:
m\n3*x4
and pressing the shortcut for tiny-expand. I bind it like this:
(global-set-key (kbd "C-;") 'tiny-expand)
Here, m\n3 basically means 4 repetitions (index starts from 0) joined by the newline character (\n). And *x4 is a shorthand for Elisp (* x 4).
In every single other program I have ever used in the last 15 years across windows, osx and linux, I enter a tilde by pressing, the tilde key and then space. The Portuguese keyboard has a dedicated key for tilde where it is the primary character (no need for shift), it is used to compose ã and õ by pressing tilde then a or o. In emacs pressing tilde does nothing and posts "dead-tilde is undefined". How can I make emacs write a '~' when I press the '~' key in pt layout ?
Edit:
I think this is a better solution: It should match your experience in other applications where ~o gives õ and ~ followed by a space gives ~.
Tell Emacs you wish to use the portuguese-prefix input method. Interactively, you can do M-x set-input-method RET portuguese-prefix RET. To make this permanent, add something like this to your config file:
(set-input-method 'portuguese-prefix)
Original answer:
self-insert-command doesn't seem to work well with dead keys.
Try this instead:
(defun my-insert-tilde ()
(interactive)
(insert "~"))
(global-set-key (kbd "<dead-tilde>") #'my-insert-tilde)
add
(require 'iso-transl)
to Emacs init file (init.el). With this line tilde+space prints a tilde, and tilde+a prints ã.
This seems to be due to "Emacs and some input method managers (ibus and SCIM) don’t work together".
I would like to put actual logic symbols into my emacs buffers, e.g., the logic symbol "∀" or "∃" or "⇒", directly into my (fundamental) text or .org or whatever buffer. I found xmsi-math-symbols-input.el at ErgoEmacs, but I'm wondering if this is "best practice." Maybe the best practice is to just right Tex/Latex copy, especially if I'm doing org-mode?
You can just use the corresponding Unicode characters normally in Emacs. Bind any that you want to any keys you want. For example:
(global-set-key [f2] "∀")
(global-set-key [f3] "∃")
(global-set-key [f4] "⇒")
To get the string with the char, you can use C-x 8 RET and type the name or code point of the Unicode char. In other words, C-x 8 RET lets you insert any Unicode character.
For example, the Unicode code point for ∀ is 2200. C-x 8 RET 2200 RET inserts a ∀ character.
And the Unicode name of ∀ is FOR ALL. C-x 8 RET for all RET also inserts a ∀ character.
The reason you might want to bind a particular character to a key is for convenience - C-x 8 RET is very general, and generally slow.
At least in org-mode, it is possible to place special symbols in an .org buffer just as their raw latex markup, e.g.:
\forall
becomes the UTF-8
∀
when you do C-c C-x \
... but this isn't a general solution.
The way I do it is with the TeX input method. I.e. use C-u C-\ TeX RET after which typing \forall will insert the ∀ char.
[ Well, in reality , I have TeX set as my default coding-system, so I really only need to hit C-\ to enable this input method. ]
I tried sometimes and realized that exporter can recognize $1100^{\circ}C$ and 1000^\circ, but can not recognize 1000^\circC and 1000^\circ C correctly, so which is the best way to add a ℃? I would not like to use $1100^{\circ}C$, because it need to add two whitespaces in both sides.
Why not use an appropriate wysiwyg character here.
A sample org file:
Foo! The temp is 12 °C.
The PDF after C-x C-e l o:
Different extended alphabet symbols can be typed with Emacs' C-x 8 subbindings. For instance:
Key Gives
---------------------
C-x 8 o °
C-x 8 u µ
Be sure to check C-x 8 C-h for some of the mapped symbols.
Check also the input method TeX. It is pretty cool. It translates directly written TeX macros into unicode symbols. C-\ TeX RET and you're set.
If i would insert a Celsius symbol with C-x 8 o , it still would convert it to a non printable or useless character. The only way the Celsius sign works for me is when i insert it in org-mode with \textdegree
Another possibility is to replace the symbol with some latex command. I would recommend the siunitx package which I think yields better results in general. For example, with the code below and \usepackage{siunitx} in the header, you could write 12 °C in the Org document and it becomes \SI{12}{\degreeCelsius} in the tex file.
(defun org-latex-replace-degree (text backend info)
(when (org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string
"\\([0-9\.]*\\)\s?\\(°C\\)" "\\\\SI\{\\1\}\{\\\\degreeCelsius\}" text)))
(add-to-list 'org-export-filter-plain-text-functions 'org-latex-replace-degree)
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Emacs, switch to previous window
other-window advances me to the next window in the current frame, but I also want a way to move back to the previous window.
Emacs has next-buffer and previous-buffer, but no analogous interactive functions for window navigation. Just other-window.
Provide a negative argument with C-u - ("Control+U" then "minus"), or even more simply C-- ("Control minus").
Move to previous window: C-- C-x o
Move to previous frame: C-- C-x 5 o
From code, (other-window -1) or (other-frame -1) will do the same thing.
Check out the help for the key you want to reverse (e.g. C-h k C-x o to show help for C-x o) and if it says "A negative argument..." you know you can use C--.
This is an old post, but I just wondered the same. It seems there now is a function for this in Emacs: previous-multiframe-window.
I have it bound to C-x O, as in uppercase letter o. Now I just throw in shift when I want to go backwards.
(global-set-key (kbd "C-x O") 'previous-multiframe-window)
Put this in your .emacs, and bind it to whatever key you like
(defun back-window ()
(interactive)
(other-window -1))
A slightly less annoying shortcut available by default isC-- C-x o. That way you don't have to switch between Meta and Control while typing the prefixes.
Different from what you asked for, but the windmove package lets you move between windows according to their relative screen locations, which can be much easier than repeatedly doing C-x o.
Instead of C-u -, you can also give a negative prefix argument with just M-- (Meta-Minus) , i.e. switch to previous window with M-- C-x o.