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
ropemacs-mode only turned on after visiting a second python file
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
  3 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
 
danmaftei  
View profile  
 More options Jul 14 2012, 10:53 pm
From: danmaftei <ninestrayc...@gmail.com>
Date: Sat, 14 Jul 2012 19:53:23 -0700 (PDT)
Local: Sat, Jul 14 2012 10:53 pm
Subject: ropemacs-mode only turned on after visiting a second python file
I've defined a function make-python-ide which is attached to the
python-mode hook. Among other things, it calls (pymacs-load "ropemacs"
"rope-").

When I visit my first .py file, ropemacs and its functions are loaded,
but key-bindings don't work, and ropemacs-mode is NOT turned on.

Both problems are fixed when I visit my second file. Why is this? I
don't want to put (pymacs-load "ropemacs" "rope-") outside of this
function since it takes a while to execute and I only want ropemacs
for python files.

A related question, what exactly does the ropemacs-enable-autoimport
variable do? I've checked the documentation and it isn't clear what is
being autoimported.

Thanks,
Dan


 
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 Jul 15 2012, 10:07 am
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Sun, 15 Jul 2012 18:37:26 +0430
Local: Sun, Jul 15 2012 10:07 am
Subject: Re: ropemacs-mode only turned on after visiting a second python file

danmaftei <ninestrayc...@gmail.com> wrote:
> I've defined a function make-python-ide which is attached to the
> python-mode hook. Among other things, it calls (pymacs-load "ropemacs"
> "rope-").

It loads ropemacs using pymacs; it should be executed only once
when emacs comes up.  What you really need is ropemacs-mode,
which turns on ropemacs minor mode; it can be called from
a python-mode hook.

> A related question, what exactly does the ropemacs-enable-autoimport
> variable do? I've checked the documentation and it isn't clear what is
> being autoimported.

When autoimports are enabled, among completion proposals global names
from other modules are also included; if you select them, a
"from x import name" statement is added to your file.

        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 Jul 17 2012, 7:45 am
From: Takafumi Arakaki <aka....@gmail.com>
Date: Tue, 17 Jul 2012 13:45:56 +0200
Local: Tues, Jul 17 2012 7:45 am
Subject: Re: ropemacs-mode only turned on after visiting a second python file

On Sun, Jul 15, 2012 at 4:53 AM, danmaftei <ninestrayc...@gmail.com> wrote:
> I've defined a function make-python-ide which is attached to the
> python-mode hook. Among other things, it calls (pymacs-load "ropemacs"
> "rope-").

> When I visit my first .py file, ropemacs and its functions are loaded,
> but key-bindings don't work, and ropemacs-mode is NOT turned on.

> Both problems are fixed when I visit my second file. Why is this? I
> don't want to put (pymacs-load "ropemacs" "rope-") outside of this
> function since it takes a while to execute and I only want ropemacs
> for python files.

I have something like the following to address this issue.
I guess you can get the idea.

(defvar my-ropemacs-loaded nil)
(defun my-ropemacs-setup ()
  (unless my-ropemacs-loaded
    (setq my-ropemacs-loaded t)
    (require 'pymacs)
    (pymacs-load "ropemacs" "rope-")

    ;; other settings here...

    ;; The hook function (`ropemacs-mode') to enable ropemacs-mode is
    ;; just hooked, so it won't be called this time.
    ;; That's why I'm calling this manually here:
    (ropemacs-mode t)))

(add-hook 'python-mode-hook 'my-ropemacs-setup)

---
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.
End of messages
« Back to Discussions « Newer topic     Older topic »