From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: dabbrev-expand for the minibuffer Date: Sun, 24 Feb 2008 09:26:13 +0000 Message-ID: References: <200802232259.m1NMx6rY027848@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203845223 20774 80.91.229.12 (24 Feb 2008 09:27:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Feb 2008 09:27:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 24 10:27:27 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JTD8m-0000oq-Gt for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2008 10:27:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTD8G-0000Rl-LZ for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2008 04:26:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTD8C-0000PV-6w for emacs-devel@gnu.org; Sun, 24 Feb 2008 04:26:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTD8A-0000ML-Gd for emacs-devel@gnu.org; Sun, 24 Feb 2008 04:26:47 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTD89-0000M0-Sr for emacs-devel@gnu.org; Sun, 24 Feb 2008 04:26:46 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JTD89-0007SA-IM for emacs-devel@gnu.org; Sun, 24 Feb 2008 04:26:45 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JTD84-0006If-0s for emacs-devel@gnu.org; Sun, 24 Feb 2008 09:26:40 +0000 Original-Received: from sl392.st-edmunds.cam.ac.uk ([131.111.223.202]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Feb 2008 09:26:40 +0000 Original-Received: from sdl.web by sl392.st-edmunds.cam.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Feb 2008 09:26:40 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sl392.st-edmunds.cam.ac.uk Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= User-Agent: Gnus/5.130000 Emacs/23.0.60 (20080222) Fedora 8 (gnu/linux) Cancel-Lock: sha1:cGIvYPJOGsLOzT+c1DfOdJPnMv4= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90210 Archived-At: 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/