diff --git a/src/filters/rclorgmode.py b/src/filters/rclorgmode.py index cf23773e..b009d8e8 100755 --- a/src/filters/rclorgmode.py +++ b/src/filters/rclorgmode.py @@ -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") diff --git a/src/sampleconf/mimeview b/src/sampleconf/mimeview index 1a83b213..78137e36 100644 --- a/src/sampleconf/mimeview +++ b/src/sampleconf/mimeview @@ -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