From unknown Fri Aug 15 02:01:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45946 <45946@debbugs.gnu.org> To: bug#45946 <45946@debbugs.gnu.org> Subject: Status: 28.0.50; hl-line-sticky-flag not working Reply-To: bug#45946 <45946@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:01:55 +0000 retitle 45946 28.0.50; hl-line-sticky-flag not working reassign 45946 emacs submitter 45946 Gabriel do Nascimento Ribeiro severity 45946 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 17 23:28:52 2021 Received: (at submit) by debbugs.gnu.org; 18 Jan 2021 04:28:53 +0000 Received: from localhost ([127.0.0.1]:46086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1M9s-0000vM-Ev for submit@debbugs.gnu.org; Sun, 17 Jan 2021 23:28:52 -0500 Received: from lists.gnu.org ([209.51.188.17]:54248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1M9q-0000vC-JV for submit@debbugs.gnu.org; Sun, 17 Jan 2021 23:28:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1M9p-00076J-V6 for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2021 23:28:50 -0500 Received: from mail-dm6nam11olkn2093.outbound.protection.outlook.com ([40.92.19.93]:56768 helo=NAM11-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1M9n-0004xv-JE for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2021 23:28:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bU1IubjubVI6G3Z/QHTEjggujoMO14v0HDdCSDfYMLELUQ5UGzmfzGVYoYTCtpoEGHwnC/yPVxPN/QlgjsEy1ah2z0SLVKlmOIB4hFFBnjUR5I/WKdetw+RA7pjl6WNIed5IddL5p/iboSvh8fm+GcXlMYbD9p8DAVKKIY+Un+oaS3U4tIBNq3v2WOLi58yMLtS7mQyq7/swguHPcwOZURmbmAGcX2HFYT403Nl8OWy/J02DE3bRTL2zjcBYxxZMsG+Cch/il1MgxUMWymV5h/gR0g36/i71H2Ef2wlzHyMDic2k6ysO+yLrBWuB7IS2YTJcQqbbZ9HSOXBr6odtpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xfGgcmIFHmrEhHKiIYVothgSCppU5T/hWP5R+IfUg8s=; b=bW1NW7lRrRnGp63Nt6JEyJkJliK2LITXlIiBgNZbtYt5+R+RmtGLoJyWZ3n4eBZxNlRWiKe1iCo/bu2qXy0rBqbBWJ/7922xI44OSjBocqUPt2qANVmuqdhQnYv3zVCucVyGIbKlFOcesSqQWkWCJMhxFvAg7uXVHWwucgCgfiQOg0NDFLOUiS4iJbzPMocUee0jOutFPpMZqfJ1GrKyN8s+ngS8dHqdWSV3l4FI19WN5uPQgBHaO2XxXqPYsXfxWg62cwc+2FxKZcbfukj2RCONm+0d/QO25uA4vuBJvVSb7/pWTPB7DMaVz1x+Aeks9ruIIuJ6qQKSnaeDn4L1ww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xfGgcmIFHmrEhHKiIYVothgSCppU5T/hWP5R+IfUg8s=; b=U3ScEloo0dOZz4Jm3b+XOmRhxkUpeDy2ellLMFw0xOoxN+ILRLvvRV5T723vyedqkmq+RJ0cY0SoyTmyl7vN6hx+a7shM5PrJz7Kv/39kvG7578bg/pCq734zdciCym4tG1x41GisCtI8vnDDU1Sujvnr7EFTQ0wV6bsLRh27+/9DXOQ+mXzR3TYQGVlXtkkXJEHLtRxf8uWpllHVSlQoVx+3QtvK6jEKir2wRJPYpDbR28OZoozl1MFUyJmSLGPtOgdbyWOeY38uQO3dY4FTLzqnocTBdadE2RkAHC0ZLPqHe79TzEQbxTtW327tBNu6pfehSECgjAgUKzTdvCtNA== Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::49) by DM6NAM11HT101.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::438) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Mon, 18 Jan 2021 04:13:43 +0000 Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:fc4d::45) by DM6NAM11FT024.mail.protection.outlook.com (2a01:111:e400:fc4d::159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.12 via Frontend Transport; Mon, 18 Jan 2021 04:13:43 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:9477DF38046ACC0CF2E2988A4D88E2EB9DF28DE89E752546B837EF1B8AA5762A; UpperCasedChecksum:047E1B1CF3964733DECE9CB1DE665012B8088EA73E9217FF9B3CB0CEBFCE43C7; SizeAsReceived:7205; Count:42 Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac%7]) with mapi id 15.20.3763.014; Mon, 18 Jan 2021 04:13:43 +0000 From: Gabriel do Nascimento Ribeiro To: bug-gnu-emacs@gnu.org Subject: 28.0.50; hl-line-sticky-flag not working Date: Mon, 18 Jan 2021 01:13:38 -0300 Message-ID: Content-Type: text/plain X-TMN: [UhIVSqHoZQap+++rAcGdTA0Aj/Czeu1LXuifRYpP0VdReHBqHZC+0gKrE2sXTYAW] X-ClientProxiedBy: CP2P215CA0025.LAMP215.PROD.OUTLOOK.COM (2603:10d6:102:2::11) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <878s8qlw5p.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from precision5540 (2804:431:c7f3:af8f:64a4:42ac:4360:beab) by CP2P215CA0025.LAMP215.PROD.OUTLOOK.COM (2603:10d6:102:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9 via Frontend Transport; Mon, 18 Jan 2021 04:13:42 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 42 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 8831529c-5dcb-4df3-e998-08d8bb67715d X-MS-TrafficTypeDiagnostic: DM6NAM11HT101: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +RgNJJVSpSGd3EWBwrUf9k77U1TGNba0S2sfW77soEzxzDll/sQUtq7kqMXSOpGis3TgeYGDqV82oMl1HJ0jOeT2kr611Skw+eyjGQLyJD0TvwfZmKGeC6DaAVMJHeQzCn5qcxZdrzXoeLwJ1YG+l/a160nuYfzVwAyh00v1bYc7MJE0oBsrmi0n32VnMDvd5KIsOrHsVAcx3b9PdT/khXmSFlplPumyW8dAO2mzobfzP2qmWCr/Y+Pp/hPY20XB X-MS-Exchange-AntiSpam-MessageData: VNApm5IEp00Nx4NzPdam0XAPmHcY5tBTvVWcWNJtqHA3A9z47MopzO8Q6dMM7o13xaNI6VSUQMFqPe72Tms/KEq9Z9rAv8FY93RJQc6k6NDS23rok7yj+wPdvtERWXoxNGGLCbLPH4WtldDa82JoxaN3EOUBGvn17aPD/ZcUPy7fqATdPeEu+xQtG9xT+sYnlIe1NTfeR973Xgxl2feI8A== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8831529c-5dcb-4df3-e998-08d8bb67715d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 04:13:43.6007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT101 Received-SPF: pass client-ip=40.92.19.93; envelope-from=gabriel376@hotmail.com; helo=NAM11-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.4 (/) 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.1 (--) 1) emacs -q # start emacs 2) C-x 3 # split window right 3) C-x # go to previous buffer (*scratch*) 4) eval the following expression: (setq-default hl-line-sticky-flag nil) 5) M-x hl-line-mode # enable hl-line-mode in current buffer 6) C-x o # other window (*GNU Emacs*) 7) M-x hl-line-mode # enable hl-line-mode in current buffer 8) C-x o multiple times to change the selected window Expected result: the line is highlighted only in selected window Actual result: sometimes the line in non-selected window is not unhighlighted --- In GNU Emacs 28.0.50 (build 39, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0) of 2021-01-16 built on precision5540 Repository revision: 25e1b732947bcba51e457a7168eba6608fb666c0 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Ubuntu 20.10 Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LCMS2 LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LC_CTYPE: pt_BR.UTF-8 value of $LC_MONETARY: pt_BR.UTF-8 value of $LC_NUMERIC: pt_BR.UTF-8 value of $LC_TIME: pt_BR.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort emacsbug mail-extr cursor-sensor nndraft nnmh utf-7 gnutls network-stream nsm nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache smtpmail sendmail misearch multi-isearch rx org-element avl-tree generator ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt speedbar ezimage dframe gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr kinsoku svg dom browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars mailcap gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message rmc puny rfc822 mml mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr wid-edit ol-docview doc-view image-mode exif dired dired-loaddefs ol-bibtex bibtex iso8601 ol-bbdb ol-w3m org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-color ring org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat advice org-macs org-loaddefs format-spec cal-menu calendar cal-loaddefs vc-git diff-mode easy-mmode conf-mode dabbrev jka-compr find-func cl-print time-date subr-x cl-extra shortdoc text-property-search seq byte-opt gv bytecomp byte-compile cconv hl-line thingatpt help-fns radix-tree help-mode easymenu cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 216767 12349) (symbols 48 22643 1) (strings 32 76291 2945) (string-bytes 1 2499291) (vectors 16 35895) (vector-slots 8 445907 18792) (floats 8 315 136) (intervals 56 1217 0) (buffers 984 24)) From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 20 20:22:50 2021 Received: (at submit) by debbugs.gnu.org; 21 Jan 2021 01:22:50 +0000 Received: from localhost ([127.0.0.1]:56513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l2OgU-00088r-7C for submit@debbugs.gnu.org; Wed, 20 Jan 2021 20:22:50 -0500 Received: from lists.gnu.org ([209.51.188.17]:35488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l2OgR-00088i-SK for submit@debbugs.gnu.org; Wed, 20 Jan 2021 20:22:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2OgR-0007zc-Mp for bug-gnu-emacs@gnu.org; Wed, 20 Jan 2021 20:22:47 -0500 Received: from mail-dm6nam12olkn2020.outbound.protection.outlook.com ([40.92.22.20]:3008 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2OgO-0004Ta-6H for bug-gnu-emacs@gnu.org; Wed, 20 Jan 2021 20:22:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XUUXABbJh0S3oCX9MQGOvVrF1Mg87iun17CbAUHDuda4HoyKiXLrmxgsaX+2rQT9eWV+Uh6BtGwEhGUrkZzfoZ6sDLLz/zIEkW32WdpB+u0Bc7g64+6kWe9It2xnshWupM680cescXI3E5JomCt+Snl2zSpZ+wS08aAYA8I7W8G69PoCYXc/mzQlF6OeOdyl2w+MLr9dOmkPoTZHEIT8lAW5sV1J54/hfyzcWs+9AgS19rTqAztRvXHS7+pvJt9BQgImSPrkIOQNwGdkaq/d4Naf6W5tH+kSUvuquF/TvAAxE/oaXSrdrHeveVcdDClg7uo6Nvh3mtkmpX7y4SFevw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QNr8pt9LZWfsGTr/Ve1WvRiP4k3tzKcIqXcPrjMdeZA=; b=Lq5Ld5lByLjR63e7YrrXwCv6akfjX+f+z4+bF+I+HWL5zxN+/jj+K1w5qITc4jUP9QYo1ot4hi7OD9e+pcOoFvpIL4B0+8sqidWDciatTtV2quobL+2Q32sBQScsVRMio8WpfVPJzatBzF+BI1xzeivtkTwjPjrYytuIO4EmbDpUI40TBKKPq6592v2HQxJ04MnKMf2D2Af9L5yk0FB0zzPd0WoRBuCwqAQTfNWUzveqjO7CVf3+CY29v0fEn/avpRbkTSicDMJY0wj8Uy9UH/MzQ4nz8TKCAJ1pzi3n+xCkapOPxUENBMWw4qmll4Tp5WHz57Sq2kC8MpoUZ8LG3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QNr8pt9LZWfsGTr/Ve1WvRiP4k3tzKcIqXcPrjMdeZA=; b=S8FvihsJkOWyCnpBVUKB8ViAG4RvA6B8ynustAYDFKiryTiY/f8UEBlerSgaYH4GVLXB9KzKLU2oHfovu7jpbtfLJfynNGWKYd8uO6sHQrzRuaGAVsxTB+10I2/Ug0FTf5LCUGmpZIZu5mSv4Ex1uC9z1SbS7vsHzWDlXeyknT10Hu0tPhrQRirwrKJZRynBoQEmd1S8+LZ5JXw8/1YJ7QAsMOKPdvELVAydeOBYFXoBflMd42OIGS7Fx+IjR6mbm+JrW8KYxCumemiaDBN7YRTvYrtj7uRo1G4zHGDcM+k3XvvLLna4iCPcUBmVqTUGyKUsUTCWq6wL/iR+yvGg2g== Received: from BN8NAM12FT019.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc66::4b) by BN8NAM12HT033.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc66::90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.6; Thu, 21 Jan 2021 01:07:38 +0000 Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:fc66::43) by BN8NAM12FT019.mail.protection.outlook.com (2a01:111:e400:fc66::416) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.6 via Frontend Transport; Thu, 21 Jan 2021 01:07:38 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:0B850855CE51066E26ACCB1F9D6AD96627E08AB77973D092F3DA5F18DA4C3EA1; UpperCasedChecksum:0FB919E12B26306BBD1E1344C1D2FF95A8BCA14EA6834300183CB507500C70A4; SizeAsReceived:7601; Count:45 Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac%7]) with mapi id 15.20.3763.014; Thu, 21 Jan 2021 01:07:38 +0000 From: Gabriel do Nascimento Ribeiro To: bug-gnu-emacs@gnu.org Subject: [PATCH] Re: bug#45946: 28.0.50; hl-line-sticky-flag not working References: Date: Wed, 20 Jan 2021 22:07:33 -0300 In-Reply-To: (Gabriel do Nascimento Ribeiro's message of "Mon, 18 Jan 2021 01:13:38 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [soK2N1tobqCBSu8xlleoibPL//VxHQQyhEiz0sCeHjbLb3AujP8DZ2pFtgtNQ+ka] X-ClientProxiedBy: CP2PR80CA0187.lamprd80.prod.outlook.com (2603:10d6:102:15::29) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <87y2gnksh6.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from precision5540 (2804:431:c7f3:76d5:a497:b83e:37c5:74e) by CP2PR80CA0187.lamprd80.prod.outlook.com (2603:10d6:102:15::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Thu, 21 Jan 2021 01:07:36 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 65ae01eb-9666-410a-7911-08d8bda8f160 X-MS-TrafficTypeDiagnostic: BN8NAM12HT033: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 13jzOvxAm+n5MgnHAi4b6Q3fO+61OzjR9BBbS8zvyNM9/+RTFRL9MNeFmJ5q8cUk5Xxb5MtLQj3l/9hsRkHNosdiu0LK5YKBghVXOkfA2AS+YI6gjC7Ek3bTfyRQx43hz1/zE4KZDmK43TcO2ZUB6Va/3FNwfqP3FzXQ2uY+c0UORwEy7/Lv0aP/mnpTrY6To27DdN2GfYJj62chFSSDFdIYIyTRIUTkNFQKJs6PftMRTZTtG1lQ5RH+9maR1krt X-MS-Exchange-AntiSpam-MessageData: 8vwvaY0dPafuUw4uH7e0OJGGv81jg2LsXZ4SgZpJ2NjXwyXYb4oXEiTfxow7qyZcN/wRMmqXUqTMJ1rMOOOj/qBcEUwUSF7Hr+C3VZYpGPhEhPP0x3cx9Dj8bGEvVXRX2GKDq3xT9srAeqGNBWHpRsIdHhZgqDSrquu8VwjKghdeQ7g8f79CTwZBEQG3mJ8E5KqRUx+TM3y2kv68en58BQ== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65ae01eb-9666-410a-7911-08d8bda8f160 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2021 01:07:38.1837 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT019.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM12HT033 Received-SPF: pass client-ip=40.92.22.20; envelope-from=gabriel376@hotmail.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) 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.1 (--) --=-=-= Content-Type: text/plain Here is a proposal of patch for this bug. It seems to work well in all cases I have tested, but maybe I am missing some edge case. Suggestions are welcome. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Always-set-overlay-current-buffer-on-hl-line-maybe-u.patch >From f4586cd7f535a9613216f61888a5ab8ee05352ca Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Wed, 20 Jan 2021 22:02:31 -0300 Subject: [PATCH] Always set overlay current-buffer on hl-line-maybe-unhighlight --- lisp/hl-line.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 73870f9579..b19b9543f5 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -193,8 +193,7 @@ hl-line-maybe-unhighlight (with-current-buffer hlob (when (overlayp hl-line-overlay) (delete-overlay hl-line-overlay)))) - (when (and (overlayp hl-line-overlay) - (eq (overlay-buffer hl-line-overlay) curbuf)) + (when (overlayp hl-line-overlay) (setq hl-line-overlay-buffer curbuf)))) ;;;###autoload -- 2.27.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 21 09:13:45 2021 Received: (at 45946) by debbugs.gnu.org; 21 Jan 2021 14:13:45 +0000 Received: from localhost ([127.0.0.1]:57172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l2aiX-00049s-9c for submit@debbugs.gnu.org; Thu, 21 Jan 2021 09:13:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l2aiV-00049c-Oy for 45946@debbugs.gnu.org; Thu, 21 Jan 2021 09:13:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42233) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2aiQ-0005rz-Hh; Thu, 21 Jan 2021 09:13:38 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1782 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l2aiP-0006f3-9Y; Thu, 21 Jan 2021 09:13:37 -0500 Date: Thu, 21 Jan 2021 16:13:52 +0200 Message-Id: <83bldi74yn.fsf@gnu.org> From: Eli Zaretskii To: Gabriel do Nascimento Ribeiro In-Reply-To: (message from Gabriel do Nascimento Ribeiro on Wed, 20 Jan 2021 22:07:33 -0300) Subject: Re: bug#45946: [PATCH] Re: bug#45946: 28.0.50; hl-line-sticky-flag not working References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45946 Cc: 45946@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 (---) > From: Gabriel do Nascimento Ribeiro > Date: Wed, 20 Jan 2021 22:07:33 -0300 > > Here is a proposal of patch for this bug. It seems to work well in all > cases I have tested, but maybe I am missing some edge case. Suggestions > are welcome. Thanks. While at that, would it be possible to fix some code there that I at least consider strange? E.g., it calls delete-overlay, but doesn't assign nil to the variable, so the overlayp predicate still returns non-nil for the resulting invalid overlay. Also, it puts 2 functions on the post-command-hook, but it looks like the code subtly depends on the order of their execution (should hl-line-highlight run before or after hl-line-maybe-unhighlight?). From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 22 21:37:38 2021 Received: (at submit) by debbugs.gnu.org; 23 Jan 2021 02:37:38 +0000 Received: from localhost ([127.0.0.1]:33481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l38nx-000152-FS for submit@debbugs.gnu.org; Fri, 22 Jan 2021 21:37:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:54646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l38nt-00014s-2X for submit@debbugs.gnu.org; Fri, 22 Jan 2021 21:37:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l38ns-0006vO-Qz for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2021 21:37:32 -0500 Received: from mail-mw2nam10olkn2030.outbound.protection.outlook.com ([40.92.42.30]:46176 helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l38nq-0000H1-Ha for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2021 21:37:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FVehs/5JmiUJTKSWzSr3jMN8IemTiOjriCifFToWzezU9ZUoUv7J6aSJP35lWwPmWPSxYfc2ylUQEwDGAchhpdZj6MYKs4ExR2NAC1mRJ/pQMFUATFs4ouct004RWzP+Jisr8Aa6vFfBrxTo8cGGRQYpTl8iamZYzx6/IZbkyEAgAxvzXxdn+m1oeHIxw1WDflT27dYx3ISJwdxybRv8faP7Ddn/gtarT4tnlyuhTYmLcTot0FsArbor1IcbER4yics0aNU97D49FEQW/8fOiJeGCN53FqkDPKBoo8nF69dfqQXbfsXFaWwfuTNaiOutPx252B42rlnwzmJ8IJVT0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=upLb+nBqYrulzKAcMAlhS8cYLFxwPTZYkooe9k6NJWQ=; b=ObzAQBGSGbVM0dimuA6Z+qsFZmzl9mOJ8yyz2tpN6BSL3CGOvlb9wFSkKMz0ukXdkIrnPCT6inNvWERRYAcOUAAAzbHqWXd+VTBMAPN4l8ELHSdEu0KbwNYXWIej808oS9nwlJjnCwnJiskc2zoBahpkgwC7QjC5whngNqGHmkIVdwQ3bTza8ZT07nLY9p4XtAg7wHwGQ8ZE393bJfdLSUYO482tQnw9XOO116u9mRikgcooHIvgddCSHg5iR6tA7B2PMNBx9HtNUFUpi2VFtN5aKLDB7vr/cNb3yYqQv2/bRHvGE1oIbTucBVZGCwh6Z1U0DJ1dLwAs8BlvXbmw7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=upLb+nBqYrulzKAcMAlhS8cYLFxwPTZYkooe9k6NJWQ=; b=QrJT9Z6VHnF5dzl3iqF6hdIx+WafW3r7wVTAIIeFjyiTXQvrH6GVYVtMgtXP41QuObHyVRpMML8epT2DPVuinZMsGMxpmtkXjkpzXb8hsQNiJGHCNapDX51tFf4FLs4WDEZqi6YIyDiH3RmvmBS0cUt2/ECZcN5eGwC3ZnWoMpyD3xqXPw6a2tLzSMBc5M5RA8kvhntmcr+igjoGi8Zv1JlV1pExNc4q5uKTx2SoEBwvhEgt5O+HUb0UKyUxnudeHmexz5Hd9sSUt/S1tj6+jm/DzHzVobynAN7pqwjIJQOCuHKZYL2U2JHsPsjKr4MzfXORr0G4S0MNtchTKgRIIQ== Received: from DM6NAM10FT020.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::42) by DM6NAM10HT119.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::333) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11; Sat, 23 Jan 2021 02:22:27 +0000 Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:7e86::45) by DM6NAM10FT020.mail.protection.outlook.com (2a01:111:e400:7e86::115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Sat, 23 Jan 2021 02:22:27 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:EC4DA1F55829060D9596B3E8D8BCD15712B843733AF2B9AFD9F5B5C89D11F988; UpperCasedChecksum:3D061C663327EBAFF3680CD1378A13DDF418E3314683CB44BD0E996A6BF449B1; SizeAsReceived:7656; Count:45 Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac%7]) with mapi id 15.20.3763.014; Sat, 23 Jan 2021 02:22:27 +0000 From: Gabriel do Nascimento Ribeiro To: bug-gnu-emacs@gnu.org Subject: [PATCH] Re: bug#45946: 28.0.50; hl-line-sticky-flag not working References: <83bldi74yn.fsf@gnu.org> Date: Fri, 22 Jan 2021 23:22:21 -0300 In-Reply-To: <83bldi74yn.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 21 Jan 2021 16:13:52 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [mnMGt7bqu2/QZhGjk2vMqduNbiLT0nm5oNK6yVM8th/UQ6LN26utlxJ/aJl3S7Ld] X-ClientProxiedBy: CPYP284CA0006.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:68::11) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <8735yspf36.fsf_-_@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from precision5540 (2804:431:c7f3:76d5:a5da:d562:8946:2579) by CPYP284CA0006.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:68::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Sat, 23 Jan 2021 02:22:25 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 6ff95599-2652-4e73-d374-08d8bf45b9e5 X-MS-TrafficTypeDiagnostic: DM6NAM10HT119: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N1Rj0tJpYA6icX5xmuSeMHxxMtoZ5DCrd7VTZcyLVeAM1YNwiAEREYxRuDcbwoECTQNp3uxhNOG3j/BAB8m3GBnxdsMWxBEjOJtr8VLpw1E5OHnSc99qEygQ7DtMt2D6nU+ppMTKQX6GJlyYh03+fEhm4EmHfcx/zn2IScyalPFYx7XVx/loza/sWis9/jRdIfF2SUOoh1+I23uc3oNbb8uVcsnIbgVzZ9s1wSpGnQbGsODsyGUS4mCX19VhZK7x X-MS-Exchange-AntiSpam-MessageData: OdsgcswFLZujvAOGo1Optr2G56Etd3O3PIRfSWj9EM7POddey8fmNvlBtro68twxelpV8I1NvXbpjdUK/NTSG4bFunXjrEBAcCgJhczw50Z67B9455HWQg0BZFjer3WfWxWZWb/ZO8bh/3A2ceMXvp7JZK158zqRqoEpmP/j/3lb62cKjiHyxCEIFRHY8tJXiTuos3ynE463byglrGoFUg== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ff95599-2652-4e73-d374-08d8bf45b9e5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2021 02:22:27.2786 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM10FT020.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM10HT119 Received-SPF: pass client-ip=40.92.42.30; envelope-from=gabriel376@hotmail.com; helo=NAM10-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) 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.1 (--) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Gabriel do Nascimento Ribeiro >> Date: Wed, 20 Jan 2021 22:07:33 -0300 >> >> Here is a proposal of patch for this bug. It seems to work well in all >> cases I have tested, but maybe I am missing some edge case. Suggestions >> are welcome. > > Thanks. > > While at that, would it be possible to fix some code there that I at > least consider strange? E.g., it calls delete-overlay, but doesn't > assign nil to the variable, so the overlayp predicate still returns > non-nil for the resulting invalid overlay. Also, it puts 2 functions > on the post-command-hook, but it looks like the code subtly depends on > the order of their execution (should hl-line-highlight run before or > after hl-line-maybe-unhighlight?). Hi Eli, Thanks for your suggestions. Please find attached a new patch that uses a single post-command-hook function and some other minor changes. The original issue is fixed. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Use-single-post-command-hook-on-hl-line.patch >From 980504403e41164fef79806781eff84e05760463 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Fri, 22 Jan 2021 23:05:17 -0300 Subject: [PATCH] Use single post-command-hook on hl-line --- lisp/hl-line.el | 58 +++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 73870f9579..82952e934b 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -45,11 +45,7 @@ ;; An overlay is used. In the non-sticky cases, this overlay is ;; active only on the selected window. A hook is added to ;; `post-command-hook' to activate the overlay and move it to the line -;; about point. To get the non-sticky behavior, `hl-line-unhighlight' -;; is added to `pre-command-hook' as well. This function deactivates -;; the overlay unconditionally in case the command changes the -;; selected window. (It does so rather than keeping track of changes -;; in the selected window). +;; about point. ;; You could make variable `global-hl-line-mode' buffer-local and set ;; it to nil to avoid highlighting specific buffers, when the global @@ -91,9 +87,9 @@ hl-line-face (set symbol value) (dolist (buffer (buffer-list)) (with-current-buffer buffer - (when hl-line-overlay + (when (overlayp hl-line-overlay) (overlay-put hl-line-overlay 'face hl-line-face)))) - (when global-hl-line-overlay + (when (overlayp global-hl-line-overlay) (overlay-put global-hl-line-overlay 'face hl-line-face)))) (defcustom hl-line-sticky-flag t @@ -141,9 +137,7 @@ hl-line-mode `hl-line-highlight' on `post-command-hook' in this case. When `hl-line-sticky-flag' is nil, Hl-Line mode highlights the -line about point in the selected window only. In this case, it -uses the function `hl-line-maybe-unhighlight' in -addition to `hl-line-highlight' on `post-command-hook'." +line about point in the selected window only." :group 'hl-line (if hl-line-mode (progn @@ -151,12 +145,10 @@ hl-line-mode (add-hook 'change-major-mode-hook #'hl-line-unhighlight nil t) (hl-line-highlight) (setq hl-line-overlay-buffer (current-buffer)) - (add-hook 'post-command-hook #'hl-line-highlight nil t) - (add-hook 'post-command-hook #'hl-line-maybe-unhighlight nil t)) + (add-hook 'post-command-hook #'hl-line-highlight nil t)) (remove-hook 'post-command-hook #'hl-line-highlight t) (hl-line-unhighlight) - (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t) - (remove-hook 'post-command-hook #'hl-line-maybe-unhighlight t))) + (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t))) (defun hl-line-make-overlay () (let ((ol (make-overlay (point) (point)))) @@ -168,17 +160,19 @@ hl-line-highlight "Activate the Hl-Line overlay on the current line." (if hl-line-mode ; Might be changed outside the mode function. (progn - (unless hl-line-overlay + (unless (overlayp hl-line-overlay) (setq hl-line-overlay (hl-line-make-overlay))) ; To be moved. (overlay-put hl-line-overlay 'window (unless hl-line-sticky-flag (selected-window))) - (hl-line-move hl-line-overlay)) + (hl-line-move hl-line-overlay) + (hl-line-maybe-unhighlight)) (hl-line-unhighlight))) (defun hl-line-unhighlight () "Deactivate the Hl-Line overlay on the current line." - (when hl-line-overlay - (delete-overlay hl-line-overlay))) + (when (overlayp hl-line-overlay) + (delete-overlay hl-line-overlay) + (setq hl-line-overlay nil))) (defun hl-line-maybe-unhighlight () "Maybe deactivate the Hl-Line overlay on the current line. @@ -191,8 +185,7 @@ hl-line-maybe-unhighlight (not (eq curbuf hlob)) (not (minibufferp))) (with-current-buffer hlob - (when (overlayp hl-line-overlay) - (delete-overlay hl-line-overlay)))) + (hl-line-unhighlight))) (when (and (overlayp hl-line-overlay) (eq (overlay-buffer hl-line-overlay) curbuf)) (setq hl-line-overlay-buffer curbuf)))) @@ -205,8 +198,8 @@ global-hl-line-mode highlights the line about the current buffer's point in all live windows. -Global-Hl-Line mode uses the functions `global-hl-line-highlight' -and `global-hl-line-maybe-unhighlight' on `post-command-hook'." +Global-Hl-Line mode uses the function `global-hl-line-highlight' +on `post-command-hook'." :global t :group 'hl-line (if global-hl-line-mode @@ -214,25 +207,24 @@ global-hl-line-mode ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'global-hl-line-unhighlight) (global-hl-line-highlight-all) - (add-hook 'post-command-hook #'global-hl-line-highlight) - (add-hook 'post-command-hook #'global-hl-line-maybe-unhighlight)) + (add-hook 'post-command-hook #'global-hl-line-highlight)) (global-hl-line-unhighlight-all) (remove-hook 'post-command-hook #'global-hl-line-highlight) - (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight) - (remove-hook 'post-command-hook #'global-hl-line-maybe-unhighlight))) + (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight))) (defun global-hl-line-highlight () "Highlight the current line in the current window." (when global-hl-line-mode ; Might be changed outside the mode function. (unless (window-minibuffer-p) - (unless global-hl-line-overlay + (unless (overlayp global-hl-line-overlay) (setq global-hl-line-overlay (hl-line-make-overlay))) ; To be moved. (unless (member global-hl-line-overlay global-hl-line-overlays) (push global-hl-line-overlay global-hl-line-overlays)) (overlay-put global-hl-line-overlay 'window (unless global-hl-line-sticky-flag (selected-window))) - (hl-line-move global-hl-line-overlay)))) + (hl-line-move global-hl-line-overlay) + (global-hl-line-maybe-unhighlight)))) (defun global-hl-line-highlight-all () "Highlight the current line in all live windows." @@ -243,8 +235,9 @@ global-hl-line-highlight-all (defun global-hl-line-unhighlight () "Deactivate the Global-Hl-Line overlay on the current line." - (when global-hl-line-overlay - (delete-overlay global-hl-line-overlay))) + (when (overlayp global-hl-line-overlay) + (delete-overlay global-hl-line-overlay) + (setq global-hl-line-overlay nil))) (defun global-hl-line-maybe-unhighlight () "Maybe deactivate the Global-Hl-Line overlay on the current line. @@ -256,9 +249,8 @@ global-hl-line-maybe-unhighlight (bufferp ovb) (not (eq ovb (current-buffer))) (not (minibufferp))) - (with-current-buffer ovb - (when (overlayp global-hl-line-overlay) - (delete-overlay global-hl-line-overlay)))))) + (with-current-buffer ovb + (global-hl-line-unhighlight))))) global-hl-line-overlays)) (defun global-hl-line-unhighlight-all () -- 2.27.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 03:10:55 2021 Received: (at 45946) by debbugs.gnu.org; 23 Jan 2021 08:10:55 +0000 Received: from localhost ([127.0.0.1]:33613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3E0U-0002gR-VW for submit@debbugs.gnu.org; Sat, 23 Jan 2021 03:10:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3E0T-0002gD-8V for 45946@debbugs.gnu.org; Sat, 23 Jan 2021 03:10:53 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37405) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3E0M-0000uB-S2; Sat, 23 Jan 2021 03:10:47 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2181 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l3E0M-00064c-8S; Sat, 23 Jan 2021 03:10:46 -0500 Date: Sat, 23 Jan 2021 10:10:47 +0200 Message-Id: <8335ys5b08.fsf@gnu.org> From: Eli Zaretskii To: Gabriel do Nascimento Ribeiro In-Reply-To: (message from Gabriel do Nascimento Ribeiro on Fri, 22 Jan 2021 23:22:21 -0300) Subject: Re: bug#45946: [PATCH] Re: bug#45946: 28.0.50; hl-line-sticky-flag not working References: <83bldi74yn.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45946 Cc: 45946@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 (---) > From: Gabriel do Nascimento Ribeiro > Date: Fri, 22 Jan 2021 23:22:21 -0300 > > > While at that, would it be possible to fix some code there that I at > > least consider strange? E.g., it calls delete-overlay, but doesn't > > assign nil to the variable, so the overlayp predicate still returns > > non-nil for the resulting invalid overlay. Also, it puts 2 functions > > on the post-command-hook, but it looks like the code subtly depends on > > the order of their execution (should hl-line-highlight run before or > > after hl-line-maybe-unhighlight?). > > Hi Eli, > > Thanks for your suggestions. Please find attached a new patch that uses > a single post-command-hook function and some other minor changes. The > original issue is fixed. Thanks, this LGTM, but could you please accompany the changes with the ChangeLog-style commit log message (see CONTRIBUTE about the details)? Also, this patch is close to the limit that we can accept without copyright assignment. So I'd suggest that you start the legal paperwork rolling at this time, to allow us to accept your future contributions. Would you like me to send to you the legal form to fill? From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 14:11:39 2021 Received: (at submit) by debbugs.gnu.org; 23 Jan 2021 19:11:39 +0000 Received: from localhost ([127.0.0.1]:35316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3OJu-0004p2-IO for submit@debbugs.gnu.org; Sat, 23 Jan 2021 14:11:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:53042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3OJs-0004ou-KF for submit@debbugs.gnu.org; Sat, 23 Jan 2021 14:11:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3OJs-0003zL-Eq for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 14:11:36 -0500 Received: from mail-oln040092011020.outbound.protection.outlook.com ([40.92.11.20]:47759 helo=NAM04-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3OJi-000127-Nr for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 14:11:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KrWJBTRTHiXEf7nmA1+wxmY7nW4Hv26ICkDlqSt+kG6XGgBNiVfsbgGsO2icxpg7BCOnxtD23Y1YIv/VMZ7CYp1kB7IoxBwRg8iFuaV8V11FR/09dFuf1Wa7dYKUnoVoqJOirXkxW5MoH5vPdsqBpivbaXMaRNx0LTkQ//k27uxV4e8H66TOC9yEZ0tCC6GADyS57i/vMWCtXK2fR1BMQ3DALiFoszzlz6+8C2KDD+Jd9Y67m5BlRoZVv2wNg1mrKyJ8YI5ef5bv0p27O1daMV8ZyyQkdf/QcyjMJjoTl73LOY1JBMLRJEl9fCPK4EpS/s131lfNwwQDgjyiDcCtqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D+Vx3oViy+0GnKQwwefQRRdOi6GSqRLMjum4F6jmIo4=; b=mDBEodzvoUTLm6QIqXKQOc6ihZdsplgVdmVd4ixbfFBf3fHmpl8HMDkGBpBDpjVLgJSPgHOvWuSAkjT8BDSsa7H3AMURFm2fHJQ/lauRsXPuHwbjImzxEiulgr+clx30tahgGmnTk8GmLDazIOS8NxK51i0v9oHFZuk2sTo4qKaJnqlKMbJmSZstdJDc3ZpjCgMbC49a103bjbsa6J96MQoFCy2eVWJbys49sMS1KZUjdQl1TlOJKfQT0PYPAYJAH+LDidnAAbaW3PO2X6vmiYmuRHx5gEaIgnJhkzPhYe/lAiV/wd2E9qalq/BOwclySOZe36Ef169eRPu5QfALXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D+Vx3oViy+0GnKQwwefQRRdOi6GSqRLMjum4F6jmIo4=; b=l7eYOrSdoutxgeX+/EpcOmJJsF4NwEs+vPUqWlFNvN7fZpjhW3/S206vEZ9feJLQ7CFL7z6lp89U3NKnqJ64Rq05i2zhPSVKjaR8Bg4zCxHXkJl3Uy6wiaDvdN6Gop2Kwa+Qff6055HKbVxUFqfPyejnqzEDxdIW6t7aYscx3u5RAdcUb90PcZUO5uT20PgNuDkx2j3jPd6O0vaTbURWssQOC9HEogBM/6wP0bVdAw8rHjDlDRZSB/S5OQHv3bzU2gxGQmJ5Ml86QqWvh1U9s1JDeNPPRRkGoiwoAS2mDttxJXkQAXzr2PXCIOCrGChn9xGVBHlmIKJkrzNkoEWw4g== Received: from CO1NAM04FT059.eop-NAM04.prod.protection.outlook.com (10.152.90.55) by CO1NAM04HT020.eop-NAM04.prod.protection.outlook.com (10.152.91.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12; Sat, 23 Jan 2021 19:11:23 +0000 Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:7e4d::4e) by CO1NAM04FT059.mail.protection.outlook.com (2a01:111:e400:7e4d::449) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Sat, 23 Jan 2021 19:11:22 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F65DBA695F5184D50822029DBB54A9ECD8C30FF2FF54AFD29D1F0A2E8664472A; UpperCasedChecksum:66D2C1AA906F237CB29822CF78BB7DB4A024BEE633B3B45CB4013DC863843C26; SizeAsReceived:7762; Count:45 Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac%7]) with mapi id 15.20.3763.014; Sat, 23 Jan 2021 19:11:22 +0000 From: Gabriel do Nascimento Ribeiro To: bug-gnu-emacs@gnu.org Subject: Re: bug#45946: [PATCH] Re: bug#45946: 28.0.50; hl-line-sticky-flag not working References: <83bldi74yn.fsf@gnu.org> <8335ys5b08.fsf@gnu.org> Date: Sat, 23 Jan 2021 16:11:04 -0300 In-Reply-To: <8335ys5b08.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jan 2021 10:10:47 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [amoiQSMsRs+wU/WRgNkw0e+Xv29vHd2CGrhddOmdYmGO49n+RfDKEHkA9oj0gk9u] X-ClientProxiedBy: CP5P284CA0041.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:96::10) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <87czxvqxiv.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from precision5540 (2804:431:c7f3:76d5:872e:57fa:d470:5789) by CP5P284CA0041.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:96::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Sat, 23 Jan 2021 19:11:21 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 102bdb9f-a765-4424-8c03-08d8bfd2ab99 X-MS-TrafficTypeDiagnostic: CO1NAM04HT020: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JXcsYO+3UZNrUzGn/ndGiQJNXOP67eUZaxZzwCRt/n44cnXJSNRzEj5jGbXy6RifM049Bmzopy1QXipRyt4G80PRGCT77SUEsQslY5FRK3kHP1XELZWVy6hGswDUDqFXQ+MZ4dwSrzA0aPT6MiDn3bVH9NvyiWN/GP+9qxlKqNPJH9IGJXRVbr8o7QkXhwUNxmRP0tqBAUhavLGNSuBJzf/qT6MXp7kJgdrKBkWG0IygnL/o6HWmSzygEbxB5+er X-MS-Exchange-AntiSpam-MessageData: F5ltSsHLDTI96kxrhbjSplYQmvbuOBWWQMJW4OLXvrESY+O8S69Zxdn5V4Hvci5usJj0dLh0beeXqTAo0DPNAzEfzmcc55ePqZcWahiiS9N/cJCNo5mn32gxv097UJflHGpp7Av1kQrq/Uh/zC9yGykNUww6X2x2FXgD0S8caD5GLkdxNYOwBdZ6UufQ1sEXFzN0gxvh6xof/y+Qkt1ACw== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 102bdb9f-a765-4424-8c03-08d8bfd2ab99 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2021 19:11:22.8522 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: CO1NAM04FT059.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1NAM04HT020 Received-SPF: pass client-ip=40.92.11.20; envelope-from=gabriel376@hotmail.com; helo=NAM04-SN1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) 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.1 (--) --=-=-= Content-Type: text/plain > > Thanks, this LGTM, but could you please accompany the changes with the > ChangeLog-style commit log message (see CONTRIBUTE about the details)? > > Also, this patch is close to the limit that we can accept without > copyright assignment. So I'd suggest that you start the legal > paperwork rolling at this time, to allow us to accept your future > contributions. Would you like me to send to you the legal form to > fill? Patch updated with appropriate ChangeLog-style commit log message. I have already concluded the assignment process with FSF. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Use-single-post-command-hook-on-hl-line-modes.patch >From c0293a572df799eb5cd03dd404c7fc364b6831d0 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Sat, 23 Jan 2021 15:38:42 -0300 Subject: [PATCH] Use single post-command-hook on hl-line modes * lisp/hl-line.el (hl-line-mode, global-hl-line-mode): Ensure that maybe-unhighlight is called after line is highlighted (bug#45946). (hl-line-unhighlight, global-hl-line-unhighlight): Set overlay variable to nil after overlay is deleted. --- lisp/hl-line.el | 58 +++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 73870f9579..82952e934b 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -45,11 +45,7 @@ ;; An overlay is used. In the non-sticky cases, this overlay is ;; active only on the selected window. A hook is added to ;; `post-command-hook' to activate the overlay and move it to the line -;; about point. To get the non-sticky behavior, `hl-line-unhighlight' -;; is added to `pre-command-hook' as well. This function deactivates -;; the overlay unconditionally in case the command changes the -;; selected window. (It does so rather than keeping track of changes -;; in the selected window). +;; about point. ;; You could make variable `global-hl-line-mode' buffer-local and set ;; it to nil to avoid highlighting specific buffers, when the global @@ -91,9 +87,9 @@ hl-line-face (set symbol value) (dolist (buffer (buffer-list)) (with-current-buffer buffer - (when hl-line-overlay + (when (overlayp hl-line-overlay) (overlay-put hl-line-overlay 'face hl-line-face)))) - (when global-hl-line-overlay + (when (overlayp global-hl-line-overlay) (overlay-put global-hl-line-overlay 'face hl-line-face)))) (defcustom hl-line-sticky-flag t @@ -141,9 +137,7 @@ hl-line-mode `hl-line-highlight' on `post-command-hook' in this case. When `hl-line-sticky-flag' is nil, Hl-Line mode highlights the -line about point in the selected window only. In this case, it -uses the function `hl-line-maybe-unhighlight' in -addition to `hl-line-highlight' on `post-command-hook'." +line about point in the selected window only." :group 'hl-line (if hl-line-mode (progn @@ -151,12 +145,10 @@ hl-line-mode (add-hook 'change-major-mode-hook #'hl-line-unhighlight nil t) (hl-line-highlight) (setq hl-line-overlay-buffer (current-buffer)) - (add-hook 'post-command-hook #'hl-line-highlight nil t) - (add-hook 'post-command-hook #'hl-line-maybe-unhighlight nil t)) + (add-hook 'post-command-hook #'hl-line-highlight nil t)) (remove-hook 'post-command-hook #'hl-line-highlight t) (hl-line-unhighlight) - (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t) - (remove-hook 'post-command-hook #'hl-line-maybe-unhighlight t))) + (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t))) (defun hl-line-make-overlay () (let ((ol (make-overlay (point) (point)))) @@ -168,17 +160,19 @@ hl-line-highlight "Activate the Hl-Line overlay on the current line." (if hl-line-mode ; Might be changed outside the mode function. (progn - (unless hl-line-overlay + (unless (overlayp hl-line-overlay) (setq hl-line-overlay (hl-line-make-overlay))) ; To be moved. (overlay-put hl-line-overlay 'window (unless hl-line-sticky-flag (selected-window))) - (hl-line-move hl-line-overlay)) + (hl-line-move hl-line-overlay) + (hl-line-maybe-unhighlight)) (hl-line-unhighlight))) (defun hl-line-unhighlight () "Deactivate the Hl-Line overlay on the current line." - (when hl-line-overlay - (delete-overlay hl-line-overlay))) + (when (overlayp hl-line-overlay) + (delete-overlay hl-line-overlay) + (setq hl-line-overlay nil))) (defun hl-line-maybe-unhighlight () "Maybe deactivate the Hl-Line overlay on the current line. @@ -191,8 +185,7 @@ hl-line-maybe-unhighlight (not (eq curbuf hlob)) (not (minibufferp))) (with-current-buffer hlob - (when (overlayp hl-line-overlay) - (delete-overlay hl-line-overlay)))) + (hl-line-unhighlight))) (when (and (overlayp hl-line-overlay) (eq (overlay-buffer hl-line-overlay) curbuf)) (setq hl-line-overlay-buffer curbuf)))) @@ -205,8 +198,8 @@ global-hl-line-mode highlights the line about the current buffer's point in all live windows. -Global-Hl-Line mode uses the functions `global-hl-line-highlight' -and `global-hl-line-maybe-unhighlight' on `post-command-hook'." +Global-Hl-Line mode uses the function `global-hl-line-highlight' +on `post-command-hook'." :global t :group 'hl-line (if global-hl-line-mode @@ -214,25 +207,24 @@ global-hl-line-mode ;; In case `kill-all-local-variables' is called. (add-hook 'change-major-mode-hook #'global-hl-line-unhighlight) (global-hl-line-highlight-all) - (add-hook 'post-command-hook #'global-hl-line-highlight) - (add-hook 'post-command-hook #'global-hl-line-maybe-unhighlight)) + (add-hook 'post-command-hook #'global-hl-line-highlight)) (global-hl-line-unhighlight-all) (remove-hook 'post-command-hook #'global-hl-line-highlight) - (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight) - (remove-hook 'post-command-hook #'global-hl-line-maybe-unhighlight))) + (remove-hook 'change-major-mode-hook #'global-hl-line-unhighlight))) (defun global-hl-line-highlight () "Highlight the current line in the current window." (when global-hl-line-mode ; Might be changed outside the mode function. (unless (window-minibuffer-p) - (unless global-hl-line-overlay + (unless (overlayp global-hl-line-overlay) (setq global-hl-line-overlay (hl-line-make-overlay))) ; To be moved. (unless (member global-hl-line-overlay global-hl-line-overlays) (push global-hl-line-overlay global-hl-line-overlays)) (overlay-put global-hl-line-overlay 'window (unless global-hl-line-sticky-flag (selected-window))) - (hl-line-move global-hl-line-overlay)))) + (hl-line-move global-hl-line-overlay) + (global-hl-line-maybe-unhighlight)))) (defun global-hl-line-highlight-all () "Highlight the current line in all live windows." @@ -243,8 +235,9 @@ global-hl-line-highlight-all (defun global-hl-line-unhighlight () "Deactivate the Global-Hl-Line overlay on the current line." - (when global-hl-line-overlay - (delete-overlay global-hl-line-overlay))) + (when (overlayp global-hl-line-overlay) + (delete-overlay global-hl-line-overlay) + (setq global-hl-line-overlay nil))) (defun global-hl-line-maybe-unhighlight () "Maybe deactivate the Global-Hl-Line overlay on the current line. @@ -256,9 +249,8 @@ global-hl-line-maybe-unhighlight (bufferp ovb) (not (eq ovb (current-buffer))) (not (minibufferp))) - (with-current-buffer ovb - (when (overlayp global-hl-line-overlay) - (delete-overlay global-hl-line-overlay)))))) + (with-current-buffer ovb + (global-hl-line-unhighlight))))) global-hl-line-overlays)) (defun global-hl-line-unhighlight-all () -- 2.27.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 14:37:36 2021 Received: (at 45946-done) by debbugs.gnu.org; 23 Jan 2021 19:37:36 +0000 Received: from localhost ([127.0.0.1]:35325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3Oj2-0007YL-C0 for submit@debbugs.gnu.org; Sat, 23 Jan 2021 14:37:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3Oj1-0007Y5-HK for 45946-done@debbugs.gnu.org; Sat, 23 Jan 2021 14:37:35 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47617) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Oiw-0003we-7v; Sat, 23 Jan 2021 14:37:30 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1079 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l3Oiv-0008DI-FW; Sat, 23 Jan 2021 14:37:30 -0500 Date: Sat, 23 Jan 2021 21:37:28 +0200 Message-Id: <83lfcj4f7r.fsf@gnu.org> From: Eli Zaretskii To: Gabriel do Nascimento Ribeiro In-Reply-To: (message from Gabriel do Nascimento Ribeiro on Sat, 23 Jan 2021 16:11:04 -0300) Subject: Re: bug#45946: [PATCH] Re: bug#45946: 28.0.50; hl-line-sticky-flag not working References: <83bldi74yn.fsf@gnu.org> <8335ys5b08.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45946-done Cc: 45946-done@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 (---) > From: Gabriel do Nascimento Ribeiro > Date: Sat, 23 Jan 2021 16:11:04 -0300 > > Patch updated with appropriate ChangeLog-style commit log message. Thanks, pushed (after minor tweaking of the log message). > I have already concluded the assignment process with FSF. Right, the records were updated today. From unknown Fri Aug 15 02:01:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 21 Feb 2021 12:24:05 +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