Exemplo n.º 1
0
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)
Exemplo n.º 2
0
 def push_mark(self):
     marker_ring = self.get('marker_ring')
     marker = lisp.point_marker()
     lisp.ring_insert(marker_ring, marker)
Exemplo n.º 3
0
 def push_mark(self):
     marker_ring = self.get('marker_ring')
     marker = lisp.point_marker()
     lisp.ring_insert(marker_ring, marker)