Eric,
I'm not sure of all of what you said since I have never used Naturally
Speaking, but I do know that the
method of copy/paste used by windows is known by the name CUA.
There is a cua-mode for XEmacs, I quickly searched google for XEmacs and
CUA and found one link
to a copy of the cua-mode for XEmacs:
http://ftp.sa.xemacs.org/contrib/cua-mode.el
I'm sure there are other places to get it too.
Maybe that mode would change things the way you would like them.
Another thought is that you can redefine the keyboard mapping to what
suits you as well.
Some keys like control-X which is used so much in XEmacs would be hard
to redefine and still
keep everything working.
I wanted to redefine the copy/paste keys awhile back, so here is a fine
that I wrote back then--maybe you could use it for an example to give
you a leg up on getting your own desired layout working. Note the super
key (windows key to left of spacebar) is not easily re-defined in
Windows, so that would need changed someway for this exact code to work
in windows. This code also highlights the block correctly too.
Steve Mitchell
-----------snip-------------------------------------------------------------------------------------
; skm-blocks.el
; Byrel and Steve Mitchell
; Nov 12, 2009
; mark blocks by:
; same key for marking first and second block end markers
; once both ends marked, keys to copy, cut, move, & delete block
;
; Goal:
; to do all block commands: mark, copy, move, del, etc. with the left hand
; while the right hand used for positioning in buffer with cursor keys
;
; first written mimicing Vedit+ method (for right hand)::
; F9 to mark first end,
; F9 to mark second end,
; then Cntl-F9 (copy to cursor) or Alt-F9 (move to cursor)
; Vedit+ uses the delete key while block highlighted to delete block.
Won't work here
; so we define a key with the same prefix (super) for deleting
highlighted block
;
; possible improvements:
; add vars to choose how point (or cursor position or block markers) is
moved when block
{ is copied, etc.
; that is, do these things move with the block, stay where they were
was,
: or move to end of new block, etc.?
; add function to unmark all block ends?
; currently marking a "third" end unmarks the 2 previously
selected block ends
; and counts the third end as marking a new first-end-of-block
; find a name for this kind of block marking other than my intials.
; add functions to do columnar block marking (rectangles), with new key
combinations.
; add vars to config how columnar block marking should work, insert,
overwrite, etc.
;
(defvar block-marker-highlight-mode 1
"block-marker-highlight-mode can have 3 values:
0 = highlighing is removed following a block copy or block move
1 = w/ a copy, orig block remains highlighted
w/ a move, block is highlighted at new position
2 = w/ copy or move, block is highlighted at new position" )
(defvar block-marker-end-position-mode t
"block-marker-end-position-mode has 2 values:
t = after a block copy/move, cursor is positioned at end of
inserted block
nil = after a block copy/move, cursor is positioned at beginning
of inserted block
note: t is similar to the way Xemacs works by default")
(defvar block-mark1 (point-marker)) ;var to hold 1st end of our block
(defvar block-mark2 (point-marker)) ;var to hold 2nd end of our block
(defvar block-ends-marked 0) ;0 if no ends marked,
;1 or 2 for number of ends marked
(defvar block-copiedp nil) ;t if block copied
;-------- mark-block --------------------------
(defun mark-block ()
"Marks either end of block with skm type blocks."
(interactive)
(if ( or (eq block-ends-marked 0 ) (eq block-ends-marked 2)) ;are we
marking the first end of a block?
(progn
(setq block-mark1 (point-marker))
(setq block-ends-marked 1)
(clear-highlighting )
(set-mark-command nil)) ;starts highlighting
( if (eq block-ends-marked 1) ; if there is 1 block marker
already, we are marking the second end.
(progn (setq block-mark2 (point-marker))
(setq block-ends-marked 2)
(highlight-region ) ))) )
;-------- copy-block-to-point -----------------
(defun copy-block-to-point ()
"Copies skm-marked block to cur. cursor pos. "
(interactive)
(let ((start-pos (point)))
(if ( < block-ends-marked 2)
(message "Both ends not marked: %d end(s) marked."
block-ends-marked ) ;error if there aren't 2 ends marked
(save-excursion
(set-buffer (marker-buffer block-mark1))
(copy-to-register ?c block-mark1 block-mark2))
(insert-register ?c t)
(setq block-copiedp t)
(let ((end-pos (point)))
(if (eq block-marker-highlight-mode 0) ;0 = clear all
highlighting
(clear-highlighting-at-point ( marker-buffer block-mark1)
block-mark1)
(if (eq block-marker-highlight-mode 2 ) ;2 =
highlight at new position
(progn
(clear-highlighting-at-point ( marker-buffer block-mark1)
block-mark1)
(goto-char start-pos)
(push-mark)
(goto-char end-pos)
(highlight-region))))))
(if (not block-marker-end-position-mode) ;determine
where to leave cursor
(goto-char start-pos)) ))
;-------- move-block-to-point -----------------
(defun move-block-to-point ()
"Moves skm-marked block to current cursor pos. "
(interactive)
(if ( < block-ends-marked 2)
(message "Both ends not marked: %d end(s) marked."
block-ends-marked )
(save-excursion
(set-buffer (marker-buffer block-mark1))
(copy-to-register ?c block-mark1 block-mark2 t))
(let ((start-pos (point)) end-pos )
(insert-register ?c t)
(setq end-pos (point))
(setq block-copiedp t)
(clear-highlighting-at-point ( marker-buffer block-mark1)
block-mark1)
(if (eq block-marker-highlight-mode 0) ;0 = clear
all highlighting
nil
(goto-char start-pos)
(push-mark)
(goto-char end-pos)
(highlight-region))
(if (not block-marker-end-position-mode) ;determine
where to leave cursor
(goto-char start-pos)) )))
;-------- cut-block ---------------------------
(defun cut-block ()
"Cuts skm-marked block from file."
(interactive)
(if ( < block-ends-marked 2)
(message "Both ends not marked: %d end(s) marked."
block-ends-marked )
(copy-to-register ?c block-mark1 block-mark2 t)
(setq block-copiedp t)))
;------- highlight a block persistantly -----------
(defun highlight-region ()
(interactive)
(let (new-extent) (setq new-extent (make-extent (mark t) (point)))
(set-extent-property new-extent 'face 'zmacs-region)
(set-extent-property new-extent 'wordstar-block t)))
;------- clear the highlighted blocks in a buffer -----------
(defun clear-highlighting-whole-buffer (&optional buffer)
(interactive)
(let ((highlighted-list (extent-list buffer nil nil nil 'face
'zmacs-region)))
(while highlighted-list
(delete-extent (car highlighted-list))
(setq highlighted-list (cdr highlighted-list)))))
(defun clear-highlighting-at-point (&optional buffer position)
(interactive)
(if (not position)
(setq position (point)))
(while (extent-at position buffer 'wordstar-block nil 'at )
(delete-extent (extent-at position buffer 'wordstar-block nil 'at )) ))
;------------key assignments ------------------
;--- key assignments to mimic VEdit+ method
;--- to verify we have algorithm correct
(global-set-key [ f9 ] 'mark-block)
(global-set-key [ (control f9) ] 'copy-block-to-point)
(global-set-key [ (meta f9) ] 'move-block-to-point)
(global-set-key [ (control meta f9) ] 'cut-block) ;not in Vedit, but
for testing
(global-set-key [ (control shift f9) ] 'clear-highlighting) ;not in
Vedit, but for testing
;------- key assignments for left hand use
;--- using only super key (left windows-logo key) shifting
;Doesn't work with xemacs in Windows since Windows preempts the super key
; have to experiment to find something to work for windows' xemacs...
(global-set-key [ (super space) ] 'mark-block)
(global-set-key [ (super v) ] 'copy-block-to-point) ;mnemonic: V for
insert, drive a V (wedge) in
(global-set-key [ (super m) ] 'move-block-to-point) ;mnemonic: M for move
(global-set-key [ (super c) ] 'cut-block) ;mnemonic: C for Cut
(global-set-key [ (super n) ] 'clear-highlighting-at-point) ;mnemonic:
think N for No highlighting
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta