all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [ELPA] New package: activities
@ 2024-01-26  0:59 Adam Porter
  2024-01-26  7:33 ` Philip Kaludercic
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: Adam Porter @ 2024-01-26  0:59 UTC (permalink / raw)
  To: emacs-devel

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

Hi,

I'd like to add a new package to ELPA, activities.el.  It's hosted at:

   https://github.com/alphapapa/activities.el

Here's the description; please see the readme/manual for more details.

   Inspired by Genera's and KDE's concepts of "activities", this library 
allows the user to select an "activity", the loading of which restores a 
window configuration and/or frameset, along with the buffers shown in 
each window.  Saving an activity saves the state for later restoration. 
Switching away from an activity saves the last-used state for later 
switching back to, while still allowing the activity's initial or 
default state to be restored on demand.  Resuming an activity loads the 
last-used state, or the initial/default state when a universal argument 
is provided.

   The implementation uses the bookmark system to save buffers' 
states–that is, any major mode that supports the bookmark system is 
compatible.  A buffer whose major mode does not support the bookmark 
system (or does not support it well enough to restore useful state) is 
not compatible and can't be fully restored, or perhaps not at all; but 
solving that is as simple as implementing bookmark support for the mode, 
which is usually trivial.

   Integration with Emacs's `tab-bar-mode' is provided: a window 
configuration or frameset can be restored to a window or set of frames, 
or to a tab or set of tabs.

   Various hooks are (or will be–feedback is welcome) provided, both 
globally and per-activity, so that the user can define functions to be 
called when an activity is saved, restored, or switched from/to.  For 
example, this could be used to limit the set of buffers offered for 
switching to within an activity, or to track the time spent in an activity.

Please see the attached patch to elpa-packages.

Thanks,
Adam

[-- Attachment #2: 0001-elpa-packages-activities-New-package.patch --]
[-- Type: text/x-patch, Size: 730 bytes --]

From 96e673cb20366758e4b928f72e7a1491039fa635 Mon Sep 17 00:00:00 2001
From: Adam Porter <adam@alphapapa.net>
Date: Thu, 25 Jan 2024 18:53:38 -0600
Subject: [PATCH] elpa-packages (activities): New package

---
 elpa-packages | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/elpa-packages b/elpa-packages
index c73e8a066b..c77b650592 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -35,6 +35,9 @@
 
 ((ace-window		:url "https://github.com/abo-abo/ace-window")
  (ack			:url "https://github.com/leoliu/ack-el")
+ (activities           	:url "https://github.com/alphapapa/activities.el.git"
+   :release-branch "stable"
+   :doc "README.org")
  (ada-mode		:url nil
   :doc ("ada-mode.texi")
   :release-branch t)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 29+ messages in thread
* Re: [ELPA] New package: activities
@ 2024-01-27 19:20 Drew Adams
  0 siblings, 0 replies; 29+ messages in thread
From: Drew Adams @ 2024-01-27 19:20 UTC (permalink / raw)
  To: Sergey Organov, Eric S Fraga; +Cc: emacs-devel@gnu.org

Just one comment about desktop.el, FWIW.

I've said this more than once over the
decades, but I'll mention it again since
the question of desktop files being limited
by being directory-based has come up again
in this thread (as only one small part of
this thread).

There's no reason desktop files should be
limited in this way.  You should be able to
have multiple desktop files in a directory.
There's no necessary relation between a
desktop file and any particular directory.

It's a design bug, IMO.

I fixed this long ago, in order to let you
bookmark desktops flexibly.  A trivial fix
lets you load an arbitrary desktop file.

This 2019 post covers this, but there are
likely older posts by me that do the same:

https://lists.gnu.org/archive/html/emacs-devel/2019-09/msg00571.html

Here again is the code that fixes this
design oversight, FWIW:

(defun bmkp-desktop-save (desktop-file)
  "Save current desktop in DESKTOP-FILE."
  (let ((desktop-base-file-name
         (file-name-nondirectory desktop-file))
        (desk-dir
         (file-name-directory desktop-file))
        (desktop-restore-eager  t)) ; Don't bother w/ lazy.
    (desktop-save desk-dir 'RELEASE 'AUTOSAVE)))

;; Derived from code in `desktop-read'.
;;
 (defun bmkp-desktop-read (file)
  "Load desktop-file FILE, then run `desktop-after-read-hook'.
Return t if FILE was loaded, nil otherwise."
  (interactive)
  (when (file-directory-p file)
    (error "`%s' is a directory, not a file" file))
  (setq desktop-dirname  (file-name-directory file))
  (if (not (file-readable-p file))
      nil ; Return nil: not loaded.
    (let ((desktop-restore-eager      t) ; Don't bother w/ lazy.
          (desktop-first-buffer       nil)
          (desktop-buffer-ok-count    0)
          (desktop-buffer-fail-count  0)
          ;; Prevent desktop-saving for eval of desktop buffer.
          (desktop-save               nil))
      (desktop-lazy-abort)
      (load file t t t)
      (setq desktop-file-modtime (nth 5 (file-attributes file)))
      (mapc 'bury-buffer
            (nreverse (cdr (memq desktop-first-buffer
                                 (nreverse (buffer-list))))))
      (switch-to-buffer (car (buffer-list)))
      (run-hooks 'desktop-delay-hook)
      (setq desktop-delay-hook  ())
      (run-hooks 'desktop-after-read-hook)
      (message "Desktop: %d buffer%s restored%s%s."
               desktop-buffer-ok-count
               (if (= 1 desktop-buffer-ok-count) "" "s")
               (if (< 0 desktop-buffer-fail-count)
                   (format ", %d failed to restore"
                           desktop-buffer-fail-count)
                 "")
               (if desktop-buffer-args-list
                   (format ", %d to be restored lazily"
                           (length desktop-buffer-args-list))
                 ""))
      t))) ; Return t: successfully loaded.



^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: [ELPA] New package: activities
@ 2024-02-01  5:33 Joseph Turner
  0 siblings, 0 replies; 29+ messages in thread
From: Joseph Turner @ 2024-02-01  5:33 UTC (permalink / raw)
  To: adam; +Cc: emacs-devel

Hello!

I find activities.el's ideas and its implementation useful.

I'm glad ELPA accepts packages that overlap with core functionality.

With activities.el available on ELPA, I wonder if it's more likely that
someone will find it, appreciate its ideas, and extend desktop.el.

Everybody wins :)

Thank you!!

Joseph



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

end of thread, other threads:[~2024-02-01  5:33 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-26  0:59 [ELPA] New package: activities Adam Porter
2024-01-26  7:33 ` Philip Kaludercic
2024-01-26 10:36   ` Adam Porter
2024-01-29 19:50     ` Adam Porter
2024-01-30  7:16       ` Philip Kaludercic
2024-01-30  7:43         ` Adam Porter
2024-01-26  7:45 ` Eli Zaretskii
2024-01-26 10:42   ` Adam Porter
2024-01-26 12:32     ` Eli Zaretskii
2024-01-26 21:59       ` Adam Porter
2024-01-27  7:08         ` Eli Zaretskii
2024-01-27  8:46           ` Adam Porter
2024-01-27 14:53             ` Eric S Fraga
2024-01-27 15:32               ` Eli Zaretskii
2024-01-27 16:14               ` Sergey Organov
2024-01-28 11:25                 ` Eric S Fraga
2024-01-29 10:45                   ` Sergey Organov
2024-01-29 13:03                     ` Philip Kaludercic
2024-01-29 22:23                       ` Sergey Organov
2024-01-29 15:29                     ` Fraga, Eric
2024-01-26  8:25 ` Eshel Yaron
2024-01-26 10:48   ` Adam Porter
2024-01-29 21:48 ` JD Smith
2024-01-30  0:08   ` Chris Van Dusen
2024-01-30  0:24     ` Adam Porter
2024-02-01  3:49       ` Richard Stallman
2024-01-30  2:50     ` JD Smith
  -- strict thread matches above, loose matches on Subject: below --
2024-01-27 19:20 Drew Adams
2024-02-01  5:33 Joseph Turner

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.