📄 erlang.el
字号:
and should return one of the following values: nil -- no determination made, continue checking 'stop -- do not create prototype for next line (anything else) -- insert prototype, and stop checkingIf every function in the list is called with no determination made,then no prototype is inserted.The test is performed by the function `erlang-test-criteria-list'.")(defvar erlang-electric-arrow-criteria '(erlang-next-lines-empty-p erlang-at-end-of-function-p) "*List of functions controlling the arrow aspect of `erlang-electric-gt'.The functions in this list are called, in order, whenever a `>'is typed. Each function in the list is called with no arguments,and should return one of the following values: nil -- no determination made, continue checking 'stop -- do not create prototype for next line (anything else) -- insert prototype, and stop checkingIf every function in the list is called with no determination made,then no prototype is inserted.The test is performed by the function `erlang-test-criteria-list'.")(defvar erlang-electric-newline-criteria '(t) "*List of functions controlling `erlang-electric-newline'.The electric newline commands indents the next line. Should thecurrent line begin with a comment the comment start is copied tothe newly created line.The functions in this list are called, in order, whenever a commais typed. Each function in the list is called with no arguments,and should return one of the following values: nil -- no determination made, continue checking 'stop -- do not create prototype for next line (anything else) -- trigger the electric command.If every function in the list is called with no determination made,then no prototype is inserted. Should the atom t be a member of thelist, it is treated as a function triggering the electric command.The test is performed by the function `erlang-test-criteria-list'.")(defvar erlang-next-lines-empty-threshold 2 "*Number of blank lines required to activate an electric command.Actually, this value controls the behaviour of the function`erlang-next-lines-empty-p' which normally is a member of thecriteria lists controlling the electric commands. (Please seethe variables `erlang-electric-semicolon-criteria' and`erlang-electric-comma-criteria'.)The variable is bound to a threshold value, a number, representing thenumber of lines which must be empty.Setting this variable to zero, electric commands will always betriggered by `erlang-next-lines-empty-p', unless inhibited by otherrules.Should this variable be nil, `erlang-next-lines-empty-p' will nevertrigger an electric command. The same effect would be reached if thefunction `erlang-next-lines-empty-p' would be removed from the criterialists.Note that even if `erlang-next-lines-empty-p' should not trigger anelectric command, other functions in the criteria list could.")(defvar erlang-new-clause-with-arguments nil "*Non-nil means that the arguments are cloned when a clause is generated.A new function header can be generated by calls to the function`erlang-generate-new-clause' and by use of the electric semicolon.")(defvar erlang-compile-use-outdir t "*When nil, go to the directory containing source file when compiling.This is a workaround for a bug in the `outdir' option of compile. If theoutdir is not in the current load path, Erlang doesn't load the objectmodule after it has been compiled.To activate the workaround, place the following in your `~/.emacs' file: (setq erlang-compile-use-outdir nil)")(defvar erlang-indent-level 4 "*Indentation of Erlang calls/clauses within blocks.")(defvar erlang-indent-guard 2 "*Indentation of Erlang guards.")(defvar erlang-argument-indent 2 "*Indentation of the first argument in a function call.When nil, indent to the column after the `(' of thefunction.")(defvar erlang-tab-always-indent t "*Non-nil means TAB in Erlang mode should always re-indent the current line,regardless of where in the line point is when the TAB command is used.")(defvar erlang-error-regexp-alist '(("^\\([^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)[:) \t]" . (1 2))) "*Patterns for matching Erlang errors.")(defvar erlang-man-inhibit (eq system-type 'windows-nt) "Inhibit the creation of the Erlang Manual Pages menu.The Windows distribution of Erlang does not include man pages, hencethere is no attempt to create the menu.")(defvar erlang-man-dirs '(("Man - Commands" "/man/man1" t) ("Man - Modules" "/man/man3" t) ("Man - Files" "/man/man4" t) ("Man - Applications" "/man/man6" t)) "*The man directories displayed in the Erlang menu.Each item in the list should be a list with three elements, the firstthe name of the menu, the second the directory, and the last a flag.Should the flag the nil, the directory is absolute, should it be non-nilthe directory is relative to the variable `erlang-root-dir'.")(defvar erlang-man-max-menu-size 20 "*The maximum number of menu items in one menu allowed.")(defvar erlang-man-display-function 'erlang-man-display "*Function used to display man page.The function is called with one argument, the name of the filecontaining the man page. Use this variable when the defaultfunction, `erlang-man-display', does not work on your system.")(eval-and-compile(defconst erlang-atom-regexp "\\([a-z][a-zA-Z0-9_]*\\|'[^\n']*[^\\]'\\)" "Regexp which should match an Erlang atom.The regexp must be surrounded with a pair of regexp parentheses."))(defconst erlang-atom-regexp-matches 1 "Number of regexp parenthesis pairs in `erlang-atom-regexp'.This is used to determine parenthesis matches in complex regexps whichcontains `erlang-atom-regexp'.")(defconst erlang-variable-regexp "\\([A-Z_][a-zA-Z0-9_]*\\)" "Regexp which should match an Erlang variable.The regexp must be surrounded with a pair of regexp parentheses.")(defconst erlang-variable-regexp-matches 1 "Number of regexp parenthesis pairs in `erlang-variable-regexp'.This is used to determine matches in complex regexps which contains`erlang-variable-regexp'.")(defvar erlang-defun-prompt-regexp (concat "^" erlang-atom-regexp "\\s *(") "Regexp which should match beginning of a clause.")(defvar erlang-file-name-extension-regexp "\\.[eh]rl$" "*Regexp which should match an Erlang file name.This regexp is used when an Erlang module name is extracted from thename of an Erlang source file.The regexp should only match the section of the file name which shouldbe excluded from the module name.To match all files set this variable to \"\\\\(\\\\..*\\\\|\\\\)$\".The matches all except the extension. This is useful if the Erlangtags system should interpret tags on the form `module:tag' forfiles written in other languages than Erlang.")(defvar erlang-mode-map nil "*Keymap used in Erlang mode.")(defvar erlang-mode-abbrev-table nil "Abbrev table in use in Erlang-mode buffers.")(defvar erlang-mode-syntax-table nil "Syntax table in use in Erlang-mode buffers.")(defconst erlang-emacs-major-version (if (boundp 'emacs-major-version) emacs-major-version (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)" emacs-version) (string-to-int (substring emacs-version (match-beginning 1) (match-end 1)))) "Major version number of Emacs.")(defconst erlang-emacs-minor-version (if (boundp 'emacs-minor-version) emacs-minor-version (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)" emacs-version) (string-to-int (substring emacs-version (match-beginning 2) (match-end 2)))) "Minor version number of Emacs.")(defconst erlang-xemacs-p (string-match "Lucid\\|XEmacs" emacs-version) "Non-nil when running under XEmacs or Lucid Emacs.")(defvar erlang-xemacs-popup-menu '("Erlang Mode Commands" . nil) "Common popup menu for all buffers in Erlang mode.This variable is destructively modified every time the Erlang menuis modified. The effect is that all changes take effect in allbuffers in Erlang mode, just like under GNU Emacs.Never EVER set this variable!")(defconst inferior-erlang-use-cmm (boundp 'minor-mode-overriding-map-alist) "Non-nil means use `compilation-minor-mode' in Erlang shell.");; Tempo skeleton templates:(defvar erlang-skel '(("If" "if" erlang-skel-if) ("Case" "case" erlang-skel-case) ("Receive" "receive" erlang-skel-receive) ("Receive After" "after" erlang-skel-receive-after) ("Receive Loop" "loop" erlang-skel-receive-loop) ("Module" "module" erlang-skel-module) ("Author" "author" erlang-skel-author) () ("Small Header" "small-header" erlang-skel-small-header erlang-skel-header) ("Normal Header" "normal-header" erlang-skel-normal-header erlang-skel-header) ("Large Header" "large-header" erlang-skel-large-header erlang-skel-header) () ("Small Server" "small-server" erlang-skel-small-server erlang-skel-header) () ("Application" "application" erlang-skel-application erlang-skel-header) ("Supervisor" "supervisor" erlang-skel-supervisor erlang-skel-header) ("supervisor_bridge" "supervisor-bridge" erlang-skel-supervisor-bridge erlang-skel-header) ("gen_server" "generic-server" erlang-skel-generic-server erlang-skel-header) ("gen_event" "gen-event" erlang-skel-gen-event erlang-skel-header) ("gen_fsm" "gen-fsm" erlang-skel-gen-fsm erlang-skel-header) ("Library module" "gen-lib" erlang-skel-lib erlang-skel-header) ("Corba callback" "gen-corba-cb" erlang-skel-corba-callback erlang-skel-header) ("Erlang test suite TS frontend" "ts-test-suite" erlang-skel-ts-test-suite erlang-skel-header) ("Erlang test suite CT frontend" "ct-test-suite" erlang-skel-ct-test-suite erlang-skel-header) ) "*Description of all skeleton templates.Both functions and menu entries will be created.Each entry in `erlang-skel' should be a list with three or fourelements, or the empty list.The first element is the name which shows up in the menu. The secondis the `tempo' identifier (The string \"erlang-\" will be added infront of it). The third is the skeleton descriptor, a variablecontaining `tempo' attributes as described in the function`tempo-define-template'. The optional fourth elements denotes afunction which should be called when the menu is selected.Functions corresponding to every template will be created. The nameof the function will be `tempo-template-erlang-X' where `X' is thetempo identifier as specified in the second argument of the elementsin this list.A list with zero elements means that the a horizontal line shouldbe placed in the menu.");; In XEmacs `user-mail-address' returns "x@y.z (Foo Bar)" ARGH!;; What's wrong with that? RFC 822 says it's legal. [sverkerw];; This needs to use the customized value. If that's not sane, things like;; add-log will lose anyhow. Avoid it if there _is_ a paren.(defvar erlang-skel-mail-address (if (or (not user-mail-address) (string-match "(" user-mail-address)) (concat (user-login-name) "@" (or (and (boundp 'mail-host-address) mail-host-address) (system-name))) user-mail-address) "Mail address of the user.");; Expression templates:(defvar erlang-skel-case '((erlang-skel-skip-blank) o > "case " p " of" n> p "_ ->" n> p "ok" n> "end" p) "*The skeleton of a `case' expression.Please see the function `tempo-define-template'.")(defvar erlang-skel-if '((erlang-skel-skip-blank) o > "if" n> p " ->" n> p "ok" n> "end" p) "The skeleton of an `if' expression.Please see the function `tempo-define-template'.")(defvar erlang-skel-receive '((erlang-skel-skip-blank) o > "receive" n> p "_ ->" n> p "ok" n> "end" p) "*The skeleton of a `receive' expression.Please see the function `tempo-define-template'.")(defvar erlang-skel-receive-after '((erlang-skel-skip-blank) o > "receive" n> p "_ ->" n> p "ok" n> "after " p "T ->" n> p "ok" n> "end" p) "*The skeleton of a `receive' expression with an `after' clause.Please see the function `tempo-define-template'.")(defvar erlang-skel-receive-loop '(& o "loop(" p ") ->" n> "receive" n> p "_ ->" n> "loop(" p ")" n> "end.") "*The skeleton of a simple `receive' loop.Please see the function `tempo-define-template'.");; Attribute templates(defvar erlang-skel-module '(& "-module(" (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) ")." n) "*The skeleton of a `module' attribute.Please see the function `tempo-define-template'.")(defvar erlang-skel-author '(& "-author('" erlang-skel-mail-address "')." n) "*The skeleton of a `author' attribute.Please see the function `tempo-define-template'.")(defvar erlang-skel-vc nil "*The skeleton template to generate a version control attribute.The default is to insert nothing. Example of usage: (setq erlang-skel-vc '(& \"-rcs(\\\"$\Id: $ \\\").\") n)Please see the function `tempo-define-template'.")(defvar erlang-skel-export '(& "-export([" n> "])." n) "*The skeleton of an `export' attribute.Please see the function `tempo-define-template'.")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -