From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: cons Newsgroups: gmane.emacs.help Subject: Re: dabbrev problem... Date: Fri, 14 Sep 2007 05:39:38 -0700 Organization: http://groups.google.com Message-ID: <1189773578.932094.215980@g4g2000hsf.googlegroups.com> References: <1189713098.097690.296390@22g2000hsm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1189773704 3763 80.91.229.12 (14 Sep 2007 12:41:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Sep 2007 12:41:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 14 14:41:42 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IWAUM-0000wQ-GQ for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Sep 2007 14:41:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IWAUL-0000zF-QR for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Sep 2007 08:41:37 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g4g2000hsf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: 213.115.62.204 Original-X-Trace: posting.google.com 1189773579 31807 127.0.0.1 (14 Sep 2007 12:39:39 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 14 Sep 2007 12:39:39 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g4g2000hsf.googlegroups.com; posting-host=213.115.62.204; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:152078 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:47588 Archived-At: On 14 Sep, 12:20, Andreas R=F6hler wrote: > Am Donnerstag, 13. September 2007 21:51 schrieb cons: > > > (defun complete-further (arg) > > "Insert space if necessary and then call dabbrev-expand." > > (interactive "*P") > > (if (not (eq (preceding-char) ?\s)) > > (insert ?\s)) > > (dabbrev-expand arg)) > > What about this: > > (defun dabbrev-expand-before-point (arg) > (interactive "*p") > (skip-chars-backward " \t\r\n\f") > (dabbrev-expand arg) > (unless (eq (preceding-char) ?\ ) > (insert " "))) > > Andreas R=F6hler Hmmm, that does not work. Let me explain. The manual describes it as "After you have expanded a dynamic abbrev, you can copy additional words that follow the expansion in its original context. Simply type M-/ for each additional word you want to copy. The spacing and punctuation between words is copied along with the words." For example, put the point at the end of the string "demonstration,of,dabbrevs,extend-word,feature. dem". Now press M-/. The word 'dem' is now expanded to the word 'demonstration'. Now press SPC and then M-/ again. Dabbev-expand now deletes the space you just wrote and replace it with the next word. The result is "demonstration,of". Press SPC and M-/ again and you get "demonstration,of,dabbrevs" and so on. The pattern here is to press M-/ SPC M-/ SPC M-/ SPC M-/ etc for each word you want to expand. Now, instead of for example pressing M-/ SPC M-/ SPC M-/ (5 key presses), I would instead like to just press something like M-/ F1 F1 (3 key presses). This of course requires that I bind a new function to F1 that simply first insert a SPC and then call dabbrev-expand: (defun complete-further (arg) "Insert space and then call dabbrev-expand." (interactive "*P") (insert " ") (dabbrev-expand arg)) but that doesn't work for some strange reason. In the example above M-/ results in the correct 'demonstration'. The first press of F1 also works and result in "demonstration,of" as expected. But the second press of F1 that should result in 'demonstration,of,dabbrevs' totally freaks out and produce a random result. The function you provided doesn't work either unfortunately. Does somebody know what's going on? Why isn't it equivalent to press SPC M-/ and let a function inserts a SPC and then call dabbrev-expand? /Stefan