|
| <prev next> |
add-abbrev-propose-initials: msg#00051emacs.sources
Maybe someone takes interest in it. Cheers Andreas Roehler (defun add-abbrev-propose-initials (table type arg) "A (slightly) extended add-abbrev function: if more than one word shall be abbreviated it takes the initials of these words constructing an abbrev proposal from it." (let* ((exp (and (>= arg 0) (buffer-substring-no-properties (point) (if (= arg 0) (mark) (save-excursion (forward-word (- arg)) (point)))))) (prepare (split-string exp)) propose name) (when (< 1 (abs arg)) (dolist (elt prepare) (setq propose (concat propose (downcase (substring elt 0 1))))) (message "%s" propose)) (setq name (read-string (format (if exp "%s abbrev for \"%s\": " "Undefine %s abbrev: ") type exp) propose t propose)) (set-text-properties 0 (length name) nil name) (if (or (null exp) (not (abbrev-expansion name table)) (y-or-n-p (format "%s expands to \"%s\"; redefine? " name (abbrev-expansion name table)))) (define-abbrev table (downcase name) exp)))) ;; end |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: archive-downloader.el --- Download files from archive.org: 00051, Michael Olson |
|---|---|
| Previous by Thread: | EDB 1.28 availablei: 00051, Thien-Thi Nguyen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |