unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: John Williams <jrw@pobox.com>
Cc: emacs-devel@gnu.org
Subject: Re: patches for etags and shell-command
Date: Sun, 19 Feb 2006 15:48:20 -0600	[thread overview]
Message-ID: <43F8E7A4.9060901@pobox.com> (raw)
In-Reply-To: <E1F9nTR-0003HU-Ew@fencepost.gnu.org>

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` <pot@gnu.org>
>To: John Williams <jrw@pobox.com>
>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.
>>

       reply	other threads:[~2006-02-19 21:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1F9nTR-0003HU-Ew@fencepost.gnu.org>
2006-02-19 21:48 ` John Williams [this message]
2006-01-20 16:29 patches for etags and shell-command John Williams
2006-01-21 19:58 ` Richard M. Stallman
2006-01-21 22:17   ` John Williams
2006-01-22 17:44     ` Richard M. Stallman
2006-01-22  0:38   ` Juri Linkov
2006-02-15 18:08 ` Francesco Potorti`

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43F8E7A4.9060901@pobox.com \
    --to=jrw@pobox.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).