;; Batch. ;; Emacs-Time-stamp: "2007-11-14 08:55:51" (setq file-stamp "Emacs-File-stamp: \"/home/ysverdlov/leninist.biz/lb-batch.el\"") ;; IMPORTANT! ;; UPDATE DATABASE IN FILESYSTEM! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;x ;; Execute "$ bash lb.sh es 1" to refresh "es" file-system database. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ( pushd ~/leninist.biz; ;; emacs -batch -l lb-batch.el 2>&1 | mail -s lb-batch.el ysverdlov@localhost; ;; popd; ) ;; IMPORTANT! ;; SET LANGUAGE! (load "lb") (setq lb-lang "es") (setq lb-lang "en") (defvar lbg-batch nil "Batch mode?") ;; (boundp 'lbg-batch) ;; 2007.02.12 - made symbolic link from ~/bin to ~/leninist.biz (unless (featurep 'file-stamp) (load "file-stamp")) (setq load-path (append (list "~/leninist.biz/") load-path)) (unless (featurep 'lb) (load "lb")) ;; NOTE: Unable to resolve HREF ... ? ;; NOTE: ... defun lb-mu-href-replace-uptree ;; NOTE: ... See: lb-defvar.el: lb-list-href-ok-not-file-exist (setq lb-debug nil) ;; (kill-buffer " *load*") ;; 0-59/5 0-23/1 * * * ( pushd ~/leninist.biz; emacs -batch -l lb-batch.el 2>&1 | mail -s s ysverdlov@yahoo.com; popd; ) ;; TO-DO: Each subdirectory needs an ".index" ;; ;; TO-DO: ;; ;; TO-DO: ;; ;; TO-DO: ;; ;; emacs -batch --eval '(setq debug-on-error t)' ;; (setq debug-on-error t) ;; Each subdirectory has a .index to describe contents of database. ;; pf = pathfile ;; pt = point ;; (lb-batch-files-exist nil) (defun lb-batch-files-exist (arg1p) ; 2005.05.21 "Do files exist" ;; (interactive "p") (unless (featurep 'lb-batch) (save-some-buffers)) (let (lb-pt0 lb-pt1 lb-pf lb-rc) (with-temp-buffer (insert-file lb-file-filelist) (goto-char (point-min)) (while (< (point) (point-max)) (if (looking-at "\n") (forward-char 1)) (save-excursion (setq lb-pt0 (point)) (end-of-line) (setq lb-pt1 (point))) (setq lb-pf (_-normalize-whitespace (buffer-substring-no-properties lb-pt0 lb-pt1))) (message lb-pf) (if (and (not (string-match "^[ \t]*[#]" lb-pf)) (not (file-exists-p lb-pf))) (progn (insert "File not found: ") (end-of-line) (if (looking-at "\n") (forward-char 1))) (delete-region lb-pt0 lb-pt1) (if (looking-at "\n") (replace-match "")))) (_-compress-multiple-newlines) ;; Buffer might have a single newline, nothing else. (if (< (point-max) 5) (erase-buffer)) (setq lb-rc (buffer-string))) (if (string= "" lb-rc) nil lb-rc))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fix! ;; Insert letter in