• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/eshell/

Lines Matching +refs:eshell +refs:next +refs:input

29 (defgroup eshell-arg nil
34 :group 'eshell)
39 ;; hook `eshell-parse-argument-hook'. For a good example of this, see
40 ;; `eshell-parse-drive-letter', defined in eshell-dirs.el.
42 (defcustom eshell-parse-argument-hook
46 'eshell-parse-special-reference
51 (when (and (not eshell-current-argument)
52 (not eshell-current-quoted)
53 (looking-at eshell-number-regexp)
54 (eshell-arg-delimiter (match-end 0)))
64 (unless eshell-inside-quote-regexp
65 (setq eshell-inside-quote-regexp
67 (apply 'string eshell-special-chars-inside-quoting))))
68 (unless eshell-outside-quote-regexp
69 (setq eshell-outside-quote-regexp
71 (apply 'string eshell-special-chars-outside-quoting))))
72 (when (looking-at (if eshell-current-quoted
73 eshell-inside-quote-regexp
74 eshell-outside-quote-regexp))
86 (and (not eshell-current-argument)
93 (eshell-finish-arg)))))
96 'eshell-parse-backslash
99 'eshell-parse-literal-quote
102 'eshell-parse-double-quote
105 'eshell-parse-delimiter)
111 moving the point forward to reflect the amount of input text that was
117 :group 'eshell-arg)
123 (defcustom eshell-arg-load-hook '(eshell-arg-initialize)
124 "*A hook that gets run when `eshell-arg' is loaded."
126 :group 'eshell-arg)
128 (defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ? ?\t ?\n)
131 :group 'eshell-arg)
133 (defcustom eshell-special-chars-inside-quoting '(?\\ ?\")
136 :group 'eshell-arg)
138 (defcustom eshell-special-chars-outside-quoting
139 (append eshell-delimiter-argument-list '(?# ?! ?\\ ?\" ?\'))
143 :group 'eshell-arg)
147 (defvar eshell-current-argument nil)
148 (defvar eshell-current-modifiers nil)
149 (defvar eshell-arg-listified nil)
150 (defvar eshell-nested-argument nil)
151 (defvar eshell-current-quoted nil)
152 (defvar eshell-inside-quote-regexp nil)
153 (defvar eshell-outside-quote-regexp nil)
157 (defun eshell-arg-initialize ()
159 (define-key eshell-command-map [(meta ?b)] 'eshell-insert-buffer-name)
160 (set (make-local-variable 'eshell-inside-quote-regexp) nil)
161 (set (make-local-variable 'eshell-outside-quote-regexp) nil))
163 (defun eshell-insert-buffer-name (buffer-name)
168 (defsubst eshell-escape-arg (string)
174 (defun eshell-resolve-current-argument ()
176 (when eshell-current-argument
177 (when eshell-arg-listified
178 (let ((parts eshell-current-argument))
182 (list 'eshell-to-flat-string (car parts))))
184 (setq eshell-current-argument
185 (list 'eshell-convert
186 (append (list 'concat) eshell-current-argument))))
187 (setq eshell-arg-listified nil))
188 (while eshell-current-modifiers
189 (setq eshell-current-argument
190 (list (car eshell-current-modifiers) eshell-current-argument)
191 eshell-current-modifiers (cdr eshell-current-modifiers))))
192 (setq eshell-current-modifiers nil))
194 (defun eshell-finish-arg (&optional argument)
197 (setq eshell-current-argument argument))
198 (throw 'eshell-arg-done t))
200 (defsubst eshell-arg-delimiter (&optional pos)
205 (memq (char-after pos) eshell-delimiter-argument-list))))
209 (defun eshell-parse-arguments (beg end)
225 (catch 'eshell-incomplete
228 (arg (eshell-parse-argument)))
234 (throw 'eshell-incomplete delim)
235 (throw 'eshell-incomplete
239 (defun eshell-parse-argument ()
240 "Get the next argument. Leave point after it."
241 (let* ((outer (null eshell-nested-argument))
243 (eshell-nested-argument t)
244 eshell-current-argument
245 eshell-current-modifiers
246 eshell-arg-listified)
247 (catch 'eshell-arg-done
251 'eshell-parse-argument-hook)
255 (if (not eshell-current-argument)
256 (setq eshell-current-argument result)
257 (unless eshell-arg-listified
258 (setq eshell-current-argument
259 (list eshell-current-argument)
260 eshell-arg-listified t))
261 (nconc eshell-current-argument (list result))))))
262 (when (and outer eshell-current-argument)
269 (eshell-resolve-current-argument)
270 eshell-current-argument))
272 (defsubst eshell-operator (&rest args)
274 (error "Unhandled operator in input text"))
276 (defsubst eshell-looking-at-backslash-return (pos)
283 (defun eshell-quote-backslash (string &optional index)
289 (if (memq char eshell-special-chars-outside-quoting)
292 (defun eshell-parse-backslash ()
297 (if (eshell-looking-at-backslash-return (point))
298 (throw 'eshell-incomplete ?\\)
300 (if eshell-current-quoted
302 eshell-special-chars-inside-quoting)
304 eshell-special-chars-outside-quoting)))
307 (list 'eshell-escape-arg
317 (if (eshell-looking-at-backslash-return (1+ (point)))
322 (defun eshell-parse-literal-quote ()
325 (let ((end (eshell-find-delimiter ?\' ?\')))
327 (throw 'eshell-incomplete ?\')
332 (list 'eshell-escape-arg string))))))
334 (defun eshell-parse-double-quote ()
337 (let* ((end (eshell-find-delimiter ?\" ?\" nil nil t))
338 (eshell-current-quoted t))
340 (throw 'eshell-incomplete ?\")
345 (let ((arg (eshell-parse-argument)))
348 (list 'eshell-escape-arg arg))))
351 (defun eshell-parse-special-reference ()
353 (if (and (not eshell-current-argument)
354 (not eshell-current-quoted)
359 (end (eshell-find-delimiter ?\< ?\>)))
361 (throw 'eshell-incomplete ?\<)
362 (if (eshell-arg-delimiter (1+ end))
369 (defun eshell-parse-delimiter ()
371 ;; this `eshell-operator' keyword gets parsed out by
372 ;; `eshell-separate-commands'. Right now the only possibility for
376 (if eshell-current-argument
377 (eshell-finish-arg)
378 (eshell-finish-arg
380 (list 'eshell-operator