Limit number of files saved by emacs in desktop-save

What language shall they sing in?

Which communication protocol is used in AdLib sound card?

Why is there a prohibition of gevinat aku"m?

Bash script to truncate subject line of incoming email

Is there any risk in sharing info about technologies and products we use with a supplier?

Which RAF squadrons and aircraft types took part in the bombing of Berlin on the 25th of August 1940?

How do you catch Smeargle in Pokemon Go?

Cryptic with some cross words

Why avoid shared user accounts?

Count repetitions of an array

Does Skippy chunky peanut butter contain trans fat?

Why does magnet wire need to be insulated?

Boss asked me to sign a resignation paper without a date on it along with my new contract

How much mayhem could I cause as a fish?

What makes papers publishable in top-tier journals?

Why was Lupin comfortable with saying Voldemort's name?

How would you say "I like to go bowling" and other suru verbs?

How can I play a serial killer in a party of good PCs?

How do you funnel food off a cutting board?

Separate environment for personal and development use under macOS

Should I always close BufferedReader?

Can the "Friends" spell be used without making the target hostile?

What is the difference between rolling more dice versus fewer dice?

Square Root Distance from Integers



Limit number of files saved by emacs in desktop-save














0















I tend not to delete buffers in emacs, so over time, the number of buffers tends to grow to a hundred or more. (At the moment, *Buffer List* has 144 lines.)



Many of these files are java files, and with my configuration, loading a Java file takes a second or two. This means that starting emacs can take a few minutes.



Is there a way to limit the number of buffers that are saved by the desktop? Ideally, I would like to drop buffers that I have not visited in a while.



I tried this:



(advice-add 'no-save-unseen-buffers :before-while 'desktop-save-buffer-p
(lambda (buffer &optional rest)
(let ((last-time (with-current-buffer buffer buffer-display-time)))
(when (and last-time
(< (time-to-seconds (time-subtract (current-time) last-time))
(* 2 7 24 60 60)))))))


but it does not seem to have an effect.



Advice on how to make the above code work, a completely different approach or package that does what I want are all fine answers.










share|improve this question













migrated from superuser.com 6 mins ago


This question came from our site for computer enthusiasts and power users.























    0















    I tend not to delete buffers in emacs, so over time, the number of buffers tends to grow to a hundred or more. (At the moment, *Buffer List* has 144 lines.)



    Many of these files are java files, and with my configuration, loading a Java file takes a second or two. This means that starting emacs can take a few minutes.



    Is there a way to limit the number of buffers that are saved by the desktop? Ideally, I would like to drop buffers that I have not visited in a while.



    I tried this:



    (advice-add 'no-save-unseen-buffers :before-while 'desktop-save-buffer-p
    (lambda (buffer &optional rest)
    (let ((last-time (with-current-buffer buffer buffer-display-time)))
    (when (and last-time
    (< (time-to-seconds (time-subtract (current-time) last-time))
    (* 2 7 24 60 60)))))))


    but it does not seem to have an effect.



    Advice on how to make the above code work, a completely different approach or package that does what I want are all fine answers.










    share|improve this question













    migrated from superuser.com 6 mins ago


    This question came from our site for computer enthusiasts and power users.





















      0












      0








      0








      I tend not to delete buffers in emacs, so over time, the number of buffers tends to grow to a hundred or more. (At the moment, *Buffer List* has 144 lines.)



      Many of these files are java files, and with my configuration, loading a Java file takes a second or two. This means that starting emacs can take a few minutes.



      Is there a way to limit the number of buffers that are saved by the desktop? Ideally, I would like to drop buffers that I have not visited in a while.



      I tried this:



      (advice-add 'no-save-unseen-buffers :before-while 'desktop-save-buffer-p
      (lambda (buffer &optional rest)
      (let ((last-time (with-current-buffer buffer buffer-display-time)))
      (when (and last-time
      (< (time-to-seconds (time-subtract (current-time) last-time))
      (* 2 7 24 60 60)))))))


      but it does not seem to have an effect.



      Advice on how to make the above code work, a completely different approach or package that does what I want are all fine answers.










      share|improve this question














      I tend not to delete buffers in emacs, so over time, the number of buffers tends to grow to a hundred or more. (At the moment, *Buffer List* has 144 lines.)



      Many of these files are java files, and with my configuration, loading a Java file takes a second or two. This means that starting emacs can take a few minutes.



      Is there a way to limit the number of buffers that are saved by the desktop? Ideally, I would like to drop buffers that I have not visited in a while.



      I tried this:



      (advice-add 'no-save-unseen-buffers :before-while 'desktop-save-buffer-p
      (lambda (buffer &optional rest)
      (let ((last-time (with-current-buffer buffer buffer-display-time)))
      (when (and last-time
      (< (time-to-seconds (time-subtract (current-time) last-time))
      (* 2 7 24 60 60)))))))


      but it does not seem to have an effect.



      Advice on how to make the above code work, a completely different approach or package that does what I want are all fine answers.







      untagged






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 12 mins ago









      Troy DanielsTroy Daniels

      1434




      1434




      migrated from superuser.com 6 mins ago


      This question came from our site for computer enthusiasts and power users.









      migrated from superuser.com 6 mins ago


      This question came from our site for computer enthusiasts and power users.
























          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "583"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f48080%2flimit-number-of-files-saved-by-emacs-in-desktop-save%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Emacs Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f48080%2flimit-number-of-files-saved-by-emacs-in-desktop-save%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...