From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#21091: 25.0.50; `isearch-done' called before `isearch-update' raises wrong-type-arg error Date: Sat, 03 Sep 2016 23:45:07 -0400 Message-ID: <87h99w9vlo.fsf@users.sourceforge.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1472960722 14575 195.159.176.226 (4 Sep 2016 03:45:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Sep 2016 03:45:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 21091@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 04 05:45:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgOMs-00031k-RT for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Sep 2016 05:45:15 +0200 Original-Received: from localhost ([::1]:48616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgOMq-0003Lo-Jz for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Sep 2016 23:45:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgOMk-0003JD-7x for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2016 23:45:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgOMg-0000l5-53 for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2016 23:45:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgOMg-0000l1-0x for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2016 23:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bgOMf-00073y-Pm for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2016 23:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Sep 2016 03:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21091 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 21091-submit@debbugs.gnu.org id=B21091.147296069527127 (code B ref 21091); Sun, 04 Sep 2016 03:45:01 +0000 Original-Received: (at 21091) by debbugs.gnu.org; 4 Sep 2016 03:44:55 +0000 Original-Received: from localhost ([127.0.0.1]:49059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgOMZ-00073O-0D for submit@debbugs.gnu.org; Sat, 03 Sep 2016 23:44:55 -0400 Original-Received: from mail-it0-f45.google.com ([209.85.214.45]:34832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgOMX-000736-AO; Sat, 03 Sep 2016 23:44:53 -0400 Original-Received: by mail-it0-f45.google.com with SMTP id e124so100460141ith.0; Sat, 03 Sep 2016 20:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=SBLHm8EQsrXrR8QyRI19NrdaIrQw2beyk5igSV8Lk/s=; b=lzqY20CSBW83HdmHJ8Opl0QvtYydl6Y6tnK8JlPZXv95GPXeYxDIUZ0XUlLXJq959D iWetCRh+yRSorEpgEDXw2B2tIcx808mvcUCPCpyXJEkebs6+Ho491m61EexDz8AotuV0 UUPEjaDXgV1OA2cueC2Ole+avqPIUrn1o5ixtGEMcd0GuEPfqylEkCxys8klVU0UvIrH Ul4XRWN++vAh3NkuVbh5drPZdhCEq0s2eVQs/O4Xe8r5oN0pkSsT8IrQJZNnpc98HWiE zDBA+Z3m4GOztWsiMjrPog8TphaybzyNP5BeaqBADpOcAxbU33PsY6uFGr7drFLgoI/E gfpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=SBLHm8EQsrXrR8QyRI19NrdaIrQw2beyk5igSV8Lk/s=; b=TveqcvK2beAYROCpHxFiRr+qzdhw4ki1mNFCHMNqDtX6AzbnGib8cVUYcIrL0fv0Rw cIRJa74DDzvm4ht+qtLokHTtUyiCR2d/f3cZCIvRxVXEQzoFd0qgTamLhXS/3KzJAdJZ aT3teUcJMV8/JTorfv4ZAaL1wKxzH4KY1GOcIsQHlcP/7mRF3SUt6/jFE3GMfw1K7a8a CyysPihZ5oIJfI8EfvkRg4/qhvyTmDxdZ70T7jEKLwFrEkSjcFRAp+QNyO63JnxzHyuI 1NzzfO2unN48gkrR5aNiKbPYzrN7yOB08EdhFz9RAEfbAO2U+vHRYYkbnjuwYT9GrKZx /EpQ== X-Gm-Message-State: AE9vXwPFTE4VXIv9ezJ9Qmf/G+lzeHZG3GYLkE6iiMEAsgYSqtRRcMzBxk6BCl0mOq2pPw== X-Received: by 10.36.55.146 with SMTP id r140mr14417563itr.73.1472960687744; Sat, 03 Sep 2016 20:44:47 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id r123sm3002780ith.1.2016.09.03.20.44.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Sep 2016 20:44:47 -0700 (PDT) In-Reply-To: (Drew Adams's message of "Sat, 18 Jul 2015 20:57:32 -0700 (PDT)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:122919 Archived-At: --=-=-= Content-Type: text/plain tags 21091 patch quit Drew Adams writes: > > Anyway, please consider somehow ensuring that `isearch-done' does not > care whether `isearch--current-buffer' has a string value. Make sense to me, I suggest the following (isearch-update checks for a buffer value, so I went with that to be consistent): --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=v1-0001-Don-t-require-isearch-update-before-isearch-done.patch Content-Description: patch >From 5d7697546800ad3494df1d06d24e12f2fe987350 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 3 Sep 2016 23:38:35 -0400 Subject: [PATCH v1] Don't require isearch-update before isearch-done It is useful to be able to call `isearch-done' unconditionally to ensure a non-isearching state. * lisp/isearch.el (isearch-done): Check that `isearch--current-buffer' is a live buffer before using it (Bug #21091). --- lisp/isearch.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index b50379a..39ed8af 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1045,9 +1045,10 @@ isearch-done (remove-hook 'mouse-leave-buffer-hook 'isearch-done) (remove-hook 'kbd-macro-termination-hook 'isearch-done) (setq isearch-lazy-highlight-start nil) - (with-current-buffer isearch--current-buffer - (setq isearch--current-buffer nil) - (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit))) + (when (buffer-live-p isearch--current-buffer) + (with-current-buffer isearch--current-buffer + (setq isearch--current-buffer nil) + (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))) ;; Called by all commands that terminate isearch-mode. ;; If NOPUSH is non-nil, we don't push the string on the search ring. -- 2.9.3 --=-=-=--