Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About locked file of lentic-doc-orgify-if-necessary #28

Open
tumashu opened this issue Apr 11, 2015 · 3 comments
Open

About locked file of lentic-doc-orgify-if-necessary #28

tumashu opened this issue Apr 11, 2015 · 3 comments

Comments

@tumashu
Copy link

tumashu commented Apr 11, 2015

(defun lentic-doc-orgify-if-necessary (file)
  (let* ((target
          (concat
           (file-name-sans-extension file)
           ".org"))
         (locked
          (or (file-locked-p file)
              (file-locked-p target)))
         (open
          (or
           (get-file-buffer file)
           (get-file-buffer target))))
    (unless (or locked open)
      (when (file-newer-than-file-p file target)
        (let ((lentic-kill-retain t))
          (lentic-batch-clone-and-save-with-config
           file 'lentic-orgel-org-init))))))

Why lock file? can this limit remove?

@phillord
Copy link
Owner

Well, if the target is locked trying to write to it is a bad idea. And if the file is locked, this may mean it's open in another Emacs.

@tumashu
Copy link
Author

tumashu commented Apr 11, 2015

Oh, I found the wrong place....

The problem I faced is like this:

when "myfile.org" buffer exist, lentic refuse to write "myfile.org" when i update myfile.el, Is it possible
add a yes-or-no, which can ask me: "myfile.org has been opend, do you want to close it force? "

@phillord
Copy link
Owner

Actually, I think that's a bug. Really, it should work out that the .org file is open and make sure that everything is saved. The file-locked-p is there for the situation when you are running emacs interactively and in batch at the same time (I do this quite often).

This needs to be fixed at some point, I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants