all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r115545: Cleanup cfengine3-mode so complete-symbol works again.
Date: Tue, 17 Dec 2013 05:33:23 -0500	[thread overview]
Message-ID: <878uvjn4wc.fsf@flea.lifelogs.com> (raw)
In-Reply-To: jwvhaa8nrk6.fsf-monnier+emacsdiffs@gnu.org

On Mon, 16 Dec 2013 21:25:14 -0500 Stefan Monnier <monnier@IRO.UMontreal.CA> wrote: 

>> (defun cfengine3-completion-function ()
>> "Return completions for function name around or before point."
>> (cfengine3-make-syntax-cache)
>> -  (let* ((bounds (cfengine3--current-word t))
>> +  (let* ((bounds (save-excursion
>> +                   (let ((p (point)))
>> +                     (skip-syntax-backward "w_" (point-at-bol))
>> +                     (list (point) p))))
>> (syntax (cfengine3-make-syntax-cache))
>> (flist (assq 'functions syntax)))

SM> BTW, it would be better for cfengine3-completion-function not to call
SM> cfengine3-make-syntax-cache which can cause all kinds of processing
SM> to happen.  Instead it should return a completion-table-dynamic or
SM> something like that, such that cfengine3-make-syntax-cache is only
SM> called if/when the completion-table is actually used.

I'm not sure I agree.  `cfengine3-make-syntax-cache' is only expensive
the first time, unless there are problems running the
`cfengine-cf-promises' binary (should I attempt just once? but then it's
not idempotent...).  After that, it's just a couple of built-in
functions to retrieve the cache from memory, if+cddr+assoc.

Or is the name a problem because it implies the cache is remade every time?

Ted




      reply	other threads:[~2013-12-17 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1VsaP2-0000uL-EZ@vcs.savannah.gnu.org>
2013-12-17  2:25 ` [Emacs-diffs] trunk r115545: Cleanup cfengine3-mode so complete-symbol works again Stefan Monnier
2013-12-17 10:33   ` Ted Zlatanov [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=878uvjn4wc.fsf@flea.lifelogs.com \
    --to=tzz@lifelogs.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 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.