Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Patches to ropemode and ropemacs
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  21 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Takafumi Arakaki  
View profile  
 More options Feb 6 2012, 3:32 am
From: Takafumi Arakaki <aka....@gmail.com>
Date: Mon, 6 Feb 2012 09:32:17 +0100
Local: Mon, Feb 6 2012 3:32 am
Subject: Patches to ropemode and ropemacs
Hi,

I posted two patches:
https://bitbucket.org/agr/ropemacs/pull-request/1/add-ropemacs-use-po...
https://bitbucket.org/agr/ropemode/pull-request/1/added-rope-project-...

The first one is to customize creation of the new window in Emacs. The
second one is for adding API to use it from Emacs lisp (and I guess it
will be available for Vim, too). I hope they will be merged soon!

Takafumi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leo  
View profile  
 More options Feb 6 2012, 4:51 am
From: Leo <sdl....@gmail.com>
Date: Mon, 06 Feb 2012 17:51:24 +0800
Local: Mon, Feb 6 2012 4:51 am
Subject: Re: Patches to ropemode and ropemacs
On 2012-02-06 16:32 +0800, Takafumi Arakaki wrote:

Could you name it as project_opened_p and return the root directory when
it is true? Thanks.

Leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 6 2012, 5:19 am
From: Takafumi Arakaki <aka....@gmail.com>
Date: Mon, 6 Feb 2012 11:19:17 +0100
Local: Mon, Feb 6 2012 5:19 am
Subject: Re: Patches to ropemode and ropemacs

On Mon, Feb 6, 2012 at 10:51 AM, Leo <sdl....@gmail.com> wrote:
> On 2012-02-06 16:32 +0800, Takafumi Arakaki wrote:
>> https://bitbucket.org/agr/ropemode/pull-request/1/added-rope-project-...

> Could you name it as project_opened_p and return the root directory when
> it is true? Thanks.

> Leo

Yes, I think returning project root is a good idea. About naming, is
"*_p" Vim script convention too? I didn't find "*_p" in ropemode and
that's why I didn't choose that name. How about "get_project_root" if
it returns a path?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leo  
View profile  
 More options Feb 6 2012, 6:07 am
From: Leo <sdl....@gmail.com>
Date: Mon, 06 Feb 2012 19:07:29 +0800
Local: Mon, Feb 6 2012 6:07 am
Subject: Re: Patches to ropemode and ropemacs
On 2012-02-06 18:19 +0800, Takafumi Arakaki wrote:

> Yes, I think returning project root is a good idea. About naming, is
> "*_p" Vim script convention too? I didn't find "*_p" in ropemode and
> that's why I didn't choose that name. How about "get_project_root" if
> it returns a path?

That works too. Thanks a lot.

Leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 6 2012, 6:45 am
From: Takafumi Arakaki <aka....@gmail.com>
Date: Mon, 6 Feb 2012 03:45:52 -0800 (PST)
Local: Mon, Feb 6 2012 6:45 am
Subject: Re: Patches to ropemode and ropemacs
Updated!
https://bitbucket.org/tkf/ropemode/changeset/9bf46eecc9b7

I am not sure if self.project.root.real_path is always accessible
here. So if someone knows it's not, please tell me.

Takafumi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ali Gholami Rudi  
View profile  
 More options Feb 6 2012, 1:06 pm
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Mon, 06 Feb 2012 21:36:27 +0330
Local: Mon, Feb 6 2012 1:06 pm
Subject: Re: Patches to ropemode and ropemacs
Hi,

Takafumi Arakaki <aka....@gmail.com> wrote:
> Updated!
> https://bitbucket.org/tkf/ropemode/changeset/9bf46eecc9b7

> I am not sure if self.project.root.real_path is always accessible
> here. So if someone knows it's not, please tell me.

It IS safe to use.

ACK for the patch.

        Ali


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
general  
View profile  
 More options Feb 6 2012, 3:13 pm
From: general <gene...@angri.ru>
Date: Mon, 6 Feb 2012 21:13:47 +0100
Local: Mon, Feb 6 2012 3:13 pm
Subject: Re: Patches to ropemode and ropemacs
Merged pull request.

Thanks!

--
Anton

2012/2/6 Ali Gholami Rudi <aligr...@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 6 2012, 4:01 pm
From: Takafumi Arakaki <aka....@gmail.com>
Date: Mon, 6 Feb 2012 22:01:02 +0100
Local: Mon, Feb 6 2012 4:01 pm
Subject: Re: Patches to ropemode and ropemacs
Hi Ali,

Thanks for the merge!

How about the other one
https://bitbucket.org/agr/ropemacs/pull-request/1/add-ropemacs-use-po...

Takafumi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leo  
View profile  
 More options Feb 6 2012, 8:46 pm
From: Leo <sdl....@gmail.com>
Date: Tue, 07 Feb 2012 09:46:04 +0800
Local: Mon, Feb 6 2012 8:46 pm
Subject: Re: Patches to ropemode and ropemacs
On 2012-02-07 05:01 +0800, Takafumi Arakaki wrote:

Is there a more general solution? For example, if it goes through
with-output-to-temp-buffer, then its behaviour can be controlled in
elisp and `q' can correctly restore window configuration.

Leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 7 2012, 9:20 am
From: Takafumi Arakaki <aka....@gmail.com>
Date: Tue, 7 Feb 2012 15:20:14 +0100
Local: Tues, Feb 7 2012 9:20 am
Subject: Re: Patches to ropemode and ropemacs

On Tue, Feb 7, 2012 at 2:46 AM, Leo <sdl....@gmail.com> wrote:
> Is there a more general solution? For example, if it goes through
> with-output-to-temp-buffer, then its behaviour can be controlled in
> elisp and `q' can correctly restore window configuration.

You can do this with popwin.el and my patch. There is no general
solution as far as I know. pop-to-buffer is general in some sense
because it tries to do the "right" thing (like using already opened
window if it is available) and you can customize its behavior via
display-buffer-function variable.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ali Gholami Rudi  
View profile  
 More options Feb 7 2012, 10:29 pm
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Wed, 08 Feb 2012 06:59:37 +0330
Local: Tues, Feb 7 2012 10:29 pm
Subject: Re: Patches to ropemode and ropemacs
Hi Takafumi,

Takafumi Arakaki <aka....@gmail.com> wrote:
> On Tue, Feb 7, 2012 at 2:46 AM, Leo <sdl....@gmail.com> wrote:
> > Is there a more general solution? For example, if it goes through
> > with-output-to-temp-buffer, then its behaviour can be controlled in
> > elisp and `q' can correctly restore window configuration.

> You can do this with popwin.el and my patch. There is no general
> solution as far as I know. pop-to-buffer is general in some sense
> because it tries to do the "right" thing (like using already opened
> window if it is available) and you can customize its behavior via
> display-buffer-function variable.

How does it differ from the old behavior?  Can't we use
pop-to-buffer and merge the two cases in window="other"?

        Ali


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 8 2012, 3:40 am
From: Takafumi Arakaki <aka....@gmail.com>
Date: Wed, 8 Feb 2012 09:40:53 +0100
Local: Wed, Feb 8 2012 3:40 am
Subject: Re: Patches to ropemode and ropemacs
Hi Ali,

On Wed, Feb 8, 2012 at 4:29 AM, Ali Gholami Rudi <aligr...@gmail.com> wrote:

I think the original version has some additional behaviors such as
fitting height of the opened window if there is not much contents when
window="othere" and fit_lines=True. Maybe some people prefer this.
Personally I don't need this because I want let other elisp module
handle this. I don't know what is the best solution for every one. But
yes, I guess using pop-to-buffer is a point of compromise if you want
keep the function simple.

Takafumi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 8 2012, 3:43 am
From: Takafumi Arakaki <aka....@gmail.com>
Date: Wed, 8 Feb 2012 09:43:44 +0100
Local: Wed, Feb 8 2012 3:43 am
Subject: Re: Patches to ropemode and ropemacs

> I think the original version has some additional behaviors such as
> fitting height of the opened window if there is not much contents when
> window="othere" and fit_lines=True.

Oops. No. It fits height to the number of lines given by fit_lines.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
an...@angri.ru  
View profile  
 More options Feb 12 2012, 5:32 pm
From: an...@angri.ru
Date: Sun, 12 Feb 2012 23:32:27 +0100
Local: Sun, Feb 12 2012 5:32 pm
Subject: Re: Patches to ropemode and ropemacs
Hi Ali and Takamufi,

what is the status of this pull request?
https://bitbucket.org/agr/ropemacs/pull-request/1/add-ropemacs-use-po...

--
Anton

2012/2/8 Takafumi Arakaki <aka....@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ali Gholami Rudi  
View profile  
 More options Feb 12 2012, 10:36 pm
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Mon, 13 Feb 2012 07:06:15 +0330
Local: Sun, Feb 12 2012 10:36 pm
Subject: Re: Patches to ropemode and ropemacs
Hi Anton and Takafumi,

I agree with the change.  But I think it can be improved a bit (untested):

--- a/ropemacs/__init__.py      2012-02-13 07:07:44.854411645 +0330
+++ b/ropemacs/__init__.py      2012-02-13 07:12:12.024802480 +0330
@@ -173,7 +173,11 @@
                     lisp.switch_to_buffer_other_window(new_buffer)
                 lisp.goto_char(lisp.point_min())
             elif window == 'other':
-                new_window = lisp.display_buffer(new_buffer)
+                if self.get("use_pop_to_buffer"):
+                    new_window = lisp.get_buffer_window(
+                        lisp.pop_to_buffer(new_buffer))
+                else:
+                    new_window = lisp.display_buffer(new_buffer)
                 lisp.set_window_point(new_window, lisp.point_min())
                 if fit_lines and lisp.fboundp(lisp['fit-window-to-buffer']):
                     lisp.fit_window_to_buffer(new_window, fit_lines)

Now most of the path is common between the cases.  Also mentioning the
new variable in "Variables" section of ropemacs and adding a defcustom
in ropemacs/__init__.py can help users that need the same feature.

Thanks,
Ali


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 21 2012, 10:07 pm
From: Takafumi Arakaki <aka....@gmail.com>
Date: Tue, 21 Feb 2012 19:07:16 -0800 (PST)
Local: Tues, Feb 21 2012 10:07 pm
Subject: Re: Patches to ropemode and ropemacs
Hi Ali and Anton,

I tried Ali's suggestion:
https://bitbucket.org/tkf/ropemacs/changeset/b82acdc277c0

It works almost fine, but I found another issue with
lisp.bury_buffer(new_buffer) since it is in the execution path even if
I set ropemacs-use-pop-to-buffer to t now.

popwin.el decide whether to close the created window by watching if
the buffer is buried (there are other conditions).  Therefore, it
won't show the document buffer created by rope-show-doc.  It is not
ropemacs's bug or anything, it's just that two emacs modules do not
play well together.  I don't know what is the best way to solve this.
I can ask popwin's author to workaround this somehow.

However, I think burring the buffer *after* reading it makes more
sense than burring it at the time it is created, *before* reading it.
So I hope you don't mind if I remove the line containing
lisp.bury_buffer(new_buffer).  Another possible fix is to add new
customization variable to choose the behavior.  (Also, I don't
understand why lisp.bury_buffer(new_buffer) is called only when
window='other' and fit_lines is specified.  So if we are going to
choose the second fix, please specify the execution path in which it
should be located)

Takafumi

On Feb 13, 4:36 am, Ali Gholami Rudi <aligr...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ali Gholami Rudi  
View profile  
 More options Feb 22 2012, 10:49 am
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Wed, 22 Feb 2012 19:19:15 +0330
Local: Wed, Feb 22 2012 10:49 am
Subject: Re: Patches to ropemode and ropemacs
Hi Takafumi,

Takafumi Arakaki <aka....@gmail.com> wrote:
> I tried Ali's suggestion:
> https://bitbucket.org/tkf/ropemacs/changeset/b82acdc277c0

> It works almost fine, but I found another issue with
> lisp.bury_buffer(new_buffer) since it is in the execution path even if
> I set ropemacs-use-pop-to-buffer to t now.

> However, I think burring the buffer *after* reading it makes more
> sense than burring it at the time it is created, *before* reading it.
> So I hope you don't mind if I remove the line containing
> lisp.bury_buffer(new_buffer).  Another possible fix is to add new
> customization variable to choose the behavior.  (Also, I don't
> understand why lisp.bury_buffer(new_buffer) is called only when
> window='other' and fit_lines is specified.  So if we are going to

As far as I remember, bury-buffer is called to put the buffer
at the end of the buffer list since you never want to switch
back to this buffer, specially with fit_lines: you want to show
a window in as small as possible room and then close it
with C-x 1.

> choose the second fix, please specify the execution path in which it
> should be located)

Any of them seem OK.  Maybe it is cleaner to put the incompatible stuff
in the else block of self.get("use_pop_to_buffer").

Thanks,
Ali


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 22 2012, 5:57 pm
From: Takafumi Arakaki <aka....@gmail.com>
Date: Wed, 22 Feb 2012 23:57:30 +0100
Local: Wed, Feb 22 2012 5:57 pm
Subject: Re: Patches to ropemode and ropemacs
On Wed, Feb 22, 2012 at 4:49 PM, Ali Gholami Rudi <aligr...@gmail.com> wrote:

>> However, I think burring the buffer *after* reading it makes more
>> sense than burring it at the time it is created, *before* reading it.
>> So I hope you don't mind if I remove the line containing
>> lisp.bury_buffer(new_buffer).  Another possible fix is to add new
>> customization variable to choose the behavior.  (Also, I don't
>> understand why lisp.bury_buffer(new_buffer) is called only when
>> window='other' and fit_lines is specified.  So if we are going to

> As far as I remember, bury-buffer is called to put the buffer
> at the end of the buffer list since you never want to switch
> back to this buffer, specially with fit_lines: you want to show
> a window in as small as possible room and then close it
> with C-x 1.

I understand that point.  What I was saying that calling bury-buffer
after reading the buffer is more consistent behavior.  For example,
when you do M-x describe-function, *help* buffer is opened and it has
quit-window bound to key q, which does bury-buffer internally.  So the
buffer is not buried when the user is reading it.  The buffer is
buried only when the user quit the window by pressing q.  If the user
want see some other buffer and go back to the *help* window, he can
choose not to push q and do C-x b.

Furthermore, functions which use _make_buffer, show_occurrences and
show_doc, bind similar commands to q.  This binding makes no sense if
you already bury buffer in _make_buffer.  So, I think deleting
lisp.bury_buffer(new_buffer) is better choice (I changed my statement
a little bit after finding about show_occurrences and show_doc). What
do you think?

Takafumi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ali Gholami Rudi  
View profile  
 More options Feb 23 2012, 10:48 am
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Thu, 23 Feb 2012 19:18:05 +0330
Local: Thurs, Feb 23 2012 10:48 am
Subject: Re: Patches to ropemode and ropemacs
Hi Takafumi,

Takafumi Arakaki <aka....@gmail.com> wrote:
> > As far as I remember, bury-buffer is called to put the buffer
> > at the end of the buffer list since you never want to switch
> > back to this buffer, specially with fit_lines: you want to show
> > a window in as small as possible room and then close it
> > with C-x 1.
> I understand that point. What I was saying that calling bury-buffer
> after reading the buffer is more consistent behavior. For example,
> when you do M-x describe-function, *help* buffer is opened and it has
> quit-window bound to key q, which does bury-buffer internally. So the
> buffer is not buried when the user is reading it. The buffer is
> buried only when the user quit the window by pressing q. If the user
> want see some other buffer and go back to the *help* window, he can
> choose not to push q and do C-x b.

My emacs skills are quite rusty and I may be wrong.  So be warned!

When window equals "other" and fit_lines is specified, you usually don't
switch to the buffer, so the q command probably won't be used.

> Furthermore, functions which use _make_buffer, show_occurrences and
> show_doc, bind similar commands to q. This binding makes no sense if
> you already bury buffer in _make_buffer. So, I think deleting
> lisp.bury_buffer(new_buffer) is better choice (I changed my statement
> a little bit after finding about show_occurrences and show_doc). What
> do you think?

Only if it is backward compatible.  Otherwise I suggest not
calling bury-buffer() in the pop-to-buffer case.  Specifically, after
rope-show-doc (C-c d), and then using C-x 1 to close *rope-pydoc* buffer,
it should not appear high in the buffer list.

Thanks,
Ali


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takafumi Arakaki  
View profile  
 More options Feb 24 2012, 7:01 am
From: Takafumi Arakaki <aka....@gmail.com>
Date: Fri, 24 Feb 2012 13:01:16 +0100
Local: Fri, Feb 24 2012 7:01 am
Subject: Re: Patches to ropemode and ropemacs
Hi Ali,

On Thu, Feb 23, 2012 at 4:48 PM, Ali Gholami Rudi <aligr...@gmail.com> wrote:

> When window equals "other" and fit_lines is specified, you usually don't
> switch to the buffer, so the q command probably won't be used.

>> Furthermore, functions which use _make_buffer, show_occurrences and
>> show_doc, bind similar commands to q. This binding makes no sense if
>> you already bury buffer in _make_buffer. So, I think deleting
>> lisp.bury_buffer(new_buffer) is better choice (I changed my statement
>> a little bit after finding about show_occurrences and show_doc). What
>> do you think?

> Only if it is backward compatible.  Otherwise I suggest not
> calling bury-buffer() in the pop-to-buffer case.  Specifically, after
> rope-show-doc (C-c d), and then using C-x 1 to close *rope-pydoc* buffer,
> it should not appear high in the buffer list.

You are right, the focus does not go to the *rope-pydoc* buffer.  I
was not aware of that.  I guess I understand why you want to bury
buffer at the time the buffer is created; you want to make the buffer
virtually never opened, right?  And it makes sense because you do not
move the focus to the buffer.

So, I made another version to include your suggestions:
https://bitbucket.org/tkf/ropemacs/src/f467bb42484f/ropemacs/__init__...

This version is functionally same as my old version:
https://bitbucket.org/tkf/ropemacs/src/93831bf740bc/ropemacs/__init__...

Please choose the version you like.  I think my old version is
clearer, although the execution path is completely separated.  If
anything needed to be changed, let me know.

Thanks,
Takafumi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ali Gholami Rudi  
View profile  
 More options Feb 24 2012, 7:47 am
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Fri, 24 Feb 2012 16:17:29 +0330
Local: Fri, Feb 24 2012 7:47 am
Subject: Re: Patches to ropemode and ropemacs
Hi Takafumi,

Takafumi Arakaki <aka....@gmail.com> wrote:
> So, I made another version to include your suggestions:
> https://bitbucket.org/tkf/ropemacs/src/f467bb42484f/ropemacs/__init__...

> This version is functionally same as my old version:
> https://bitbucket.org/tkf/ropemacs/src/93831bf740bc/ropemacs/__init__...

> Please choose the version you like.  I think my old version is
> clearer, although the execution path is completely separated.  If
> anything needed to be changed, let me know.

ACK.  I prefer the first one too.

Thanks,
Ali


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »