Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
7ada1a07
Commit
7ada1a07
authored
Feb 08, 1997
by
Richard M. Stallman
Browse files
(define-derived-mode): Add derived-mode-parent
property to the defived mode command name.
parent
db98a733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
lisp/derived.el
lisp/derived.el
+10
-9
No files found.
lisp/derived.el
View file @
7ada1a07
...
...
@@ -143,30 +143,31 @@ been generated automatically, with a reference to the keymap."
(
setq
docstring
(
or
docstring
(
derived-mode-make-docstring
parent
child
)))
(
`
(
progn
(
derived-mode-init-mode-variables
(
quote
(
,
child
)))
(
derived-mode-init-mode-variables
'
(
,
child
))
(
put
'
(
,
child
)
'derived-mode-parent
'
(
,
parent
))
(
defun
(
,
child
)
()
(
,
docstring
)
(
interactive
)
; Run the parent.
((
,
parent
))
; Identify special modes.
(
if
(
get
(
quote
(
,
parent
)
)
'special
)
(
put
(
quote
(
,
child
)
)
'special
t
))
(
if
(
get
'
(
,
parent
)
'special
)
(
put
'
(
,
child
)
'special
t
))
; Identify the child mode.
(
setq
major-mode
(
quote
(
,
child
))
)
(
setq
major-mode
'
(
,
child
))
(
setq
mode-name
(
,
name
))
; Set up maps and tables.
(
derived-mode-set-keymap
(
quote
(
,
child
))
)
(
derived-mode-set-syntax-table
(
quote
(
,
child
))
)
(
derived-mode-set-abbrev-table
(
quote
(
,
child
))
)
(
derived-mode-set-keymap
'
(
,
child
))
(
derived-mode-set-syntax-table
'
(
,
child
))
(
derived-mode-set-abbrev-table
'
(
,
child
))
; Splice in the body (if any).
(
,@
body
)
;;; ; Run the setup function, if
;;; ; any -- this will soon be
;;; ; obsolete.
;;; (derived-mode-run-setup-function
(quote
(, child))
)
;;; (derived-mode-run-setup-function
'
(, child))
; Run the hooks, if any.
(
derived-mode-run-hooks
(
quote
(
,
child
))))))
)
(
derived-mode-run-hooks
'
(
,
child
))))))
;; PUBLIC: find the ultimate class of a derived mode.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment