From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: proposal to make C-c C-c not remove latex overlays
Date: Wed, 16 Jul 2014 07:31:02 -0400 [thread overview]
Message-ID: <877g3dsfpl.fsf@gmail.com> (raw)
In-Reply-To: olua989vbt5.fsf@med.uni-goettingen.de
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> Hi all,
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> I am using org-mode files with equations and code blocks in lectures,
>> and it is problematic that C-c C-c removes the equation overlays when
>> running a code block. First, you have to press C-c C-c twice to run the
>> block, since the first one gets rid of the equations, but then you have
>> run C-c C-x C-l to get the equations back! and the cycle repeats
>> throughout a lecture.
>>
>> I would prefer that the equations stay untouched, and that the code
>> blocks run without modifying them.
>>
>> I think the best behavior would be for C-c C-x C-l to toggle the
>> equations, and to remove the C-c C-c behavior for latex overlays
>> completely.
>
> Since this thread focusses on work arounds and local customizations so
> far, let me just say, that I completely agree here. What is the
> reasoning behind the current key binding? Is there any benefit over
> using the same key binding to toggle the state?
>
I'm inclined to agree too: I imagine it would be very annoying after
a while.
There are three things that C-c C-c currently undoes in an ad-hoc
fashion. The first cond clause in the function looks like this:
,----
| ((or (and (boundp 'org-clock-overlays) org-clock-overlays)
| org-occur-highlights
| org-latex-fragment-image-overlays)
| (and (boundp 'org-clock-overlays) (org-clock-remove-overlays))
| (org-remove-occur-highlights)
| (org-remove-latex-fragment-image-overlays)
| (message "Temporary highlights/overlays removed from current buffer"))
`----
So if there are clock overlays or occur highlights or latex fragment
image overlays, they are undone and the function is finished. This seems
like a separate issue from the main thrust of what C-c C-c does (and it
does a lot), so my inclination would be to suggest that each of the
above conditions be togglable, using the standard keybinding for each
(C-c C-x C-l for latex fragment image overlay toggling, C-c C-x C-d for
clock display - occur highlights only happen from org-goto with the "/"
keybinding, but there is no org-global keybinding I believe).
However there is a variable that modifies that behavior:
,----
| org-remove-highlights-with-change is a variable defined in `org.el'.
| Its value is t
|
| Documentation:
| Non-nil means any change to the buffer will remove temporary highlights.
| Such highlights are created by `org-occur' and `org-clock-display'.
| When nil, `C-c C-c needs to be used to get rid of the highlights.
| The highlights created by `org-preview-latex-fragment' always need
| `C-c C-c' to be removed.
`----
If most of us leave that variable's value at default, the ad-hoc-kery
probably does not raise its head except for latex fragments. If that's
the case, then getting rid of just latex fragment undoing in
org-ctrl-c-ctrl-c and toggling with C-c C-x C-l is probably the best
solution. It probably would be a good idea to make the handling of clock
overlays similar as well and make C-c C-x C-d toggle the clock overlay
state (I'd be inclined to take that out of org-ctrl-c-ctrl-c as well,
since I suspect that almost nobody uses it, given the variable above and
its default value - but that's only a hunch). That would leave only
occur highlights to be undone by org-ctrl-c-ctrl-c - which is ugly but
the function is a kitchen-sink kind of function anyway, so that's
probably OK.
Alternatively, make org-ctrl-c-ctrl-c undo these things as it does
today, but only with a triple prefix arg (which afaict is not used
today).
As Nicolas would say, WDYT?
--
Nick
next prev parent reply other threads:[~2014-07-16 11:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 22:22 proposal to make C-c C-c not remove latex overlays John Kitchin
2014-07-15 0:33 ` Aaron Ecay
2014-07-15 2:04 ` Grant Rettke
2014-07-15 21:00 ` John Kitchin
2014-07-16 1:28 ` Grant Rettke
2014-07-16 12:45 ` John Kitchin
2014-07-15 21:13 ` John Kitchin
2014-07-15 22:52 ` Nick Dokos
2014-07-16 13:26 ` John Kitchin
2014-07-28 15:27 ` Sebastien Vauban
2014-07-16 10:27 ` Andreas Leha
2014-07-16 11:31 ` Nick Dokos [this message]
2014-07-16 13:29 ` John Kitchin
2014-07-27 17:47 ` Bastien
2014-07-31 21:49 ` Charles Berry
2014-08-01 11:53 ` Bastien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877g3dsfpl.fsf@gmail.com \
--to=ndokos@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.