A while ago a ported version of cua-mode.el was sent out on this list.
;; Author: Kim F. Storm <storm(a)olicom.dk>
;; Adapted-By: SL Baur <steve(a)altrasoft.com>
;; Maintainer: SL Baur <steve(a)altrasoft.com>
;; Keywords: emulations
;; Revision: 1.3
It has worked very well in most regards but has one bug that I occasionally
run into. I didn't find it in the last sumo I downloaded and I can't get to
the CVS site this morning to see if a newer version is available there.
This is reproducible on both my NT and Sun builds of 21.1.3 and 21.2.14 on
the Sun. It also is repeatable using -vanilla, at least on the NT version.
Recipe:
After having loaded and activated cua-mode, select a region in an editable
file and begin to perform a query-replace in it.
Either after you begin typing in characters into the query replace (NT) or
when you hit enter after entering the first argument (Sun) you will get an
error:
(1) (error/warning) Error in `pre-command-hook' (setting hook to nil):
(wrong-type-argument integer-or-marker-p nil)
A backtrace looks like:
Signaling: (wrong-type-argument integer-or-marker-p nil)
delete-region(1 nil)
(if killp (if (listp killp) (copy-region-as-kill ... ...) (kill-region ...
...)) (delete-region (point) (mark)))
)
CUA-delete-active-region(nil)
(cond ((eq type ...) (CUA-delete-active-region t)) ((eq type ...) (setq
supersede ...)) ((eq type ...) (if ... ...) (CUA-delete-active-region nil))
((eq type ...) (setq supersede ...)) ((eq type ...)
(CUA-delete-active-region nil)) ((eq type ...) (setq supersede ...)) ((eq
type ...) (setq supersede ...)) (t (setq ro t)))
)
(if (not ro) (cond (... ...) (... ...) (... ... ...) (... ...) (... ...)
(... ...) (... ...) (t ...)))
)
(progn (if (not ro) (cond ... ... ... ... ... ... ... ...)) (if ro (cond
... ...)))
)
(if zmacs-region-active-p (progn (if ... ...) (if ro ...)))
)
(if (eq type (quote move)) (if (memq ... ...) (and ... ...)) (if
zmacs-region-active-p (progn ... ...)))
)
(let ((type ...) (ro buffer-read-only) (supersede nil)) (if (eq type ...)
(if ... ...) (if zmacs-region-active-p ...)) (if supersede (setq
this-command ...)))
)
(if (and CUA-mode (symbolp this-command)) (let (... ... ...) (if ... ...
...) (if supersede ...)))
)
CUA-pre-hook()
read-minibuffer-internal("Query replace: ")
byte-code("..." [recursion-depth minibuffer-depth t standard-input
standard-output read-minibuffer-internal prompt] 2)
read-from-minibuffer("Query replace: " nil nil nil query-replace-history)
query-replace-read-args("Query replace" nil)
call-interactively(query-replace)
delete-region is getting called with a nil for end, yet the region was
active when entering query-replace so (mark) should have been defined.
Sorry, I don't know where to take it from there, it looks to me like it
should have worked.
Regards,
Jim Horning
--
Jim Horning
Senior Engineering Specialist, Computer Architecture
Lockheed Martin Vought Systems
P.O. Box 650003, M/S L14-01, Dallas, TX 75265-0003
(972)603-1560
mailto:jim.horning@lmco.com