Ejemplo n.º 1
0
 def inline_local_variable(self):
     lisp.save_some_buffers()
     filename = lisp.buffer_file_name()
     line,col = _getCoords()
     brmctx.inlineLocalVariable(filename,line,col)
     lisp.set_marker(lisp.mark_marker(),None)
     _revertSavedFiles(brmctx.save())
Ejemplo n.º 2
0
 def inline_local_variable(self):
     lisp.save_some_buffers()
     filename = lisp.buffer_file_name()
     line, col = _getCoords()
     brmctx.inlineLocalVariable(filename, line, col)
     lisp.set_marker(lisp.mark_marker(), None)
     _revertSavedFiles(brmctx.save())
Ejemplo n.º 3
0
 def pop_excursion(self):
     method, (buffer, point_marker, mark_marker) = self.stack[-1]
     assert method == 'excursion', self.stack[-1]
     del self.stack[-1]
     lisp.set_buffer(buffer)
     lisp.goto_char(point_marker)
     lisp.set_mark(mark_marker)
     lisp.set_marker(point_marker, None)
     if mark_marker is not None:   # needed for xemacs
         lisp.set_marker(mark_marker, None)
Ejemplo n.º 4
0
 def pop_excursion(self):
     method, (buffer, point_marker, mark_marker) = self.stack[-1]
     assert method == 'excursion', self.stack[-1]
     del self.stack[-1]
     lisp.set_buffer(buffer)
     lisp.goto_char(point_marker)
     lisp.set_mark(mark_marker)
     lisp.set_marker(point_marker, None)
     if mark_marker is not None:  # needed for xemacs
         lisp.set_marker(mark_marker, None)
Ejemplo n.º 5
0
 def rename(self,newname):
     lisp.save_some_buffers()
     filename = lisp.buffer_file_name()
     line,col = _getCoords()
     brmctx.setRenameMethodPromptCallback(promptCallback)
     try:
         self.ctx.renameByCoordinates(filename,line,col,newname)
         savedFiles = brmctx.save()
         _revertSavedFiles(savedFiles)
         lisp.set_marker(lisp.mark_marker(),None)
     except bikefacade.CouldntLocateASTNodeFromCoordinatesException:
         print >>logger,"Couldn't find AST Node. Are you renaming the declaration?"
Ejemplo n.º 6
0
    def extract_method(self,name):
        lisp.save_some_buffers()
        filename = lisp.buffer_file_name()

        bline,bcol = _getPointCoords()
        lisp.exchange_point_and_mark()
        eline,ecol = _getPointCoords()
        lisp.exchange_point_and_mark()

        brmctx.extract(filename,bline,bcol,eline,ecol,name)
        lisp.set_marker(lisp.mark_marker(),None)
        _revertSavedFiles(brmctx.save())
Ejemplo n.º 7
0
 def rename(self, newname):
     lisp.save_some_buffers()
     filename = lisp.buffer_file_name()
     line, col = _getCoords()
     brmctx.setRenameMethodPromptCallback(promptCallback)
     try:
         self.ctx.renameByCoordinates(filename, line, col, newname)
         savedFiles = brmctx.save()
         _revertSavedFiles(savedFiles)
         lisp.set_marker(lisp.mark_marker(), None)
     except bikefacade.CouldntLocateASTNodeFromCoordinatesException:
         print >> logger, "Couldn't find AST Node. Are you renaming the declaration?"
Ejemplo n.º 8
0
    def extract_method(self, name):
        lisp.save_some_buffers()
        filename = lisp.buffer_file_name()

        bline, bcol = _getPointCoords()
        lisp.exchange_point_and_mark()
        eline, ecol = _getPointCoords()
        lisp.exchange_point_and_mark()

        brmctx.extract(filename, bline, bcol, eline, ecol, name)
        lisp.set_marker(lisp.mark_marker(), None)
        _revertSavedFiles(brmctx.save())
Ejemplo n.º 9
0
    def pop_mark(self):
        marker_ring = self.get('marker_ring')
        if lisp.ring_empty_p(marker_ring):
            self.message("There are no more marked buffers in \
the rope-marker-ring")
        else:
            oldbuf = lisp.current_buffer()
            marker = lisp.ring_remove(marker_ring, 0)
            marker_buffer = lisp.marker_buffer(marker)
            if marker_buffer is None:
                lisp.message("The marked buffer has been deleted")
                return
            marker_point  = lisp.marker_position(marker)
            lisp.set_buffer(marker_buffer)
            lisp.goto_char(marker_point)
            #Kill that marker so it doesn't slow down editing.
            lisp.set_marker(marker, None, None)
            if not lisp.eq(oldbuf, marker_buffer):
                lisp.switch_to_buffer(marker_buffer)
Ejemplo n.º 10
0
    def pop_mark(self):
        marker_ring = self.get('marker_ring')
        if lisp.ring_empty_p(marker_ring):
            self.message("There are no more marked buffers in \
the rope-marker-ring")
        else:
            oldbuf = lisp.current_buffer()
            marker = lisp.ring_remove(marker_ring, 0)
            marker_buffer = lisp.marker_buffer(marker)
            if marker_buffer is None:
                lisp.message("The marked buffer has been deleted")
                return
            marker_point  = lisp.marker_position(marker)
            lisp.set_buffer(marker_buffer)
            lisp.goto_char(marker_point)
            #Kill that marker so it doesn't slow down editing.
            lisp.set_marker(marker, None, None)
            if not lisp.eq(oldbuf, marker_buffer):
                lisp.switch_to_buffer(marker_buffer)