We had a question recently about how to remove all Index insets from the document. Rather than building yet another UI for that, the following dirty function maybe be useful, although mostly for power user (not the kind of function that I would like to see advertised prominently
in UserGuide).

Remove all index insets:
inset-forall Index delete-char-forward

Close all Notes (also works for a particular branch, for example)
inset-forall Note inset-toggle close

Close only yellow sticky notes
inset-forall Note:Note inset-toggle close

Put LyX in an infinite loop if there is at least a Note:
inset-forall Note char-backward

This function has several problems:
- can freeze LyX (see above)
- the cursor is reset to beginning of document (keeping it where it was can
  be problematic if the length of the document changes)
- the commands that work now will not work anymore when the Inset Name Cleanup is done, so we do not want peaople to start binding this to lots of things.

Known bugs that are fixable:
- depm not handled
- will not work for insets which names contain a space.

Have fun.

Attachment: insetforall.diff
Description: Binary data


Reply via email to