agr / ropemacs (http://rope.sf.net/ropemacs.html)

An emacs minor mode for using rope python refactoring library in emacs.

Clone this repository (size: 368.1 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/agr/ropemacs/
commit 372: 5d2b7c97e44c
parent 371: e6a26436ff84
branch: trunk
[mq]: occurance-next-error-functionality
Stefan Reichoer
20 months ago

Changed (Δ397 bytes):

raw changeset »

ropemacs/__init__.py (13 lines added, 1 lines removed)

Up to file-list ropemacs/__init__.py:

@@ -218,6 +218,8 @@ class LispUtils(ropemode.environment.Env
218
218
        text = '\n'.join(text) + '\n'
219
219
        buffer = self._make_buffer('*rope-occurrences*', text, switch=True)
220
220
        lisp.set_buffer(buffer)
221
        lisp.toggle_read_only(1)
222
        lisp.set(lisp["next-error-function"], lisp.rope_occurrences_next)
221
223
        lisp.local_set_key('\r', lisp.rope_occurrences_goto_occurrence)
222
224
        lisp.local_set_key('q', lisp.delete_window)
223
225
@@ -346,9 +348,19 @@ def occurrences_goto_occurrence():
346
348
        resource = _interface._get_resource(filename)
347
349
        LispUtils().find_file(resource.real_path, other=True)
348
350
        lisp.goto_char(offset + 1)
349
        lisp.switch_to_buffer_other_window('*rope-occurrences*')
350
351
occurrences_goto_occurrence.interaction = ''
351
352
353
def occurrences_next(arg, reset):
354
    lisp.switch_to_buffer_other_window('*rope-occurrences*')
355
    if reset:
356
        lisp.goto_char(lisp.point_min())
357
    lisp.forward_line(arg)
358
    if lisp.eobp():
359
        lisp.message("Cycling rope occurences")
360
        lisp.goto_char(lisp.point_min())
361
    occurrences_goto_occurrence()
362
occurrences_next.interaction = ''
363
352
364
353
365
DEFVARS = """\
354
366
(defgroup ropemacs nil