From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#19422: 25.0.50; `remove-overlays` needs one additional `point` at end of narrowed region. Date: Sun, 21 Dec 2014 09:42:36 -0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1419183807 22045 80.91.229.3 (21 Dec 2014 17:43:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Dec 2014 17:43:27 +0000 (UTC) Cc: 19422@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 21 18:43:20 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y2kXI-0008Qg-GN for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Dec 2014 18:43:20 +0100 Original-Received: from localhost ([::1]:37920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2kXH-00053y-PW for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Dec 2014 12:43:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2kX7-00053q-KJ for bug-gnu-emacs@gnu.org; Sun, 21 Dec 2014 12:43:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2kX0-0007b2-Tp for bug-gnu-emacs@gnu.org; Sun, 21 Dec 2014 12:43:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2kX0-0007ah-QT for bug-gnu-emacs@gnu.org; Sun, 21 Dec 2014 12:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y2kX0-0002yM-DF for bug-gnu-emacs@gnu.org; Sun, 21 Dec 2014 12:43:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Dec 2014 17:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19422 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19422-submit@debbugs.gnu.org id=B19422.141918376211402 (code B ref 19422); Sun, 21 Dec 2014 17:43:02 +0000 Original-Received: (at 19422) by debbugs.gnu.org; 21 Dec 2014 17:42:42 +0000 Original-Received: from localhost ([127.0.0.1]:53997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y2kWg-0002xp-9U for submit@debbugs.gnu.org; Sun, 21 Dec 2014 12:42:42 -0500 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:55692) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y2kWc-0002xf-9O for 19422@debbugs.gnu.org; Sun, 21 Dec 2014 12:42:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=asBD8zqBMGE7+cjlbs8jfDOttaaT66NI3HfqRYNZXV8=; b=L5EAnhRPvQlTNTt8/0dmk8ebDt3upSk9WvoSWvzS6t/4baeRq3h45MSq0wrvFfYb10eVLdlh0Kq5AZHfdxG1ev7FaRMcubZrMyQEYwp9HCrIAArJ+R0WGJtu62z4Go3g; Original-Received: from cpe-104-173-54-60.socal.res.rr.com ([104.173.54.60]:49451 helo=MP.local) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1Y2kWZ-0000LT-RR; Sun, 21 Dec 2014 12:42:36 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97648 Archived-At: In my particular use case, I am narrowing to a region and then inserting an `after-string` overlay at `point-max`: (overlay-put (make-overlay (point-max) (point-max)) 'after-string "|") I have a minor mode that draws a vertical line that tracks the cursor position and I extend that to window-end or point-max. The end of the buffer has a different color and a different character overlay depending upon where `point` is --- a leading cushion is used if the vertical column extends beyond the point at the end of the line. And here is the slightly revised function that I am using to remove it. It differs a little bit from the version in my initial bug report number 19422: (defun lawlist-remove-overlays (beg end name val) "Remove the overlays." ;; DEBUGGING ;; (unless (and beg end name val) ;; (message "ERROR -- beg: %s | end: %s | name: %s | val: %s" beg end name val)) (let* ( (point-max (point-max)) (point-min (point-min)) (narrowed-p (not (equal (- point-max point-min) (buffer-size)))) (beg (if beg beg point-min)) (end (cond ((and (not narrowed-p) end) end) ((and (not narrowed-p) (null end)) point-max) ((and narrowed-p end (< end point-max)) end) ((and narrowed-p end (= end point-max)) (1+ end)) ((and narrowed-p (null end)) (1+ point-max)) ))) (when (and beg end name val) (overlay-recenter end) (dolist (o (overlays-in beg end)) (when (eq (overlay-get o name) val) (delete-overlay o)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; At Sun, 21 Dec 2014 18:45:06 +0200, Eli Zaretskii wrote: > > > Date: Sun, 21 Dec 2014 00:39:44 -0800 > > From: Keith David Bershatsky > > > > The function `remove-overlays`, when used without any arguments, needs one additional `point` at the end of a narrowed region to effectively remove an overlay at the very end of said region. > > Maybe I'm confused, but what do you mean by "overlay at the very end > of region"? Overlay that starts at END is not part of the region, > AFAIU.