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

:wq doesn't do the right thing from org src buffers #43

Open
dieggsy opened this issue Apr 25, 2018 · 5 comments
Open

:wq doesn't do the right thing from org src buffers #43

dieggsy opened this issue Apr 25, 2018 · 5 comments

Comments

@dieggsy
Copy link

dieggsy commented Apr 25, 2018

From an org src buffer, :w does save the original file, but :wq just quits the buffer without saving the file.

@Somelauw
Copy link
Owner

Unable to reproduce. I tried the following:

  • Start with
#+BEGIN_SRC emacs-lisp
(message "start-point")

#+END_SRC
  • Press C-c '
  • I get
(message "start-point")
  • Modify this into:
(message "start-point")
(message "edit")
  • Now press :wq

  • The result becomes

#+BEGIN_SRC emacs-lisp
  (message "start-point")
  (message "edit")

#+END_SRC
  • Now press :w one more time to save the original org file.

@dieggsy
Copy link
Author

dieggsy commented May 27, 2018

@Somelauw What I'm saying is I shouldn't have to press :w one more time to save the original org file, :w should save the original file

@Somelauw
Copy link
Owner

Somelauw commented May 27, 2018 via email

@dieggsy
Copy link
Author

dieggsy commented May 27, 2018

Calling evil-write interactively from an src block edit results in the message : user-error: Please specify a file name for the buffer. FWIW, I have the following in my init, which does what I want:

    (define-key org-src-mode-map [remap evil-write] 'org-edit-src-save)
    (define-key org-src-mode-map [remap evil-save-and-close]
      (lambda () (interactive)
        (org-edit-src-save)
        (org-edit-src-exit)))
    (define-key org-src-mode-map [remap evil-save-modified-and-close]
      (lambda () (interactive)
        (org-edit-src-save)
        (org-edit-src-exit)))

@Somelauw
Copy link
Owner

Somelauw commented Jun 5, 2018

Calling evil-write interactively from an src block edit results in the message : user-error: Please specify a file name for the buffer.

:w and ZZ both work for me and save the original file.

I'm running the following org-mode version org-plus-contrib 20180604

(define-key org-src-mode-map [remap evil-write] 'org-edit-src-save)

Does this still work when you run :w codeblock.py? This should only save the code in the temporary buffer in a new file codeblock.py. If possible I want to preserve as many features that evil-write originally had as possible.

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