orgmode: also index text before the first heading. Add mimeview config

This commit is contained in:
Jean-Francois Dockes 2022-04-06 19:29:23 +02:00
parent 6643f48a7f
commit ad2db6cd1c
2 changed files with 10 additions and 3 deletions

View File

@ -13,7 +13,8 @@ class OrgModeExtractor:
self.file = ""
self.contents = []
self.em = em
self.selftext = ""
def extractone(self, index):
if index >= len(self.docs):
return(False, "", "", True)
@ -44,6 +45,9 @@ class OrgModeExtractor:
res = rb'''^\* '''
self.docs = re.compile(res, flags=re.MULTILINE).split(data)
# Note that there can be text before the first heading. This goes into the self doc,
# because it's not a proper entry.
self.selftext = self.docs[0]
self.docs = self.docs[1:]
#self.em.rclog("openfile: Entry count: %d" % len(self.docs))
return True
@ -68,7 +72,7 @@ class OrgModeExtractor:
eof = rclexecm.RclExecM.eofnext
else:
eof = rclexecm.RclExecM.noteof
return (True, "", "", eof)
return (True, self.selftext, "", eof)
if self.currentindex >= len(self.docs):
self.em.rclog("getnext: EOF hit")

View File

@ -24,7 +24,8 @@
xallexcepts = application/pdf application/postscript application/x-dvi \
text/html|gnuinfo text/html|chm text/html|epub text/html|rclman \
application/x-fsdirectory|parentopen inode/directory|parentopen \
application/vnd.ms-visio.drawing application/x-ipynb+json
application/vnd.ms-visio.drawing application/x-ipynb+json \
text/x-orgmode text/x-orgmode-sub
[view]
@ -218,6 +219,8 @@ text/x-c++ = emacsclient --no-wait %f
text/x-csv = libreoffice %f
text/x-html-sidux-man = konqueror %f
text/x-html-aptosid-man = iceweasel %f
text/x-orgmode-sub = emacsclient --no-wait %F
text/x-orgmode = emacsclient --no-wait %f
application/x-chm = kchmviewer %f
# Html pages inside a chm have a chm rclaptg set by the filter. Kchmviewer