summaryrefslogtreecommitdiff
path: root/lisp/info.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-09-16 23:31:10 +0000
committerKarl Heuer <kwzh@gnu.org>1994-09-16 23:31:10 +0000
commite9dffce21333ac191ab230c87ce4bc8a4353f6b9 (patch)
treeb4d0eb2671c326c00338ce3813a3ad9e4d344bb9 /lisp/info.el
parent553909b2227186919cc676cbc09dea696902f547 (diff)
downloademacs-e9dffce21333ac191ab230c87ce4bc8a4353f6b9.tar.gz
(Info-edit): Move the customary mode-initialization calls out of here.
(Info-edit-mode): Put them here. Also enable undo, and call Info-edit-mode-hook.
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 59416d79329..b07c8930c81 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1520,14 +1520,6 @@ Advanced commands:
Like text mode with the addition of `Info-cease-edit'
which returns to Info mode for browsing.
\\{Info-edit-map}"
- )
-
-(defun Info-edit ()
- "Edit the contents of this Info node.
-Allowed only if variable `Info-enable-edit' is non-nil."
- (interactive)
- (or Info-enable-edit
- (error "Editing info nodes is not enabled"))
(use-local-map Info-edit-map)
(setq major-mode 'Info-edit-mode)
(setq mode-name "Info Edit")
@@ -1535,8 +1527,18 @@ Allowed only if variable `Info-enable-edit' is non-nil."
(setq buffer-read-only nil)
;; Make mode line update.
(set-buffer-modified-p (buffer-modified-p))
+ (buffer-enable-undo (current-buffer))
+ (run-hooks 'Info-edit-mode-hook))
+
+(defun Info-edit ()
+ "Edit the contents of this Info node.
+Allowed only if variable `Info-enable-edit' is non-nil."
+ (interactive)
+ (or Info-enable-edit
+ (error "Editing info nodes is not enabled"))
+ (Info-edit-mode)
(message (substitute-command-keys
- "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info")))
+ "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info")))
(defun Info-cease-edit ()
"Finish editing Info node; switch back to Info proper."