From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: PATCH: isearch-yank-until-char Date: Tue, 27 Aug 2019 15:52:23 -0700 (PDT) Message-ID: <558c8b76-e120-4767-be00-391f375fae77@default> References: <87tvakfnv4.fsf@red-bean.com> <87lfvvjxjs.fsf@mail.linkov.net> <87sgq1r9rb.fsf@red-bean.com> <87lfvt6m1e.fsf@mail.linkov.net> <877e7256uc.fsf@red-bean.com> <604cbbef-7e25-486a-a97a-9bc1adf23928@default> <871rx87b9h.fsf@red-bean.com> <77205e15-f38a-46dc-9451-4030a318900a@default> <874l23ak8m.fsf@red-bean.com> <87a7bvwqg6.fsf@mail.linkov.net> <645496e5-935d-4f9c-9a53-b38a3a83f9fd@default> <87lfvfvabh.fsf@mail.linkov.net> <07fab6f3-3edb-40ae-bdfb-cc699a38f3ac@default> <87y2zewb0w.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="141693"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Karl Fogel , Emacs developers To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 28 00:53:17 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 1i2kKz-000ajZ-Bt for ged-emacs-devel@m.gmane.org; Wed, 28 Aug 2019 00:53:17 +0200 Original-Received: from localhost ([::1]:59540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2kKy-0006Ww-9u for ged-emacs-devel@m.gmane.org; Tue, 27 Aug 2019 18:53:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2kKF-0006We-3E for emacs-devel@gnu.org; Tue, 27 Aug 2019 18:52:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2kKD-0007D3-LG for emacs-devel@gnu.org; Tue, 27 Aug 2019 18:52:30 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:51836) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i2kKD-0007Cl-Dp for emacs-devel@gnu.org; Tue, 27 Aug 2019 18:52:29 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7RMnO54139739; Tue, 27 Aug 2019 22:52:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=R5yqU3L6Gbc4yOaLg/w4M9MlF3DzFJQ5snNMxs1R2PA=; b=M8kWYsnCyMcVlAdozDYkmhaKuYAOKmrvjkDlkTeUvkA8ro15iORjkHcSoj14R+sJIvwq WCy58oOESEMFDsEFPoU1NJlhtZPDZ5x3cUcQZpuYR1BBRH/xX73hBTtVduoBGseoD+I/ VHJ1KUd+XruhSprfUbRUVjl4O+m3dVDMNNYIRccrY7OzlTgNFMXoFA97o4NIy+5w7a1N jJdhTE8OOQ4XVKHQsnpApKdrBrNKhXJ0ZcTOjLDK4XOGjzuzp66V2rDZF1BlZsmWE/SC fQqWxohfYwKhQ4nt2x0bWyPFwxxotHyl/wAL3Z+TfZWIhnoPogaBDnDY8WPLrCRfhtPF Ig== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2und0cg6p3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Aug 2019 22:52:26 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7RMmGt2027052; Tue, 27 Aug 2019 22:52:26 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2umj308xgq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Aug 2019 22:52:26 +0000 Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x7RMqOCG006609; Tue, 27 Aug 2019 22:52:24 GMT In-Reply-To: <87y2zewb0w.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4873.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9362 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908270216 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9362 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908270216 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 141.146.126.78 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:239632 Archived-At: > >> `M-.' and `C-M-.' are good keys for pulling text > >> into the minibuffer, as well as into a search string, > >> so let's reserve them for the text pulling feature. > > > > OK. (But we already have multiple text-pulling > > keys for Isearch.) >=20 > One of its first usages would be to bind `M-s M-.' to a command > that turns the active region into the search string. OK by me. FWIW, that doesn't interfere with any keys I have in `isearch-mode-map'. (But `M-s M-.' is not `C-M-.' or `M-.'.) > (defun skip-to-char (arg char) > (interactive "^p\ncSkip to char: ") > (search-forward (char-to-string char) nil nil arg) > (forward-char -1)) >=20 > (define-key esc-map "\C-z" 'skip-to-char) >=20 > Then `C-SPC C-M-z ) M-s M-.' would be another way > to yank until next char. Looks useful, sounds good. Oops, but no. Now I see that you didn't mean `M-s M-.' during Isearch. You meant `M-s- M-.' _globally_, to _start_ Isearch with a certain search string. When you said "a command that turns the active region into the search string" I thought you meant during search. Personally, I'm not in favor of binding more and more keys globally, to start particular Isearches. Global keys are rare these days. I prefer to use the usual keys to start Isearch, and then hit a key to make it a particular kind of Isearch - in this case, to use the region text as the search string (or maybe to append it to the search string). E.g., though I don't suggest we sacrifice the global keys `C-M-s' and `C-M-r', nowadays we _can_ just use `C-s M-r' to get regexp search (a particular kind of Isearch), without needing global keys just for that. In this case, I'd sooner see `M-s M-.' be bound in the Isearch map to a command that appends the region text to the search string (or if you prefer, replaces it). That gives you what you expected when starting Isearch. IOW, `C-SPC C-M-z )' to activate the region up to the `)' char, then `C-s M-s M-.' to use the region as the search string. IOW, just use `C-s' (or `C-r' or `C-M-s' or `C-M-r') to start searching; don't sacrifice yet another global key for that. --- [Personally, I'll have to bind `skip-to-char' to a different key, because I bind `C-M-z' to `thumfr-really-iconify-or-deiconify-frame'. But that's OK. I have a bunch of keys that end in `z', which I use for things similar to the default `C-z' binding of `suspend-frame' (aka `iconify-or-deiconify-frame'). As is often the case in Emacs, a single key (in this case `z') has more than one standard meaning. The frame-suspension meaning of `C-z' and `C-x C-z' is just as old as the `zap-to-char' meaning of `M-z' (at least checking back to Emacs 20). It's 6 of one, half a dozen of the other. I iconify (thumbify) much more than I zap-to-char, so that association is stronger in my head.]