Associate ` to <S-dead-grave> in Emacs - emacs

What do I have to write in my .emacs file in order to associate the <S-dead-grave> command with inserting the character ` (backtick).
I run GNU Emacs 23.1.1 on Unix.
Background: I run Unix via a shell that runs in Java (Oracle SGD) on a Windows terminal server. I do not have admin access on either system. My keyboard is set to Norwegian. There is apparently some bug in Java causing this to act weird with "dead" characters (like ` is on the Norwegian keyboard) and I have not succeeded in getting my administrator to fix this.
When I click ` followed by a space (as is the way to insert that character with my keyboard layout) in Emacs, I get the error message <S-dead-grave> is undefined. Hence, I believe that if I could define this, I would be able to work around this error.
Within this setup, I am also happy with alternative workarounds.

It's not completely clear to me whether you run Emacs in GUI mode or in text mode (in a terminal emulator), but based on your description of Emacs's behavior I guess it runs in GUI mode (maybe via some X server on your Windows machine?).
It's strange that you'd get S-dead-grave events, so it might be a bug in your GUI environment (your X server's config?).
But in any case
(global-set-key [S-dead-grave] "`")
might let you work around the problem.

I had the same problem and this bug report discussion reports a solution :
XMODIFIERS= emacs
I did put it into my .bashrc after testing that it works (with XMODIFIERS= emacs && emacs)
This is apparently not needed with emacs 24.4, but I use emacs 24.3.1 and still need it.

If XMODIFIERS= emacs works for you (don't forget space after equal sign), check ~/.xinputrc and /etc/X11/xinit/xinputrc or run im-config and select none. For more info consult debian reference chapter I18N and L10N

Related

Emacs can't work with ibus to input chinese

My Emacs editor can't work with ibus chinese input method, ibus shows "No input window" when cursor is on Emacs.
I run Emacs with alias like LC_CTYPE="zh_CN.UTF-8" emacs, It actually works before, but I have no idea why it doesn't work now, maybe some system update I think.
About my system: Gentoo Linux with Gnome3, I installed Emacs23 and Emacs24, and both of them can't work with ibus now.
PS: Ibus works on other programs, Emacs can display chinese characters well.
It seems the problem only happen on Gentoo. Because system update clear up some fonts. The solution is to install the missing fonts:
emerge media-fonts/font-adobe-75dpi x11-apps/bdftopcf media-fonts/font-alias media-fonts/font-util
Then after logout and re-login, I can use input method again.
I solve this problem via installing ibus.el and this seems like emacs GTK UI's problem.
make sure that ibus is configured correctly by opening the default text editor for your distribution (Mousepad, Leafpad...?), typing control-space and seeing if you can enter Chinese. If you cant you may have to install a Chinese input method or add an input method in the ibus settings.
next make sure you have the emacs, ibus mode installed. If you are using a Debian based distribution, the package you want to install will be listed as 'ibus-el'.
After installing ibus-el usually control-space will activate and allow you to cycle through your input methods; however, on some of my machines I have to help emacs to get ibus mode started by typing M-x ibus-mode.

emacs version control mode line missing

After finally upgrading from emacs 21.x to 23.x, I've lost the version control status info from my mode line.
emacs manual didn't turn up anything because it simply states that the status info should be there and offers no information about turning it on/off.
Thanks.
what do you have set as your vc-handled-backends if this is blank or doesn't contain for source control tool, vc will not be enabled for that tool.
You don't say what operating system or revision control system you use, but it may be that emacs is not able to find the right command line program. On OSX with emacs 24.3 (from http://emacsformacosx.com/), I was able to restore the vc mode line by setting the proper path. In my case, using the mercurial binary from macports:
(setq-default vc-hg-program "/opt/local/bin/hg")
Other vcs' have similar variables vc-git-program, vc-svn-program, etc.

Using clipboard/ copy paste results in chinese looking characters (debian sid)

Using Emacs on my linux box (wheezy, awesome,gnome and kde) I run into big trouble using clipboard even from one emacs instance to another.
Everything I put into the clipboard is converted into chinese looking characters in emacs. Only solution is to copy paste into some other editor (e.g. nano, vi) save it and open it in emacs.
I use the same .emacs on my other (ubuntu) computer and on windows 7 with out any trouble. I erased all my previous encoding settings I had without any success.
http://stackoverflow.com/questions/ask
after copy paste gets
栊瑴㩰⼯瑳捡潫敶晲潬⹷潣⽭畱獥楴湯⽳獡k
I run into the same problem today, with a little different environment tho. I've been using Emacs 24.3.1 on Windows 7, then switched to the same version running under Cygwin+XWin with the same .emacs.d config. While clipboard under Windows worked fine, with the config I had under Cygwin/XWin I had the same problem as in the question.
Under terminal it worked fine, with XWin the -Q worked too, so after a little digging, it turned out to be:
;; MS Windows clipboard is UTF-16LE
(set-clipboard-coding-system 'utf-16le-dos)
I don't remember why I added this. I must have copied it from some Emacs Wiki in early days. When I googled it now, it seems like a popular setting in people configs. It turns out, under Windows I don't need this line for clipboard to work properly with Emacs (quick check with some polish diacritical characters), and under Cygwin/XWin it finally started to work.
(sorry, I haven't the reputation to comment, so I leave a clarification request here)
Are you using emacs in a terminal ? if so, which one (konsole, lxterm, xterm...) ?
Are you cut'n'pasting with mouse (middle click) or keyboard ?
Have you any clipboard manager running (eg glipper) ?
Do you get the same behavior if you start without an init file (~/.emacs), that is, using emacs -Q?
If you can come up with a reproducible recipe starting from emacs -Q then, unless you get some solution proposed here, consider filing an Emacs bug report: M-x report-emacs-bug.

How Can I Get MinTTY (Cygwin Terminal) to Open Emacs in a New Window?

I can't figure out why this isn't easy to find on Google, but after searching for about 10 minutes, I just decided to give up and post here.
The subject basically says it all. I'm running MinTTY as a cygwin terminal on a Windows XP desktop. All I want to do is have emacs open up in a new window rather than inside my terminal. What would be best is a switch for this, so I could toggle it depending on my current needs. This seems like something that would be useful to a lot of people, and I know I've done it before on Linux boxes, so I imagine there must be a way to do this in cygwin too. Anyone know how?
Just start a new mintty, telling it to invoke emacs:
mintty emacs
There are a couple of scenarios that you might clarify:
Running the cygwin version of emacs within a standard windows environment will call emacs within the current shell
If the Cygwin X-Windows server (i.e., “XWin Server”) has been started and the DISPLAY environment variable has been set in the mintty terminal (e.g., export DISPLAY=":0"), calling emacs will start it in its own window.
running the Windows version of emacs within the cygwin terminal should launch the new frame you are seeking.
If you want a separate emacs 'window', you would be best served by installing the Windows native version of emacs (I use the gnu emacs precompiled binaries), and calling it from the cygwin terminal.

Coding in Emacs shell?

I am using shell in my emacs version 22.2.1 (debian stable repos) and it has some kind of broken coding. For example, if I run `ls' command, output is
[0m[01;34margouml-0.30.2[0m
not "argouml-0.30.2" as normal. I have tried commands C-x RET p utf-8 and so others but without any effect. I have properly generated utf-8 locales and everywhere else in emacs coding works perfect. Does anybody knows what may be wrong with it?
Your terminal type in the shell is set incorrectly; those escapes are for colors, but the emacs shell doesn't support them. Try M-x term instead for better support.
You can also try M-x ansi-term, or even download Multi term and try that too.
Links:
Ansi Term
Multi Term