Posts

Showing posts with the label emacs

My Emacs Configuration

Image
My Emacs Configuration Table of Contents What is it? How to install my configure The most complicated part Code location 1 What is it? I have at least three desktop machines works right now, running Mac OS and Linux. I found that's a messy and dirty job to configure my emacs again and again after reinstalling the system. This project is a convenience collection my configurations of emacs and reinstalls them quickly into another machine. I had worked in a similar project formerly, not a so pleasure experience, I commit everything located in ~/.emacs.d into a git repository, after realize how silly it is, I abandon that project. This new project is an upgraded version, more light weight, just upload my own configuration without the third party modules. 2 How to install my configure steps 1 create your .emacs.d directory into your home directory cd ${ HOME } mkdir .emacs.d steps 2 clone the code into your ${HOME}/.emacs.d directory cd ${ ...

Configure Emacs's PATH environment in Mac OS X

Image
Configure Emacs's PATH environment in Mac OS X Table of Contents Background Why did that sad thing happen? 1 Background Yesterday, I wanna send a love letter to a chick who I am chasing on-line. So I decided to send this letter by my favorite email client GNUS in my favorite editor Emacs to show my passion and love, but sad things happened(Seriously, Should I still being single and lonely?) , I got following errors: My customized email signature corrupted, which supposed to attach a joke and an ASCII art. Following is the error message, if I sent those error message to a girl, I must be out the game, right? /bin/bash: fortune: command not found /bin/bash: cowsay: command not found I can not send emails in GNUS anymore. smtpmail-send-it: Sending failed: 530 5.7.0 Must issue a STARTTLS command first. y9sm60423107pas.10 - gsmtp Although I have another puzzle which can be classified as same kinds of problem, In eshell-mode, I can not found the right ...

tts-mode for emacs update - support Mac OS X's tts engine

Image
tts-mode for emacs update - support Mac OS X's tts engine Table of Contents 1 Support Mac OS X's default tts engine 2 Configure and Install tts-mode 1 Support Mac OS X's default tts engine After I owned an Macbook air, I tried to port tts-mode into OS X system. I installed espeak command line tool into OS X, it works well just like in linux system. Thanks to the excellent portability of elisp source code, I need not to change any source code. I still have not installed festival tts engine into Mac OS, but it seems have many tutorials to do it. After that I found OS X's default tts engine, which provide an command line interface, has much clearer and greater fluency than both espeak and festival. So I wonder if I can support OS X's default tts engine. Then here it is, the new tts-mode . 2 Configure and Install tts-mode Reference the following codes: (add-to-list 'load-path "path/to/tts-mode" ) ;; configure tts engine...

Configure Emacs as an Python IDE

Image
Configure Emacs as a Python IDE Table of Contents 1 use python.el 2 auto-completion in python.el 1 use python.el There are plenty of python modes which support develop python in emacs, well, in my personal opinion, most of those are sucks, and F fgallina's python.el is the much better one.  Besides the major mode for python, I installed following python packages including rope, ropemode, Pymacs, and ropemacs. Install rope, reopmode, and ropemacs were really easy with the help of python's package management tool pip .  pip install rope pip install ropemode pip install ropemacs Pymacs provided the both-way communication between Emacs Lisp and Python, it can not installed by pip, so just download the source code from GitHub.  Install pymacs python package first.  make sudo make install Install emacs package pymacs.el which generated by above step. copy pymacs.el into the path which included in emacs's load-path. Then add the fol...

Configure eshell-mode after upgrade emacs to 24.3.1

Image
Configure eshell-mode after upgrade emacs to 24.3.1 My eshell-mode doesn't works after I upgrade emacs to 24.3.1. I got the empty symbol "eshell-output-filter-functions" error every time I start eshell-mode.  The symbol "eshell-output-filter-functions" located in esh-mode.el. So I need to load the esh-mode.el before the code which refers to the "eshell-output-filter-functions" symbol.  After that My eshell-mode's configure code is as following:  (setq eshell-cmpl-cycle-completions nil eshell-save-history-on-exit t eshell-cmpl-dir-ignore "\\` \\ ( \\.\\.? \\ | CVS \\ | \\.svn \\ | \\.git \\ ) /\\'" ) ;; load esh-mode first ( require ' esh-mode ) ( eval-after-load 'esh-opt '( progn ( require ' em-cmpl ) ( require ' em-prompt ) ( require ' em-term ) ;; TODO: for some reason requiring this here breaks it, but ;; requiring it after an eshell session is s...

Using textmate-mode in Emacs

Image
Using TextMate-mode in Emacs As an emacs user, I was always being surprised by some fabulous modes. This time is TextMate-mode, which is a really useful minor mode for the plain text editor.  As a software developer, I always need to jump to some parts of the source code. Command, M-x textmate-goto-symbol, can really kick my ass.  Another thing which exciting me is the jump to a file by command M-x textmate-goto-file. Also, it only works when I am working in a git repository. It just gives me what I needed.  Are there any other functions in this mode which enlightening me? Well, Maybe it makes my tears running down again by other amazing tricks.

Using Gnu Global to navigating source code

Image
Using GNU Global to navigating source code I use etags as the default tagging system to navigating the C-like source code before. It works good, but sometimes it didn't perform as good as ctags which were used by vimer. Table of Contents 1 why not etags? 2 gtags's advantage 3 gtags's disadvantage 4 Install gtags 5 tagging source code systems of emacs 1 why not etags? Etags has a flaw compared with ctags, which is it didn't pop up the mini-buffer when searching a symbol. Which means I can not get options then decide where to jump when multi locations match the symbol. I have to jump one by one to find the right location in emacs with etags,which push me over the edge sometimes.  2 gtags's advantage Today I tried the gtags source tagging system which provided by Gnu Global project.  It can pop up the minibuffer when multiple targets match the symbol, which functions let me felt much more comfortable. 3 gtags's disadv...

Install malabar-mode for java development

Install Malabar-mode for java development (Deprecated) Table of Contents 1 Why Malabar-mode? 2 What is Malabar-mode? 3 Install Malabar-mode 4 Configure Malabar-mode 1 Why Malabar-mode? There are Jdee for java development in emacs, so Why Malabar instead? Jdee is such a huge weapon, that it's so hard to hack into it. It is powerful but probably includes more useless features. What's more, Jdee maybe slow down your Emacs, but you can not fix it. But why not use Eclipse? Well, Emacs just make me cooler. 2 What is Malabar-mode? Malabar-mode is hosted on  GitHub . It provided a much more elegant way to edit java source code compared with Jdee. Just as its Github's page title – "A better Java mode for Emacs". 3 Install Malabar-mode This project stopped upgrade about two years age. So I met some troubles during the installation. Build the package with the following command. mvn package And I got following warning and erro...

fs-mode for emacs (Linux filesystem management in emacs)

fs-mode for emacs fs-mode for emacs Table of Contents 1 What is fs-mode? 2 How to install it? 3 How to use it? 4 Use root-cmd.el to execute commands which needs root privilege. 1 What is fs-mode? fs-mode is an Linux file system management mode in emacs. It can manage your file system, you can mount or umount file system. It also support mount ecryptfs file system.( I put my little secret into ecryptfs file systems. ) 2 How to install it? I upload the source code to github, download it from following link. https://github.com/suzp1984/fs-mode add following code into emacs's init file. ;; change the directory according to your needs (add-to-list 'load-path "directory/to/install/" ) ( require ' fs-mode-autoload ) 3 How to use it? Use M-x list-fs to enter the fs-mode. and there are following key shortcuts bindings. m - mount a file system. u - umount a file system. q - quit the fs-mode. 4 Use root-c...

Configure emacs's auto-insert module

Configure emacs's auto-insert module Configure emacs's auto-insert module Table of Contents 1 how to use auto-insert? 2 Configure auto-insert-alist 1 how to use auto-insert? auto-insert mode is very useful, which can be used to declare the license in the header of the source code and some personal information, for example, who create this file and when? auto-insert will insert declaration according the variable named auto-insert-alist. It first search this variable and find the item match the file type, then extract the action to finish the auto insert. If you build an new elisp file buffer, and execute auto-insert command, it will insert the fantastic declaration with GPL license. But this command performs sucks in other mode like c-mode or python-mode. So you must configure variable auto-insert-alist by your self. 2 Configure auto-insert-alist I upload the source code into github, download according following a...

Using Emacs as Presentation tool

Using Emacs as presentation tool Using Emacs as Presentation tool Emacs is not just a editor, I found some hackers even use it to do presentations. So I collected some ways that emacs can become an presentation tool. Table of Contents 1 This article is not about… 2 epresent.el 3 Sacha Chua's source code. 4 Improved epresent.el 1 This article is not about… First, I must make a clearly announcement about what this article is not about. This article is not about how to make a pdf file style presentation using emacs as a editor, and using anther tools like a pdf viewer to play this slides. This article is about how to using emacs as an presentation style slides player. 2 epresent.el Epresent is an simple presentation mode for org-mode. How to use it? load eprsent.el into emacs open a org file (present.org). M-x epresent-run press "t" to view the top level of presentation navigate the presentation with 'n', ...

Pulseaudio-mode for emacs

Pulseaudio-mode for emacs Pulseaudio-mode for emacs Table of Contents 1 Get Source code 2 How to install it? 3 How to use it? 1 Get Source code You can download source code from my github repository . or you can clone the repository directly by git. git clone https://github.com/suzp1984/pulseaudio-mode.git 2 How to install it? First, get the source code according to above section. Add following line into your emacs's init file ;; replace following parameter into actual directory path. (add-to-list 'load-path "directory path to pulseaudio-autoload.el" ) ( require ' pulseaudio-autoload ) 3 How to use it? Start pulseaudio modules management by M-x list-pulseaudio-modules Start pulseaudio sinks management by M-x list-pulseaudio-sinks … x. Maybe add more function to make it more like a powerful pulseaudio control panel.

tts-mode in emacs

TTS mode for emacs TTS mode for emacs There are a scene in The big-bang theory, a America TV drama, Sheldon use his laptop computer to emulate human voice. That's really cool. Actually What Sheldon did is just install a TTS software, TTS short for Text To Speech. Table of Contents 1 TTS engine in linux platform 2 The simple way to use Festival and Espeak 3 Why TTS mode? 4 How to use TTS mode? 1 TTS engine in linux platform I use two kinds of TTS engine in my PC, Festival and Espeak. Festival provide a interactive interface with lisp like syntax. Espeak support more language voice. Of course there are another TTS engines in linux platform, I just have a little experience in above two. 2 The simple way to use Festival and Espeak # festival read text from stdin echo "hello world" | festival --tts # festival read text from file festival --tts filename espeak "hello world" # espeak speak chinese espeak -...

Install JDEE in emac

Install JDEE in emacs Table of Contents 1 JDEE Introduction 2 Some Troubles Met during Instillation 3 I have a word to say 1 JDEE Introduction I want to configure my java develop an environment of my emacs. And It seems that JDEE is a recommended option. Some one even uses JDEE as full features of IDE for java, that's sounds exciting right. So I decide to use JDEE. According to emacs wiki's advise, I use the latest source code from svn repository, But I met some trouble in the installation. The following section will figure out the solution. 2 Some Troubles Met during Instillation compile JDEE      # Download JDEE from svn first # use the source code in the main trunk svn co https://jdee.svn.sourceforge.net/svnroot/jdee jdee Then use ant to compile the source code, I met the error prompted by:   ## Could not load definitions from resource net/sf/antcontrib/antlib.xml That's because of lack of ant-contrib package, So I i...

A magic trick to make cool email signature

Image
A magic trick to make cool email signature Table of Contents 1 where's the idea come from? 2 how to use it? 1 where's the idea come from? I hang out in the #emacs IRC channel in freenode one day, and some guy show some funny trick that can always make some fun: fortune | cowsay Every time I execute this command, the output always let me LOL. _______________________________________ / Atherton: "You set this up, whore! \ | After I bought and paid for you. I | | should have uglied you up so no one | | else would want you." | | | | Mal: "See how I'm not punching him? I | | think I've grown." | | | \ --Episode #4, "Shindig" / --------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ...

some tips for how to write a emacs lisp package -- elisp's loading mechanisms

1. elisp's loading mechanisms In order to learn how to write an elisp package, you must be familiar with some ways of how to load your package to emacs. That means developers need to master following functions. Some of them puzzled me at  the past. Functions: load-file, load, require, autoload Following hyperlinks webpage removes my confusion, and give a good explanation of elisp's loading  mechanisms. http://ergoemacs.org/emacs/elisp_library_system.html?1352689199 Function Name Purpose Tech Detail Comment load-file Load a file. Load one specific file. Use this if you have one very SPECIFIC file at one particular file path. load Load a file. Load a file by searching thru var “load-path”. Also, tries to load a compiled version (.elc) if exists. Use this if the path for the file is not known in advance, and you are using a file name without full paths, such as “undo” or “undo.el”, and you want to load the compiled version if it exists (undo.elc). require Load a...

auto-complete mode in emacs

Emacs as an IDE works well with all kinds of the environment (C lisp elisp slime java python). But his auto-complete plugins sucks. I use hippie-expand before I met auto-complete. Auto-complete was the best auto-complete package in the present moment. This package is so simple that can be a tutorial on how to write a minor-mode package. And the users also easy to configure or modify it according to their needs. after a search in google, I add a package to use auto-complete in slime environment to develop a common lisp. Also, add a package to Let it search ac-source from etags files. I upload modified package into google drive: https://docs.google.com/open?id=0B5yiz3j-W7mca3VtYUpWTTl1VDg Install tutorial: 1. copy *.el to a directory like (~/.emacs.d/auto-complete/) 2. copy dict directory to a directiory like (~/.emacs.d/auto-complete/dict) change symbol ac-dictionary-directories according dict directory (add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-com...

use org-mode to schedule your job

http://www.mastermindcn.com/2012/02/org_mode_quite_a_life/ emacs is not just an editor or IDE, It is a desktop Environment. org-mode in emacs is an amazing tool to practice GTD which help you to organize your time. here is a template I used. My Whole Template * org-mode configuration #+STARTUP: OVERVIEW #+PROPERTY: CLOCK_INTO_DRAWER t #+TAGS: { LEARNING(l) LISP C FUCK-GFW EMACS TEX EMULATOR PYTHON BLOG } #+STARTUP: hidestars [[http://www.mastermindcn.com/2012/02/org_mode_quite_a_life/][where this file come from]] * Inbox [100%] ** DONE Interface C: momory interface CLOSED: [2012-11-09 Fri 11:30] SCHEDULED: * Tasks [16%] ** TODO [#B] learning org-mode :LEARNING: SCHEDULED: :LOGBOOK: CLOCK: [2012-11-09 Fri 09:39]--[2012-11-09 Fri 10:24] =>; 0:45 CLOCK: [2012-11-09 Fri 08:18]--[2012-11-09 Fri 08:52] =>; 0:34 :END: ** TODO [#A] Common lisp [50%] :LISP: *** TODO shoutcast p...

tabbar-mode slow down emacs

I find my emacs slow down after a long time operate in it.  Emacs process takes 50% of cpu resource. After search this problem in google, I found following stuff: http://ergoemacs.org/emacs/emacs_font_slowdown.html tabber-mode seems have bugs. So,  M-x tabbar-mode to disable tabber-mode, then everything become normal again.  Maybe I should disable tabber forever.