GNU bug report logs - #17284
24.3.90; Host name completion in shell mode take 45 seconds

Previous Next

Package: emacs;

Reported by: Svend Sorensen <svend <at> ciffer.net>

Date: Thu, 17 Apr 2014 17:49:02 UTC

Severity: normal

Found in version 24.3.90

Done: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Drew Adams <drew.adams <at> oracle.com>, Svend Sorensen <svend <at> ciffer.net>,  Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: 17284 <at> debbugs.gnu.org
Subject: bug#17284: Host name completion in shell mode take 45 seconds
Date: Sat, 04 Apr 2015 10:29:52 +0200
> 1. Is it really about LIMIT?  Or is it instead about looking back
>     at a literal string of chars?  And typically a short string.
>     I'm guessing that that is the use case to pursue here.

Right.

> 2. Instead of (or in addition to) a byte-compiler warning for
>     `looking-back', how about adding a function `chars-before'?

This would be useful.

> Since I use multiple Emacs versions, some quite old, I use this.
> But I'm sure that a much better (including prettier) definition
> can be had for recent Emacs.  Or (better) define it in C.

I guess something like

(defun string-before-p (string)
  "Return t if string before `point' equals STRING."
  (let ((start (- (point) (length string))))
    (and (>= start (point-min))
	 (string-equal
	  (buffer-substring-no-properties start (point))
	  string))))

would do.  And for simpler cases giving `char-before' a second argument
to specify the position of the character before `point' might help too.

But many occurrences of `looking-back' in the code base are inherently
tied to regexps specified via defcustoms or passed as arguments and it
doesn't seem easy to get rid of them.  Hence we should probably add a
TODO item to fix all occurrences of `looking-back' either via the LIMIT
argument, by string or character comparison.  An appetizing formulation
of such an item would be very welcome.

martin




This bug report was last modified 9 years and 144 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.