 (defun not-in-view ()
 	(error-message "this command must be executed from within a view"))
 
+(defun no-link ()
+    (error-message "there is no link associated with this line"))
+    
+(defun no-target ()
+    (error-message "there is no target associated with this line"))
+    
 (defun refresh-view ()
     (interactive)
     (if view-root


(defun decrease-link-weight ()
    (interactive)
    (let (
        (key (current-line-link))
	(weight (find-link-weight))
	(sharability (find-link-sharability)))
            (if key
	        (set-properties key (- weight 0.25) sharability))))

(defun increase-link-weight ()
    (interactive)
    (let (
        (key (current-line-link))
	(weight (find-link-weight))
	(sharability (find-link-sharability)))
            (if key
	        (set-properties key (+ weight 0.25) sharability))))

(defun decrease-target-weight ()
    (interactive)
    (let (
        (key (current-line-target))
	(weight (find-target-weight))
	(sharability (find-target-sharability)))
            (if key
	        (set-properties key (- weight 0.25) sharability))))

(defun increase-target-weight ()
    (interactive)
    (let (
        (key (current-line-target))
	(weight (find-target-weight))
	(sharability (find-target-sharability)))
            (if key
	        (set-properties key (+ weight 0.25) sharability))))

(defun decrease-link-sharability ()
    (interactive)
    (let (
        (key (current-line-link))
	(weight (find-link-weight))
	(sharability (find-link-sharability)))
            (if key
		    (set-properties key weight (- sharability 0.25)))))

(defun increase-link-sharability ()
    (interactive)
    (let (
        (key (current-line-link))
	(weight (find-link-weight))
	(sharability (find-link-sharability)))
            (if key
		    (set-properties key weight (+ sharability 0.25)))))

(defun decrease-target-sharability ()
    (interactive)
    (let (
        (key (current-line-target))
	(weight (find-target-weight))
	(sharability (find-target-sharability)))
            (if key
		    (set-properties key weight (- sharability 0.25)))))

(defun increase-target-sharability ()
    (interactive)
    (let (
        (key (current-line-target))
	(weight (find-target-weight))
	(sharability (find-target-sharability)))
            (if key
		    (set-properties key weight (+ sharability 0.25)))))


;; INTERFACE ;;;;;;;;;;;;;;;;;;;;;;;;;;;

					                     '(:foreground "grey80" :background "grey97")
					                     '(:foreground "black"))) " ")
					         ;;'invisible t
			                'link-key link-key
			                'target-key target-key))
			        ;; TODO: also propertize the whitespace. Just propertize once for the whole "line"
			        (loop for i from 1 to indent do (insert "    "))
			        ;; Also propertize target value, for the sake of {{{block text}}}
                    (insert (propertize (concat
		                (colorize link-value link-weight link-sharability t) "  "
			            (colorize target-value target-weight target-sharability nil) "\n")
			            'link-key link-key
			            'target-key target-key))
                    (write-view children (+ indent 1))
                    ))))

