(defalias 'Custom-make-dependencies 'ignore)
(defalias 'toolbar-gnus 'ignore)
(defalias 'update-autoloads-from-directory 'ignore))
+(autoload 'texinfo-parse-line-arg "texinfmt")
(unless (fboundp 'with-temp-buffer)
;; Pickup some macros.
(when (or (not (file-exists-p (setq elc (concat file "c"))))
(file-newer-than-file-p file elc))
(ignore-errors
- (byte-compile-file file)))))))
+ (byte-compile-file file)))))))
(defun dgnushack-recompile ()
(require 'gnus)
(error "batch-texinfo-format may only be used -batch."))
(require 'texinfmt)
(let ((auto-save-default nil)
- (find-file-run-dired nil)
+ (find-file-run-dired nil)
coding-system-for-write)
(let ((error 0)
- file
- (files ()))
+ file
+ (files ()))
(while command-line-args-left
- (setq file (expand-file-name (car command-line-args-left)))
- (cond ((not (file-exists-p file))
- (message ">> %s does not exist!" file)
- (setq error 1
- command-line-args-left (cdr command-line-args-left)))
- ((file-directory-p file)
- (setq command-line-args-left
- (nconc (directory-files file)
- (cdr command-line-args-left))))
- (t
- (setq files (cons file files)
- command-line-args-left (cdr command-line-args-left)))))
+ (setq file (expand-file-name (car command-line-args-left)))
+ (cond ((not (file-exists-p file))
+ (message ">> %s does not exist!" file)
+ (setq error 1
+ command-line-args-left (cdr command-line-args-left)))
+ ((file-directory-p file)
+ (setq command-line-args-left
+ (nconc (directory-files file)
+ (cdr command-line-args-left))))
+ (t
+ (setq files (cons file files)
+ command-line-args-left (cdr command-line-args-left)))))
(while files
- (setq file (car files)
- files (cdr files))
- (condition-case err
- (progn
- (if buffer-file-name (kill-buffer (current-buffer)))
- (find-file file)
+ (setq file (car files)
+ files (cdr files))
+ (condition-case err
+ (progn
+ (if buffer-file-name (kill-buffer (current-buffer)))
+ (find-file file)
(setq coding-system-for-write buffer-file-coding-system)
(when (and addsuffix
(re-search-forward
"^@setfilename[\t ]+\\([^\t\n ]+\\)" nil t)
(not (string-match "\\.info$" (match-string 1))))
(insert ".info"))
- (buffer-disable-undo (current-buffer))
+ (buffer-disable-undo (current-buffer))
;; process @include before updating node
- ;; This might produce some problem if we use @lowersection or such.
+ ;; This might produce some problem if we use @lowersection or
+ ;; such.
(let ((input-directory default-directory)
(texinfo-command-end))
(while (re-search-forward "^@include" nil t)
(let ((filename (concat input-directory
(texinfo-parse-line-arg))))
(re-search-backward "^@include")
- (delete-region (point) (save-excursion (forward-line 1) (point)))
+ (delete-region (point) (save-excursion
+ (forward-line 1)
+ (point)))
(message "Reading included file: %s" filename)
(save-excursion
(save-restriction
(narrow-to-region
(point)
- (+ (point) (car (cdr (insert-file-contents filename)))))
+ (+ (point)
+ (car (cdr (insert-file-contents filename)))))
(goto-char (point-min))
- ;; Remove `@setfilename' line from included file, if any,
- ;; so @setfilename command not duplicated.
- (if (re-search-forward
- "^@setfilename" (save-excursion (forward-line 100) (point)) t)
+ ;; Remove `@setfilename' line from included file,
+ ;; if any, so @setfilename command not duplicated.
+ (if (re-search-forward "^@setfilename"
+ (save-excursion
+ (forward-line 100)
+ (point))
+ t)
(progn
(beginning-of-line)
- (delete-region
- (point) (save-excursion (forward-line 1) (point))))))))))
- (texinfo-mode)
+ (delete-region (point) (save-excursion
+ (forward-line 1)
+ (point))))))))))
+ (texinfo-mode)
(texinfo-every-node-update)
- (set-buffer-modified-p nil)
+ (set-buffer-modified-p nil)
(message "texinfo formatting %s..." file)
(texinfo-format-buffer nil)
(if (buffer-modified-p)
(save-buffer))))
(error
(message ">> Error: %s" (prin1-to-string err))
- (message ">> point at")
- (let ((s (buffer-substring (point)
- (min (+ (point) 100)
- (point-max))))
- (tem 0))
- (while (setq tem (string-match "\n+" s tem))
- (setq s (concat (substring s 0 (match-beginning 0))
- "\n>> "
- (substring s (match-end 0)))
- tem (1+ tem)))
- (message ">> %s" s))
- (setq error 1))))
+ (message ">> point at")
+ (let ((s (buffer-substring (point)
+ (min (+ (point) 100)
+ (point-max))))
+ (tem 0))
+ (while (setq tem (string-match "\n+" s tem))
+ (setq s (concat (substring s 0 (match-beginning 0))
+ "\n>> "
+ (substring s (match-end 0)))
+ tem (1+ tem)))
+ (message ">> %s" s))
+ (setq error 1))))
(kill-emacs error))))
;;; dgnushack.el ends here