unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15262: 24.3.50; desktop does not save buffer-display-time
@ 2013-09-03 19:09 Sam Steingold
  2013-09-03 19:26 ` Glenn Morris
  2019-08-18 17:26 ` Stefan Kangas
  0 siblings, 2 replies; 12+ messages in thread
From: Sam Steingold @ 2013-09-03 19:09 UTC (permalink / raw)
  To: 15262

desktop saves the buffers, but not their buffer-display-time.
i.e., when Emacs is started and desktop loads all the old buffers,
their buffer-display-time is set to the Emacs start time.
this leads to ancient buffers not being cleaned up by clean-buffer-list.


In GNU Emacs 24.3.50.12 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4)
 of 2013-09-03 on t520sds
Bzr revision: 114115 dmantipov@yandex.ru-20130903124135-n1l2ri1aroxpa9pa
Windowing system distributor `The X.Org Foundation', version 11.0.11303000
System Description:	Ubuntu 13.04

Configured using:
 `configure --with-wide-int'

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: C
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-undo-mode: t
  diff-auto-refine-mode: t
  rcirc-track-minor-mode: t
  global-edit-server-edit-mode: t
  which-function-mode: t
  url-handler-mode: t
  show-paren-mode: t
  desktop-save-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t

Features:
(shadow bbdb-message mailalias cookie1 nnir emacsbug sendmail url-http
url-gw url-auth sort gnus-cite smiley url-queue url-cache url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util shr mm-archive gnus-async gnus-bcklg gnus-dup qp mail-extr
gnus-ml disp-table spam spam-stat gnus-uu yenc nndraft nnmh gnus-agent
gnus-srvr gnus-score score-mode nnvirtual gnus-msg utf-7 nnimap utf7
nnfolder parse-time gnus-cache bbdb-gnus gnus-art mm-uu mml2015
epg-config mm-view mml-smime smime dig mailcap gnus-sum netrc gnutls
network-stream starttls tls nntp gnus-group gnus-undo nnmail mail-source
nnoo tramp-cache tramp-sh tramp tramp-compat tramp-loaddefs trampver
gnus-start gnus-spec gnus-int gnus-range message rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums gmm-utils mailheader gnus-win skeleton cal-move cal-x view
cal-china cal-bahai cal-islam cal-julian holidays hol-loaddefs cal-iso
cal-hebrew lunar solar cal-dst appt diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs debug whitespace diff-mode warnings time-stamp
cl-indent dabbrev edebug misearch multi-isearch find-func help-mode
mule-util remember bug-reference add-log sgml-mode nxml-uchnm rng-xsd
xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse
nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode
nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok cl-macs
cc-langs jde derived jde-annotations jde-open-source semantic/senator
semantic/decorate pulse jde-bsh jde-parse-expr etags jde-class
jde-parse-class jde-import jde-java-font-lock jde-which-method
jde-java-grammar jde-wiz jde-complete semantic/idle jde-plugins jde-gen
tempo jde-run jde-jdb jde-bug jde-dbs jde-dbo regress jde-db jde-parse
sregex jde-imenu semantic/imenu semantic/db-file data-debug cedet-files
semantic/db gv eieio-base semantic/java semantic/doc avl-tree
semantic/sb speedbar sb-image dframe semantic/sort semantic/format
ezimage semantic/tag-ls semantic/find semantic/ctxt jde-compile cus-edit
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet jde-help jde-widgets tree-widget beanshell
lmenu jde-custom jde-project-file jde-util arc-mode archive-mode efc
jde-autoload cperl-mode make-mode js2-mode js json cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine vc-git noutline
outline easy-mmode vc-bzr sh-script smie vc-dir ewoc vc vc-dispatcher
dired-aux doc-view jka-compr image-mode vc-hg auto-complete edmacro
kmacro popup info package vlf dired midnight autoloads gnus gnus-ems
nnheader mail-utils wid-edit bbdb-mua bbdb-com mailabbrev bbdb-loaddefs
bbdb timezone rcirc edit-server server uniquify which-func imenu
url-handlers url-parse auth-source eieio byte-opt bytecomp byte-compile
cconv eieio-core gnus-util mm-util mail-prsvr password-cache url-vars
paren help-at-pt desktop frameset cus-start cus-load ido ess-toolbar
ess-mouse mouseme thingatpt browse-url ess-menu ess-swv ess-noweb
ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d ess-sas-l
ess-sas-a shell pcomplete ess-sta-d ess-sta-l cc-vars cc-defs
make-regexp ess-sp6-d ess-sp3-d ess-julia ess-r-d compile ess-tracebug
format-spec ess-roxy advice hideshow ess-help ess-developer ess-r-args
eldoc help-fns ess-s-l ess ess-inf comint ansi-color ring ess-mode
ess-noweb-mode ess-utils ess-custom executable easymenu ess-compat
ess-site cl cl-loaddefs cl-lib time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring) X 11.0.11303000
http://www.childpsy.net/ http://jihadwatch.org http://dhimmi.com http://ffii.org
http://honestreporting.com http://openvotingconsortium.org
I'd give my right arm to be ambidextrous.





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2013-09-03 19:09 bug#15262: 24.3.50; desktop does not save buffer-display-time Sam Steingold
@ 2013-09-03 19:26 ` Glenn Morris
  2013-09-03 19:46   ` Sam Steingold
  2019-08-18 17:26 ` Stefan Kangas
  1 sibling, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2013-09-03 19:26 UTC (permalink / raw)
  To: sds; +Cc: 15262

Sam Steingold wrote:

> desktop saves the buffers, but not their buffer-display-time.
> i.e., when Emacs is started and desktop loads all the old buffers,
> their buffer-display-time is set to the Emacs start time.

So add buffer-display-time to your value of desktop-locals-to-save.

> this leads to ancient buffers not being cleaned up by clean-buffer-list.

It's not obvious to me that everyone will want the same behaviour as
you do.





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2013-09-03 19:26 ` Glenn Morris
@ 2013-09-03 19:46   ` Sam Steingold
  2013-09-03 19:51     ` Glenn Morris
  0 siblings, 1 reply; 12+ messages in thread
From: Sam Steingold @ 2013-09-03 19:46 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 15262

On Tue, Sep 3, 2013 at 3:26 PM, Glenn Morris <rgm@gnu.org> wrote:
> Sam Steingold wrote:
>
>> desktop saves the buffers, but not their buffer-display-time.
>> i.e., when Emacs is started and desktop loads all the old buffers,
>> their buffer-display-time is set to the Emacs start time.
>
> So add buffer-display-time to your value of desktop-locals-to-save.

thanks!
Alas, there is no interface for pushing values to custom variables...
I would have to do either
(custom-set-variables
 '(desktop-locals-to-save (cons 'buffer-display-time desktop-locals-to-save)
   nil (desktop)))
or
(eval-after-load "desktop"
 '(add-to-list 'desktop-locals-to-save 'buffer-display-time))
neither of which is perfect.
(the first can push repeatedly and the second bypasses the custom system)

>> this leads to ancient buffers not being cleaned up by clean-buffer-list.
>
> It's not obvious to me that everyone will want the same behaviour as
> you do.

Can you describe a situation when the current behavior is more useful
than the proposed one?
thanks.

-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net/>





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2013-09-03 19:46   ` Sam Steingold
@ 2013-09-03 19:51     ` Glenn Morris
  2013-09-03 20:04       ` Sam Steingold
  0 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2013-09-03 19:51 UTC (permalink / raw)
  To: Sam Steingold; +Cc: 15262

Sam Steingold wrote:

> Alas, there is no interface for pushing values to custom variables...

Still waiting for someone to implement the "diff-list" custom type.
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7812#26

> Can you describe a situation when the current behavior is more useful
> than the proposed one?

Maybe someone wants starting a new Emacs to reset the clocks on all
their buffers, so none are considered "old".
(I've never used clean-buffer-list.)





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2013-09-03 19:51     ` Glenn Morris
@ 2013-09-03 20:04       ` Sam Steingold
  2013-09-03 20:30         ` Glenn Morris
  0 siblings, 1 reply; 12+ messages in thread
From: Sam Steingold @ 2013-09-03 20:04 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 15262

On Tue, Sep 3, 2013 at 3:51 PM, Glenn Morris <rgm@gnu.org> wrote:
> Sam Steingold wrote:
>
>> Alas, there is no interface for pushing values to custom variables...
>
> Still waiting for someone to implement the "diff-list" custom type.
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7812#26

thanks for the link, see also http://thread.gmane.org/gmane.emacs.help/86660

>> Can you describe a situation when the current behavior is more useful
>> than the proposed one?
>
> Maybe someone wants starting a new Emacs to reset the clocks on all
> their buffers, so none are considered "old".

why would one want to do that?

> (I've never used clean-buffer-list.)

it's in midnight.el

-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net/>





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2013-09-03 20:04       ` Sam Steingold
@ 2013-09-03 20:30         ` Glenn Morris
  2013-09-03 20:39           ` Sam Steingold
  0 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2013-09-03 20:30 UTC (permalink / raw)
  To: Sam Steingold; +Cc: 15262

Sam Steingold wrote:

>> Maybe someone wants starting a new Emacs to reset the clocks on all
>> their buffers, so none are considered "old".
>
> why would one want to do that?

You don't think there's anyone alive who would think it weird to start
an Emacs at 11.59pm, then have a bunch of buffers killed 1 minute later
as "too old"?

(Make whatever change you like to the default value, I don't care.)





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2013-09-03 20:30         ` Glenn Morris
@ 2013-09-03 20:39           ` Sam Steingold
  2013-09-03 22:55             ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Sam Steingold @ 2013-09-03 20:39 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 15262

On Tue, Sep 3, 2013 at 4:30 PM, Glenn Morris <rgm@gnu.org> wrote:
> Sam Steingold wrote:
>
>>> Maybe someone wants starting a new Emacs to reset the clocks on all
>>> their buffers, so none are considered "old".
>>
>> why would one want to do that?
>
> You don't think there's anyone alive who would think it weird to start
> an Emacs at 11.59pm, then have a bunch of buffers killed 1 minute later
> as "too old"?

well, let's see: the last time the user saw the buffers was 3 days ago.
and he explicitly (by enabling midnight) requested that they are purged.
what's weird?
ah, I see! suppose the user have not used emacs for a week.
then all buffers will be killed.
maybe it would make sense to advance the saved buffer-display-time
by the period while emacs was inactive.
wdyt?

> (Make whatever change you like to the default value, I don't care.)

thanks.

-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net/>





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2013-09-03 20:39           ` Sam Steingold
@ 2013-09-03 22:55             ` Stefan Monnier
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2013-09-03 22:55 UTC (permalink / raw)
  To: Sam Steingold; +Cc: 15262

> maybe it would make sense to advance the saved buffer-display-time
> by the period while emacs was inactive.

IOW save the "inactive time" rather than the "last display time".
That would make sense and would be OK for the default.


        Stefan





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2013-09-03 19:09 bug#15262: 24.3.50; desktop does not save buffer-display-time Sam Steingold
  2013-09-03 19:26 ` Glenn Morris
@ 2019-08-18 17:26 ` Stefan Kangas
  2019-08-18 20:58   ` Juri Linkov
  1 sibling, 1 reply; 12+ messages in thread
From: Stefan Kangas @ 2019-08-18 17:26 UTC (permalink / raw)
  To: Sam Steingold; +Cc: 15262-done

Sam Steingold <sds@gnu.org> writes:

> On Tue, Sep 3, 2013 at 4:30 PM, Glenn Morris <rgm@gnu.org> wrote:
>> Sam Steingold wrote:
>>
>>>> Maybe someone wants starting a new Emacs to reset the clocks on all
>>>> their buffers, so none are considered "old".
>>>
>>> why would one want to do that?
>>
>> You don't think there's anyone alive who would think it weird to start
>> an Emacs at 11.59pm, then have a bunch of buffers killed 1 minute later
>> as "too old"?
>
> well, let's see: the last time the user saw the buffers was 3 days ago.
> and he explicitly (by enabling midnight) requested that they are purged.
> what's weird?
> ah, I see! suppose the user have not used emacs for a week.
> then all buffers will be killed.
> maybe it would make sense to advance the saved buffer-display-time
> by the period while emacs was inactive.

The changes suggested by Sam Steingold above is now on master, and I'm
therefore closing this bug report.

commit cd726ef68ece4fff6772bd08c0051c294e925505
Author: Sam Steingold <sds@gnu.org>
Date:   Sat Oct 15 23:14:48 2016 -0400

    Save and restore buffer-display-time

    * desktop.el (desktop-locals-to-save): Add `buffer-display-time'
    (desktop-read): Set `desktop-file-modtime' before loading the desktop file
    (desktop-create-buffer): Adjust `buffer-display-time' for the
    downtime

Thanks,
Stefan Kangas





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2019-08-18 17:26 ` Stefan Kangas
@ 2019-08-18 20:58   ` Juri Linkov
  2019-08-21 21:10     ` Stefan Kangas
  0 siblings, 1 reply; 12+ messages in thread
From: Juri Linkov @ 2019-08-18 20:58 UTC (permalink / raw)
  To: 15262; +Cc: sds, stefan

>>>>> Maybe someone wants starting a new Emacs to reset the clocks on all
>>>>> their buffers, so none are considered "old".
>>>>
>>>> why would one want to do that?
>>>
>>> You don't think there's anyone alive who would think it weird to start
>>> an Emacs at 11.59pm, then have a bunch of buffers killed 1 minute later
>>> as "too old"?
>>
>> well, let's see: the last time the user saw the buffers was 3 days ago.
>> and he explicitly (by enabling midnight) requested that they are purged.
>> what's weird?
>> ah, I see! suppose the user have not used emacs for a week.
>> then all buffers will be killed.
>> maybe it would make sense to advance the saved buffer-display-time
>> by the period while emacs was inactive.
>
> The changes suggested by Sam Steingold above is now on master, and I'm
> therefore closing this bug report.
>
> commit cd726ef68ece4fff6772bd08c0051c294e925505
> Author: Sam Steingold <sds@gnu.org>
> Date:   Sat Oct 15 23:14:48 2016 -0400
>
>     Save and restore buffer-display-time
>
>     * desktop.el (desktop-locals-to-save): Add `buffer-display-time'
>     (desktop-read): Set `desktop-file-modtime' before loading the desktop file
>     (desktop-create-buffer): Adjust `buffer-display-time' for the
>     downtime

I used to show buffer-display-time in the customized buffer list.
After that change buffer-display-time displayed weird times,
so I had to replace buffer-display-time with visited-file-modtime
instead.  But I think this issue has a minuscule importance,
so unless somebody wants to add a new attribute inactive-time,
it was ok to close this.





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2019-08-18 20:58   ` Juri Linkov
@ 2019-08-21 21:10     ` Stefan Kangas
  2019-08-21 22:28       ` Juri Linkov
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Kangas @ 2019-08-21 21:10 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Sam Steingold, 15262

Juri Linkov <juri@linkov.net> writes:

> > commit cd726ef68ece4fff6772bd08c0051c294e925505
> > Author: Sam Steingold <sds@gnu.org>
> > Date:   Sat Oct 15 23:14:48 2016 -0400
> >
> >     Save and restore buffer-display-time
> >
> >     * desktop.el (desktop-locals-to-save): Add `buffer-display-time'
> >     (desktop-read): Set `desktop-file-modtime' before loading the desktop file
> >     (desktop-create-buffer): Adjust `buffer-display-time' for the
> >     downtime
>
> I used to show buffer-display-time in the customized buffer list.
> After that change buffer-display-time displayed weird times,
> so I had to replace buffer-display-time with visited-file-modtime
> instead.  But I think this issue has a minuscule importance,
> so unless somebody wants to add a new attribute inactive-time,
> it was ok to close this.

Thanks for that.  What does "customized buffer list" mean here more
exactly?  And does this suggest that there is a bug in the above
commit?

Best regards,
Stefan Kangas





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

* bug#15262: 24.3.50; desktop does not save buffer-display-time
  2019-08-21 21:10     ` Stefan Kangas
@ 2019-08-21 22:28       ` Juri Linkov
  0 siblings, 0 replies; 12+ messages in thread
From: Juri Linkov @ 2019-08-21 22:28 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Sam Steingold, 15262

>> I used to show buffer-display-time in the customized buffer list.
>> After that change buffer-display-time displayed weird times,
>> so I had to replace buffer-display-time with visited-file-modtime
>> instead.  But I think this issue has a minuscule importance,
>> so unless somebody wants to add a new attribute inactive-time,
>> it was ok to close this.
>
> Thanks for that.  What does "customized buffer list" mean here more
> exactly?  And does this suggest that there is a bug in the above
> commit?

This is from an external package, so no core Emacs packages are affected.
I'm not sure if it could be called a bug, maybe just a misfeature.





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

end of thread, other threads:[~2019-08-21 22:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-03 19:09 bug#15262: 24.3.50; desktop does not save buffer-display-time Sam Steingold
2013-09-03 19:26 ` Glenn Morris
2013-09-03 19:46   ` Sam Steingold
2013-09-03 19:51     ` Glenn Morris
2013-09-03 20:04       ` Sam Steingold
2013-09-03 20:30         ` Glenn Morris
2013-09-03 20:39           ` Sam Steingold
2013-09-03 22:55             ` Stefan Monnier
2019-08-18 17:26 ` Stefan Kangas
2019-08-18 20:58   ` Juri Linkov
2019-08-21 21:10     ` Stefan Kangas
2019-08-21 22:28       ` Juri Linkov

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