From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Williams Newsgroups: gmane.emacs.devel Subject: Re: patches for etags and shell-command Date: Sun, 19 Feb 2006 15:48:20 -0600 Message-ID: <43F8E7A4.9060901@pobox.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1140399202 3991 80.91.229.2 (20 Feb 2006 01:33:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 20 Feb 2006 01:33:22 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 20 02:33:18 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FAzvO-0008Lc-PP for ged-emacs-devel@m.gmane.org; Mon, 20 Feb 2006 02:33:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAzvB-0005XJ-OB for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2006 20:33:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FAwQ0-0004ZI-FP for emacs-devel@gnu.org; Sun, 19 Feb 2006 16:48:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FAwPw-0004QT-Vz for emacs-devel@gnu.org; Sun, 19 Feb 2006 16:48:35 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAwPw-0004Pq-91 for emacs-devel@gnu.org; Sun, 19 Feb 2006 16:48:32 -0500 Original-Received: from [68.142.198.201] (helo=smtp102.sbc.mail.mud.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.52) id 1FAwVp-0000m7-Az for emacs-devel@gnu.org; Sun, 19 Feb 2006 16:54:37 -0500 Original-Received: (qmail 83288 invoked from network); 19 Feb 2006 21:48:20 -0000 Original-Received: from unknown (HELO ?192.168.1.1?) (starfishjami@sbcglobal.net@209.30.82.52 with plain) by smtp102.sbc.mail.mud.yahoo.com with SMTP; 19 Feb 2006 21:48:20 -0000 User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en Original-To: pot@gnu.org In-Reply-To: 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:50778 Archived-At: Francesco, I've updated my version of tags-completion-table so it contains the same amount of comments as the original, and I replaced the message I had accidentally removed. My tests indicate that recursing into the included tags tables is not necessary because (while (visit-tags-table-buffer (and combined-table t)) ...) visits the included tags tables in addition to those the user has specifically visited. (defun tags-completion-table () (or tags-completion-table ;; No cached value for this buffer. (condition-case () (let (current-table combined-table) (message "Making tags completion table for %s..." buffer-file-name) (save-excursion ;; Iterate over all tags buffers. (while (visit-tags-table-buffer (and combined-table t)) ;; Find possible completions in this buffer. (setq current-table (funcall tags-completion-table-function)) ;; Merge this buffer's comletions into the combined ;; table. (if combined-table (mapatoms (lambda (sym) (intern (symbol-name sym) combined-table)) current-table) (setq combined-table current-table)))) (message "Making tags completion table for %s...done" buffer-file-name) ;; Cache the result a buffer-local variable. (setq tags-completion-table combined-table)) (quit (message "Tags completion table construction aborted.") (setq tags-completion-table nil))))) P.S. Sorry about the overly aggressive spam filtering; I've updated by settings so you shouldn't get any more bounces from me. jw Richard M. Stallman wrote: >In case you don't receive his mail. > >------- Start of forwarded message ------- >From: Francesco Potorti` >To: John Williams >In-reply-to: <43D10FF4.8030202@pobox.com> (jrw@pobox.com) >Organization: >Date: Wed, 15 Feb 2006 19:08:01 +0100 >Cc: emacs-devel@gnu.org >Subject: Re: patches for etags and shell-command > >John, I tried to follow up on your patch to etags.el, but apparently >your mail server bounces mail coming from *.it! > >Anyway, you should get this one via the list. > >I was examining the patch you proposed (see below), which is intended to >correctly implement Emacs' behaviour as documented in the manual, in the >Select Tags Table node. However it has three problems: >- - it removes the starting message >- - it removes helpful comments >- - most importantly, it does not recursively descend into the tree of > included tags tables > >Would you please resubmit a patch that corrects these problems? > > > >>This patch corrects a bug in etags that causes completion to only consider the >>tags in a single TAGS buffer. With the match tag completion will consider tags >> >> >>from all the active TAGS buffers. (The diff is a bit longer than it really > > >>needs to be because I inadvertently changed tabs to spaces--I didn't change back >>to tabs because spaces appear to be the preferred from of indentation based on >>emacs's default settings.) >> >>--- etags.el 2006-01-20 09:53:43.000000000 -0600 >>+++ etags-1.el 2006-01-20 10:14:31.000000000 -0600 >>@@ -747,28 +747,21 @@ >> (defun tags-completion-table () >> (or tags-completion-table >> (condition-case () >>- (prog2 >>- (message "Making tags completion table for %s..." buffer-file-name) >>- (let ((included (tags-included-tables)) >>- (table (funcall tags-completion-table-function))) >>- (save-excursion >>- ;; Iterate over the list of included tables, and combine each >>- ;; included table's completion obarray to the parent obarray. >>- (while included >>- ;; Visit the buffer. >>- (let ((tags-file-name (car included))) >>- (visit-tags-table-buffer 'same)) >>- ;; Recurse in that buffer to compute its completion table. >>- (if (tags-completion-table) >>- ;; Combine the tables. >>- (mapatoms (lambda (sym) (intern (symbol-name sym) table)) >>- tags-completion-table)) >>- (setq included (cdr included)))) >>- (setq tags-completion-table table)) >>- (message "Making tags completion table for %s...done" >>- buffer-file-name)) >>- (quit (message "Tags completion table construction aborted.") >>- (setq tags-completion-table nil))))) >>+ (let (combined-table) >>+ (save-excursion >>+ (while (visit-tags-table-buffer (and combined-table t)) >>+ (let ((included (tags-included-tables)) >>+ (table (funcall tags-completion-table-function))) >>+ (if (null combined-table) >>+ (setq combined-table table) >>+ (mapatoms (lambda (sym) >>+ (intern (symbol-name sym) combined-table)) >>+ table)) >>+ (message "Making tags completion table for %s...done" >>+ buffer-file-name)))) >>+ (setq tags-completion-table combined-table)) >>+ (quit (message "Tags completion table construction aborted.") >>+ (setq tags-completion-table nil))))) >> >> ;; Completion function for tags. Does normal try-completion, >> ;; but builds tags-completion-table on demand. >>