goj...@gmail.com writes:

> On 150820 Thu 9:00, David Kastrup wrote:
>
>> I tend to right-click on the preview, copy the preview content and paste
>> it above where I am editing.  Cleaning up afterwards is also easy with
>> the mouse (two right mouse clicks in a row delete the current mouse
>> selection).
>>
>> That is not to say that the requested feature wouldn't be useful,
>> particularly for a keyboard-centric workflow.
>>
>
>
> Thank you for the feedback & tip, David. In my case I often need only
> to take a peek at the code of some previous formula, eg to see which
> macro I used to produce a particular symbol (I have a very short
> memory). That's why to push only a button to quickly toggle on/off
> would be useful.

Several other options come to mind, like a mode where mouse-over removes
the preview.  Or two parallel (synchronized?) windows where one is
without previews (that's only possible on Emacs rather than XEmacs since
one can restrict overlays to show only on a particular window).

> As a temporary solution I'm making a function that does a backward or
> forward regexp-search to the beginning of any inline or display math
> (like "\\begin{\(eq\|al\|ga\)" or "\\(" etc), so as to automatically
> toggle the preview as the search cycles. This way I can cyclically
> open them and come back at point by quitting the search.

On Emacs, I think that you could use

(preview-open-overlays (overlays-in BEG END))

Preview overlays should have a non-nil state of the 'preview-state
property, and there also is
preview-toggle is a compiled Lisp function in ‘prv-emacs.el’.

(preview-toggle OV &optional ARG EVENT)

Toggle visibility of preview overlay OV.
ARG can be one of the following: t displays the overlay,
nil displays the underlying text, and 'toggle toggles.
If EVENT is given, it indicates the window where the event
occured, either by being a mouse event or by directly being
the window in question.  This may be used for cursor restoration
purposes.


So filtering the output of overlays-at (possibly given window-start and
window-end ?) for preview overlays and then calling preview-toggle with
some settings on all of them should be reasonably simple.

-- 
David Kastrup

_______________________________________________
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex

Reply via email to