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

Display buffer function #88

Closed

Conversation

FrancisMurillo
Copy link
Contributor

This adds an option on how to display the prodigy and process buffer with prodigy-display-buffer-function and prodigy-process-display-buffer-function respectively. The process buffer function defaults to the main display function if not set. This also may resolve #73

@rejeep
Copy link
Owner

rejeep commented Sep 5, 2016

Hi,

A few comments:

  1. Why does prodigy-switch-to-process-buffer care about prodigy-process-display-buffer-function? Seems like they should be separated to make it more clear.
  2. Use backtick before and single quote after for referencing variables and functions in the doc strings.
    3 Add to the documentation of the variables that the value is an arbitrary function (or symbol) that takes a single argument, which is the buffer name or buffer object.

@@ -1395,7 +1414,7 @@ The old service process is transfered to the new service."
(interactive)
(let ((buffer-p (prodigy-buffer))
(buffer (get-buffer-create prodigy-buffer-name)))
(pop-to-buffer buffer)
(funcall prodigy-display-buffer-function buffer)
Copy link
Owner

Choose a reason for hiding this comment

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

What changed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know myself. It could be whitespace but it looks too identical.

@rejeep
Copy link
Owner

rejeep commented Sep 9, 2016

Maybe I was a bit unclear before.

Am I right when I say that you want to be able to set one variable and affect both the prodigy and the process buffer, but still be able to configure them separately?

In my head, I would prefer to have one variable for the prodigy buffer and one for the process buffer. That means if you want the same buffer function in both cases, you would have to set two variables.

How does that sound?

@FrancisMurillo
Copy link
Contributor Author

So I separated the prodigy and process display functions to prodigy-display-buffer-function and prodigy-process-display-buffer-function, respectively. Also the process display function does not default to the prodigy display function if it is nil.

I hope I got it right.

@rejeep
Copy link
Owner

rejeep commented Sep 10, 2016

I think it looks good now, but the diff is weird, which I think is because master has changed. Can you please rebase to master? Also, I would prefer if you would squash your commits into a single one. Thanks!

@FrancisMurillo FrancisMurillo force-pushed the display-buffer-function branch 2 times, most recently from 5c054c9 to 7664cca Compare September 11, 2016 03:55
@rejeep
Copy link
Owner

rejeep commented Sep 11, 2016

Still doesn't looks rebased?

@FrancisMurillo
Copy link
Contributor Author

First time rebasing and squashing.
This is more or less how I did it

git rebase -i                             # Sort of to squash to my first commit
git fetch origin                         
git rebase origin/master          # Rebasing to master
git push --force origin display-buffer-function  #Push

Sorry for the inconvenience.

@rejeep
Copy link
Owner

rejeep commented Sep 11, 2016

I think the problem is that your master is behind mine. The easiest would be to reset your master on mine.

$ git checkout master
$ git reset --hard rejeep/master

And then rebase your branch on your master again.

You could also rebase your branch on my master directly.

@Fuco1
Copy link
Collaborator

Fuco1 commented Nov 20, 2017

The correct approach here is to customize display-buffer-alist (the end-user should do this) instead of changing the program. pop-to-buffer is perfectly fine and legal way to open a new buffer.

Many packages try to accomodate this with their own customize variables but in fact that just leads to duplication of effort and unclear semantics. You can set up rules for this with shackle easily for example.

@dmacvicar
Copy link

@Fuco1 The current way is not usable. I split windows, go to the new created one, call prodigy, and prodigy shows up in the previous one where I have the source code.

I have my straight local git repo patched to use pop-to-buffer-same-window instead of pop-to-buffer.

@DamienCassou
Copy link
Collaborator

I'm closing all old PRs. If you still care, please rebase your branch and reopen the PR.

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.

Make the choice of buffer opening command customizeable.
5 participants