how to cancel highlight in Mac OS emacs - emacs

I realize it might be not an interesting question, but does anyone know how to cancel the highlighting area (shown in the yellow) in Emacs24.
I first selected that area and entered M-w (I meant to copy that area), then the highlighting shows up. The behavior seems quite mysterious to me since most of the time M-w works fine. Can anyone shed some light on why that happens?

I think you select the area by C-SPC, you could press C-SPC again to unselect them. If this doesn't work, you could press C-g to quit(I think the highlight will disappear). If all do not work as expected, you could press ESC ESC ESC, I think this could help you out.

Related

Emacs ace jump mode: how to scroll?

As far as I can tell, ace jump will only jump to items found in the visible part of the buffer. Once I activate ace jump, and matches to my selection are highlighted, I can jump to any of them, as long as they are visible. But what do I do if I want to find matches in the part of the buffer that it not visible? Attempts to scroll the buffer causes ace jump to quit.
What you want seems like a good idea, but it doesn't really work. You would need to know what keypress you need to get to an off-screen match, and you can't know what those are because they are off-screen. Ace-jump is for jumping around the visible buffer.
Other options are isearch, M-x occur or structured tools like imenu, speedbar, ecb and so on.

Indenting multiple lines: Keyboard shortcut

I think I was told once how to indent an entire collection of lines quickly and at the same time with a keyboard shortcut in Eclipse (I'm using Juno with PyDev-Python). Does anyone know of such a shortcut? I can't seem to dig anything up.
Thanks.
Just highlight the lines and push tab.
Select the lines and Press TAB - for Right
Select the lines and Press SHIFT+TAB - for Left
Select all, then do Ctrl+I.
The advantage of this method over selecting some lines, then pressing Tab, is that it is much faster to do Ctrl+A then Ctrl+I, than tabbing lines at a time. I do automatic indenting all the time, it's basically in my reflex. Like saving.
A quick googling would have helped you faster.

Prevent mouse-selected text from being put into Emacs paste buffer?

In emacs, there is a feature where if I select text with a mouse, then without pressing
ctrl-c I can paste into emacs with ctrl-v if I have cua mode turned on.
I want to turn off this feature while keeping the cua mode on. I mean I want to
explicitly press ctrl-c so that the text will get copied to the clipboard.
I suspect that you are using a version of Emacs older than version 24? If so, see the last paragraph of this page of the current Emacs manual. You can probably get rid of the behaviour you dislike by setting x-select-enable-primary to nil.
From my quick tests, setting it to T (which isn't the default on Emacs 24) reproduces the problem behaviour, and this happens both in and not in cua-mode.

How can I configure emacs to switch to a particular buffer when I click the mouse in it?

I'm using iTerm2 on my mac to ssh into a Linux box and run emacs in the terminal. On a big monitor, I like to split the window to see multiple buffers side-by-side. I'd like to be able to switch to a particular buffer by clicking the mouse in it (rather than doing C-x o).
What seems to be happening is that if I click the mouse anywhere outside the currently active buffer e.g. in the next buffer, on the mode line etc., the click is being interpreted as which is bound to (tmm-menubar-mouse EVENT).
I have disabled the menubar by doing the following in my .emacs_d/init.el:
(menu-bar-mode -1)
This seems to disable the visible display of the menu bar at the top of the window, but the mouse click behavior I described is still happening.
I think what I need is to have the click interpreted as something other than and then bind that to some function that detects which buffer the click happened in and switch to it. But, I don't know how to do that and the searching I've done hasn't yielded any clear answer. Can anyone help?
Alternatively, I looked into using windmove to enable switching between buffers with SHIFT and the arrow keys. I did (windmove-default-keybindings) but emacs then seems to respond to SHIFT left-arrow by inserting "2C" into the buffer and SHIFT-right-arrow by inserting "2D". If anyone has any tips on making this work too, I'd love to hear them.
Thanks
I ran into this problem a while ago, where clicking on column > 95 was interpreted as <menu-bar> <mouse-1>, which invokes tmm-menubar-mouse. It turned out to be a bug:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6594
There hasn't been a formal release since this bug was fixed, but you can get the patch here:
http://bzr.savannah.gnu.org/lh/emacs/emacs-23/revision/100618
If I recall correctly, you should be able to just drop the modified file into your existing emacs installation and byte-compile it (assuming you're running the 23.3.1, the latest release).

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.