[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dabbrev in minibuffer
From: |
Klaus Zeitler |
Subject: |
Re: dabbrev in minibuffer |
Date: |
10 Jul 2002 09:51:30 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
>>>>> "Miles" == Miles Bader <miles@lsi.nec.co.jp> writes:
Miles>
Miles> TBABIN@nortelnetworks.com (Tim Babin) writes:
>> Running dabbrev-expand in the minibuffer starts an infinite loop.
Miles>
Miles> Not for me; please give a precise test-case.
Miles>
I've reported this problem in February and RMS sent me the following patch
that IMHO only partially fixed it (the problem only occurred with the
inviolable option set for the minibuffer).
-------------------- snip ------------------------
*** dabbrev.el.~1.61.~ Thu Nov 8 12:56:42 2001
--- dabbrev.el Sat Feb 2 20:09:49 2002
***************
*** 599,605 ****
(progn
(forward-char -1)
(while (and (looking-at dabbrev--abbrev-char-regexp)
! (not (bobp)))
(forward-char -1))
(or (looking-at dabbrev--abbrev-char-regexp)
(forward-char 1))))
--- 599,605 ----
(progn
(forward-char -1)
(while (and (looking-at dabbrev--abbrev-char-regexp)
! (not (= (point) (field-beginning (point)))))
(forward-char -1))
(or (looking-at dabbrev--abbrev-char-regexp)
(forward-char 1))))
-------------------- snip ------------------------
Here's what I wrote in one of my mails to RMS:
-------------------- snip ------------------------
Originally I ran in to this problem cause I wanted to change a
set-face-background call to a set-face-foreground in one of my el files (and
I'm an avid user of dynamic abbrev). So here's how I reproduce this bug.
1. start emacs with -q --no-site-file
2. (the original dabbrev package that comes with 21.1 is used)
3. M-x customize-variable minibuffer-prompt-properties
turn on the Inviolable option and set for current session
4. load a file with e.g. the following contents
----- cut -----
(set-face-background 'trailing-whitespace "Gray25")
----- cut -----
5. M-x query-replace
and now enter as regexp "s" followed by "M-/"
=> emacs loops on HP-UX 10.20, Solaris 5.8 and GNU/Linux but
- on HP-UX 10.20 C-g does not work
- on Solaris 5.8 C-g does work (most of the time), but when I open a 2nd
frame (C-x 5 2) before I try the query replace, C-g doesn't interrupt
anymore
- on GNU/Linux C-g always works
now I perform the same steps but first I load your patched dabbrev file
1. start emacs with -q --no-site-file
2. load-library <patched-dabbrev.elc>
3. M-x customize-variable minibuffer-prompt-properties
turn on the Inviolable option and set for current session
4. load a file with e.g. the following contents
----- cut -----
(set-face-background 'trailing-whitespace "Gray25")
----- cut -----
5a. M-x query-replace
and now enter as regexp "s" followed by "M-/", this works
5b. press return and now try to enter as replacement string again
"s" followed by "M-/"
=> emacs loops on HP-UX 10.20 and Solaris 5.8 but not on GNU/Linux
as I said in one of my previous posts XTread_socket never gets called
once emacs loops. Could it be that one of the lisp functions/macros, e.g.
save-match-data or unwind-protect disables/postpones interrupts?
-------------------- snip ------------------------
ever since then it's been on my low priority todo list to investigate,
but haven't had time yet.
I think it gets stuck in the while loop in dabbrev--search.
But what worries me more is that I can't interrupt it on Solaris and HP.
Klaus
--
------------------------------------------
| Klaus Zeitler Lucent Technologies |
| Email: kzeitler@lucent.com |
------------------------------------------
---
What garlic is to food, insanity is to art.