From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: Completing with anything Date: Tue, 24 May 2011 16:45:19 +0200 Message-ID: <87zkmcf98g.fsf@gmail.com> References: <87r5bhysp6.fsf@keller.adm.naquadah.org> <87vd0qfhu3.fsf@member.fsf.org> <87y63jpii5.fsf@keller.adm.naquadah.org> <871v0ecwe4.fsf@keller.adm.naquadah.org> <87aaecihl2.fsf@gmail.com> <87lixwkzi4.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306248339 4742 80.91.229.12 (24 May 2011 14:45:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 May 2011 14:45:39 +0000 (UTC) Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 24 16:45:35 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QOsrU-0000Fy-Ja for ged-emacs-devel@m.gmane.org; Tue, 24 May 2011 16:45:32 +0200 Original-Received: from localhost ([::1]:33618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOsrT-0007gz-UX for ged-emacs-devel@m.gmane.org; Tue, 24 May 2011 10:45:32 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOsrQ-0007eF-Ou for emacs-devel@gnu.org; Tue, 24 May 2011 10:45:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOsrP-0005tg-Ta for emacs-devel@gnu.org; Tue, 24 May 2011 10:45:28 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:56342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOsrN-0005t4-J5; Tue, 24 May 2011 10:45:25 -0400 Original-Received: by wyf19 with SMTP id 19so6217569wyf.0 for ; Tue, 24 May 2011 07:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=juxlw7+N6VnxQjQcrygAt7g3pyKmLQYRyZjMyo/qDz0=; b=lQUGry9Su43nGozOw/Ec6DJNPZlnLwx0OwnHpgABSCyVInBXgQFKlvKL554h9AkFhw qBjB85m9PC2h20/Rd8isLb5DjzPjSYsT8lHIyUfJPLlapCDD2KZsjerjAXFxRGyGqE8e Bm4kTV8FS/wv8XY71nbXx6nSOzzuhFe6E8JTM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=p5+Eb2XRQSLLYM6gWgvKdoTRmbu+mxYt0Jw+uGSYP5Ot1d0bf7BoWJxXep5zDXGLH8 NzbSUpDbSGRkz34diWZ9qweJW7F3P0uK20hW5ic6Oynmm7cyRJ1JU4HPVvUDEkA73/hh U1QPvW5azi8igz1gzEd6SXIrHVxsqO2F5pUAY= Original-Received: by 10.216.232.41 with SMTP id m41mr3484742weq.31.1306248322596; Tue, 24 May 2011 07:45:22 -0700 (PDT) Original-Received: from lambda (portable43.ceremade.dauphine.fr [193.48.71.43]) by mx.google.com with ESMTPS id d54sm3865687wej.34.2011.05.24.07.45.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 07:45:21 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 24 May 2011 11:05:43 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139681 gmane.emacs.orgmode:42194 Archived-At: 24/05/11 16:05, Stefan Monnier >> (defadvice completion-at-point >> (after completion-at-point-complete-if-failed activate) >> "Fallback on dabbrev if completion didn't do anything useful." >> (unless ad-return-value >> (dabbrev-expand nil))) > > BTW, you can avoid the advice by using your own > > (defun al-completion-at-point () > (interactive) > (or (completion-at-point) > (dabbrev-expand nil))) I'd do that, but completion-at-point is used in places I don't fully understand when I set (setq tab-always-indent 'complete). Also there's some weirdness with dabbrev that makes it bug out when it's called indirectly. For instance, seemingly simple code like (artificial example here, but similar things happen when for instance you indent and then complete with the same key) (setq counter 0) (defun my-my-dabbrev-expand () (interactive) (setq counter (mod (+ 1 counter) 2)) (when (equal counter 0) (dabbrev-expand nil))) (local-set-key (kbd "C-c C-c") 'my-my-dabbrev-expand) behaves in a very unexpected way : it actually jumps (!) to the location where the completion was found. I wasn't able to understand this, but it's definitely a bug in dabbrev. It looks like it's related to the way dabbrev checks it's continuing a completion: (eq last-command this-command) but I wouldn't know how to fix this.