Emacs 23 on Ubuntu - menus between Tools and Help are broken - emacs

I have used succesfully used for some time
GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.0)
on Ubuntu 9.10. With all kinds of plugins and additions.
Now I have installed a completely new Ubuntu, that's 11.04, and I installed most of the emacs and related emacs plugins with apt-get.
This is what I have installed.
i A emacs23 - The GNU Emacs editor (with GTK+ user interface)
i A emacs23-bin-common - The GNU Emacs editor's shared, architecture dependent files
i A emacs23-common - The GNU Emacs editor's shared, architecture independent infrastructure
v emacs23-gtk -
i A emacsen-common
And my version now is:
GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.4)
of 2011-04-04 on crested, modified by Debian
The problem is, that on when I enter any mode (css, sgml, org, sql, c, text, etc), whatever menus I have between Tools and Help do not show. So the main menu item shows (like SQL in sql mode), but when I mouseover it, it does not contain any items.
First, I thought is one of the *.el files I have in my .emacs.d or I blame it on pymacs rope ropemode ropemacs etc. But then I deleted all from my .emacs file and my .emacs.d folder and I have the same strange thing.
What is extremely weird, is that sometimes, I don't know how, when I start emacs, the problem is gone. This is like one in 50 tries. I first thought I did something (like when I uninstalled magit), and blame it on that. But then I closed and opened my emacs again, without modifying anything and the menus were broken again.
No that I installed back my .emacs .emacs.d and my plugins, since it's not their fault, I have for example on scratch buffer a Lisp-Interaction menu beginning with "Complete Lisp symbol" and then a YASnippet empty menu.
If I switch to a .py file, the first menu after the Tools menu is IM-Python, which in fact has the sub-menu items that Lisp-Interaction menu has. So when I hover on IM-Python I get "Complete Lisp Symbol", "Indent-or-Pretty print", etc. and then the rest of menus Python, Yasnippet, Rope are empty. And the last menu, Help, is good again.
I really don't know what should I try more, or how to go further and debug, I've been fighting with it for hours.
PS: oh yeah, so now I discovered an answer on stackoverflow for a similar issue, so when I hit F10 (menu-bar-open) the menu fixes, the submenu items appear correctly.
But when I open a new file and want to use the menu again, it's broken and have to hit F10 again and it works. So it's not so bad after all :) but anyway, if you have a clue please let me know.
Thanks,
Stefan

Try and duplicate the issue with a plain-vanilla emacs. To do that, startup emacs like this:
$ emacs -q --no-site-init
It should work as expected. If it does, then make a copy of your .emacs file and in the copy, delete half of it, then restart emacs normally. If the problem is there, then cut down your .emacs by half again; if it's not there, startup with the other half of the original .emacs file. Lather, rinse, repeat until you find the offending code that mucks everything up.
If it does not work when emacs -q --no-site-init is called, then there's something wonky going on in the interaction between your emacs binary and the window manager, which will be a lot tougher to track down.

Related

Using Emacs as external editor of Xilinx ISE, how to change the related buffer to current buffer when click a design file?

It has been like one year or so since I started to learn Emacs, and I do like its power and flexibility as a general text editor. When I had tried its Auctex mode for LaTeX/TeX, I knew I will never go back to read which TeX editor I should use. When I had tried its Pyhon mode, I knew I will never be bothered to choose a Python editor/IDE. Well, the same feeling for the VHDL mode of Emacs.
I do not intend to implement Emacs as a whole FPGA design solution (although I tried that). Instead, I prefer to use Emacs just as an external editor (Xilinx ISE in my case) and follow the design sequence according to the ventor's specific IDE. So according to this Editor Options, I set the editor options in my ISE {C:\Program Files (x86)\emacs\bin\emacsclient.exe} +$2 $1. However if I use runemacs.exe as suggested by Xilinx, everytime I clicked a file in ISE a new Emacs will be started. With the emacsclient.exe it helps a bit.
When I clicked a file in ISE now, its corresponding buffer will be opened in Emacs. But the buffer remains invisible and I have to C-x b to it by my self.
Also if I clicked the error information in ISE's console, the file containing the error will be opened in the background of Emacs with the cursor in the error position.
While it is not a big deal if I compare the benefits and drawbacks brought by Emacs VHDL mode, I do like Emacs can change the file I opened in ISE to the current buffer. So the question is how to set Emacs or Xilinx ISE to change Emacs's current buffer to the one I opened or clicked in ISE?
I suppose it should be some configuration related to Emacs rather than settings in ISE (obvious there is not too much choice in ISE's options). It maybe a simple question but it's beyond my current knowledge of Emacs configuration. I really appreciate if someone here could help me on this issue. Thank you guys in advance:)
P.S. Sorry for my poor English expression. Hopefully you can understand my quesition.
With some configuration it's possible to tell Emacs to switch to the related buffer. However, you might want to consider opening a new window (frame in Emacs term) when you call the editor in ISE.
The command line parameter -c tells Emacs client to open a new frame
{C:\Program Files (x86)\emacs\bin\emacsclient.exe} -c +$2 $1

set-mark-command not working emacs with C-SPC

I am not able to set the mark at the current point by C-SPC (both when emacs loads the init file and when it doesn't). However, when I do M-x set-mark-command, the mark is well set and I am able to select the region by moving the cursor. When I do M-x apropos set-mark-command, it shows two bindings C-# and C-SPC, but only the first one works. Any suggestions will be appreciated.
I am running emacs 24.3 on a GUI on Kubuntu 14.04.
Ubuntu 14.04 has an open bug affecting some desktop environments (at least KDE, LXDE and i3, but not Unity).
The default IBus key binding for "next input method" is Ctrl+Space, which prevents this key combination from reaching Emacs (or any other userspace program). To resolve the issue, run ibus-setup and change the key binding for "next input method" to something else (or delete it entirely by clicking the "..." button and then the "Delete" button).
Note that running ibus-setup from Unity, where C-SPC works already, shows a preferences window that does not include the key binding option that needs to be changed.
The "next input method" command cycles through your configured inputs, e.g. perhaps from English to French.
So I tracked down a similar issue to this on macOS. It seems that at some point C-SPC became bound to "Select the previous input source":
I just had the same issue today which I never had before. I am on Windows 7. As it turns out the Ctrl+SPC is bound to the OS's language switch. So the keystrokes are not sent to emacs at all.
But one thing that is even more weird is that I have never installed new languages/keyboards, yet the 'CH PRC' shows up in my language bar as a language/keyboard today. It turns out to be a Windows 7 bug and all I had to do to fix was:
Add 'CH PRC' in the language bar then Save.
Remove the language then Save again.
I know you are not on Windows, so the fix may not be the same as mine, but it is very likely Ctrl+SPC is bound to your OS's language switch as well.

Emacs 24 Ubuntu Menu Panel

just installed Emacs 24 on a ubuntu precise OS. The menu bar in the top panel is missing a number of options (e.g. using Auctex, all the Latex options).
I recall seeing on the web somewhere that it was possible to have the menu on top of the Emacs frame rather than the unity default of the top panel. There is an answer on SO for how to enable the global menubar in ubuntu. Can someone please point me to how to disable it in the global menu until it gets to the point where they play well together.
Thanks
Ubuntu has a hardcoded hack to disable the global menubar for applications matching certain filename patterns. emacs is among those, as is firefox, another popular program that suffers from the same sorts of problems of GTK detached menubars not updating in the usual way that X programs expect them to.
Try running update-alternatives to select emacs24 as your default Emacs, then use emacs to start it, rather than emacs24.
I was using the symlink method mentioned by #Bernhard Kausler, but found I couldn't pin the icon that resulted from staring emacs from the shell in this way without it reverting to using the global menu.
I got a working unity launcher shortcut with this .desktop file:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_NZ]=emacs
Name[en_NZ]=Gnu Emacs 24
Exec=emacs
Name=Gnu Emacs 24
Icon=emacs
StartupWMClass=Emacs24
Now I can have emacs pinned to the launcher and it launches with its own menu bar.
You can just create a symbolic link to the emacs??? command you use to launch emacs, and if the symbolic link's name is exactly 'emacs', it will not use the global menu when launched.
This is a known bug with Emacs dynamic menus where changing major modes adds or removes entries from the menu.
https://bugs.launchpad.net/ubuntu/+source/appmenu-gtk/+bug/673302
It's unfortunate that the names of the blacklisted apps are hard coded into the appmenu-gtk package, and that there does not seem to be a way to add items without touching the source code.

Text Zoom in putty emacs

I'm currently using Emacs 23.1 on a remote server through putty. I would like to be able to zoom out (so I can view all my code when needed). I've tried several methods and none of them have worked.
Text-scale-decrease and text-scale-increase give no errors but don't change the text size
The zoom-frm plugin tells me that "symbol's function definition is void: query-fontset" when I attempt to use any of its methods (all dependencies listed are installed)
The doremi-frm plugin either gives no errors and does nothing, or complains about face-remap (depending on what function is used)
I'm wondering at this point if zoom is possible within putty, and if so how do I get it to work properly.
P.S. Opening a remote X11 session with the Emacs GUI is not an option.
Thanks.
You need to config putty instead.
Open putty, then right click > Change Settings > Window > Fonts on the left panel to change font size.
What Emacs are you using? You say Emacs 23.1, but that has `query-fontset' (as do also older and more recent Emacs versions, from GNU Emacs 20 to the latest GNU Emacs 24 dev build).
Likewise, GNU Emacs 23.1 has face-remap' and all of its relatives,face-remap-*'.
I can't answer the putty questions, but can you check in some other way whether Emacs at the remote end actually zooms OK using any of the methods you describe? IOW, try to remove putty from the equation, to see what happens.

Some standard Emacs keybindings don't work on my Linux box

On my macbook everything worked nicely, but on my Archlinux box, with dwm as a window manager, the following keybindings don't work:
M-m
M-<
M->
It is kind of a pain to work without these bindings. I should note that many other Meta key bindings work fine.
Does anyone know how to fix this?
They're probably being intercepted by your window manager. I don't know dwm, but I'd try googling "dwm resetting keyboard shortcuts".
(A quick read of the results suggests dwm may need to be recompiled to do this, see http://dwm.suckless.org/)