#12 cannot reopen file easily

open-accepted
None
5
2004-08-23
2003-06-26
Anonymous
No

It is not possible to reopen a file in the editor if it is
changed from outside. You will have to close the editor
window and open the file again. Just open the file
in the editor will leave the contents unchanged.

Discussion

  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-09-06

    • status: open --> open-accepted
     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-09-10

    • priority: 5 --> 4
     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2004-08-22

    Logged In: YES
    user_id=149084

    This is an RFE which I believe would find limited use.

    Calling an Open dialog on a file which is already open
    merely wakes up the associated window. Doing what
    this RFE asks would require tracking the modification
    times of open files and comparing upon re-open.

     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2004-08-22

    • priority: 4 --> 2
    • status: open-accepted --> open
     
  • Logged In: YES
    user_id=6380

    Hm, *I* would find it extremely useful. The other editor I
    use a lot has several features relating to this issue, and I
    *depend* on them.

     
    • priority: 2 --> 5
     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2004-08-23

    • assigned_to: nobody --> kbk
    • status: open --> open-accepted
     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2004-08-23

    Logged In: YES
    user_id=149084

    Ah, yes, the /other/ editor. Emacs, I presume, also my
    /other/ editor. Emacs has a rather sophisticated locking
    feature involving symlinks which detects at the first
    keystroke that another emacs has modified the file.
    IDLE could interact with that implementation, but I
    assume that you'd be satisfied if IDLE imitated the

    (if (buffer-modified-p buf)
    "File %s changed on disk. Discard your edits? "
    "File %s changed on disk. Reread from disk? ")

    behavior when the disk file was modified by another
    application. This would involve adding the equivalent
    to (verify-visited-file-modtime buf) and an associated
    EditorWindow modtime attribute.

    When the file is saved IDLE could then also detect a time
    mismatch and warn the user that he was about to overwrite
    a modified file.

     
  • Logged In: YES
    user_id=6380

    I wasn't talking about two Emacsen interacting (I rarely
    have more than one running and it's almost always by
    mistake). Emacs does a super job of detecting that some
    other tool (e.g. source control!) touched a file. I guess
    the algorithm is something like

    - save the mtime when first opening
    - upon first change, see if the mtime didn't change
    - upon save, see again if the mtime didn't change

    If the mtime did change, various interaction take place to
    decide whether to cancel the operation or go ahead despite
    the change.