Making the emacs cursor into a line - emacs

Hi I have been using Emacs23 for some time now and find it a really cool editor. However I am not happy with the cursor (or point in Emacs lingo) being a ' little black box'. I want it to be a nice thin straight line just the way it is in gedit or notepad. Any suggestions on how to do this?

Add this to your .emacs file:
(setq-default cursor-type 'bar)

Related

Changing emacs terminal color theme

This might be dumb question but I'm a newbie and having a lot of trouble changing my emacs color scheme. I think i already changed colors for my desktop version of emacs, but whenever i open .c files from terminal, they turn up just plain black and white?
Anyways,
I really want to download the monokai color scheme but I'm really confused on the directions for installation. Would someone mind helping me through with it?
https://github.com/oneKelvinSmith/monokai-emacs
it says to
"Download monokai-theme.el to the directory ~/.emacs.d/themes/. Add this to your .emacs:"
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
How do i download something through emacs? I know it has something to do with adding stuff to the .emacs file...but do i just put it anywhere in there? I know theres already lines in there and I don't want to mess any of that up.
Thanks!
1)Open github.com/oneKelvinSmith/monokai-emacs
2)You have a green button (up right) "clone or download " to download monokai-theme.
3)After downloading, unzip monokai-emacs-master.zip
4)If necessary do : mkdir ~/.emacs.d/themes
5)cd monokai-emacs-master;cp monokai-theme.el ~/.emacs.d/themes/
6)add to your ~/.emacs : (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
7)Inside emacs :M-x load-theme RET monokai (of course RET is return)

emacs doc-view new frame

I am new to Emacs and presently I am using it heavily for LaTeXing.
Please help me out with the following customizations:
How to scroll continuously in doc-view-mode? I have
(setq doc-view-continuous t)
in my .emacs file. This enables scrolling through the pages, however, the pages "jump" to the next one. I do not like reading to the bottom of the screen. Is it possible to resolve it?
I invoke doc-view using C-c C-c and the PDF loads into a new window. Is it possible to load it in a new frame?
I have used
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
in my .emacs file. This works fine. However, the first line is just below the top screen. Can I create some margin ONLY on top?
How do I copy/paste from Emacs to other application, like a browser? I couldn't copy the code above using C-w in Emacs and then Ctrl-v in Iceweasel (browser). I had to use Kate, sadly. (This I realized while typing this question!)
Regards,
Saurav Agarwal
You should be able to scroll "line by line" with C-n and C-p.
I do not know that mode (I use tex-mode), but what you probably want is to find out how C-c C-c is invoking doc-view and use it with other-window, for example:
(defun new-frame-dvi-file ()
(interactive)
(split-window-right)
(other-window 1)
(tex-view))
I could not find anything that sets a top margin ONLY, but found this:
(set-frame-parameter nil 'internal-border-width 10)
You can share clipboards with this:
(setq x-select-enable-clipboard t)
Anyway, even if it sounds really boring, sometimes it is really useful to take a look at the manual. Sometimes you don't need to read it all and you can find the answer quickly ;-)
Hope it helps!

How to enable global menu bar for Emacs on Ubuntu (Unity 11.04)

I use latest Ubuntu 11.04 which has Unity desktop. I am learning to use Emacs 23.
As you know, Unity has top panel. I want to enable global menu bar for Emacs so that I could save valuable screen space. (I use small screen laptop)
How to enable global menu bar? Your help will be much appreciated. Thank you.
Use your favorite editor to open this file: /usr/lib/gtk-2.0/2.10.0/menuproxies/libappmenu.so
Find the word "emacs"
Change "emacs" to other word
Save the file
sudo ldconfig
update:The file of "libappmenu.so" moved to "/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/menuproxies" now in ubuntu 12.04.
appmenu-gtk (which provides the global menu bar) specifically blacklisted emacs since it does not play nicely together so unfortunately you probably can't use it with emacs.
Cleaner way to circument the blacklist:
ln -s /usr/bin/emacs somewhere_on_PATH/emacs-with-global-menu
any name except "emacs" works.
You might need workaround for updating menus from http://code.google.com/p/gnome2-globalmenu/issues/detail?id=357#c8 (don't know if still relevant, or if that's the only problem):
(defun menuupdate () (menu-bar-mode -1) (menu-bar-mode 1))
(add-hook 'window-configuration-change-hook 'menuupdate)

How do I fix this random behavior with my Emacs mode line?

I am running Emacs 23.3 on Windows XP. When Emacs is started, the mode line will assume one of these two appearances at random. Needless to say, I prefer the first one. How do I figure out what is going on and how do I make the first one stick?
The images don't show it, but the first one has a GUI type appearance. If I hover over the various bits of text with a mouse, e.g. Help then the text Help turns into a button with shadows etc.
The black mode line appears to be a text mode widget. The only thing that the mouse will change on it is the highlighting.
PS: Thanks JSON!
I vaguely remember this happening years ago depending on whether or not I started Emacs from Remote Desktop. Perhaps there's an issue with color depth?
See if anything has changed your settings to
(set-face-background 'modeline "#000000")
(set-face-foreground 'modeline "#FFFFFF")
(EDIT: Color codes corrected) in any of your .el files.

Mac OS X Emacs Does Not Highlight Comments Correctly

I'm pretty old school sometimes and I like working with Emacs in my terminal. (I work with IDEs all the time. But sometimes, when in the privacy of my own home, I just like a text editor a terminal and a beer)
However, the default Emacs that comes with OS X does not seem to highlight the comments in font-lock-mode. I've seen this behavior in both Python and C mode.
I've already searched some forums and I found one post where the person was having the same problem as me:
http://forums.macosxhints.com/showthread.php?p=512361
Is is there any way to fix this problem?
I had this exact same problem. The solution is to change the color used for the comment face as follows:
(set-face-foreground 'font-lock-comment-face "red")
Or, if you only want to do this for certain modes:
;;; Only do this for the common C mode (C, C++, Objective-C)
(add-hook 'c-mode-common-hook #'(lambda () (set-face-foreground 'font-lock-comment-face "red")))
For more information on faces, see http://www.gnu.org/software/emacs/manual/html_node/emacs/Faces.html.
I'm not sure exactly how to fix it, but I'm fairly certain there's something you can put in the .emacs file. In fact, I think I've done that before. I'll look for my file and let you know what I can find.
I'll try and get you my .emacs file when I get home from work tonight.
[edit] I've looked and looked, and can't find a .emacs file on either system that I use, and on my OS X install (Leopard default), it looks like it does it correctly by default. I did some research here, and it looks like the default installations no longer use .emacs files, because there's folks like me that mess around with them and break things, and they got tired of having to help us fix it. But, there is a set of menus that will let you tweak things. Start by typing "M-x customize RET", where M is the meta character (on my OSX install, this is the esc key. Don't hold it down, just type it like a regular character. That'll get you into a menu of stuff you can change. I didn't poke around too much, so I'm not sure where in the menu you'll find what you're looking for. Sorry I couldn't be more help.
In my experience this is usually related to a unpaired quote (single-, double-, or otherwise) somewhere in an existing comment.
Hunt those occurences down and eradicate them in your source code (or if you are more ambitious, see if you can update the fontlock code in your major modes' emacs source code)
When I have encountered this in editting Perl in emacs, I often switch major modes to cperl-mode as it typically handles parsing the perl better than the default perl-mode.