From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: Re: complete-tag at the end of a buffer Date: Sat, 09 Feb 2013 16:47:27 +0400 Message-ID: <87d2w9ac2o.fsf@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1360414061 28836 80.91.229.3 (9 Feb 2013 12:47:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Feb 2013 12:47:41 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Sarah Weissman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 09 13:48:02 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U49qc-0006Ka-71 for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Feb 2013 13:48:02 +0100 Original-Received: from localhost ([::1]:60983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U49qI-0006uW-PT for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Feb 2013 07:47:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U49q9-0006uJ-Sw for help-gnu-emacs@gnu.org; Sat, 09 Feb 2013 07:47:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U49q5-0000os-Oh for help-gnu-emacs@gnu.org; Sat, 09 Feb 2013 07:47:33 -0500 Original-Received: from mail-lb0-f170.google.com ([209.85.217.170]:45333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U49q5-0000oX-Fx for help-gnu-emacs@gnu.org; Sat, 09 Feb 2013 07:47:29 -0500 Original-Received: by mail-lb0-f170.google.com with SMTP id ge1so3655086lbb.1 for ; Sat, 09 Feb 2013 04:47:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=c+pm1M/lvVoPDrDwuH4+sA+GW3t+kMgMf0TSl4cLOk8=; b=WrBoxUaU0tQR2zGGaUCezYTD/AUNDZ/nxsmFKOFWZNwfsY8H3QJQPeKDtpNdtiz2j9 JzeR+09BdJuq0FW6uXhyKnxNJbzYhb+MuSMGJqkB1Zvi5iZZTFTVHer4YY+gA21jGS3Q ZgjfTqKsT+UHe7w5gvMQzlzyBryZ4hBfit1UAgnr6YOvFdADpTSPJJBXRK4dkuTOINyf jgyd5yNNuux+4jHwgwAV3gi4cxuyvRAwaskCAXm9JAap0xOn6QXJFjiXmHxucb2947rF YISdlNcBN6kg+oJFsIoLNptNEX9tTJN5sV9RnllPibhIPmC0GntloYKsCuY/+Ye32hyV /hig== X-Received: by 10.112.37.129 with SMTP id y1mr3499940lbj.17.1360414047592; Sat, 09 Feb 2013 04:47:27 -0800 (PST) Original-Received: from SOL ([178.252.98.87]) by mx.google.com with ESMTPS id f8sm11073547lbg.2.2013.02.09.04.47.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 09 Feb 2013 04:47:26 -0800 (PST) In-Reply-To: (Sarah Weissman's message of "Fri, 8 Feb 2013 21:51:21 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.217.170 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89020 Archived-At: Sarah Weissman writes: > I thought I could implement general tab completion using tags in a > custom mode by following the advice found here: > http://emacsblog.org/2007/03/12/tab-completion-everywhere/ > and simply replacing the call to dabbrev-expand with a call to > complete-tag. This worked fine, except when trying to do completion at > the end of the buffer, which generates an end-of-buffer error. This > seems to be because tags-completion-at-point-function (called by > complete-tags) is using forward-char without checking that it might go > past the end. To get around this I wrote my own version of > tags-completion-at-point-function, just to add in the extra check > around each call to forward char, and my own version of complete-tag > to call this function, but this seems kind of silly. Am I using the > wrong entry point for completing tags in a normal buffer? Or is this a > bug? Below I've included the original version and my version for > tags-completion-at-point-function, for reference. I'm pretty sure it's a bug. It should be able to complete anywhere in the buffer.