GNU   davin.50webs.com/research
Bringing to you notes for the ages

       Main Menu          Research Projects         Photo Album            Curriculum Vitae      The Greatest Artists
    Email Address       Computer Games          Web Design          Java Training Wheels      The Fly (A Story)   
  Political Activism   Scruff the Cat       My Life Story          Smoking Cessation          Other Links      
Debugging Macros     String Class I     Linked List System I Java for C Programmers Naming Convention
    String Class II         How I use m4              Strings III                 Symmetrical I/O             Linked Lists II     
Run-Time Type Info   Virtual Methods      An Array System        Science & Religion            Submodes       
  Nested Packages      Memory Leaks    Garbage Collection      Internet & Poverty      What is Knowledge?
Limits of Evolution   Emacs Additions      Function Plotter           Romantic Love        The Next Big Thing
    Science Fiction     Faster Compilation Theory of Morality         Elisp Scoping               Elisp Advice      
  S.O.G.M. Pattern       Safe Properties         School Bullying          Charisma Control          Life and Death    
     Splitting Java          Multiple Ctors       Religious Beliefs         Conversation 1           Conversation 2    
   J.T.W. Language    Emacs Additions II      Build Counter             Relation Plotter          Lisp++ Language  
  Memory Leaks II   Super Constructors CRUD Implementation Order a Website Form There Is An Afterlife
More Occam's Razor C to Java Translator Theory of Morality II


My own personal additions to Emacs Free Stuff

Abstract

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 has been supplemented by a later article. This article presents 6 additions to Emacs (my most important customisations) that I have made in the form of 11 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.

1. How to install these features

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.

2. The features

2.1 An automated backup system

Here are the features of my automated backup system:

You can download a tarball containing all of these files.

2.2 A C++ class browser

The file cbrow.el (cbrow stands for Class Browser) implements a C++ class browser. This file requires a file called diagnose.el. Pressing F5 inside a method of a source file (e.g. *.c++, *.cxx, *.cpp or *.cc) takes you to corresponding line for that function in the the header file for that class. Pressing enter at this point takes you back to the source file. Otherwise pressing F5 takes you to a summary list of all the classes in your program. At this point, enter takes you back to the header browser for the selected class. On the theory that a picture is worth 1,000 words the following diagram explains this system more clearly:

To use this code, you will need to customise the function cbrow--init which can be found at the end of cbrow.el. You can download a tarball containing these files. This code has been submitted to the Emacs Lisp List at Cambridge University, England.

2.3 A recoverable file deletion system

The file trashcan.el contains a recoverable file deletion system that behaves like the trash can or recycle bin that many operating systems, present and past, show on their screens. This system creates special directories known as trashcan directories to hold files that can be deleted or undeleted (restored/recovered). On Unix systems there is one trashcan in the folder HOME and in each of the folders /media/[A-Za-z0-9]+/[A-Za-z0-9]+ for one trashcan directory in each Lubuntu drive. On Windows systems there are trashcan directories at the following default locations: a:\TRASHCAN, b:\TRASHCAN, c:\TRASHCAN etc.

This system changes the behaviour of the "x" key in dired mode from permanently deleting files to a two stage system. If you are not in a trashcan directory, then the selected files are moved into a trashcan directory. If you are already in a trashcan directory, the the selected files are permanently deleted. Files in a trashcan directory can be restored by viewing that directory in dired mode, selecting some files and executing the command M-x trashcan-restore. All of the files in a trashcan directory can also be permanently deleted in one hit by issuing the command M-x trashcan-empty. The name "trashcan" comes from my old Amiga Computer which I still have fond memories of! You can download a tarball containing this files. This code has been submitted to the Emacs Lisp List.

2.4 The current function/method on the modeline

The file cfm.el (cfm stands for Current Function/Method) causes the current function (C/C++/Elisp) or method (C++/Java) to be printed on the modeline. This is useful when you are inside a large function/method and you can't remember which one you are in. This code uses diagnose.el. This feature has been super-seeded by a new package d-speedbar. You can download a tarball containing these files. This code has been submitted to the Emacs Lisp List.

2.5 An integrity checker for burnt CD's

The file archive-compare.el contains the function archive-compare--zips that checks the integrity of CD's burnt using my CD burner. This function makes use of the Five Minute Principle which is used by builders to assess the quality of their buildings: if the building stays erect for five minutes after completion, then it will remain erect forever! Translated to the operation of the integrity checker: if the data is still intact after five minutes after the CD is burnt, then it will remain intact for a long time. Internally this function executes the my own shell command compare-files.cc which takes two file arguments, compares them and prints the result of the comparison to std::cout. You can download a tarball containing these files.

2.6 Some useful directory functions

The file directory-files-deep.el contains the following useful functions that generalise the built-in function directory-files:

This file uses the file diagnose.el. You can download a tarball containing these files. This code has been submitted to the Emacs Lisp List.


Back to Research Projects
This page has the following hit count:
| Main Menu | Research Projects | Photo Album | Curriculum Vitae | The Greatest Artists |
| Email Address | Computer Games | Web Design | Java Training Wheels | The Fly (A Story) |
| Political Activism | Scruff the Cat | My Life Story | Smoking Cessation | Other Links |
| Debugging Macros | String Class I | Linked List System I | Java for C Programmers | Naming Convention |
| String Class II | How I use m4 | Strings III | Symmetrical I/O | Linked Lists II |
| Run-Time Type Info | Virtual Methods | An Array System | Science & Religion | Submodes |
| Nested Packages | Memory Leaks | Garbage Collection | Internet & Poverty | What is Knowledge? |
| Limits of Evolution | Emacs Additions | Function Plotter | Romantic Love | The Next Big Thing |
| Science Fiction | Faster Compilation | Theory of Morality | Elisp Scoping | Elisp Advice |
| S.O.G.M. Pattern | Safe Properties | School Bullying | Charisma Control | Life and Death |
| Splitting Java | Multiple Ctors | Religious Beliefs | Conversation 1 | Conversation 2 |
| J.T.W. Language | Emacs Additions II | Build Counter | Relation Plotter | Lisp++ Language |
| Memory Leaks II | Super Constructors | CRUD Implementation | Order a Website Form | There Is An Afterlife |
| More Occam's Razor | C to Java Translator | Theory of Morality II
Last modified: Fri Dec 9 21:04:42 NZDT 2016
Best viewed at 800x600 or above resolution.
© Copyright 1999-2016 Davin Pearson.
Please report any broken links to