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/viper-util.el


From: Michael Kifer
Subject: [Emacs-diffs] Changes to emacs/lisp/emulation/viper-util.el
Date: Wed, 18 Sep 2002 00:23:29 -0400

Index: emacs/lisp/emulation/viper-util.el
diff -c emacs/lisp/emulation/viper-util.el:1.47 
emacs/lisp/emulation/viper-util.el:1.48
*** emacs/lisp/emulation/viper-util.el:1.47     Sun Feb 10 01:46:12 2002
--- emacs/lisp/emulation/viper-util.el  Wed Sep 18 00:23:27 2002
***************
*** 264,276 ****
      (goto-char cur-pos)
      result))
  
! ;; Emacs counts each multibyte character as several positions in the buffer, 
so
! ;; we use Emacs' chars-in-region.  XEmacs is counting each char as just one 
pos,
! ;; so we can simply subtract. 
  (defun viper-chars-in-region (beg end &optional preserve-sign)
!   (let ((count (abs (if (fboundp 'chars-in-region)
!                       (chars-in-region beg end)
!                     (- end beg)))))
      (if (and (< end beg) preserve-sign)
        (- count)
        count)))
--- 264,279 ----
      (goto-char cur-pos)
      result))
  
! ;; Emacs used to count each multibyte character as several positions in the 
buffer,
! ;; so we had to use Emacs' chars-in-region to count characters. Since 20.3,
! ;; Emacs counts multibyte characters as 1 position.  XEmacs has always been
! ;; counting each char as just one pos. So, now we can simply subtract beg from
! ;; end to determine the number of characters in a region.
  (defun viper-chars-in-region (beg end &optional preserve-sign)
!   ;;(let ((count (abs (if (fboundp 'chars-in-region)
!   ;;                  (chars-in-region beg end)
!   ;;                (- end beg)))))
!   (let ((count (abs (- end beg))))
      (if (and (< end beg) preserve-sign)
        (- count)
        count)))




reply via email to

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