I have used the GNU Emacs text editor for 20 years (Happy Anniversary Emacs!). During which time I have written over 54,000 lines of Emacs Lisp code to customise the program so that it behaves exactly like how I want it to behave. This article is a supplement to an earlier article. This article presents 10 additions to Emacs (my most important customisations) that I have made in the form of 24 Emacs Lisp (*.el) files. The Lisp files presented in this document should work on all dialects of Emacs, including but not limited to GNU Emacs and XEmacs. Please email me if you encounter any problems installing these files in your local Emacs system. The files linked to from this document fall under the GNU General Public License. You can download an archive file containing almost my entire Emacs customisations. The name of the tarball dlisp.tar.gz the d in dlisp stands for Davin's customizations to elisp, i.e. Emacs Lisp. In the Emacs *.el source files that follow, the d- prefix stands for Davin's customisations.
To install an arbitrary Emacs Lisp file foo.el to your own local Emacs system, simply copy foo.el to one of the folders pointed to by the variable load-path and add the line (require 'foo) to your .emacs file. If you do not already have a .emacs file, create one in the folder that the environment variable HOME points to. If your HOME variable is not set, as might be the case if you are using Microsoft Windows then the HOME folder will be c:/. The trouble with this approach is that the root directory of your c:/ drive will be cluttered with a whole heap of miscellaneous files, e.g. .* (files beginning with a period). If you don't want this then you need to set it to a appropriate value for your system. Examples of sensible values for HOME on Windows systems include c:/home or d:/home (if your d:/ drive is a hard disk) or whatever. It is important that the folder pointed to by HOME actually exists, so you can put your .emacs file into it.
The files d-groups.el, d-electric.el and diagnose.el contains code for setting the colour of the modeline dependent on the current folder, for example, modelines of files in the folder ~/bak are coloured with yellow text with a red background because that folder is reserved for backup files and it is therefore dangerous to edit these files. The colour of modelines of files in my HOME folder ~/ is a more subdued black text with a light blue background, the colour of modelines of files in my ~/dlisp folder is black text with a light green background, the colour of modelines of files in my ~/java-projects folder is black text with an orange background, and the colour of modelines of files in my ~/hairy-lemon folder is green text with a black background. Also the Electric Buffers Menu is highlighted with the colour of each buffer so you can easily see which files you are editing. Note that the term ‘‘buffer’’ is Emacs speak for a file that has been loaded into Emacs, although some buffers have no file associated with them. To use this system, you will need to customise the function d-groups-get-face in the file d-groups.el by following the conventions established in this function. You can download a tarball containing these files.
The file dired-colours.el and diagnose.el contains code for implementing syntax highlighting on dired buffers. Note that ‘‘dired’’ is Emacs terminology for Directory Editor. For example GIF/JPG/PNG images are coloured like so (respectively): foo.gif, foo.jpg and foo.png, executable files are coloured like foo.exe, archive files are coloured like so: foo.tar.gz, foo.tar and foo.zip, H.T.M.L. documents are coloured like foo.html and foo.css, folders are coloured like foo, Java/C/C++/Emacs Lisp source files are coloured like this (respectively): Foo.java, foo.c, foo.c++, foo.el and text files are coloured like foo.txt (i.e. without any decoration). You can download a tarball containing these files. This code has been submitted to the Emacs Lisp List at Cambridge University, England.
The file d-flock.el contains code for my personal syntax highlighting preferences. The phrase flock comes from Emacs' terminology of calling syntax highlighting font lock mode. This file uses the files d-flock-coding-preferences.el, d-flock-lisp++.el, d-flock-private.el, diagnose.el and d-make-faces.el You can also download a tarball containing these files. This code has been submitted to the Emacs Lisp List.
The file d-speedbar.el causes the current function or method to be shown highlighted in the right window alongside a list of all the functions and methods in a file. This is intended to replace the cfm feature which placed the current function or method on the modeline. This file uses the files d-electric.el, d-comp.el, cfm.el, d-keys.el and diagnose.el. This is an improvement over the built-in Emacs Lisp package speedbar.el with the advantage that the browser window appears inside the same Emacs frame as the main Emacs frame, so that multiple frames are not necessary to use the system. Emacs windows are easier to manage using the keyboard than Emacs frames. As of Version 1.1, one d-speedbar buffer is shown for each frame. You can download a tarball containing these files. This code has been submitted to the Emacs Lisp List.
The file rsi-brk.el contains code for implementing an R.S.I. (Repetitive Strain Injury) typing break of rsi-break (by default 10) seconds every rsi-period (by default (* 5 60) seconds). This file uses the files pause-break.el and d-time.el. You can download a tarball containing these files. This code has been submitted to the Emacs Lisp List.
The file d-testlinks.el contains code for validating the href= and src= links in H.T.M.L. web pages. You can download a tarball containing this files and a sound sample that plays on completing the test. This code has been submitted to the Emacs Lisp List.
Have you ever sat programmming on your computer only to realise that the cooking on your stove top has been burnt for want of lack of care of your cooking? For those of you who are out there, this system is for you. You simply execute M-x meal-timer and the minibuffer prompts you for a time to elapse before a sound sample is played. While the timer is counting down, the number of hours, minutes and seconds remaining is continuously updated on the mode line. This is a superior replacement from the built-in appt.el system. There is also support for stopping and restarting the timer countdown, namely the commands meal-timer-stop and meal-timer-start. The file d-meal-timer.el contains code for a meal timer alarm feature. The file d-meal-timer.el uses the file d-time.el. You can download a tarball containing these files and a sound sample that is played when the timer elapses. This code has been submitted to the Emacs Lisp List.
The file d-appt.el contains code for an improved appointment system over the Emacs built-in appt appointment notification system. See my ~/.diary file for how to use the system. In particular *.wav sound samples are played when appointments occur and every 30 minutes the message "OK Davin it's time for a pause break so you should do something else which is away from the computer" is played through your computer's speakers to give you a sense of time passing and to remind you to have a break away from the computer. At 09:00 hours every morning d-appt.el runs a shell command to start Foobar2000 playing my *.flac collection at random like a radio station. At approximately 12:30 hours (the actual time varies from day to day) d-appt.el runs a shell command to terminate Foobar2000 from playing my *.flac collection. The file d-appt.el uses the files d-number-sayer.el and d-time.el. You can download a a tarball containing these files. This code has been submitted to the Emacs Lisp List.
The file d-dabbrev.el contains code for an improved dabbrev system over the Emacs built-in dabbrev system. In particular, text inside the kill-ring, file-name-history, command-history, minibuffer-history, search-ring, apropos-pattern-quoted, buffer-list and deleted text are searched in addition to buffers in memory. The file d-dabbrev.el uses the file d-key-nav.el. You can download a tarball containing these files.
The file d-recent.el contains code for implementing an improved recent file visited system over Emacs' built-in recentf system. With this file loaded, pressing the Enter key on the numeric keypad brings up a window showing files recently visited. The file d-recent.el uses the files d-groups.el, d-make-faces.el, d-time.el, d-find.el and diagnose.el. You can download a tarball containing these files.
The file d-readonly.el contains code for setting the read-only status of certain files to prevent accidental editing of them. To override this system, press F7 to toggle the read-only status of a given file. To use this system, you will need to customise the function d-readonly in the file d-readonly.el. You can download a tarball containing these files.
|Back to Research Projects|
This page has the following hit count: