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

XEamcs -- how to assign keys to Cut, Copy, Paste?



Hi

	How can I assign keys to Cut, Copy, and Paste in XEmacs.  Ideally,  
they would not be lots of keystrokes combined.

	On a related note, my frien Bill Bumgartner once gave me the  
included function for my .emacs file...it causes the paste command to replace  
the selection.   How can I make it work here?



 	  ;; clear-and-paste
	  ;;
	  ;; Replaces current region with yank-buffer and moves point to end of
	  ;; freshly yanked text.  If no selection, simply inserts text.
	  (defun clear-and-paste (p)
		"Act like Text object paste.  That is-- paste yank buffer,  
replacing
current selection (if any) and move point to end"
		(interactive "*d")
		(let ((newPoint 0))
		  (save-excursion
			(cond ((eval mark-active)
				   (delete-region p (mark))))
			(yank)
			(setq newPoint (point)))
		  (goto-char newPoint)))

     ;; Replace more like text object
      (setq delete-selection-mode t)


			- B


Reply to: