* possible bug in M-/ (dabbrev-expand)
@ 2007-04-21 16:14 Dieter Wilhelm
2007-04-21 18:13 ` Dieter Wilhelm
0 siblings, 1 reply; 5+ messages in thread
From: Dieter Wilhelm @ 2007-04-21 16:14 UTC (permalink / raw)
To: emacs-devel; +Cc: help-gnu-emacs
Hi
I deemed it an especially good idea to have function which is
searching something in a buffer when there are changes to the content.
(GNU Emacs 22.0.95.1 (i486-pc-linux-gnu, GTK+ Version 2.8.20) of
2007-03-02 on pacem, modified by Debian.)
When I install such a function in the following way (for example in
the *scratch* buffer):
$ emacs -Q -D
(defun bla ( &optional a b c) ;dummy variables
(interactive)
(save-excursion
(re-search-forward "a" nil 'noerror)))
(add-hook 'after-change-functions 'bla nil t)
and I try to M-/ something at the buffer beginning, the cursor does
not remain after the expansion but skips somewhere into the buffer.
I'm not sure whether this is a bug of M-/ or this is just a stupid
approach to have such an functionality after a buffer change? It
would be nice if you could give me some advice before I submit a
possibly unnecessary bug report.
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
* possible bug in M-/ (dabbrev-expand)
@ 2007-04-21 16:14 Dieter Wilhelm
2007-04-23 1:31 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Dieter Wilhelm @ 2007-04-21 16:14 UTC (permalink / raw)
Cc: help-gnu-emacs
The following message is a courtesy copy of an article
that has been posted to gmane.emacs.devel as well.
Hi
I deemed it an especially good idea to have function which is
searching something in a buffer when there are changes to the content.
(GNU Emacs 22.0.95.1 (i486-pc-linux-gnu, GTK+ Version 2.8.20) of
2007-03-02 on pacem, modified by Debian.)
When I install such a function in the following way (for example in
the *scratch* buffer):
$ emacs -Q -D
(defun bla ( &optional a b c) ;dummy variables
(interactive)
(save-excursion
(re-search-forward "a" nil 'noerror)))
(add-hook 'after-change-functions 'bla nil t)
and I try to M-/ something at the buffer beginning, the cursor does
not remain after the expansion but skips somewhere into the buffer.
I'm not sure whether this is a bug of M-/ or this is just a stupid
approach to have such an functionality after a buffer change? It
would be nice if you could give me some advice before I submit a
possibly unnecessary bug report.
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: possible bug in M-/ (dabbrev-expand)
2007-04-21 16:14 possible bug in M-/ (dabbrev-expand) Dieter Wilhelm
@ 2007-04-21 18:13 ` Dieter Wilhelm
0 siblings, 0 replies; 5+ messages in thread
From: Dieter Wilhelm @ 2007-04-21 18:13 UTC (permalink / raw)
To: emacs-devel
Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
> and I try to M-/ something at the buffer beginning, the cursor does
> not remain after the expansion but skips somewhere into the buffer.
I'm very, I got the wrong news group. The original message was meant
exclusively for emacs.help and not (yet) for this list.
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: possible bug in M-/ (dabbrev-expand)
2007-04-21 16:14 Dieter Wilhelm
@ 2007-04-23 1:31 ` Stefan Monnier
2007-04-23 20:01 ` Dieter Wilhelm
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2007-04-23 1:31 UTC (permalink / raw)
To: Dieter Wilhelm; +Cc: help-gnu-emacs, emacs-devel
> (defun bla ( &optional a b c) ;dummy variables
> (interactive)
> (save-excursion
> (re-search-forward "a" nil 'noerror)))
> (add-hook 'after-change-functions 'bla nil t)
You probably need to save-match-data as well.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: possible bug in M-/ (dabbrev-expand)
2007-04-23 1:31 ` Stefan Monnier
@ 2007-04-23 20:01 ` Dieter Wilhelm
0 siblings, 0 replies; 5+ messages in thread
From: Dieter Wilhelm @ 2007-04-23 20:01 UTC (permalink / raw)
To: Stefan Monnier; +Cc: help-gnu-emacs, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> (defun bla ( &optional a b c) ;dummy variables
>> (interactive)
>> (save-excursion
>> (re-search-forward "a" nil 'noerror)))
>
>> (add-hook 'after-change-functions 'bla nil t)
>
> You probably need to save-match-data as well.
>
Yes you are right, thank you very much.
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-04-23 20:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-21 16:14 possible bug in M-/ (dabbrev-expand) Dieter Wilhelm
2007-04-21 18:13 ` Dieter Wilhelm
-- strict thread matches above, loose matches on Subject: below --
2007-04-21 16:14 Dieter Wilhelm
2007-04-23 1:31 ` Stefan Monnier
2007-04-23 20:01 ` Dieter Wilhelm
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.