all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* desktop-buffer-info  and set-buffer
@ 2015-03-01 10:03 Artur Malabarba
  2015-03-01 13:33 ` Andreas Röhler
  2015-03-01 15:32 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Artur Malabarba @ 2015-03-01 10:03 UTC (permalink / raw
  To: emacs-devel

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

I noticed yesterday that `desktop-buffer-info' uses `set-buffer' instead of
`with-current-buffer'.

I couldn't find any particular reason for that, but I'm asking here if
anyone knows why, before I go and change it.

Cheers

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

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

* Re: desktop-buffer-info  and set-buffer
  2015-03-01 10:03 desktop-buffer-info and set-buffer Artur Malabarba
@ 2015-03-01 13:33 ` Andreas Röhler
  2015-03-01 15:32 ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Röhler @ 2015-03-01 13:33 UTC (permalink / raw
  To: emacs-devel; +Cc: Artur Malabarba

On 01.03.2015 11:03, Artur Malabarba wrote:
> I noticed yesterday that `desktop-buffer-info' uses `set-buffer' instead of
> `with-current-buffer'.
>
> I couldn't find any particular reason for that, but I'm asking here if
> anyone knows why, before I go and change it.
>
> Cheers
>

AFAIU you are right.

Employed by desktop-save: a test, which would fail if desktop-save changes the current-buffer, should reveal the connected bug.

Thanks,

Andreas




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

* Re: desktop-buffer-info  and set-buffer
  2015-03-01 10:03 desktop-buffer-info and set-buffer Artur Malabarba
  2015-03-01 13:33 ` Andreas Röhler
@ 2015-03-01 15:32 ` Eli Zaretskii
  2015-03-01 16:06   ` Artur Malabarba
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-03-01 15:32 UTC (permalink / raw
  To: bruce.connor.am; +Cc: emacs-devel

> Date: Sun, 1 Mar 2015 10:03:26 +0000
> From: Artur Malabarba <bruce.connor.am@gmail.com>
> 
> I noticed yesterday that `desktop-buffer-info' uses `set-buffer' instead of
> `with-current-buffer'. 
> 
> I couldn't find any particular reason for that, but I'm asking here if anyone
> knows why, before I go and change it.

Why waste cycles on restoring the buffer, when it will be immediately
changed to some other buffer?



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

* Re: desktop-buffer-info and set-buffer
  2015-03-01 15:32 ` Eli Zaretskii
@ 2015-03-01 16:06   ` Artur Malabarba
  2015-03-01 16:12     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Artur Malabarba @ 2015-03-01 16:06 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: emacs-devel

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

> Why waste cycles on restoring the buffer, when it will be immediately
> changed to some other buffer?

Because (by name and purpose) it looks like a function without side
effects, so it's a little surprising that it has.
I don't think this would make a noticeable difference in performance, but
if it's necessary for performance reasons I'll just write something on a
docstring.

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

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

* Re: desktop-buffer-info and set-buffer
  2015-03-01 16:06   ` Artur Malabarba
@ 2015-03-01 16:12     ` Eli Zaretskii
  2015-03-02  6:35       ` Andreas Röhler
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-03-01 16:12 UTC (permalink / raw
  To: bruce.connor.am; +Cc: emacs-devel

> Date: Sun, 1 Mar 2015 16:06:15 +0000
> From: Artur Malabarba <bruce.connor.am@gmail.com>
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
> > Why waste cycles on restoring the buffer, when it will be immediately
> > changed to some other buffer?
> 
> Because (by name and purpose) it looks like a function without side effects, so
> it's a little surprising that it has.

If this is the only issue, documenting it should be enough.

> I don't think this would make a noticeable difference in performance, but if
> it's necessary for performance reasons I'll just write something on a
> docstring.

I don't think it's performance-critical, either, but IMO doing
unnecessary things is unclean regardless.

In any case, this is a minor issue.



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

* Re: desktop-buffer-info and set-buffer
  2015-03-01 16:12     ` Eli Zaretskii
@ 2015-03-02  6:35       ` Andreas Röhler
  2015-03-02 13:23         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Röhler @ 2015-03-02  6:35 UTC (permalink / raw
  To: emacs-devel; +Cc: Eli Zaretskii, Artur Malabarba

On 01.03.2015 17:12, Eli Zaretskii wrote:
>> Date: Sun, 1 Mar 2015 16:06:15 +0000
>> From: Artur Malabarba <bruce.connor.am@gmail.com>

[ ... ]
> I don't think it's performance-critical, either, but IMO doing
> unnecessary things is unclean regardless.
>

The question is, at which point desktop-save is called. If only at end of session, okay.
If during session, consider it a bug changing the current buffer.

BTW was happy to see someone going to clean up the code-base.

> In any case, this is a minor issue.
>
>






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

* Re: desktop-buffer-info and set-buffer
  2015-03-02  6:35       ` Andreas Röhler
@ 2015-03-02 13:23         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2015-03-02 13:23 UTC (permalink / raw
  To: Andreas Röhler; +Cc: bruce.connor.am, emacs-devel

> Date: Mon, 02 Mar 2015 07:35:13 +0100
> From: Andreas Röhler <andreas.roehler@online.de>
> CC: Eli Zaretskii <eliz@gnu.org>, 
>  Artur Malabarba <bruce.connor.am@gmail.com>
> 
> The question is, at which point desktop-save is called. If only at end of 
> session, okay.
> If during session, consider it a bug changing the current buffer.

It is called both during and at the end of the session.

But I don't think it's a bug, because desktop-buffer-info is called
inside a with-temp-buffer form, so it doesn't cause a change of the
current buffer.

> BTW was happy to see someone going to clean up the code-base.

Same here.




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

end of thread, other threads:[~2015-03-02 13:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-01 10:03 desktop-buffer-info and set-buffer Artur Malabarba
2015-03-01 13:33 ` Andreas Röhler
2015-03-01 15:32 ` Eli Zaretskii
2015-03-01 16:06   ` Artur Malabarba
2015-03-01 16:12     ` Eli Zaretskii
2015-03-02  6:35       ` Andreas Röhler
2015-03-02 13:23         ` Eli Zaretskii

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.