dired-hide-details-mode have no effect suddenly

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

dired-hide-details-mode have no effect suddenly

Tomas Nordin-2
Hi List

Here is a problem I don't know how to reproduce. I have this in my
.emacs:

    (add-hook 'dired-mode-hook 'dired-hide-details-mode)

and details are hidden by default, the way I like it. Sometimes I need
to see some details and I use (default I think) the key ( to toggle
visibility of details.

However, suddenly after some long time of keeping emacs alive, details
are always shown and I cannot toggle it. I have been trying to detect at
what moment this happens but I fail to understand what the interference
is. At this point all I can think of is restarting emacs. Did somebody
notice a similar problem?

Best regards
--
Tomas

Reply | Threaded
Open this post in threaded view
|

RE: dired-hide-details-mode have no effect suddenly

Drew Adams
> Here is a problem I don't know how to reproduce. I have this in my
> .emacs:
>
>     (add-hook 'dired-mode-hook 'dired-hide-details-mode)
>
> and details are hidden by default, the way I like it. Sometimes I need
> to see some details and I use (default I think) the key ( to toggle
> visibility of details.
>
> However, suddenly after some long time of keeping emacs alive, details
> are always shown and I cannot toggle it. I have been trying to detect at
> what moment this happens but I fail to understand what the interference
> is. At this point all I can think of is restarting emacs. Did somebody
> notice a similar problem?

Do you see the same thing if you start Emacs using `emacs -Q'
(no init file)?  If so, it sounds like a bug
(`M-x report-emacs-bug').

Do you perhaps use library `dired-details+.el'? If so, and if
option `dired-details-propagate-flag' has its default value
of `t', and if you happen to use `(` in Dired (to toggle
showing details), then that the resulting state is used from
then on (until you hit `(` again), by default.

IOW, that could explain what you think you see.  If you did
hit `(` then what you get from that (e.g. showing details)
will be what you see in Dired from then on (until you toggle
with `(` again).  If you don't want such propagation then
customize the option value to `nil'.

https://www.emacswiki.org/emacs/download/dired-details%2b.el

Reply | Threaded
Open this post in threaded view
|

RE: dired-hide-details-mode have no effect suddenly

Tomas Nordin-2
Drew Adams <[hidden email]> writes:

> Do you see the same thing if you start Emacs using `emacs -Q'

I don's see. Loaded magit, zerodark theme and maybe something else and
it didn't happen.

> Do you perhaps use library `dired-details+.el'? If so, and if

not what I know. I see a readme in my elpa directory,
"dired-details+-readme.txt" but nothing else. I don't know what it's
doing there, but anyway. It informs me it's not needed since emacs 24.4+

I report back if I can be more specific, it feels like there must be a
package doing something.

Reply | Threaded
Open this post in threaded view
|

RE: dired-hide-details-mode have no effect suddenly

Drew Adams
> > Do you see the same thing if you start Emacs using `emacs -Q'
>
> I don's see. Loaded magit, zerodark theme and maybe something else and
> it didn't happen.

Then recursively bisect your init file to find the culprit.

You can use command `comment-region' to comment or (with `C-u')
uncomment a selection of text.  Use it to comment out 1/2, then
3/4, 7/8, ... of your init file.  Narrow down the code you use,
to find the problem.

> > Do you perhaps use library `dired-details+.el'? If so, and if
>
> not what I know. I see a readme in my elpa directory,
> "dired-details+-readme.txt" but nothing else. I don't know what it's
> doing there, but anyway. It informs me it's not needed since emacs 24.4+

That's a misreading of that readme.  What it says is that Emacs
24.4 and later provide `dired-hide-details-mode'.  If all you
want is what that offers then you do not need any 3rd-party
library.

But if you want what `dired-details+.el' provides and you have
Emacs 24.4 or later then you can get those additional features
from Dired+ (library `dired+.el').

I've reworded that part of the readme to help prevent misreading:

NOTE: If you use Emacs 24.4 or later, and if you use library
      `dired+.el', then you do not need this library or library
      `dired-details.el'.

      Instead, you can use `dired-hide-details-mode'.  Library
      `dired+.el' enhances `dired-hide-details-mode' to give it
      the same features as `dired-details+.el' provides.  In
      that case, use `(require 'dired+.el)', and use option
      `diredp-hide-details-propagate-flag' instead of option
      `dired-details-propagate-flag'.

> I report back if I can be more specific, it feels like there
> must be a package doing something.

Again, bisect your init file, to find out what you are doing
that causes the behavior you don't like.

Reply | Threaded
Open this post in threaded view
|

Re: dired-hide-details-mode have no effect suddenly

Charles A. Roelli
In reply to this post by Tomas Nordin-2
> From: Tomas Nordin <[hidden email]>
> Date: Sun, 03 Sep 2017 19:48:59 +0200
> Content-Type: text/plain
>
> Hi List
>
> Here is a problem I don't know how to reproduce. I have this in my
> .emacs:
>
>     (add-hook 'dired-mode-hook 'dired-hide-details-mode)
>
> and details are hidden by default, the way I like it. Sometimes I need
> to see some details and I use (default I think) the key ( to toggle
> visibility of details.
>
> However, suddenly after some long time of keeping emacs alive, details
> are always shown and I cannot toggle it. I have been trying to detect at
> what moment this happens but I fail to understand what the interference
> is. At this point all I can think of is restarting emacs. Did somebody
> notice a similar problem?
>
> Best regards
> --
> Tomas

I had the same issue once.  I had mistakenly added to the global value
of the variable 'font-lock-extra-managed-props' in some of my own code
for a buffer-local minor mode, instead of making the variable
buffer-local.  That resulted in dired-hide-details-mode breaking (and
a month's worth of confusion).

Reply | Threaded
Open this post in threaded view
|

Re: dired-hide-details-mode have no effect suddenly

Tomas Nordin-2
"Charles A. Roelli" <[hidden email]> writes:

> I had the same issue once.  I had mistakenly added to the global value
> of the variable 'font-lock-extra-managed-props' in some of my own code
> for a buffer-local minor mode, instead of making the variable
> buffer-local.  That resulted in dired-hide-details-mode breaking (and
> a month's worth of confusion).

Ok, my value is nil of that variable in dired, will check it when I get
the problem next time, thanks. But I never touched that variable as far
as I am aware.


Reply | Threaded
Open this post in threaded view
|

RE: dired-hide-details-mode have no effect suddenly

Tomas Nordin-2
In reply to this post by Drew Adams
Drew Adams <[hidden email]> writes:

> Then recursively bisect your init file to find the culprit.

I am sure this is a proper suggestion. It's just that the workflow would
look something like, comment out half, use Emacs to a point in time when
I feel the problem should have occurred (but it didn't occur),
un-comment half of the first commented half plus the first un-commented
half and repeat using Emacs to a point in time when I feel that the
problem should have occurred and so on. I mean, it's just a bit tricky
when the problem is seemingly intermittent. Like now for example, Emacs
has been running for a couple of days and details hide as expected.

Could there be some variables to check while it's working as expected
and then check again when it's not working as expected? Or something
like that.

--
Tomas

Reply | Threaded
Open this post in threaded view
|

RE: dired-hide-details-mode have no effect suddenly

Drew Adams
> > Then recursively bisect your init file to find the culprit.
>
> I am sure this is a proper suggestion. It's just that the workflow would
> look something like, comment out half, use Emacs to a point in time when
> I feel the problem should have occurred (but it didn't occur),
> un-comment half of the first commented half plus the first un-commented
> half and repeat using Emacs to a point in time when I feel that the
> problem should have occurred and so on. I mean, it's just a bit tricky
> when the problem is seemingly intermittent. Like now for example, Emacs
> has been running for a couple of days and details hide as expected.
>
> Could there be some variables to check while it's working as expected
> and then check again when it's not working as expected? Or something
> like that.

`C-h f dired-hide-details TAB' shows you these variables:

dired-hide-details-hide-information-lines
dired-hide-details-hide-symlink-targets
dired-hide-details-mode
dired-hide-details-mode-hook

You might start with the last two, checking in your init
file, `custom-file', or other code you might load.

You can also put (debug-on-entry 'dired-hide-details-mode)
in your init file, to find out what code is calling it.
In the debugger, look at how it gets called, then use `c'
to skip debugging.  Use `M-x cancel-debug-on-entry RET'
to cancel such debugger entry.

But it's probably easier to just grep for `dired-hide-details'
in directories of customization and 3rd-party code you load.

Reply | Threaded
Open this post in threaded view
|

RE: dired-hide-details-mode have no effect suddenly

Tomas Nordin-2
Drew Adams <[hidden email]> writes:

> `C-h f dired-hide-details TAB' shows you these variables:
>
> dired-hide-details-hide-information-lines
> dired-hide-details-hide-symlink-targets
> dired-hide-details-mode
> dired-hide-details-mode-hook
>
> You might start with the last two, checking in your init
> file, `custom-file', or other code you might load.
>
> You can also put (debug-on-entry 'dired-hide-details-mode)
> in your init file, to find out what code is calling it.
> In the debugger, look at how it gets called, then use `c'
> to skip debugging.  Use `M-x cancel-debug-on-entry RET'
> to cancel such debugger entry.
>
> But it's probably easier to just grep for `dired-hide-details'
> in directories of customization and 3rd-party code you load.

Thanks for this suit of suggestions, I keep it in my back pocket. I
stored away the values of the variables (working condition), didn't grep
any results on `dired-hide-details' in my elpa directory.

Reply | Threaded
Open this post in threaded view
|

Re: dired-hide-details-mode have no effect suddenly

Tomas Nordin-2
In reply to this post by Tomas Nordin-2
Tomas Nordin <[hidden email]> writes:

> "Charles A. Roelli" <[hidden email]> writes:
>
>> I had the same issue once.  I had mistakenly added to the global value
>> of the variable 'font-lock-extra-managed-props' in some of my own code
>> for a buffer-local minor mode, instead of making the variable
>> buffer-local.  That resulted in dired-hide-details-mode breaking (and
>> a month's worth of confusion).
>
> Ok, my value is nil of that variable in dired, will check it when I get
> the problem next time, thanks. But I never touched that variable as far
> as I am aware.

And now suddenly...

font-lock-extra-managed-props is a variable defined in ‘font-lock.el’.
Its value is (invisible composition)

... and problem is back. Who has changed it I don't know. I know that it
has happened around doing some magit.

Cool, resetting that variable to nil removes the problem. But still,
hmm, ehh.

Reply | Threaded
Open this post in threaded view
|

Re: dired-hide-details-mode have no effect suddenly

Charles A. Roelli
> From: Tomas Nordin <[hidden email]>
> Cc: [hidden email]
> Date: Wed, 20 Sep 2017 22:49:06 +0200
>
> Tomas Nordin <[hidden email]> writes:
>
> > "Charles A. Roelli" <[hidden email]> writes:
> >
> >> I had the same issue once.  I had mistakenly added to the global value
> >> of the variable 'font-lock-extra-managed-props' in some of my own code
> >> for a buffer-local minor mode, instead of making the variable
> >> buffer-local.  That resulted in dired-hide-details-mode breaking (and
> >> a month's worth of confusion).
> >
> > Ok, my value is nil of that variable in dired, will check it when I get
> > the problem next time, thanks. But I never touched that variable as far
> > as I am aware.
>
> And now suddenly...
>
> font-lock-extra-managed-props is a variable defined in ‘font-lock.el’.
> Its value is (invisible composition)
>
> ... and problem is back. Who has changed it I don't know. I know that it
> has happened around doing some magit.
>
> Cool, resetting that variable to nil removes the problem. But still,
> hmm, ehh.

Neat.  Does M-x rgrep font-lock-extra-managed-props RET * RET
~/.emacs.d/elpa/ show anything interesting?

Reply | Threaded
Open this post in threaded view
|

Re: dired-hide-details-mode have no effect suddenly

Tomas Nordin-2
"Charles A. Roelli" <[hidden email]> writes:

>> font-lock-extra-managed-props is a variable defined in ‘font-lock.el’.
>> Its value is (invisible composition)
>>
>> ... and problem is back. Who has changed it I don't know. I know that it
>> has happened around doing some magit.
>>
>> Cool, resetting that variable to nil removes the problem. But still,
>> hmm, ehh.
>
> Neat.  Does M-x rgrep font-lock-extra-managed-props RET * RET
> ~/.emacs.d/elpa/ show anything interesting?

Yes, three. I think the relevant two are those:

./markdown-mode-20170610.602/markdown-mode.el:7783:  (add-to-list 'font-lock-extra-managed-props 'composition)
./markdown-mode-20170610.602/markdown-mode.el:7789:  (add-to-list 'font-lock-extra-managed-props 'invisible)


Reply | Threaded
Open this post in threaded view
|

Re: dired-hide-details-mode have no effect suddenly

Tomas Nordin-2
Tomas Nordin <[hidden email]> writes:

> "Charles A. Roelli" <[hidden email]> writes:
>
>>> font-lock-extra-managed-props is a variable defined in ‘font-lock.el’.
>>> Its value is (invisible composition)
>>>
>>> ... and problem is back. Who has changed it I don't know. I know that it
>>> has happened around doing some magit.
>>>
>>> Cool, resetting that variable to nil removes the problem. But still,
>>> hmm, ehh.
>>
>> Neat.  Does M-x rgrep font-lock-extra-managed-props RET * RET
>> ~/.emacs.d/elpa/ show anything interesting?
>
> Yes, three. I think the relevant two are those:
>
> ./markdown-mode-20170610.602/markdown-mode.el:7783:  (add-to-list 'font-lock-extra-managed-props 'composition)
> ./markdown-mode-20170610.602/markdown-mode.el:7789:  (add-to-list 'font-lock-extra-managed-props 'invisible)

I have updated that package and now those variables are manipulated like this:

(setq-local font-lock-extra-managed-props
              (append font-lock-extra-managed-props
                      '(composition display invisible)))

Is this a more proper way to do it? :)

Reply | Threaded
Open this post in threaded view
|

Re: dired-hide-details-mode have no effect suddenly

Charles A. Roelli
> From: Tomas Nordin <[hidden email]>
> Date: Thu, 21 Sep 2017 21:20:36 +0200
>
> Tomas Nordin <[hidden email]> writes:
>
> > "Charles A. Roelli" <[hidden email]> writes:
> >
> >>> font-lock-extra-managed-props is a variable defined in ‘font-lock.el’.
> >>> Its value is (invisible composition)
> >>>
> >>> ... and problem is back. Who has changed it I don't know. I know that it
> >>> has happened around doing some magit.
> >>>
> >>> Cool, resetting that variable to nil removes the problem. But still,
> >>> hmm, ehh.
> >>
> >> Neat.  Does M-x rgrep font-lock-extra-managed-props RET * RET
> >> ~/.emacs.d/elpa/ show anything interesting?
> >
> > Yes, three. I think the relevant two are those:
> >
> > ./markdown-mode-20170610.602/markdown-mode.el:7783:  (add-to-list 'font-lock-extra-managed-props 'composition)
> > ./markdown-mode-20170610.602/markdown-mode.el:7789:  (add-to-list 'font-lock-extra-managed-props 'invisible)
>
> I have updated that package and now those variables are manipulated like this:
>
> (setq-local font-lock-extra-managed-props
>               (append font-lock-extra-managed-props
>                       '(composition display invisible)))
>
> Is this a more proper way to do it? :)

Aha, perfect.  I guess I'm not the only one who learned that lesson
the hard way.

Reply | Threaded
Open this post in threaded view
|

Re: dired-hide-details-mode have no effect suddenly

Tomas Nordin-2

> Aha, perfect.  I guess I'm not the only one who learned that lesson
> the hard way.

Yes, perfect and yes, I guess not too. Let's try to summarize the
lesson:

If there is a problem with dired-hide-details-mode and you happen to use
markdown-mode, make sure you have the latest version of markdown-mode,
it has improved its way of handling `font-lock-extra-managed-props`.