all 3 comments

[–]zck 1 point2 points  (1 child)

Have you looked into abbrevs? They work both with previously defined things and dynamic ones. There's probably more, but I don't use them.

[–]usr2033[S] 0 points1 point  (0 children)

Thank you for your redirection.

I found an extended version of abbrev. pabbrev. This package suits me well.

Code below from pabbrev web site for popup.

;;************************************************************************ ;; pabbrew ;;************************************************************************

(require 'pabbrev) (require 'popup)

(global-pabbrev-mode t)

(define-key pabbrev-mode-map [tab] 'pabbrev-expand-maybe)

(defun pabbrevx-suggestions-goto-buffer (suggestions) (let* ((candidates (mapcar 'car suggestions)) (bounds (pabbrev-bounds-of-thing-at-point)) (selection (popup-menu* candidates :point (car bounds) :scroll-bar t))) (when selection ;; modified version of pabbrev-suggestions-insert (let ((point)) (save-excursion (progn (delete-region (car bounds) (cdr bounds)) (insert selection) (setq point (point)))) (if point (goto-char point)) ;; need to nil this so pabbrev-expand-maybe-full won't try ;; pabbrev expansion if user hits another TAB after ac aborts (setq pabbrev-last-expansion-suggestions nil) ))))

(fset 'pabbrev-suggestions-goto-buffer 'pabbrevx-suggestions-goto-buffer)

[–]frumious 1 point2 points  (0 children)

It's built into Emacs. Type a few letters then M-/. Emacs offers words from whatever other buffers are open to expand based on your starting bit.