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: Overlay insertion types, markers, etc. Date: Tue, 12 Nov 2019 00:09:18 +0000 (UTC) Message-ID: <20c74b83-6272-44e9-b4ac-829fd4cd0143@default> 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="251172"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 12 01:10:08 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 1iUJkz-0013A0-F6 for ged-emacs-devel@m.gmane.org; Tue, 12 Nov 2019 01:10:06 +0100 Original-Received: from localhost ([::1]:58132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUJkx-0001rS-OB for ged-emacs-devel@m.gmane.org; Mon, 11 Nov 2019 19:10:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51359) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUJkO-0001rJ-CF for emacs-devel@gnu.org; Mon, 11 Nov 2019 19:09:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUJkM-0008VW-SB for emacs-devel@gnu.org; Mon, 11 Nov 2019 19:09:28 -0500 Original-Received: from userp2120.oracle.com ([156.151.31.85]:47536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iUJkM-0008R3-JY for emacs-devel@gnu.org; Mon, 11 Nov 2019 19:09:26 -0500 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAC09LaE122981 for ; Tue, 12 Nov 2019 00:09:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=nd3aTWlqDYDyPHQeV2iEIG06G5w0HMb3TA1WzmnAA30=; b=WzmpovyNBZV9uv3b/BvQB0+5oLK3cG4rT1jQkDxF8DGNES9HJo/7eQs4Xhe26NSZSZbD q4XuU8Z1Nt6nHic2uENbEQwKygKYIrNaN78DLuzmwG/XvYn9lw/XthG+3UrLi7SJn3U3 kxD1pLL3gLzHuwAMZRc7cCTBR3p3lSG/74UKvArCkVOSeSj5MFhD2aMlwFFNAC9LmIS9 TAmKUVImGRlieRNSIGsGfXLB+2rOaWSWTVxHxzBWXDo6+bzh7lOI9HunMEOouTQQzgxY n4jdRn8S0OsqLhTnbz/J4IJEMYz80/LslHBnE9b0cgAUeEC7OfWcVOPpe04IS2WtbF+3 ag== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2w5p3qh86b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 12 Nov 2019 00:09:24 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAC0902e047027 for ; Tue, 12 Nov 2019 00:09:24 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2w6r8k9sxj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 12 Nov 2019 00:09:24 +0000 Original-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xAC09J6p021312 for ; Tue, 12 Nov 2019 00:09:19 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4900.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9438 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 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-1910280000 definitions=main-1911120000 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9438 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 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-1910280000 definitions=main-1911120000 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 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:242096 Archived-At: >From (elisp) `Overlays': "An overlay uses markers to record its beginning and end." 1. You can create an overlay with `make-overlay', passing it markers. But the insertion types of those markers are not used for that overlay. Instead, you can specify those types for the overlay as optional `make-overlay' args. By default, text you insert at the beginning, but not at the end, of the overlay is included in the (extended) overlay. First question: Why, if you pass markers, isn't the default to use the insertion types of those markers? 2. `make-overlay' seems to be the only way to specify the insertion types for an overlay. Is that right, or did I miss something? `move-overlay' doesn't let you specify them, nor does `copy-overlay'. (And I don't see this being handled by `overlay-put'' - they are not overlay properties.) There are hook properties `insert-in-front-hooks' and `insert-behind-hooks'. But that's not the same. Second question: Why isn't there (or is there?) a simple way to change the "marker insertion types" of an existing overlay? Suppose you want to copy an existing overlay and then change some things in the copy. You can't change the insertion types for it, right? I guess you need to use `make-overlay', specifying insertion types, and then explicitly copy everything else from the first overlay. Is that right? 3. Similarly, the default BUFFER for `make-overlay' is the current buffer, even if you pass markers. Third question (similar to the first): Why, if you pass markers to `make-overlay', and you don't pass arg BUFFER, isn't the default to use the buffer of those markers? 4. (Repeating) "An overlay uses markers to record its beginning and end." It seems that an overlay "uses markers" but those aren't the markers you passed to `make-overlay'. Is that right? Fourth question (also similar to the first): Can you retrieve the markers that are "used by" an overlay, i.e., as markers? I don't see that you can. (`overlay-start' and `overlay-end', for example, don't give you markers.) You can of course create suitable (but separate) markers. (elisp) `Managing Overlays' says, about `move-overlay': "This is the only valid way to change the endpoints of an overlay. Do not try modifying the markers in ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the overlay by hand, as that fails to update other vital data structures and can cause some overlays to be lost." That makes me wonder. I don't even see how you could try to "modify the markers of the overlay" (with Lisp). How so? How to get those markers? I feel like I'm probably missing something here, but I don't notice it in the manual, doc strings, or Lisp code (only `remove-overlay' and `copy-overlay' are coded in Lisp, it seems). Do I understand the situation correctly? If so, what's the rationale for it? I'm guessing there are good reasons?