You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need a bit more understanding about below code,
(while (search-forward " #<" nil t)
(replace-match " \#<" nil t))
Why this code works?
The problem I ran into was this. Let's say I have an Org
Agenda buffer showing and I do wg-create-workgroup (and I
don't yet have an .emacs_workgroup file). The .emacs_workgroup
is created but it contains a string that looks partially like
#<buffer
followed by other stuff. This happens with buffers that are
not visiting a file. Now, later when I try to
wg-open-workgroup or wg-create-workgroup or anything that
tries o read .emacs_workgroup then I will get a syntax read
error because it doesn't like the '#' character in
.emacs_workgroup.
So I found by experimenting that if I escape the "#" by making
it into "\#" then the file will be read correctly.
So the code I added searches for #< and replaces it with
\#<. It has to search for " #<" to find instances of "
#<buffer" because there can be # present elsewhere which don't
need to have escape like many "#s" occurrences.
Of course search and replace is a very crude solution. Really
the right way would have been to write out the \# in the first
place rather than fixing it later on. But I didn't figure out
how to do it the right way :(
Thank you for your time and attention and I hope this explains
a little better.
Ah, thank you, I see, and this is symptomatic of a bigger problem with buffers not visiting a file. However, a user (like me!) who may create a workgroup with Org Agenda or similar will then have the .emacs_workgroups file made unreadable because of the bare "#" character in front of "<buffer Org Agenda>". This seems like harsh punishment to lose all the saved workspaces!
Activity
redguardtoo commentedon Mar 6, 2022
thanks , could you send me a pull request?
chipschap commentedon Mar 6, 2022
redguardtoo commentedon Mar 6, 2022
I might need a bit more understanding about below code,
Why this code work?
A minimum case to reproduce the problem is also very helpful.
chipschap commentedon Mar 6, 2022
redguardtoo commentedon Mar 7, 2022
It's because there is no

wg-deserialize-org-agenda-mode-buffer,chipschap commentedon Mar 7, 2022
Ah, thank you, I see, and this is symptomatic of a bigger problem with buffers not visiting a file. However, a user (like me!) who may create a workgroup with Org Agenda or similar will then have the .emacs_workgroups file made unreadable because of the bare "#" character in front of "<buffer Org Agenda>". This seems like harsh punishment to lose all the saved workspaces!
redguardtoo commentedon Mar 8, 2022
342fc30 store buffer name instead of buffer object (Chen Bin)