aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-05-17 13:55:43 +0200
committerLars Ingebrigtsen2019-05-17 13:55:43 +0200
commitdeb88392c61d9cdf99f2fbe432c16d995541e2c0 (patch)
treedfb1236f75252b71e65f97b03041e2bf502e5444
parent81ce8d9d11fa89fd4a636af5ef63eadf8f605e58 (diff)
downloademacs-deb88392c61d9cdf99f2fbe432c16d995541e2c0.tar.gz
emacs-deb88392c61d9cdf99f2fbe432c16d995541e2c0.zip
Move Info-edit-* commands from info.el to obsolete/info-edit.el
* lisp/info.el: Move Info-edit-* commands to obsolete/info-edit.el. * lisp/obsolete/info-edit.el: New file.
-rw-r--r--lisp/info.el59
-rw-r--r--lisp/obsolete/info-edit.el83
2 files changed, 83 insertions, 59 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 2882262aadf..c211887a39a 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -380,12 +380,6 @@ with wrapping around the current Info node."
380 :type 'hook 380 :type 'hook
381 :group 'info) 381 :group 'info)
382 382
383(defvar Info-edit-mode-hook nil
384 "Hook run when `Info-edit-mode' is activated.")
385
386(make-obsolete-variable 'Info-edit-mode-hook
387 "editing Info nodes by hand is not recommended." "24.4")
388
389(defvar-local Info-current-file nil 383(defvar-local Info-current-file nil
390 "Info file that Info is now looking at, or nil. 384 "Info file that Info is now looking at, or nil.
391This is the name that was specified in Info, not the actual file name. 385This is the name that was specified in Info, not the actual file name.
@@ -4384,59 +4378,6 @@ Advanced commands:
4384 (copy-marker (marker-position m))) 4378 (copy-marker (marker-position m)))
4385 (make-marker)))))) 4379 (make-marker))))))
4386 4380
4387(define-obsolete-variable-alias 'Info-edit-map 'Info-edit-mode-map "24.1")
4388(defvar Info-edit-mode-map (let ((map (make-sparse-keymap)))
4389 (set-keymap-parent map text-mode-map)
4390 (define-key map "\C-c\C-c" 'Info-cease-edit)
4391 map)
4392 "Local keymap used within `e' command of Info.")
4393
4394(make-obsolete-variable 'Info-edit-mode-map
4395 "editing Info nodes by hand is not recommended."
4396 "24.4")
4397
4398;; Info-edit mode is suitable only for specially formatted data.
4399(put 'Info-edit-mode 'mode-class 'special)
4400
4401(define-derived-mode Info-edit-mode text-mode "Info Edit"
4402 "Major mode for editing the contents of an Info node.
4403Like text mode with the addition of `Info-cease-edit'
4404which returns to Info mode for browsing."
4405 (setq buffer-read-only nil)
4406 (force-mode-line-update)
4407 (buffer-enable-undo (current-buffer)))
4408
4409(make-obsolete 'Info-edit-mode
4410 "editing Info nodes by hand is not recommended." "24.4")
4411
4412(defun Info-edit ()
4413 "Edit the contents of this Info node."
4414 (interactive)
4415 (Info-edit-mode)
4416 (message "%s" (substitute-command-keys
4417 "Editing: Type \\<Info-edit-mode-map>\\[Info-cease-edit] to return to info")))
4418
4419(put 'Info-edit 'disabled "Editing Info nodes by hand is not recommended.
4420This feature will be removed in future.")
4421
4422(make-obsolete 'Info-edit
4423 "editing Info nodes by hand is not recommended." "24.4")
4424
4425(defun Info-cease-edit ()
4426 "Finish editing Info node; switch back to Info proper."
4427 (interactive)
4428 ;; Do this first, so nothing has changed if user C-g's at query.
4429 (and (buffer-modified-p)
4430 (y-or-n-p "Save the file? ")
4431 (save-buffer))
4432 (Info-mode)
4433 (force-mode-line-update)
4434 (and (marker-position Info-tag-table-marker)
4435 (buffer-modified-p)
4436 (message "Tags may have changed. Use Info-tagify if necessary")))
4437
4438(make-obsolete 'Info-cease-edit
4439 "editing Info nodes by hand is not recommended." "24.4")
4440 4381
4441(defvar Info-file-list-for-emacs 4382(defvar Info-file-list-for-emacs
4442 '("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e") 4383 '("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e")
diff --git a/lisp/obsolete/info-edit.el b/lisp/obsolete/info-edit.el
new file mode 100644
index 00000000000..b64e84003fc
--- /dev/null
+++ b/lisp/obsolete/info-edit.el
@@ -0,0 +1,83 @@
1;; info-edit.el --- Editing info files -*- lexical-binding:t -*-
2
3;; Copyright (C) 1985-1986, 1992-2019 Free Software Foundation, Inc.
4
5;; Maintainer: emacs-devel@gnu.org
6;; Keywords: help
7;; Obsolete-since: 24.4
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software: you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
23
24;;; Commentary:
25
26;;; Code:
27
28(require 'info)
29
30(defvar Info-edit-mode-hook nil
31 "Hook run when `Info-edit-mode' is activated.")
32
33(make-obsolete-variable 'Info-edit-mode-hook
34 "editing Info nodes by hand is not recommended." "24.4")
35
36(define-obsolete-variable-alias 'Info-edit-map 'Info-edit-mode-map "24.1")
37(defvar Info-edit-mode-map (let ((map (make-sparse-keymap)))
38 (set-keymap-parent map text-mode-map)
39 (define-key map "\C-c\C-c" 'Info-cease-edit)
40 map)
41 "Local keymap used within `e' command of Info.")
42
43(make-obsolete-variable 'Info-edit-mode-map
44 "editing Info nodes by hand is not recommended."
45 "24.4")
46
47;; Info-edit mode is suitable only for specially formatted data.
48(put 'Info-edit-mode 'mode-class 'special)
49
50(define-derived-mode Info-edit-mode text-mode "Info Edit"
51 "Major mode for editing the contents of an Info node.
52Like text mode with the addition of `Info-cease-edit'
53which returns to Info mode for browsing."
54 (setq buffer-read-only nil)
55 (force-mode-line-update)
56 (buffer-enable-undo (current-buffer)))
57
58(defun Info-edit ()
59 "Edit the contents of this Info node."
60 (interactive)
61 (Info-edit-mode)
62 (message "%s" (substitute-command-keys
63 "Editing: Type \\<Info-edit-mode-map>\\[Info-cease-edit] to return to info")))
64
65(put 'Info-edit 'disabled "Editing Info nodes by hand is not recommended.
66This feature will be removed in future.")
67
68(defun Info-cease-edit ()
69 "Finish editing Info node; switch back to Info proper."
70 (interactive)
71 ;; Do this first, so nothing has changed if user C-g's at query.
72 (and (buffer-modified-p)
73 (y-or-n-p "Save the file? ")
74 (save-buffer))
75 (Info-mode)
76 (force-mode-line-update)
77 (and (marker-position Info-tag-table-marker)
78 (buffer-modified-p)
79 (message "Tags may have changed. Use Info-tagify if necessary")))
80
81(provide 'info-edit)
82
83;;; info-edit.el ends here