Anonymous avatar Anonymous committed 408afe1

nil for ropemacs-.*-prefix will prevent binding keys

Comments (0)

Files changed (2)

     (pymacs-load "ropemacs" "rope-")
     (rope-init)
     ;; Automatically save project python buffers before refactorings
-    (setq rope-confirm-saving 'nil)
+    (setq ropemacs-confirm-saving 'nil)
   )
 
 And execute ``load-ropemacs`` whenever you want to use ropemacs.  Also
 
 Rope refactorings use a special kind of dialog.  When you start a
 refactoring, you'll be asked to confirm saving modified python
-buffers; you can change it by using ``rope-confirm-saving`` variable.
-Adding ``(setq rope-confirm-saving 'nil)`` to your ``.emacs`` file,
-will make emacs save them without asking.
+buffers; you can change it by using ``ropemacs-confirm-saving``
+variable.  Adding ``(setq ropemacs-confirm-saving 'nil)`` to your
+``.emacs`` file, will make emacs save them without asking.
 
 After that depending on the refactoring, you'll be asked about the
 essential information a refactoring needs to know (like the new name

ropemacs/__init__.py

         lisp.add_hook(lisp.kill_emacs_hook, lisp.rope_exiting_actions)
         lisp.add_hook(lisp.python_mode_hook, lisp.rope_register_local_keys)
 
-        prefix = lisp.ropemacs_global_prefix.value() + ' '
-        for key, callback in self.global_keys:
-            lisp.global_set_key(self._key_sequence(prefix + key), callback)
+        prefix = lisp.ropemacs_global_prefix.value()
+        if prefix is not None:
+            for key, callback in self.global_keys:
+                lisp.global_set_key(self._key_sequence(prefix + ' ' + key),
+                                    callback)
 
     def _prepare_refactorings(self):
-        prefix = lisp.ropemacs_local_prefix.value() + ' '
+        prefix = lisp.ropemacs_local_prefix.value()
         for name in dir(refactor):
             if not name.startswith('_') and name != 'Refactoring':
                 attr = getattr(refactor, name)
                     name = self._refactoring_name(attr)
                     setattr(self, name, do_refactor)
                     name = 'rope-' + name.replace('_', '-')
-                    self.local_keys.append((prefix + attr.key, lisp[name]))
+                    if prefix is not None:
+                        key = prefix + ' ' + attr.key
+                        self.local_keys.append((key, lisp[name]))
 
     def _refactoring_name(self, refactoring):
         return refactor.refactoring_name(refactoring)
   'rope-code-assist-max-fixes 'ropemacs-codeassist-maxfixes)
 
 (defcustom ropemacs-local-prefix "C-c r"
-  "The prefix for ropemacs refactorings")
+  "The prefix for ropemacs refactorings
+
+Use nil to prevent binding keys.")
 
 (defcustom ropemacs-global-prefix "C-x p"
-  "The prefix for ropemacs project commands")
+  "The prefix for ropemacs project commands
+
+Use nil to prevent binding keys.")
 
 (provide 'ropemacs)
 """
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.