comparison lisp/novice.el @ 5451:165b0bf0e879

(enable-command, disable-command): Use user-init-file.
author Richard M. Stallman <rms@gnu.org>
date Thu, 06 Jan 1994 04:29:23 +0000
parents 78098404b263
children 84cdd74ddbb0
comparison
equal deleted inserted replaced
5450:9c57cdb2091e 5451:165b0bf0e879
88 The user's .emacs file is altered so that this will apply 88 The user's .emacs file is altered so that this will apply
89 to future sessions." 89 to future sessions."
90 (interactive "CEnable command: ") 90 (interactive "CEnable command: ")
91 (put command 'disabled nil) 91 (put command 'disabled nil)
92 (save-excursion 92 (save-excursion
93 (set-buffer (find-file-noselect (substitute-in-file-name "~/.emacs"))) 93 (set-buffer (find-file-noselect
94 (substitute-in-file-name user-init-file)))
94 (goto-char (point-min)) 95 (goto-char (point-min))
95 (if (search-forward (concat "(put '" (symbol-name command) " ") nil t) 96 (if (search-forward (concat "(put '" (symbol-name command) " ") nil t)
96 (delete-region 97 (delete-region
97 (progn (beginning-of-line) (point)) 98 (progn (beginning-of-line) (point))
98 (progn (forward-line 1) (point))) 99 (progn (forward-line 1) (point)))
107 The user's .emacs file is altered so that this will apply 108 The user's .emacs file is altered so that this will apply
108 to future sessions." 109 to future sessions."
109 (interactive "CDisable command: ") 110 (interactive "CDisable command: ")
110 (put command 'disabled t) 111 (put command 'disabled t)
111 (save-excursion 112 (save-excursion
112 (set-buffer (find-file-noselect (substitute-in-file-name "~/.emacs"))) 113 (set-buffer (find-file-noselect
114 (substitute-in-file-name user-init-file)))
113 (goto-char (point-min)) 115 (goto-char (point-min))
114 (if (search-forward (concat "(put '" (symbol-name command) " ") nil t) 116 (if (search-forward (concat "(put '" (symbol-name command) " ") nil t)
115 (delete-region 117 (delete-region
116 (progn (beginning-of-line) (point)) 118 (progn (beginning-of-line) (point))
117 (progn (forward-line 1) (point)))) 119 (progn (forward-line 1) (point))))