aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2003-05-25 00:36:59 +0000
committerStefan Monnier2003-05-25 00:36:59 +0000
commitaeeace45c821a6f6912e578c5f09dab7da7e20f1 (patch)
tree702b60be4094b6c96d284477168d69e8c4098392
parent6f8968c8c393b2b8b6b6a92c3c7676ebacb37570 (diff)
downloademacs-aeeace45c821a6f6912e578c5f09dab7da7e20f1.tar.gz
emacs-aeeace45c821a6f6912e578c5f09dab7da7e20f1.zip
(skeleton-abbrev-cleanup, skeleton-proxy): Remove obsolete code.
-rw-r--r--lisp/skeleton.el59
1 files changed, 0 insertions, 59 deletions
diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index 6ba478f708e..12ca2fb3247 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -98,10 +98,6 @@ skeleton elements.")
98 "*Replacement for %s in prompts of recursive subskeletons.") 98 "*Replacement for %s in prompts of recursive subskeletons.")
99 99
100 100
101(defvar skeleton-abbrev-cleanup nil
102 "Variable used to delete the character that led to abbrev expansion.")
103
104
105(defvar skeleton-debug nil 101(defvar skeleton-debug nil
106 "*If non-nil `define-skeleton' will override previous definition.") 102 "*If non-nil `define-skeleton' will override previous definition.")
107 103
@@ -170,61 +166,6 @@ of `str' whereas the skeleton's interactor is then ignored."
170 ;; Otherwise the no-self-insert is ignored. 166 ;; Otherwise the no-self-insert is ignored.
171 t) 167 t)
172 168
173;; This command isn't meant to be called, only its aliases with meaningful
174;; names are.
175;;;###autoload
176(defun skeleton-proxy (&optional str arg)
177 "Insert skeleton defined by variable of same name (see `skeleton-insert').
178Prefix ARG allows wrapping around words or regions (see `skeleton-insert').
179If no ARG was given, but the region is visible, ARG defaults to -1 depending
180on `skeleton-autowrap'. An ARG of M-0 will prevent this just for once.
181This command can also be an abbrev expansion (3rd and 4th columns in
182\\[edit-abbrevs] buffer: \"\" command-name).
183
184When called as a function, optional first argument STR may also be a string
185which will be the value of `str' whereas the skeleton's interactor is then
186ignored."
187 (interactive "*P\nP")
188 (let ((function (nth 1 (backtrace-frame 1))))
189 (if (eq function 'nth) ; uncompiled Lisp function
190 (setq function (nth 1 (backtrace-frame 5)))
191 (if (eq function 'byte-code) ; tracing byte-compiled function
192 (setq function (nth 1 (backtrace-frame 2)))))
193 (if (not (setq function (funcall skeleton-filter (symbol-value function))))
194 (if (memq this-command '(self-insert-command
195 skeleton-pair-insert-maybe
196 expand-abbrev))
197 (setq buffer-undo-list (primitive-undo 1 buffer-undo-list)))
198 (skeleton-insert function
199 (if (setq skeleton-abbrev-cleanup
200 (or (eq this-command 'self-insert-command)
201 (eq this-command
202 'skeleton-pair-insert-maybe)))
203 ()
204 ;; Pretend C-x a e passed its prefix arg to us
205 (if (or arg current-prefix-arg)
206 (prefix-numeric-value (or arg
207 current-prefix-arg))
208 (and skeleton-autowrap
209 (or (eq last-command 'mouse-drag-region)
210 (and transient-mark-mode mark-active))
211 -1)))
212 (if (stringp str)
213 str))
214 (and skeleton-abbrev-cleanup
215 (setq skeleton-abbrev-cleanup (point))
216 (add-hook 'post-command-hook 'skeleton-abbrev-cleanup nil t)))))
217
218
219(defun skeleton-abbrev-cleanup (&rest list)
220 "Value for `post-command-hook' to remove char that expanded abbrev."
221 (if (integerp skeleton-abbrev-cleanup)
222 (progn
223 (delete-region skeleton-abbrev-cleanup (point))
224 (setq skeleton-abbrev-cleanup)
225 (remove-hook 'post-command-hook 'skeleton-abbrev-cleanup t))))
226
227
228;;;###autoload 169;;;###autoload
229(defun skeleton-insert (skeleton &optional regions str) 170(defun skeleton-insert (skeleton &optional regions str)
230 "Insert the complex statement skeleton SKELETON describes very concisely. 171 "Insert the complex statement skeleton SKELETON describes very concisely.