;;; rect.el --- rectangle functions for GNU Emacs -*- lexical-binding:t -*-
-;; Copyright (C) 1985, 1999-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1999-2014 Free Software Foundation, Inc.
;; Maintainer: Didier Verna <didier@xemacs.org>
;; Keywords: internal
;; - lots of commands handle the region without paying attention to its
;; rectangular shape.
-(add-hook 'deactivate-mark-hook
- (lambda () (rectangle-mark-mode -1)))
-
(add-function :around redisplay-highlight-region-function
#'rectangle--highlight-for-redisplay)
(add-function :around redisplay-unhighlight-region-function
Activates the region if needed. Only lasts until the region is deactivated."
nil nil nil
(when rectangle-mark-mode
+ (add-hook 'deactivate-mark-hook
+ (lambda () (rectangle-mark-mode -1)))
(unless (region-active-p)
(push-mark)
- (activate-mark))))
+ (activate-mark)
+ (message "Mark set (rectangle mode)"))))
(defun rectangle--extract-region (orig &optional delete)
(if (not rectangle-mark-mode)
(overlay-put ol 'after-string str))))
((overlay-get ol 'after-string)
(overlay-put ol 'after-string nil)))
- (when (= leftcol rightcol)
+ (when (and (= leftcol rightcol) (display-graphic-p))
;; Make zero-width rectangles visible!
- (overlay-put ol 'after-string
- (concat (propertize " "
+ (overlay-put ol 'after-string
+ (concat (propertize " "
'face '(region (:height 0.2)))
(overlay-get ol 'after-string))))
(push ol nrol)