how to get rid of text beside emacs toolbar buttons - emacs

Running under ubuntu, emacs has a text description of buttons in the toolbar, even have something like
|(separator)
which is really annoying.

Look at the variable tool-bar-style. You can do this with C-h v. You can then either click the "customize" button at the bottom of the help buffer, or you can just evaluate
(setq tool-bar-style 'image)

Related

Emacs: How to enable toolbar mode and menubar mode only under a certain mode?

I use Emacs. However, I am not familiar with Lisp although I do know some functional programming, and hence I never really understood how to customize the init.el.
So basically, I want to be able to enable the toolbar mode and menubar mode only if I am in R-mode.
I know that to enable these mode simply requires:
(tool-bar-mode 1) and (menu-bar-mode 1)
but what if I want to do this locally, i.e. enable them only if I am in R-mode.
What should I put in the init.el ?
It's possible with this advice:
(defadvice select-window (after select-window-change-menubar activate)
(let ((yes-or-no
(if (memq major-mode '(r-mode lisp-interaction-mode))
1 -1)))
(menu-bar-mode yes-or-no)
(tool-bar-mode yes-or-no)))
I added two modes to the list for now, lisp-interaction-mode is the
mode of the *scratch* buffer, so that it's easy to test if the
advice works.
It's super-annoying, but kind of cool at the same time. I hope it's
what you want.
The features I describe here are close to what you are asking, but not an exact match. If your real need is to not have the tool bar around all the time when you don't need it, then they might help.
Library Tool-Bar+ provides two possibilities that limit when a tool bar is shown:
tool-bar-here-mode:
Enable the tool bar for specific frames only. Presences or absence of the tool bar is a frame thing, not a window or buffer/mode thing. When present, the actual contents of the tool bar (its icons) are specific to the selected window and its buffer. But whether or not the tool bar is shown has to do with the frame.
You enable showing the tool bar for the selected frame with command tool-bar-here-mode. You can add this to a mode hook, so that when a given mode is enabled so is the tool bar:
(add-hook 'info-mode (lambda () (tool-bar-here-mode 1)))
But that does not turn the mode off when the same frame no longer shows a buffer with that mode. In this regard it does not answer your question exactly.
tool-bar-popup-mode:
Hide the tool bar, and just put a Buttons entry in the menu-bar. When you click it the tool bar pops up for a single tool-bar action. So:
a. Click Buttons - the tool-bar pops up.
b. Click a tool-bar icon to effect its action - then the tool bar is hidden again.
For the toolbar, you can bind it to one of your mouse buttons or a key-sequence. For example, try this in your .emacs file:
(global-set-key [mouse-8] 'tool-bar-here-mode)
(tool-bar-pop-up-mode 1)
Depending on your mouse, you'll need to change 'mouse-8' to reflect the mouse button you wish to bind to. (Hint, click your desired mouse button while Emacs has the focus and you will see a message at the bottom like:
is undefined
Alternatively, you can bind to a key on your keyboard, like for instance:
(global-set-key (kbd "C-.") 'tool-bar-here-mode)
which will bind it to the CTRL-.

emacs artist-mode bind right click to menu

I'd realy like to use emacs-artist mode to document my code as seen here: http://www.cinsk.org/emacs/emacs-artist.html
But I can't access the menu like in the screen cast. It seems that the menu is boud to the 3rd (middle) mouse button. But my mouse has only 2 buttons.
How can I reconfigure my emacs key binding for emacs artist-mode that it uses the 2nd (right) mouse button for the menu?
I'd like to set the binding only for artist-mode of course.
Thank you for your help!
This is what I put in my .emacs.el
(eval-after-load "artist"
'(define-key artist-mode-map [(down-mouse-3)] 'artist-mouse-choose-operation)
)
Thanks for the right hints!
FWIW, the right button is the one Emacs calls mouse-3 and the middle buttong is the one Emacs calls mouse-2. You should report this problem via M-x report-emacs-bug because I think it's a bug.
You can fix this problem with something like:
(define-key artist-mode-map [down-mouse-3] 'artist-mouse-choose-operation)

Disable auto-complete's pop-up menu in emacs

How to disable auto-complete's pop-up menu from showing up? I would simply like one simple suggestion much like in googles' suggestions (and also implemented in auto-complete itself).
Strangely it shows this in grey right before the pop up menu, how to make it stay like that?
Adding the following line to your init file should do the trick.
(setq ac-auto-show-menu nil)

Emacs: mitigating dependancy on the mouse

In Emacs, how does one emulate mouse button presses and the like using a keyboard? For example, with CEDET's Semantic (included with GNU Emacs 23.2.1), includes can be right clicked to provide a menu; how can I make that menu, and others, with the keyboard, appear as a tooltip or in the minibuffer a la M-` that allows one to access the menu bar?
You can find out what command the mouse-click is running using C-h k (describe-key), followed by the mouse-click in the appropriate place. You could then bind that to something on the keyboard.
It's not exactly what you're asking, but you should be able to use it to accomplish the same thing for all the clicks you care about.

Preview colours in Emacs-ESS

I accidentally managed to get colour names, #HEX, and a colour preview in Emacs. Don't have a bloody idea how, must've pressed some keybinding or menu item... But, now I can't seem to find where's that feature... I'm quite sure I wasn't hallucinating, so it's gotta be there, under some keystroke that I can't reproduce!!! =)
So, what is your question? :)
What you've described can be reproduced by M-x list-colors-display (or Control-click with middle mouse button, then select display colors from the pop-up menu) -- and it's an Emacs feature, nothing to do with R or ESS. Is that what you are looking for?
If/when you find yourself in that situation, where something happened in Emacs, but you don't know how. You can ask Emacs what the last 300 keys you pressed were with C-h l (which is bound to 'view-lossage, and that might give you enough information as to what you did.