[Refdb-cvs] CVS: elisp refdb-mode.el,1.20,1.21
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2005-12-18 23:50:11
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11779 Modified Files: refdb-mode.el Log Message: adapt query prompts to database engine used;use start-process-shell-command instead of start-process to simplify setup on Windoze;create empty xref elements with end tag compatible with both XML and SGML Index: refdb-mode.el =================================================================== RCS file: /cvsroot/refdb/elisp/refdb-mode.el,v retrieving revision 1.20 retrieving revision 1.21 diff -u -U2 -r1.20 -r1.21 --- refdb-mode.el 8 Dec 2005 00:56:49 -0000 1.20 +++ refdb-mode.el 18 Dec 2005 23:50:00 -0000 1.21 @@ -1373,5 +1373,6 @@ (progn (setq refdb-regexp-query-string "") - (setq refdb-periodical-regexp ".+"))) + (setq refdb-periodical-regexp ".+") + (setq refdb-regexp-prompt "\(regexp\)"))) ((or (equal dbengine "sqlite") @@ -1379,5 +1380,6 @@ (progn (setq refdb-regexp-query-string "%%") - (setq refdb-periodical-regexp "_%%"))) + (setq refdb-periodical-regexp "_%%") + (setq refdb-regexp-prompt "\(SQL regexp\)"))) (t (progn @@ -2774,5 +2776,4 @@ ) ) - ;; todo: should be customizable. use refdbc setting (set-buffer-file-coding-system refdb-default-ris-encoding) ) @@ -2794,6 +2795,7 @@ "Display all RefDB datasets regexp-matching AUTHOR." (interactive (list - (completing-read "Author \(regexp\): " - (refdb-make-alist-from-list refdb-current-authors-list)) + (completing-read + (format "Author %s: " refdb-regexp-prompt) + (refdb-make-alist-from-list refdb-current-authors-list)) ) ) @@ -2813,5 +2815,5 @@ (defun refdb-getref-by-title-regexp (title) "Display all RefDB datasets regexp-matching TITLE." - (interactive (list (read-string (format "Title \(regexp\): ")))) + (interactive (list (read-string (format "Title %s: " refdb-regexp-prompt)))) (refdb-message-getting-refs 'title "like" title) (refdb-getref-by-field-regexp "TI" title) @@ -2834,6 +2836,7 @@ "Display all RefDB datasets regexp-matching KEYWORD." (interactive (list - (completing-read "Keyword \(regexp\): " - (refdb-make-alist-from-list refdb-current-keywords-list)) + (completing-read + (format "Keyword %s: " refdb-regexp-prompt) + (refdb-make-alist-from-list refdb-current-keywords-list)) ) ) @@ -2858,6 +2861,7 @@ "Display all RefDB datasets regexp-matching PERIODICAL." (interactive (list - (completing-read "Periodical \(regexp\): " - (refdb-make-alist-from-list refdb-current-periodicals-list)) + (completing-read + (format "Periodical %s: " refdb-regexp-prompt) + (refdb-make-alist-from-list refdb-current-periodicals-list)) ) ) @@ -3517,5 +3521,5 @@ (defun refdb-getnote-by-title-regexp (title) "Display all RefDB notes regexp-matching TITLE." - (interactive (list (read-string (format "Title \(regexp\): ")))) + (interactive (list (read-string (format "Title %s: " refdb-regexp-prompt)))) (refdb-message-getting-notes 'title "like" title) (refdb-getnote-by-field-regexp "NTI" title) @@ -3538,6 +3542,7 @@ "Display all RefDB notes regexp-matching KEYWORD." (interactive (list - (completing-read "Keyword \(regexp\): " - (refdb-make-alist-from-list refdb-current-keywords-list)) + (completing-read + (format "Keyword : " refdb-regexp-prompt) + (refdb-make-alist-from-list refdb-current-keywords-list)) ) ) @@ -3578,6 +3583,7 @@ "Display all RefDB notes linked to regexp AUTHOR." (interactive (list - (completing-read "Author \(regexp\): " - (refdb-make-alist-from-list refdb-current-authors-list)) + (completing-read + (format "Author %s: " refdb-regexp-prompt) + (refdb-make-alist-from-list refdb-current-authors-list)) ) ) @@ -3602,6 +3608,7 @@ "Display all RefDB notes linked to regexp PERIODICAL." (interactive (list - (completing-read "Periodical \(regexp\): " - (refdb-make-alist-from-list refdb-current-periodicals-list)) + (completing-read + (format "Periodical : " refdb-regexp-prompt) + (refdb-make-alist-from-list refdb-current-periodicals-list)) ) ) @@ -3626,6 +3633,7 @@ "Display all RefDB notes linked to regexp KEYWORD." (interactive (list - (completing-read "Keyword \(regexp\): " - (refdb-make-alist-from-list refdb-current-keywords-list)) + (completing-read + (format "Keyword %s: " refdb-regexp-prompt) + (refdb-make-alist-from-list refdb-current-keywords-list)) ) ) @@ -4044,5 +4052,5 @@ ) (message "Transforming document to %s..." type) - (start-process + (start-process-shell-command (concat "refdb-transform-" (buffer-name)) (get-buffer-create "*refdb-messages*") @@ -4074,5 +4082,5 @@ ) (message "Transforming document to %s..." type) - (start-process + (start-process-shell-command (concat "refdb-transform-" (buffer-name)) (get-buffer-create "*refdb-messages*") @@ -4091,27 +4099,28 @@ ) (let ((view-target-file + (shell-quote-argument ;; the DSSSL stylesheet generate book1.html, article1.html and so on ;; the XSLT stylesheets generate basename.html ;; both stylesheets generate basename.XXX for all other output types - (cond ((and (or - (equal type "html") - (equal type "xhtml")) - (string-match ".sgml$" buffer-file-name)) - (concat - (substring - buffer-file-name - 0 - (string-match "/[^/]+$" buffer-file-name)) + (cond ((and (or + (equal type "html") + (equal type "xhtml")) + (string-match ".sgml$" buffer-file-name)) + (concat + (substring + buffer-file-name + 0 + (string-match "/[^/]+$" buffer-file-name)) "/book1.html")) - (t - (concat - (substring - buffer-file-name - 0 - (if (string-match "\\.short\\." buffer-file-name) - (string-match "\\.short\\." buffer-file-name) - (string-match "\\.[^\\.]+$" buffer-file-name))) - "." - type)))) + (t + (concat + (substring + buffer-file-name + 0 + (if (string-match "\\.short\\." buffer-file-name) + (string-match "\\.short\\." buffer-file-name) + (string-match "\\.[^\\.]+$" buffer-file-name))) + "." + type))))) (view-program (cond ((equal type "pdf") @@ -4143,9 +4152,9 @@ ;; command including all arguments appears as a single argument ;; of the start-process command - (start-process + (start-process-shell-command (concat "refdb-view-output-" (buffer-name)) (get-buffer-create "*refdb-messages*") - refdb-external-program-shell - "-c" +; refdb-external-program-shell +; "-c" (format "%s %s %s" view-program @@ -4174,4 +4183,5 @@ )) ) + (ml-type (refdb-check-doctype)) ) (kill-new @@ -4223,7 +4233,8 @@ (if (eq refdb-citation-type 'short) (setq id-string (concat id-string ";" (match-string 1 nil))) + ;; the xref notation used here works for both SGML and XML (setq id-string (concat id-string (format - "<xref linkend=\"ID%s-X\"/>" + "<xref linkend=\"ID%s-X\"></xref>" (match-string 1 nil)) )) @@ -4244,6 +4255,7 @@ (match-string 1 id-string)))) (concat + ;; the xref notation used here works for both SGML and XML (format - "<xref endterm=\"IM0\" linkend=\"%s\" role=\"MULTIXREF\"/>" + "<xref endterm=\"IM0\" linkend=\"%s\" role=\"MULTIXREF\"></xref>" linkend ) @@ -4291,5 +4303,6 @@ (concat (format - "<xref endterm=\"IM0\" linkend=\"%s\" role=\"MULTIXREF\"/>" + ;; the xref notation used here works for both SGML and XML + "<xref endterm=\"IM0\" linkend=\"%s\" role=\"MULTIXREF\"></xref>" linkend ) @@ -4351,6 +4364,7 @@ (if (eq refdb-citation-type 'short) (match-string 1 nil) + ;; the xref notation used here works for both SGML and XML (format - "<xref linkend=\"ID%s-X\"/>" + "<xref linkend=\"ID%s-X\"></xref>" (match-string 1 nil))) nil) @@ -4367,6 +4381,7 @@ (if (eq refdb-citation-type 'short) (match-string 1 nil) + ;; the xref notation used here works for both SGML and XML (format - "<xref linkend=\"ID%s-X\"/>" + "<xref linkend=\"ID%s-X\"></xref>" (match-string 1 nil))) nil) @@ -4981,5 +4996,5 @@ (defun refdb-listdb (dbname) "List available databases." - (interactive "sDatabase name \(regexp\):") + (interactive "sDatabase name \(SQL regexp\):") (refdb-list-item "listdb" dbname) @@ -5188,5 +5203,5 @@ (progn (let ((sudo-password (read-passwd "Your sudo password: ")) - (my-proc (start-process + (my-proc (start-process-shell-command "my-proc" (get-buffer-create "*refdb-messages*") |