summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/package.el13
-rw-r--r--lisp/international/mule.el12
-rw-r--r--lisp/simple.el2
3 files changed, 24 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 362335220f0..cacc8b0c18c 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1754,6 +1754,15 @@ if it is still empty."
(indirect indirect-deps)
(t (delete-dups (append direct-deps indirect-deps))))))
+(defun package--user-installed-p (package)
+ "Return non-nil if PACKAGE is a user-installed package.
+PACKAGE is the package name, a symbol. Check whether the package
+was installed into `package-user-dir' where we assume to have
+control over."
+ (let* ((pkg-desc (cadr (assq package package-alist)))
+ (dir (package-desc-dir pkg-desc)))
+ (file-in-directory-p dir package-user-dir)))
+
(defun package--removable-packages ()
"Return a list of names of packages no longer needed.
These are packages which are neither contained in
@@ -1763,7 +1772,9 @@ These are packages which are neither contained in
;; `p' and its dependencies are needed.
append (cons p (package--get-deps p)))))
(cl-loop for p in (mapcar #'car package-alist)
- unless (memq p needed)
+ unless (or (memq p needed)
+ ;; Do not auto-remove external packages.
+ (not (package--user-installed-p p)))
collect p)))
(defun package--used-elsewhere-p (pkg-desc &optional pkg-list all)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index a5e7477e758..0267b154409 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -2545,7 +2545,17 @@ This function is intended to be added to `auto-coding-functions'."
(let* ((match (match-string 2))
(sym (intern (downcase match))))
(if (coding-system-p sym)
- sym
+ ;; If the encoding tag is UTF-8 and the buffer's
+ ;; encoding is one of the variants of UTF-8, use the
+ ;; buffer's encoding. This allows, e.g., saving an
+ ;; HTML file as UTF-8 with BOM when the tag says UTF-8.
+ (let ((sym-type (coding-system-type sym))
+ (bfcs-type
+ (coding-system-type buffer-file-coding-system)))
+ (if (and (coding-system-equal 'utf-8 sym-type)
+ (coding-system-equal 'utf-8 bfcs-type))
+ buffer-file-coding-system
+ sym))
(message "Warning: unknown coding system \"%s\"" match)
nil)))))
diff --git a/lisp/simple.el b/lisp/simple.el
index 8d770478aa9..6040d48a991 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6019,7 +6019,7 @@ into account variable-width characters and line continuation.
If nil, `line-move' moves point by logical lines.
A non-nil setting of `goal-column' overrides the value of this variable
and forces movement by logical lines.
-A window that is horizontally scrolled also forces movement by logical
+A window that is horizontally scrolled also forces movement by logical
lines."
:type 'boolean
:group 'editing-basics