bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline


From: Dmitry Gutov
Subject: bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline
Date: Wed, 11 May 2016 03:00:22 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1

On 05/09/2016 05:13 AM, Artur Malabarba wrote:
IIRC, I made this change because the previous behaviour caused
`package-install-from-buffer' to move point. Since I saw no reason for
lm-header to move point, I fixed the issue at its roots.

Doesn't package-install-from-buffer currently move point anyway? It jumps to the end of the buffer.

Moving save-excursion there does help.

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 3f0e972..f481157 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1979,17 +1979,18 @@ package-install-from-buffer
 Downloads and installs required packages as needed."
   (interactive)
   (let* ((pkg-desc
-          (cond
-            ((derived-mode-p 'dired-mode)
-             ;; This is the only way a package-desc object with a `dir'
-             ;; desc-kind can be created.  Such packages can't be
-             ;; uploaded or installed from archives, they can only be
-             ;; installed from local buffers or directories.
-             (package-dir-info))
-            ((derived-mode-p 'tar-mode)
-             (package-tar-file-info))
-            (t
-             (package-buffer-info))))
+          (save-excursion
+            (cond
+             ((derived-mode-p 'dired-mode)
+              ;; This is the only way a package-desc object with a `dir'
+              ;; desc-kind can be created.  Such packages can't be
+              ;; uploaded or installed from archives, they can only be
+              ;; installed from local buffers or directories.
+              (package-dir-info))
+             ((derived-mode-p 'tar-mode)
+              (package-tar-file-info))
+             (t
+              (package-buffer-info)))))
          (name (package-desc-name pkg-desc)))
     ;; Download and install the dependencies.
     (let* ((requires (package-desc-reqs pkg-desc))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]