Eli Zaretskii writes: >> From: Joseph Mingrone >> Date: Wed, 01 Jun 2016 16:10:49 -0300 >> After starting an Emacs daemon, everything works as expected, but after some >> time (or event I'm unaware of), trying to open a file from a shell gives an >> error. >> % emacsclient some_file >> Waiting for Emacs... >> *ERROR*: Wrong type argument: stringp, nil > Please try to figure out which Emacs function signals this error. Joel Rosdahl (joel@rosdahl.net) has done some detective work: > Here's how to reproduce (at least my version of) the problem: > emacs -q --daemon > emacsclient -nc > In Emacs: C-s ; enter isearch-mode > emacsclient -e '(find-file ".")' > In Emacs: C-x b RET > emacsclient . > What seems to happen is that isearch-mode can be left in a bad state after > using "emacsclient -e", and then server-goto-toplevel tries to perform > isearch-cancel on the buffer, which fails since isearch--current-buffer is > nil (while isearch-mode is non-nil). > This part of isearch-done seems to have been added to Emacs 25, and that's > what fails when isearch--current-buffer is nil: > (with-current-buffer isearch--current-buffer > (setq isearch--current-buffer nil) > (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))