aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/subr.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index a95f4d58efd..21438419302 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -882,6 +882,14 @@ Wildcards and redirection are handled as usual in the shell."
882 (cons 'progn body) 882 (cons 'progn body)
883 (list 'store-match-data original))))) 883 (list 'store-match-data original)))))
884 884
885(defun match-string (n &optional string)
886 "Return the Nth subexpression matched by the last regexp search or match.
887If the last search or match was done against a string,
888specify that string as the second argument STRING."
889 (if string
890 (substring string (match-beginning 0) (match-end 0))
891 (buffer-substring string (match-beginning 0) (match-end 0))))
892
885(defun shell-quote-argument (argument) 893(defun shell-quote-argument (argument)
886 "Quote an argument for passing as argument to an inferior shell." 894 "Quote an argument for passing as argument to an inferior shell."
887 ;; Quote everything except POSIX filename characters. 895 ;; Quote everything except POSIX filename characters.