     (goto-char (point-min))
     (flush-lines "^## .*")))
 
-(defun svn-file-add-to-changelog (curdir)
+(defun svn-file-add-to-changelog (prefix-arg)
+  "Create a changelog entry for the function at point.
+The variable `svn-status-changelog-style' allows to select the used changlog style"
+  (interactive "P")
+  (cond ((eq svn-status-changelog-style 'changelog)
+         (svn-file-add-to-log-changelog-style prefix-arg))
+        ((eq svn-status-changelog-style 'svn-dev)
+         (svn-file-add-to-log-svn-dev-style prefix-arg))
+        ((fboundp svn-status-changelog-style)
+         (funcall svn-status-changelog-style prefix-arg))
+        (t
+         (error "Invalid setting for `svn-status-changelog-style'"))))
+
+(defun svn-file-add-to-log-changelog-style (curdir)
   "Create a changelog entry for the function at point.
 `add-change-log-entry-other-window' creates the header information.
 If CURDIR, save the log file in the current directory, otherwise in the base directory of this working copy."
   (interactive "P")
   (add-change-log-entry-other-window nil (svn-log-edit-file-name curdir))
   (svn-log-edit-mode))
+
+;; taken from svn-dev.el: svn-log-path-derive
+(defun svn-dev-log-path-derive (path)
+  "Derive a relative directory path for absolute PATH, for a log entry."
+  (save-match-data
+    (let ((base (file-name-nondirectory path))
+          (chop-spot (string-match
+                      "\\(code/\\)\\|\\(src/\\)\\|\\(projects/\\)"
+                      path)))
+      (if chop-spot
+          (progn
+            (setq path (substring path (match-end 0)))
+            ;; Kluge for Subversion developers.
+            (if (string-match "subversion/" path)
+                (substring path (+ (match-beginning 0) 11))
+              path))
+        (string-match (expand-file-name "~/") path)
+        (substring path (match-end 0))))))
+
+;; taken from svn-dev.el: svn-log-message
+(defun svn-file-add-to-log-svn-dev-style (prefix-arg)
+  "Add to an in-progress log message, based on context around point.
+If PREFIX-ARG is negative, then use basenames only in
+log messages, otherwise use full paths.  The current defun name is
+always used.
+
+If PREFIX-ARG is a list (e.g. by using C-u), save the log file in
+the current directory, otherwise in the base directory of this
+working copy.
+
+If the log message already contains material about this defun, then put
+point there, so adding to that material is easy.
+
+Else if the log message already contains material about this file, put
+point there, and push onto the kill ring the defun name with log
+message dressing around it, plus the raw defun name, so yank and
+yank-next are both useful.
+
+Else if there is no material about this defun nor file anywhere in the
+log message, then put point at the end of the message and insert a new
+entry for file with defun.
+"
+  (interactive "P")
+  (let* ((short-file-names (and (numberp prefix-arg) (< prefix-arg 0)))
+         (curdir (listp prefix-arg))
+         (this-file (if short-file-names
+                        (file-name-nondirectory buffer-file-name)
+                      (svn-dev-log-path-derive buffer-file-name)))
+         (this-defun (or (add-log-current-defun)
+                         (save-excursion
+                           (save-match-data
+                             (if (eq major-mode 'c-mode)
+                                 (progn
+                                   (if (fboundp 'c-beginning-of-statement-1)
+                                       (c-beginning-of-statement-1)
+                                     (c-beginning-of-statement))
+                                   (search-forward "(" nil t)
+                                   (forward-char -1)
+                                   (forward-sexp -1)
+                                   (buffer-substring
+                                    (point)
+                                    (progn (forward-sexp 1) (point)))))))))
+         (log-file (svn-log-edit-file-name curdir)))
+    (find-file log-file)
+    (goto-char (point-min))
+    ;; Strip text properties from strings
+    (set-text-properties 0 (length this-file) nil this-file)
+    (set-text-properties 0 (length this-defun) nil this-defun)
+    ;; If log message for defun already in progress, add to it
+    (if (and
+         this-defun                        ;; we have a defun to work with
+         (search-forward this-defun nil t) ;; it's in the log msg already
+         (save-excursion                   ;; and it's about the same file
+           (save-match-data
+             (if (re-search-backward  ; Ick, I want a real filename regexp!
+                  "^\\*\\s-+\\([a-zA-Z0-9-_.@=+^$/%!?(){}<>]+\\)" nil t)
+                 (string-equal (match-string 1) this-file)
+               t))))
+        (if (re-search-forward ":" nil t)
+            (if (looking-at " ") (forward-char 1)))
+      ;; Else no log message for this defun in progress...
+      (goto-char (point-min))
+      ;; But if log message for file already in progress, add to it.
+      (if (search-forward this-file nil t)
+          (progn
+            (if this-defun (progn
+                             (kill-new (format "(%s): " this-defun))
+                             (kill-new this-defun)))
+            (search-forward ")" nil t)
+            (if (looking-at " ") (forward-char 1)))
+        ;; Found neither defun nor its file, so create new entry.
+        (goto-char (point-max))
+        (if (not (bolp)) (insert "\n"))
+        (insert (format "\n* %s (%s): " this-file (or this-defun "")))
+        ;; Finally, if no derived defun, put point where the user can
+        ;; type it themselves.
+        (if (not this-defun) (forward-char -3))))))
 
 ;; --------------------------------------------------------------------------------
 ;; svn-log-view-mode:

           (list "sort-status-buffer" svn-status-sort-status-buffer)
           (list "elide-list" svn-status-elided-list)
           (list "module-name" svn-status-module-name)
           (list "branch-list" svn-status-branch-list)))
    (insert (pp-to-string svn-status-options))
    (save-buffer)
    (kill-buffer buf)))


This can be toggled with \\[svn-status-toggle-sort-status-buffer]."
  :type 'boolean
  :group 'psvn)

(defcustom svn-status-changelog-style 'changelog
  "*The changelog style that is used for `svn-file-add-to-changelog'.
Possible values are:
 'changelog: use `add-change-log-entry-other-window'
 'svn-dev: use commit messages that are used by the svn developers
 a function: This function is called to add a new entry to the changelog file.
"
  :type '(set (const changelog)
              (const svn-dev))
  :group 'psvn)

(defcustom svn-status-unmark-files-after-list '(commit revert)
