     (request-duplicates
         tn-min-sharability tn-max-sharability tn-min-weight tn-max-weight))
 
-(defun tn-search ()
+;; non-interactive search, for use with emacsclient
+(defun tn-search (query)
+    (if (> (length query) 0)
+        (request-search-results
+            query
+            tn-style
+            tn-min-sharability tn-max-sharability tn-min-weight tn-max-weight)))
+
+(defun tn-search-interactive ()
     (interactive)
     (let ((query (read-from-minibuffer "query: ")))
-        (if (> (length query) 0)
-            (request-search-results
-                query
-                tn-style
-                tn-min-sharability tn-max-sharability tn-min-weight tn-max-weight))))
+        (tn-search query)))
 
 (defun tn-priorities ()
     (interactive)

(global-set-key (kbd "C-c P")           'tn-priorities)
(global-set-key (kbd "C-c p")           'tn-push-view)
(global-set-key (kbd "C-c r")           'tn-ripple-query)
(global-set-key (kbd "C-c s")           'tn-search)
(global-set-key (kbd "C-c t")           'tn-visit-target)
(global-set-key (kbd "C-c u")           'tn-refresh-view)
(global-set-key (kbd "C-c v")           'tn-events)


(defun tn-toggle-emacspeak ()
    (interactive)

    (kill-new "         * \n")(yank)
    (beginning-of-buffer)(end-of-line))


;; KEYBOARD MAPPINGS ;;;;;;;;;;;;;;;;;;;

;; Note: when updating this list of mappings, also update the PKB
(global-set-key (kbd "C-c C-a C-s")     'insert-attr-sharability)
