comparison contrib/mercurial.el @ 5467:521284cdbcb4

mercurial.el: mark-marker() returns non-nil with no active mark on GNU Emacs
author NIIMI Satoshi <sa2c@sa2c.net>
date Thu, 11 Oct 2007 06:10:45 +0900
parents 9873cbb134b2
children
comparison
equal deleted inserted replaced
5466:87860c62e003 5467:521284cdbcb4
664 "Return information to help restore a user's editing context. 664 "Return information to help restore a user's editing context.
665 This is useful across reverts and merges, where a context is likely 665 This is useful across reverts and merges, where a context is likely
666 to have moved a little, but not really changed." 666 to have moved a little, but not really changed."
667 (let ((point-context (hg-position-context (point))) 667 (let ((point-context (hg-position-context (point)))
668 (mark-context (let ((mark (mark-marker))) 668 (mark-context (let ((mark (mark-marker)))
669 (and mark (hg-position-context mark))))) 669 (and mark
670 ;; make sure active mark
671 (marker-buffer mark)
672 (marker-position mark)
673 (hg-position-context mark)))))
670 (list point-context mark-context))) 674 (list point-context mark-context)))
671 675
672 (defun hg-find-context (ctx) 676 (defun hg-find-context (ctx)
673 "Attempt to find a context in the given buffer. 677 "Attempt to find a context in the given buffer.
674 Always returns a valid, hopefully sane, position." 678 Always returns a valid, hopefully sane, position."