(This follows the answer to the question: Completion of sentences stored in a file.)
Suppose I have a file, the content of which being organized thanks to org-mode
:
* Dreams ≠ reality
Please, don't take your dreams for reality: (a + b)² ≠ a² + b².
Please, don't take your dreams for reality: cos(a + b) ≠ cos a + cos b.
No, √(a²) ≠ a.
* Derivatives
You should revise the derivatives.
* General remarks
This only works for a positive x.
Edit after @NickD comments:
AFAICS, the function used for reading this file, ?insert-file-contents
, filters (I mean ignores) empty lines. Is it possible to ask it to filter lines starting with a *
as well
Is it possible to ask the function used for reading this file, insert-file-contents
, or a consequent one, to filter some lines, e.g. those starting with a *
insert-file-contents
ignores empty lines, but I don't think that's true.split-string
: the buffer contents are read as a string, thensplit-strig
splits it on newlines and (because of thet
third argument) it omits null string matches. It has nothing to do withinsert-file-contents
.split-string
takes a TRIM argument that can be used to omit such lines from the result. But that's not going to work in a more general context.