From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#21091: 25.0.50; `isearch-done' called before `isearch-update' raises wrong-type-arg error Date: Sat, 18 Jul 2015 20:57:32 -0700 (PDT) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1437278365 30390 80.91.229.3 (19 Jul 2015 03:59:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jul 2015 03:59:25 +0000 (UTC) To: 21091@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 19 05:59:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZGfks-0004jx-1o for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Jul 2015 05:59:10 +0200 Original-Received: from localhost ([::1]:50425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGfkr-0006Uw-6g for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jul 2015 23:59:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGfko-0006UR-1C for bug-gnu-emacs@gnu.org; Sat, 18 Jul 2015 23:59:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGfkk-0001UC-RD for bug-gnu-emacs@gnu.org; Sat, 18 Jul 2015 23:59:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGfkk-0001U6-OQ for bug-gnu-emacs@gnu.org; Sat, 18 Jul 2015 23:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZGfkk-0001pI-H9 for bug-gnu-emacs@gnu.org; Sat, 18 Jul 2015 23:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Jul 2015 03:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21091 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14372782876953 (code B ref -1); Sun, 19 Jul 2015 03:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Jul 2015 03:58:07 +0000 Original-Received: from localhost ([127.0.0.1]:53452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZGfjr-0001o4-6Z for submit@debbugs.gnu.org; Sat, 18 Jul 2015 23:58:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60516) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZGfjp-0001na-6v for submit@debbugs.gnu.org; Sat, 18 Jul 2015 23:58:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGfji-0001Q8-Lh for submit@debbugs.gnu.org; Sat, 18 Jul 2015 23:57:59 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGfji-0001Px-JN for submit@debbugs.gnu.org; Sat, 18 Jul 2015 23:57:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGfjh-0006PD-9q for bug-gnu-emacs@gnu.org; Sat, 18 Jul 2015 23:57:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGfja-0001PC-S1 for bug-gnu-emacs@gnu.org; Sat, 18 Jul 2015 23:57:57 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:18149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGfja-0001P8-LL for bug-gnu-emacs@gnu.org; Sat, 18 Jul 2015 23:57:50 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t6J3vmxx013166 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 19 Jul 2015 03:57:48 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t6J3vlSv018095 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sun, 19 Jul 2015 03:57:47 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t6J3vY3N011690 for ; Sun, 19 Jul 2015 03:57:34 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:105035 Archived-At: Dunno whether I'll be able to convince you that this is a bug, but here goes. Recently someone added `isearch--current-buffer' to isearch.el. This is initially nil. It is given a string value (buffer name) only in `isearch-update'. But it is called in `isearch-done' and expected to have a string value there. If it does not, a wrong-type-arg error is raised. I have code that defines some Isearch commands that each start out by calling (isearch-done) - they can be called at top level or from `isearch-mode-map'. Here is the beginning of one: (defun foo (arg) (interactive "P") (bar 'isearch-forward arg)) (defun bar (arg) (isearch-done) (setq isearch-success t isearch-adjusted t) (let* ((enable-recursive-minibuffers t) ...) ... (setq isearch-filter-predicate ...) ...) (funcall search-fn)) When called at top level, `isearch--current-buffer' is nil, and the wrong-type arg error is raised. I can "fix" the problem that was introduced by wrapping the `isearch-done' call in `ignore-errors'. But I think it would be better for isearch.el not to assume that `isearch-done' is called after `isearch-update'. I don't think there is a reason why the two need to be coupled in that way. Adding variable `isearch--current-buffer' in the way it was done makes the isearch.el code more fragile than it needs to be, I think. Anyway, please consider somehow ensuring that `isearch-done' does not care whether `isearch--current-buffer' has a string value. Perhaps one possibility would be something like this - dunno. (when isearch--current-buffer (with-current-buffer isearch--current-buffer (setq isearch--current-buffer nil) (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))) Or maybe even: (when (and isearch--current-buffer (get-buffer isearch--current-buffer)) ...) In GNU Emacs 25.0.50.1 (i686-pc-mingw32) of 2015-07-03 on LEG570 Bzr revision: 2b848fadd51e805b2f46da64c5958ea7f009048a Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --host=3Di686-pc-mingw32 --enable-checking=3Dyes,glyphs'