emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emulation/cua-rect.el


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/lisp/emulation/cua-rect.el
Date: Thu, 02 Sep 2004 19:12:54 -0400

Index: emacs/lisp/emulation/cua-rect.el
diff -c emacs/lisp/emulation/cua-rect.el:1.10 
emacs/lisp/emulation/cua-rect.el:1.11
*** emacs/lisp/emulation/cua-rect.el:1.10       Sun Aug 29 20:57:19 2004
--- emacs/lisp/emulation/cua-rect.el    Thu Sep  2 22:56:22 2004
***************
*** 274,280 ****
      (move-to-column mc)
      (set-mark (point))
      (goto-char pp)
!     (move-to-column pc)
      ))
  
  ;;; Rectangle resizing
--- 274,284 ----
      (move-to-column mc)
      (set-mark (point))
      (goto-char pp)
!     (if (and (if (cua--rectangle-right-side)
!                (= (move-to-column pc) (- pc tab-width))
!              (> (move-to-column pc) pc))
!            (not (bolp)))
!       (backward-char 1))
      ))
  
  ;;; Rectangle resizing
***************
*** 569,574 ****
--- 573,580 ----
            (setq end   (min (window-end) end)))
          (goto-char end)
          (setq end (line-end-position))
+       (if (and visible (bolp) (not (eobp)))
+           (setq end (1+ end)))
          (goto-char start)
          (setq start (line-beginning-position))
          (narrow-to-region start end)
***************
*** 761,767 ****
        (cua--rectangle-operation nil t nil nil nil ; do not tabify
          '(lambda (s e l r v)
             (let ((rface (if v 'cua-rectangle-face 
'cua-rectangle-noselect-face))
!                  overlay bs as)
             (if (= s e) (setq e (1+ e)))
             (when (cua--rectangle-virtual-edges)
               (let ((lb (line-beginning-position))
--- 767,773 ----
        (cua--rectangle-operation nil t nil nil nil ; do not tabify
          '(lambda (s e l r v)
             (let ((rface (if v 'cua-rectangle-face 
'cua-rectangle-noselect-face))
!                  overlay bs ms as)
             (if (= s e) (setq e (1+ e)))
             (when (cua--rectangle-virtual-edges)
               (let ((lb (line-beginning-position))
***************
*** 791,813 ****
                         (setq s (1- s))))
                   (cond
                    ((= cr r)
!                    (if (and (/= cr0 (1- cr))
!                             (= (mod cr tab-width) 0))
                         (setq e (1- e))))
                    ((= cr cl)
!                    (setq bs (concat bs
!                                     (propertize
!                                      (make-string
!                                       (- r l)
!                                       (if cua--virtual-edges-debug ?, ?\s))
!                                      'face rface)))
                     (setq rface nil))
!                   (t
                     (setq as (propertize
                               (make-string
                                (- r cr0 (if (= le pr) 1 0))
                                (if cua--virtual-edges-debug ?~ ?\s))
                               'face rface))
                     (if (/= pr le)
                         (setq e (1- e))))))))
             ;; Trim old leading overlays.
--- 797,827 ----
                         (setq s (1- s))))
                   (cond
                    ((= cr r)
!                    (if (and (/= pr le)
!                             (/= cr0 (1- cr))
!                             (or bs (/= cr0 (- cr tab-width)))
!                             (/= (mod cr tab-width) 0))
                         (setq e (1- e))))
                    ((= cr cl)
!                    (setq ms (propertize
!                              (make-string
!                               (- r l)
!                               (if cua--virtual-edges-debug ?, ?\s))
!                              'face rface))
!                    (if (cua--rectangle-right-side)
!                        (put-text-property (1- (length ms)) (length ms) 
'cursor t ms)
!                      (put-text-property 0 1 'cursor t ms))
!                    (setq bs (concat bs ms))
                     (setq rface nil))
!                   (t
                     (setq as (propertize
                               (make-string
                                (- r cr0 (if (= le pr) 1 0))
                                (if cua--virtual-edges-debug ?~ ?\s))
                               'face rface))
+                    (if (cua--rectangle-right-side)
+                        (put-text-property (1- (length as)) (length as) 
'cursor t as)
+                      (put-text-property 0 1 'cursor t as))
                     (if (/= pr le)
                         (setq e (1- e))))))))
             ;; Trim old leading overlays.
***************
*** 826,832 ****
                     (move-overlay overlay s e)
                     (setq old (cdr old)))
                 (setq overlay (make-overlay s e)))
!            (overlay-put overlay 'before-string bs)
             (overlay-put overlay 'after-string as)
             (overlay-put overlay 'face rface)
             (setq new (cons overlay new))))))
--- 840,846 ----
                     (move-overlay overlay s e)
                     (setq old (cdr old)))
                 (setq overlay (make-overlay s e)))
!            (overlay-put overlay 'before-string bs)
             (overlay-put overlay 'after-string as)
             (overlay-put overlay 'face rface)
             (setq new (cons overlay new))))))
***************
*** 839,845 ****
    (let ((col (cua--rectangle-insert-col))
          (pad (cua--rectangle-virtual-edges))
          indent)
!     (cua--rectangle-operation (if clear 'clear 'corners) nil t pad t
        '(lambda (s e l r)
           (move-to-column col pad)
           (if (and (eolp)
--- 853,859 ----
    (let ((col (cua--rectangle-insert-col))
          (pad (cua--rectangle-virtual-edges))
          indent)
!     (cua--rectangle-operation (if clear 'clear 'corners) nil t pad nil
        '(lambda (s e l r)
           (move-to-column col pad)
           (if (and (eolp)
***************
*** 975,981 ****
  (defun cua-rotate-rectangle ()
    (interactive)
    (cua--rectangle-corner (if (= (cua--rectangle-left) (cua--rectangle-right)) 
0 1))
!   (cua--rectangle-set-corners))
  
  (defun cua-toggle-rectangle-virtual-edges ()
    (interactive)
--- 989,997 ----
  (defun cua-rotate-rectangle ()
    (interactive)
    (cua--rectangle-corner (if (= (cua--rectangle-left) (cua--rectangle-right)) 
0 1))
!   (cua--rectangle-set-corners)
!   (if (cua--rectangle-virtual-edges)
!       (setq cua--buffer-and-point-before-command nil)))
  
  (defun cua-toggle-rectangle-virtual-edges ()
    (interactive)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]