unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: dabbrev-expand for the minibuffer
Date: Sun, 24 Feb 2008 09:26:13 +0000	[thread overview]
Message-ID: <m3oda6hfii.fsf@cam.ac.uk> (raw)
In-Reply-To: 200802232259.m1NMx6rY027848@sallyv1.ics.uci.edu

On 2008-02-23 22:59 +0000, Dan Nicolaescu wrote:
> A lot of times when using dabbrev-expand in the minibuffer, the most
> desirable expansion is something from the minibuffer history.
> But dabbrev-expand does not search the minibuffer history...
> If for example you use M-x compile a lot with a lot of very complex
> command lines, having dabbrev-expand look in the minibuffer history is
> very useful.
> (This is not unlike what you suffer from when using bash: no dabbrev-expand at all).
>
> So a long time ago I wrote this hack to put the minibuffer history in a
> buffer and tell dabbrev to search it too.
>
> (setq dabbrev-select-buffers-function 'my-minibuffer-setup-dabbrev-buffers)
>
> (defun my-minibuffer-setup-dabbrev-buffers ()
>   (let ((buf (get-buffer-create " *dabbrev history* ")))
>     (save-excursion 
>       (set-buffer buf)
>       (erase-buffer)
>       ;; dabbrev looks for text only in buffers.  Put the minibuffer
>       ;; history in a buffer, so that dabbrev can look at it.
>       (mapc (lambda (arg) 
>             (insert arg "\n")) 
>                 (if minibuffer-history-variable 
>                     (eval minibuffer-history-variable)
>                           minibuffer-history)))
>     ;; Put the minibuffer history at the beginning of the buffer list
>     ;; that dabbrev will look at.
>     (append (list buf) (dabbrev--select-buffers))))
>
> I am not sure what is the proper way to integrate this functionality,
> it would be great if someone that knows dabbrev could either add
> something similar to this code, or do it in a better way and provide it
> by default.  

It looks like the best way to integrate this is with hippie-expand,
probably not dabbrev-expand. Just a thought.

>
> Thanks
>
>         --dan

-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

          Use the best OS -- http://www.fedoraproject.org/





  reply	other threads:[~2008-02-24  9:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23 22:59 dabbrev-expand for the minibuffer Dan Nicolaescu
2008-02-24  9:26 ` Leo [this message]
2008-02-27 22:49   ` Juri Linkov
2008-02-27 23:22     ` Leo
2008-02-27 23:54     ` Miles Bader
2008-02-28  0:08       ` Jason Rumney
2008-02-28  0:35         ` Miles Bader
2008-02-28  8:21           ` Jason Rumney
2008-02-28  8:29             ` Leo
2008-02-28 16:41       ` Richard Stallman
2008-02-28 21:14         ` Leo
2008-02-29 19:54           ` Richard Stallman
2008-02-24 17:35 ` Juri Linkov
2008-02-25  8:13   ` Bastien
2008-02-27  0:18 ` Johan Bockgård
2008-02-27  1:06   ` Dan Nicolaescu
2008-02-27 11:28     ` Johan Bockgård
2008-02-27 14:38       ` Dan Nicolaescu
2008-02-27 15:04         ` Johan Bockgård
2008-02-27 15:30           ` Dan Nicolaescu
  -- strict thread matches above, loose matches on Subject: below --
2008-03-01 13:31 Richard Stallman
2008-07-21 15:55 ` Drew Adams
2008-07-21 16:47   ` Lennart Borgman (gmail)
2008-07-21 16:48     ` Lennart Borgman (gmail)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3oda6hfii.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).