def save_files(self, filenames): ask = self.get('confirm_saving') initial = lisp.current_buffer() for filename in filenames: buffer = lisp.find_buffer_visiting(filename) if buffer: if lisp.buffer_modified_p(buffer): if not ask or lisp.y_or_n_p('Save %s buffer?' % filename): lisp.set_buffer(buffer) lisp.save_buffer() lisp.set_buffer(initial)
def redo(self): self._check_project() change = self.project.history.tobe_redone if change is None: lisputils.message('Nothing to redo!') return if lisp.y_or_n_p('Redo <%s>? ' % str(change)): def redo(handle): for changes in self.project.history.redo(task_handle=handle): self._reload_buffers(changes) lisputils.runtask(redo, 'Redo refactoring', interrupts=False)
def promptCallback(filename,line,colbegin,colend): let = Let().push_excursion() # gets popped when let goes out of scope buffer = lisp.current_buffer() if let: ans = 0 lisp.find_file(filename) lisp.goto_line(line) lisp.move_to_column(colbegin) lisp.set_mark(lisp.point() + (colend - colbegin)) if is_xemacs: lisp.activate_region() ans = lisp.y_or_n_p("Couldn't deduce object type - rename this method reference? ") del let lisp.switch_to_buffer(buffer) return ans
def promptCallback(filename, line, colbegin, colend): let = Let().push_excursion() # gets popped when let goes out of scope buffer = lisp.current_buffer() if let: ans = 0 lisp.find_file(filename) lisp.goto_line(line) lisp.move_to_column(colbegin) lisp.set_mark(lisp.point() + (colend - colbegin)) if is_xemacs: lisp.activate_region() ans = lisp.y_or_n_p( "Couldn't deduce object type - rename this method reference? ") del let lisp.switch_to_buffer(buffer) return ans
def _save_buffers(self, only_current=False): ask = lisp['ropemacs-confirm-saving'].value() initial = lisp.current_buffer() current_buffer = lisp.current_buffer() if only_current: buffers = [current_buffer] else: buffers = lisp.buffer_list() for buffer in buffers: filename = lisp.buffer_file_name(buffer) if filename: if self._is_python_file(filename) and \ lisp.buffer_modified_p(buffer): if not ask or lisp.y_or_n_p('Save %s buffer?' % filename): lisp.set_buffer(buffer) lisp.save_buffer() lisp.set_buffer(initial)
def y_or_n(self, prompt): return lisp.y_or_n_p(prompt)