Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
2021a200
Commit
2021a200
authored
Nov 22, 2013
by
Leo Liu
Browse files
* pcmpl-x.el (pcmpl-x-ag-options): Handle `[no]' in long options.
parent
b6ffa04a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
lisp/ChangeLog
lisp/ChangeLog
+3
-2
lisp/pcmpl-x.el
lisp/pcmpl-x.el
+13
-6
No files found.
lisp/ChangeLog
View file @
2021a200
2013-11-21 Leo Liu <sdl.web@gmail.com>
Add completion for command `ag'.
* pcmpl-x.el (pcomplete/ag, pcmpl-x-ag-options): New functions.
(pcmpl-x-ag-options): New variable.
* pcmpl-x.el (pcmpl-x-ag-options): New variable.
(pcomplete/ag): New function.
(pcmpl-x-ag-options): New function. Handle `[no]' in long options.
2013-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
...
...
lisp/pcmpl-x.el
View file @
2021a200
...
...
@@ -257,16 +257,23 @@ long options."
(
setq
pcmpl-x-ag-options
(
with-temp-buffer
(
when
(
zerop
(
call-process
"ag"
nil
t
nil
"--help"
))
(
let
(
s
o
lo
)
(
let
(
s
hort
lo
ng
)
(
goto-char
(
point-min
))
(
while
(
re-search-forward
"^ +\\(-[a-zA-Z]\\) "
nil
t
)
(
push
(
match-string
1
)
s
o
))
(
push
(
match-string
1
)
s
hort
))
(
goto-char
(
point-min
))
(
while
(
re-search-forward
"^ +\\(?:-[a-zA-Z] \\)?\\(--[^ \t\n]+\\) "
nil
t
)
(
push
(
match-string
1
)
lo
))
(
list
(
cons
'short
(
nreverse
so
))
(
cons
'long
(
nreverse
lo
)))))))))
"^ +\\(?:-[a-zA-Z] \\)?\\(--\\(\\[no\\]\\)?[^ \t\n]+\\) "
nil
t
)
(
if
(
match-string
2
)
(
progn
(
replace-match
""
nil
nil
nil
2
)
(
push
(
match-string
1
)
long
)
(
replace-match
"no"
nil
nil
nil
2
)
(
push
(
match-string
1
)
long
))
(
push
(
match-string
1
)
long
)))
(
list
(
cons
'short
(
nreverse
short
))
(
cons
'long
(
nreverse
long
)))))))))
;;;###autoload
(
defun
pcomplete/ag
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment