From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: BibTeX completion via completion-in-region Date: Sat, 05 Dec 2009 13:44:25 -0500 Message-ID: References: <19225.59404.211849.447292@regnitz.physics.niu.edu> <19226.39988.288763.3156@regnitz.physics.niu.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260038727 14231 80.91.229.12 (5 Dec 2009 18:45:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Dec 2009 18:45:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Roland Winkler" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 05 19:45:20 2009 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 1NGzd9-0000gf-8s for ged-emacs-devel@m.gmane.org; Sat, 05 Dec 2009 19:45:19 +0100 Original-Received: from localhost ([127.0.0.1]:53747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGzd9-0005Du-4k for ged-emacs-devel@m.gmane.org; Sat, 05 Dec 2009 13:45:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGzcO-0004mj-JR for emacs-devel@gnu.org; Sat, 05 Dec 2009 13:44:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGzcJ-0004iv-TG for emacs-devel@gnu.org; Sat, 05 Dec 2009 13:44:32 -0500 Original-Received: from [199.232.76.173] (port=56687 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGzcJ-0004ii-Hr for emacs-devel@gnu.org; Sat, 05 Dec 2009 13:44:27 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:23454 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGzcJ-0006Df-Mr for emacs-devel@gnu.org; Sat, 05 Dec 2009 13:44:27 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4EAL44GktFpZ7i/2dsb2JhbACBTNM0hDMEih4 X-IronPort-AV: E=Sophos;i="4.47,347,1257138000"; d="scan'208";a="50754561" Original-Received: from 69-165-158-226.dsl.teksavvy.com (HELO pastel.home) ([69.165.158.226]) by ironport2-out.pppoe.ca with ESMTP; 05 Dec 2009 13:44:25 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id BCFEA80B1; Sat, 5 Dec 2009 13:44:25 -0500 (EST) In-Reply-To: <19226.39988.288763.3156@regnitz.physics.niu.edu> (Roland Winkler's message of "Sat, 5 Dec 2009 11:45:24 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:118313 Archived-At: > The old BibTeX code achieved this goal in two steps, by hooking into > choose-completion-string-functions plus using the return value of > bibtex-complete-internal. (Unfortunately, I cannot recall all > details anymore under which circumstances one or the other step was > needed.) Now bibtex-complete-internal does not return the completion > anymore (because of completion-in-region) so that this step doesn't > work anymore in the old way. Is this step really not needed anymore > (and should be removed from the code)? Is it sufficient now that the > post-completion procesing is done inside choose-completion-string-functions? Check bibtex-complete-internal again, it ends with: (when (completion-in-region beg end completions) (buffer-substring beg (point))))) it's not perfect, but should work for now. Bibtex-mode's completion (as well as a few others) show the need for some kind of "completion-hook" that gets run when a completion is performed (e.g. via TAB or via choosing something in the *Completions* buffer), so this should/will be added at some point in the future. Currently, I'm mostly going through all the packages and making them use completion-in-region to try and see what needs to be added (like this completion-hook). Stefan