Mercurial > emacs
annotate lisp/pcmpl-rpm.el @ 92870:8f17f65dd575
* textmodes/org.el (org-ctrl-c-star): Implement a missing branch
in the decision tree.
(org-select-remember-template): Cleaned the code.
(org-prepare-dblock): Added the extra :content parameter.
(org-write-agenda): New output type ".ics" files.
(org-write-agenda): Call `org-icalendar-verify-function', both for
time stamps and for TODO entries.
(org-agenda-collect-markers, org-create-marker-find-array)
(org-check-agenda-marker-table): New functions.
(org-agenda-marker-table): New variable.
(org-export-as-html): Revert the change that killed the html
buffer. Side effects first need to be studied carefully.
(org-get-tags-at): Fix the structure of the condition-case
statement.
(org-ts-regexp0, org-repeat-re, org-display-custom-time)
(org-timestamp-change): Fix regulear expressions to swallow the
extra character for repeat-shift control.
(org-auto-repeat-maybe): Implement the new repeater mechanisms.
(org-get-legal-level): Aliased to `org-get-valid-level'.
(org-dblock-write:clocktable): Added a :link parameter, linking
headlines to their location in the Org agenda files.
(org-get-tags-at): Bugfix: prevent `org-back-to-heading' from
throwing an error when getting tags before headlines.
(org-timestamp-change, org-modify-ts-extra)
(org-ts-regexp1): Fix timestamp editing.
(org-agenda-custom-commands-local-options): New constant.
(org-agenda-custom-commands): Use
`org-agenda-custom-commands-local-options' to improve customize
type. "htmlize": Removed hack to fix face problem with htmlize,
it no longer seem necessary.
(org-follow-link-hook): New hook.
(org-agenda-custom-commands): Added "Component" as a tag for each
item in a command serie.
(org-open-at-point): Run `org-follow-link-hook'.
(org-agenda-schedule): Bugfix: don't display marker type when it
is `nil'.
(org-store-link): org-irc required.
(org-set-regexps-and-options): Parse the new logging options.
(org-extract-log-state-settings): New function.
(org-todo): Handle the new ways of recording state change stuff.
(org-local-logging): New function.
(org-columns-open-link): Fixed bug with opening link in column
view.
(org-local-logging): New function
(org-todo): Make sure that LOGGING properties are honoured.
(org-todo-keywords): Improve docstring.
(org-startup-options): Cleanup startup options.
(org-set-regexps-and-options): Process the "!" markers.
(org-todo): Respect the new logging stuff.
(org-log-note-how): New variable.
(org-add-log-maybe): New parameter HOW that defines how logging
should be done and also overrides PURPOSE. Add a docstring.
(org-add-log-note): Check if we really need to ask for a note.
(org-get-current-options): Digest the new keyword.
(org-agenda-reset-markers): Renamed from
`org-agenda-maybe-reset-markers'. FORCE argument removed.
(org-diary, org-agenda-quit, org-prepare-agenda): Call the renamed
function, without force argument.
(org-buffer-property-keys): Bind local variables s and p.
(org-make-tags-matcher): Allow "" to match an empty or
non-existent property value.
(org-export-as-html): Join unsorted lists when they directly
follow each other. Such lists may be created by headlines that
are converted to lists.
(org-nofm-to-completion): New function.
(org-export-as-html): Use :html-extension instead of
org-export-html-extension.
(org-store-link): Support for links from `rmail-summary-mode'.
(org-columns-new, org-complete, org-set-property): Set the
`include-columns' argument in the call to
`org-buffer-property-keys'.
(org-buffer-property-keys): New argument `include-columns', to
include properties expected by any of the COLUMS formats in the
current buffer.
(org-cleaned-string-for-export): Get rid of drawers first, so that
they will be removed also in the text before the first headline.
(org-clock-report): Show the clocktable when found.
(org-refile): Fix positioning bug when `org-reverse-note-order' is
nil.
(org-version): With prefix argument, insert `org-version' at
point.
(org-agenda-goto): Recenter the window after finding the target
location, to make sure the correct position will be displayed.
(org-agenda-get-deadlines): Don't scale priority with the warning
period.
(org-insert-heading): Don't break line in the middle of the line.
(org-agenda-get-deadlines): Allow `org-deadline-warning-days' to
be 0.
(org-update-checkbox-count): Revamped to deal with hierarchical
beckboxes. This was a patch from Miguel A. Figueroa-Villanueva.
(org-remove-timestamp-with-keyword): New function.
(org-schedule, org-deadline): Use
`org-remove-timestamp-with-keyword' to make sure all such time
stamps are removed.
(org-mode): Support for `align'.
(org-agenda-get-deadlines): Make sure priorities increase as the
due date approaches and is passed.
(org-remember-apply-template): Fixed problem with tags that
contain "_" or "@".
(org-make-link-regexps): Improve the regular expression for plain
links.
(org-agenda-get-closed): List each clocking entry.
(org-set-tags): Only tabify before tags if indent-tabs-mode is t.
(org-special-ctrl-k): New option.
(org-kill-line): New function.
(org-archive-all-done): Fixed incorrect number of stars in regexp.
(org-refile-get-location): New function.
(org-refile-goto-last-stored): New function.
(org-global-tags-completion-table): Add the value of org-tag-alist
in each buffer, to make sure that also unused tags will be
available for completion.
(org-columns-edit-value)
(org-columns-next-allowed-value): Only update if not in agenda.
(org-clocktable-steps): New function.
(org-dblock-write:clocktable): Call `org-clocktable-steps'.
(org-archive-subtree): Add the outline tree context as a property.
(org-closest-date): New optional argument `prefer'.
(org-goto-auto-isearch): New option.
(org-goto-map, org-get-location): Implement auto-isearch.
(org-goto-local-auto-isearch-map): New variable.
(org-goto-local-search-forward-headings)
(org-goto-local-auto-isearch): New functions
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Thu, 13 Mar 2008 08:54:11 +0000 |
parents | 73661ddc7ac7 |
children | 606f2d163a64 1e3a407766b9 |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
29959
diff
changeset
|
1 ;;; pcmpl-rpm.el --- functions for dealing with rpm completions |
29959 | 2 |
74442 | 3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, |
79721 | 4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
29959 | 5 |
6 ;; This file is part of GNU Emacs. | |
7 | |
8 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
9 ;; it under the terms of the GNU General Public License as published by | |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
10 ;; the Free Software Foundation; either version 3, or (at your option) |
29959 | 11 ;; any later version. |
12 | |
13 ;; GNU Emacs is distributed in the hope that it will be useful, | |
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 ;; GNU General Public License for more details. | |
17 | |
18 ;; You should have received a copy of the GNU General Public License | |
19 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64091 | 20 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 ;; Boston, MA 02110-1301, USA. | |
29959 | 22 |
23 ;;; Commentary: | |
24 | |
25 ;; These functions provide completion rules for RedHat's `rpm' tool. | |
26 | |
27 ;;; Code: | |
28 | |
29 (provide 'pcmpl-rpm) | |
30 | |
31 (require 'pcomplete) | |
32 | |
33 (defgroup pcmpl-rpm nil | |
64017
660d78f5be5a
(pcmpl-rpm): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents:
52401
diff
changeset
|
34 "Functions for dealing with CVS completions." |
29959 | 35 :group 'pcomplete) |
36 | |
37 ;; Functions: | |
38 | |
39 (defsubst pcmpl-rpm-packages () | |
40 (split-string (pcomplete-process-result "rpm" "-q" "-a"))) | |
41 | |
42 (defun pcmpl-rpm-all-query (flag) | |
43 (message "Querying all packages with `%s'..." flag) | |
44 (let ((pkgs (pcmpl-rpm-packages)) | |
45 (provs (list t))) | |
46 (while pkgs | |
47 (nconc provs (split-string | |
48 (pcomplete-process-result | |
49 "rpm" "-q" (car pkgs) flag))) | |
50 (setq pkgs (cdr pkgs))) | |
51 (pcomplete-uniqify-list (cdr provs)))) | |
52 | |
53 (defsubst pcmpl-rpm-files () | |
54 (pcomplete-dirs-or-entries "\\.rpm\\'")) | |
55 | |
56 ;;;###autoload | |
57 (defun pcomplete/rpm () | |
58 "Completion for RedHat's `rpm' command. | |
59 These rules were taken from the output of `rpm --help' on a RedHat 6.1 | |
60 system. They follow my interpretation of what followed, but since I'm | |
61 not a major rpm user/builder, please send me any corrections you find. | |
62 You can use \\[eshell-report-bug] to do so." | |
63 (let (mode) | |
64 (while (<= pcomplete-index pcomplete-last) | |
65 (unless mode | |
66 (if (pcomplete-match "^--\\(.*\\)" 0) | |
67 (pcomplete-here* | |
68 '("--addsign" | |
69 "--checksig" | |
70 "--erase" | |
71 "--help" | |
72 "--initdb" | |
73 "--install" | |
74 "--pipe" | |
75 "--querytags" | |
76 "--rebuild" | |
77 "--rebuilddb" | |
78 "--recompile" | |
79 "--resign" | |
80 "--rmsource" | |
81 "--setperms" | |
82 "--setugids" | |
83 "--upgrade" | |
84 "--verify" | |
85 "--version")) | |
86 (pcomplete-opt "vqVyiUebtK"))) | |
87 ; -b<stage> <spec> | |
88 ; -t<stage> <tarball> - build package, where <stage> is one of: | |
89 ; p - prep (unpack sources and apply patches) | |
90 ; l - list check (do some cursory checks on %files) | |
91 ; c - compile (prep and compile) | |
92 ; i - install (prep, compile, install) | |
93 ; b - binary package (prep, compile, install, package) | |
94 ; a - bin/src package (prep, compile, install, package) | |
95 (cond | |
96 ((or (eq mode 'query) | |
97 (pcomplete-match "-[^-]*q")) | |
98 (setq mode 'query) | |
99 (if (pcomplete-match "^--\\(.*\\)" 0) | |
100 (progn | |
101 (pcomplete-here* | |
102 '("--changelog" | |
103 "--dbpath" | |
104 "--dump" | |
105 "--ftpport" ;nyi for the next four | |
106 "--ftpproxy" | |
107 "--httpport" | |
108 "--httpproxy" | |
109 "--provides" | |
110 "--queryformat" | |
111 "--rcfile" | |
112 "--requires" | |
113 "--root" | |
114 "--scripts" | |
115 "--triggeredby" | |
116 "--whatprovides" | |
117 "--whatrequires")) | |
118 (cond | |
119 ((pcomplete-test "--dbpath") | |
120 (pcomplete-here* (pcomplete-dirs))) | |
121 ((pcomplete-test "--queryformat") | |
122 (pcomplete-here*)) | |
123 ((pcomplete-test "--rcfile") | |
124 (pcomplete-here* (pcomplete-entries))) | |
125 ((pcomplete-test "--root") | |
126 (pcomplete-here* (pcomplete-dirs))) | |
127 ((pcomplete-test "--scripts") | |
128 (if (pcomplete-match "^--\\(.*\\)" 0) | |
129 (pcomplete-here* '("--triggers")))) | |
130 ((pcomplete-test "--triggeredby") | |
131 (pcomplete-here* (pcmpl-rpm-packages))) | |
132 ((pcomplete-test "--whatprovides") | |
133 (pcomplete-here* | |
134 (pcmpl-rpm-all-query "--provides"))) | |
135 ((pcomplete-test "--whatrequires") | |
136 (pcomplete-here* | |
137 (pcmpl-rpm-all-query "--requires"))))) | |
138 (if (pcomplete-match "^-" 0) | |
139 (pcomplete-opt "af.p(pcmpl-rpm-files)ilsdcvR") | |
140 (pcomplete-here (pcmpl-rpm-packages))))) | |
141 ((pcomplete-test "--pipe") | |
142 (pcomplete-here* (funcall pcomplete-command-completion-function))) | |
143 ((pcomplete-test "--rmsource") | |
144 (pcomplete-here* (pcomplete-entries)) | |
145 (throw 'pcomplete-completions nil)) | |
146 ((pcomplete-match "\\`--re\\(build\\|compile\\)\\'") | |
147 (pcomplete-here (pcmpl-rpm-files)) | |
148 (throw 'pcomplete-completions nil)) | |
149 ((pcomplete-match "\\`--\\(resign\\|addsign\\)\\'") | |
150 (while (pcomplete-here (pcmpl-rpm-files)))) | |
151 ((or (eq mode 'checksig) | |
152 (pcomplete-test "--checksig")) | |
153 (setq mode 'checksig) | |
154 (if (pcomplete-match "^--\\(.*\\)" 0) | |
155 (progn | |
156 (pcomplete-here* | |
157 '("--nopgp" | |
158 "--nogpg" | |
159 "--nomd5" | |
160 "--rcfile")) | |
161 (cond | |
162 ((pcomplete-test "--rcfile") | |
163 (pcomplete-here* (pcomplete-entries))))) | |
164 (if (pcomplete-match "^-" 0) | |
165 (pcomplete-opt "v") | |
166 (pcomplete-here (pcmpl-rpm-files))))) | |
167 ((or (eq mode 'rebuilddb) | |
168 (pcomplete-test "--rebuilddb")) | |
169 (setq mode 'rebuilddb) | |
170 (if (pcomplete-match "^--\\(.*\\)" 0) | |
171 (progn | |
172 (pcomplete-here* | |
173 '("--dbpath" | |
174 "--root" | |
175 "--rcfile")) | |
176 (cond | |
177 ((pcomplete-test "--dbpath") | |
178 (pcomplete-here* (pcomplete-dirs))) | |
179 ((pcomplete-test "--root") | |
180 (pcomplete-here* (pcomplete-dirs))) | |
181 ((pcomplete-test "--rcfile") | |
182 (pcomplete-here* (pcomplete-entries))))) | |
183 (if (pcomplete-match "^-" 0) | |
184 (pcomplete-opt "v") | |
185 (pcomplete-here)))) | |
186 ((memq mode '(install upgrade)) | |
187 (if (pcomplete-match "^--\\(.*\\)" 0) | |
188 (progn | |
189 (pcomplete-here* | |
190 (append | |
191 '("--allfiles" | |
192 "--badreloc" | |
193 "--dbpath" | |
194 "--excludedocs" | |
195 "--excludepath" | |
196 "--force" | |
197 "--hash" | |
198 "--ignorearch" | |
199 "--ignoreos" | |
200 "--ignoresize" | |
201 "--includedocs" | |
202 "--justdb" | |
203 "--nodeps" | |
204 "--noorder" | |
205 "--noscripts" | |
206 "--notriggers") | |
207 (if (eq mode 'upgrade) | |
208 '("--oldpackage")) | |
209 '("--percent" | |
210 "--prefix" | |
211 "--rcfile" | |
212 "--relocate" | |
213 "--replacefiles" | |
214 "--replacepkgs" | |
215 "--root"))) | |
216 (cond | |
217 ((pcomplete-test "--dbpath") | |
218 (pcomplete-here* (pcomplete-dirs))) | |
219 ((pcomplete-test "--relocate") | |
220 (pcomplete-here*)) | |
221 ((pcomplete-test "--rcfile") | |
222 (pcomplete-here* (pcomplete-entries))) | |
223 ((pcomplete-test "--excludepath") | |
224 (pcomplete-here* (pcomplete-entries))) | |
225 ((pcomplete-test "--root") | |
226 (pcomplete-here* (pcomplete-dirs))) | |
227 ((pcomplete-test "--prefix") | |
228 (pcomplete-here* (pcomplete-dirs))))) | |
229 (if (pcomplete-match "^-" 0) | |
230 (pcomplete-opt "vh") | |
231 (pcomplete-here (pcmpl-rpm-files))))) | |
232 ((or (pcomplete-test "--install") | |
233 (pcomplete-match "-[^-]*i")) | |
234 (setq mode 'install)) | |
235 ((or (pcomplete-test "--upgrade") | |
236 (pcomplete-match "-[^-]*U")) | |
237 (setq mode 'upgrade)) | |
238 ((or (eq mode 'erase) | |
239 (pcomplete-test "--erase") | |
240 (pcomplete-match "-[^-]*e")) | |
241 (setq mode 'erase) | |
242 (if (pcomplete-match "^--\\(.*\\)" 0) | |
243 (progn | |
244 (pcomplete-here* | |
245 '("--allmatches" | |
246 "--dbpath" | |
247 "--justdb" | |
248 "--nodeps" | |
249 "--noorder" | |
250 "--noscripts" | |
251 "--notriggers" | |
252 "--rcfile" | |
253 "--root")) | |
254 (cond | |
255 ((pcomplete-test "--dbpath") | |
256 (pcomplete-here* (pcomplete-dirs))) | |
257 ((pcomplete-test "--rcfile") | |
258 (pcomplete-here* (pcomplete-entries))) | |
259 ((pcomplete-test "--root") | |
260 (pcomplete-here* (pcomplete-dirs))))) | |
261 (if (pcomplete-match "^-" 0) | |
262 (pcomplete-opt "v") | |
263 (pcomplete-here (pcmpl-rpm-packages))))) | |
264 ((or (eq mode 'verify) | |
265 (pcomplete-test "--verify")) | |
266 (setq mode 'verify) | |
267 (if (pcomplete-match "^--\\(.*\\)" 0) | |
268 (progn | |
269 (pcomplete-here* | |
270 '("--dbpath" | |
271 "--nodeps" | |
272 "--nofiles" | |
273 "--nomd5" | |
274 "--rcfile" | |
275 "--root" | |
276 "--triggeredby" | |
277 "--whatprovides" | |
278 "--whatrequires")) | |
279 (cond | |
280 ((pcomplete-test "--dbpath") | |
281 (pcomplete-here* (pcomplete-dirs))) | |
282 ((pcomplete-test "--rcfile") | |
283 (pcomplete-here* (pcomplete-entries))) | |
284 ((pcomplete-test "--root") | |
285 (pcomplete-here* (pcomplete-dirs))) | |
286 ((pcomplete-test "--triggeredby") | |
287 (pcomplete-here* (pcmpl-rpm-packages))) | |
288 ((pcomplete-test "--whatprovides") | |
289 (pcomplete-here* | |
290 (pcmpl-rpm-all-query "--provides"))) | |
291 ((pcomplete-test "--whatrequires") | |
292 (pcomplete-here* | |
293 (pcmpl-rpm-all-query "--requires"))))) | |
294 (if (pcomplete-match "^-" 0) | |
295 (pcomplete-opt "af.p(pcmpl-rpm-files)v") | |
296 (pcomplete-here (pcmpl-rpm-packages))))) | |
297 ((or (memq mode '(build test)) | |
298 (pcomplete-match "\\`-[bt]")) | |
299 (setq mode (if (pcomplete-match "\\`-b") | |
300 'build | |
301 'test)) | |
302 (if (pcomplete-match "^--\\(.*\\)" 0) | |
303 (progn | |
304 (pcomplete-here* | |
305 '("--buildroot" | |
306 "--clean" | |
307 "--nobuild" | |
308 "--rcfile" | |
309 "--rmsource" | |
310 "--short-circuit" | |
311 "--sign" | |
312 "--target" | |
313 "--timecheck")) | |
314 (cond | |
315 ((pcomplete-test "--buildroot") | |
316 (pcomplete-here* (pcomplete-dirs))) | |
317 ((pcomplete-test "--rcfile") | |
318 (pcomplete-here* (pcomplete-entries))) | |
319 ((pcomplete-test "--timecheck") | |
320 (pcomplete-here*)))) | |
321 (if (pcomplete-match "^-" 0) | |
322 (pcomplete-opt "v") | |
323 (pcomplete-here | |
324 (if (eq mode 'test) | |
325 (pcomplete-dirs-or-entries "\\.tar\\'") | |
326 (pcomplete-dirs-or-entries "\\.spec\\'")))))) | |
327 (t | |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
29959
diff
changeset
|
328 (error "You must select a mode: -q, -i, -U, --verify, etc")))))) |
29959 | 329 |
52401 | 330 ;;; arch-tag: 4e64b490-fecf-430e-b2b9-70a8ad64b8c1 |
29959 | 331 ;;; pcmpl-rpm.el ends here |