Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow up for the ticket https://github.com/bmag/emacs-purpose/issues/106 #107

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

sergeyglazyrindev
Copy link

Hey bmag!

I moved out almost all not necessary stuff from window-purpose-x.el though there's one problem:
maybe you can advice (I am debugging it now - maybe there's a problem with my init.el)

Hm, I removed everything from my init.el except window-purpose initialization... and still there's a problem: if I fix default layout in your window-purpose-x.el then it works, if I put the same layout to separated layout file it doesn't work... Any idea ?

I included changes to layout, so you may play with these changes.....

@coveralls
Copy link

coveralls commented Jul 17, 2017

Coverage Status

Coverage decreased (-0.05%) to 67.53% when pulling a5fa09c on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@sergeyglazyrindev
Copy link
Author

And yes, I'll cleanup this pull request to mimic current main project state once we solve issue with layout which doesn't work properly being in separated file. Sorry.. for some wrong changes here.

Copy link
Owner

@bmag bmag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I added comments on some technicalities.

  • Please don't change code1, instead write a code2 based on code1.

  • I was expecting to see changes to purpose-x-code1-purpose-config as well. (as purpose-x-code2-purpose-config).

@@ -125,14 +137,15 @@ If a non-buffer-dedicated window with purpose 'dired exists, display
the directory of the current buffer in that window, using `dired'.
If there is no window available, do nothing.
If current buffer doesn't have a filename, do nothing."
(when (and (buffer-file-name)
(when (not (string= (purpose--buffer-major-mode (current-buffer)) "org-mode"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(eq major-mode 'org-mode) instead of (string= (purpose--...) "org-mode")

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(unless ...) instead of (when (not ...))

@@ -158,7 +171,7 @@ imenu."
(purpose-set-extension-configuration :purpose-x-code1 purpose-x-code1-purpose-config)
(purpose-x-code1--setup-ibuffer)
(purpose-x-code1-update-dired)
(imenu-list-minor-mode)
(ignore-errors (imenu-list-minor-mode))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ignore-errors necessary?

@@ -168,7 +181,7 @@ imenu."
(interactive)
(purpose-del-extension-configuration :purpose-x-code1)
(purpose-x-code1--unset-ibuffer)
(imenu-list-minor-mode -1)
(ignore-errors (imenu-list-minor-mode -1))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ignore-errors necessary?

@bmag
Copy link
Owner

bmag commented Jul 18, 2017

Thanks, I reviewed the PR and submitted feedback.

As I suggested in the issue report, please implement the change as a new extension, and don't change code1 itself. Copy code1 and rename code1 to code2, then do the changes you want to code2. If I'm not clear feel free to ask questions.

What exactly is "the issue with layout which doesn't work properly being in separated file"?

@sergeyglazyrindev
Copy link
Author

Hi bmag!
I've got an idea why my layout doesn't work in separated file... Let me try out one idea and then if that doesn't help, I'll share details about the problem.
Thanks for review. I am not an expert in elisp :( And I appreciate your suggestions.

@sergeyglazyrindev
Copy link
Author

Oh yes, sorry forgot to ask you: what do you mean by "add code2" instead of "changing code1" ?
Are you talking about adding separated vars, etc with code2 prefix like you named variable "purpose-x-code1--window-layout" ?

@coveralls
Copy link

coveralls commented Jul 18, 2017

Coverage Status

Coverage decreased (-0.05%) to 67.53% when pulling 8c179f0 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jul 18, 2017

Coverage Status

Coverage decreased (-0.05%) to 67.53% when pulling aba2252 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jul 18, 2017

Coverage Status

Coverage decreased (-0.05%) to 67.53% when pulling acb1404 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@sergeyglazyrindev
Copy link
Author

sergeyglazyrindev commented Jul 18, 2017

Hey bmag!
Please check this out now!
I solved the issue with setting up my layout though I had to get rid of purpose-x-code1-setup function calling, instead I added my own initialization:

(defun load-purpose-mode ()
  (interactive)
  (purpose-x-code1--setup-ibuffer)
  (purpose-x-code1-update-dired)
  (ignore-errors (imenu-list-minor-mode))
  (frame-or-buffer-changed-p 'purpose-x-code1-buffers-changed)
  (add-hook 'post-command-hook #'purpose-x-code1-update-changed)
  (purpose-load-window-layout-file "~/.emacs.d/layouts/full-ide.window-layout")
  (todo-mode-get-buffer-create)
)
(global-set-key (kbd "M-L") 'load-purpose-mode)

That works fine now. And I added my layout into your folder "layouts"
I am thinking, how do I describe the way how to setup it properly ?
Because I like todo purpose buffer and it helps much to find all todos and handle it.
Also I like the idea of misc buffer.
Though I listed all needed major mode and its modes through variable purpose-user-mode-purposes but I think how to simplify the setup for another users. Would you mind if I add a part how to setup the things to your README ? Or is it better to write a full-ide-README.md in layouts folder ?

@bmag
Copy link
Owner

bmag commented Jul 18, 2017

Oh yes, sorry forgot to ask you: what do you mean by "add code2" instead of "changing code1" ?
Are you talking about adding separated vars, etc with code2 prefix like you named variable "purpose-x-code1--window-layout" ?

Yes, I'm talking about adding separate variables and functions. Right now, these exist:

(defvar purpose-x-code1--window-layout ...)
(defvar purpose-x-code1-purpose-config ...)
(defvar purpose-x-code1-buffers-changed ...)
(define-ibuffer-filter purpose-x-code1-ibuffer-files-only ...)
(defun purpose-x-code1--setup-ibuffer ...)
(defun purpose-x-code1--unset-ibuffer ...)
(defun purpose-x-code1-update-dired ...)
(defun purpose-x-code1-update-changed ...)
(defun purpose-x-code1-setup ...)
(defun purpose-x-code1-unset ...)

What I'm saying is to add below them:

(defvar purpose-x-code2--window-layout ...)
(defvar purpose-x-code2-purpose-config ...)
(defun purpose-x-code2-update-dired ...)
(defun purpose-x-code2-update-changed ...)
(defun purpose-x-code2-setup ...)
(defun purpose-x-code2-unset ...)

I think you can reuse purpose-x-code1-buffers-changed, purpose-x-code1--setup-ibuffer and purpose-x-code1--unset-ibuffer in code2 without copying them.

And I added my layout into your folder "layouts"
I am thinking, how do I describe the way how to setup it properly ?
Because I like todo purpose buffer and it helps much to find all todos and handle it.
Also I like the idea of misc buffer.

I prefer the layout to be stored in purpose-x-code2--window-layout, rather than as a separate layout file. Ideally code2 will just work by calling purpose-x-code2-setup, including setting up the layout, and won't need a big description. Any necessary description can be included in the docstring of purpose-x-code2-setup or in the wiki.

Though I listed all needed major mode and its modes through variable purpose-user-mode-purposes but I think how to simplify the setup for another users. Would you mind if I add a part how to setup the things to your README ? Or is it better to write a full-ide-README.md in layouts folder ?

I prefer the necessary configuration to be stored in purpose-x-code2-purpose-config, so the user doesn't need to do anything more than calling purpose-x-code2-setup. That said, the todo.org buffer is custom-made for your workflow, right? It isn't a standard thing? So if the user uses a different buffer for viewing todos, he/she will have to assign a todo purpose to this buffer. This kind of info can go in the wiki as well. Instructions on how to create a todo.org can also go in the wiki.

I solved the issue with setting up my layout though I had to get rid of purpose-x-code1-setup function calling, instead I added my own initialization

It's weird that you need to wrap imenu-list-minor-mode inside an ignore-errors block. The index can't be created when imenu-list-minor-mode is invoked from an indexable buffer (e.g. the *scratch* buffer if activated at Emacs startup), but imenu-list is supposed to catch these errors and handle them gracefully. Are you using an old version of imenu-list.el by any chance?

@sergeyglazyrindev
Copy link
Author

Ok, now it's clear
I'll do that
Thank you for suggestions!
But I think I'll find a time a the end of the week. Now busy at work.

@bmag
Copy link
Owner

bmag commented Aug 10, 2017

Any news?

@sergeyglazyrindev
Copy link
Author

Hi, I scheduled it but last weeks very crazy. Will do that asap. Sorry :( for delay.

@coveralls
Copy link

coveralls commented Jan 9, 2018

Coverage Status

Coverage decreased (-0.4%) to 67.217% when pulling a13d6cb on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 67.217% when pulling f21238e on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

1 similar comment
@coveralls
Copy link

coveralls commented Jan 9, 2018

Coverage Status

Coverage decreased (-0.4%) to 67.217% when pulling f21238e on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 9, 2018

Coverage Status

Coverage decreased (-0.4%) to 67.217% when pulling 53341eb on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 9, 2018

Coverage Status

Coverage decreased (-1.4%) to 66.183% when pulling 53341eb on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 9, 2018

Coverage Status

Coverage decreased (-0.4%) to 67.217% when pulling ab99409 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 67.217% when pulling 8b74770 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 67.217% when pulling 8b74770 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@sergeyglazyrindev
Copy link
Author

Hello dear bmag.
Sorry for the huge delay
I had problems with health and couldn't work enough to do anything in open source world.
Now I restored and added changes you requested + added a documentation how to install things and use full-ide.window-layout. Please let me know your thoughts

@coveralls
Copy link

coveralls commented Jan 17, 2018

Coverage Status

Coverage decreased (-1.9%) to 65.689% when pulling 9ad678a on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 17, 2018

Coverage Status

Coverage decreased (-1.9%) to 65.689% when pulling 91f0956 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 17, 2018

Coverage Status

Coverage decreased (-1.9%) to 65.689% when pulling d5cc415 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 17, 2018

Coverage Status

Coverage decreased (-1.9%) to 65.689% when pulling b710f68 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 17, 2018

Coverage Status

Coverage decreased (-1.9%) to 65.689% when pulling b69ffad on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 17, 2018

Coverage Status

Coverage decreased (-1.9%) to 65.689% when pulling b69ffad on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 17, 2018

Coverage Status

Coverage decreased (-1.9%) to 65.689% when pulling 383dd1e on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@coveralls
Copy link

coveralls commented Jan 17, 2018

Coverage Status

Coverage decreased (-1.8%) to 65.786% when pulling 5a97da9 on sergeyglazyrindev:master into 67ecaa2 on bmag:master.

@bmag
Copy link
Owner

bmag commented Jan 19, 2018

@sergeyglazyrindev It's ok, I understand, hope you're all better now and wish you the best.

As for this PR, I'm very busy myself this month, so it will take me some time to review these. Worst case scenario, I will review them towards the end of February.

@bmag
Copy link
Owner

bmag commented Aug 8, 2018

Hey, sorry for the late response, I was really busy and turns out "end of February" wasn't the worst case ☹️

I know putting together this PR is a considerable amount of work, and I appreciate the effort you put into it, but I feel it ended up too big and out-of-scope for Purpose itself, so I won't be merging it. However, I'd like to convert it to a new page in Purpose's wiki. Would you mind if I did that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants