|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
#!/usr/bin/env lua5.1
-- This file: (find-angg "LUA/djview-hack.lua")
-- See: (find-es "scan" "djview-default-page")
-- (find-angg ".emacs" "ee-find-djvu-cleanup")
-- (find-fline "~/.config/DjVuLibre/DjView.conf")
-- (find-fline "~/.config/DjVuLibre/DjView.conf" "recentFiles=")
-- (find-efunction 'find-djvupage)
-- (find-efunction 'find-djvu-page)
-- (find-sh0 "djview-hack.lua")
-- (setq ee-find-djvu-page-options '("-fs" "-geometry" "+0+0"))
-- Test:
-- (find-efunction 'find-djvu-page)
-- (find-elephantpage (+ 17 195) "A4.4 Local Operators")
-- (ee-find-djvu-cleanup)
-- (find-elephantpage (+ 18 264) "B1.3 Fibred Categories")
fname = ee_expand "~/.config/DjVuLibre/DjView.conf"
if not fileexists(fname) then
error("Conf file not found: "..fname)
os.exit(1)
end
bigstr = readfile(fname)
print("Read: "..fname)
pat1 = "recentFiles=[^\n]+"
pat2 = "\nrecentFiles=[^\n]+\n"
line = bigstr:match(pat1)
newbigstr = bigstr:gsub(pat2, "\n")
if line then
print("Deleting this line:")
print(line)
writefile(fname, newbigstr)
print("Wrote: "..fname)
else
print("A line containing 'recentFiles=' was not found")
end
--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile "djview-hack.lua"
= line
if line then writefile(fname, newbigstr) end
--]]