Created
May 15, 2017 01:38
-
-
Save ymattu/6413865b009ad8a6b801edc81daa20a0 to your computer and use it in GitHub Desktop.
Emacs Ipython Notebook で保存できないエラーをなんとかする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun save-buffer (&optional arg) | |
(interactive "p") | |
(if (eq major-mode 'ein:notebook-multilang-mode) | |
(ein:notebook-save-notebook-command) | |
(let ((modp (buffer-modified-p)) | |
(make-backup-files (or (and make-backup-files (not (eq arg 0))) | |
(memq arg '(16 64))))) | |
(and modp (memq arg '(16 64)) (setq buffer-backed-up nil)) | |
(if (and modp (buffer-file-name)) | |
(message "Saving file %s..." (buffer-file-name))) | |
(basic-save-buffer) | |
(and modp (memq arg '(4 64)) (setq buffer-backed-up nil)))) | |
;;; advice /defadvice that fails | |
(defun save-ein() | |
(if (eq major-mode 'ein:notebook-multilang-mode) | |
(ein:notebook-save-notebook-command)))) | |
(advice-add 'save-buffer :before #'save-ein) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment