Server IP : 111.118.215.189 / Your IP : 3.147.48.161 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/emacs/24.3/lisp/emacs-lisp/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:09:00 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/emacs-lisp/derived.el ;;; in Emacs version 24.3.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #@50 Construct a mode-hook name based on a MODE name. (defalias 'derived-mode-hook-name #[(mode) "\301\302!\303P!\207" [mode intern symbol-name "-hook"] 3 (#$ . 561)]) (put 'derived-mode-hook-name 'byte-optimizer 'byte-compile-inline-expand) #@44 Construct a map name based on a MODE name. (defalias 'derived-mode-map-name #[(mode) "\301\302!\303P!\207" [mode intern symbol-name "-map"] 3 (#$ . 805)]) (put 'derived-mode-map-name 'byte-optimizer 'byte-compile-inline-expand) #@53 Construct a syntax-table name based on a MODE name. (defalias 'derived-mode-syntax-table-name #[(mode) "\301\302!\303P!\207" [mode intern symbol-name "-syntax-table"] 3 (#$ . 1040)]) (put 'derived-mode-syntax-table-name 'byte-optimizer 'byte-compile-inline-expand) #@54 Construct an abbrev-table name based on a MODE name. (defalias 'derived-mode-abbrev-table-name #[(mode) "\301\302!\303P!\207" [mode intern symbol-name "-abbrev-table"] 3 (#$ . 1312)]) (put 'derived-mode-abbrev-table-name 'byte-optimizer 'byte-compile-inline-expand) #@1994 Create a new mode as a variant of an existing mode. The arguments to this command are as follow: CHILD: the name of the command for the derived mode. PARENT: the name of the command for the parent mode (e.g. `text-mode') or nil if there is no parent. NAME: a string which will appear in the status line (e.g. "Hypertext") DOCSTRING: an optional documentation string--if you do not supply one, the function will attempt to invent something useful. BODY: forms to execute just before running the hooks for the new mode. Do not use `interactive' here. BODY can start with a bunch of keyword arguments. The following keyword arguments are currently understood: :group GROUP Declare the customization group that corresponds to this mode. The command `customize-mode' uses this. :syntax-table TABLE Use TABLE instead of the default (CHILD-syntax-table). A nil value means to simply use the same syntax-table as the parent. :abbrev-table TABLE Use TABLE instead of the default (CHILD-abbrev-table). A nil value means to simply use the same abbrev-table as the parent. Here is how you could define LaTeX-Thesis mode as a variant of LaTeX mode: (define-derived-mode LaTeX-thesis-mode LaTeX-mode "LaTeX-Thesis") You could then make new key bindings for `LaTeX-thesis-mode-map' without changing regular LaTeX mode. In this example, BODY is empty, and DOCSTRING is generated by default. On a more complicated level, the following command uses `sgml-mode' as the parent, and then sets the variable `case-fold-search' to nil: (define-derived-mode article-mode sgml-mode "Article" "Major mode for editing technical articles." (setq case-fold-search nil)) Note that if the documentation string had been left out, it would have been generated automatically, with a reference to the keymap. The new mode runs the hook constructed by the function `derived-mode-hook-name'. See Info node `(elisp)Derived Modes' for more details. (defalias 'define-derived-mode '(macro . #[(child parent name &optional docstring &rest body) "\203 ;\204 B\306\n\307=\203 \306\310\311\f!\312P!)\310\311\f!\313P!)\310\311\f!\314P!)\315\211\310\311\f!\316P!)\306@ABCDE\317 @!\203\236 \211A@\211F\320=\203l \211A@\202\232 F\321=\203\200 \211A@C\306B\202\232 F\322=\203\224 \211A@D\306A\202\232 \211A@\210)\202O \323\nDC%\324\325\326\327@D\330BB\331\327@D\332\333\334\335G\"DFE\325\336\327EDD\331\327ED\337\327DFE\340\341E\342BBD\325\326\327ED\343BB\331\327ED\344\333\334\345\"DFEA\205(\324\325\336\327DDD\331\327DD\346\327DFE\341D\347BB\325\326\327DD\350BB\331\327DD\351\333\334\352\"DFEFB\205`\324\331\327CD\353\327DF\341C\324\354\327CD\355BBCEE\325\326\327CD\356BB\331\327CD\357\333\334\360\"DFEF\331\327D\361\327\nDF \205t\331\327D\362 F\363\306\364\365\n\206\366C\367\370\327DE\367\371GE\n\205 \324\372\326\327\nD\373BB\331\327D\374\326\327\nD\375BBFE\325\376ED\377E\201H BBEA\205\325\201I \302\201J DDDC\325\201K \201L D\201M BBEEB\205\376\325\201N \201O C\201P BB\201Q C\201R BBE\201S C\201T BBE\257\201U EDD\205\201V DDC\205\367\201W CE BBBBBBBB\201X \327@DD\257\257\n.\207" [docstring body parent child mode group nil fundamental-mode intern symbol-name "-map" "-syntax-table" "-abbrev-table" t "-hook" keywordp :group :abbrev-table :syntax-table derived-mode-make-docstring progn unless get quote ('variable-documentation) put 'variable-documentation purecopy format "Hook run when entering %s mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp 'definition-name with-no-warnings defvar ((make-sparse-keymap)) ('variable-documentation) 'variable-documentation "Keymap for `%s'." 'definition-name ((make-syntax-table)) ('variable-documentation) 'variable-documentation "Syntax table for `%s'." 'definition-name define-abbrev-table (nil) ('variable-documentation) 'variable-documentation "Abbrev table for `%s'." 'derived-mode-parent 'custom-mode-group defun (interactive) delay-mode-hooks kill-all-local-variables setq major-mode mode-name if ('mode-class) 'mode-class ('mode-class) keymap-parent set-keymap-parent hook declare-syntax declare-abbrev abbrev syntax map #1=#:val name ((current-local-map)) let char-table-parent (and parent (not (eq parent (standard-syntax-table)))) set-char-table-parent ((syntax-table)) or abbrev-table-get (:parents) eq (local-abbrev-table) abbrev-table-put (:parents (list local-abbrev-table)) use-local-map set-syntax-table local-abbrev-table run-mode-hooks] 29 (#$ . 1587)])) (byte-code "\300\301\302\303#\210\300\301\304\305#\207" [put define-derived-mode edebug-form-spec (&define name symbolp sexp [&optional stringp] [&rest keywordp sexp] def-body) doc-string-elt 4] 4) #@266 Find the class of a major MODE. A mode's class is the first ancestor which is NOT a derived mode. Use the `derived-mode-parent' property of the symbol to trace backwards. Since major-modes might all derive from `fundamental-mode', this function is not very useful. (defalias 'derived-mode-class #[(mode) "\301N\203 \301N\211\202 \207" [mode derived-mode-parent] 3 (#$ . 6455)]) (make-obsolete 'derived-mode-class 'derived-mode-p "22.1") #@59 Construct a docstring for a new mode if none is provided. (defalias 'derived-mode-make-docstring #[(parent child &optional docstring syntax abbrev) "\306\307 !\310P!)\306\307 !\311P!)\f;\2046 \204* \312\313$\2025 \312\314 &\315\316\307\n!!\f\"\204e \f \204J \317\202^ \320\315\316\312\321 \"!\f\"?\205\\ \312\322 \"\323Q\312\324\n\"\325R\315\326\f\"\204t \f\327\307!\330R\f*\207" [child mode hook map docstring parent intern symbol-name "-map" "-hook" format "Major-mode.\nUses keymap `%s', abbrev table `%s' and syntax-table `%s'." "Major mode derived from `%s' by `define-derived-mode'.\nIt inherits all of the parent's attributes, but has its own keymap,\nabbrev table and syntax table:\n\n `%s', `%s' and `%s'\n\nwhich more-or-less shadow %s's corresponding tables." string-match regexp-quote "\n\nThis mode " "\n\nIn addition to any hooks its parent mode " "`%s'" "`%s' " "might have run,\nthis mode " "runs the hook `%s'" ", as the final step\nduring initialization." "\\\\[{[]" "\n\n\\{" "}" abbrev syntax] 7 (#$ . 6904)]) #@55 Construct a setup-function name based on a MODE name. (defalias 'derived-mode-setup-function-name #[(mode) "\301\302!\303P!\207" [mode intern symbol-name "-setup"] 3 (#$ . 7964)]) (put 'derived-mode-setup-function-name 'byte-optimizer 'byte-compile-inline-expand) #@207 Initialize variables for a new MODE. Right now, if they don't already exist, set up a blank keymap, an empty syntax table, and an empty abbrev table -- these will be merged the first time the mode is used. (defalias 'derived-mode-init-mode-variables #[(mode) "\301\302\303!\304P!)!\2042 \305\306\302\303!\304P!)\307\310\311\"F!\210\312\302\303!\304P!)\313\314#\210\301\302\303!\315P!)!\204d \305\306\302\303!\315P!)\316\310\317\"F!\210\312\302\303!\315P!)\313\314#\210\301\302\303!\320P!)!\203u \314\207\305\306\302\303!\320P!)\321\310\322\"F!\207" [mode boundp intern symbol-name "-map" eval defvar (make-sparse-keymap) format "Keymap for %s." put derived-mode-unmerged t "-syntax-table" (make-char-table 'syntax-table nil) "Syntax table for %s." "-abbrev-table" (progn (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) (make-abbrev-table)) "Abbrev table for %s."] 7 (#$ . 8236)]) #@64 Set the keymap of the new MODE, maybe merging with the parent. (defalias 'derived-mode-set-keymap #[(mode) "\304\305!\306P!)\307 !\310 \211\203! \311N\203! \312\n\"\210\313 \311\314#\210\315\n!+\207" [mode map-name new-map old-map intern symbol-name "-map" eval current-local-map derived-mode-unmerged derived-mode-merge-keymaps put nil use-local-map] 5 (#$ . 9165)]) #@70 Set the syntax table of the new MODE, maybe merging with the parent. (defalias 'derived-mode-set-syntax-table #[(mode) "\304\305!\306P!)\307 \310 ! \311N\203 \312\n\"\210\313 \311\314#\210\315!+\207" [mode table-name old-table new-table intern symbol-name "-syntax-table" syntax-table eval derived-mode-unmerged derived-mode-merge-syntax-tables put nil set-syntax-table] 4 (#$ . 9547)]) #@114 Set the abbrev table for MODE if it exists. Always merge its parent into it, since the merge is non-destructive. (defalias 'derived-mode-set-abbrev-table #[(mode) "\305\306!\307P!)\n\310 !\311\f\"\210\f\211+\207" [mode table-name local-abbrev-table old-table new-table intern symbol-name "-abbrev-table" eval derived-mode-merge-abbrev-tables] 3 (#$ . 9950)]) #@29 Run the mode hook for MODE. (defalias 'derived-mode-run-hooks #[(mode) "\302\303!\304P!)\305 !\205 \306 !)\207" [mode hooks-name intern symbol-name "-hook" boundp run-hooks] 3 (#$ . 10323)]) #@139 Merge an OLD keymap into a NEW one. The old keymap is set to be the last cdr of the new one, so that there will be automatic inheritance. (defalias 'derived-mode-merge-keymaps #[(old new) "\211:\203t @:\203/ \306 @@!\307\n\"\307\f\n\"\310!\203. \310 !\203. \311 \"\210+\312 @!\203m @GS\211\f\313Y\203l \306\f!\307\n\"\307\f\n\"\310!\203b \310 !\203b \311 \"\210+\fS\211\f\202= ) A\211\202 )GS\233\f\241\207" [new tail key subnew old subold vector lookup-key keymapp derived-mode-merge-keymaps vectorp 0 i] 4 (#$ . 10526)]) #@121 Merge an OLD syntax table into a NEW one. Where the new table already has an entry, nothing is copied from the old one. (defalias 'derived-mode-merge-syntax-tables #[(old new) "\302 \"\207" [new old set-char-table-parent] 3 (#$ . 11080)]) (defalias 'derived-mode-merge-abbrev-tables #[(old new) "\205 \301\302\"\207" [old mapatoms #[(symbol) "\302\303! \"\206 \304 \303!JK$\207" [symbol new intern-soft symbol-name define-abbrev] 5]] 3]) (provide 'derived)