Function: ex-copy

ex-copy is a byte-compiled function defined in viper-ex.el.gz.

Signature

(ex-copy DEL-FLAG)

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-ex.el.gz
;; Ex copy and move command.  DEL-FLAG means delete
(defun ex-copy (del-flag)
  (viper-default-ex-addresses)
  (let ((address (viper-get-ex-address))
	(end (car ex-addresses)) (beg (car (cdr ex-addresses))))
    (goto-char end)
    (save-excursion
      (push-mark beg t)
      (viper-enlarge-region (mark t) (point))
      (if del-flag
	  (kill-region (point) (mark t))
	(copy-region-as-kill (point) (mark t)))
      (if ex-flag
	  (progn
	    (with-output-to-temp-buffer " *copy text*"
	      (princ
	       (if (or del-flag ex-g-flag ex-g-variant)
		   (current-kill 0)
		 (buffer-substring (point) (mark t)))))
	    (condition-case nil
		(progn
		  (read-string "[Hit return to confirm] ")
		  (save-excursion (kill-buffer " *copy text*")))
	      (quit (save-excursion (kill-buffer " *copy text*"))
		    (signal 'quit nil))))))
    (if (= address 0)
	(goto-char (point-min))
      (goto-char address)
      (forward-line 1))
      (insert (current-kill 0))))