From: Stefan Kangas Date: Fri, 4 Oct 2019 16:30:34 +0000 (+0200) Subject: Doc fixes in package.el X-Git-Tag: emacs-27.0.90~134 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fabf0065c51ad0714e4ade2c5f44d6e81921d3fe;p=emacs.git Doc fixes in package.el * lisp/emacs-lisp/package.el (package-process-define-package) (package-generate-description-file): Doc fixes. (package-generate-autoloads, package--write-file-no-coding) (package--archive-file-exists-p, package-desc-status): Add doc strings. --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 91b32dfa79d..afe42c7d723 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -606,8 +606,10 @@ EXP should be a form read from a foo-pkg.el file. Convert EXP into a `package-desc' object using the `package-desc-from-define' constructor before pushing it to `package-alist'. -If there already exists a package by that name in -`package-alist', replace that definition with the new one." + +If there already exists a package by the same name in +`package-alist', insert this object there such that the packages +are sorted with the highest version first." (when (eq (car-safe exp) 'define-package) (let* ((new-pkg-desc (apply #'package-desc-from-define (cdr exp))) (name (package-desc-name new-pkg-desc)) @@ -953,7 +955,7 @@ untar into a directory named DIR; otherwise, signal an error." pkg-dir)) (defun package-generate-description-file (pkg-desc pkg-file) - "Create the foo-pkg.el file for single-file packages." + "Create the foo-pkg.el file PKG-FILE for single-file package PKG-DESC." (let* ((name (package-desc-name pkg-desc))) (let ((print-level nil) (print-quoted t) @@ -997,6 +999,7 @@ untar into a directory named DIR; otherwise, signal an error." (defvar version-control) (defun package-generate-autoloads (name pkg-dir) + "Generate autoloads in PKG-DIR for package named NAME." (let* ((auto-name (format "%s-autoloads.el" name)) ;;(ignore-name (concat name "-pkg.el")) (generated-autoload-file (expand-file-name auto-name pkg-dir)) @@ -1177,12 +1180,14 @@ The return result is a `package-desc'." ;; signature checking. (defun package--write-file-no-coding (file-name) + "Write file FILE-NAME without encoding using coding system." (let ((buffer-file-coding-system 'no-conversion)) (write-region (point-min) (point-max) file-name nil 'silent))) (declare-function url-http-file-exists-p "url-http" (url)) (defun package--archive-file-exists-p (location file) + "Return t if FILE exists in remote LOCATION." (let ((http (string-match "\\`https?:" location))) (if http (progn @@ -2820,6 +2825,7 @@ of these dependencies, similar to the list returned by (push dep out))))))))))) (defun package-desc-status (pkg-desc) + "Return the status of `package-desc' object PKG-DESC." (let* ((name (package-desc-name pkg-desc)) (dir (package-desc-dir pkg-desc)) (lle (assq name package-load-list))