def insert(name): """Inserts a license out of ``licenses_alist`` into the current buffer. """ name = name.upper() try: args = {"year": date.today().year, "name": lisp.user_full_name.value(), "email": lisp.user_mail_address.value()} text = licenses[name] % args except KeyError: lisp.error("Unknown license %s", name) return # get the current point start_pos = lisp.point_marker() lisp.insert(text) lisp.insert("\n") end_pos = lisp.point_marker() lisp.comment_region(start_pos, end_pos)
def push_mark(self): marker_ring = self.get('marker_ring') marker = lisp.point_marker() lisp.ring_insert(marker_ring, marker)