cssh icon indicating copy to clipboard operation
cssh copied to clipboard

Reduce require commands and change to autoloads

Open jaalto opened this issue 13 years ago • 3 comments

cssh.el is a bit heavy to load multiple libraries at start:

(require 'dired) (require 'ibuffer) (require 'term) (require 'tramp) (require 'cl) (require 'shell)

Please delay loading of these features until used. E.g. User may not use dired at all in his session, so there is no need to load it upfront. Example how to arrange the code after removing "(require 'dired)":

(autoload 'dired-get-filename "dired")

;; See my "pull request". Put this code inside cssh-define-global-bindings (add-hook 'dired-mode-hook 'cssh-define-keys)

(defun cssh-define-keys () (define-key dired-mode-map (kbd "C-=") 'cssh-dired-find-file))

jaalto avatar Dec 27 '11 12:12 jaalto

Do you want to propose a patch?

dimitri avatar Jan 02 '12 14:01 dimitri

Could you pull first, so that I can continue proposing further.

jaalto avatar Jan 02 '12 17:01 jaalto

.. Ah, that was already done. See pull request for fixes for this issue.

jaalto avatar Jan 02 '12 17:01 jaalto