emacs, auto-complete doesn't suggest anything - emacs

Hy guys
I finally decided to get into emacs. However setting it up as my C-IDE it encountered difficulty with autocomplete. First of all, here's my .emacs file:
; start package.el with emacs
(require 'package)
; add MELPA to repository list
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
; initialize package.el
(package-initialize)
; do default config for auto-complete
(require 'auto-complete-config)
(global-auto-complete-mode t)
(set-default 'ac-sources
'(ac-source-imenu
ac-source-dictionary
ac-source-words-in-buffer
ac-source-words-in-same-mode-buffers
ac-source-words-in-all-buffer))
(ac-config-default)
; start yasnippet with emacs
(require 'yasnippet)
(yas-global-mode 1)
The thing is, yasnippet is working fine. When typing in for and then pressing TAB will bring up the full for-body and I can go through the different elements by pressing TAB.
But when for example typing whil I expected with auto-complete installed, that if I now hit TAB, that there'll be a window coming up with suggestions or it at least starts to auto-complete, but this isn't the case. When typed in whil and then pressing TAB nothing happens, and after quickly typing twice it indents the line my cursor is on by a tab.
What's going wrong here? How can I fix this?
Thanks for your help in advance! :-)

The problem was, that I had old popup packages installed; after updating all of my packages it works.

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 !

Getting browser-style tabs in emacs

Really new programming student here, and I'm trying to get tabs in emacs (browser style, like Aquamacs has).
So, how do you get tabs in emacs? A strip of labels showing me which buffers I have open, and clicking on one of them selects that buffer.
I have googled this extensively, but not being fluent in elisp makes it really hard to understand. I have installed the tabbar package, but I do not know where to go from here.
What do I want? Just tabs, and a command to open new tabs, for example C-t (or whatever is best).
I have installed the tabbar package, but I do not know where to go from here.
The tabbar library provides a global minor mode named tabbar-mode, so you will want to enable that in your init file. If it's installed somewhere in your load-path then the following will work:
(when (require 'tabbar nil t)
(tabbar-mode 1))
There is lots of documentation in the library's Commentary, which you can visit like so:
M-x find-library RET tabbar RET
Try this, it's called tabbar and should allow you to do what you're looking for.
As the other answers, tabbar is what you're looking for.
You need to copy it to wherever you keep your emacs files (if you don't have such a place - make one, tabbar will not be the last add-on you'll use :) ), load the file and start the tabbar-mode.
In the below code, the emacs files dir is .emacs.files and it is in my home dir.
(setq tabbar-file
(expand-file-name "tabbar.el"
(expand-file-name ".emacs.files" "~")))
(load-file tabbar-file)
(tabbar-mode 1)
(define-key global-map "\M-[" 'tabbar-backward)
(define-key global-map "\M-]" 'tabbar-forward)
In the above code, I also added binding of scrolling through the tabs to Alt-[ and Alt-].
As to opening new tabs - every time you'll open a new file, it will be opened in a new tab, so don't worry...

How do I activate "lisp mode" for cljs files in emacs?

Currently emacs isn't turning on paredit and isn't using any syntax highlighting when I edit .cljs files. It does when I edit .clj files and I want it to treat .cljs similar.
What do I have to do?
If you already have everything working for clojure you can just turn clojure-mode on for the current buffer using
M-x clojure-mode
If you want it turned on automatically you need to add an entry to the Auto Mode AList. In my case, adding the following to init.el did the trick:
(add-to-list 'auto-mode-alist '("\.cljs$" . clojure-mode))
After that you need to reload your init.el (M-x load-file) and re-open the file.

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)))

Autocomplete function name in haskell-mode

had a system crash and my .emacs got lost. Before the crash, haskell-mode auto completed function names when pressing tab button on a new line. Unfortunately I'm unable to reproduce this behaviour in my new .emacs.
Any one got a clue on how to enable this behaviour?
(load "~/.emacs.d/haskell-mode/haskell-site-file") (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
solved my problem