;;; Code:
-(defvar asm-comment-char ?;
- "*The comment-start character assumed by Asm mode.")
+(defgroup asm nil
+ "Mode for editing assembler code."
+ :group 'languages)
+
+(defcustom asm-comment-char ?;
+ "*The comment-start character assumed by Asm mode."
+ :type 'character
+ :group 'asm)
(defvar asm-mode-syntax-table nil
"Syntax table used while in Asm mode.")
;;; *** Customization *****************************************************
+(defcustom dcl nil
+ "Major mode for editing DCL command files."
+ :group 'languages)
-(defvar dcl-basic-offset 4
+(defcustom dcl-basic-offset 4
"*Number of columns to indent a block in DCL.
A block is the commands between THEN-ELSE-ENDIF and between the commands
dcl-block-begin-regexp and dcl-block-end-regexp.
The meaning of this variable may be changed if
-dcl-calc-command-indent-function is set to a function.")
+dcl-calc-command-indent-function is set to a function."
+ :type 'integer
+ :group 'dcl)
-(defvar dcl-continuation-offset 6
+(defcustom dcl-continuation-offset 6
"*Number of columns to indent a continuation line in DCL.
A continuation line is a line that follows a line ending with `-'.
The meaning of this variable may be changed if
-dcl-calc-cont-indent-function is set to a function.")
+dcl-calc-cont-indent-function is set to a function."
+ :type 'integer
+ :group 'dcl)
-(defvar dcl-margin-offset 8
+(defcustom dcl-margin-offset 8
"*Indentation for the first command line in DCL.
The first command line in a file or after a SUBROUTINE statement is indented
this much. Other command lines are indented the same number of columns as
the preceding command line.
-A command line is a line that starts with `$'.")
+A command line is a line that starts with `$'."
+ :type 'integer
+ :group 'dcl)
-(defvar dcl-margin-label-offset 2
+(defcustom dcl-margin-label-offset 2
"*Number of columns to indent a margin label in DCL.
A margin label is a label that doesn't begin or end a block, i.e. it
-doesn't match dcl-block-begin-regexp or dcl-block-end-regexp.")
+doesn't match dcl-block-begin-regexp or dcl-block-end-regexp."
+ :type 'integer
+ :group 'dcl)
-(defvar dcl-comment-line-regexp "^\\$!"
+(defcustom dcl-comment-line-regexp "^\\$!"
"*Regexp describing the start of a comment line in DCL.
-Comment lines are not indented.")
+Comment lines are not indented."
+ :type 'regexp
+ :group 'dcl)
-(defvar dcl-block-begin-regexp "loop[0-9]*:"
+(defcustom dcl-block-begin-regexp "loop[0-9]*:"
"*Regexp describing a command that begins an indented block in DCL.
-Set to nil to only indent at THEN-ELSE-ENDIF.")
+Set to nil to only indent at THEN-ELSE-ENDIF."
+ :type 'regexp
+ :group 'dcl)
-(defvar dcl-block-end-regexp "endloop[0-9]*:"
+(defcustom dcl-block-end-regexp "endloop[0-9]*:"
"*Regexp describing a command that ends an indented block in DCL.
-Set to nil to only indent at THEN-ELSE-ENDIF.")
+Set to nil to only indent at THEN-ELSE-ENDIF."
+ :type 'regexp
+ :group 'dcl)
-(defvar dcl-calc-command-indent-function nil
+(defcustom dcl-calc-command-indent-function nil
"*Function to calculate indentation for a command line in DCL.
If this variable is non-nil it is called as a function:
This package includes two functions suitable for this:
dcl-calc-command-indent-multiple
- dcl-calc-command-indent-hang
-")
+ dcl-calc-command-indent-hang"
+ :type 'function
+ :group 'dcl)
-(defvar dcl-calc-cont-indent-function 'dcl-calc-cont-indent-relative
+(defcustom dcl-calc-cont-indent-function 'dcl-calc-cont-indent-relative
"*Function to calculate indentation for a continuation line.
If this variable is non-nil it is called as a function:
CUR-INDENT + EXTRA-INDENT.
This package includes one function suitable for this:
- dcl-calc-cont-indent-relative
-")
+ dcl-calc-cont-indent-relative"
+ :type 'function
+ :group 'dcl)
-(defvar dcl-tab-always-indent t
+(defcustom dcl-tab-always-indent t
"*Controls the operation of the TAB key in DCL mode.
If t, pressing TAB always indents the current line.
If nil, pressing TAB indents the current line if point is at the left margin.
Data lines (i.e. lines not part of a command line or continuation line) are
-never indented.")
+never indented."
+ :type 'boolean
+ :group 'dcl)
-(defvar dcl-electric-characters t
- "*Non-nil means reindent immediately when a label, ELSE or ENDIF is inserted.")
+(defcustom dcl-electric-characters t
+ "*Non-nil means reindent immediately when a label, ELSE or ENDIF is inserted."
+ :type 'boolean
+ :group 'dcl)
-(defvar dcl-tempo-comma ", "
- "*Text to insert when a comma is needed in a template, in DCL mode.")
+(defcustom dcl-tempo-comma ", "
+ "*Text to insert when a comma is needed in a template, in DCL mode."
+ :type 'string
+ :group 'dcl)
-(defvar dcl-tempo-left-paren "("
- "*Text to insert when a left parenthesis is needed in a template in DCL.")
+(defcustom dcl-tempo-left-paren "("
+ "*Text to insert when a left parenthesis is needed in a template in DCL."
+ :type 'string
+ :group 'dcl)
-(defvar dcl-tempo-right-paren ")"
- "*Text to insert when a right parenthesis is needed in a template in DCL.")
+(defcustom dcl-tempo-right-paren ")"
+ "*Text to insert when a right parenthesis is needed in a template in DCL."
+ :type 'string
+ :group 'dcl)
; I couldn't decide what looked best, so I'll let you decide...
; Remember, you can also customize this with imenu-submenu-name-format.
-(defvar dcl-imenu-label-labels "Labels"
- "*Imenu menu title for sub-listing with label names.")
-(defvar dcl-imenu-label-goto "GOTO"
- "*Imenu menu title for sub-listing with GOTO statements.")
-(defvar dcl-imenu-label-gosub "GOSUB"
- "*Imenu menu title for sub-listing with GOSUB statements.")
-(defvar dcl-imenu-label-call "CALL"
- "*Imenu menu title for sub-listing with CALL statements.")
-
-(defvar dcl-imenu-generic-expression
+(defcustom dcl-imenu-label-labels "Labels"
+ "*Imenu menu title for sub-listing with label names."
+ :type 'string
+ :group 'dcl)
+(defcustom dcl-imenu-label-goto "GOTO"
+ "*Imenu menu title for sub-listing with GOTO statements."
+ :type 'string
+ :group 'dcl)
+(defcustom dcl-imenu-label-gosub "GOSUB"
+ "*Imenu menu title for sub-listing with GOSUB statements."
+ :type 'string
+ :group 'dcl)
+(defcustom dcl-imenu-label-call "CALL"
+ "*Imenu menu title for sub-listing with CALL statements."
+ :type 'string
+ :group 'dcl)
+
+(defcustom dcl-imenu-generic-expression
(`
((nil "^\\$[ \t]*\\([A-Za-z0-9_\$]+\\):[ \t]+SUBROUTINE\\b" 1)
((, dcl-imenu-label-labels)
((, dcl-imenu-label-goto) "\\s-GOTO[ \t]+\\([A-Za-z0-9_\$]+\\)" 1)
((, dcl-imenu-label-gosub) "\\s-GOSUB[ \t]+\\([A-Za-z0-9_\$]+\\)" 1)
((, dcl-imenu-label-call) "\\s-CALL[ \t]+\\([A-Za-z0-9_\$]+\\)" 1)))
-"*Default imenu generic expression for DCL.
+ "*Default imenu generic expression for DCL.
The default includes SUBROUTINE labels in the main listing and
sub-listings for other labels, CALL, GOTO and GOSUB statements.
-See `imenu-generic-expression' for details.")
+See `imenu-generic-expression' for details."
+ :type '(repeat (sexp :tag "Imenu Expression"))
+ :group 'dcl)
-(defvar dcl-mode-hook nil
- "*Hook called by `dcl-mode'.")
+(defcustom dcl-mode-hook nil
+ "*Hook called by `dcl-mode'."
+ :type 'hook
+ :group 'dcl)
;;; *** Global variables ****************************************************
)
-(defvar dcl-ws-r
+(defcustom dcl-ws-r
"\\([ \t]*-[ \t]*\\(!.*\\)*\n\\)*[ \t]*"
"Regular expression describing white space in a DCL command line.
White space is any number of continued lines with only space,tab,endcomment
-followed by space or tab.")
+followed by space or tab."
+ :type 'regexp
+ :group 'dcl)
-(defvar dcl-label-r
+(defcustom dcl-label-r
"[a-zA-Z0-9_\$]*:\\([ \t!]\\|$\\)"
"Regular expression describing a label.
-A label is a name followed by a colon followed by white-space or end-of-line.")
+A label is a name followed by a colon followed by white-space or end-of-line."
+ :type 'regexp
+ :group 'dcl)
-(defvar dcl-cmd-r
+(defcustom dcl-cmd-r
"^\\$\\(.*-[ \t]*\\(!.*\\)*\n\\)*[^!\"\n]*\\(\".*\\(\"\".*\\)*\"\\)*[^!\"\n]*"
"Regular expression describing a DCL command line up to a trailing comment.
A line starting with $, optionally followed by continuation lines,
followed by the end of the command line.
A continuation line is any characters followed by `-',
-optionally followed by a comment, followed by a newline.")
+optionally followed by a comment, followed by a newline."
+ :type 'regexp
+ :group 'dcl)
-(defvar dcl-command-regexp
+(defcustom dcl-command-regexp
"^\\$\\(.*-[ \t]*\\(!.*\\)*\n\\)*.*\\(\".*\\(\"\".*\\)*\"\\)*"
"Regular expression describing a DCL command line.
A line starting with $, optionally followed by continuation lines,
followed by the end of the command line.
A continuation line is any characters followed by `-',
-optionally followed by a comment, followed by a newline.")
+optionally followed by a comment, followed by a newline."
+ :type 'regexp
+ :group 'dcl)
-(defvar dcl-electric-reindent-regexps
+(defcustom dcl-electric-reindent-regexps
(list "endif" "else" dcl-label-r)
"*Regexps that can trigger an electric reindent.
A list of regexps that will trigger a reindent if the last letter
E.g.: if this list contains `endif', the key `f' is defined as
dcl-electric-character and the you have just typed the `f' in
-`endif', the line will be reindented.")
+`endif', the line will be reindented."
+ :type '(repeat regexp)
+ :group 'dcl)
(defvar dcl-option-alist
(require 'cc-mode)
+(defgroup hide-ifdef nil
+ "Hide selected code within `ifdef'."
+ :group 'c)
+
(defvar hide-ifdef-mode-submap nil
"Keymap used with Hide-Ifdef mode.")
;===%%SF%% exports (Start) ===
;;;###autoload
-(defvar hide-ifdef-initially nil
- "*Non-nil means call `hide-ifdefs' when Hide-Ifdef mode is first activated.")
+(defcustom hide-ifdef-initially nil
+ "*Non-nil means call `hide-ifdefs' when Hide-Ifdef mode is first activated."
+ :type 'boolean
+ :group 'hide-ifdef)
;;;###autoload
-(defvar hide-ifdef-read-only nil
- "*Set to non-nil if you want buffer to be read-only while hiding text.")
+(defcustom hide-ifdef-read-only nil
+ "*Set to non-nil if you want buffer to be read-only while hiding text."
+ :type 'boolean
+ :group 'hide-ifdef)
(defvar hif-outside-read-only nil
"Internal variable. Saves the value of `buffer-read-only' while hiding.")
;;;###autoload
-(defvar hide-ifdef-lines nil
- "*Non-nil means hide the #ifX, #else, and #endif lines.")
+(defcustom hide-ifdef-lines nil
+ "*Non-nil means hide the #ifX, #else, and #endif lines."
+ :type 'boolean
+ :group 'hide-ifdef)
(defun hide-ifdef-toggle-read-only ()
"Toggle hide-ifdef-read-only."
(require 'easymenu)
+(defgroup meta-font nil
+ "Major mode for editing Metafont or MetaPost sources."
+ :group 'languages)
+
;;; Fontification.
(defvar meta-font-lock-keywords
\f
;;; Indentation.
-(defvar meta-indent-level 2
- "*Indentation of begin-end blocks in Metafont or MetaPost mode.")
+(defcustom meta-indent-level 2
+ "*Indentation of begin-end blocks in Metafont or MetaPost mode."
+ :type 'integer
+ :group 'meta-font)
-(defvar meta-left-comment-regexp "%%+"
- "*Regexp matching comments that should be placed on the left margin.")
+(defcustom meta-left-comment-regexp "%%+"
+ "*Regexp matching comments that should be placed on the left margin."
+ :type 'regexp
+ :group 'meta-font)
-(defvar meta-right-comment-regexp nil
- "*Regexp matching comments that should be placed to the right margin.")
+(defcustom meta-right-comment-regexp nil
+ "*Regexp matching comments that should be placed to the right margin."
+ :type '(choice regexp
+ (const :tag "None" nil))
+ :group 'meta-font)
-(defvar meta-ignore-comment-regexp "%[^%]"
- "*Regexp matching comments that whose indentation should not be touched.")
+(defcustom meta-ignore-comment-regexp "%[^%]"
+ "*Regexp matching comments that whose indentation should not be touched."
+ :type 'regexp
+ :group 'meta-font)
-(defvar meta-begin-environment-regexp
+(defcustom meta-begin-environment-regexp
(concat "\\(begin\\(char\\|fig\\|gr\\(aph\\|oup\\)\\|logochar\\)\\|"
"def\\|for\\(\\|ever\\|suffixes\\)\\|if\\|mode_def\\|"
"primarydef\\|secondarydef\\|tertiarydef\\|vardef\\)")
- "*Regexp matching the beginning of environments to be indented.")
+ "*Regexp matching the beginning of environments to be indented."
+ :type 'regexp
+ :group 'meta-font)
-(defvar meta-end-environment-regexp
+(defcustom meta-end-environment-regexp
(concat "\\(end\\(char\\|def\\|f\\(ig\\|or\\)\\|gr\\(aph\\|oup\\)\\)"
"\\|fi\\)")
- "*Regexp matching the end of environments to be indented.")
+ "*Regexp matching the end of environments to be indented."
+ :type 'regexp
+ :group 'meta-font)
-(defvar meta-within-environment-regexp
+(defcustom meta-within-environment-regexp
; (concat "\\(e\\(lse\\(\\|if\\)\\|xit\\(if\\|unless\\)\\)\\)")
(concat "\\(else\\(\\|if\\)\\)")
- "*Regexp matching keywords within environments not to be indented.")
+ "*Regexp matching keywords within environments not to be indented."
+ :type 'regexp
+ :group 'meta-font)
(defun meta-comment-indent ()
\f
;;; Editing commands.
-(defvar meta-begin-defun-regexp
+(defcustom meta-begin-defun-regexp
(concat "\\(begin\\(char\\|fig\\|logochar\\)\\|def\\|mode_def\\|"
"primarydef\\|secondarydef\\|tertiarydef\\|vardef\\)")
- "*Regexp matching beginning of defuns in Metafont or MetaPost mode.")
+ "*Regexp matching beginning of defuns in Metafont or MetaPost mode."
+ :type 'regexp
+ :group 'meta-font)
-(defvar meta-end-defun-regexp
+(defcustom meta-end-defun-regexp
(concat "\\(end\\(char\\|def\\|fig\\)\\)")
- "*Regexp matching the end of defuns in Metafont or MetaPost mode.")
+ "*Regexp matching the end of defuns in Metafont or MetaPost mode."
+ :type 'regexp
+ :group 'meta-font)
(defun meta-beginning-of-defun (&optional arg)
\f
;;; Hook variables.
-(defvar meta-mode-load-hook nil
- "*Hook evaluated when first loading Metafont or MetaPost mode.")
-
-(defvar meta-common-mode-hook nil
- "*Hook evaluated by both `metafont-mode' and `metapost-mode'.")
-
-(defvar metafont-mode-hook nil
- "*Hook evaluated by `metafont-mode' after `meta-common-mode-hook'.")
-(defvar metapost-mode-hook nil
- "*Hook evaluated by `metapost-mode' after `meta-common-mode-hook'.")
+(defcustom meta-mode-load-hook nil
+ "*Hook evaluated when first loading Metafont or MetaPost mode."
+ :type 'hook
+ :group 'meta-font)
+
+(defcustom meta-common-mode-hook nil
+ "*Hook evaluated by both `metafont-mode' and `metapost-mode'."
+ :type 'hook
+ :group 'meta-font)
+
+(defcustom metafont-mode-hook nil
+ "*Hook evaluated by `metafont-mode' after `meta-common-mode-hook'."
+ :type 'hook
+ :group 'meta-font)
+(defcustom metapost-mode-hook nil
+ "*Hook evaluated by `metapost-mode' after `meta-common-mode-hook'."
+ :type 'hook
+ :group 'meta-font)
\f
(require 'octave-mod)
(require 'comint)
-(defvar inferior-octave-program "octave"
- "*Program invoked by `inferior-octave'.")
+(defgroup octave-inferior nil
+ "Running Octave as an inferior Emacs process."
+ :group 'octave)
-(defvar inferior-octave-prompt
+(defcustom inferior-octave-program "octave"
+ "*Program invoked by `inferior-octave'."
+ :type 'string
+ :group 'octave-inferior)
+
+(defcustom inferior-octave-prompt
"\\(^octave\\(:[0-9]+\\)?\\|^debug\\|^\\)>+ "
- "*Regexp to match prompts for the inferior Octave process.")
+ "*Regexp to match prompts for the inferior Octave process."
+ :type 'regexp
+ :group 'octave-inferior)
-(defvar inferior-octave-startup-file nil
+(defcustom inferior-octave-startup-file nil
"*Name of the inferior Octave startup file.
The contents of this file are sent to the inferior Octave process on
-startup.")
+startup."
+ :type '(choice (const :tag "None" nil)
+ file)
+ :group 'octave-inferior)
-(defvar inferior-octave-startup-args '("-i")
+(defcustom inferior-octave-startup-args '("-i")
"*List of command line arguments for the inferior Octave process.
For example, for suppressing the startup message and using `traditional'
-mode, set this to (\"-q\" \"--traditional\").")
+mode, set this to (\"-q\" \"--traditional\")."
+ :type '(repeat string)
+ :group 'octave-inferior)
(defvar inferior-octave-mode-map nil
"Keymap used in Inferior Octave mode.")
(modify-syntax-entry ?\n ">" table)
(setq inferior-octave-mode-syntax-table table)))
-(defvar inferior-octave-mode-hook nil
- "*Hook to be run when Inferior Octave mode is started.")
+(defcustom inferior-octave-mode-hook nil
+ "*Hook to be run when Inferior Octave mode is started."
+ :type 'hook
+ :group 'octave-inferior)
(defvar inferior-octave-font-lock-keywords
(list
;;; Code:
+(defgroup octave nil
+ "Major mode for editing Octave source files."
+ :group 'languages)
+
(defvar inferior-octave-output-list nil)
(defvar inferior-octave-output-string nil)
(defvar inferior-octave-receive-in-progress nil)
'(3 font-lock-function-name-face nil t)))
"Additional Octave expressions to highlight.")
-(defvar inferior-octave-buffer "*Inferior Octave*"
- "*Name of buffer for running an inferior Octave process.")
+(defcustom inferior-octave-buffer "*Inferior Octave*"
+ "*Name of buffer for running an inferior Octave process."
+ :type 'string
+ :group 'octave-inferior)
(defvar inferior-octave-process nil)
\f
(modify-syntax-entry ?\n ">" table)
(setq octave-mode-syntax-table table)))
-(defvar octave-auto-indent nil
- "*Non-nil means indent line after a semicolon or space in Octave mode.")
+(defcustom octave-auto-indent nil
+ "*Non-nil means indent line after a semicolon or space in Octave mode."
+ :type 'boolean
+ :group 'octave)
-(defvar octave-auto-newline nil
- "*Non-nil means insert newline after a semicolon in Octave mode.")
+(defcustom octave-auto-newline nil
+ "*Non-nil means automatically newline after a semicolon in Octave mode."
+ :type 'boolean
+ :group 'octave)
-(defvar octave-blink-matching-block t
+(defcustom octave-blink-matching-block t
"*Control the blinking of matching Octave block keywords.
Non-nil means show matching begin of block when inserting a space,
-newline or semicolon after an else or end keyword.")
-(defvar octave-block-offset 2
- "*Extra indentation applied to statements in Octave block structures.")
+newline or semicolon after an else or end keyword."
+ :type 'boolean
+ :group 'octave)
+(defcustom octave-block-offset 2
+ "*Extra indentation applied to statements in Octave block structures."
+ :type 'integer
+ :group 'octave)
(defvar octave-block-begin-regexp
(concat "\\<\\("
(concat (make-string 2 octave-comment-char) " ")
"String to insert to start a new Octave comment on an empty line.")
-(defvar octave-continuation-offset 4
- "*Extra indentation applied to Octave continuation lines.")
+(defcustom octave-continuation-offset 4
+ "*Extra indentation applied to Octave continuation lines."
+ :type 'integer
+ :group 'octave)
(defvar octave-continuation-regexp
"[^#%\n]*\\(\\\\\\|\\.\\.\\.\\)\\s-*\\(\\s<.*\\)?$")
-(defvar octave-continuation-string "\\"
- "*Character string used for Octave continuation lines. Normally \\.")
+(defcustom octave-continuation-string "\\"
+ "*Character string used for Octave continuation lines. Normally \\."
+ :type 'string
+ :group 'octave)
(defvar octave-completion-alist nil
"Alist of Octave symbols for completion in Octave mode.
(list nil octave-function-header-regexp 3))
"Imenu expression for Octave mode. See `imenu-generic-expression'.")
-(defvar octave-mode-startup-message t
- "*Nil means do not display the Octave mode startup message.")
-
-(defvar octave-mode-hook nil
- "*Hook to be run when Octave mode is started.")
-
-(defvar octave-send-show-buffer t
- "*Non-nil means display `inferior-octave-buffer' after sending to it.")
-(defvar octave-send-line-auto-forward t
+(defcustom octave-mode-startup-message t
+ "*Nil means do not display the Octave mode startup message."
+ :type 'boolean
+ :group 'octave)
+
+(defcustom octave-mode-hook nil
+ "*Hook to be run when Octave mode is started."
+ :type 'hook
+ :group 'octave)
+
+(defcustom octave-send-show-buffer t
+ "*Non-nil means display `inferior-octave-buffer' after sending to it."
+ :type 'boolean
+ :group 'octave)
+(defcustom octave-send-line-auto-forward t
"*Control auto-forward after sending to the inferior Octave process.
-Non-nil means always go to the next Octave code line after sending.")
-(defvar octave-send-echo-input t
- "*Non-nil means echo input sent to the inferior Octave process.")
+Non-nil means always go to the next Octave code line after sending."
+ :type 'boolean
+ :group 'octave)
+(defcustom octave-send-echo-input t
+ "*Non-nil means echo input sent to the inferior Octave process."
+ :type 'boolean
+ :group 'octave)
\f
;;;###autoload