From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 24 20:28:55 2021 Received: (at submit) by debbugs.gnu.org; 25 Jul 2021 00:28:55 +0000 Received: from localhost ([127.0.0.1]:47230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7S0l-00038S-33 for submit@debbugs.gnu.org; Sat, 24 Jul 2021 20:28:55 -0400 Received: from lists.gnu.org ([209.51.188.17]:34380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7S0h-00038I-TJ for submit@debbugs.gnu.org; Sat, 24 Jul 2021 20:28:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7S0h-0007D6-MI for bug-gnu-emacs@gnu.org; Sat, 24 Jul 2021 20:28:51 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:45813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7S0e-0000Cq-Hs for bug-gnu-emacs@gnu.org; Sat, 24 Jul 2021 20:28:51 -0400 Received: (Authenticated sender: league@contrapunctus.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A8B0360002 for ; Sun, 25 Jul 2021 00:28:43 +0000 (UTC) From: Christopher League To: bug-gnu-emacs@gnu.org Subject: [PATCH] Unfontify previous location when overwriting bookmark Date: Sat, 24 Jul 2021 20:28:41 -0400 Message-ID: <875ywzkzie.fsf@contrapunctus.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=217.70.183.195; envelope-from=league@contrapunctus.net; helo=relay3-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This issue with =E2=80=98bookmark-fontify=E2=80=99 came up (within a broader discussion) on the list in May, in particular by Bastien in +message-id:<8735v0w5fv.fsf@bzg.fr>. It's obtrusive with the way =E2=80=98org-refile=E2=80=99 and =E2=80=98org-capture=E2=80=99 use bookmark= s, but still bothersome outside of org. It's not yet fixed in current master. To reproduce, make sure =E2=80=98bookmark-fontify=E2=80=99 is t (the defaul= t in master) and =E2=80=98bookmark-face=E2=80=99 is noticeable (orange backgroun= d by default). Then: emacs -Q ;; Visit any file with >20 lines, e.g.: M-x find-library RET bookmark RET ;; Set bookmark to current line C-x r m RET ;; Go elsewhere and overwrite same bookmark: C-u C-u C-n C-x r m RET When we set or jump to a bookmark, that line gets fontified in the buffer. Move down a few lines, and set the bookmark again with the same name. This will (by default) overwrite the previous location, but now *both* locations are displayed using bookmark-face. When a bookmark is deleted with =E2=80=98bookmark-delete=E2=80=99 or within =E2=80=98bookmark-bmenu-list=E2=80=99 (C-x r l), its location gets unfontif= ied. But when just overwritten, the font overlay remains. In the fix, I tried to split and edit the nearby comment for clarity as well. Feedback welcome, thanks. CL --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-When-bookmark-is-overwritten-unfontify-its-previous-.patch >From cd1539cb298372f47dc8160ff271e4d8a6f96012 Mon Sep 17 00:00:00 2001 From: Christopher League Date: Sat, 24 Jul 2021 18:17:07 -0400 Subject: [PATCH] When bookmark is overwritten, unfontify its previous position * lisp/bookmark.el (bookmark-store): When the bookmark-fontify option is non-nil, setting or jumping to bookmarks will colorize them using `bookmark-face'. With this change, overwriting a bookmark will remove the fontification at its former position. --- lisp/bookmark.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 52b96fd203..ff9b8ab138 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -561,10 +561,14 @@ old one." (set-text-properties 0 (length stripped-name) nil stripped-name) (if (and (not no-overwrite) (bookmark-get-bookmark stripped-name 'noerror)) - ;; already existing bookmark under that name and - ;; no prefix arg means just overwrite old bookmark - ;; Use the new (NAME . ALIST) format. - (setcdr (bookmark-get-bookmark stripped-name) alist) + ;; Already existing bookmark under that name and + ;; no prefix arg means just overwrite old bookmark. + (let ((bm (bookmark-get-bookmark stripped-name))) + ;; First clean up if previously location was fontified. + (when bookmark-fontify + (bookmark--unfontify bm)) + ;; Modify using the new (NAME . ALIST) format. + (setcdr bm alist)) ;; otherwise just cons it onto the front (either the bookmark ;; doesn't exist already, or there is no prefix arg. In either -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 25 03:38:45 2021 Received: (at 49725) by debbugs.gnu.org; 25 Jul 2021 07:38:45 +0000 Received: from localhost ([127.0.0.1]:47474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7Yij-0005Ys-Cj for submit@debbugs.gnu.org; Sun, 25 Jul 2021 03:38:45 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7Yig-0005Yc-NF for 49725@debbugs.gnu.org; Sun, 25 Jul 2021 03:38:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=BZWb/mFC3KjObWyY33Nz582sT4IxNOHTb+b1VjXwDN4=; b=VyZyFhvy6HrFIpTLXGO/1UtHyI rMolBGRaOkBPghfrDHSIJLaYfjZAy04T/2jcTBspgpAq2Pd/VF9i+haQouxOBZ/asNU8RoZe0UcPM 3wKoSzMfXyDt2jOBFXoFo9tNgK6aYD/kTXS2zitkLW+RuWhQm3l7Po03h8JUTTiMFgPM=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7YiY-0006ew-0W; Sun, 25 Jul 2021 09:38:36 +0200 From: Lars Ingebrigtsen To: Christopher League Subject: Re: bug#49725: [PATCH] Unfontify previous location when overwriting bookmark References: <875ywzkzie.fsf@contrapunctus.net> X-Now-Playing: Bobbie Gentry's _The Girl From Chickasaw County (6): Fancy_: "Fancy (Mono Radio Edit)" Date: Sun, 25 Jul 2021 09:38:33 +0200 In-Reply-To: <875ywzkzie.fsf@contrapunctus.net> (Christopher League's message of "Sat, 24 Jul 2021 20:28:41 -0400") Message-ID: <87wnpex2py.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Christopher League writes: > In the fix, I tried to split and edit the nearby comment for clarity > as well. Feedback welcome, thanks. Thanks; looks good to me (and pushed to Emacs 28). Does this also fix the related bug#49645? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49725 Cc: 49725@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Christopher League writes: > In the fix, I tried to split and edit the nearby comment for clarity > as well. Feedback welcome, thanks. Thanks; looks good to me (and pushed to Emacs 28). Does this also fix the related bug#49645? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 25 03:38:48 2021 Received: (at control) by debbugs.gnu.org; 25 Jul 2021 07:38:48 +0000 Received: from localhost ([127.0.0.1]:47477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7Yim-0005Z7-JS for submit@debbugs.gnu.org; Sun, 25 Jul 2021 03:38:48 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7Yil-0005Yj-Fc for control@debbugs.gnu.org; Sun, 25 Jul 2021 03:38:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UyuaKhDlWmzpBBQSz4/fuUv5QluWBuLe4DF0cF4k1QA=; b=Ey8QF/9gqFVPaRVT45aDonPdb5 5DhDD4KMHC+MspDmWNzVRMVOhOSkVZtwQbcLVq4/PMEXrPc6iXRAOwRYxQ7xYoWklv+BilY2wakvC wTEOGgyMqam7mltqAap4jQDbTNIWFJtnAiO3piXzsekF7mbORyssIz1DhE5fZt43LKFc=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7Yid-0006f3-SW for control@debbugs.gnu.org; Sun, 25 Jul 2021 09:38:41 +0200 Date: Sun, 25 Jul 2021 09:38:39 +0200 Message-Id: <87v94yx2ps.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49725 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 49725 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 49725 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 25 10:18:54 2021 Received: (at 49725) by debbugs.gnu.org; 25 Jul 2021 14:18:54 +0000 Received: from localhost ([127.0.0.1]:49090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7exy-0005hC-2r for submit@debbugs.gnu.org; Sun, 25 Jul 2021 10:18:54 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:57575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7exv-0005gx-Rm for 49725@debbugs.gnu.org; Sun, 25 Jul 2021 10:18:52 -0400 Received: (Authenticated sender: league@contrapunctus.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 97141C0002; Sun, 25 Jul 2021 14:18:44 +0000 (UTC) From: Christopher League To: Lars Ingebrigtsen Subject: Re: bug#49725: [PATCH] Unfontify previous location when overwriting bookmark In-Reply-To: <87wnpex2py.fsf@gnus.org> References: <875ywzkzie.fsf@contrapunctus.net> <87wnpex2py.fsf@gnus.org> Date: Sun, 25 Jul 2021 10:18:43 -0400 Message-ID: <871r7mlbng.fsf@contrapunctus.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49725 Cc: 49725@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Lars Ingebrigtsen writes: > Thanks; looks good to me (and pushed to Emacs 28). Does this > also fix the related bug#49645? Oh, I missed that! Found the discussion from May, but not that report a few days ago. I think it must fix that, though Marius describes that the highlighting gets stuck "when deleting bookmarks", which I think was working before my patch, which only applies to overwrites. >From what I can tell, the call to =E2=80=98bookmark--unfontify=E2=80=99 ins= ide =E2=80=98bookmark-delete=E2=80=99 dates to 4 May, in the same commit when =E2=80=98bookmark-fontify=E2=80=99 option was introduced. But maybe he was accumulating bookmarks due to overwrites and misattributed it. I'll reply on that report to confirm. CL From unknown Fri Aug 15 03:56:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 23 Aug 2021 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator