diff options
Diffstat (limited to 'emacs/wc-helper-functions.el')
-rw-r--r-- | emacs/wc-helper-functions.el | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/emacs/wc-helper-functions.el b/emacs/wc-helper-functions.el index e393b1247c6c..2d5924f5e1ff 100644 --- a/emacs/wc-helper-functions.el +++ b/emacs/wc-helper-functions.el @@ -1,11 +1,5 @@ (require 'cl) -(defun wc/edit-file-in-emacs (file) - "Edits a file in a buffer in Emacs. On :wq, the buffer is deleted and the previous term session restored." - (find-file file) - (quick-edit-file-mode)) - - (defun wc/open-in-pager (file) "Opens a file in a simulated pager in emacs." (find-file file) @@ -19,25 +13,34 @@ (kill-this-buffer)) -(defvar quick-edit-file-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "q") 'wc/write-quit-kill-buffer) - map) - "Keymap for emacs quick-edit file mode.") +;; (defun wc/edit-file-in-emacs (file) +;; "Edits a file in a buffer in Emacs. On :wq, the buffer is deleted and the previous term session restored." +;; (find-file file) +;; (quick-edit-file-mode)) -(define-derived-mode quick-edit-file-mode fundamental-mode "QuickEdit" - "Mode quickly editing files." - (setq-local make-backup-files nil) - (setq buffer-name "*quick-edit*")) +;; (defvar quick-edit-file-mode-map +;; (let ((map (make-sparse-keymap))) +;; (define-key map (kbd "q") 'wc/write-quit-kill-buffer) +;; map) +;; "Keymap for emacs quick-edit file mode.") + + +;; (define-derived-mode quick-edit-file-mode fundamental-mode "QuickEdit" +;; "Mode quickly editing files." +;; (setq-local make-backup-files nil) +;; (setq buffer-name "*quick-edit*")) + +;; (defun wc/quick-edit-evil-quit (old-fun &rest args) +;; (if (eq major-mode 'quick-edit-file-mode) +;; (wc/write-quit-kill-buffer) +;; (apply old-fun args))) -(defun wc/quick-edit-evil-quit (old-fun &rest args) - (if (eq major-mode 'quick-edit-file-mode) - (wc/write-quit-kill-buffer) - (apply old-fun args))) -(advice-add #'evil-quit :around #'wc/quick-edit-evil-quit) +;; (defadvice evil-quit +;; (around wc/quick-edit-quick activate) +;; (wc/quick-edit-evil-quit)) (defvar emacs-pager-mode-map |