Posts

Showing posts with the label elisp

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

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

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

Network programming in elisp

  Network API in elisp Table of Contents 1 Introduction 2 A example 3 Http server implemented by elisp 1 Introduction Emacs is not just an editor, Yes, that's true. Emacs lisp can do network connection programming by its network API. But there is something difference with other kinds of programming language. First, elisp do not support multi-thread, pretty cool, huh!! Yeh, Multi-threads programming is a horrible venture for you, right! Second, There is no socket similarly conception in elisp, and elisp provide network programming ability as processes. Elisp can open a network connection by function – open-network-stream .  It can make network connection server listen a special port by function - make-network-process . Both of those function return a process object. Then you can communicate with the process by process's API. 2 A example I write a snippet code to figure out How to use it. ( require ' cl ) ( defvar my-network-client-b...

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