Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
emacs25 opened this issue Feb 12, 2023 · 21 comments
Open

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

emacs25 opened this issue Feb 12, 2023 · 21 comments

Comments

@emacs25
Copy link

emacs25 commented Feb 12, 2023

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.

@cage2
Copy link
Collaborator

cage2 commented Feb 12, 2023 via email

@cage2
Copy link
Collaborator

cage2 commented Feb 15, 2023

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
Copy link
Collaborator

cage2 commented Feb 22, 2023

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.

@emacs-newer
Copy link

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

@cage2
Copy link
Collaborator

cage2 commented Feb 24, 2023 via email

@emacs-newer
Copy link

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?

@cage2
Copy link
Collaborator

cage2 commented Feb 25, 2023 via email

@emacs-newer
Copy link

emacs-newer commented Feb 26, 2023

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

@cage2
Copy link
Collaborator

cage2 commented Feb 26, 2023 via email

@emacs-newer
Copy link

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.

@cage2
Copy link
Collaborator

cage2 commented Mar 10, 2023

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.

@emacs-newer
Copy link

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
Copy link

emacs-newer commented Mar 10, 2023

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.

@cage2
Copy link
Collaborator

cage2 commented Mar 11, 2023

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
Copy link
Collaborator

cage2 commented Mar 11, 2023

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.

@emacs-newer
Copy link

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..

@cage2
Copy link
Collaborator

cage2 commented Mar 16, 2023 via email

@emacs-newer
Copy link

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

@cage2
Copy link
Collaborator

cage2 commented Mar 29, 2023

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.

@emacs-newer
Copy link

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
.....
)

@cage2
Copy link
Collaborator

cage2 commented Apr 1, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants