File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,9 @@ lock_file (Lisp_Object fn)
680680 dostounix_filename (SSDATA (fn ));
681681#endif
682682 encoded_fn = ENCODE_FILE (fn );
683+ if (create_lockfiles )
684+ /* Create the name of the lock-file for file fn */
685+ MAKE_LOCK_NAME (lfname , encoded_fn );
683686
684687 /* See if this file is visited and has changed on disk since it was
685688 visited. */
@@ -690,18 +693,15 @@ lock_file (Lisp_Object fn)
690693
691694 if (!NILP (subject_buf )
692695 && NILP (Fverify_visited_file_modtime (subject_buf ))
693- && !NILP (Ffile_exists_p (fn )))
696+ && !NILP (Ffile_exists_p (fn ))
697+ && (!create_lockfiles || current_lock_owner (NULL , lfname ) != -2 ))
694698 call1 (intern ("userlock--ask-user-about-supersession-threat" ), fn );
695699
696700 }
697701
698702 /* Don't do locking if the user has opted out. */
699703 if (create_lockfiles )
700704 {
701-
702- /* Create the name of the lock-file for file fn */
703- MAKE_LOCK_NAME (lfname , encoded_fn );
704-
705705 /* Try to lock the lock. FIXME: This ignores errors when
706706 lock_if_free returns a positive errno value. */
707707 if (lock_if_free (& lock_info , lfname ) < 0 )
You can’t perform that action at this time.
0 commit comments