amno1 / org-view-mode

An attempt to create a markup-free read-only view mode for org-mode files in Emacs.
GNU General Public License v3.0
49 stars 1 forks source link

Feature Request: hide emphasis markers #6

Open molok opened 2 years ago

molok commented 2 years ago

this is pretty easy to do since you just have to toggle org-hide-emphasis-markers

amno1 commented 2 years ago

Yes I know. I left on purpose org-hide-emphasis-markers, org-toggle-pretty-entities and org-toggle-inline-images to users. Since those are already implemented in org-mode, I thought that users already have their opinion if they prefer those on or off, so I left those untouched.

If user prefer, toggling those could be easily added with a function or lambda to org-view-mode-hook.

Ypot commented 2 years ago

I agree with @molok : more "agressivity" would be welcome. I, as user, wouldn't mind if I would have to customize it, to change some of your choices (but I would like to know your reach and preferred choices).

amno1 commented 2 years ago

The problem is that each of those features means I have to add a user option to toggle it, to save the old value into another variable and to restore the old value upon exit as as to document it. Org-mode already provides all of that, so why not use what is already in org-mode?

I am not sure about it, it feels like adding an extra layer of options for things that already are customizable options. Org-hide-emphasis-markers is typically set in with-eval-after-load 'org-mode (or somewhere in use-package for most of ppl I guess) along with some other org-mode options. Auto displaying images can be really slow in case of big images or many images, so it is probably better left per buffer. Anyway, if you would like to have this auto on, and to turn it off per-buffer, you can do this somewhere in your init file:

(defun org-view-prettify-more ()
  (setq org-hide-emphasis-markers t)
  (unless org-inline-image-overlays
    (org-toggle-inline-images))
  (unless org-pretty-entities
    (org-toggle-pretty-entities)))

(add-hook 'org-view-mode-hook #'org-view-prettify-more nil t)