GNU bug report logs - #53771
29.0.50; highlight-regexp not working after tabulated-list-col-sort

Previous Next

Package: emacs;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Fri, 4 Feb 2022 06:30:02 UTC

Severity: normal

Tags: notabug

Found in version 29.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53771 in the body.
You can then email your comments to 53771 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53771; Package emacs. (Fri, 04 Feb 2022 06:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jean Louis <bugs <at> gnu.support>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 04 Feb 2022 06:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; highlight-regexp not working after tabulated-list-col-sort
Date: Fri, 04 Feb 2022 09:29:10 +0300
highlight-regexp not working after tabulated-list-col-sort

Here is how:

1) M-x package-list-packages

2) M-x highlight-regexp RET parens RET and word "parens" will get
   highlighted

3) Click on "Archive" title and sort the list by Archive column

4) M-x highlight-regexp RET parens RET and the word "parens" is not
   highlighted. I would like to understand why. hi-lock mode remains
   turned on.


In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.4, Xaw3d scroll bars)
 of 2022-01-29 built on protected.rcdrun.com
Repository revision: 7e17749ada101fbfb772a79deda5f7087ba9e96d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Parabola GNU/Linux-libre

Configured using:
 'configure --with-x-toolkit=lucid'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
WEBP X11 XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: @im=exwm-xim
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-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
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr shortdoc help-fns radix-tree help-mode emacsbug
message mailcap yank-media rmc puny dired dired-loaddefs rfc822 mml
mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util
text-property-search time-date seq gv subr-x byte-opt bytecomp
byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils iso-transl tooltip
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode 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 lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
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 emoji-zwj 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 keymap hashtable-print-readable backquote threads
dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo x-toolkit x multi-tty make-network-process
emacs)

Memory information:
((conses 16 52925 5041)
 (symbols 48 6456 3)
 (strings 32 18917 1698)
 (string-bytes 1 572784)
 (vectors 16 12130)
 (vector-slots 8 167847 41359)
 (floats 8 64 36)
 (intervals 56 270 0)
 (buffers 992 13))

-- 
Thanks,
Jean Louis

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53771; Package emacs. (Fri, 04 Feb 2022 06:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 53771 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Jean Louis <bugs <at> gnu.support>
Cc: 53771 <at> debbugs.gnu.org
Subject: Re: bug#53771: 29.0.50; highlight-regexp not working after
 tabulated-list-col-sort
Date: Fri, 4 Feb 2022 09:33:54 +0300
I can observe that M-x highlight-regexp does not work for second time
in Dired mode as well.

Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53771; Package emacs. (Sat, 05 Feb 2022 06:50:02 GMT) Full text and rfc822 format available.

Message #11 received at 53771 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jean Louis <bugs <at> gnu.support>
Cc: 53771 <at> debbugs.gnu.org
Subject: Re: bug#53771: 29.0.50; highlight-regexp not working after
 tabulated-list-col-sort
Date: Sat, 05 Feb 2022 07:48:58 +0100
Jean Louis <bugs <at> gnu.support> writes:

> 1) M-x package-list-packages
>
> 2) M-x highlight-regexp RET parens RET and word "parens" will get
>    highlighted
>
> 3) Click on "Archive" title and sort the list by Archive column
>
> 4) M-x highlight-regexp RET parens RET and the word "parens" is not
>    highlighted. I would like to understand why. hi-lock mode remains
>    turned on.

As the doc string says:

---
Use Font lock mode, if enabled, to highlight REGEXP.  Otherwise,
use overlays for highlighting.  If overlays are used, the
highlighting will not update as you type.  The Font Lock mode
is considered "enabled" in a buffer if its ‘major-mode’
causes ‘font-lock-specified-p’ to return non-nil, which means
the major mode specifies support for Font Lock.
---

So in these modes, changing the text won't update the overlays, and
re-sorting them will remove the overlays altogether.  So I don't think
there's any bug here, and I'm therefore closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 05 Feb 2022 06:50:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 53771 <at> debbugs.gnu.org and Jean Louis <bugs <at> gnu.support> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 05 Feb 2022 06:50:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53771; Package emacs. (Sat, 05 Feb 2022 07:17:02 GMT) Full text and rfc822 format available.

Message #18 received at 53771 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 53771 <at> debbugs.gnu.org
Subject: Re: bug#53771: 29.0.50; highlight-regexp not working after
 tabulated-list-col-sort
Date: Sat, 5 Feb 2022 10:13:59 +0300
* Lars Ingebrigtsen <larsi <at> gnus.org> [2022-02-05 09:49]:
> As the doc string says:
> 
> ---
> Use Font lock mode, if enabled, to highlight REGEXP.  Otherwise,
> use overlays for highlighting.  If overlays are used, the
> highlighting will not update as you type.  The Font Lock mode
> is considered "enabled" in a buffer if its ‘major-mode’
> causes ‘font-lock-specified-p’ to return non-nil, which means
> the major mode specifies support for Font Lock.

I  wish   to  use  the   function  highlight-regexp  for   reasons  of
simplicity. The  above description does  not tell  me HOW to  use font
lock mode to highlight regexp.

I  can see  that font-lock-mode  is T  inthe buffer  before and  after
sorting.   My    understanding   is   that   I    am   already   using
font-lock-mode. It is enabled, and I cannot get highlighting. 

Description  such as  "Use Font  lock mode,  if enabled,  to highlight
REGEXP."  with its  "REGEXP" relates  to  the argument  REGEXP. It  is
related to the function. It tells little how is that supposed to work.

I have  followed the above  instructions by my  (mis)understanding and
have  specified `font-lock-specified-p'  below,  and  after sorting  I
still  cannot  invoke highlight-regexp  neither  with  M-x neither  by
evaluation.

Please, help me resolve this.

(define-derived-mode hyperscope-list-mode tabulated-list-mode "Hyperscope" "Hyperscope mode"
  (hyperscope-text-scale-adjust 'hyperscope-list-mode)
  (let ((id-length (length (number-to-string (rcd-sql-first "SELECT hyobjects_id FROM hyobjects ORDER BY hyobjects_id DESC LIMIT 1" hs-db)))))
    (setq tabulated-list-format (vconcat (list (list "ID" id-length t :right-align t))
					 (list (list "Hyperdocument" 70 t))
					 (list (list "Type" 12 t))
					 (list (list "Action" 9 t))))
    (setq font-lock-specified-p t)
    (setq tabulated-list-padding 1)
    ;; (setq tabulated-list-sort-key (cons "ID" nil))
    (tabulated-list-init-header)))


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53771; Package emacs. (Sat, 05 Feb 2022 07:20:02 GMT) Full text and rfc822 format available.

Message #21 received at 53771 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jean Louis <bugs <at> gnu.support>
Cc: 53771 <at> debbugs.gnu.org
Subject: Re: bug#53771: 29.0.50; highlight-regexp not working after
 tabulated-list-col-sort
Date: Sat, 05 Feb 2022 08:19:00 +0100
Jean Louis <bugs <at> gnu.support> writes:

> Please, help me resolve this.

I think you just have to reapply the highlight-regexp after altering the
buffer.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53771; Package emacs. (Sat, 05 Feb 2022 16:12:01 GMT) Full text and rfc822 format available.

Message #24 received at 53771 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 53771 <at> debbugs.gnu.org, Jean Louis <bugs <at> gnu.support>
Subject: Re: bug#53771: 29.0.50; highlight-regexp not working after
 tabulated-list-col-sort
Date: Sat, 5 Feb 2022 19:10:21 +0300
* Lars Ingebrigtsen <larsi <at> gnus.org> [2022-02-05 10:19]:
> Jean Louis <bugs <at> gnu.support> writes:
> 
> > Please, help me resolve this.
> 
> I think you just have to reapply the highlight-regexp after altering the
> buffer.

Then I wasn't clear. I have tried  that in first place and it does not
work. That is why I said it is bug.

I don't get it why it is not bug.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53771; Package emacs. (Sun, 06 Feb 2022 03:11:02 GMT) Full text and rfc822 format available.

Message #27 received at 53771 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Jean Louis <bugs <at> gnu.support>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 53771 <at> debbugs.gnu.org
Subject: Re: bug#53771: 29.0.50; highlight-regexp not working after
 tabulated-list-col-sort
Date: Sun, 06 Feb 2022 04:10:05 +0100
Jean Louis <bugs <at> gnu.support> writes:

> Then I wasn't clear. I have tried  that in first place and it does not
> work. That is why I said it is bug.

You are right, that doesn't work.  The second time `hi-lock-set-pattern'
checks `hi-lock-interactive-patterns', finds the pattern, and does
nothing.

At least in the package-list buffer.  Dired is different because it
_does_ use font-lock.  But I don't see a problem in dired when I revert
or reorder the buffer, the highlighting doesn't disappear, so I don't
need to add a pattern a second time.

Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 06 Mar 2022 12:24:08 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Jean Louis <bugs <at> gnu.support> to control <at> debbugs.gnu.org. (Wed, 31 Aug 2022 22:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53771; Package emacs. (Fri, 02 Sep 2022 00:12:01 GMT) Full text and rfc822 format available.

Message #34 received at 53771 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: help-gnu-emacs <at> gnu.org
Cc: larsi <at> gnu.org, 53771 <at> debbugs.gnu.org
Subject: Re: Why M-x highlight-regexp does not work after sort in
 tabulated-list-mode?
Date: Fri, 02 Sep 2022 02:11:40 +0200
Jean Louis <bugs <at> gnu.support> writes:

> Do you think that is error, and that hook shall be run after sorting?

I don't know what exactly you are doing, so it's hard to tell something
concrete.

tabulated-list is only a generic mode, so maybe it's better when the
implementations add hooks for operations when it makes sense.  In any
case, I don't think it's that mode's concern to implement features of
`hi-lock-mode' - which seems to be your intention.

Maybe it would be easier for you to just turn on font-lock-mode.  Have
you tried that?

Removing and re-adding pattern highlighting explicitly is only a
workaround.  If I would change anything then I would try to improve
hi-lock-mode instead so that it is easier to use under such
circumstances.  That `highlight-regexp' does nothing when font-lock-mode
is off (and no automatic highlighting can be assumed) doesn't make much
sense to me.  It could just highlight again.  But if you think that
further (automatic updating...) you end with a re-implementation of
font-lock-mode in Elisp - thus my suggestion to just try to turn that
mode on.

Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Sep 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 199 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.