                             (error-message msg)))
                  (url-retrieve url (receive-view mode)))))))))
 
-(defun tn-decrease-link-weight ()
-    (interactive)
-    (let ((link (current-link)))
-        (if link
-            (let (
-                (key (get-key link))
-                (weight (get-weight link))
-                (sharability (get-sharability link)))
-	                (set-properties key (- weight 0.25) sharability))
-	        (no-link))))
-
-(defun tn-increase-link-weight ()
-    (interactive)
-    (let ((link (current-link)))
-        (if link
-            (let (
-                (key (get-key link))
-                (weight (get-weight link))
-                (sharability (get-sharability link)))
-	                (set-properties key (+ weight 0.25) sharability))
-	        (no-link))))
-
-(defun tn-decrease-target-weight ()
-    (interactive)
-    (let ((target (current-target)))
-        (if target
-            (let (
-                (key (get-key target))
-                (weight (get-weight target))
-                (sharability (get-sharability target)))
-	                (set-properties key (- weight 0.25) sharability))
-	        (no-target))))
-
-(defun tn-increase-target-weight ()
-    (interactive)
-    (let ((target (current-target)))
-        (if target
-            (let (
-                (key (get-key target))
-                (weight (get-weight target))
-                (sharability (get-sharability target)))
-	                (set-properties key (+ weight 0.25) sharability))
-	        (no-target))))
-
-(defun tn-decrease-link-sharability ()
-    (interactive)
-    (let ((link (current-link)))
-        (if link
-            (let (
-                (key (get-key link))
-                (weight (get-weight link))
-                (sharability (get-sharability link)))
-		            (set-properties key weight (- sharability 0.25)))
-		    (no-link))))
-
-(defun tn-increase-link-sharability ()
-    (interactive)
-    (let ((link (current-link)))
-        (if link
-            (let (
-                (key (get-key link))
-                (weight (get-weight link))
-                (sharability (get-sharability link)))
-		            (set-properties key weight (+ sharability 0.25)))
-		    (no-link))))
-
-(defun tn-decrease-target-sharability ()
-    (interactive)
-    (let ((target (current-target)))
-        (if target
-            (let (
-                (key (get-key target))
-                (weight (get-weight target))
-                (sharability (get-sharability target)))
-		            (set-properties key weight (- sharability 0.25)))
-		    (no-target))))
-
-(defun tn-increase-target-sharability ()
-    (interactive)
-    (let ((target (current-target)))
-        (if target
-            (let (
-                (key (get-key target))
-                (weight (get-weight target))
-                (sharability (get-sharability target)))
-		            (set-properties key weight (+ sharability 0.25)))
-		    (no-target))))
+(defun set-link-weight (v)
+    (if (and (> v 0) (<= v 1))
+        (let ((link (current-link)))
+            (if link
+                (let (
+                    (key (get-key link))
+                    (weight (get-weight link))
+                    (sharability (get-sharability link)))
+	                    (set-properties key v sharability))
+	            (no-link)))
+        (error-message
+            (concat "weight " (number-to-string v) " is outside of range (0, 1]"))))
+
+(defun tn-set-link-weight-1 ()
+    (interactive)
+    (set-link-weight 0.25))
+
+(defun tn-set-link-weight-2 ()
+    (interactive)
+    (set-link-weight 0.5))
+
+(defun tn-set-link-weight-3 ()
+    (interactive)
+    (set-link-weight 0.75))
+
+(defun tn-set-link-weight-4 ()
+    (interactive)
+    (set-link-weight 1.0))
+
+(defun set-target-weight (v)
+    (if (and (> v 0) (<= v 1))
+        (let ((target (current-target)))
+            (if target
+                (let (
+                    (key (get-key target))
+                    (weight (get-weight target))
+                    (sharability (get-sharability target)))
+	                    (set-properties key v sharability))
+	            (no-target)))
+        (error-message
+            (concat "weight " (number-to-string v) " is outside of range (0, 1]"))))
+
+(defun tn-set-target-weight-1 ()
+    (interactive)
+    (set-target-weight 0.25))
+
+(defun tn-set-target-weight-2 ()
+    (interactive)
+    (set-target-weight 0.5))
+
+(defun tn-set-target-weight-3 ()
+    (interactive)
+    (set-target-weight 0.75))
+
+(defun tn-set-target-weight-4 ()
+    (interactive)
+    (set-target-weight 1.0))
+
+(defun set-link-sharability (v)
+    (if (and (> v 0) (<= v 1))
+        (let ((link (current-link)))
+            (if link
+                (let (
+                    (key (get-key link))
+                    (weight (get-weight link))
+                    (sharability (get-sharability link)))
+	                    (set-properties key weight v))
+	            (no-link)))
+        (error-message
+            (concat "sharability " (number-to-string v) " is outside of range (0, 1]"))))
+
+(defun tn-set-link-sharability-1 ()
+    (interactive)
+    (set-link-sharability 0.25))
+
+(defun tn-set-link-sharability-2 ()
+    (interactive)
+    (set-link-sharability 0.5))
+
+(defun tn-set-link-sharability-3 ()
+    (interactive)
+    (set-link-sharability 0.75))
+
+(defun tn-set-link-sharability-4 ()
+    (interactive)
+    (set-link-sharability 1.0))
+
+(defun set-target-sharability (v)
+    (if (and (> v 0) (<= v 1))
+        (let ((target (current-target)))
+            (if target
+                (let (
+                    (key (get-key target))
+                    (weight (get-weight target))
+                    (sharability (get-sharability target)))
+	                    (set-properties key weight v))
+	            (no-target)))
+        (error-message
+            (concat "sharability " (number-to-string v) " is outside of range (0, 1]"))))
+
+(defun tn-set-target-sharability-1 ()
+    (interactive)
+    (set-target-sharability 0.25))
+
+(defun tn-set-target-sharability-2 ()
+    (interactive)
+    (set-target-sharability 0.5))
+
+(defun tn-set-target-sharability-3 ()
+    (interactive)
+    (set-target-sharability 0.75))
+
+(defun tn-set-target-sharability-4 ()
+    (interactive)
+    (set-target-sharability 1.0))
 
 
 ;; INTERFACE ;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; set weight ;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun set-default-weight (s)
    (if (in-view)
        (if (and (> s 0) (<= s 1))
            (setq tn-default-weight s)
            (error-message
                (concat "weight " (number-to-string s) " is outside of range (0, 1]")))))

(defun tn-decrease-default-weight ()
    (interactive)

(global-set-key (kbd "C-c C-t C-b t")   'tn-browse-target-value-in-twitter)
(global-set-key (kbd "C-c C-t C-b w")   'tn-browse-target-value-in-wikipedia)
(global-set-key (kbd "C-c C-t i")       'tn-target-info)
(global-set-key (kbd "C-c C-t C-s 1")   'tn-set-target-sharability-1)
(global-set-key (kbd "C-c C-t C-s 2")   'tn-set-target-sharability-2)
(global-set-key (kbd "C-c C-t C-s 3")   'tn-set-target-sharability-3)
(global-set-key (kbd "C-c C-t C-s 4")   'tn-set-target-sharability-4)
(global-set-key (kbd "C-c C-t C-s a")   'tn-set-target-sharability-1)
(global-set-key (kbd "C-c C-t C-s s")   'tn-set-target-sharability-2)
(global-set-key (kbd "C-c C-t C-s d")   'tn-set-target-sharability-3)
(global-set-key (kbd "C-c C-t C-s f")   'tn-set-target-sharability-4)
(global-set-key (kbd "C-c C-t C-w 1")   'tn-set-target-weight-1)
(global-set-key (kbd "C-c C-t C-w 2")   'tn-set-target-weight-2)
(global-set-key (kbd "C-c C-t C-w 3")   'tn-set-target-weight-3)
(global-set-key (kbd "C-c C-t C-w 4")   'tn-set-target-weight-4)
(global-set-key (kbd "C-c C-t C-w a")   'tn-set-target-weight-1)
(global-set-key (kbd "C-c C-t C-w s")   'tn-set-target-weight-2)
(global-set-key (kbd "C-c C-t C-w d")   'tn-set-target-weight-3)
(global-set-key (kbd "C-c C-t C-w f")   'tn-set-target-weight-4)
(global-set-key (kbd "C-c C-v b")       'tn-refresh-to-backward-view)
(global-set-key (kbd "C-c C-v e")       'tn-enter-edit-view)
(global-set-key (kbd "C-c C-v f")       'tn-refresh-to-forward-view)
