annotate.el icon indicating copy to clipboard operation
annotate.el copied to clipboard

is it possble to hide annotation but keep showing annotate-highlght

Open emacs25 opened this issue 2 years ago • 21 comments

for some reason,i dont want anybody to see my annotations but still keep annotate-highlight,how should i do?

closing annotate-mode disables annotaton but the highlight is disabled too.

emacs25 avatar Feb 12 '23 00:02 emacs25

On Sat, Feb 11, 2023 at 04:58:49PM -0800, emacs25 wrote:

Hi!

for some reason,i dont want anybody to see my annotations but still keep annotate-highlight,how should i do?

closing annotate-mode disables annotaton but the highlight is disabled too.

This looks like definitely a good idea to me!

Bye! C.

cage2 avatar Feb 12 '23 12:02 cage2

Hi @emacs25 !

I have found some free time to start working on this feature! :)

I wrote a couple of function that perhaps can be useful to what you proposed here.

To get the new experimental feature just clone this fork of the package:

https://github.com/cage2/annotate.el/

$ git clone https://github.com/cage2/annotate.el/
$ git switch hide-annotation-text

somewhere in your init file just load the file annotate.el from this fork.

 (load "path/to/cloned/annotate-package/annotate.el")

then you will be able to launch a new command annotate-toggle-annotation-text.

Let me know if it is OK to you. Bye! C.

cage2 avatar Feb 15 '23 14:02 cage2

Hi @emacs25 !

I think the patch #150 implements whet you asked in this thread. It is now possible to hide all the annotation's' text in a buffer or choose to hide the text for the annotation under the cursor.

Bye! C.

cage2 avatar Feb 22 '23 14:02 cage2

sorry for replying so lately, something is wrong with my old account,and i create a new one

i will test it as soon as possible and give feedback.

thanks again

emacs-newer avatar Feb 24 '23 06:02 emacs-newer

On Thu, Feb 23, 2023 at 10:27:38PM -0800, you wrote:

Hi!

sorry for replying so lately, something is wrong with my old account,and i create a new one

i will test it as soon as possible and give feedback.

No problem! Take your time and thanks for testing! Bye! C.

cage2 avatar Feb 24 '23 08:02 cage2

i test for both english and CJK characters and they all work as expected.

just a problem maybe:

it will wait for a little time when the text content is too big with a lot of annotations, escpecially for CJK characters.

is there anyway to improve the performance?

emacs-newer avatar Feb 25 '23 00:02 emacs-newer

On Fri, Feb 24, 2023 at 04:18:20PM -0800, you wrote:

Hi!

i test for both english and CJK characters and they all work as expected.

Good!

just a problem maybe:

it will wait for a little time when the text content is too big with a lot of annotations, escpecially for CJK characters.

This happens when a single annotation is added or when visiting a file with a lots of annotations?

is there anyway to improve the performance?

Likely yes but i guess it will not be simple, i need to reproduce the issue, first.

BTW thanks a lot for your precious help! I would like to mention you in the 'NEWS.org' file, if you agree let me know how to mention you.

Thanks again for helping improving this package! C.

cage2 avatar Feb 25 '23 11:02 cage2

i will give a full sample to reproduce in 3days,sorry

well,it doesn't matter about name if you like to refer to,and all i do is to make it more powerful for emacs.

and the most contributions are offered by you,thanks

emacs-newer avatar Feb 26 '23 03:02 emacs-newer

On Sat, Feb 25, 2023 at 07:18:32PM -0800, you wrote:

Hi!

i will give a full sample to reproduce in 3days,sorry

It's fine, no needs to be sorry! We are not in a hurry! :)

well,it doesn't matter about name if you like to refer,and all i do is to make it more powerful for emacs.

and the most contributions are offered by you,thanks

But you proposed the idea for this feature, it is also my pleasure to give you the credits i think you deserve! :) BTW, I will mention you as 'emacs-newer', OK? :)

Bye! C.

cage2 avatar Feb 26 '23 14:02 cage2

hi i'm back.

i test many times and make sure that the real problem is org mode not annotate.el.

org-cycle plays slowly the same as hide annotations for cjk characters.

so i think we should change a way to do the work.

in my opinion, i have an idea:

just hide/show the current window content inside the screen size.

if there are annotations inside eye area,then hide/show the annotations by hand,and others in current buffer keep as usual.

i think it will play much better and be more suitable for people like me.

emacs-newer avatar Mar 09 '23 05:03 emacs-newer

Hi @emacs-newer !

I am not sure how and if there is a easy and reliable way to get the portion of text that is visible in a buffer window. If it was not possible what about adding a command that hide all the annotation in a region?

Bye! C.

cage2 avatar Mar 10 '23 14:03 cage2

forget what i said above, that is not a good way

maybe can try this:

just hide/show the cursor position annotation if there is. i just read books and often annotate the part needed to think about deeply, so that's the reason why i wanna hide/show annotations.

because the thought is changed always by life so i can modify them when there is needed.

how about this?

emacs-newer avatar Mar 10 '23 23:03 emacs-newer

in personally, i want to enable annotate-mode in org-mode automatically but hide all annotations by default, so i add hook to org-mode, but how to hide all annotations by default when annotate mode is on.

and when i press c-c c-a on existed annotation, it just tell me to write new annotation instead of show current annotation to let me modify it.

emacs-newer avatar Mar 10 '23 23:03 emacs-newer

Hi @emacs-newer !

[...]

just hide/show the cursor position annotation if there is. i just read books and often annotate the part needed to think about deeply, so that's the reason why i wanna hide/show annotations.

There is the command: annotate-toggle-annotation-text that hide the annotation under cursor, could this command be the one that you need?

Bye! C.

cage2 avatar Mar 11 '23 10:03 cage2

Hi @emacs-newer !

in personally, i want to enable annotate-mode in org-mode automatically but hide all annotations by default, so i add hook to org-mode, but how to hide all annotations by default when annotate mode is on.

I also thought that settings an hook should do the job, i would write something like:

(add-hook 'lisp-mode-hook
          'annotate-toggle-all-annotations-text
          99)

Did you tried something similar to the code above?

Bye! C.

cage2 avatar Mar 11 '23 10:03 cage2

Hi @emacs-newer !

in personally, i want to enable annotate-mode in org-mode automatically but hide all annotations by default, so i add hook to org-mode, but how to hide all annotations by default when annotate mode is on.

I also thought that settings an hook should do the job, i would write something like:

(add-hook 'lisp-mode-hook
          'annotate-toggle-all-annotations-text
          99)

Did you tried something similar to the code above?

Bye! C.

yes you are right and i'm stupid suddenly..

emacs-newer avatar Mar 16 '23 07:03 emacs-newer

On Thu, Mar 16, 2023 at 12:10:41AM -0700, you wrote:

Hi!

[...]

yes you are right and i'm stupid suddenly..

No need to blame yourself, we all make mistakes. I make a lot of mistakes, for example! :D

Bye! C.

cage2 avatar Mar 16 '23 13:03 cage2

it seems that there is no way to use "custom-set-faces" to add into theme

emacs-newer avatar Mar 28 '23 05:03 emacs-newer

Hi @emacs-newer !

it seems that there is no way to use "custom-set-faces" to add into theme

I am afraid I can not understand what you are trying to do, please can you elaborate?

Bye! C.

cage2 avatar Mar 29 '23 14:03 cage2

sorry, i mean the code can not be added into dark/light theme.el files to work

the theme el files use

(custom-set-faces
.....
)

emacs-newer avatar Mar 30 '23 07:03 emacs-newer

Hi @emacs-newer !

To accomplish what you want you probably needs to write an elisp function that does two things:

  • sets the theme
  • then setting the colors fo the annotations using the variables described here:

https://github.com/bastibe/annotate.el/blob/master/annotate.el#L96

and here:

https://github.com/bastibe/annotate.el/blob/master/annotate.el#L101

Bye! C.

cage2 avatar Apr 01 '23 16:04 cage2