+(defun elpher-bookmarks ()
+ "Visit bookmarks page."
+ (interactive)
+ (switch-to-buffer "*elpher*")
+ (elpher-visit-node
+ (elpher-make-node "Bookmarks Page" (elpher-make-address 'bookmarks))))
+
+(defun elpher-info-node (node)
+ "Display information on NODE."
+ (let ((display-string (elpher-node-display-string node))
+ (address (elpher-node-address node)))
+ (if (not (elpher-address-special-p address))
+ (message "`%s' on %s port %s"
+ (elpher-address-selector address)
+ (elpher-address-host address)
+ (elpher-address-port address))
+ (message "%s" display-string))))
+
+(defun elpher-info-link ()
+ "Display information on node corresponding to link at point."
+ (interactive)
+ (let ((button (button-at (point))))
+ (if button
+ (elpher-info-node (button-get button 'elpher-node))
+ (error "No item selected"))))
+
+(defun elpher-info-current ()
+ "Display information on current node."
+ (interactive)
+ (elpher-info-node elpher-current-node))
+
+(defun elpher-get-address-url (address)
+ "Get URL representation of ADDRESS."
+ (let ((type (elpher-address-type address))
+ (selector (elpher-address-selector address))
+ (host (elpher-address-host address))
+ (port (elpher-address-port address)))
+ (if (and (equal type ?h)
+ (string-prefix-p "URL:" selector))
+ (elt (split-string selector "URL:") 1)
+ (concat "gopher"
+ (if (elpher-address-use-tls-p address) "s" "")
+ "://"
+ host
+ (if (equal port 70)
+ ""
+ (format ":%d" port))
+ "/" (string type)
+ selector))))
+
+(defun elpher-copy-node-url (node)
+ "Copy URL representation of address of NODE to `kill-ring'."
+ (let ((address (elpher-node-address node)))
+ (if (elpher-address-special-p address)
+ (error (format "Cannot represent %s as URL" (elpher-node-display-string node)))
+ (let ((url (elpher-get-address-url address)))
+ (message "Copied \"%s\" to kill-ring/clipboard." url)
+ (kill-new url)))))
+
+(defun elpher-copy-link-url ()
+ "Copy URL of item at point to `kill-ring'."
+ (interactive)
+ (let ((button (button-at (point))))
+ (if button
+ (elpher-copy-node-url (button-get button 'elpher-node))
+ (error "No item selected"))))
+
+(defun elpher-copy-current-url ()
+ "Copy URL of current node to `kill-ring'."
+ (interactive)
+ (elpher-copy-node-url elpher-current-node))
+
+(defun elpher-set-coding-system ()
+ "Specify an explicit character coding system."
+ (interactive)
+ (let ((system (read-coding-system "Set coding system to use (default is to autodetect): " nil)))
+ (setq elpher-user-coding-system system)
+ (if system
+ (message "Coding system fixed to %s. (Reload to see effect)." system)
+ (message "Coding system set to autodetect. (Reload to see effect)."))))