Yasnippet seems to be working but the trigger key is not. I can load snippets, look at snippet tables and M-x yas/expand. However, after typing a trigger key (i.e time) I'd like to expand the snippet with the TAB key which isn't working. I checked the yasnippet.el file and found that the yas-trigger-key is set to . I tried changing it and still couldn't get it working. Anyone have an idea about what's going on? I'm trying to get this working first in LaTeX mode. Yasnippet tells me I should also try C-c C-s but that just seems to insert "\end."
I downloaded Yasnippet via the el-get packager manager. I'm using OSX and emacs 23.4.1
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
Did you put the aforementioned in your .emacs?
Maybe try reinstalling from this recent link
Related
I am currently using emacs24 with clojure-mode as my clojure IDE. I use the zenburn theme.
As far as I can tell, clojure-mode only provides syntax-highlighting for macros. Is there a way to add syntax highlighting for all clojure native functions?
I've googled a bit and it seems like I'm either the only one who wants this, or the only one that doesn't have it for some strange reason. I don't think my .emacs file is a necessary addition to this question but I'll add it if someone wants to take a look.
Thank you.
You need to explicitly enable font locking for these functions with clojure-mode-extra-font-locking. Install this package from MELPA, and add the following to your init.el:
(eval-after-load 'clojure-mode '(require 'clojure-mode-extra-font-locking))
I read the following on the Emacs list about Emacs multi-term:
Because of changes in advice.el, multi-term.el does not work anymore. These changes surely mark the emerge into a bright future. But I hate them because I can no longer use my beloved multi-term.
Unfortunately the development of multi-term is abandoned.
However, today I saw a new update when updating my Emacs packages:
multi-term 20140316.... installed Managing multiple terminal buffers in Emacs.
The date sems to be March 16 of 2014. With this, my question is:
Where did this update come from? Is there a multi-term repository that is actively maintained?
If multi-term is not compatible with Emacs 24.4, will the functionality of multi-term be available in Emacs? (e.g. automatically closing the buffer when exiting the terminal)
It does not seem that multi-term's development has been abandoned. Check the source on its emacswiki page. The change log in the file says
;;; Change log:
;;
;; 2014/03/17 Andy Stewart
;; * Swap key binding of `term-send-raw' and `term-send-input', i think it's better send yank data when user hit ctrl+m.
;;
;; 2014/01/16
;; * Fix breakage introduced in Emacs 24.4.
;;
The latest change was made yesterday. This is where the update came from. Also the breakage due to 24.4 seems to fixed.
Every time I type a comment in emacs, tramp freezes it.
it says:Tramp: waiting for prompts from remote shell
This happens for any file I open. It freezes for a minute whenever I type /, and repeats for all characters typed until whitespace.
I found a few other questions like this, but they all seemed to be asked by people who use tramp. I do not use tramp. Had it not been freezing emacs, I would not have known what it is.
Can anyone tell me how to make it stop?
.emacs
Does it happen in every file? Only for octave related files?
Have you tried with "emacs -Q"?. If you are free of the problem with "emacs -Q", then check with "emacs -q", if not, post your emacs version and OS.
If with "emacs -q" you are free of the problem, the problem is in your .emacs. Your .emacs is tiny, so a binary search of what is the offending part should be quick.
By default, auto-complete suggests file names when you type //, and this invokes tramp to get the file name list. To turn of this behaviour, make sure ac-source-filename is not in your ac-sources list. An easy way to do this globally is to edit your auto-complete-config.el to comment out the line
(add-hook 'auto-complete-mode-hook 'ac-common-setup)
I am using Org-mode in Emacs to handle all my technical documentation. I would like to use Emacs to prepare questions that I have for Stack Overflow. Is there an Emacs mode for that, or even better, an extension for Org-mode to handle Stack Overflow formatting? Ideally it should include all formatting options supported by the markdown syntax used in the Stack Overflow question/comment buffers.
Integrating Emacs with Stack Overflow
As mentioned you can use markdown-mode. To integrate markdown-mode with Stack Overflow you can use the Firefox plugin It's All Text which lets you edit textareas with an external editor. Here is how to set it up:
Install markdown-mode. If you use Debian or Ubuntu you can install it by issuing
sudo apt-get install emacs-goodies-el
or if you're on emacs 24 (or have package.el on emacs 23) and Marmalade or Melpa you can install it with
M-x package-install RET markdown-mode
Install It's All Text.
Set It's All Text's preferences to use Emacs. Either you can set it to the executable (e.g. /usr/bin/emacs) or the emacsclient.
Add the following to your .emacs to enable markdown-mode for Stack Overflow and Stack Exchange textareas:
;; Integrate Emacs with Stack Exchange https://stackoverflow.com/a/10386560/789593
(add-to-list 'auto-mode-alist '("stack\\(exchange\\|overflow\\)\\.com\\.[a-z0-9]+\\.txt" . markdown-mode))
Alternatively, if as-external-alist is defined—if M-x describe-variable RET as-external-alist doesn't fail—it will probably override your auto-mode-alist. It has a slightly different format (it's a list of pairs instead of a list of cons cells) so this will work:
(add-to-list 'as-external-alist '("stack\\(exchange\\|overflow\\)\\.com\\.[a-z0-9]+\\.txt" markdown-mode))
Press the blue edit button at the bottom right side of a textarea to edit it via emacs. The blue edit button is shown in the following screenshot:
In the following screenshot is an Emacs buffer in markdown-mode editing this post:
When you are done editing in Emacs save the buffer to send it to Firefox.
If you want this functionality for other domains you need to change the regexp above. The following recognizes Stack Exchange, Stack Overflow, Ask Ubuntu and Super User:
;; Integrate Emacs with Stack Exchange https://stackoverflow.com/a/10386560/789593
(add-to-list 'auto-mode-alist '("\\(stack\\(exchange\\|overflow\\)\\|superuser\\|askubuntu\\)\\.com\\.[a-z0-9]+\\.txt" . markdown-mode))
Using markdown-mode with Org-mode
To use markdow-mode with Org-mode you can use its feature for working with source code. With it you can include blocks of markdown inside your Org-mode buffers which you can edit via markdown-mode. You can use it as follows:
When in an Org-mode buffer enter <s on a newline and press Tab. This will result in
#+begin_src
#+end_src
Enter markdown after #+begin_src so that you have
#+begin_src markdown
#+end_src
When inside the source block (between #+begin_src markdown and #+end_src) press C-c ' to edit the source block with markdown-mode.
Edit the source block in markdown-mode.
Press C-c ' to return to the Org-mode buffer and insert the edit. This can look like what the following screenshot shows:
There is markdown-mode: http://jblevins.org/projects/markdown-mode/
See http://emacswiki.org/emacs/MarkdownMode for some customization.
And there is a markdown backend for the new export engine here:
http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/lisp/org-md.el;hb=HEAD
Make sure you add the contrib/lisp/ directory to your load-path.
Then (require 'org-export) and (require 'org-md).
M-x org-md-export-to-markdown RET will export to markdown.
#N.N's answer is applicable to Chrome also, with these changes in details.
Chrome has Edit with Emacs extension, which is similar to It's all text. After installing it, you'll find further instructions from the extension options page.
There is an emacs customization group edit-server with options, most importantly the major mode change per site is configured differently than in #N.N's answer:
(add-to-list 'edit-server-url-major-mode-alist
'("^stackoverflow" . markdown-mode))
Also, for the edit-server to work in terminal emacs, I had to disable the edit-server-new-frame option.
Pandoc has support for reading a subset of org-mode and can output markdown.
In other words, you can keep writing in org-mode, including writing italics /like this/, and then export to markdown.
From emacs you can convert to markdown by selecting the region, hitting C-u M-S-\ and typing pandoc -r org -t markdown, getting output like this:
In other words, you can keep writing in org-mode, including writing italics *like this*, and then export to markdown.
Or, you can save the file and convert it at the command line.
It Is Easy With Chrome Too
This is less an answer than a test of my solution using
the
Edit with Emacs chrome
plugin and the Emacs Edit Server
configured to use markdown-mode
for Stackoverflow (and other Stackexchange sites I use). All I had to do after
installing the extension and MELPA packages was set
(setq edit-server-url-major-mode-alist
'(("mail.google.com" . org-mode)
("stackoverflow\\.com" . markdown-mode)
(".*\\.stackexchange\\.com" . markdown-mode)
("github\\.com" . markdown-mode)))
Gmail Message Support
Note in the above setting, I'm using org-mode for gmail messages. Still need
to do a little work here, but it is possible, with a little effort, to draft
your gmail message using org-mode and then use org-mime to generate html from
your org structured text. You could just use markdown and a markdown to html
conversion.
Is there a way to expand the current command at the Clojure repl like I'd be able to do in Common Lisp?
For example say I have typed:
Math/
I would like the tab key to expand to all the available variables and functions in that namespace.
I'm using Clojure as inferior-lisp would like to know how to do this from the plain vanilla repl in Clojure, and through swank slime.
Another vote in favour of clojure-mode and slime under Emacs. In particular, if you set up auto-complete, then you can use my ac-slime package to get context-aware tab completion in a dropdown list. Here's a screencast showing it in action.
And, further to technomancy's comment about hippie-expand, here's how to tie slime completion into hippie-expand.
Update: as of 2012, nrepl, nrepl.el and ac-nrepl are replacing slime and ac-slime; same functionality, smaller and cleaner codebase.
Update2: as of Oct 2013 nrepl.el is renamed to cider and it and ac-nrepl have moved to the clojure-emacs organisation on github. nrepl remains as the server component
Have you tried Clojure mode for Emacs? It has autocomplete (suggestions are shown in new window, and if there's only one possible option, it is used to expand name), highlighting and many other nice features (not more then for CL, but not less too).
It is available via ELPA. After installing ELPA type M-x package-list-packages, set cursor near needed package and press i (already installed packages are in red). You'll need packages clojure-mode, slime, slime-repl and swank-clojure. When you're done with i-marks, press x to complete installation. Finally, press M-x slime - Emacs will tell, that Clojure is not installed and propose to download and use latest version. Just agree.
You can also integrate Emacs with Leiningen.
The vanilla repl in Clojure is pretty crippled; it doesn't even have history. Avoid it for anything but the most primitive of tasks. I don't think you can get this in inferior-lisp, but in the slime repl you can just use TAB to complete things like this. In clojure-mode buffers with slime activated it's M-TAB, or you can tie it into your hippie-expand functions.