emacs neotree go to directory when using helm projectile - emacs

How can I make it such that whenever I do helm-projectile-find-file, neotree will jump to that directory?

you could add an advice to helm-projectile-find-file that it runs neotree-find once it's done.
Something like this:
(defadvice helm-projectile-find-file (after helm-projectile-find-file activate)
(neotree-dir default-directory))
Hope this helps

Related

How to solve 'emacs emms player list is empty'

I was trying to use emacs emms to play music.
I loaded the playlist. And chose a song. Pressed enter to play it.
But emms showed a message in minibuf: emms-player-list empty
What should I do?
emms is installed. M-x package-install RET emms.
Should I install something else?
The exact same thing happened to me.
It's because I use use-package and misconfigured it (defer option to t and code not loaded after emms invocation).
This is a working use-package declaration :
(use-package emms-setup
:ensure nil
:init
(add-hook 'emms-player-started-hook 'emms-show)
:config
(setq emms-show-format "Playing: %s")
(emms-all)
(emms-default-players)
(setq emms-source-file-default-directory "~/Musique/")
)
Without use-package, referring to the quickstart guide, a simple
(require 'emms-setup)
(emms-all)
(emms-default-players)
should get you rocking !

Force neotree to stay at project root

I'm using neotree and projectile. I can open neotree at my project root using neotree-find-project-root, and it's beautiful.
When I open a file in a subfolder, it changes the neotree root to the folder that contains that file. This is less useful to me than if neotree view remained the project root.
Can I force neotree to always display the project root folder, and not automatically descend into subfolders?
(Toggling neotree off and on again using neotree-find-project-root will bring it back to the root, but it's a pain to do this manually. There must be a way to automatically do this?)
I don't see a way to configure neotree to do this. You could consider submitting an issue to the developers of neotree, as this seems like it would be a common feature request.
As a sort of hacky fix, you could try something like this.
(add-hook 'find-file-hook
(lambda ()
(let ((buffer (current-buffer)))
(neotree-find (projectile-project-root))
(set-buffer buffer))))
This hook is run every time a new file is opened. It changes the neotree directory to the projectile project root, then sets the current buffer to the original buffer you were working with.

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!

Show all possible completitions in Emacs using auto-complete.el

I have auto-complete.el, using Emacs. When I type something, only part of the suggestion appears, and I want to set a key shortcut or something, to enable the whole thing and show all possible suggestions. Using it in Python mode.
When I first installed it, I used it once, don't remember how (possibly automatically).
Try this:
(add-hook
'python-mode-hook
(lambda()
(define-key python-mode-map "\C-i" 'auto-complete)))

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)