all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Sam Halliday <sam.halliday@gmail.com>, help-gnu-emacs@gnu.org
Subject: Re: BUG 20703 further evidence
Date: Thu, 14 Jan 2016 00:50:52 +0300	[thread overview]
Message-ID: <5696C6BC.6060609@yandex.ru> (raw)
In-Reply-To: <5a73d376-ec6e-4ad3-8575-667629306d55@googlegroups.com>

On 01/14/2016 12:36 AM, Sam Halliday wrote:

> The approach that sounds most sensible for my use case sounds like just excluding that one file from indexing, because I can do that from my .ctags. I actually hadn't thought of it until you mentioned it!

I've suggested it before, in a comment to the bug in question: 
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20703#26

> I was thinking along the lines of a function that deletes all the long lines from a TAGS file, part of a validation / cleanup phase. If you have a recipe in mind for that, it would be pretty useful.

That code still has to be written. Maybe after 25.1?

> Could you please copy out your proposed changes in full? I won't be applying them against their sources, I'll just put them in my scratch and execute in the running instance.

Try replacing these definitions:

(defvar etags--table-line-limit 500)

(defun etags-tags-completion-table ()   ; Doc string?
   (let (table
	(progress-reporter
	 (make-progress-reporter
	  (format "Making tags completion table for %s..." buffer-file-name)
	  (point-min) (point-max))))
     (save-excursion
       (goto-char (point-min))
       ;; This regexp matches an explicit tag name or the place where
       ;; it would start.
       (while (not (eobp))
         (if (not (re-search-forward
                   "[\f\t\n\r()=,; ]?\177\\\(?:\\([^\n\001]+\\)\001\\)?"
                   ;; Avoid lines that are too long (bug#20703).
                   (+ (point) etags--table-line-limit) t))
             (forward-line 1)
           (push (prog1 (if (match-beginning 1)
			   ;; There is an explicit tag name.
			   (buffer-substring (match-beginning 1) (match-end 1))
			 ;; No explicit tag name.  Backtrack a little,
                          ;; and look for the implicit one.
                          (goto-char (match-beginning 0))
                          (skip-chars-backward "^\f\t\n\r()=,; ")
                          (prog1
                              (buffer-substring (point) (match-beginning 0))
                            (goto-char (match-end 0))))
		  (progress-reporter-update progress-reporter (point)))
		table))))
     table))

(defun tags-completion-table ()
   "Build `tags-completion-table' on demand.
The tags included in the completion table are those in the current
tags table and its (recursively) included tags tables."
   (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 the current list of tags tables.
	      (while (visit-tags-table-buffer (and combined-table t))
		;; Find possible completions in this table.
		(setq current-table (funcall tags-completion-table-function))
		;; Merge this buffer's completions 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 in a buffer-local variable.
	    (setq tags-completion-table combined-table))
	(quit (message "Tags completion table construction aborted.")
	      (setq tags-completion-table nil)))))



      reply	other threads:[~2016-01-13 21:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 17:54 BUG 20703 further evidence Sam Halliday
2016-01-13 21:25 ` Dmitry Gutov
2020-08-25  9:13   ` bug#20703: " Lars Ingebrigtsen
2020-08-25 14:54     ` Drew Adams
2020-10-11  3:08     ` Lars Ingebrigtsen
2020-10-11  3:08     ` Lars Ingebrigtsen
2020-08-25  9:13   ` Lars Ingebrigtsen
2016-01-13 21:25 ` Dmitry Gutov
     [not found] ` <mailman.2317.1452720341.843.help-gnu-emacs@gnu.org>
2016-01-13 21:36   ` Sam Halliday
2016-01-13 21:50     ` Dmitry Gutov [this message]

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

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

  git send-email \
    --in-reply-to=5696C6BC.6060609@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=help-gnu-emacs@gnu.org \
    --cc=sam.halliday@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.