Mercurial > emacs
annotate lisp/eshell/em-basic.el @ 76136:4aa6d6384e7d
(org-table-overlay-coordinates)
(org-table-toggle-coordinate-overlays): New functions.
(org-table-overlay-coordinates, org-table-coordinate-overlays):
New variables.
(org-startup-with-deadline-check): Option removed.
(org-mode): Remove deadline check on startup.
(org-table-limit-column-width): Option removed.
(org-table-formula-numbers-only): Option removed.
(org-link-style, org-link-format): Options removed.
(org-select-agenda-window, org-fit-agenda-window): Options
removed.
(org-export-ascii-show-new-buffer)
(org-export-html-show-new-buffer): Options removed.
(org-activate-links): Camel option removed.
(org-file-link-context-use-camel-case): Option removed.
(org-camel-regexp): Veriable removed.
(org-activate-camels): Function removed.
(org-store-link): Removed Camel stuff.
(org-make-org-heading-camel): Function removed.
(org-open-at-point): Removed camel stuff.
(org-link-search): Removed camel stuff.
(org-camel-to-words): Function removed.
(org-get-agenda-file-buffer): Make sure we prepare the
base buffers, not any indirect buffers.
(org-sort-entries): Sort top-level when not on a
headline, and no active region.
(org-in-regexp): New function.
(org-search-not-self): Renamed from `org-search-not-link'.
(org-open-link-marker): New variable.
(org-open-at-point): Set `org-open-link-marker'.
(org-print-icalendar-entries): Fixed bug with excluding DONE
entries from the exported list.
(org-edit-formula-lisp-indent): New command.
(orgtbl-to-texinfo, orgtbl-to-html): New functions.
(orgtbl-to-latex, orgtbl-insert-radio-table)
(orgtbl-toggle-comment, orgtbl-send-table): New functions.
(orgtbl-radio-table-templates): New option.
(org-store-link-props):
(org-remember-templates): More possibilities to insert
info into templates.
(org-remember-apply-template): Make use of the extended template
capabilities.
(org-remember-redo-template): New command.
(org-upgrade-old-links)
(org-table-modify-formulas, org-table-replace-in-formulas)
(org-table-find-dataline)
(org-table-get-vertical-vector): Functions removed.
(org-table-remove-rectangle-highlight)
(org-time-stamp-format, org-toggle-log-option)
(org-table-highlight-rectangle)
(org-table-iterate, org-table-make-reference):
(org-translate-time, org-tree-to-indirect-buffer)
(org-table-field-info, org-table-fix-formulas)
(org-table-force-dataline, org-table-get-descriptor-line)
(org-table-get-range)
(org-skip-comments, org-sort)
(org-sort-entries, org-sublist, org-table-add-rectangle-overlay)
(org-table-current-dline, org-table-current-field-formula)
(org-table-edit-backward-field)
(org-table-edit-formulas-post-command)
(org-table-edit-line-down, org-table-edit-line-up)
(org-agenda-archive)
(org-agenda-clock-cancel)
(org-agenda-clock-out, org-agenda-list-stuck-projects)
(org-agenda-open-link, org-agenda-show-new-time)
(org-agenda-skip-subtree-when-regexp-matches)
(org-agenda-tree-to-indirect-buffer, org-agenda-undo)
(org-at-regexp-p, org-auto-repeat-maybe, org-check-log-option)
(org-do-sort, org-file-image-p, org-find-overlays)
(org-find-row-type, org-get-indirect-buffer, org-get-repeat)
(org-highlight-until-next-command, org-isearch-end)
(org-match-any-p, org-next-link, org-previous-link):
(org-remove-subtree-entries-from-agenda, org-replace-escapes)
(org-rewrite-old-row-references)
(org-isearch-post-command)
(org-table-edit-move, org-table-edit-next-field)
(org-table-edit-scroll, org-table-edit-scroll-down)
(org-set-frame-title, org-show-reference)
(org-unhighlight-once, org-verify-change-for-undo): New
functions.
(org-show-variable): Command removed.
(org-add-log-maybe): New arguments STATE, FINDPOS
(org-table-sort-lines): Rewritten from scratch.
(org-link-search): New argument AVOID-POS.
(org-print-icalendar-entries): Argument CATEGORY removed.
(org-run-agenda-series): Argument WONDOW removed.
(org-next-link, org-previous-link): New commands.
(org-agenda-date-format): New option.
(org-table-iterate): New command.
(org-table-modify-formulas)
(org-table-replace-in-formulas): Functions removed.
(org-table-fix-formulas): New function.
(org-table-insert-column, org-table-delete-column)
(org-table-move-column): Use `org-table-fix-formulas'.
(org-follow-gnus-link): Patch from Bastien/Leo.
(org-table-current-field-formula): New function.
(org-file-image-p): New function.
(org-agenda-show-new-time): New function.
(org-agenda-date-later): Call `org-agenda-show-new-time'.
(org-with-remote-undo): New macro.
(org-agenda-undo): New command.
(org-verify-change-for-undo): New function.
(org-time-stamp-format): New function.
(org-agenda-get-timestamps): Skip scheduled if DONE and requested
by user.
(org-match-any-p): New function.
(org-make-tags-matcher): Handle regular expressions for tag and
todo matches.
(org-read-date): Accept "+N" as input for a date relative to the
current date.
(org-remove-subtree-entries-from-agenda): New function.
(org-agenda-archive, org-agenda-kill): Use
`org-remove-subtree-entries-from-agenda'.
(org-do-sort, org-sort-entries): New functions.
(org-sort): New command.
(org-table-sort-lines): Use `org-do-sort'.
(org-fix-decoded-time): New function.
(org-table-number-regexp): Require 0x... to identify as number in
tables.
(org-startup-options): New keywords for note taking.
(org-upgrade-old-links): Function removed.
(org-get-repeat): New function.
(org-show-context): Also show siblings on current level.
(org-show-siblings): New function.
(org-isearch-end, org-isearch-post-command): New functions.
(org-show-siblings): New option.
(org-show-context): Use `org-show-siblings'.
(org-table-maybe-recalculate-line): No longer require `calc-eval'
to be bound, because user may just use elisp.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Sun, 25 Feb 2007 06:39:11 +0000 |
parents | 7a3f13e2dd57 |
children | a1e8300d3c55 95d0cdf160ea |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
32526
diff
changeset
|
1 ;;; em-basic.el --- basic shell builtin commands |
29876 | 2 |
74509 | 3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, |
75346 | 4 ;; 2005, 2006, 2007 Free Software Foundation, Inc. |
29876 | 5 |
32526 | 6 ;; Author: John Wiegley <johnw@gnu.org> |
7 | |
29876 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64085 | 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 ;; Boston, MA 02110-1301, USA. | |
29876 | 24 |
25 (provide 'em-basic) | |
26 | |
27 (eval-when-compile (require 'esh-maint)) | |
28 | |
29 (defgroup eshell-basic nil | |
30 "The \"basic\" code provides a set of convenience functions which | |
31 are traditionally considered shell builtins. Since all of the | |
32 functionality provided by them is accessible through Lisp, they are | |
33 not really builtins at all, but offer a command-oriented way to do the | |
34 same thing." | |
35 :tag "Basic shell commands" | |
36 :group 'eshell-module) | |
37 | |
38 ;;; Commentary: | |
39 | |
40 ;; There are very few basic Eshell commands -- so-called builtins. | |
41 ;; They are: echo, umask, and version. | |
42 ;; | |
43 ;;;_* `echo' | |
44 ;; | |
45 ;; The `echo' command repeats its arguments to the screen. It is | |
46 ;; optional whether this is done in a Lisp-friendly fashion (so that | |
47 ;; the value of echo is useful to a Lisp command using the result of | |
48 ;; echo as an argument), or whether it should try to act like a normal | |
49 ;; shell echo, and always result in a flat string being returned. | |
50 | |
51 (defcustom eshell-plain-echo-behavior nil | |
52 "*If non-nil, `echo' tries to behave like an ordinary shell echo. | |
53 This comes at some detriment to Lisp functionality. However, the Lisp | |
54 equivalent of `echo' can always be achieved by using `identity'." | |
55 :type 'boolean | |
56 :group 'eshell-basic) | |
57 | |
58 ;;; | |
59 ;; An example of the difference is the following: | |
60 ;; | |
61 ;; echo Hello world | |
62 ;; | |
63 ;; If `eshell-plain-echo-behavior' is non-nil, this will yield the | |
64 ;; string "Hello world". If Lisp behavior is enabled, however, it | |
65 ;; will yield a list whose two elements are the strings "Hello" and | |
66 ;; "world". The way to write an equivalent expression for both would | |
67 ;; be: | |
68 ;; | |
69 ;; echo "Hello world" | |
70 ;; | |
71 ;; This always returns a single string. | |
72 ;; | |
73 ;;;_* `umask' | |
74 ;; | |
75 ;; The umask command changes the default file permissions for newly | |
76 ;; created files. It uses the same syntax as bash. | |
77 ;; | |
78 ;;;_* `version' | |
79 ;; | |
80 ;; This command reports the version number for Eshell and all its | |
81 ;; dependent module, including the date when those modules were last | |
82 ;; modified. | |
83 | |
84 ;;; Code: | |
85 | |
86 (require 'esh-opt) | |
87 | |
88 ;;; Functions: | |
89 | |
90 (defun eshell-echo (args &optional output-newline) | |
91 "Implementation code for a Lisp version of `echo'. | |
92 It returns a formatted value that should be passed to `eshell-print' | |
93 or `eshell-printn' for display." | |
94 (if eshell-plain-echo-behavior | |
95 (concat (apply 'eshell-flatten-and-stringify args) "\n") | |
96 (let ((value | |
97 (cond | |
98 ((= (length args) 0) "") | |
99 ((= (length args) 1) | |
100 (car args)) | |
101 (t | |
102 (mapcar | |
103 (function | |
104 (lambda (arg) | |
105 (if (stringp arg) | |
106 (set-text-properties 0 (length arg) nil arg)) | |
107 arg)) | |
108 args))))) | |
109 (if output-newline | |
110 (cond | |
111 ((stringp value) | |
112 (concat value "\n")) | |
113 ((listp value) | |
114 (append value (list "\n"))) | |
115 (t | |
116 (concat (eshell-stringify value) "\n"))) | |
117 value)))) | |
118 | |
119 (defun eshell/echo (&rest args) | |
120 "Implementation of `echo'. See `eshell-plain-echo-behavior'." | |
121 (eshell-eval-using-options | |
122 "echo" args | |
123 '((?n nil nil output-newline "terminate with a newline") | |
124 (?h "help" nil nil "output this help screen") | |
125 :preserve-args | |
126 :usage "[-n] [object]") | |
127 (eshell-echo args output-newline))) | |
128 | |
129 (defun eshell/printnl (&rest args) | |
130 "Print out each of the argument, separated by newlines." | |
131 (let ((elems (eshell-flatten-list args))) | |
132 (while elems | |
133 (eshell-printn (eshell-echo (list (car elems)))) | |
134 (setq elems (cdr elems))))) | |
135 | |
136 (defun eshell/listify (&rest args) | |
137 "Return the argument(s) as a single list." | |
138 (if (> (length args) 1) | |
139 args | |
140 (if (listp (car args)) | |
141 (car args) | |
142 (list (car args))))) | |
143 | |
144 (defun eshell/umask (&rest args) | |
145 "Shell-like implementation of `umask'." | |
146 (eshell-eval-using-options | |
147 "umask" args | |
148 '((?S "symbolic" nil symbolic-p "display umask symbolically") | |
149 (?h "help" nil nil "display this usage message") | |
150 :usage "[-S] [mode]") | |
151 (if (or (not args) symbolic-p) | |
152 (let ((modstr | |
153 (concat "000" | |
154 (format "%o" | |
155 (logand (lognot (default-file-modes)) | |
156 511))))) | |
157 (setq modstr (substring modstr (- (length modstr) 3))) | |
158 (when symbolic-p | |
159 (let ((mode (default-file-modes))) | |
160 (setq modstr | |
161 (format | |
162 "u=%s,g=%s,o=%s" | |
163 (concat (and (= (logand mode 64) 64) "r") | |
164 (and (= (logand mode 128) 128) "w") | |
165 (and (= (logand mode 256) 256) "x")) | |
166 (concat (and (= (logand mode 8) 8) "r") | |
167 (and (= (logand mode 16) 16) "w") | |
168 (and (= (logand mode 32) 32) "x")) | |
169 (concat (and (= (logand mode 1) 1) "r") | |
170 (and (= (logand mode 2) 2) "w") | |
171 (and (= (logand mode 4) 4) "x")))))) | |
172 (eshell-printn modstr)) | |
173 (setcar args (eshell-convert (car args))) | |
174 (if (numberp (car args)) | |
175 (set-default-file-modes | |
176 (- 511 (car (read-from-string | |
177 (concat "?\\" (number-to-string (car args))))))) | |
178 (error "setting umask symbolically is not yet implemented")) | |
179 (eshell-print | |
180 "Warning: umask changed for all new files created by Emacs.\n")) | |
181 nil)) | |
182 | |
183 (eval-when-compile | |
184 (defvar print-func)) | |
185 | |
52401 | 186 ;;; arch-tag: 385a31b1-cb95-46f0-9829-9d352ee77db8 |
29876 | 187 ;;; em-basic.el ends here |