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


_______________________________________________
gnu-emacs-sources mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources

Reply via email to