* export-cancel: Used to cancel background export processes.
+* master-buffer-forall executes an lfun in the master and all children of a document.
+
* paragraph-select is a new convenience function to select the paragraph
surrounding the actual cursor position.
LFUN_BIDI,
// 380
LFUN_BUFFER_RESET_EXPORT, // spitz 20191226
+ LFUN_MASTER_BUFFER_FORALL, // spitz 20191231
LFUN_LASTACTION // end of the table
};
* \endvar
*/
{ LFUN_MASTER_BUFFER_EXPORT, "master-buffer-export", ReadOnly, Buffer },
+
+/*!
+ * \var lyx::FuncCode lyx::LFUN_MASTER_BUFFER_FORALL
+ * \li Action: Applies a command to a buffer and all it children, starting from the master.
+ * \li Syntax: master-buffer-forall <LFUN-COMMAND>
+ * \li Params: <LFUN-COMMAND>: The command to be applied to the buffers.
+ * \li Sample: Close all Notes in buffers: \n
+ master-buffer-forall inset-forall Note inset-toggle close \n
+ Toggle change tracking on buffers: \n
+ master-buffer-forall changes-track \n
+ Toggle read-only for buffers: \n
+ master-buffer-forall buffer-toggle-read-only \n
+ Show statistics for individual buffers: \n
+ master-buffer-forall statistics \n
+ Activate the branch named "Solutions" in buffers: \n
+ master-buffer-forall branch-activate Solutions \n
+ * \li Origin: spitz, 31 Dec 2019
+ * \endvar
+ */
+ { LFUN_MASTER_BUFFER_FORALL, "master-buffer-forall", ReadOnly | Argument, Buffer },
/*!
* \var lyx::FuncCode lyx::LFUN_MASTER_BUFFER_UPDATE
enable = doc_buffer != 0;
break;
+ case LFUN_MASTER_BUFFER_FORALL:
+ enable = doc_buffer != 0;
+ break;
+
case LFUN_BUFFER_WRITE:
enable = doc_buffer && (doc_buffer->isUnnamed() || !doc_buffer->isClean());
break;
break;
}
+ case LFUN_MASTER_BUFFER_FORALL: {
+ if (!doc_buffer)
+ break;
+
+ FuncRequest funcToRun = lyxaction.lookupFunc(cmd.getLongArg(0));
+ funcToRun.allowAsync(false);
+
+ for (Buffer const * buf : doc_buffer->allRelatives()) {
+ // Switch to other buffer view and resend cmd
+ lyx::dispatch(FuncRequest(
+ LFUN_BUFFER_SWITCH, buf->absFileName()));
+ lyx::dispatch(funcToRun);
+ }
+ // switch back
+ lyx::dispatch(FuncRequest(
+ LFUN_BUFFER_SWITCH, doc_buffer->absFileName()));
+ break;
+ }
+
case LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR:
LASSERT(doc_buffer, break);
doc_buffer->clearExternalModification();