unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [ELPA] package proposal: fannypack.el
@ 2022-02-22 13:24 Theodor Thornhill
  2022-02-22 19:11 ` Philip Kaludercic
  2022-02-24  6:30 ` Uwe Brauer
  0 siblings, 2 replies; 16+ messages in thread
From: Theodor Thornhill @ 2022-02-22 13:24 UTC (permalink / raw)
  To: emacs-devel

Hi there!

I've been using a small utility for some time that might be useful for
others.  It's called fannypack.el, and is a file management/file
navigation helper.  So, what does it do?

When working on some feature, I usually checkout a branch, then start
working.  After a while, some files reveal themselves as more relevant
to the ongoing work than others, and I want to be able to jump to them
quickly, without them getting lost in the sea of buffers.  In addition,
I want it to be persisted, so that when I restart my emacs session, I
still can jump to things quickly.  This demotes the general
switch-to-buffer mechanism to store the bulk of buffers, and the
fannypack provides some clarity.  When changing branches, or projects,
the fannypacks are automatically updated to the relevant ones.  So to
sum it up:

* Keep different subsets of project files easily accessible, delimited
  by branch

* Automatically update what sets of files are shown

* Persist the data between sessions


The keybinds I use at the moment for this are:
```
(global-set-key (kbd "s-f") 'fannypack-pick)
(global-set-key (kbd "s-k") 'fannypack-drop)
(global-set-key (kbd "s-m") 'fannypack-place)
(global-set-key (kbd "s-+") 'fannypack-promote)
(global-set-key (kbd "s--") 'fannypack-demote)
(global-set-key (kbd "s-n") 'fannypack-feeling-lucky)
(global-set-key (kbd "s-d") 'fannypack-default-directory)
```

I'm not sure if this is wanted in ELPA or anywhere else, but I find it
very useful, and others might too.

Source can be found at https://git.sr.ht/~theo/fannypack

All the best,
Theodor Thornhil



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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 13:24 [ELPA] package proposal: fannypack.el Theodor Thornhill
@ 2022-02-22 19:11 ` Philip Kaludercic
  2022-02-22 19:40   ` Theodor Thornhill
  2022-02-24  6:30 ` Uwe Brauer
  1 sibling, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2022-02-22 19:11 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: emacs-devel

Theodor Thornhill <theo@thornhill.no> writes:

> Hi there!
>
> I've been using a small utility for some time that might be useful for
> others.  It's called fannypack.el, and is a file management/file
> navigation helper.  So, what does it do?

If I may ask, what is the background behind the name?  If added to ELPA,
it might be that users don't notice the package because neither the name
nor the tagline describes the functionality you describe below.

-- 
	Philip Kaludercic



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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 19:11 ` Philip Kaludercic
@ 2022-02-22 19:40   ` Theodor Thornhill
  2022-02-22 20:02     ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Theodor Thornhill @ 2022-02-22 19:40 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: emacs-devel

Philip Kaludercic <philipk@posteo.net> writes:

>
> If I may ask, what is the background behind the name?  If added to ELPA,
> it might be that users don't notice the package because neither the name
> nor the tagline describes the functionality you describe below.

Well, I'm bad at naming, and really don't know what to call it.  It
started out as satchel, but I found fannypack more amusing.  The name is
nothing I'm married to, but when creating it I wanted to have a more fun
name than say, "branch-files.el" or something like that.  But yeah, the
name is not the best :)

Theo



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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 19:40   ` Theodor Thornhill
@ 2022-02-22 20:02     ` Philip Kaludercic
  2022-02-22 21:11       ` Theodor Thornhill
  2022-02-24  4:50       ` Richard Stallman
  0 siblings, 2 replies; 16+ messages in thread
From: Philip Kaludercic @ 2022-02-22 20:02 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: emacs-devel

Theodor Thornhill <theo@thornhill.no> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>>
>> If I may ask, what is the background behind the name?  If added to ELPA,
>> it might be that users don't notice the package because neither the name
>> nor the tagline describes the functionality you describe below.
>
> Well, I'm bad at naming, and really don't know what to call it.  It
> started out as satchel, but I found fannypack more amusing.

I had to look up the Wikipedia page
(https://en.wikipedia.org/wiki/Fanny_pack) because I wasn't sure what
the word meant, and it mentions the word is considered "vulgar slang" in
the UK, Ireland and Australia.

> The name is nothing I'm married to, but when creating it I wanted to
> have a more fun name than say, "branch-files.el" or something like
> that.  But yeah, the name is not the best :)

I am biased and prefer boring names, but how about file-belt (as in
tool-belt), file-ring, file-bag/purse/sporran (see
https://en.wikipedia.org/wiki/Template:Bags) or something
more esoteric like file-escritoire.

Of course these are just suggestions, the package seems otherwise very
interesting.

> Theo

-- 
	Philip Kaludercic



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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 20:02     ` Philip Kaludercic
@ 2022-02-22 21:11       ` Theodor Thornhill
  2022-02-22 21:16         ` Bob Rogers
  2022-02-22 21:41         ` Stefan Monnier
  2022-02-24  4:50       ` Richard Stallman
  1 sibling, 2 replies; 16+ messages in thread
From: Theodor Thornhill @ 2022-02-22 21:11 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: emacs-devel

Philip Kaludercic <philipk@posteo.net> writes:
>
> I had to look up the Wikipedia page
> (https://en.wikipedia.org/wiki/Fanny_pack) because I wasn't sure what
> the word meant, and it mentions the word is considered "vulgar slang" in
> the UK, Ireland and Australia.
>

Point absolutely taken.  Where I'm from it's merely seen as a uncool
thing to wear.  Yet noone can argue its practicality.  Name is changed
to satchel.

>
> Of course these are just suggestions, the package seems otherwise very
> interesting.
>

Thanks!  It really is useful - at least the 'satchel-feeling-lucky'
command, which takes me to the most important file in an arbitrary
project, even from a newly loaded emacs session. (If a satchel is
previously defined, that is).

The new repo is to be found at https://git.sr.ht/~theo/satchel

All the best,
Theo




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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 21:11       ` Theodor Thornhill
@ 2022-02-22 21:16         ` Bob Rogers
  2022-02-22 21:29           ` Theodor Thornhill
  2022-02-22 21:41         ` Stefan Monnier
  1 sibling, 1 reply; 16+ messages in thread
From: Bob Rogers @ 2022-02-22 21:16 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: Philip Kaludercic, emacs-devel

   From: Theodor Thornhill <theo@thornhill.no>
   Date: Tue, 22 Feb 2022 22:11:13 +0100

   Philip Kaludercic <philipk@posteo.net> writes:

   > Of course these are just suggestions, the package seems otherwise very
   > interesting.

   Thanks!  It really is useful - at least the 'satchel-feeling-lucky'
   command, which takes me to the most important file in an arbitrary
   project, even from a newly loaded emacs session. (If a satchel is
   previously defined, that is).

   The new repo is to be found at https://git.sr.ht/~theo/satchel

   All the best,
   Theo

Maybe the metaphor you want is speed-dialing, as on a phone?

					-- Bob Rogers
					   http://www.rgrjr.com/



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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 21:16         ` Bob Rogers
@ 2022-02-22 21:29           ` Theodor Thornhill
  0 siblings, 0 replies; 16+ messages in thread
From: Theodor Thornhill @ 2022-02-22 21:29 UTC (permalink / raw)
  To: Bob Rogers; +Cc: Philip Kaludercic, emacs-devel

Bob Rogers <rogers-emacs@rgrjr.homedns.org> writes:
>
> Maybe the metaphor you want is speed-dialing, as on a phone?
>

Not bad.  I need to ponder.  Thanks :)

Theo



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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 21:11       ` Theodor Thornhill
  2022-02-22 21:16         ` Bob Rogers
@ 2022-02-22 21:41         ` Stefan Monnier
  2022-02-22 22:24           ` Theodor Thornhill
  1 sibling, 1 reply; 16+ messages in thread
From: Stefan Monnier @ 2022-02-22 21:41 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: Philip Kaludercic, emacs-devel

Thanks, pushed `satchel` to elpa.git.  See patch below (the first hunk
of which is necessary before the tarball can be built).

BTW, this makes me wonder if we couldn't make something slightly more
automatic/transparent.

E.g. keep track of all the times you select a file/buffer and the branch
that was current for that file/buffer at that time, and then use that
history to sort past files/buffers by frequency of use in the current
context (directory&branch)?


        Stefan


PS: Personally, the branch info would be of virtually no use to me since
    I rarely if ever `checkout` and use `git worktree`s instead.



diff --git a/satchel.el b/satchel.el
index 1d736f03e5..cef792af15 100644
--- a/satchel.el
+++ b/satchel.el
@@ -1,6 +1,6 @@
 ;;; satchel.el --- A bag for your files, separated by git branches -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2022 Theodor Thornhill
+;; Copyright (C) 2022  Free Software Foundation, Inc.
 
 ;; Author: Theodor Thornhill <theo@thornhill.no>
 ;; Keywords: tools languages
@@ -48,6 +48,7 @@
   :group 'tools)
 
 (defcustom satchel-directory
+  ;; FIXME: Use `locate-user-emacs-file'?
   (concat user-emacs-directory ".local/satchel/")
   "Where the satchels will be saved."
   :type 'string)
@@ -77,7 +78,7 @@
 This is a file named after the path of the directory it refers
 to.  There can be several of those files, appended with the
 current branch name.  If the file can be found, we read that file
-into lisp data."
+into Lisp data."
   (let ((filename (satchel--name)))
     (when (file-exists-p filename)
       (with-temp-buffer




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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 21:41         ` Stefan Monnier
@ 2022-02-22 22:24           ` Theodor Thornhill
  0 siblings, 0 replies; 16+ messages in thread
From: Theodor Thornhill @ 2022-02-22 22:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Philip Kaludercic, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Thanks, pushed `satchel` to elpa.git.  See patch below (the first hunk
> of which is necessary before the tarball can be built).

Thanks!

>
> BTW, this makes me wonder if we couldn't make something slightly more
> automatic/transparent.
>
> E.g. keep track of all the times you select a file/buffer and the branch
> that was current for that file/buffer at that time, and then use that
> history to sort past files/buffers by frequency of use in the current
> context (directory&branch)?
>

This makes sense!  I'll see if I can figure out some good metadata to
use for something like this.  I've been thinking about both using more
advanced git trickery, such as the git worktree workflow etc, but then
I'd need to think a little harder on the design.  For a future version :)

>
>         Stefan
>
>
> PS: Personally, the branch info would be of virtually no use to me since
>     I rarely if ever `checkout` and use `git worktree`s instead.
>
>

Thanks for the input - I'll apply the patch shortly.

Theo


>
> diff --git a/satchel.el b/satchel.el
> index 1d736f03e5..cef792af15 100644
> --- a/satchel.el
> +++ b/satchel.el
> @@ -1,6 +1,6 @@
>  ;;; satchel.el --- A bag for your files, separated by git branches -*- lexical-binding: t; -*-
>  
> -;; Copyright (C) 2022 Theodor Thornhill
> +;; Copyright (C) 2022  Free Software Foundation, Inc.
>  
>  ;; Author: Theodor Thornhill <theo@thornhill.no>
>  ;; Keywords: tools languages
> @@ -48,6 +48,7 @@
>    :group 'tools)
>  
>  (defcustom satchel-directory
> +  ;; FIXME: Use `locate-user-emacs-file'?
>    (concat user-emacs-directory ".local/satchel/")
>    "Where the satchels will be saved."
>    :type 'string)
> @@ -77,7 +78,7 @@
>  This is a file named after the path of the directory it refers
>  to.  There can be several of those files, appended with the
>  current branch name.  If the file can be found, we read that file
> -into lisp data."
> +into Lisp data."
>    (let ((filename (satchel--name)))
>      (when (file-exists-p filename)
>        (with-temp-buffer



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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 20:02     ` Philip Kaludercic
  2022-02-22 21:11       ` Theodor Thornhill
@ 2022-02-24  4:50       ` Richard Stallman
  2022-02-24  6:14         ` Theodor Thornhill
  1 sibling, 1 reply; 16+ messages in thread
From: Richard Stallman @ 2022-02-24  4:50 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: theo, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I am good at naming.  How about describing what this package does?
(Don't assume I know anything about it.)  I may get an idea.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-24  4:50       ` Richard Stallman
@ 2022-02-24  6:14         ` Theodor Thornhill
  0 siblings, 0 replies; 16+ messages in thread
From: Theodor Thornhill @ 2022-02-24  6:14 UTC (permalink / raw)
  To: rms, Philip Kaludercic; +Cc: emacs-devel

Hi, Richard!

> I am good at naming.  How about describing what this package does?
> (Don't assume I know anything about it.)  I may get an idea.
>

I'll try!

When working on some feature, there are usually only a handful of
important files. By important I mean a file that you'll visit more often
than others.  However, sometimes the bufferlist can get huge, so you'll
need to manually trim it, or start looking through it to find the
relevant file. This quickly gets tedious, at least for a long living
emacs session.  This utility will simplify this a little, and exposes a
set of functions to manually handle such a small set of files, without
disrupting the rest of the buffer system in emacs.

So, what it does is to store the files you mark manually as important in
a Lisp list, then persist it to disk.  This file is named as the project
path, and also adds in the Git branch, to make sure that even a single
project can have many sets of files, each one relevant to the ongoing
work.  An example name of such a file can be
"~---home---theo---src---project-name---#master".  This file just stores
data like so:


```elisp
;; satchel is named '~---theo---src---satchel---#master'
(("/home/theo/src/satchel/satchel.el")
 ("/home/theo/src/satchel/README.md"))
```

Satchel, as the name is currently, will automatically pick the correct
file to use, so that the management of these files gets really easy and
quick.  For the deeper exploratory work, go-to-definition, bufferlist,
find-file etc remains the same.  It can be seen as a more advanced
'find-alternate-file' (which I've never really understood how works,
though), I think.

In the future I am considering other metadata to persist as well, such
as the point when the file is marked.

Was this a little clearer?

All the best,
Theodor Thornhill



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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-22 13:24 [ELPA] package proposal: fannypack.el Theodor Thornhill
  2022-02-22 19:11 ` Philip Kaludercic
@ 2022-02-24  6:30 ` Uwe Brauer
  2022-02-24  6:43   ` Theodor Thornhill
  1 sibling, 1 reply; 16+ messages in thread
From: Uwe Brauer @ 2022-02-24  6:30 UTC (permalink / raw)
  To: emacs-devel

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

>>> "TT" == Theodor Thornhill <theo@thornhill.no> writes:

> Hi there!
> I've been using a small utility for some time that might be useful for
> others.  It's called fannypack.el, and is a file management/file
> navigation helper.  So, what does it do?

> When working on some feature, I usually checkout a branch, then start
> working.  After a while, some files reveal themselves as more relevant
> to the ongoing work than others, and I want to be able to jump to them
> quickly, without them getting lost in the sea of buffers.  In addition,

Very interesting, but that is GIT only? No change for mercurial?
Because this is a feature I miss very much.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-24  6:30 ` Uwe Brauer
@ 2022-02-24  6:43   ` Theodor Thornhill
  2022-02-24  7:04     ` Uwe Brauer
  0 siblings, 1 reply; 16+ messages in thread
From: Theodor Thornhill @ 2022-02-24  6:43 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-devel

[-- Attachment #1: Type: text/html, Size: 734 bytes --]

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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-24  6:43   ` Theodor Thornhill
@ 2022-02-24  7:04     ` Uwe Brauer
  2022-02-24  7:28       ` Theodor Thornhill
  0 siblings, 1 reply; 16+ messages in thread
From: Uwe Brauer @ 2022-02-24  7:04 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: Uwe Brauer, emacs-devel

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

>>> "TT" == Theodor Thornhill <theo@thornhill.no> writes:

>     Very interesting, but that is GIT only? No change for mercurial?
>     Because this is a feature I miss very much.
   
> I didn't get to that yet, but I will add it! Would hg bookmarks be
> sufficient, or should i use both branch and bookmarks? I'm sure vc
> exposes what I want, so I will look into it :)

Thanks for your quick reply. 

I don't use bookmarks, only named branches (this is why I use mercurial
and not git 😉).

On the other there is a new feature called topics which is the ideal
combination of mercurial named branches and well git branches (you can
delete them but each change set/commit gets a tag when active).

This however is still not in core mercurial but you need the evolve
extension enabled.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-24  7:04     ` Uwe Brauer
@ 2022-02-24  7:28       ` Theodor Thornhill
  2022-02-24  7:41         ` Uwe Brauer
  0 siblings, 1 reply; 16+ messages in thread
From: Theodor Thornhill @ 2022-02-24  7:28 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-devel

[-- Attachment #1: Type: text/html, Size: 1691 bytes --]

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

* Re: [ELPA] package proposal: fannypack.el
  2022-02-24  7:28       ` Theodor Thornhill
@ 2022-02-24  7:41         ` Uwe Brauer
  0 siblings, 0 replies; 16+ messages in thread
From: Uwe Brauer @ 2022-02-24  7:41 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: Uwe Brauer, emacs-devel

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


> On 24 Feb 2022 08:04, Uwe Brauer <oub@mat.ucm.es> wrote:
   
      

> Thanks for the input! I'll ping you when I have something relevant to look at :) 

> Side note: the feature you are describing sounds a lot like "git clone --bare + git worktree add $branch", does is not? 

Hm not sure, I only use git if I have to delete a unwanted commit on a remote server, 😇, other than that I use the hg-git extension,

But to give you a better example here is a graph 
◍  changeset:   130:77f838cb2a8c
│  Branch:      default
│  tag:         tip
│  Author:      Uwe Brauer <oub@mat.ucm.es>
│  Date:        Thu, 24 Feb 2022 08:38:00 +0100
│  Topic:       state-space
│  Phase:       draft
│  Summary:     Start to add the computer
│
○  changeset:   129:c2a52279db8c
│  Branch:      default
│  Author:      Uwe Brauer <oub@mat.ucm.es>
│  Date:        Thu, 24 Feb 2022 08:21:29 +0100
│  Topic:       state-space
│  Phase:       draft
│  Summary:     Start to add more examples
│
○  changeset:   128:81bbb18e8bea
│  Branch:      default
│  Author:      Uwe Brauer <oub@mat.ucm.es>
│  Date:        Wed, 23 Feb 2022 22:59:41 +0100
│  Phase:       public
│  Summary:     Finish part math, examples are still needed
│


Note that both changesets are on the default (named) branch, (that would be master in git speech), but there are now to changesets that belong to the topic «state-space», these can be deleted.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

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

end of thread, other threads:[~2022-02-24  7:41 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 13:24 [ELPA] package proposal: fannypack.el Theodor Thornhill
2022-02-22 19:11 ` Philip Kaludercic
2022-02-22 19:40   ` Theodor Thornhill
2022-02-22 20:02     ` Philip Kaludercic
2022-02-22 21:11       ` Theodor Thornhill
2022-02-22 21:16         ` Bob Rogers
2022-02-22 21:29           ` Theodor Thornhill
2022-02-22 21:41         ` Stefan Monnier
2022-02-22 22:24           ` Theodor Thornhill
2022-02-24  4:50       ` Richard Stallman
2022-02-24  6:14         ` Theodor Thornhill
2022-02-24  6:30 ` Uwe Brauer
2022-02-24  6:43   ` Theodor Thornhill
2022-02-24  7:04     ` Uwe Brauer
2022-02-24  7:28       ` Theodor Thornhill
2022-02-24  7:41         ` Uwe Brauer

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