Sammanfattning: Link ElispArea at the top
< This is the place for guidelines and existing coding practices for EmacsLisp files on EmacsWiki pages.
> This is the place for guidelines and existing coding practices for EmacsLisp files on EmacsWiki pages (the ElispArea).
Guidelines that say “should” are paraphrased from the EmacsLispReference. Text in angle brackets (
>) is exemplary only – replace it with your text. Note, in particular, the difference between lines that start with
;;; and lines that start with
;;. Three semi-colons indicate major file sections.
The major section headings are, in order:
;;; <name>.el --- <one-line description of the library>
;;; Change Log:(optional)
;;; <name>.el ends here
Here are descriptions of all commonly used (or proposed) sections:
;;; <name>.el --- <one-line description of the library>. This should contain the same description as the
;; Description:field, if that exists. The filename should be the same as the
;; Filename:field. Both
;; Filename:are considered obsolete.
;; Copyright (C) <YEAR> <NAME> <EMAIL>– for example,
;; Copyright (C) 2000-2005 J. Random Hacker <email@example.com>or
;; Copyright (C) 2000-2005 J. Random Hacker <firstname.lastname@example.org>, all rights reserved.. Copyright could be granted to organization, for example
Free Software Foundation, Inc.. If there are more than one copyright holders, list them separated by commas.
;; Maintainer:. Those fields should state the name, and they can also indicate the net address, if appropriate. For example
;; Maintainer: Joe Hacker <email@example.com>. If there are multiple authors, you can list them on continuation lines led by `
;;’ and a tab character (use `
C-q TAB’ to insert it).
;; Last-Updated: <date in UTC, or with timezone present>
;; By: <name of modifier>
;; Update #: <counter incremented after each update>– successive Wiki updates need not have successive update numbers).
;; Created: <creation date>, for example
14 Jul 1992
;; Version: <library version>, for example
;; Keywords: <M-x finder-list-keywords>, separated by commas>. This line lists keywords for the help command
;; URL: <location of the file>– use
http://www.emacswiki.org/cgi-bin/emacs/download/name.elif you want to host it here
;; Compatibility: <target Emacs versions>and
;; EmacsWiki:(EmacsWiki page that describes the library). For example, this would be
;; EmacsWiki: OccurBufferfor Lisp:color-moccur.el (OccurBuffer). A good place for this is just after
;;; Commentary:. Sometimes, the
Commentarysection is divided into
;;; Change Log:.
;; This file is *NOT* part of GNU Emacs., or
;; This file is part of GNU Emacs., or
;; This file is part of XEmacs., as appropriate. If present, this appears typically before
;;; <name>.el ends here. The final full stop is optional.
FWIW, the EmacsLispReference suggests for files contributed to GNU (Info node `Emacs Lisp Coding Conventions’):
Relying on case in filenames is not a very good idea, either. Sure, it works on UNIX:ish systems, but not in Windows.
See also: AutomaticFileHeaders for automatic insertion of appropriate file headers.