From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: [patch, review request] better dired-isearch-filenames reset in dired-isearch-filenames-end Date: Thu, 28 Nov 2019 17:13:08 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="26328"; mail-complaints-to="usenet@blaine.gmane.org" Cc: juri@linkov.net To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 28 15:32:03 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iaKpu-0006is-CY for ged-emacs-devel@m.gmane.org; Thu, 28 Nov 2019 15:32:02 +0100 Original-Received: from localhost ([::1]:49588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaKpt-00006k-3j for ged-emacs-devel@m.gmane.org; Thu, 28 Nov 2019 09:32:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51406) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaKXs-00026T-Vp for emacs-devel@gnu.org; Thu, 28 Nov 2019 09:13:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaKXk-0000aw-MX for emacs-devel@gnu.org; Thu, 28 Nov 2019 09:13:20 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:59637) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iaKXj-0000Bx-4b for emacs-devel@gnu.org; Thu, 28 Nov 2019 09:13:16 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9464120365; Thu, 28 Nov 2019 09:13:11 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 28 Nov 2019 09:13:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= fm1; bh=5SzUwcDq8oZEUA6URYJrBsk7D9YxMDKJ2RRXDcV2F6k=; b=czgAbgmY KcLoefzA/gzM7g2bLppSaoHZtEo0v9RUOyKnBnXa6w7kPbtHmeE5ZRf4TUUXTFJr dj7rsEyXpWwxivoChnR87hIQXmrXEjJqyxTtUJmDqPOxsNRyG4HnSK6pQVW2cHYk 7KIEyZYaxnQUE3g4rmEcRDe13+9yJXfSXVOV1w1i6vru6fsVkeA7N5sPt5Kpmlam Zv3kvpKm80XAvX0HJXEaUEo76ycKAHsPDJQjwZ1k74nhJpiNaBbBxnUJi4qfFVlk IylVz/NnEaeYe9Vh2AOgJTnXCjmeonmJ/cfqWN4msRg4gCwdG7j/yntjIiC5rhgC cYpfs7ShBUSuRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=5SzUwcDq8oZEUA6URYJrBsk7D9YxM DKJ2RRXDcV2F6k=; b=V8lRcLHt2QDz9zdGBc4qkHQUKFDf9Uyzf1jyi1fggzAW0 BI/dJQVKoxjsEXpCIRqJTHbql+fzTXiG+XWtZ5B0Mi9dxhxKfvnoRxwxz7WA5Qxp 0JEl3NeTeK3vWH4IX2+zdevhtXOE8JEmeebHDLl+Dx9ab1KUkOzOU2CnTXQSLxKU RLO0tgNAJWR2k9GgoDElQ+if7RknDkkDSOPZYGEuO8hb6T1dywLbozoffm1yUcxn ECD+U5neYRy6mlc8E19JdUhJmrOToo9zlY+Jw7EqKESl7Dfh++uaIn+RkJhtzjmQ ISxmbBYXQjouN2xr4kVDWqENRurTW6RZcvKH77O3Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeijedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtsehttdertddttd dtnecuhfhrohhmpefhihhlihhpphcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshht mhgrihhlrdhfmheqnecukfhppedukeehrdefvddrieekrddufeehnecurfgrrhgrmhepmh grihhlfhhrohhmpehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmnecuvehluhhsthgv rhfuihiivgeptd X-ME-Proxy: Original-Received: from fgunbin.local (unknown [185.32.68.135]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B9293060090; Thu, 28 Nov 2019 09:13:10 -0500 (EST) Mail-Followup-To: emacs-devel@gnu.org, juri@linkov.net X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.29 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242833 Archived-At: Current code calls custom-reevaluate-setting (bug#30187), and that results in wrong value when dired-isearch-filenames was initialized not with emacs customization facility, but with plain setq in .emacs. I think a temporary local variable is a better way to save & restore the global setting, WDYT? In my tests what worked well. TIA. Filipp diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4d7abd1ef6..fb1ad6266d 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2876,7 +2876,7 @@ dired-isearch-filenames-end (dired-isearch-filenames-mode -1) (remove-hook 'isearch-mode-end-hook #'dired-isearch-filenames-end t) (unless isearch-suspended - (custom-reevaluate-setting 'dired-isearch-filenames))) + (kill-local-variable 'dired-isearch-filenames))) (defun dired-isearch-filter-filenames (beg end) "Test whether some part of the current search match is inside a file name. @@ -2889,14 +2889,14 @@ dired-isearch-filter-filenames (defun dired-isearch-filenames () "Search for a string using Isearch only in file names in the Dired buffer." (interactive) - (setq dired-isearch-filenames t) + (set (make-local-variable 'dired-isearch-filenames) t) (isearch-forward nil t)) ;;;###autoload (defun dired-isearch-filenames-regexp () "Search for a regexp using Isearch only in file names in the Dired buffer." (interactive) - (setq dired-isearch-filenames t) + (set (make-local-variable 'dired-isearch-filenames) t) (isearch-forward-regexp nil t))