When loged in as user1 type:
su user2
emacs file.pro # edit, exit and save the changes
emacs file.pro # file.pro is now read only.
I can not edit file.pro the second time because it is apperently locked
by user2 (as shown in the status line? of emacs). File permissions are
correct and the onwner of file.pro (still) is user2.
After some googling I think the possible cause is that emacs is
inconsistent in the way it handles the USER and LOGNAME variables.
Indeed USER is set to user2 whereas LOGNAME is still user1. When I
change LOGNAME to user2 the problem disappears.
So, what to do?