auf.suno
Connector, investor, futurist, geek, software developer, innovator, sportsman, libertarian, business enabler, cosmopolitan, autodidact, funny finch, tech evangelist,
purist, agnostic, Kärnten fan, foodie, artist, globetrotter, social liberal but fiscal conservative, Schöngeist... elegantiorum litterarum amans oder studiosus...

This is the website of Markus Gattol. It is composed, driven and secured/encrypted exclusively by Open Source Software. The speciality of this website
is that it is seamlessly integrating into my daily working environment (Python + MongoDB + Linux + SSH + GIT + ZeroMQ) which therefore means it
becomes a fully fledged and automatized publishing and communication platform. It will be under construction until 2014.

Open Source / Free Software, because freedom is in everyone's language...
Frihed Svoboda Libertà Vrijheid เสรีภาพ Liberté Freiheit Cê̤ṳ-iù Ελευθερία Свобода חרות Bebas Libertada 自由
auf.suno
Website Sections
Home
FAQs
About Me
Tweets by @markusgattol
GNU Emacs
Status: IDE (Integrated Development Environment) part still incomplete.
Last changed: Saturday 2015-01-10 18:31 UTC
Abstract:

Measured in time, GNU Emacs is by far the most used application here. I use it to read/write email/news, as CLI (Command Line Interface), image viewer, to chat in IRC channels or do jabber IM (Instant Messaging), write and manage this website, listen to music, programming (this by itself would be tens of things worth to mention that I do with the powers of Emacs), manage my remote servers, as a PIM (Personal Information System) etc. The purpose of this page is to show folks what and how I get things done with GNU Emacs.
Table of Contents
Miscellaneous
Planner
Install
Set up and Configure
Muse
Remember
IDE
Python
Specific Python Preparations
Our Python + GNU Emacs Agenda
ECB
CEDET

Presenting Emacs as an editor is analogous to presenting mathematics
as arithmetic.
      — Mike Mattie on the emacs-devel mailing list

Emacs outshines all other editing software in approximately the same
way that the noonday sun does the stars. It is not just bigger and
brighter; it simply makes everything else vanish.
      — Neal Stephenson

This is the main page related to GNU Emacs at my website. This page will nonetheless point to some topics about GNU Emacs that I felt should have a dedicated page:

  • For short notes and my GNU Emacs cheat sheet click here...
  • I use Gnus to do email and news - it is the biggest GNU Emacs package and thus deserves a dedicated page.
  • Muse is what I use to write/manage this website.
  • Another two packages that should go on a dedicated pages are planner-mode respectively org-mode, my PIM (Personal Information Manager) tools.
  • For those interested in my .emacs file (automatically updated and transferred to this website whenever I change it — thus you are looking at up-to-date data).
    • Go here for the HTML version or download the
    • plain text version
    • As of now, Saturday 2015-01-10 [18:31 UTC] , my .emacs has 4333 lines (blank lines have not been counted).
  • Python hacking with GNU Emacs.

This page is also part of a bigger context called Markus's Scheduling and self-management System. Following pages are considered being part of this context:

  • GTD (Getting Things Done)
  • The Schedule of Markus Gattol which links to
    • The index of Markus's to-the-net-published schedule data
  • The PIM (Personal Information Manager) system existing of
    • GNU Emacs (current page) and some add-on software which is
    • planner-mode and
    • org-mode

Caution: Please be aware that if you do not know GNU Emacs yet... oOOooOooh kid... it might let you do things that might look pretty odd to your environment... However, do not worry... other Emacsers will very well understand you ;-]

Miscellaneous

This section is in place for several add-on packages to Emacs (e.g. Muse, Planner etc.) I heavily use. It is about things that are common for all of those packages i.e. how to install them, update them, set things up and configure things to fit ones personal needs/likings. However, as times goes by, I might very well put other things into that sections as well... not sure yet (January 2008)...

Planner

Muse, Planner, Remember, etc. I am using up-to-date versions of each i.e. I directly checkout from upstream repositories as can be seen below — this way I am always with the latest and greatest...

Install

All my local Emacs source code is under ~/.emacs_misc/libs as can be seen in lines 5 to 18. Lines 1 and 2 are just there because I already had the git tree installed — to show how it works I deleted it again (line 2).

 1  sa@pc1:~$ cd .emacs_misc/libs/
 2  sa@pc1:~/.emacs_misc/libs$ rm -rf planner/
 3  sa@pc1:~/.emacs_misc/libs$ ll
 4  total 56K
 5  drwxr-xr-x  2 sa sa 4.0K 2007-09-12 17:46 allout
 6  drwxr-xr-x 11 sa sa 4.0K 2007-12-07 09:40 bbdb
 7  drwxr-xr-x  2 sa sa 4.0K 2007-09-12 17:46 bm+
 8  drwxr-xr-x  2 sa sa 4.0K 2007-02-27 20:23 css
 9  drwxr-xr-x  2 sa sa 4.0K 2007-09-12 17:46 htmlize
10  drwxr-xr-x 10 sa sa 4.0K 2008-01-24 09:12 muse
11  drwxr-xr-x  2 sa sa 4.0K 2008-01-07 09:10 pastie
12  drwxr-xr-x  2 sa sa 4.0K 2007-06-23 02:34 pgg
13  drwxr-xr-x  2 sa sa 4.0K 2007-09-12 17:47 ps
14  drwxr-xr-x  4 sa sa 4.0K 2008-01-23 13:54 remember
15  drwxr-xr-x  4 sa sa 4.0K 2007-09-12 12:36 scm
16  drwxr-xr-x  2 sa sa 4.0K 2007-09-12 17:47 unbound
17  drwxr-xr-x  9 sa sa 4.0K 2008-01-21 15:58 w3m
18  drwxr-xr-x  2 sa sa 4.0K 2007-10-27 01:19 wtf
19  sa@pc1:~/.emacs_misc/libs$ time git clone git://repo.or.cz/planner-el.git planner
20  Initialized empty Git repository in /home/sa/.emacs_misc/libs/planner/.git/
21  remote: Counting objects: 831, done.
22  remote: Compressing objects: 100% (215/215), done.
23  Indexing 831 objects...
24  remote: Total 831 (delta 610), reused 831 (delta 610)
25   100% (831/831) done
26  Resolving 610 deltas...
27   100% (610/610) done
28
29  real    0m2.871s
30  user    0m0.808s
31  sys     0m0.112s
32  sa@pc1:~/.emacs_misc/libs$

The ll in line 3 is just alias in my .bashrc. The really important thing here is line 19 — I used time as well which is not obligatory just to show how fast GIT is — takes not even 3 seconds to check out up-to-date Planner code.

From time to time, or in case I need the just made bugfix from the repository, I update particular, several or all of my local upstream repositories. One might take a look at my setup in my .bashrc (all the aliases starting with mu etc.). An explanation about what I did there can be found here.

Set up and Configure

Can all be found in my .emacs (for further information, see beginning of this page). What you are looking for are those lines


(add-to-list 'load-path (expand-file-name "~/.emacs_misc/libs/planner"))

and further on — but that has actually nothing to do with the installation and setup — the detailed configuration for each add-on package.

Muse

Same as for Planner, just use git clone git://repo.or.cz/muse-el.git muse instead.

Remember

Same as for Planner, just use git clone git://repo.or.cz/remember-el.git remember instead.

IDE

Emacs is, aside from many other things, an IDE (Integrated Development Environment) if we want it to be...

Setups as described below are for those which are about to dive into the depths of some mid to large scale software development project, using one or more major programming languages like for example C, Java, Python, Ada, PHP, C++, etc.

Those who just want to edit some shell script, do email, edit and view photos, organize themselves, play music, write some article/thesis, chat, etc. simply do not need to unleash all the IDE (Integrated Development Environment) powers with GNU Emacs.

Aside from best practices, I will provide information about what I think makes up for the best <some programming language> + Emacs experience possible. However, before we get to the beef, I find it important to make some common statements:

  • Whatever programming language we are talking about, there is some common approach to them all. Emacs has programming modes for pretty much any programming language out there. For example, in case of Python, we pick python-mode. This one, as pretty much all the others, ship with GNU Emacs i.e. there is nothing special to do like for example install something in addition to GNU Emacs itself.
  • Every so-called major mode (e.g. python-mode) can be used with many minor modes which add functionality to some major mode e.g. code refactoring, remote file editing, hooked support for some SCM (Software Configuration Management) system (e.g. SVN, GIT, etc.), semantic code folding, compiling, debugging, autocompletion, reporting, etc.
  • After installing all GNU Emacs core and add-on packages (all possible with a simple aptitude install <package_name>) that provide us with major and minor modes, we can/need to configure GNU Emacs to our personal likings. This however, is the thing that people refer to when the say GNU Emacs has step learning curve. All the configuration information can go in one or more files — .emacs that is (see above). I use the one file approach and use some nifty minor mode called allout-mode to do all the structuring of my .emacs file.

Python

This subsection is about best practices when it comes to Python programming with GNU Emacs.

Specific Python Preparations

Well, we do exactly as I said above i.e. we install a few packages if not installed already which is what I already did as can be seen.

sa@wks:~$ type dpl
dpl is aliased to `dpkg -l'
sa@wks:~$ dpl emacs-snap* | grep ^ii
ii  emacs-snapshot                             1:20081129-1               The GNU Emacs editor (development snapshot)
ii  emacs-snapshot-bin-common                  1:20081129-1               The GNU Emacs editor's shared, architecture
ii  emacs-snapshot-common                      1:20081129-1               The GNU Emacs editor's common infrastructure
ii  emacs-snapshot-el                          1:20081129-1               GNU Emacs LISP (.el) files
ii  emacs-snapshot-gtk                         1:20081129-1               The GNU Emacs editor (transitional package)
sa@wks:~$ dpl ecb* | grep ^ii
ii  ecb                                        2.32-1                     code browser for Emacs supporting several languages
sa@wks:~$ dpl pymacs* | grep ^ii
ii  pymacs                                     0.23-1.1                   interface between Emacs Lisp and Python
sa@wks:~$ dpl python-rop* | grep ^ii
ii  python-rope                                0.8.4-3                    Python refactoring library
ii  python-ropemacs                            0.6c2-3                    Emacs mode for Python refactoring
sa@wks:~$

Those are the packages which I think are the ones in order to create experience the best Python + Emacs experience possible. However, many things which I also use on a daily basis with other major/minor modes have not been mentioned explicitly yet simply because they are not Python specific but instead they are used with more than one major/minor mode.

For example, there is the package emacs-goodies-el installed on my system which provides a whole bunch of such common goodies. Then there is of course all the code which I pull from repositories on the net on a regular

sa@wks:~$ ll em/libs/
total 20K
drwxr-xr-x  2 sa sa   22 2008-06-02 10:40 allout
drwxr-xr-x 12 sa sa 4.0K 2008-06-17 16:02 bbdb
drwxr-xr-x  2 sa sa   26 2008-06-02 10:40 bm+
drwxr-xr-x  2 sa sa   24 2008-06-02 10:39 css
drwxr-xr-x  2 sa sa  101 2008-06-02 10:40 etexshow
drwxr-xr-x  2 sa sa   23 2008-06-02 10:40 htmlize
drwxr-xr-x 10 sa sa 4.0K 2008-11-24 09:38 muse
drwxr-xr-x  2 sa sa   22 2008-06-02 10:40 pastie
drwxr-xr-x  2 sa sa   72 2008-06-02 10:40 pgg
drwxr-xr-x  6 sa sa 4.0K 2008-07-11 18:54 planner
drwxr-xr-x  2 sa sa   27 2008-06-02 10:40 ps
drwxr-xr-x  3 sa sa   33 2008-06-02 10:40 pwsafe
drwxr-xr-x  4 sa sa 4.0K 2008-06-02 10:40 remember
drwxr-xr-x  4 sa sa   27 2008-06-02 10:40 scm
drwxr-xr-x  2 sa sa   23 2008-06-02 10:40 unbound
drwxr-xr-x  9 sa sa 4.0K 2008-11-21 17:31 w3m
drwxr-xr-x  2 sa sa   36 2008-06-02 10:40 wtf
sa@wks:~$

In the end, all comes down to what I explain here with regards to Python and all the code within my .emacs. I am for example not going to explicitly mention that it might be a smart thing to put

(show-paren-mode t)
(transient-mark-mode t)
(global-font-lock-mode t)
(setq auto-save-interval 100)
(setq auto-save-timeout 3)
(savehist-mode t)

into .emacs simply because I think that is not Python specific but some common thing that I think should be applied for all major modes etc. For such common things please just take a look into my .emacs.

Our Python + GNU Emacs Agenda

In the following we are going to look at how to set up and configure

  • GNU Emacs's major mode for Python editing called python-mode.
  • ECB (Emacs Code Browser), a nifty add-on package to GNU Emacs used for code browsing i.e. it turns GNU Emacs into a fully fledged IDE (Integrated Development Environment).
  • Take a look at CEDET (Collection of Emacs Development Environment Tools) and use its functionality with regards to having GNU Emacs act as an IDE.
  • add some minor modes to the mix which are going to provide us with additional functionality, ease things and boost our coding experience in general.

I figured we can jump right to ECB, skipping the whole installation and setup of GNU Emacs itself — what packages to install are mentioned above plus there is my .emacs to look at for configuration matters.

ECB

ECB (Emacs Code Browser) is as its name says... a code browser. While Emacs already has good editing support for many modes, its browsing support is somewhat lacking out of the box. That is where ECB comes in — it displays a number of informational windows that allow for easy source code navigation and overview.

Thereby it does not matter what kind of files we are working on i.e. some C++ programm, some PhD thesis written with LaTeX or ConTeX, some Muse project, etc.. With ECB we can browse through all that files/directories and interact in various ways with all the information provided.

How does it look like? Below is what it looks like, right after installing it, no custom configuration in place so far — just what it looks like out of the box...

As can be seen, I have my .emacs file opened, added (require 'ecb) and then used M-x ecb-activate to get the result that can be seen above. ECB shows those four windows in the left hand side of the current frame, directory tree at the top, contents of current directory below, below that, a list of functions/classes/methods/etc. in the current and at the bottom a history of visited files so far. I also have a screencasts for ECB available for those which are more into motion pictures ;-]

CEDET

CEDET (Collection of Emacs Development Environment Tools)...

Creative Commons License
The content of this site is licensed under Creative Commons Attribution-Share Alike 3.0 License.