Update of /cvsroot/refdb/elisp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17405
Modified Files:
refdb-mode.el
Log Message:
fixed viewer stuff for Windoze
Index: refdb-mode.el
===================================================================
RCS file: /cvsroot/refdb/elisp/refdb-mode.el,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -U2 -r1.24 -r1.25
--- refdb-mode.el 20 Dec 2005 00:26:32 -0000 1.24
+++ refdb-mode.el 21 Dec 2005 00:19:03 -0000 1.25
@@ -4134,5 +4134,5 @@
(defun refdb-check-doctype ()
- "Determine the document type of the current document"
+ "Determine the document type of the current document. Only DocBook and TEI are handled currently."
(save-excursion
(goto-char (point-min))
@@ -4147,5 +4147,5 @@
((re-search-forward "<book.*>" nil t)
"book")
- ((re-search-forward "<TEI.2.*>" nil t)
+ ((re-search-forward "<TEI\\.2.*>" nil t)
"TEI.2")
(t
@@ -4162,5 +4162,4 @@
)
(let ((view-target-file
- (shell-quote-argument
;; the DSSSL stylesheet generate book1.html, t1.html and so on
;; the XSLT stylesheets generate basename.html
@@ -4171,4 +4170,6 @@
(string-match ".sgml$" buffer-file-name))
(concat
+ ;; need the protocol at least on Windoze
+ "file:///"
(substring
buffer-file-name
@@ -4188,5 +4189,6 @@
(string-match "\\.[^\\.]+$" buffer-file-name)))
"."
- type)))))
+ type)))
+ )
(view-program
(cond ((equal type "pdf")
@@ -4211,20 +4213,16 @@
(equal type "html")
(equal type "xhtml"))
+ ;; browse-url apparently does its own quoting as calling
+ ;; shell-quote-argument here screws up things
(browse-url-of-file view-target-file))
(t
(if
-;; running the viewer as an argument to a shell has the advantage
-;; that we can use argument lists of variable length, as the viewer
-;; command including all arguments appears as a single argument
-;; of the start-process command
(start-process-shell-command
(concat "refdb-view-output-" (buffer-name))
(get-buffer-create "*refdb-messages*")
-; refdb-external-program-shell
-; "-c"
(format "%s %s %s"
view-program
view-options
- view-target-file))
+ (shell-quote-argument view-target-file)))
(message "Viewing %s in %s viewer...done" view-target-file type)
(error "Could not start %s viewer")
|