vip-mode under GNU Emacs 18.41 and 18.44

vip-mode under GNU Emacs 18.41 and 18.44

Post by a88.. » Sun, 03 Jun 1990 00:22:00

The vi emulating package vip.el under GNU Emacs 18.41 and 18.44 contains
a rather seriou bug.  Namely the keys "f", "t", "F", "T" do not work as
expected in vi mode.  This bug can be fixed by changing the definition of
vi-find-char as follows:

(defun vi-find-char (arg char forward offset)
  "(ARG CHAR FORWARD OFFSET)  Find ARG's occurence of CHAR on the
current line.  If FORWARD then search is forward, otherwise backward.
OFFSET is used to adjust point after search."
  (let ((arg (if forward arg (- arg))) point)
        (if (> arg 0)
             ;; forward search begins here
             (if (eolp) (error "") (point))
             ;; forward search ends here
             (progn (next-line 1) (beginning-of-line) (point)))
           ;; backward search begins from here
           (if (bolp) (error "") (point))
           ;; backward search ends here
           (progn (beginning-of-line) (point))))
        ;; if arg > 0, point is forwarded before search.
        (if (> arg 0) (goto-char (1+ (point-min)))
          (goto-char (point-max)))
        (let ((case-fold-search nil))
          (if (> arg 0)
              (search-forward (char-to-string char) nil 0 arg)
            (search-backward (char-to-string char) nil 0 (- arg))))
        (setq point (point))
        (if (or (and (> arg 0) (= point (point-max)))
                (and (< arg 0) (= point (point-min))))
            (error ""))))
    (goto-char (+ point (if (> arg 0) (if offset -2 -1) (if offset 1 0))))))

You can either modify the file vip.el or you can insert the above function
definition in your .vip file.  The above bug has been introduced because I
developed the vi package under GNU Emacs 17.64, and I used a function which
is now obsolete.

I am told that this bug is fixed in GNU Emacs 18.45.

I thank John Rigby at Utah for reporting the bug.

** masahiko **


1. vip-mode under GNU Emacs 19.28: paste doesn't work

Hello everyone! I just installed the GNU Emacs version 19.28 on an IBM
RS6000 running AIX 3.2. Everything works fine. I'm using vip-mode under
Emacs. But there is a problem with the paste function in vi mode. For
example, after I deleted a line using 'dd', I tried to paste the line
back using 'p' or 'P', emacs complained 'The mark is not active now' and
the paste failed. I have tried vip.el version 3.5 and 4.3, both have the
same problem.

By the way, this problem doesn't occur with version 18.57.

Has anybody experienced the same problem? Is there anyway to solve it?

Thank you for you help!

Kezhao Zhang
Physcics Department
UC, San Diego

2. PALM 2.0 desktop BETA for MAC issues

3. GNU Emacs' vip-mode improvments wanted

4. web cams

5. Minor GNU Emacs 18.44 strangeness on RT.

6. XPath Axes Question

7. GNU EMACS 18.44 on SUN-4

8. HP Deskjet 1220 Grinding Noise Followup

9. Bugs in VMS GNU Emacs 18.44

10. GNU Emacs changes 18.41 - 18.46

11. Access violations in VMS Gnu Emacs 18.41

12. Problems with GNU Emacs 18.41 on Amdahl UTS 5.2.4

13. Problems in building VMS GNU Emacs 18.41