From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: `isearch-allow-scroll' - a misnomer and a bad design Date: Fri, 9 Sep 2011 13:38:16 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1315600714 19498 80.91.229.12 (9 Sep 2011 20:38:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Sep 2011 20:38:34 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 09 22:38:30 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R27qH-0001HE-QL for ged-emacs-devel@m.gmane.org; Fri, 09 Sep 2011 22:38:30 +0200 Original-Received: from localhost ([::1]:44854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R27qG-0000Da-SI for ged-emacs-devel@m.gmane.org; Fri, 09 Sep 2011 16:38:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R27qD-0000DF-TE for emacs-devel@gnu.org; Fri, 09 Sep 2011 16:38:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R27qC-0004Rf-MN for emacs-devel@gnu.org; Fri, 09 Sep 2011 16:38:25 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:58513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R27qC-0004RQ-Gu for emacs-devel@gnu.org; Fri, 09 Sep 2011 16:38:24 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p89KcL9k012694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 9 Sep 2011 20:38:23 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p89KcLBP000440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 9 Sep 2011 20:38:21 GMT Original-Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p89KcFTx002765 for ; Fri, 9 Sep 2011 15:38:15 -0500 Original-Received: from dradamslap1 (/10.159.51.14) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 09 Sep 2011 13:38:15 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcxvMGb2KG+iHY8xSvilFokW+HAucw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A02020A.4E6A793F.00F2:SCFMA922111,ss=1,re=-4.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:143829 Archived-At: 1. The doc for this option, as well as its name, give the impression that it is about allowing scrolling. It is not. 1. For one thing, a non-nil value allows *any* command bound to a key in `isearch-mode-map' to take advantage of a prefix arg. That is, `C-u' is passed through to the command if the option value is non-nil. The command need not have anything to do with scrolling. And there are already at least two such vanilla commands: `isearch-query-replace' and `isearch-query-replace-regexp' (`M-%', `C-M-%'). A `C-u' changes the command behavior in a way that has nothing to do with scrolling. At a minimum, the doc should be adjusted. The option name should also be changed to fit what it really does. Likewise, the functions (e.g. `isearch-lookup-scroll-key') and other code and doc strings in isearch.el that paint this feature as having to do with scrolling. 1b. For another thing (i.e., forgetting about `C-u'), *any* command can benefit from the same Isearch feature as a scrolling command. It suffices to put a non-nil `isearch-scroll' property on the command symbol. 2. I would like to see us separate the treatment of a prefix arg - whether it gets passed it through to a command or it exits Isearch - from the other uses/effects of this option. IOW, I would like to be able to set some option to have Isearch pass `C-u' through, and have that be independent of the setting of some other option that controls whether scrolling (or some other behavior) is allowed. Even if allowing scrolling (or whatever) might also require the ability to pass through `C-u', that does not mean that being able to pass through `C-u' should allow scrolling. It makes little sense to couple these two features. The query-replace commands are a good example, and users (such as yours truly) might well want similar `C-u' pass-through for other commands, without also wanting scrolling (or whatever). 3. Wrt controlling which commands are affected by the option (i.e., forgetting about `C-u' now): The current design makes the library designer responsible for this choice, not the user. That is another flaw, IMO. A user should be able to easily (using Customize, not just putting `put' here and there) choose which commands are affected. Instead of a Boolean option (`isearch-allow-scroll'), users should have an option that specifies the affected commands. (It could also configure any specifics for each command, if there are such.) 4. Why are there currently _two_ different properties that turn on this sensitivity (i.e., "scrolling")? From the code comments: ;; ... property called `isearch-scroll'. ;; If a command's symbol has the value t for this property or for the ;; `scroll-command' property, it is a scrolling command. This means that if someone adds property `scroll-command' for some command then it automatically acts as if s?he also added property `isearch-scroll'. Why couple these two things? Why assume that every `scroll-command' command is also one for which Isearch should allow scrolling. All of this smacks of being a carryover from someone's (hi Alan) personal customizations, rather than being thought out in terms of users in general.