 
 (defvar svn-status-load-state-before-svn-status t
   "*Whether to automatically restore state from ++psvn.state file before running svn-status.")
+
+(defvar svn-log-link-handlers nil "A list of link handlers in *svn-log* buffers.
+These link handlers must be registered via `svn-log-register-link-handler'")
 
 ;;; hooks
 (defvar svn-status-mode-hook nil "Hook run when entering `svn-status-mode'.")

      (let ((default-directory (svn-status-base-dir)))
        ;;(message "svn-log-file-name-at-point: %s, default-directory: %s" file-name default-directory)
        (find-file file-name)))))

(defun svn-log-view-diff (arg)
  "Show the changeset for a given log entry.

    ;; (message "svn-log-resolve-link '%s'" link-name)
    (funcall (get-text-property (point) 'link-handler) link-name)))

(defun svn-log-register-link-handler (handler-id link-regexp handler-function)
  "Register a link handler for external links in *svn-log* buffers
HANDLER-ID is a symbolic name for this handler. The link handler is active when HANDLER-ID
is registered in `svn-log-link-handlers'.
LINK-REGEXP specifies a regular expression that matches the external link.
HANDLER-FUNCTION is called with the match of LINK-REGEXP when the user clicks at the external link."
  (let ((font-lock-desc (list link-regexp '(0 `(face font-lock-function-name-face
                                            mouse-face highlight
                                            link-handler invalid-handler-function
                                            keymap ,svn-log-link-keymap)))))
    ;; no idea, how to use handler-function in invalid-handler-function above, so set it here
    (setcar (nthcdr 5 (nth 1 (nth 1 (nth 1 font-lock-desc)))) handler-function)
    (svn-puthash handler-id font-lock-desc svn-log-registered-link-handlers)))

;; example: add support for ditrack links and handle them via svn-log-resolve-ditrack
;;(svn-log-register-link-handler 'ditrack-issue "i#[0-9]+" 'svn-log-resolve-ditrack)
;;(defun svn-log-resolve-ditrack (link-name)
;;  (interactive)
;;  (message "svn-log-resolve-ditrack %s" link-name))


(defun svn-log-resolve-trac-ticket-short (link-name)
  "Show the trac ticket specified by LINK-NAME via `svn-trac-browse-ticket'."
  (interactive)
  (let ((ticket-nr (string-to-number (substring-no-properties link-name 1))))
    (svn-trac-browse-ticket ticket-nr)))

;; register the out of the box provided link handlers
(svn-log-register-link-handler 'trac-ticket-short "#[0-9]+" 'svn-log-resolve-trac-ticket-short)

;; the actually used link handlers are specified in svn-log-link-handlers

;; --------------------------------------------------------------------------------
;; svn-info-mode
