comparison lisp/abbrev.el @ 26079:bc18b027a049

(add-abbrev, inverse-add-abbrev, expand-region-abbrevs): Remove properties from buffer text.
author Dave Love <fx@gnu.org>
date Mon, 18 Oct 1999 21:28:04 +0000
parents 5f4d21e85cf6
children a552a942b327
comparison
equal deleted inserted replaced
26078:1dfff19134ab 26079:bc18b027a049
223 (interactive "p") 223 (interactive "p")
224 (add-abbrev global-abbrev-table "Global" arg)) 224 (add-abbrev global-abbrev-table "Global" arg))
225 225
226 (defun add-abbrev (table type arg) 226 (defun add-abbrev (table type arg)
227 (let ((exp (and (>= arg 0) 227 (let ((exp (and (>= arg 0)
228 (buffer-substring 228 (buffer-substring-no-properties
229 (point) 229 (point)
230 (if (= arg 0) (mark) 230 (if (= arg 0) (mark)
231 (save-excursion (forward-word (- arg)) (point)))))) 231 (save-excursion (forward-word (- arg)) (point))))))
232 name) 232 name)
233 (setq name 233 (setq name
264 264
265 (defun inverse-add-abbrev (table type arg) 265 (defun inverse-add-abbrev (table type arg)
266 (let (name nameloc exp) 266 (let (name nameloc exp)
267 (save-excursion 267 (save-excursion
268 (forward-word (- arg)) 268 (forward-word (- arg))
269 (setq name (buffer-substring (point) (progn (forward-word 1) 269 (setq name (buffer-substring-no-properties
270 (setq nameloc (point)))))) 270 (point) (progn (forward-word 1) (setq nameloc (point))))))
271 (set-text-properties 0 (length name) nil name) 271 (set-text-properties 0 (length name) nil name)
272 (setq exp (read-string (format "%s expansion for \"%s\": " 272 (setq exp (read-string (format "%s expansion for \"%s\": "
273 type name) nil nil nil t)) 273 type name) nil nil nil t))
274 (if (or (not (abbrev-expansion name table)) 274 (if (or (not (abbrev-expansion name table))
275 (y-or-n-p (format "%s expands to \"%s\"; redefine? " 275 (y-or-n-p (format "%s expands to \"%s\"; redefine? "
304 (while (and (not (eobp)) 304 (while (and (not (eobp))
305 (progn (forward-word 1) 305 (progn (forward-word 1)
306 (<= (setq pnt (point)) (- (point-max) lim)))) 306 (<= (setq pnt (point)) (- (point-max) lim))))
307 (if (abbrev-expansion 307 (if (abbrev-expansion
308 (setq string 308 (setq string
309 (buffer-substring 309 (buffer-substring-no-properties
310 (save-excursion (forward-word -1) (point)) 310 (save-excursion (forward-word -1) (point))
311 pnt))) 311 pnt)))
312 (if (or noquery (y-or-n-p (format "Expand `%s'? " string))) 312 (if (or noquery (y-or-n-p (format "Expand `%s'? " string)))
313 (expand-abbrev))))))) 313 (expand-abbrev)))))))
314 314