unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* possible bug in M-/ (dabbrev-expand)
@ 2007-04-21 16:14 Dieter Wilhelm
  2007-04-21 18:13 ` Dieter Wilhelm
  0 siblings, 1 reply; 4+ 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] 4+ messages in thread

* Re: possible bug in M-/ (dabbrev-expand)
  2007-04-21 16:14 Dieter Wilhelm
@ 2007-04-21 18:13 ` Dieter Wilhelm
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

* Re: possible bug in M-/ (dabbrev-expand)
       [not found] <87slatg0x2.fsf@debby.local.net>
@ 2007-04-23  1:31 ` Stefan Monnier
  2007-04-23 20:01   ` Dieter Wilhelm
  0 siblings, 1 reply; 4+ 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] 4+ messages in thread

* Re: possible bug in M-/ (dabbrev-expand)
  2007-04-23  1:31 ` possible bug in M-/ (dabbrev-expand) Stefan Monnier
@ 2007-04-23 20:01   ` Dieter Wilhelm
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

end of thread, other threads:[~2007-04-23 20:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87slatg0x2.fsf@debby.local.net>
2007-04-23  1:31 ` possible bug in M-/ (dabbrev-expand) Stefan Monnier
2007-04-23 20:01   ` Dieter Wilhelm
2007-04-21 16:14 Dieter Wilhelm
2007-04-21 18:13 ` Dieter Wilhelm

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).