Agenda key binding don't work - emacs

I'm tring to setup agenda in emacs.
In the file .emacs I have such configuration
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
but after C-c a I have message:
The symbol definition is void: org-defvaralias
Please help in fix this problem.
EDIT 1.
Key binding looks ok - after C-h k I see
C-c a org-agenda
EDIT 2.
After M-x org-agenda result is
The symbol definition is void: org-defvaralias
Regards Krzysiek

Related

How to install Proof General for Emacs on Mac?

I am new to Emacs and perhaps that is the problem but I was following the instructions here:
https://github.com/ProofGeneral/PG
in particular after I added the given lines to my .emacs file, I did (M is the alt/option key):
M-x package-refresh-contents RET
but I got the error message:
[no match]
what is going wrong?
maybe this what I am doing wrong, what does:
M-x package-refresh-contents RET followed by M-x package-install RET proof-general RET
mean?
This is what works for me (TM):
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; Bootstrap use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(use-package proof-general
:no-require t
:ensure t)
The line will work if you have melpa as your package source. See the answer of ejgallego:
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
If you add these lines to your .emacs - file and then
M-x package-refresh-contents (followed by return)
M-x package-install (followed by return and then `proof-general`)
then it will work without explicitly adding the package in your .emacs-file.

Indent clojure on Emacs

I am trying to set up the emacs to have auto-Indentation for clojure code.
Until now unsuccessful. What is the command to set into the config file for that?
Here is a sample emacs config for what i consider the "minimal" usable emacs config for Clojure. I say minimal in that I'm not willing to work without good code completion, jump to definition, project aware file handling etc:
from this example which you can clone to ~/.emacs.d:
This is just a hilight, see the init file in the example project for the context, look at the project for recent versions, etc. don't just copy these:
(use-package clojure-mode
:ensure t
:config
(add-hook 'clojure-mode-hook 'yas-minor-mode))
(use-package cider
:ensure t
:config (progn (add-hook 'clojure-mode-hook 'cider-mode)
(add-hook 'clojure-mode-hook 'cider-turn-on-eldoc-mode)
(add-hook 'cider-repl-mode-hook 'subword-mode)
(setq cider-annotate-completion-candidates t
cider-prompt-for-symbol nil)))
;; clojure refactor library
;; https://github.com/clojure-emacs/clj-refactor.el
(use-package clj-refactor
:ensure t
:config (progn (setq cljr-suppress-middleware-warnings t)
(add-hook 'clojure-mode-hook (lambda ()
(clj-refactor-mode 1)
(cljr-add-keybindings-with-prefix "C-c C-m")))))
there is also some code to add to ~/.lein/profiles.clj:
{:user {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]
[refactor-nrepl "1.1.0"]]
:dependencies [[acyclic/squiggly-clojure "0.1.3-SNAPSHOT"]]}}
I added
(global-set-key (kbd "RET") 'newline-and-indent)
to the init file and this worked. I am not sure if this was the best solutaion, but it did the trick.

How to use Cider's built-in autocompletion in Clojure?

According to this:
The built-in completion logic in CIDER relies on the library clojure-complete, so you'll have to have it your classpath for completion to work. If you're connecting to an nREPL server started from lein (e.g. you invoked M-x cider-jack-in) - there's nothing for you to do.
So -- I'm using an nREPL jack in with Emacs 24.3, so I would guess that there is "nothing for me to do." However, I am not getting any autocompletion in my Clojure source files.
I uninstalled and reinstalled Cider via Elpa to be safe. Apparently it is not necessary to manually install any other autocompletion packages from what I've read, but I must admit that getting autocompletion to work seems to be quite a task, can anyone point out what I'm missing?
Here's my old config. I haven't been using Clojure for a while, but
I've checked that it still works:
(require 'ac-nrepl)
(defun clojure-auto-complete ()
(interactive)
(let ((ac-sources
`(ac-source-nrepl-ns
ac-source-nrepl-vars
ac-source-nrepl-ns-classes
ac-source-nrepl-all-classes
ac-source-nrepl-java-methods
ac-source-nrepl-static-methods
,#ac-sources)))
(auto-complete)))
(defun my-clojure-hook ()
(auto-complete-mode 1)
(define-key clojure-mode-map
(kbd "β") 'clojure-auto-complete))
(add-hook 'clojure-mode-hook 'my-clojure-hook)
I'm pretty sure that I went for the separate function instead of modifying
ac-sources for performance reasons (I have ac-delay at 0.4).
Confirmation:
abo-abo answer of Apr 23 at 6:57 works.
Just change "ac-nrepl" into "ac-cider" of course.
(GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.9)
of 2014-06-06 on brownie, modified by Debian)
(require 'auto-complete-config)
(require 'clojure-mode)
(require 'cider-mode)
(require 'ac-cider)
(ac-config-default)
;(add-hook 'cider-repl-mode-hook 'ac-cider-setup)
(add-hook 'cider-mode-hook 'ac-cider-setup)
(eval-after-load "auto-complete"
'(add-to-list 'ac-modes 'cider-repl-mode))
(add-hook 'clojure-mode-hook 'paredit-mode)
;(add-hook 'clojurescript-mode-hook 'paredit-mode)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
(setq cider-repl-pop-to-buffer-on-connect nil)
(require 'highlight-parentheses)
(add-hook 'clojure-mode-hook
(lambda ()
(highlight-parentheses-mode t)))
(defun set-auto-complete-as-completion-at-point-function ()
(setq completion-at-point-functions '(auto-complete)))
(add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function)
;(add-hook 'cider-repl-mode-hook 'set-auto-complete-as-completion-at-point-function)
(add-hook 'cider-mode-hook 'set-auto-complete-as-completion-at-point-function)
(eval-after-load "cider"
'(define-key cider-mode-map (kbd "C-c C-d") 'ac-cider-popup-doc))
My packages are:
ac-cider
auto-complete
auto-indent
cider
clojure-mode
highlight-parentheses
parendit
popup
rainbow-delimiters
I do not want to use auto-completion for repl and script so I commented them.
You may not need them all but they are all useful. If you do not want to change the init.el file, you would better go with all packages listed.
Once you're done, make a project with Lein, then add
:plugins [[cider/cider-nrepl "0.8.2"]]
to project.clj file.
Now, it is almost done.
Open a sourcefile with Emacs, then run
M-x cider-jack-in
Then you must be able to use auto-completion feature for code!

Emacs auto-completion mode

New with emacs. I'm not able to implement auto-completion for Gtk+3. I'm using CEDET and Auto Complete Mode as UI. Semantic is unable to find include files ( ), but it can parse the tags of the code in the open buffers.
Here my .emacs conf
;;----------------------------------------------------------------------------------
(load-file "~/.emacs.d/cedet-1.0/common/cedet.el")
(global-ede-mode 1)
(semantic-load-enable-excessive-code-helpers)
;;(semantic-load-enable-semantic-debugging-helpers)
;; ede customization
(require 'semantic-lex-spp)
(ede-enable-generic-projects)
(setq senator-minor-mode-name "SN")
(setq semantic-imenu-auto-rebuild-directory-indexes nil)
(global-srecode-minor-mode 1)
(global-semantic-mru-bookmark-mode 1)
(require 'semantic-decorate-include)
;; gcc setup
(require 'semantic-gcc)
;; smart completions
(require 'semantic-ia)
(setq-mode-local c-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local c++-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local erlang-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(require 'eassist)
(require 'semanticdb)
(global-semanticdb-minor-mode 1)
;; gnu global support
(require 'semanticdb-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
;; ctags
(require 'semanticdb-ectag)
;;(semantic-load-enable-primary-exuberent-ctags-support)
(global-semantic-tag-folding-mode)
(defun my-cedet-hook ()
(local-set-key [(control return)] 'semantic-ia-complete-symbol)
(local-set-key "\C-c?" 'semantic-ia-complete-symbol-menu)
(local-set-key "\C-c>" 'semantic-complete-analyze-inline)
(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle))
(add-hook 'c-mode-common-hook 'my-cedet-hook)
;;semantic gtk gdk
(defun my-semantic-hook ()
(semantic-add-system-include "/usr/include/gtk-3.0/gtk/" 'c-mode)
(semantic-add-system-include "/usr/include/gtk-3.0/gdk/" 'c-mode))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
;; END CEDET
;;----------------------------------------------------------------------------
Any suggestions? Thanks.
Your setup looks OK to me; I wonder if the extra "gtk/" and "gdk/" in your add-system-includes might be the problem. I just got this working with gtk-3.0 using:
(semantic-add-system-include "/usr/include/gtk-3.0" 'c-mode)
Then in your source file,
#include <gtk/gtk.h>
Followed by:
gtk_[C-c ?]
spends a minute or so processing all the header files, but it does return the completion menu as expected.
If this doesn't work for you, I notice you might be using an older version of CEDET. I use the latest dev version from the bazaar repository; I highly recommend you do the same.

Clisp + Emacs compile-and-load-file

Starting to learn Common lisp. Instal in my debian 5.03 clisp, emacs-23.1 and slime.
Write in .emacs:
(setq inferior-lisp-program "/usr/bin/clisp") ; your Lisp system
(add-to-list 'load-path "/home/slime/") ; your SLIME directory
(require 'slime)
(slime-setup '(slime-scratch slime-editing-commands slime-repl))
(global-font-lock-mode t)
(show-paren-mode 1)
(add-hook 'lisp-mode-hook '(lambda ()
(local-set-key (kbd "RET") 'newline-and-indent)))
Then create in emacs new lisp file: test.lisp write simple lisp expression:
(defun square(x)
(* x x))
Then try to compile this code C-c C-k and see in minibuffer: Not connected
p.s. Now i try to click in eval defun in emacs main menu: and see in minibuffer: Process lisp does not exist
What's wrong?
Thank you.
What happens if you do M-x slime ?
I looks like you don't have slime started.