Subject: sort-regexp-fields also seems to not save point

From: Alexander Kjeldaas <[email-masked]>
Date: Mon, 7 Jan 2013 13:32:18 +0100

I think this might be related.  In the following function, point is also
not restored:

(defun my-java-organize-imports2 ()
  "Sorts import statements"
  (interactive)
  (message "Point %d" (point))
  (sit-for 3)
  (save-excursion
    (let (deactivate-mark)
      ;; Remove empty lines between imports
      (replace-regexp "^import \\(.*\\)\n\\(\n\\)*import \\(.*\\)$"
                      "import \\1\nimport \\3"
                      nil (point-min) (point-max))
      ;; Sort imports in file
      (sort-regexp-fields nil "^.*$" "^import .*$" (point-min)
(point-max))))
  (message "Point %d" (point))
  (sit-for 3))

Thanks,
Alexander