जैसा कि how to automatically install emacs packages by specifying a list of package names? पर बताया गया है, तो आपको आवश्यक पैकेज के संस्करण को भी रिकॉर्ड करना बेहतर होगा।
(defun list-packages-and-versions()
"Returns a list of all installed packages and their versions"
(mapcar
(lambda (pkg)
`(,pkg ,(package-desc-version
(cadr (assq pkg package-alist)))))
package-activated-list))
है कि आप (NAME VERSION)
जोड़ों की सूची दे देंगे: ऐसा करने के लिए, आप निम्न फ़ंक्शन का उपयोग कर सकते हैं। दुर्भाग्यवश, मैं पैकेज के विशिष्ट संस्करण को स्थापित करने का कोई तरीका नहीं ढूंढ पाया। ऐसा लगता है कि package.el
हमेशा नवीनतम उपलब्ध है। क्या मैं अब कर रहा हूँ है:
(defun install-packages-with-specific-versions (package-version-list)
"Install the packages in the given list with specific versions.
PACKAGE-VERSION-LIST should be a list of (NAME VERSION) lists,
where NAME is a symbol identifying the package and VERSION is
the minimum version to install."
(package-download-transaction
(package-compute-transaction() package-version-list)))
मैं सही संस्करण संख्या मिलान संकुल स्थापित करने के लिए लंबे समय तक समारोह में लिखा है, लेकिन यह विफल रहता है क्योंकि package.el
डिफ़ॉल्ट रूप से केवल नवीनतम संस्करण प्रत्येक पैकेज के लिए उपलब्ध प्राप्त करता है। gist
ओह यह शानदार है। – uchuugaka
यह ध्यान देने योग्य है, पैकेज-सक्रिय सूची संकुल को हटाकर अपडेट नहीं की जाती है, लेकिन केवल पुनरारंभ करने पर ही दिखाई देती है। – uchuugaka