Function: ex-get-inline-cmd-args

ex-get-inline-cmd-args is a byte-compiled function defined in viper-ex.el.gz.

Signature

(ex-get-inline-cmd-args REGEX-FORW &optional CHARS-BACK REPLACE-STR)

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-ex.el.gz
;; In inline args, skip regex-forw and (optionally) chars-back.
;; Optional 3d arg is a string that should replace ' ' to prevent its
;; special meaning
(defun ex-get-inline-cmd-args (regex-forw &optional chars-back replace-str)
  (with-current-buffer (setq viper-ex-work-buf
                             (get-buffer-create viper-ex-work-buf-name))
    (goto-char (point-min))
    (re-search-forward regex-forw nil t)
    (let ((beg (point))
	  end)
      (goto-char (point-max))
      (if chars-back
	  (skip-chars-backward chars-back)
	(skip-chars-backward " \t\n\C-m"))
      (setq end (point))
      ;; replace SPC with `=' to suppress the special meaning SPC has
      ;; in Ex commands
      (goto-char beg)
      (if replace-str
	  (while (re-search-forward " +" nil t)
	    (replace-match replace-str nil t)
	    (viper-forward-char-carefully)))
      (goto-char end)
      (buffer-substring beg end))))