It seems the thread that the subject refers to is
inaccessible by Gnus, so perhaps the OP won't read this
anyway, but I like to say it nonetheless, because this
bug almost drove me insane.
The below function cannot be used on symbolic links,
because with (buffer-file-name), you'll get the name
(and path) of the *link*...
When used to edit and save such a link that points to a
file not in $HOME, the result is that the link is
*replaced* by the file, and the file (at its original
place), disappears (?).
The code, with the bug:
(defun su-edit ()
"Edit the current buffer file as superuser."
(interactive)
(let ((window-start (window-start))
(point (point))
(mark (if mark-active (region-beginning) nil)) )
(find-alternate-file (format "/sudo::%s" (buffer-file-name)))
(if mark (set-mark mark))
(goto-char point)
(set-window-start nil window-start) ; nil - the selected window
))
The solution, I hope, is:
(file-truename (buffer-file-name))