[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dabbrev in minibuffer

From: Dan Nicolaescu
Subject: dabbrev in minibuffer
Date: Wed, 06 Sep 2006 09:00:49 -0700

When editing in the minibuffer it would be nice if dabbrev-expand
would be able to use the minibuffer history as a source for
dabbrev only looks in buffers for expansions. So one way to solve this
would be to create a buffer that contains the minibuffer history and
put it at the beginning of the list of buffers.

I post the (very simple) code, maybe someone can figure out an elegant
way to integrate such a feature in emacs...

(defun minibuffer-setup-dabbrev-buffers ()
  (let ((buf (get-buffer-create " *dabbrev history* ")))
          (set-buffer buf)
          (mapc (lambda (arg) 
                  (insert arg "\n")) 
                (if minibuffer-history-variable 
                    (eval minibuffer-history-variable)
        (append (list buf) (dabbrev--select-buffers))))

(defun minibuffer-setup-hook-dabbrev ()
  (setq dabbrev-select-buffers-function 'minibuffer-setup-dabbrev-buffers))

(add-hook 'minibuffer-setup-hook 'minibuffer-setup-hook-dabbrev)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]