/[emacs]/emacs/lisp/abbrev.el
ViewVC logotype

Diff of /emacs/lisp/abbrev.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30 by pj, Sat Jan 5 19:02:27 2002 UTC revision 1.30.4.1 by miles, Fri Apr 4 06:20:00 2003 UTC
# Line 74  buffer." Line 74  buffer."
74        (clear-abbrev-table (symbol-value (car tables)))        (clear-abbrev-table (symbol-value (car tables)))
75        (setq tables (cdr tables)))))        (setq tables (cdr tables)))))
76    
77    (defun copy-abbrev-table (table)
78      "Make a new abbrev-table with the same abbrevs as TABLE."
79      (let ((new-table (make-abbrev-table)))
80        (mapatoms
81         (lambda (symbol)
82           (define-abbrev new-table
83             (symbol-name symbol)
84             (symbol-value symbol)
85             (symbol-function symbol)))
86         table)
87        new-table))
88    
89  (defun insert-abbrevs ()  (defun insert-abbrevs ()
90    "Insert after point a description of all defined abbrevs.    "Insert after point a description of all defined abbrevs.
91  Mark is set after the inserted text."  Mark is set after the inserted text."
# Line 200  The argument FILE is the file name to wr Line 212  The argument FILE is the file name to wr
212                      abbrev-file-name)))                      abbrev-file-name)))
213    (or (and file (> (length file) 0))    (or (and file (> (length file) 0))
214        (setq file abbrev-file-name))        (setq file abbrev-file-name))
215    (save-excursion    (let ((coding-system-for-write 'emacs-mule))
216     (set-buffer (get-buffer-create " write-abbrev-file"))      (with-temp-file file
217     (erase-buffer)        (insert ";;-*-coding: emacs-mule;-*-\n")
218     (let ((tables abbrev-table-name-list))        (dolist (table abbrev-table-name-list)
219       (while tables          (insert-abbrev-table-description table nil)))))
        (insert-abbrev-table-description (car tables) nil)  
        (setq tables (cdr tables))))  
    (write-region 1 (point-max) file)  
    (erase-buffer)))  
220    
221  (defun add-mode-abbrev (arg)  (defun add-mode-abbrev (arg)
222    "Define mode-specific abbrev for last word(s) before point.    "Define mode-specific abbrev for last word(s) before point.
# Line 221  Don't use this function in a Lisp progra Line 229  Don't use this function in a Lisp progra
229    (interactive "p")    (interactive "p")
230    (add-abbrev    (add-abbrev
231     (if only-global-abbrevs     (if only-global-abbrevs
232         global-abbrev-table         global-abbrev-table
233       (or local-abbrev-table       (or local-abbrev-table
234           (error "No per-mode abbrev table")))           (error "No per-mode abbrev table")))
235     "Mode" arg))     "Mode" arg))

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.30.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26