unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline
@ 2016-02-10 16:17 Jonas Bernoulli
  2016-05-08 23:52 ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Jonas Bernoulli @ 2016-02-10 16:17 UTC (permalink / raw)
  To: 22616

Starting with bf3f6a961f378f35a292c41c0bfbdae88ee1b1b9 `lm-header's body
is wrapped with `save-excursion', but `lm-header-multiline' only works
properly if `lm-header' doesn't do that.

In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.25)
 of 2016-01-28 built on hal
Repository revision: 9be8a2fb41043b4d4734a67f155d6923df10671b





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline
  2016-02-10 16:17 bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline Jonas Bernoulli
@ 2016-05-08 23:52 ` Dmitry Gutov
  2016-05-09  2:13   ` Artur Malabarba
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2016-05-08 23:52 UTC (permalink / raw)
  To: Jonas Bernoulli, 22616; +Cc: Artur Malabarba

Arthur,

could you look into this one? And at the bug#22510 merged with it.

Do you remember why you made this change?

On 02/10/2016 06:17 PM, Jonas Bernoulli wrote:
> Starting with bf3f6a961f378f35a292c41c0bfbdae88ee1b1b9 `lm-header's body
> is wrapped with `save-excursion', but `lm-header-multiline' only works
> properly if `lm-header' doesn't do that.
>
> In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.25)
>  of 2016-01-28 built on hal
> Repository revision: 9be8a2fb41043b4d4734a67f155d6923df10671b





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline
  2016-05-08 23:52 ` Dmitry Gutov
@ 2016-05-09  2:13   ` Artur Malabarba
  2016-05-11  0:00     ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Artur Malabarba @ 2016-05-09  2:13 UTC (permalink / raw)
  To: Dmitry Gutov, Jonas Bernoulli, 22616

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

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.
Clearly, we've found a reason now. So the save excursion should be removed
from the latter function to the former.

On Sun, 8 May 2016 8:52 pm Dmitry Gutov, <dgutov@yandex.ru> wrote:

> Arthur,
>
> could you look into this one? And at the bug#22510 merged with it.
>
> Do you remember why you made this change?
>
> On 02/10/2016 06:17 PM, Jonas Bernoulli wrote:
> > Starting with bf3f6a961f378f35a292c41c0bfbdae88ee1b1b9 `lm-header's body
> > is wrapped with `save-excursion', but `lm-header-multiline' only works
> > properly if `lm-header' doesn't do that.
> >
> > In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.25)
> >  of 2016-01-28 built on hal
> > Repository revision: 9be8a2fb41043b4d4734a67f155d6923df10671b
>

[-- Attachment #2: Type: text/html, Size: 1266 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline
  2016-05-09  2:13   ` Artur Malabarba
@ 2016-05-11  0:00     ` Dmitry Gutov
  2016-05-11 22:34       ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2016-05-11  0:00 UTC (permalink / raw)
  To: Artur Malabarba, Jonas Bernoulli, 22616

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))






^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline
  2016-05-11  0:00     ` Dmitry Gutov
@ 2016-05-11 22:34       ` Dmitry Gutov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2016-05-11 22:34 UTC (permalink / raw)
  To: Artur Malabarba, Jonas Bernoulli, 22616-done

Version: 25.1

On 05/11/2016 03:00 AM, Dmitry Gutov wrote:

> Moving save-excursion there does help.

Applied, and closing.

Thanks all.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-11 22:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10 16:17 bug#22616: 25.0.50; Change to lm-header breaks lm-header-multiline Jonas Bernoulli
2016-05-08 23:52 ` Dmitry Gutov
2016-05-09  2:13   ` Artur Malabarba
2016-05-11  0:00     ` Dmitry Gutov
2016-05-11 22:34       ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).