Function: tramp-recompile-elpa

tramp-recompile-elpa is an autoloaded, interactive and byte-compiled function defined in tramp-cmds.el.gz.

Signature

(tramp-recompile-elpa)

Documentation

Recompile the installed Tramp ELPA package.

This is needed if there are compatibility problems.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cmds.el.gz
;;;###tramp-autoload
(defun tramp-recompile-elpa ()
  "Recompile the installed Tramp ELPA package.
This is needed if there are compatibility problems."
  ;; (declare (completion tramp-recompile-elpa-command-completion-p))
  (interactive)
  ;; We expect just one Tramp package is installed.
  (when-let
      ((dir (tramp-compat-funcall
	     'package-desc-dir
	     (car (alist-get 'tramp (bound-and-true-p package-alist))))))
    (dolist (elc (directory-files dir 'full "\\.elc\\'"))
      (delete-file elc))
    (with-current-buffer (get-buffer-create byte-compile-log-buffer)
      (let ((inhibit-read-only t))
	(compilation-mode)
	(goto-char (point-max))
	(insert "\f\n")
	(call-process
	 (expand-file-name invocation-name invocation-directory) nil t t
	 "-Q" "-batch" "-L" dir
	 "--eval" (format "(byte-recompile-directory %S 0 t)" dir))
	(message "Package `tramp' recompiled.")))))