Mercurial > emacs
annotate lisp/pcmpl-gnu.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:
31241
diff
changeset
|
1 ;;; pcmpl-gnu.el --- completions for GNU project tools |
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 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
31241
diff
changeset
|
23 ;;; Commentary: |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
31241
diff
changeset
|
24 |
29959 | 25 ;;; Code: |
26 | |
27 (provide 'pcmpl-gnu) | |
28 | |
29 (require 'pcomplete) | |
30 (require 'pcmpl-unix) | |
31 | |
32 (defgroup pcmpl-gnu nil | |
33 "Completions for GNU project tools." | |
34 :group 'pcomplete) | |
35 | |
36 ;; User Variables: | |
37 | |
38 (defcustom pcmpl-gnu-makefile-regexps | |
31241 | 39 '("\\`GNUmakefile" "\\`Makefile" "\\.mak\\'") |
29959 | 40 "*A list of regexps that will match Makefile names." |
41 :type '(repeat regexp) | |
42 :group 'pcmpl-gnu) | |
43 | |
44 ;; Functions: | |
45 | |
46 ;;;###autoload | |
47 (defun pcomplete/gzip () | |
48 "Completion for `gzip'." | |
49 (let ((pcomplete-help "(gzip)")) | |
50 (pcomplete-opt "cdfhlLnNqrStvV123456789") | |
51 (while (pcomplete-here | |
52 (pcmpl-gnu-zipped-files | |
53 (catch 'has-d-flag | |
54 (let ((args pcomplete-args)) | |
55 (while args | |
56 (if (string-match "\\`-.*[dt]" (car args)) | |
57 (throw 'has-d-flag t)) | |
58 (setq args (cdr args)))))))))) | |
59 | |
60 (defun pcmpl-gnu-zipped-files (unzip-p) | |
61 "Find all zipped or unzipped files: the inverse of UNZIP-P." | |
62 (pcomplete-entries | |
63 nil | |
64 (function | |
65 (lambda (entry) | |
66 (when (and (file-readable-p entry) | |
67 (file-regular-p entry)) | |
68 (let ((zipped (string-match "\\.\\(t?gz\\|\\(ta\\)?Z\\)\\'" | |
69 entry))) | |
70 (or (and unzip-p zipped) | |
71 (and (not unzip-p) (not zipped))))))))) | |
72 | |
73 ;;;###autoload | |
74 (defun pcomplete/bzip2 () | |
75 "Completion for `bzip2'." | |
76 (pcomplete-opt "hdzkftcqvLVs123456789") | |
77 (while (pcomplete-here | |
78 (pcmpl-gnu-bzipped-files | |
79 (catch 'has-d-flag | |
80 (let ((args pcomplete-args)) | |
81 (while args | |
82 (if (string-match "\\`-.*[dt]" (car args)) | |
83 (throw 'has-d-flag t)) | |
84 (setq args (cdr args))))))))) | |
85 | |
86 (defun pcmpl-gnu-bzipped-files (unzip-p) | |
87 "Find all zipped or unzipped files: the inverse of UNZIP-P." | |
88 (pcomplete-entries | |
89 nil | |
90 (function | |
91 (lambda (entry) | |
92 (when (and (file-readable-p entry) | |
93 (file-regular-p entry)) | |
94 (let ((zipped (string-match "\\.\\(t?z2\\|bz2\\)\\'" entry))) | |
95 (or (and unzip-p zipped) | |
96 (and (not unzip-p) (not zipped))))))))) | |
97 | |
98 ;;;###autoload | |
99 (defun pcomplete/make () | |
100 "Completion for GNU `make'." | |
101 (let ((pcomplete-help "(make)Top")) | |
102 (pcomplete-opt "bmC/def(pcmpl-gnu-makefile-names)hiI/j?kl?no.pqrsStvwW.") | |
103 (while (pcomplete-here (pcmpl-gnu-make-rule-names) nil 'identity)))) | |
104 | |
105 (defun pcmpl-gnu-makefile-names () | |
106 "Return a list of possible makefile names." | |
107 (let ((names (list t)) | |
108 (reg pcmpl-gnu-makefile-regexps)) | |
109 (while reg | |
110 (nconc names (pcomplete-entries (car reg))) | |
111 (setq reg (cdr reg))) | |
112 (cdr names))) | |
113 | |
114 (defun pcmpl-gnu-make-rule-names () | |
115 "Return a list of possible make rule names in MAKEFILE." | |
116 (let* ((minus-f (member "-f" pcomplete-args)) | |
31241 | 117 (makefile (or (cadr minus-f) |
118 (if (file-exists-p "GNUmakefile") | |
119 "GNUmakefile" | |
120 "Makefile"))) | |
29959 | 121 rules) |
122 (if (not (file-readable-p makefile)) | |
123 (unless minus-f (list "-f")) | |
124 (with-temp-buffer | |
125 (insert-file-contents-literally makefile) | |
126 (while (re-search-forward | |
127 (concat "^\\s-*\\([^\n#%.$][^:=\n]*\\)\\s-*:[^=]") nil t) | |
128 (setq rules (append (split-string (match-string 1)) rules)))) | |
129 (pcomplete-uniqify-list rules)))) | |
130 | |
131 (defcustom pcmpl-gnu-tarfile-regexp | |
132 "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" | |
133 "*A regexp which matches any tar archive." | |
134 :type 'regexp | |
135 :group 'pcmpl-gnu) | |
136 | |
137 (defvar pcmpl-gnu-tar-buffer nil) | |
138 | |
139 ;;;###autoload | |
140 (defun pcomplete/tar () | |
141 "Completion for the GNU tar utility." | |
142 ;; options that end in an equal sign will want further completion... | |
143 (let (saw-option complete-within) | |
144 (setq pcomplete-suffix-list (cons ?= pcomplete-suffix-list)) | |
145 (while (pcomplete-match "^-" 0) | |
146 (setq saw-option t) | |
147 (if (pcomplete-match "^--" 0) | |
148 (if (pcomplete-match "^--\\([^= \t\n\f]*\\)\\'" 0) | |
149 (pcomplete-here* | |
150 '("--absolute-names" | |
151 "--after-date=" | |
152 "--append" | |
153 "--atime-preserve" | |
154 "--backup" | |
155 "--block-number" | |
156 "--blocking-factor=" | |
157 "--catenate" | |
158 "--checkpoint" | |
159 "--compare" | |
160 "--compress" | |
161 "--concatenate" | |
162 "--confirmation" | |
163 "--create" | |
164 "--delete" | |
165 "--dereference" | |
166 "--diff" | |
167 "--directory=" | |
168 "--exclude=" | |
169 "--exclude-from=" | |
170 "--extract" | |
171 "--file=" | |
172 "--files-from=" | |
173 "--force-local" | |
174 "--get" | |
175 "--group=" | |
176 "--gzip" | |
177 "--help" | |
178 "--ignore-failed-read" | |
179 "--ignore-zeros" | |
180 "--incremental" | |
181 "--info-script=" | |
182 "--interactive" | |
183 "--keep-old-files" | |
184 "--label=" | |
185 "--list" | |
186 "--listed-incremental" | |
187 "--mode=" | |
188 "--modification-time" | |
189 "--multi-volume" | |
190 "--new-volume-script=" | |
191 "--newer=" | |
192 "--newer-mtime" | |
193 "--no-recursion" | |
194 "--null" | |
195 "--numeric-owner" | |
196 "--old-archive" | |
197 "--one-file-system" | |
198 "--owner=" | |
199 "--portability" | |
200 "--posix" | |
201 "--preserve" | |
202 "--preserve-order" | |
203 "--preserve-permissions" | |
204 "--read-full-records" | |
205 "--record-size=" | |
206 "--recursive-unlink" | |
207 "--remove-files" | |
208 "--rsh-command=" | |
209 "--same-order" | |
210 "--same-owner" | |
211 "--same-permissions" | |
212 "--sparse" | |
213 "--starting-file=" | |
214 "--suffix=" | |
215 "--tape-length=" | |
216 "--to-stdout" | |
217 "--totals" | |
218 "--uncompress" | |
219 "--ungzip" | |
220 "--unlink-first" | |
221 "--update" | |
222 "--use-compress-program=" | |
223 "--verbose" | |
224 "--verify" | |
225 "--version" | |
226 "--volno-file="))) | |
227 (pcomplete-opt "01234567ABCFGKLMNOPRSTUVWXZbcdfghiklmoprstuvwxz")) | |
228 (cond | |
229 ((pcomplete-match "\\`--after-date=" 0) | |
230 (pcomplete-here*)) | |
231 ((pcomplete-match "\\`--backup=" 0) | |
232 (pcomplete-here*)) | |
233 ((pcomplete-match "\\`--blocking-factor=" 0) | |
234 (pcomplete-here*)) | |
235 ((pcomplete-match "\\`--directory=\\(.*\\)" 0) | |
236 (pcomplete-here* (pcomplete-dirs) | |
237 (pcomplete-match-string 1 0))) | |
238 ((pcomplete-match "\\`--exclude-from=\\(.*\\)" 0) | |
239 (pcomplete-here* (pcomplete-entries) | |
240 (pcomplete-match-string 1 0))) | |
241 ((pcomplete-match "\\`--exclude=" 0) | |
242 (pcomplete-here*)) | |
243 ((pcomplete-match "\\`--\\(extract\\|list\\)\\'" 0) | |
244 (setq complete-within t)) | |
245 ((pcomplete-match "\\`--file=\\(.*\\)" 0) | |
246 (pcomplete-here* (pcomplete-dirs-or-entries pcmpl-gnu-tarfile-regexp) | |
247 (pcomplete-match-string 1 0))) | |
248 ((pcomplete-match "\\`--files-from=\\(.*\\)" 0) | |
249 (pcomplete-here* (pcomplete-entries) | |
250 (pcomplete-match-string 1 0))) | |
251 ((pcomplete-match "\\`--group=\\(.*\\)" 0) | |
252 (pcomplete-here* (pcmpl-unix-group-names) | |
253 (pcomplete-match-string 1 0))) | |
254 ((pcomplete-match "\\`--info-script=\\(.*\\)" 0) | |
255 (pcomplete-here* (pcomplete-entries) | |
256 (pcomplete-match-string 1 0))) | |
257 ((pcomplete-match "\\`--label=" 0) | |
258 (pcomplete-here*)) | |
259 ((pcomplete-match "\\`--mode=" 0) | |
260 (pcomplete-here*)) | |
261 ((pcomplete-match "\\`--new-volume-script=\\(.*\\)" 0) | |
262 (pcomplete-here* (pcomplete-entries) | |
263 (pcomplete-match-string 1 0))) | |
264 ((pcomplete-match "\\`--newer=" 0) | |
265 (pcomplete-here*)) | |
266 ((pcomplete-match "\\`--owner=\\(.*\\)" 0) | |
267 (pcomplete-here* (pcmpl-unix-user-names) | |
268 (pcomplete-match-string 1 0))) | |
269 ((pcomplete-match "\\`--record-size=" 0) | |
270 (pcomplete-here*)) | |
271 ((pcomplete-match "\\`--rsh-command=\\(.*\\)" 0) | |
272 (pcomplete-here* (funcall pcomplete-command-completion-function) | |
273 (pcomplete-match-string 1 0))) | |
274 ((pcomplete-match "\\`--starting-file=\\(.*\\)" 0) | |
275 (pcomplete-here* (pcomplete-entries) | |
276 (pcomplete-match-string 1 0))) | |
277 ((pcomplete-match "\\`--suffix=" 0) | |
278 (pcomplete-here*)) | |
279 ((pcomplete-match "\\`--tape-length=" 0) | |
280 (pcomplete-here*)) | |
281 ((pcomplete-match "\\`--use-compress-program=\\(.*\\)" 0) | |
282 (pcomplete-here* (funcall pcomplete-command-completion-function) | |
283 (pcomplete-match-string 1 0))) | |
284 ((pcomplete-match "\\`--volno-file=\\(.*\\)" 0) | |
285 (pcomplete-here* (pcomplete-entries) | |
286 (pcomplete-match-string 1 0))))) | |
287 (setq pcomplete-suffix-list (cdr pcomplete-suffix-list)) | |
288 (unless saw-option | |
289 (pcomplete-here | |
290 (mapcar 'char-to-string | |
291 (string-to-list | |
292 "01234567ABCFGIKLMNOPRSTUVWXZbcdfghiklmoprstuvwxz"))) | |
293 (if (pcomplete-match "[xt]" 'first 1) | |
294 (setq complete-within t))) | |
295 (pcomplete-here (pcomplete-dirs-or-entries pcmpl-gnu-tarfile-regexp)) | |
296 (setq pcmpl-gnu-tar-buffer (find-file-noselect (pcomplete-arg 1))) | |
297 (while (pcomplete-here | |
298 (if complete-within | |
299 (with-current-buffer pcmpl-gnu-tar-buffer | |
300 (mapcar | |
301 (function | |
302 (lambda (entry) | |
303 (tar-header-name (cdr entry)))) | |
304 tar-parse-info)) | |
305 (pcomplete-entries)) | |
306 nil 'identity)))) | |
307 | |
308 ;;;###autoload | |
309 (defalias 'pcomplete/gdb 'pcomplete/xargs) | |
310 | |
52401 | 311 ;;; arch-tag: 06d2b429-dcb1-4a57-84e1-f70d87781183 |
29959 | 312 ;;; pcmpl-gnu.el ends here |