From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: visual-region-mode? Date: Wed, 12 Sep 2018 20:40:30 +0000 (UTC) Message-ID: <688a3479-640e-415b-b6b6-f06e4fe0cf4c@default> References: <83k1nxvm5j.fsf@gnu.org> <877ejxsm18.fsf@toy.adminart.net> <874lf0oul4.fsf@toy.adminart.net> <877ejuabdt.fsf_-_@toy.adminart.net> <878t473dhg.fsf@toy.adminart.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1536784785 29515 195.159.176.226 (12 Sep 2018 20:39:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2018 20:39:45 +0000 (UTC) Cc: cpitclaudel@gmail.com, lokedhs@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: charles@aurox.ch, hw Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 12 22:39:40 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 1g0BvH-0007Wy-2A for ged-emacs-devel@m.gmane.org; Wed, 12 Sep 2018 22:39:39 +0200 Original-Received: from localhost ([::1]:38358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0BxN-0002bo-Lb for ged-emacs-devel@m.gmane.org; Wed, 12 Sep 2018 16:41:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0BwS-0002ad-7b for emacs-devel@gnu.org; Wed, 12 Sep 2018 16:40:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0BwP-0003kP-HS for emacs-devel@gnu.org; Wed, 12 Sep 2018 16:40:52 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:33160) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g0BwP-0003it-73; Wed, 12 Sep 2018 16:40:49 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8CKcjuw101337; Wed, 12 Sep 2018 20:40:32 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-2018-07-02; bh=2Q470tKFXUfSukL3wvhYtypYB7yyIe2rij5OIZsxKFA=; b=d10pAu9eyZKYPkfv8wW+vi8OhJ7PAdsJ7nwYCVKC/oNE29FdDulyMGD7h7aj40AwTujk Rlw7FkckEQ28x6HmMsMk9Po8V4ddBJdVnK5qGMqzz/VFvbu1cjlqWC9HO4WKsGybodk/ SoTLsU4pW+vM1NB0+vG3H9y0caFKMGfa7AT2wy7oZH5l3UMNpMiE2TxoohIklh89VV1n ADAy6IBeNzP+qxp4ZEy1BcyYC7o4c83gs+RPFPPSyzplvigIkIBlWVWM1wm2YOwKfhJm GlxmIWeDLxyIrMxhEK+ieohNubDUGCxA4pAtJKPGpw3weLCGWECx6FSMokF6j/QftG9R Rw== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2mc6cpvfdj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Sep 2018 20:40:32 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w8CKeVUa011347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Sep 2018 20:40:32 GMT Original-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8CKeUih000507; Wed, 12 Sep 2018 20:40:31 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4735.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9014 signatures=668708 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-1807170000 definitions=main-1809120203 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.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:229725 Archived-At: > > That I move around in a file as I see fit while reading or editing it > > doesn't have anything to do with regions I might select to do something > > with. I might highlight a selection to make parts of source code stick > > out as a reminder because they need to be fixed or worked upon in some > > particular order. I could use registers and/or bookmarks instead, but > > it would be much more convenient to use highlighting and perhaps to be > > able to jump through the selections. With Bookmark+ you can use (temporary or persistent) bookmarks, and they can highlight their locations in various ways. You can also bookmark a region and have it activated when you later jump to it. You can navigate among the bookmarks in various ways, including cycling. You can create bookmarks without bothering to name them - automatic naming based on a template (e.g. with buffer position). With library `zones.el' you can define a list of multiple regions (zones) in the same buffer or in a mix of buffers. You can cycle among them, activating each in turn. You can move among them as multiple narrowings. You can highlight and unhighlight them. You can persist them as bookmarks. > It's probably feasible to add a "type" field to the mark, indicating > where it came from (i.e., if it was set explicitly by the user, by a > certain command, from a mouse selection, ...). Then we could offer > commands that jump between previous selections, or between previous > marks set by the user for navigation. A zone has a start and end (like a region). It can also have an ID. It can also have any Lisp values as additional data. > > As for doing other things, like replacing text in multiple parts of a > > buffer, is that something that could be usefully done with indirect > > buffers? With multiple regions, I'd highlight some parts of the buffer= , > > do the replacement limited to these parts and would be done with it. > > I'd be able to see all of the buffer while doing this. >=20 > Not possible yet, I think (at least, without making N indirect buffers > for the N regions and running the replacement command in all of them). > But if we had some way to record the "type" of a previous mark (as > above), then we could offer a command to replace, for example, the > last N "active regions" in the buffer. I think that might fit the > bill. You can add the region to a current list of zones (`C-x n a'). Then cycle among them, activating each in turn (`C-x n r'); and do query-replace or other actions on each one. > > Indirect buffers still hold all of the text, so instead of marking what > > I want to work with, I'd have to narrow out what I'm not working with, > > and IIRC, it's not possible to narrow a buffer "the other way round" so > > that the parts I want to work with remain and all the rest of the buffe= r > > is narrowed away. >=20 > I don't think that's possible yet. You can make a list of zones that is the complement of another list of zones.=20 If you also use library `isearch-prop.el' then you can make a list of zones or its complement invisible, you can search the zones or their complement. You can add text properties to the zones. When searching you can dim the complement of the zones being searched, and you can toggle to search the complement instead (and dim the original zones). ---- https://www.emacswiki.org/emacs/download/zones.el https://www.emacswiki.org/emacs/download/isearch-prop.el https://www.emacswiki.org/emacs/BookmarkPlus