Flycheck installation: M-x package-install [No match] - emacs

I'm relatively new to Emacs (and Linux for that matter). I'm trying to install flycheck. Following the installation instructions, I added
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
to my .emacs file (then killed Emacs and restarted).
Then M-x package-install RET flycheck RET. But Emacs says [No match]. Any ideas what I'm doing wrong?
Platform: Emacs 24.3.1, Ubuntu 14.04 LTS 64bit running on VMware (Windows 10 host).

I'm also quite new to emacs, and I've had the same problem. What worked for me:
M-x package-list-packages RET
Find flycheck, mark it with an I
Use X to install marked package.
For reference, this is how I call package in my .emacs:
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)`

Related

How can I install nginx-mode into emacs?

I want to install nginx-mode into emacs so that I can have highlighting and formatting of my nginx configuration files. What is the easiest way to do this?
This requires emacs24 or newer.
emacs now has a pretty good package management system. The default package repository ELPA has a pretty restricted set of modes and packages, so instead we'll use MELPA which is actively maintained and growing.
First, install MELPA:
emacs /sudo::/etc/emacs/site-start.el
Paste in this code: (from https://melpa.org/#/getting-started)
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
Save and exit.
Second, install nginx-mode
To get nginx pretty-printing and indentation, do this to install nginx-mode:
emacs
M-x package-list-packages RET (Type meta-key and S, then type package-list-packages and hit return)
C-s nginx RET (Type control-S to search, type nginx and hit return to find the nginx-mode package)
i (to mark it to install)
x (to execute installation of marked packages)
Use nginx-mode
Now you can switch into nginx-mode with M-x nginx-mode. E.g.:
emacs /sudo::/etc/nginx/sites-available/default
M-x nginx-mode RET
You can make it recognize the sites-enabled files automatically by looking at these instructions.
If you can't use melpa:
You can download the file nginx-mode.el from https://github.com/ajc/nginx-mode and copy it in ~/.emacs.d/
Then in you .emacs you can add
(add-to-list 'load-path "~/.emacs.d/")
(autoload 'nginx-mode "nginx-mode" nil t)
(add-to-list 'auto-mode-alist '("nginx.conf\\'" . nginx-mode)) ;; or M-x nginx-mode

New to Emacs, issue with Melpa

I followed their guide on github and put the following in my init.el file:
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
However when I go M-x package-list-packages I either get a Melpa not found error or a 'missing zlib library' error, and it only shows the gnu packages. I've also tried using stable Melpa, to no avail. I'm using windows 10 and set a HOME variable pointing to the directory with the 'init.el' file.

emacs: Why can't I install auto-complete via package-install?

I am new to emacs and have never used package-install before. I am using emacs 24.4 on Windows, but I would like to do the same thing on my emacs installed ona unix server that I ssh into.
These instructions say that I can install auto-complete with M-x package-install [RET] auto-complete [RET], but when I do this I get [No match]. Why is this? How can I install it?
Have a look at what the instructions say with a little more context:
Install
auto-complete is available on MELPA and MELPA-STABLE
You can install auto-complete with the following command.
M-x package-install [RET] auto-complete [RET]
Before running the package-install you need to enable MELPA or MELPA stable:
Enable installation of packages from MELPA by adding an entry to package-archives after (require 'package) and before the call to package-initialize in your init.el or .emacs file:
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
or to add the stable package repository, use this instead of "melpa":
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
You might also need to run M-x package-refresh-contents before M-x package-install will work. Alternatively, run M-x package-list-packages and use the UI provided there, which refreshes contents automatically.

auto-complete-mode not working

I just followed this site to install auto-complete on Emacs. I installed it with "M-x load-file RETURN ~/path/to/etc/install.el".
The output of my installation was: http://paste.ubuntu.com/6184523/
After that, I added the recommended code to my ~/.emacs file and restarted Emacs. Typing "M-x auto-complete-mode" says "No match". I also tried to fix it by replacing flet with c-flet etc. but it hasn't changed anything too.
Version: GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.2)
Emacs has a package manager now. So just install the package from the list and you're done.
Here's the configuration that adds the two most popular repositories:
(package-initialize)
(add-to-list
'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list
'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/"))
After this, M-x package-list-packages. The rest is pretty intuitive.
UPD: A simple auto-complete setup for C++
(add-hook 'c++-mode-hook
(lambda()
(semantic-mode 1)
(define-key c++-mode-map (kbd "C-z") 'c++-auto-complete)))
(defun c++-auto-complete ()
(interactive)
(let ((ac-sources
`(ac-source-semantic
,#ac-sources)))
(auto-complete)))
I tried some solutions that worked for other people, but it didn't quite work out.
Try setting the environment variable(s) to ~/emacs.d/ in both .profile and .bashrc
If that doesn't work out, try exporting the environment variable(s) with su root (won't work with sudo).
At least that worked for me while trying to install auto-complete-mode with golangs auto-complete-mode

Emacs ess auto-complete

I am a R user, I want to use R in emacs. But, I am in trouble with customizing ess in emacs. I have installed the auto-complete packages and the latest ess in my emacs. But when I run r in emacs, the auto-complete don't work well.
When I type app, I suppose to show like the image in (http://www.emacswiki.org/pics/static/ess-ac3) , but in my emacs neither of the auto-complete nor the yellow part shows.
My OS: ubuntu 12.04 amd64
my ~/.emacs file
;; Auto-complete
(add-to-list 'load-path "~/.emacs.d/site-lisp")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/site-lisp/ac-dict")
(ac-config-default)
; ess-site
(add-to-list 'load-path "/usr/share/emacs/site-lisp/ess")
(require 'ess-site)
(setq ess-eval-visibly-p nil)
(setq ess-ask-for-ess-directory nil)
I recently started using ESS on Windows, and struggled with the same issue. I don't know all of the ins and outs but recent versions of ESS suggest using company-mode rather than auto-complete-mode. This minimal setup seems to have autocomplete working quite well for me on the following setup:
Windows 10 x64
R 3.4.3 x64
Emacs 25 x64 installed normally
MELPA repo enabled in init.el
package-install [RET] company
package-install [RET] ess
open a new R file in some directory
M-x company-mode to enable company-mode in the current buffer
`C-c C-z' to start an inferior R process
At this point, with the init.el file shown below, R completion is working, completing function calls, and package members. I think more configuration is needed to tailor it to your liking, but getting to this point took me long enough I consider it a success
init.el:
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
)
(package-initialize)
;; emacs controlled settings
(custom-set-variables
'(package-selected-packages (quote (company ess)))
'(show-paren-mode t)
'(tool-bar-mode nil))
(custom-set-faces
'(default ((t (:family "Consolas" :foundry "outline" :slant normal :weight normal :height 113 :width normal)))))
(require 'company)
Auto-complete works for me with this setting
(setq ess-use-auto-complete t)
I got the same problem and the following code worked for me:
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize) ;load and activate packages, including auto-complete
(ac-config-default)
(setq ess-use-auto-complete 'script-only)
;;if not working, use the following instead of (setq ess-use-auto-complete 'script-only)
;;(global-auto-complete-mode t)