Move eshell-C-d to eshell library
This commit is contained in:
parent
40b26e86cf
commit
ea35825e1d
2 changed files with 18 additions and 15 deletions
|
@ -148,16 +148,6 @@ MODE1 is enabled and vice-versa."
|
|||
"Set the `disabled' property for each item in FUNCTIONS to nil."
|
||||
(mapc #'(lambda (f) (put f 'disabled nil)) functions))
|
||||
|
||||
(defun oni:eshell-C-d ()
|
||||
"Either call `delete-char' interactively or quit."
|
||||
(interactive)
|
||||
(condition-case err
|
||||
(call-interactively #'delete-char)
|
||||
(error (if (and (eq (car err) 'end-of-buffer)
|
||||
(looking-back eshell-prompt-regexp nil))
|
||||
(kill-buffer)
|
||||
(signal (car err) (cdr err))))))
|
||||
|
||||
(defun oni:level (lst)
|
||||
"Reduce a 2-level list LST to a flat list."
|
||||
(let ((lsts (mapcar (lambda (l) (if (listp l) l (list l))) lst)))
|
||||
|
@ -459,10 +449,6 @@ insert at the end of the region and at the beginning."
|
|||
"Set some keybindings for `dired'."
|
||||
(local-set-key (kbd "E") #'wdired-change-to-wdired-mode))
|
||||
|
||||
(defun oni:set-keys-for-eshell ()
|
||||
"Set some keybindings for `eshell'."
|
||||
(local-set-key (kbd "C-d") #'oni:eshell-C-d))
|
||||
|
||||
(defun oni:set-keys-for-hy ()
|
||||
"Set some keybindings for `hy-mode'."
|
||||
(local-set-key (kbd "{") #'paredit-open-curly)
|
||||
|
@ -1042,7 +1028,7 @@ If no direction is given, don't split."
|
|||
#'paredit-mode #'eldoc-mode #'oni:set-emacs-lisp-keys)
|
||||
|
||||
(oni:add-hooks 'eshell-mode-hook
|
||||
#'buffer-disable-undo #'oni:set-keys-for-eshell
|
||||
#'buffer-disable-undo 'oni:set-keys-for-eshell
|
||||
#'eshell-fringe-status-mode)
|
||||
|
||||
(oni:add-hooks 'gnus-summary-mode-hook
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
;;; Code:
|
||||
|
||||
(require 'em-dirs)
|
||||
(require 'em-prompt)
|
||||
|
||||
;;;###autoload
|
||||
(defun eshell/cdp ()
|
||||
|
@ -49,5 +50,21 @@ directory in it."
|
|||
'action (lambda (button)
|
||||
(browse-url (button-label button)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun oni:eshell-C-d ()
|
||||
"Either call `delete-char' interactively or quit."
|
||||
(interactive)
|
||||
(condition-case err
|
||||
(call-interactively #'delete-char)
|
||||
(error (if (and (eq (car err) 'end-of-buffer)
|
||||
(looking-back eshell-prompt-regexp nil))
|
||||
(kill-buffer)
|
||||
(signal (car err) (cdr err))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun oni:set-keys-for-eshell ()
|
||||
"Set some keybindings for `eshell'."
|
||||
(define-key eshell-mode-map (kbd "C-d") #'oni:eshell-C-d))
|
||||
|
||||
(provide 'oni-eshell)
|
||||
;;; oni-eshell.el ends here
|
||||
|
|
Loading…
Reference in a new issue