;; (load "lb-en.el") ;; (load "lb-es.el") ;; Markup. ;; Emacs-Time-stamp: "2007-11-02 15:55:36" (setq file-stamp "Emacs-File-stamp: \"/home/ysverdlov/leninist.biz/lb-ht.el\"") ;; TO-DO: Check: more than "_-_-_" per page. ;; ;; TO-DO: If 100-pg .tx files change in copy directory, how does index.txt update? ;; ;; TO-DO: In footnote text region at page bottom, check for

before markers. ;; ;; TO-DO: ;; ;; TO-DO: ;; ;; TO-DO: ;; ;; TO-DO: ;; ;; TO-DO: ;; ;; TO-DO: ;; ;; TO-DO: ;; ;;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv (defvar lbg- nil "") (defvar lbg- nil "") (defvar lbg- nil "") (defvar lbg-i-from1 nil "") (defvar lbg-html-href nil "") (defvar lbg-html-hrefs nil "") (defvar lbg-html-index nil "") (defvar lbg-card-index nil "") (defvar lbg-this-section nil "") (defvar lbg-next-section nil "Set by lb-ht-footnote-pop-from-next-section") (defvar lbg-pf-output-html nil "") (defvar lbg-original-page-last nil "") (defvar lbg-original-page-first nil "") (defvar lbg-sections nil "") (defvar lbg-sections-max-levels nil "Maximum value of 'LVL'") (defvar lbg-sections-max-levels-list nil "List of largest 'LVL' by section") (progn ;; (defvar lbg-pf-log nil "") (defvar lbg-text-indextxlog nil "") (defvar lbg-text-indextab nil "") (defvar lbg-text-indextx nil "") (defvar lbg-text-indextxt nil "")) (defvar lb-ht-footnote-page-and-marker-separator ;; (_makunbound) "•" "") (defvar lb-ht-footnote-href-prefix-fw "forw" "") ;; (_makunbound) (defvar lb-ht-footnote-href-prefix-bk "back" "") ;; (_makunbound) (defvar lb-ht-__ nil "meta data") ;; (_makunbound) ;; (lb-ht-gen-del-self-href) (defun lb-ht-gen-del-self-href (&optional arg1fnsd-bfn) ;)(03 b "Delete href= and value if value matches filename of current buffer. Hmmm... seems more general than that... 2007.08.07 WARNING! Whole paragraph, surrounded by blank lines, is deleted" (_-dfun-hook "lb-ht-gen-del-self-href") ;; (let ( _rc) (if (not arg1fnsd-bfn) (setq arg1fnsd-bfn (file-name-sans-directory (bfn)))) ;; EXCEPTION - change, do not delete. ;; 2006.12.12 - 'href="#index.pdf"' in files like en/PS . (save-excursion (goto-char (point-min)) (while (search-forward-regexp (concat "[ \t\n]+href=/ ;; (match-string 0) "\\(" ;; (match-string 1) "#index[.]" ;; fix! no hardcode. "\\(txtttt\\|ps\\|pdf\\)" ;; (match-string 2) "\\)" "\"") nil t) (replace-match (file-name-sans-extension (file-name-sans-directory (lb-get-diskfilename (match-string-no-properties 2)))) t t nil 1))) ;; (save-excursion (goto-char (point-min)) (while (search-forward-regexp (concat "[ \t\n]+href=/ arg1fnsd-bfn ;; 2006.12.13 - "index.html#index.card" ;; 2006.12.13 - "index.html#index.html" ;; "\"" "\\(\"\\|#\\)" ) nil t) ;; WARNING! Will delete both href= and title= if in same paragraph. ;; (replace-match "") (_-para-delete))) _rc)) ;; (lb-ht-sub-__ lb-ht-__) (defun lb-ht-sub-__ (&optional arg1__assoc) ;)(03 d. "Replace __TAG__ with values from ARG1. Optional ARG1 is an assoc list. Without ARG1, default replacements are done (e.g., __FORMULA_MISSING__)" ;; (_-dfun-hook "lb-ht-sub-__") ;; (let ((lb-dfun (_-dfun-hook "lb-ht-sub-__")) lb-pf lb-pt lb-list-arg1 lb-item lb-tag-__ lb-str lb-cons lb-ms1 lb-ms2 lb-rc) ;; (setq lb-list-arg1 arg1__assoc) ;; Whenever list passed as ARG1, do default replacements just in case. ;; This way, the call without ARG1 does not have to be repeated. (if lb-list-arg1 (lb-ht-sub-__)) ;; MAIN 1 OF 2. --------------------------------- ;; MAIN 1 OF 2. --------------------------------- ;; MAIN 1 OF 2. --------------------------------- ;; Do this first, before lb-list-arg1 potentially modified. (when (not lb-list-arg1) ;; __NUMERIC_LVL1__ ...2 ...3 ;; __ALPHA_LVL1__ ...2 ...3 (goto-char (point-max)) ;; SEE: ;; (lb-tx-zap-paragraphs lb-re-__-lvl4chunking-real) (while (and (search-backward-regexp lb-re-__-lvl4chunking-real nil t) (setq lb-ms1 (match-string-no-properties 1)) (setq lb-ms2 (match-string-no-properties 2)) (progn (progn (replace-match "") (if (_-blank-line-p) (_-move-away-from-adjacent-blank-line))) (goto-char (car (_-where-double-newlines))) (insert "

\n") (goto-char (cdr (_-where-double-newlines))) (insert "\n
\n") ;; (if (and (string= "alpha" lb-ms1) (>= 3 (_-string-to-int lb-ms2))) (insert "
 
\n")) t))) ;; __FORMULA_MISSING__ (goto-char (point-max)) (while (search-backward-string "__FORMULA_MISSING__" nil t) (tx-editing-del-para) (insert "\n\n" "
\n" "
\n" "
\n" "\n") ) ) ;; when ;; MAIN 2 OF 2. --------------------------------- ;; MAIN 2 OF 2. --------------------------------- ;; MAIN 2 OF 2. --------------------------------- (while lb-list-arg1 ;; (message "OUTER: %s" (int-to-string (setq n (1+ n)))) (progn (setq lb-tag-__ (car (setq lb-item (car lb-list-arg1)))) (setq lb-str (cdr lb-item))) (when nil (message "%s" (concat " " lb-dfun ": OUTER while: " lb-tag-__ "\n" " " (prin1-to-string lb-list-arg1)))) ;; (goto-char (point-max)) (while (search-backward-string lb-tag-__ nil t) ;; (message "INNER: %s" (int-to-string (setq n (1+ n)))) ;; (message "INNER: %s" (_-current-line)) (replace-match (with-temp-buffer (insert lb-str) ;; on-the-fly (when (and (string= "__ALPHA_LVL2__" lb-tag-__) (> (length lb-str) 0)) (save-match-data ;; lb-alpha2: 6. DIALECTICS OF THE OBJECTIVE ;; (setq lb-pt (point-max)) (goto-char (point-min)) (when (search-forward-regexp "<\\([A-Ba-b]+\\)" nil t) (setq lb-str (match-string 1)) (save-excursion (goto-char lb-pt) (setq lb-pt (search-backward (concat ""))))) (goto-char lb-pt) (insert "") ;; (goto-char (point-min)) (search-forward-regexp "[0-9][.]\\([ \t\n\r]+\\)") (replace-match "\n
" t t nil 1))) (buffer-string)) t t nil nil)) ;; end while. (setq lb-list-arg1 (cdr lb-list-arg1))) ;; while control. end while. lb-rc)) (defun lb-ht-comment-page-numbers (arg1pf) ;)(03 h. "" (_-dfun-hook "lb-ht-comment-page-numbers") ;; (let (lb-pf lb-src lb-str lb-pt-bound lb-rc) (save-match-data (save-excursion (progn (string-match (expand-file-name lb-home) arg1pf) (setq lb-src (replace-match "" nil nil arg1pf))) (progn (goto-char (point-min)) (setq lb-pt-bound (search-forward-string " "))) (goto-char (point-max)) (while (search-backward-regexp lb-re-bracketed-para-integer lb-pt-bound t) (setq lb-str (match-string 1)) (replace-match (lb-ht-src_pg_dte_www lb-src lb-str _-where-page-numbers))) )) lb-rc)) ;; (lb-ht-get-copy-directories "en/1926/MD152") (defun lb-ht-get-copy-directories (arg1subpath) "" (_-dfun-hook "lb-ht-get-copy-directories") ;; (let (lb-pf) (setq lb-pf (concat lb-home arg1subpath)) (with-temp-buffer (shell-command (concat "find " lb-pf " -follow -type d -name '" lb-re-YYYYMMDD"'") t) (buffer-string) (_-something-to-list)))) (defun lb-ht-src_pg_dte_www (arg1s arg2p arg3where) "Return source (ARG1), page (ARG2), and where-page-numbers (ARG3) combined with current date as an SGML comment" ;; (let (lb-pf lb-item lb-www lb-rc) (if (integerp arg2p) (setq arg2p (int-to-string arg2p))) (save-match-data ;; Assumption: Website URL is in local path: "~/leninist.biz/" (loop for lb-item in (reverse (split-string lb-home "/")) do (if (and (not lb-www) (string-match "[a-z0-9]" lb-item)) (setq lb-www lb-item))) ;; OLD: (setq lb-rc (concat "\n\n\n\n")) (setq lb-rc (concat ;; 2006.03.24 "\n\n\n\n"))) lb-rc)) ;; (defun lb-ht-harvest-levels nil " Function 'lb-ht-toc-parse-a-__heading__-para' moves point forward. Function 'lb-ht-toc-parse-a-__heading__-para' will skip over paragraphs not matched by 'lb-re-__-lvl4chunking-real' and return nil instead of a level list" (_-dfun-hook "lb-ht-harvest-levels") ;; (let ( lb-rc) (while (or (looking-at lb-re-__-lvl4chunking) ;; fix? ;; Maybe include quotations at beginning of chapter that ;; fall inbetween LVL1 and LVL2 in original? (looking-at lb-re-__-lvl4chunking-skipover) ) (if (looking-at lb-re-__-lvl4chunking) (setq lb-rc (append lb-rc (list (lb-ht-toc-parse-a-__heading__-para)))) ;; xxxtender 7 ;; Otherwise, (progn (goto-char (cdr (_-where-double-newlines))) (_-move-forward-whitespace)) ;; Position for next one. nil)) lb-rc)) ;; (defun lb-ht-para-type (arg1str &optional arg2prevrc) "Return type of object judging from string ARG1. Optional ARG2 is value returned by previous call to this function" ;; (let (lb-pf lb-rc) (save-match-data (if (and (not lb-rc) (string-match "^\\(Emacs-\\)?Time-stamp:" arg1str)) (setq lb-rc "TIME-STAMP")) ;; __NUMERIC_LVL1__ and __ALPHA_LVL1__. (if (and (not lb-rc) (string-match (concat "^" lb-re-__) arg1str)) (setq lb-rc (match-string 0 arg1str))) (if (and (not lb-rc) (string-match "^ (point) (point-min)) (or (forward-char -1) t)) (if (looking-at "[ \t\n\r][=][ \t]*[\n]") t))))) (setq lb-rc "CONTINUED-=")) ;; TEMPLATES. (if (and (not lb-rc) (string-match "^abcdefg" arg1str)) (setq lb-rc "")) (if (and (not lb-rc) (string-match "^abcdefg" arg1str)) (setq lb-rc "")) (if (and (not lb-rc) (string-match "^abcdefg" arg1str)) (setq lb-rc "")) (if (and (not lb-rc) (string-match "^abcdefg" arg1str)) (setq lb-rc "")) ;; DEFAULT (if (null lb-rc) (setq lb-rc "OTHER"))) lb-rc)) ;; (defun lb-ht-get-minors (arg1chaptitle) "ARG1 is an nth-1 from list returned by lb-ht-toc-get-headings" ;; (lb-ht-get-minors (nth 1 (lb-ht-toc-get-headings 12))) ;; (lb-ht-get-minors nil) ;; => ((8 . "1. OVERCOMING HEGEL") ...) (_-dfun-hook "lb-ht-get-minors") ;; (let ( lb-rc) (loop for i from 1 to (1- (length lbg-sections)) do (setq lb-headings-there (lb-ht-toc-get-headings i t)) (if (string= arg1chaptitle (nth 1 lb-headings-there)) (_-app 'lb-rc (list (cons (nth 3 lb-headings-there) i))))) lb-rc)) ;; (lb-ht-gen-insert-img-close-slash) (defun lb-ht-gen-insert-img-close-slash nil "ABBYY uses so insert slash before '>'" ;; (_-dfun-hook "lb-ht-gen-insert-img-close-slash") (let (_rc) (goto-char (point-min)) (while (search-forward-regexp "<[iI][mM][gG]" nil t) (replace-match (downcase (match-string-no-properties 0)) t t) (search-forward-string ">") (when (not (looking-at-backward-become-forward "/[ \t\n]*>")) (forward-char -1) (insert " /"))) _rc)) (defun lb-ht-gen-add-span-pageno-subroutine (arg1where-lag) (setq _pg (match-string-no-properties 1)) (setq _where (match-string-no-properties 2)) (let (_visible _visible-on-the-fly) (if (setq _visible (if (string= "top" _where) _pg (if arg1where-lag arg1where-lag))) (save-excursion (if (string= "bottom" _where) (end-of-line) (beginning-of-line)) (insert (concat "\n\n" "" ;; ON-THE-FLY (progn (setq _visible-on-the-fly _visible) ;; Remove leading "0"s. (if (string-match "^0+" _visible-on-the-fly) (setq _visible-on-the-fly (replace-match "" t t _visible-on-the-fly))) _visible-on-the-fly) "" "\n\n"))))) _pg) ;; (lb-ht-gen-add-span-pageno) (defun lb-ht-gen-add-span-pageno nil "Show page numbers in webpage" ;; (_-dfun-hook "lb-ht-gen-add-span-pageno") (let (_pt _pt-data-begin _pg _pg-lag _where _where-lag _lag _re-pg-where _rc) ;; Where page numbers? (goto-char (point-min)) (while (search-forward-string "where=" nil t) (when (_-sgml-comment-p) (setq _where (progn (looking-at "[^ ]+") (match-string-no-properties 0))) (if (and _where-lag (not (string= _where _where-lag))) (error "%s: %s" _where-lag _where)) (setq _where-lag _where))) ;; fix? uncomment? ;; (setq _pt-data-begin (search-forward-string "%%data%%" nil nil)) (progn (setq _re-pg-where (concat "pg=\\([^ ]+\\)" "[^\n]+" "where=\\([^ ]+\\)")) (if (string= "bottom" _where) (goto-char (point-max)) (if (string= "top" _where) (goto-char (point-min)) (error "%s: %s" "Not top or bottom" _where)))) (if (string= "top" _where) ;; MAIN. (while (sfr _re-pg-where nil t) (when (_-sgml-comment-p) (setq _pg-lag (lb-ht-gen-add-span-pageno-subroutine _pg-lag)))) (while (sbr _re-pg-where nil t) (when (_-sgml-comment-p) (setq _pg-lag (lb-ht-gen-add-span-pageno-subroutine _pg-lag)))) ;; Flush lagged value. (search-backward "%%data%%") (end-of-line) (lb-ht-gen-add-span-pageno-subroutine _pg-lag)) _rc)) (defun lb-ht-OLD-2007.03.04-gen-add-span-pageno nil "Show page numbers in webpage" (_-dfun-hook "lb-ht-gen-add-span-pageno") (let (_pg _where _lag _pt _pt-data-begin _rc) ;; (foo "1" "top") ;; (foo "1" "bottom") (defun foo (_pg _where) (concat "\n\n" "" (if (string= "bottom" _where) (int-to-string (1+ (string-to-int _pg))) _pg) "" "\n\n")) (goto-char (point-min)) (setq _pt-data-begin (search-forward-string "%%data%%" nil nil)) (goto-char (point-max)) (while (and (setq _pt (search-backward-regexp (concat " (if (or (search-backward-string "%%notes%%" nil t) (search-forward-string "%%notes%%" nil t)) (if (not (_-sgml-comment-p)) (tx-editing-del-para))) _rc)) ;; (lb-ht-gen-wrap-arrows-without-hrefs-span-disappear) (defun lb-ht-gen-wrap-arrows-without-hrefs-span-disappear nil "Delete arrow if no HREF" (_-dfun-hook "lb-ht-gen-wrap-arrows-without-hrefs-span-disappear") ;; (let (_pt _rc) (goto-char (point-min)) (while (and (search-forward-regexp ""))) t)) (_-sgml-markup-p)) (goto-char _pt) (if (looking-at "\\(&[lg]t;\\)+<") (replace-match (concat "" (match-string 0) "/span><" ""))))) _rc)) ;; (defun lb-ht-gen-del-leading-href-poundsign nil ;)(03c "Remove '#' from beginning of HREF for final version (not templates)" ;; (_-dfun-hook "lb-ht-gen-del-leading-href-poundsign") (let ( lb-rc) ;; fix! ;; do not hardcode here. (loop for lb-item in '(".index" ;; 2006.11.17 ;;"index" "index.html" ;; 2006.12.04 ;; "bibl" "index.card" "index.txt" "index.ps" "index.pdf") do (if (not (string-match "[.]" lb-item)) (setq lb-item (concat lb-item "" lb-ext-html))) (goto-char (point-min)) (while (search-forward-regexp (concat "href=/"\\(" "#" "\\)" lb-item "\"") nil t) (replace-match "" nil nil nil 1))))) ;; (lb-ht-generate-index-card) (defun lb-ht-generate-index-card nil " NOTE: .db are updated from .index with ~/leninist.biz$ bash lb.sh en 1" (_-dfun-hook "lb-ht-generate-index-card") ;; (let (lb-str lb-tags-in-db lb-tags-in-tmplt lb-pf-db lb-publ-translations (lb-rc lbg-card-index)) ;; fix! Fields like TITLE might be different between .tx and .index !!! (progn ;; (progn (lb-ht-common-__ "lb-ht-generate-index-card") lb-ht-__) (setq lb-tags-in-db (lb-db-get-__-tags (setq lb-pf-db (concat (file-name-directory lbg-html-index) lb-file-db)))) (setq lb-tags-in-tmplt (with-temp-buffer (_-ifcl lbg-pf-template) (normal-mode) (goto-char (point-min)) ;; Isolate table with __TAGS__. (delete-region (point) (search-forward-regexp "") (delete-region (point) (point-max)) (lb-db-get-__-tags nil))) ;; Ensure all __TAGs__ in .db are also in book.htmm. (loop for tag in lb-tags-in-db do (if (and ;; "Private" variables, visible with a click on ".index" (not (member tag (list "__NOTE__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" "__NOTES__" ;; fix! Mark "private" variables in __ "__SCAN_TIFFS__" "__BACK_MATTER__" "__ABBREV__" "__UNIQID__" "__BLEMISHES__" "__APPEAR__" "__REDDOT__" "__OWNER__" "__TO_DO__" "__SOURCE__"))) (not (member tag lb-tags-in-tmplt)) ) (error "%s: %s" (concat "Look in table-index-card.e* for " tag " from " lb-pf-db) lbg-pf-template)) (__handler "PUT" tag (cond ((string= "__PUBL__" tag) (setq lb-str (lb-db-__-get- tag lb-pf-db t)) ;; 2007.11.02 - now allowing full publisher name after abbrev. ;; fix all over: if publisher after abbrev, get abbrev as 1st word. (setq lb-str (nth 0 (split-string lb-str))) (if (not (setq lb-str (assoc lb-str lb-assoc-publ))) (error "%s: %s" tag "lb-assoc-publ") (nth 1 lb-str))) (t ;; fix? - already have a function that deletes <<...>> ? (with-temp-buffer (insert (lb-db-__-get- tag lb-pf-db t)) (while (or (search-forward-regexp "\\(<<\\|>>\\)" nil t) (search-backward-regexp "\\(<<\\|>>\\)" nil t)) (replace-match "")) (buffer-string)) )))) lb-ht-__) ;; MAIN: (progn (_-force-new-file lbg-card-index) (_-ifcl lbg-pf-template) ;; Substitutions and deletions. ;; fix? - move to lb-mu-spawn-finale? ;; YES. 2006.12.12 ;; (lb-ht-subs-and-dels-__) ) (progn (goto-char (point-min)) ;; Needed just once. (while (_-flush-one-paragraph "__PREV_")) (while (_-flush-one-paragraph "__NEXT_"))) (progn (goto-char (point-min)) (search-forward-string "%%data%") (_-para-delete)) ;; Delete navigation table. (progn (goto-char (point-max)) (search-backward "
") (delete-region (point) (search-forward-string "
"))) ;; Delete notes region. (progn (goto-char (point-max)) (search-backward-string lb-str-div-class-notes) (delete-region (point) (search-forward-string ""))) ;; (lb-mu-spawn-finale nil nil (list 'lb-ht-gen-del-leading-href-poundsign ;; index-card 'lb-ht-gen-add-poundsign-with-id ;; index-card 'lb-ht-gen-del-%%notes%% ;; index-card ;; 2007.08.07 '_-highascii2html_entities ;; fix! stick ones like this in a list to share with generate-book! ;; 'lb-ht-gen-wrap-arrows-without-hrefs-span-disappear ;; index-card ) ) (lb-lftp-dosomething-file lbg-card-index) (lb-lftp-dosomething-file (concat (file-name-directory lbg-card-index) lb-file-dot-index)) lb-rc)) ;; (defun lb-ht-subs-and-dels-__ (&optional arg1__assoc) "" ;; (let ( _rc) (if (not arg1__assoc) (setq arg1__assoc lb-ht-__)) ;; __ substitutions. (lb-ht-sub-__ arg1__assoc) ;)(03 d. ;; Delete __TAGS__. (lb-tx-zap-paragraphs lb-re-__) ;)(03 e. _rc)) ;; (lb-ht-common-__) (defun lb-ht-common-__ (&optional arg1) "Set some variables using __handler. Optional ARG1 may be: - called from lb-ht-generate-book ARG1 is the name of that function - called from lb-ht-generate-toc ARG1 is not used " (_-dfun-hook "lb-ht-common-__") ;; (let (lb-title lb-headings lb-lvl-max lb-numeric lb-alpha lb-str lb-cdata lb-tdata lb-href lb-rc) (setq lb-ht-__ nil) (__handler "PUT" "*" (concat " " "
" " * " "
\n\n")) (__handler "PUT" "*_*_*" (concat " " ;; WARNING - 2006.12.08 - Keep this "" ;; 2006.12.08 ;; "  
\n" ;;"  
\n\n" " * * * " ;;"  \n\n" "\n\n")) (__handler "PUT" "TITLE_ELEMENT_TITLE" nil) (__handler "PUT" "TITLE_ELEMENT_SORT_BY_PATH" lbg-path-from-lang) (if (not __TITLE__) (error "%s: %s" "Missing" "__TITLE__") (setq lb-title (_-capitalize-cdata __TITLE__))) (__handler "PUT" "DIV_HEADER_TITLE" ;; 2007.07.02 (_-strip-br--M-9--^^-anchors (_-downcase-nonsignifs lb-title)) ) (__handler "PUT" "DIV_HEADER_SUBTITLE" (_-strip-br--M-9--^^-anchors __SUBTITLE__) ) (__handler "PUT" "DIV_HEADER_SUBTITLE2" (_-strip-br--M-9--^^-anchors __SUBTITLE2__) ) ;; ------------------------------------------------------- ;; When called from: lb-ht-generate-index-card (when (and (stringp arg1) (string= "lb-ht-generate-index-card" arg1)) ;; 140k: /home/login/leninist.biz/en/1970/LTRSP88/index.txt (with-temp-buffer (insert-file-contents-literally lbg-text-indextx nil 0 25000) (goto-char (point-min)) (if (search-forward-string "__COPYRIGHT__" nil t) (__handler "PUT" "COPYRIGHT" (car (lb-tx-get-__ "COPYRIGHT" t))))) ;; fix! EN vs. ES. (__handler "PUT" "TITLE_ELEMENT_TITLE" "Card") ;; 2006.12.05 - Superfluous. ;; (__handler "PUT" "DIV_HEADER_TITLE" "Card Catalog") ;; ) ;; ------------------------------------------------------- ;; When called from: lb-ht-generate-book (when (and (stringp arg1) (string= "lb-ht-generate-book" arg1)) ;; (__handler "PUT" "TITLE_ELEMENT_TITLE" lbg-html-href) ;; (__handler "PUT" "LOGO_ONMOUSEOVER" (concat " •" "section=" (int-to-string lbg-i-from1) ;; " •" )) (progn ;; Data for headings substitution. ;; These appear at top of webpage. (setq lb-headings (lb-ht-toc-get-headings lbg-i-from1 t)) ;; fix! BR tags not disappearing from navigation footer. (if (setq lb-str (nth 0 lb-headings)) (__handler "PUT" "NUMERIC_LVL1_CDATA" (_-sgml-str-del-tags (_-strip-br--M-9--^^-anchors lb-str) (list "br")))) (if (setq lb-str (nth 1 lb-headings)) (__handler "PUT" "ALPHA_LVL1_CDATA" (_-sgml-str-del-tags (_-strip-br--M-9--^^-anchors lb-str) (list "br")))) (if (setq lb-str (nth 2 lb-headings)) (__handler "PUT" "NUMERIC_LVL2_CDATA" (_-sgml-str-del-tags (_-strip-br--M-9--^^-anchors lb-str) (list "br")))) ;; Added NUMERIC_LVL2_CDATA on 2006.03.09 (if (setq lb-str (nth 3 lb-headings)) (__handler "PUT" "ALPHA_LVL2_CDATA" (_-sgml-str-del-tags (_-strip-br--M-9--^^-anchors lb-str) (list "br")))) ;; 2006.11.23 - Added ..._LVL3_... (if (setq lb-str (nth 4 lb-headings)) (__handler "PUT" "NUMERIC_LVL3_CDATA" (_-sgml-str-del-tags (_-strip-br--M-9--^^-anchors lb-str) (list "br")))) (if (setq lb-str (nth 5 lb-headings)) (__handler "PUT" "ALPHA_LVL3_CDATA" (_-sgml-str-del-tags (_-strip-br--M-9--^^-anchors lb-str) (list "br")))) ;; fix? what is this? do _-strip-br--M-9--^^-anchors on it? ;; TOC_A_ELEMENT looks messy. (when nil (setq lb-str (concat "" "CONTENTS")) (__handler "PUT" "TOC_A_ELEMENT" lb-str)) ) (progn ;; Data for navigation. ;; (setq lb-ht-__ nil) (loop for i-lvl from (setq lb-lvl-max (string-to-int ;; Highest LVL in this section. (nth 1 (assoc lbg-i-from1 lbg-sections-max-levels-list)))) downto 1 do ;;; TEMPLATE2SCRIPT: ;;; 12 lines matching "_lvl" in buffer book.htmm. ;;; 91: \n\n")) ;; Insert section. ;; Inserted data is bounded by: ;; ABOVE: src= comment for first page of section. ;; BELOW: src= comment for page AFTER last page of section. (insert (lb-ht-generate-wholesome-text arg1testing)) ;)(04 a (insert (concat "\n\n \n\n")) (insert (concat "\n\n \n\n")) (setq _-where-page-numbers _-where-page-numbers-global)) (when (string= "2006.09.04 moved from masa" "2006.09.04 moved from masa") ;; ;; Anchor and move footnotes. ;; Already deleted __CHILD_CITATION_* (lb-ht-toc-get-section). ;;xxxxxxxxxxxxxx ;; (if (= 30 lbg-i-from1) (error "%s" (_-buffer-substring-from-))) (lb-ht-footnotes-anchor-and-move) ;)(03 f. (when nil (if (= 11 lbg-i-from1) (error "%s" (concat "a" (_-buffer-substring-from-))))) ) ;; Comment time-stamps before inserting into template. ;; fix? ;; Return oldest and newest time-stamps ? (progn (goto-char (point-min)) (while (search-forward-string "Emacs-Time-stamp:" nil t) (beginning-of-line) (if (looking-at "[^\n]*"))) ;; Delete " =\n\n" before A anchor. (progn (goto-char (point-min)) (while (search-forward-regexp (concat "[ \t\n]\\(=\\)[ \t]*" "\n[ \t]*\n") nil t) (replace-match "" nil nil nil 1))) ;; OTHER? (progn ) ;; (setq lb-rc (buffer-substring-no-properties (point-min) (point-max)))) lb-rc)) ;; (lb-ht-insert-tx-into-html-masa-preparada) (defun lb-ht-insert-tx-into-html-masa-preparada (&optional arg1testing) ;)( "Generates text that gets inserted into HTML template. Gets text using lb-ht-tx-transform-target-html. ... lb-ht-footnotes-anchor-and-move _-join-hyphenated-words ... Returns list with two buffer substrings: %%data%% and %%notes%%" ;; (_-dfun-hook "lb-ht-insert-tx-into-html-masa-preparada") ;; (let ( lb-rc) (with-temp-buffer ;; (setq _-where-page-numbers _-where-page-numbers-global) (insert ;; (concat "\n\n \n\n") ;; Insert raw text after some minor transformations. (lb-ht-tx-transform-target-html arg1testing) ;)(03 a ;; (concat "\n\n \n\n") ) (when nil (if (= 11 lbg-i-from1) (error "%s" (concat "a" (_-buffer-substring-from-))))) ;; fix? put _-join-hyphenated-words into ...transform-target-html ? ;; fix! this is pointless! words already joined! ;; After moving footnotes, join word fragments by deleting hyphens. ;; fix? 2007.04.10 - when would they not be joined? (_-join-hyphenated-words) ;)(0 ;; ;; Return list with two buffer substrings: %%data%% and %%notes%%. (progn (goto-char (point-min)) (search-forward-string "%%div-class-notes-start%%") (beginning-of-line) (setq lb-rc (list (buffer-substring-no-properties (point-min) (point)) (buffer-substring-no-properties (point) (point-max)))) )) lb-rc)) ;; (lb-ht-insert-tx-into-html) ;; (lb-ht-insert-tx-into-html t) (defun lb-ht-insert-tx-into-html (&optional arg1testing) ;)( "Open index.html, delete %%data%% and insert .tx data transformed for HTML target. Anchor and move footnotes. Write buffer to HTML chunk" (_-dfun-hook "lb-ht-insert-tx-into-html") ;; (let (lb-data-and-notes lb-rc) ;; (setq lb-data-and-notes (lb-ht-insert-tx-into-html-masa-preparada arg1testing)) ;; TESTING: (when arg1testing (lb-testing-error-foo lb-data-and-notes)) ;; (with-temp-buffer ;; Insert template. ;; index.html is template until it is changed to Contents. (_-ifcl lbg-html-index) (goto-char (point-min)) (search-forward-string "%%data%%") (_-para-delete) (insert (car lb-data-and-notes)) (search-forward-string "%%notes%%") (_-para-delete) (insert (nth 1 lb-data-and-notes)) ;; Leave %%div-class-notes-start%% alone. ;; (_-compress-multiple-newlines) (write-region (point-min) (point-max) (setq lb-rc lbg-pf-output-html))) lb-rc)) ;; (defun lb-ht-generate-webpage nil "" ;; (let ( _rc) ;; Check for __ALPHA_LVL0__ entry in index.tab: (lb-ht-common-__ "lb-ht-generate-book") ;; 2006.12.11 ;; Every disk write: (a.) copy pre-existing to .wdiffin . ;; Every disk write: (b.) re-create file. ;; Every disk write: (c.) upload if two are different. (lb-wdiff lbg-pf-output-html "beg") (lb-ht-insert-tx-into-html) ;; -------------------------------------------- ;; Open actual file (not temp-buffer as above). ;; This allows (bfn) to work. (save-excursion ;; 2007.07.07 - cannot get _-highascii2html_entities working. (_-set-buffer-to-pf lbg-pf-output-html) (toggle-read-only nil) ;; - THIS FIXED: ;; (find-file lbg-pf-output-html) ;; - SO: changed "find-file-literally" to "find-file" in ;; _-set-buffer-to-pf ;; ;; Old code showing use of FONT tag to shrink cdata. ;; "" ;; ... (progn ;; Substitutions and deletions. ;; fix? - move to lb-mu-spawn-finale? ;; YES. 2006.12.12 ;; (lb-ht-subs-and-dels-__) ;; Change TX ... now? not later? ;; fix! ;; _-tx2something in lia-tx.el changes ^M (_-tx2something) ;)(0 ) (progn ;; fix? ;; Page sequence starts from 0 sometimes. ;; Change page numbers into SGML comments (spdw). (lb-ht-comment-page-numbers lbg-pf-output-html)) ;)(03 h. (progn ;; Stamps. (set-buffer-modified-p t) (time-stamp) (lb-write-file-hook-sgml-stamps-visible t)) ;)(03 x. (progn ;; (_-compress-multiple-newlines) ;; Debugging. (write-region (point-min) (point-max) "~/foo") ;; (lb-mu-spawn-finale nil nil (list 'lb-mu-insert-pound-anchors-at-beg-of-blocks 'lb-mu-insert-pound-anchors-scroll2next ;;; xxx 'lb-mu-insert-pound-anchors-move-them-above-p 'lb-ht-gen-del-leading-href-poundsign ;; 'lb-ht-gen-wrap-arrows-without-hrefs-span-disappear 'lb-ht-gen-add-poundsign-with-id 'lb-ht-gen-add-poundsign-with-id-to-index 'lb-ht-gen-add-span-pageno 'lb-ht-gen-del-%%notes%% 'lb-ht-gen-insert-img-close-slash ;; 2007.07.06 '_-highascii2html_entities )))) ;; ;; Do not upload if only thing that changed is time-stamp. (lb-wdiff nil "end") _rc)) ;; (setq lbg-html-index "~/leninist.biz/en/1984/AP470/index.html") ;; (setq lbg-html-index "~/leninist.biz/en/1976/UFPAA244/index.html") ;;; ;)( (defun lb-ht-generate-book nil ;)(02 b "" (_-dfun-hook "lb-ht-generate-book") ;; (let (lb-pf lb-href lb-str lb-str-tmplt lb-cons lb-item lb-__s lb-pg lb-webpage lb-rc) ;; (when nil ;; FOR LARGE BOOKS, when done incrementally, towards the END. ;; It's too dangerous to leave this set! (setq lbg-ht-update-section-numbers 60) (setq lbg-ht-update-section-numbers '(60 61 62)) (setq lbg-ht-update-section-numbers '(60 . 62)) (setq lbg-ht-update-section-numbers -60) (setq lbg-ht-update-section-numbers nil)) ;; ------------------------------------------------------- ;; Each one of these is an HTML chunk. ;; (setq i (setq lbg-i-from1 1)) ;; (setq i (setq lbg-i-from1 2)) ;; (setq i (setq lbg-i-from1 3)) (loop for i ;; from lb-loop-i-beg to lb-loop-i-end in (if (not lbg-ht-update-section-numbers) (_-something-to-list-of-integers 1 ;; 0=index nil "lb-ht-generate-book") (_-something-to-list-of-integers lbg-ht-update-section-numbers nil "lb-ht-generate-book")) do ;; (if (null (setq lb-href (cdr (assoc i lbg-html-hrefs)))) (error "%s: %s" (concat "?Missing __ALPHA_LVL0__ as " "lbg-i-from1=" (int-to-string lbg-i-from1) " lbg-html-hrefs ?") lbg-text-indextab)) (when (and ;; refresh HTML? ;; fix? are these two the same? (not (string= "__ALPHA_LVL0__" lb-href)) (< lbg-i-from1 (length lbg-sections))) (setq lb-webpage (concat (file-name-directory lbg-html-index) lb-href "" lb-ext-html)) (cond ((or ;; If HTML does not exist. (not (_-timestamp lb-webpage)) ;; If HTML is more recent than all inputs, do not bother! (string< (_-timestamp lb-webpage) ;; NOTE: Changing an .el file will cause refreshing! ;; Most recently modified input (conservative): (lb-mu-most-recently-modified-inputs))) (setq lbg-i-from1 i) (setq lbg-html-href lb-href) (setq lbg-pf-output-html lb-webpage) ;; 2007.01.03 (lb-ht-generate-webpage)) (t ;; Pretend webpage was modified. ;; Prevent file from being removed by lftp-source. (shell-command (concat "touch " lb-webpage)))))) ;; loop lb-rc)) ;; (lb-ht-generate-indexhtml-as-template) (defun lb-ht-generate-indexhtml-as-template nil ;)(02 a. "Do a 'find-file' on first version of index.html" (_-dfun-hook "lb-ht-generate-indexhtml-as-template") ;; (let ( lb-rc) (progn ;; Clear lb-ht-__ (lb-ht-common-__) ;; Create template. ;; (setq lbg-pf-template "~/leninist.biz/en/html/htmm/book") (setq lbg-pf-template (lb-mu-make-webpage lbg-bindtype))) (progn ;; Clear lb-ht-__ (lb-ht-common-__) ;; Find-file. (_-force-new-file (setq lb-rc lbg-html-index)) ;; Insert input into empty buffer. (_-ifcl lbg-pf-template) ;; Delete library card. (progn (goto-char (point-max)) (search-backward "") (delete-region (point) (search-forward-string "
"))) ;; (lb-ht-gen-add-poundsign-with-id) ;; (if (string-match (concat "/book[.]" lb-ext-htmm "$") arg1pf) (lb-mu-gen-link-AZ-19 lbg-html-index) ;; Write and kill. ;; NO! Deletes __TAGs__ ! (lb-mu-spawn-finale nil nil nil) (bsb) (kill-buffer (current-buffer))) (progn ;; *AFTER* "index.html" is on disk (otherwise #index.html in ;; index.card is linked to /index.html ! ;; Create bibliography beginning with template. (lb-ht-generate-index-card)) lb-rc)) (defun lb-ht-print-and-bind nil ;)(01 b "Create or update 'index.html' and rest of book" (_-dfun-hook "lb-ht-print-and-bind") ;; (let ( lb-rc) ;; First version of index.html. (lb-ht-generate-indexhtml-as-template) ;)(02 a. ;; ;; Create book as HTML beginning with template. (lb-ht-generate-book) ;)(02 b ;; ;; Last version of index.html. (lb-ht-generate-toc) ;)(02 c ;; (lb-ht-del-old-html) ;; lb-rc)) ;; (lb-ht-del-old-html) (defun lb-ht-del-old-html nil "Delete HTML older than index.tab" ;; (let (lb-command lb-path lb-pf lb-list _rc) ;; When all HTML was updated, delete old stuff. ;; Not handled here: a list from 1 to max (equivalent to nil). (when (or (not lbg-ht-update-section-numbers) (and (integerp lbg-ht-update-section-numbers) (= 1 lbg-ht-update-section-numbers))) ;; Get list of old HTML. (with-temp-buffer (shell-command (setq lb-command (concat "cd " (setq lb-path (file-name-directory lbg-text-indextab)) "; " "find " " -follow" " -maxdepth 1" " -type f" " -not -newer " lbg-text-indextab)) t) (goto-char (point-max)) (while (search-backward-regexp "^[^\n]" nil t) (beginning-of-line) (save-excursion (setq lb-pf (_-current-line)) (kill-line) (shell-command (concat "cd " lb-path "; file " lb-pf) t))) (goto-char (point-min)) (while (search-forward-regexp (concat ": " "HTML document text$") nil t) (replace-match "") (beginning-of-line) (if (looking-at "^[.]/") (replace-match "")) (setq lb-list (append lb-list (list (_-current-line)))))) (loop for file in lb-list do ;; LOCAL. "//" is OK. (delete-file (concat lb-path file)) ;; REMOTE. (lb-lftp-dosomething-file file "rm "))) _rc)) ;; (lb-ht-tenderize-tx) (defun lb-ht-tenderize-tx () ;)(01 a. "Maybe create .tx file, check it, and set a few things" (_-dfun-hook "lb-ht-tenderize-tx") ;; (let (lb-str lb-n0 nb-n1 lb-buffer lb-assoc lb-rc) (save-excursion ;; Set global variables. ;; (setq lb-__s (lb-db-get-__-tags lbg-text-indextx)) ;; (progn ;; ... set previously .... (setq lbg-text-indextx ;; Error right away if lftp is running (check for "PID" file). (lb-lftp-dosomething-file (setq lbg-html-index (concat (file-name-sans-extension lbg-text-indextx) ;; 2006.11.17 ;; Just about ONLY use of ".html" so that when ;; a browser is pointed at a book's folder ;; it will find "index.html". "" lb-ext-html ".html"))) ;; (setq lbg-card-index (concat (file-name-directory lbg-text-indextx) lb-file-indexcard "" lb-ext-html)) ;; (setq lbg-text-indextab (concat (file-name-sans-extension lbg-text-indextx) "." lb-ext-tab)) ;; Touched index.tab used in -newer by lb-ht-del-old-html. (when (not lbg-ht-update-section-numbers) (if (setq lb-buffer (find-buffer-visiting lbg-text-indextab)) (kill-buffer lb-buffer)) (shell-command (concat "touch " lbg-text-indextab))) ;; (setq lbg-text-indextxt (concat (file-name-sans-extension lbg-text-indextx) "." lb-ext-txt)) (setq lbg-path-from-lang (lb-get-id-from-path lbg-html-index)) ;; Check for errors in HREFs before checking text files. (setq lbg-html-hrefs (lb-toc-get-html-hrefs lbg-path-from-lang)) (setq lbg-text-indextxlog (concat lbg-text-indextx "." lb-ext-log)) ;; (setq lbg-text-dot-db (concat (file-name-directory lbg-text-indextx) "" lb-file-db)) ;; (setq lbg-bindtype (lb-db-__-get- "BINDTYPE" lbg-text-dot-db t)) ) ;; ------------------------------------------------------- ;; 2006.10.16 (if (setq lb-str (lb-tx-make-or-refresh-indextx)) ;;xxxtender 0 zzz (error "%s: %s" "Got stderr?" lb-str)) (cond ((string= "book" lbg-bindtype) nil) (t (error "%s: %s" "No BINDTYPE" lbg-bindtype))) ;; fix? use _-find-file-hooks-__-globals instead? ;; Set "global" variables. (with-temp-buffer (shell-command (concat ;; 2007.06.25 ;; "egrep -B 3 -A 3 '__WHERE_P' " "head -1000 " lbg-text-indextx) t) (lb-tx-globals)) ;; fix? will this work if page numbers not at bottom of page? ;; Does not matter: ;; If page numbers at top, value of point is to left of page number. ;; If page numbers at bot, value of point is to right of page number. ;; ASSUMPTION: Page number is first or last object on page. ;; ASSUMPTION: For rectos where page number at top, page number ;; comes before running header (even though running header is ;; before page number in original). ;; fix! ;; The cdr should be a cons with upper and lower point boundaries! (setq lbg-pages (lb-tx-parse-pg-points lbg-text-indextxlog)) ;;xxxtender 4 ;; ~/leninist.biz/en/html.hrefs ;; 17 items, first is contents, last is last section (one-based). ;; (setq lbg-sections (lb-ht-toc-parse-tx-sections lbg-text-indextxlog)) ;;xxxtender 5 (if (<= (setq lb-n0 (length lbg-html-hrefs)) (setq lb-n1 (length lbg-sections))) (error "%s: %s" (concat "n=" (int-to-string lb-n0) "= lbg-html-hrefs") (concat "n=" (int-to-string lb-n1) "= lbg-sections"))) ;; (length lbg-sections) => 17 ;; 17 items, first is first section, last is dummy endpoint (zero-based). ;; ;; Do NOT include last section, a dummy section w/ "REQUEST TO READERS". (setq lbg-next-section nil) ) lb-rc)) ;; (defun lb-ht-random-checks (arg1skip) " If ARG1 is non-nil, skip." (_-dfun-hook "lb-ht-random-checks") ;; (let (_list _rc) ;; fix! add! ;; find ~/leninist.biz -follow -type f | xargs -i egrep -Hi 'cymb' '{}' > rpt (if arg1skip (setq _rc (message "%s: %s" _-defun "SKIPPED by non-nil ARG1")) ;; (_-current-time) => "2006-12-06T15:50:33-0800" (when (string-match "[:][135][13579][-]" (_-current-time)) ;; index.tab (loop for pf in (_-something-to-list (lb-list-files-of-type- "index.tab" lb-lang)) do (setq _list (lb-toc-get-html-hrefs (lb-get-id-from-path pf))) ) ;; )) ;; _rc)) ;; (defun lb-ht (arg1path-begin-with-lang &optional arg2-section-numbers0 arg2-section-numbers1) ;)(00. "Conditionally create HTML by checking time-stamp of index.tx or delete index.html for one or more books. Optional ARG1 will check all books for year ARG1. Optional ARG1yr/ARG1abbrev will check for text ARG1abbrev for year ARG1yr. Component HTML files (etc html) may have changed since HTML last created. If those components change, time-stamps of index.txt files must be updated. " ;; ;; $ awk -f ~/leninist.biz/tx2txt.awk *.tx > ../index.txt ;; ;; Something to look at in the beginning: (_-dfun-hook "lb-ht") (let (lb-arg1-path lb-str lb-str1 lb-flag lb-list lb-dirs lb-parts lb-pf-tab lb-buffer lb-list-last-numbered-pages lb-rc) ;; (progn (setq lb-ht-__ nil) (setq lbg-i-from1 0) (save-some-buffers)) ;; Why do this? (lb-mu-htmm-to-html (concat "~/" lb-domain "/index.htmm")) (lb-ht-random-checks (or ;; Deadline `06DEC15: ;; MADE MORE STRICT: lb-toc-get-html-hrefs (string< (_-current-time) "2007-01-10T15:05:36-0800") )) ;; (1) nil (2) list (3) start-number. ;; This way, ARG2 to _-something-to-list is always nil. (setq lbg-ht-update-section-numbers (if (not arg2-section-numbers0) nil (if arg2-section-numbers1 (list arg2-section-numbers0 arg2-section-numbers1) arg2-section-numbers0))) ;; _-buffer-substring-from- (if (file-exists-p "~/foo") (delete-file "~/foo")) (progn ;; 2007.08.07 (if (string-match "/$" arg1path-begin-with-lang) (error "%s: %s" "Trailing slash on ARG1" arg1path-begin-with-lang)) (setq lb-arg1-path (setq lbg-path-from-lang arg1path-begin-with-lang)) ;; Prepend absolute path? (if (string-match (concat "^" lb-re-lang "/") lb-arg1-path) (setq lb-arg1-path (concat lb-home lb-arg1-path))) ;; ;; lb-something-to-html may supply argument with trailing "/..". (setq lb-arg1-path (command-line-normalize-file-name-then-some lb-arg1-path)) ;; Remove trailing slash. (if (string-match "/$" lb-arg1-path) (setq lb-arg1-path (substring lb-arg1-path 0 (1- (length lb-arg1-path))))) ;; Path must exist. (if (not (file-exists-p lb-arg1-path)) (error "%s: %s" "Path not found" lb-arg1-path)) ;; fix? ;; hardcode here? (setq lb-lang (lb-get-lang-from-path lb-arg1-path)) lb-arg1-path) ;; ------------------------------------------------------- ;; fix! make this a function. ;; 2006.11.29 ;; Fix page numbers in eBook subdirectory names. See top of ".tab"! (progn (setq lb-list-last-numbered-pages (lb-db-load-tabbish (setq lb-pf-tab (concat lb-home lb-lang "/last-numbered-page.tab")) ;; "AFTER" field is #4. 4)) ;; fix! Move to separate function. ;; 2007.01.25 - only check stuff if it has a copy directory before 2007. (when (or t ;; 2007.06.20 - that was dumb - copy dir is made after scanning! (progn (setq lb-flag nil) (if (setq lb-dirs (lb-ht-get-copy-directories arg1path-begin-with-lang)) (loop for path in lb-dirs do (setq lb-parts (split-string path "/")) (if (string< (nth (1- (length lb-parts)) lb-parts) "20070101") (setq lb-flag t)))) lb-flag)) (if ;; Is it in tab file? (not (setq lb-list (nth 1 (assoc (setq lb-str ;; => "./1989/HCM243" (progn (string-match lb-re-lang (setq lb-str1 arg1path-begin-with-lang)) (replace-match "." t t lb-str1))) lb-list-last-numbered-pages)))) (error "%s: %s" ;; fix! Jump to tab-file for editing. (concat "Could not assoc key " lb-str "\n" lb-pf-tab) (concat "\n" (prin1-to-string lb-list-last-numbered-pages))) ;; Field 4 may be a copy of field 3, but should be updated value. (if (and (string= (nth 2 lb-list) (setq lb-str (nth 3 lb-list))) ;; N/C (NO CHANGE) ;; N/A (NOT APPLICABLE) ;; MUST DOUBLE-CHECK (and (not (string-match "^N/[AC]" (nth 4 lb-list))) (not (string-match "^MUST DOUBLE-CHECK" (nth 4 lb-list))))) (error "%s: %s" "Same data in fields 3 and 4" (concat lb-str " >-< " lb-pf-tab))) (if (or (string= "" (nth 3 lb-list)) ;; Corrected name. (not (string= "local:Y" (nth 0 lb-list))) (not (string= "srvr:Y" (nth 1 lb-list)))) (error "%s: %s" (concat lb-pf-tab " not right") (prin1-to-string lb-list)))))) (message "%s" (concat arg1path-begin-with-lang " (lb-debug: " (prin1-to-string lb-debug) ").")) ;; Set global variable. (setq lbg-text-indextx (concat lb-arg1-path "/" lb-file-index "." lb-ext-tx)) ;; Tenderize. (lb-ht-tenderize-tx) ;)(01 a. ;; MAIN: (lb-ht-print-and-bind) ;)(01 b ;; Delete index.tx, leave index.txt for uploading. (shell-command (setq lb-command (concat "cd " (file-name-directory lbg-text-indextx) " ; " ;; 2006.11.30 - Only delete after it is X months old. ;; "rm -f " lbg-text-indextx " true " " ; " ))) (setq lb-rc (message "%s: %s" "Done processing (lang/year)" (concat "(" arg1path-begin-with-lang ")"))) ;; fix! (progn (makunbound '_-where-page-numbers) (makunbound '_-footnote-marker-style)) ;; 2006.11.22 (when (setq lb-buffer (find-buffer-visiting lbg-lftp-source)) ;; 2006.12.22 ;; (kill-buffer lb-buffer) (switch-to-buffer lb-buffer) (occur "^[a-z]") (kill-buffer lb-buffer) (switch-to-buffer (get-buffer "*Occur*")) (delete-other-windows) ) lb-rc)) (when nil (while (search-backward-string (concat ";)""(") nil t) (while (< (current-column) 66) (insert " "))) t) ;;; MAIN: SEE: lb-go-speed-racer.el (provide 'lb-ht) ;;; Local Variables: *** ;;; eval:(font-lock-fontify-buffer) *** ;;; End: ***