[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange emacsclient behaviour during use of isearch

From: Stefan Monnier
Subject: Re: Strange emacsclient behaviour during use of isearch
Date: Wed, 14 Mar 2007 11:40:49 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

>> +  (condition-case nil
>> +      ;; If we're running isearch, we must abort it to allow Emacs to
>> +      ;; display the buffer and switch to it.
>> +      (mapc #'(lambda (buffer)
>> +            (with-current-buffer buffer
>> +              (when (bound-and-true-p isearch-mode)
>> +                (isearch-cancel))))
>> +        (buffer-list))
>> +    ;; Signaled by isearch-cancel
>> +    (quit (message nil)))

> I still would like to know *why* the emacsclient buffer is not
> even displayed.

Duh, it was right there staring in my face in server-process-filter:

        (unless (or isearch-mode (minibufferp))
          (server-switch-buffer (nth 1 client))
          (run-hooks 'server-switch-hook)
          (unless nowait
            (message "%s" (substitute-command-keys
                           "When done with a buffer, type \\[server-edit]")))))

and if I remove the `isearch-mode' check, the buffer is indeed displayed.
The problem is that since it doesn't exit isearch, you end up isearching in
the new buffer.


PS: Interestingly, since the `isearch-mode' variable is buffer local, I can
circumvent the check:

   emacsclient --eval '(pop-to-buffer "someotherbuffer")'
   emacsclient <myfile>

this will show the <myfile> buffer (and will move the isearch session to
this buffer), despite the isearch-mode check.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]