Open kaushalmodi opened 9 years ago
Here is my commit to my emacs setup in which I tested out an alternative highlighting package and did not require hl-anything and the above issue did not occur.
Here is the relevant code without the diff view.
As soon as I eval the (hl-highlight-mode +1)
line for hl-anything
all color is lost from the *Color*
buffer opened by list-colors-display
and I can't figure out any way of restoring those colors other than emacs reset.
Thanks for your feedback. I'll check it out as soon as possible. (Busy of preparing wedding at March)
No worries! Congratulations! :)
Hi @kaushalmodi
What is the version of your Emacs? What O.S. are you using?
Can you provide the snapshot of M-x
list-colors-display
?
This is mine. I'm using window version of Emacs 24.4 on OSX.
I am able to repeat this issue on both emacs 24.4 and 25.0.50.2 (built from the trunk 2 days back). The OS is RHEL 5.10.
Here's an interesting thing I noted,
hl-anything
and enable the hl-highlight-mode
, I don't
see colors in the *Colors*
buffer as I mentioned earlier. I also have the
desktop-save-mode
enabled. So that saves the state of all minor modes
including hl-highlight-mode
to the desktop file. Now even when I comment
out the require for hl-anything
and restart emacs, the no-color issue
still persists as the minor mode info is read back from the saved desktop
file.hl-anything
still disabled, this issue is gone.That indicates that the hl-highlight-mode
is conflicting with the way the
*Colors*
buffer is drawing the various color highlights. The highlight-global
package also does global highlighting.
I've noticed that when I highlight any string using highlight-global
, the
colors are wiped off from the *Colors*
buffer. But the colors return when
I call list-colors-display
again. For hl-anything
, it seems that the
hl-highlight-mode
is overpowering and repeated calls of
list-colors-display
result in a black and white *Colors*
buffer even
when I have toggled off the hl-anything global highlight display.
I'll update with the screen shot in few hours when I get to my computer.
Sorry, I'v been away for couple months. Do you found the root cause?
Hey, thanks for the reply. The issue is that the hl-*global
functions force the highlights on all the buffers and in the process, it removes any pre-existing highlight.
The best way to demonstrate that is by following the below steps:
hl-highlight-thingatpt-global
)M-x list-colors-display
. That should the Colors buffer in a split window.M-x hl-highlight-thingatpt-global
, the colors gets wiped out from the Colors buffer.Few suggestions:
hl-anything
should not try to highlight. The Color buffer and the Magit status buffer are the few that come to my mind.If I already have the highlighting on using hl-highlight-thingatpt-global
, then the faces in the Magit status buffer do not show correctly (even if M-x magit-status
is launched after doing the highlighting.)
I am on the latest emacs version from the master git branch.
I have a same problem. Do you have any updates for this?
@windrg I now use my personal fork of a different package ( highlight-global
) which resolves this problem.
@kaushalmodi , it sounds very pleasant but highlight-global doesn't provide an interface to search that word back and forth. Somehow could you please share your fork with us?
@windrg The link in my previous post points to the fork ( https://github.com/kaushalmodi/highlight-global ). You can clone/fork it and try it out.
This probably doesn't fit your use case. But when I need to jump to prev/next symbols matching the symbol under point, I do M-s .
and then C-s
/C-r
.
I also use M-s h .
to highlight symbols at times instead of highlight-global
functions.
@kaushalmodi Thank you very much. It's helping a lot.
Getting back to the point of this thread, this symptom happens in most of modes I'm using like as logview-mode, org-mode. And an another remarkable thing is that it's recoverable by invoking such major mode functions. Indeed sometimes it maintains the highlighted words by this packages. I look forward this would be helpful for you to solve.
@kaushalmodi @windrg Thank you all. It'd be nice that some of you create the PR for above and I could give you authority to merge it. 👍
BTW, I'm considering to move this repo to a public organization so that everyone who loves this project could be more free to help to maintain.
Hi guys, I just moved the repo to hl-anything/hl-anything-emacs
and am waiting for the update from MELPA.
@boyw165 Thanks for doing this. As of now, I don't have bandwidth to study/update hl-anything
. But I will keep that as a TODO project at the back of my mind and work on it if someone hasn't already fixed it. I currently don't have a PR for this fix. I simply took up global-highlight
and modified it to my needs.
I see. I think MELPA has granted the migration. https://github.com/melpa/melpa/pull/3796
Hi,
I use
M-x list-colors-display
to look at the colors available in emacs.I noticed that that buffer doesn't show the colors after I require
hl-anything
.I am unable to replicate that in an emacs -Q session but I can confirm for sure that the issue returns as soon as I uncomment the
use-package
block forhl-anything
in my init.hl-anything
uses many defadvices. So probably you can give a hint as to what can can be causing issues withlist-colors-display
.I am using emacs 25.0.50.2. I can replicate the issue on emacs 24.4 too.