From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Let's make C-M-w in isearch yank symbol, not delete character Date: Sun, 25 Feb 2018 13:43:43 -0800 Message-ID: <2854ae14-ad4a-2fa2-ff0f-652e1501819e@dancol.org> References: <87po4slrg4.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519594929 27853 195.159.176.226 (25 Feb 2018 21:42:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Feb 2018 21:42:09 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: Emacs developers To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 25 22:42:04 2018 Return-path: Envelope-to: ged-emacs-devel@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 1eq43Y-0006o9-6R for ged-emacs-devel@m.gmane.org; Sun, 25 Feb 2018 22:42:04 +0100 Original-Received: from localhost ([::1]:55951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eq45a-00050V-Ko for ged-emacs-devel@m.gmane.org; Sun, 25 Feb 2018 16:44:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eq45O-0004xv-G7 for emacs-devel@gnu.org; Sun, 25 Feb 2018 16:43:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eq45N-0000NF-Ea for emacs-devel@gnu.org; Sun, 25 Feb 2018 16:43:58 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:42294) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eq45N-0000Ka-4c for emacs-devel@gnu.org; Sun, 25 Feb 2018 16:43:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=rJ7jNkIMQreA0pqOAoNo8iKqSmsi2Vbf/qeeMF7w1QQ=; b=D6yQQB3dKxkd6yNgiJIb5STbk5D3URaudE4RslVb3TqZSFBpZoDOJg4i0KZMyZjmKiP/o8PK28kIx/Kjpc+VwqxmvLphuiRMsZxNfSImMXVIlvdlpjE0OD6eycKjRyZKCbDIV6USC/7KHiCS2DKmYQyYJ73XBtrzquma1C2cYH/N6k5uCamHJathBPP2CulBp/NO1XexqJ+YPu2J3k2jjicIPTKh7pC0kX60LjNvPt8sTiaxR7XCc8Uz4UDDSTwYJQoMempi6fyAsYL4wqIwYEDfVlyTETIpe4ucNzIPN2WQ65ljsqq6lBTeDhJmbIsHSH8bz1K5qmz19Fyf/IGbfw==; Original-Received: from [2604:4080:1321:8ab0:2891:b7:d72c:af1b] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eq45F-0004rB-Jw; Sun, 25 Feb 2018 13:43:49 -0800 In-Reply-To: <87po4slrg4.fsf@mail.linkov.net> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:223031 Archived-At: On 02/25/2018 12:55 PM, Juri Linkov wrote: >> Right now, C-w in search-mode yanks a word from the buffer and globs it >> onto the end of the search result. I usually want to search for symbols, >> not words, so I end up pressing C-w multiple times. C-M-w would be the >> natural keybinding for yanking a symbol instead of a word, but it's already >> taken by isearch-del-char. How about moving isearch-del-char somewhere >> else, like C-d, and making C-M-w yank a whole symbol? > > But isn't the prefix 'C-M-' usually reserved for keys that operate on > whole expressions, not just symbols? Good point. I don't have a strong objection to using forward-sexp instead of forward-symbol. It'll still DWIM in the cases I care about. > Fortunately, it's easy to add support for yanking an expression: > in addition to the existing option 'edit' of 'search-exit-option' > we can also provide a new option 'move' that will sync the current > search string with the new position in the buffer after moving point > using all standard motion commands, e.g. `C-f' will add the next char > to the end of the search string, `C-M-f' will add the next expression, > `M-f' will add the next word, `C-b' will delete text from the end of > the search string, etc. Here is the implementation: Thanks. I'm looking for ways we can tweak the existing default interaction model, but I think we should take a broader look at how isearch works in the first place. IMHO, find-and-replace should be more closely integrated into isearch, we should have a unified history for regular and regex search, and case-sensitivity, symbol-granularity, regex mode, etc. should all be independently toggleable peer flags.