• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/textmodes/

Lines Matching +defs:last +defs:use +defs:time

38 ;; table editor.  Org-mode supports ToDo items, deadlines, time stamps,
79 (require 'time-date)
157 "Non-nil means use alternative key bindings for S-<cursor movement>.
160 If you want to use Org-mode together with `CUA-mode', Org-mode needs to use
173 This option is only relevant at load-time of Org-mode, and must be set
196 "The ellipsis to use in the Org-mode outline.
197 When nil, just use the standard three dots. When a string, use that instead,
198 and just in Org-mode (which will then use its own display table).
215 A deadline is this string, followed by a time stamp. Should be a word,
224 A schedule is this string, followed by a time stamp. Should be a word,
314 use the command \\[org-reveal] to show more context.
345 use the command \\[org-reveal] to show more context.
373 This makes it possible to do global cycling without having to use S-TAB or
416 "Non-nil means, skip even levels and only use odd levels for the outline.
470 The highlights will automatically disappear the next time the buffer is
482 :group 'org-time
510 Valid values are ?. and ?\). To get both terminators, use t. While
523 use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
529 When this is set, checkbox statistics is updated each time you either insert
613 (defcustom org-archive-stamp-time t
614 "Non-nil means, add a time stamp to entries moved to an archive file.
615 The time stamp will be added directly after the TODO state keyword in the
616 first line, so it is probably best to use this in combinations with
635 - Minimize the number of realigns. Normally, the table is aligned each time
644 If you would like to use the optimized version in Org-mode, but the
658 "Non-nil means, use the optimized table editor version for `orgtbl-mode'.
766 "Non-nil means, tab in the last column of a table with jump over a hline.
800 "List with Calc mode settings for use in calc-eval for table formulas.
821 (defcustom org-table-formula-use-constants t
830 "Alist with constant names and values, for use in table formulas.
832 The cdr is the value as a string. For example, if you'd like to use the
837 and then use it in an equation like `$1*$c'."
891 directories of it. For other files, use an absolute path."
940 You may use normal field width specification between the % and the letter.
1028 For VM, use any of
1031 For Gnus, use any of
1034 For FILE, use any of
1038 For the calendar, use the variable `calendar-setup'.
1059 "Non-nil means, use indirect buffer to display infile links.
1138 The system \"open\" is known as a default, but we use X11 applications
1165 you can use this variable to set the application for a given file
1256 %t time stamp, date only
1257 %T time stamp with date and time
1258 %u, %U like the above, but inactive time stamps
1319 :group 'org-time)
1323 \\<org-mode-map>By default, this is '(\"TODO\" \"DONE\"). The last entry in the list is
1358 "When set, insert a (non-active) time stamp when TODO entry is marked DONE.
1363 the time stamp recording the action should be annotated with a short note.
1404 %t in the heading will be replaced by a time stamp.
1420 to repeat themselves shifted by a certain amount of time, each time an
1442 (defgroup org-time nil
1443 "Options concerning time stamps and deadlines in Org-mode."
1449 When nil, these labeled time stamps are forces into the second line of an
1451 the time stamp will always be forced into the second line."
1452 :group 'org-time
1455 (defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
1456 "Formats for `format-time-string' which are used for time stamps.
1459 (defcustom org-time-stamp-rounding-minutes 0
1460 "Number of minutes to round time stamps to upon insertion.
1461 When zero, insert the time unmodified. Useful rounding numbers
1463 When this is not zero, you can still force an exact time-stamp by using
1464 a double prefix argument to a time-stamp command like `C-c .' or `C-c !'."
1465 :group 'org-time
1469 "Non-nil means, overlay custom formats over all time stamps.
1470 The formats are defined through the variable `org-time-stamp-custom-formats'.
1473 :group 'org-time
1478 (defcustom org-time-stamp-custom-formats
1480 "Custom formats for time stamps. See `format-time-string' for the syntax.
1483 :group 'org-time
1486 (defun org-time-stamp-format (&optional long inactive)
1487 "Get the right format for a time string."
1488 (let ((f (if long (cdr org-time-stamp-formats)
1489 (car org-time-stamp-formats))))
1497 :group 'org-time
1505 :group 'org-time
1512 :group 'org-time
1535 (defcustom org-use-fast-tag-selection 'auto
1536 "Non-nil means, use fast tag selection scheme.
1578 (defcustom org-use-tag-inheritance t
1588 Because of tag inheritance (see variable `org-use-tag-inheritance'),
1603 (defvar org-last-tags-completion-table nil
1604 "The last used completion table for tags.")
1613 Such files should use a file variable to set it, for example
1628 \\[org-remove-file]. You can also use customize to edit the list.
1774 After defining this variable, you may use \\[org-agenda-list-stuck-projects]
1821 When t, all days between the first and the last date are shown.
1892 dedicated-frame Create one new frame, and re-use it each time.
1893 new-frame Make a new frame each time."
1899 (const :tag "Each time a new frame" new-frame)
1930 a format string understood by `format-time-string'.
1947 (defgroup org-agenda-time-grid nil
1948 "Options concerning the time grid in the Org-mode Agenda."
1952 (defcustom org-agenda-use-time-grid t
1953 "Non-nil means, show a time grid in the agenda schedule.
1954 A time grid is a set of lines for specific times (like every two hours between
1958 the variable `org-agenda-time-grid'."
1959 :group 'org-agenda-time-grid
1962 (defcustom org-agenda-time-grid
1967 "The settings for time grid for agenda display.
1974 require-timed show grid only if at least one item has a time specification
1976 The second item is a string which will be places behing the grid time.
1980 :group 'org-agenda-time-grid
2001 (const time-up) (const time-down)
2007 '((agenda time-up category-keep priority-down)
2015 time-up Put entries with time-of-day indications first, early first
2016 time-down Put entries with time-of-day indications first, late first
2021 tag-up Sort alphabetically by last tag, A-Z.
2022 tag-down Sort alphabetically by last tag, Z-A.
2023 priority-up Sort numerically by priority, high priority last.
2028 '(time-up category-keep priority-down)
2029 means: Pull out all entries having a specified time of day and sort them,
2030 in order to make a time schedule for the current day the first thing in the
2031 agenda listing for the day. Of the entries without a time indication, keep
2050 "Non-nil means, items without time are considered late.
2052 time like 15:30 will be considered as 99:01, i.e. later than any items which
2053 do have a time. When nil, the default time is before 0:00. You can use this
2077 %T the *last* tag of the item. Last because inherited tags come
2079 %t the time-of-day specification if one applies to the entry, in the
2091 \"%?-12t\" will result in a 12 character time field if a time of the
2093 not contain a time.
2106 - If there is a time-of-day, put it into a 12 chars wide field. If no
2107 time, don't put in an empty field, just skip it (because of '?').
2110 As another example, if you don't want the time-of-day of entries in
2111 the prefix, you could use:
2131 "Non-nil means, remove duplicate time specifications in agenda items.
2133 time-of-day specification in a headline or diary entry is extracted and
2135 \(a timestamp or -range, or just a plain time(range) specification like
2139 that the time should only be removed what it is located at the beginning of
2225 or use the +OPTION lines for a per-file setting."
2241 "The last level which is still exported as a headline.
2307 "If nil, do not export time stamps and associated keywords."
2344 When this option is turned on, you can use TeX-like syntax for sub- and
2356 Still, ambiguity is possible - so when in doubt use {} to enclose the
2430 In HTML export, this means use <th> instead of <td>.
2448 Natively means, use the HTML code generator in table.el.
2450 the table does not use row- or column-spanning). This has the
2724 body-regexp A regexp like \".\" to match a body character. Don't use
3007 (defface org-time-grid ;; font-lock-variable-name-face
3012 "Face used for time grids."
3025 "The last string in `org-todo-keywords', indicating an item is DONE.")
3031 "Matches any of the TODO state keywords except the last one.")
3058 (defvar org-deadline-time-regexp nil
3059 "Matches the DEADLINE keyword together with a time stamp.")
3060 (make-variable-buffer-local 'org-deadline-time-regexp)
3067 (defvar org-scheduled-time-regexp nil
3068 "Matches the SCHEDULED keyword together with a time stamp.")
3069 (make-variable-buffer-local 'org-scheduled-time-regexp)
3070 (defvar org-closed-time-regexp nil
3071 "Matches the CLOSED keyword together with a time stamp.")
3072 (make-variable-buffer-local 'org-closed-time-regexp)
3074 (defvar org-keyword-time-regexp nil
3075 "Matches any of the 4 keywords, together with the time stamp.")
3076 (make-variable-buffer-local 'org-keyword-time-regexp)
3077 (defvar org-keyword-time-not-clock-regexp nil
3078 "Matches any of the 3 keywords, together with the time stamp.")
3079 (make-variable-buffer-local 'org-keyword-time-not-clock-regexp)
3080 (defvar org-maybe-keyword-time-regexp nil
3082 (make-variable-buffer-local 'org-maybe-keyword-time-regexp)
3113 (defsubst org-last (list)
3114 "Return the last element of LIST."
3115 (car (last list)))
3251 org-deadline-time-regexp
3257 org-scheduled-time-regexp
3259 org-closed-time-regexp
3261 org-keyword-time-regexp
3267 org-keyword-time-not-clock-regexp
3272 org-maybe-keyword-time-regexp
3335 (defvar last-state)
3470 ;; We use a before-change function to check if a table might need
3491 time stamps, which magically appear in the diary listing of the Emacs
3504 ;; the keymap so late. Still, it is a waste to call this each time
3557 ;; Emacs 21 and XEmacs make use of the hook
3578 (let ((this-command 'org-cycle) (last-command 'org-cycle))
3590 (defun org-current-time ()
3591 "Current time, possibly rounded to `org-time-stamp-rounding-minutes'."
3592 (if (> org-time-stamp-rounding-minutes 0)
3593 (let ((r org-time-stamp-rounding-minutes)
3594 (time (decode-time)))
3595 (apply 'encode-time
3596 (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r)))))
3597 (nthcdr 2 time))))
3598 (current-time)))
3685 (cons (length (format-time-string (car org-time-stamp-formats)))
3686 (length (format-time-string (cdr org-time-stamp-formats))))
3687 "This holds the lengths of the two different time formats.")
3689 "Regular expression for fast time stamp matching.")
3691 "Regular expression for fast time stamp matching.")
3693 "Regular expression matching time strings for analysis.")
3695 "Regular expression matching time stamps, with groups.")
3697 "Regular expression matching time stamps (also [..]), with groups.")
3699 "Regular expression matching a time stamp range.")
3702 "Regular expression matching a time stamp range.")
3705 "Regular expression matching a time stamp or time stamp range.")
3708 "Regular expression matching a time stamp or time stamp range.
3709 The time stamps may be either active or inactive.")
3755 We use a macro so that the test can happen at compilation time."
3799 (org-display-custom-time (match-beginning 3) (match-end 3)))
3800 (org-display-custom-time (match-beginning 1) (match-end 1)))
4042 ;; special case: use global cycling
4058 ((and (eq last-command this-command)
4068 ((and (eq last-command this-command)
4121 ((and (eq last-command this-command)
4330 (use-global-map org-goto-map)
4332 (use-global-map gm)))))
4376 (defvar org-last-indirect-buffer nil)
4383 with this command. However, when called with a C-u prefix, the last buffer
4384 is kept so that you can work with several indirect buffers at the same time.
4404 (buffer-live-p org-last-indirect-buffer))
4405 (kill-buffer org-last-indirect-buffer))
4407 org-last-indirect-buffer ibuf)
4492 If the heading has no TODO state, or if the state is DONE, use the first
4696 'outline-get-last-sibling))
4733 This is actually only a copy of the kill, because we use the normal kill
4737 "Was the last copied subtree folded?
4783 If you want to insert the tree as is, just use \\[yank].
4785 If optional TREE is given, use this text instead of the kill ring."
4790 "The kill is not a (set of) tree(s) - please use \\[yank] to yank anyway")))
4909 Sorting can be alphabetically, numerically, and by date/time as given by
4910 the first time stamp in the entry. The command prompts for the sorting
4920 last txt what)
4976 (if (and unique (equal last (setq last (org-trim (cdr p)))))
5013 (time-to-seconds
5014 (org-time-string-to-time (match-string 0 x)))
5268 Error if not at a plain list, or if this is the last item in the list."
5277 (error "On last item"))))
5281 Error if not at a plain list, or if this is the last item in the list."
5425 (defvar org-last-indent-begin-marker (make-marker))
5426 (defvar org-last-indent-end-marker (make-marker))
5440 (if (memq last-command '(org-shiftmetaright org-shiftmetaleft))
5441 (setq beg org-last-indent-begin-marker
5442 end org-last-indent-end-marker)
5444 (setq beg (move-marker org-last-indent-begin-marker (point)))
5446 (setq end (move-marker org-last-indent-end-marker (point))))
5465 heading be marked DONE, and the current time will be added.
5559 ;; Mark the entry as done, i.e. set to last work in org-todo-keywords
5564 (when org-archive-stamp-time
5568 (org-insert-time-stamp (org-current-time) t t "(" ")"))
5736 (defvar org-table-last-highlighted-reference nil)
5909 "Marker at the beginning of the table last aligned.
5912 "Marker at the end of the table last aligned.
5914 (defvar org-table-last-alignment nil
5915 "List of flags for flushright alignment, from the last re-alignment.
5917 (defvar org-table-last-column-widths nil
5924 (defvar org-last-recalc-line nil)
5976 ;; At the same time, we remove trailing space.
6016 (concat "Clipped table field, use C-c ` to edit. Full value is:\n" (org-no-properties (copy-sequence xx))))
6039 (setq org-table-last-alignment typenums
6040 org-table-last-column-widths lengths)
6151 (num (if (> col 0) (nth (1- col) org-table-last-alignment)))
6247 non-empty field above. With argument N, use the Nth non-empty field.
6288 I.e. not on a hline or before the first or after the last column?
6395 If there are less than N fields, just go to after the last delimiter.
6694 should be in the last line to be included into the sorting.
6697 alphabetically, numerically, or by time (as given in a time stamp
7094 If at least one number looks like a time HH:MM or HH:MM:SS, all other
7233 ;; don't overwrite TBLFM, we might use text properties to store stuff
7372 Will be filled automatically during use.")
7447 (not (and (memq last-command org-recalc-commands)
7448 (equal org-last-recalc-line (org-current-line))))
7476 This function makes use of Dave Gillespie's Calc package, in my view the
7478 installed in order to use this function.
7488 edited there. This is useful in order to use \\[org-show-reference]
7493 history list, and the last used formula is offered as a default.
7532 ;; a lot of work. However, I think calc still uses most of the time.
7560 (if (and (not suppress-const) org-table-formula-use-constants)
7844 (setq org-last-recalc-line (org-current-line))
7847 (goto-line org-last-recalc-line)
7961 (use-local-map org-edit-formulas-map)
8048 (if (eq last-command this-command)
8386 "The `org-mode' table editor as a minor mode for use in other modes."
8646 "Like `self-insert-command', use overwrite-mode for whitespace in tables.
8653 (member last-command
8671 (call-interactively (key-binding (vector last-input-event))))))
8719 (org-table-last-alignment
8720 (org-remove-by-index (funcall fun org-table-last-alignment)
8722 (org-table-last-column-widths
8723 (org-remove-by-index (funcall fun org-table-last-column-widths)
8810 specify either :lfmt, or all of (:lstart :lend :sep). If you do not use
8831 everything in dollars, you could use :fmt \"$%s$\".
8908 use :fmt \"$%s$\". This may also be a property list with column
8919 org-table-last-alignment ""))
8939 this function is called. The function does *not* use `orgtbl-to-generic',
8970 everything in @kbd{}, you could use :fmt \"@kbd{%s}\".
8980 (let* ((total (float (apply '+ org-table-last-column-widths)))
8984 org-table-last-column-widths " ")))
9057 (format-time-string
9058 (car org-time-stamp-formats)
9059 (apply 'encode-time
9232 ;; Only use search option if there is some text.
9414 use M-SPC or C-q SPC to force the insertion of a space character.
9489 ;; URL-like link, normalize the use of angular brackets.
9504 ;; Check if we can/should use a relative path. If yes, simplify the link
9544 (when (and org-link-search-failed (eq this-command last-command))
9564 (when (and org-link-search-failed (eq this-command last-command))
9797 A function in this hook may also use `setq' to set the variable
9817 use a numeric or double prefix to guide the search function.
9961 (defvar org-mark-ring-last-goto nil
9964 (setq org-mark-ring nil org-mark-ring-last-goto nil) ;; in case file is reloaded
9991 (if (eq last-command this-command)
9992 (setq p (nthcdr n (or org-mark-ring-last-goto org-mark-ring)))
9994 (setq org-mark-ring-last-goto p)
10017 (setq t1 (time-to-days (org-time-string-to-time t1))
10018 t2 (time-to-days (org-time-string-to-time t2)))
10021 (org-agenda-list nil (time-to-days (org-time-string-to-time
10083 ;; use tramp to access the file
10088 ;; use ange-ftp or efs
10148 "Return the name of the current message real folder, so if you use
10187 use sequences."
10196 use sequences."
10253 ;; Use the custom search meachnism to construct and use search strings for
10292 ;; Restore the window configuration because we just use the web link
10355 ;; Remove quotes around the file name - we'll use shell-quote-argument.
10422 (defun org-remember-apply-template (&optional use-char skip-interactive)
10428 (let* ((char (or use-char
10444 (v-t (format-time-string (car org-time-stamp-formats) (org-current-time)))
10445 (v-T (format-time-string (cdr org-time-stamp-formats) (org-current-time)))
10452 org-time-was-given x prompt char time)
10461 ## To switch templates, use `\\[org-remember]'.\n\n"
10500 (setq org-time-was-given (equal (upcase char) char))
10501 (setq time (org-read-date (equal (upcase char) "U") t nil
10503 (org-insert-time-stamp time org-time-was-given
10541 file, or you can use vertical cursor motion and visibility cycling (TAB) to
10549 Or use prefix arg to specify level manually.
10588 ;; We need to add a headline: Use time and first buffer line
10590 first (concat "* " (current-time-string)
10732 If COMMAND is not given, use `org-update-dblock'."
10904 (defvar org-last-todo-state-is-todo nil
10905 "This is non-nil when the last TODO state change led to a TODO state.
10906 If the last change removed the TODO tag or switched to DONE, then
10922 With C-u prefix arg, use completion to determine the new state.
10938 (last-state (or this ""))
10964 ((eq arg 'done) (org-last org-todo-keywords))
10973 (if (eq this-command last-command)
10980 (setq org-last-todo-state-is-todo
10993 (org-add-planning-info 'closed (org-current-time)
11020 (defvar org-last-changed-timestamp)
11027 ;; last-state is dynamically scoped into this function
11035 last-state
11043 (setq re (concat "\\(" org-scheduled-time-regexp "\\)\\|\\("
11044 org-deadline-time-regexp "\\)"))
11055 (setq msg (concat msg type org-last-changed-timestamp " ")))
11080 A timestamp is also inserted - use \\[org-timestamp-up] and \\[org-timestamp-down]
11087 A timestamp is also inserted - use \\[org-timestamp-up] and \\[org-timestamp-down]
11092 (defun org-add-planning-info (what &optional time &rest remove)
11094 WHAT indicates what kind of time stamp to add. TIME indicated the time to use.
11099 (let (org-time-was-given)
11100 (when what (setq time (or time (org-read-date nil 'to-time))))
11105 (org-insert-time-stamp time org-time-was-given)
11116 (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp
11130 (re-search-forward org-scheduled-time-regexp nil t))
11132 (re-search-forward org-deadline-time-regexp nil t))
11134 (re-search-forward org-closed-time-regexp nil t)))
11146 (org-insert-time-stamp time
11147 (or org-time-was-given (eq what 'closed))
11172 "\\(\n[^\r\n]*?" org-keyword-time-not-clock-regexp
11216 (cons "%t" (format-time-string
11217 (org-time-stamp-format 'long 'inactive)
11218 (current-time)))
11348 (defvar org-remove-priority-next-time nil)
11462 (if org-use-tag-inheritance
11510 (setq org-last-tags-completion-table
11512 org-last-tags-completion-table))
11623 org-last-tags-completion-table table
11629 (if (or (eq t org-use-fast-tag-selection)
11630 (and org-use-fast-tag-selection
11665 (let (s1 s2 rtn (ctable org-last-tags-completion-table)
11909 (defvar org-last-changed-timestamp nil)
11910 (defvar org-time-was-given) ; dynamically scoped parameter
11913 (defun org-time-stamp (arg)
11914 "Prompt for a date/time and insert a time stamp.
11915 If the user specifies a time like HH:MM, or if this command is called
11916 with a prefix argument, the time stamp will contain date and time.
11918 specified by the user will be filled in from the current date/time.
11919 So if you press just return without typing anything, the time stamp
11920 will represent the current date/time. If there is already a timestamp
11923 (let (org-time-was-given time)
11926 (eq last-command 'org-time-stamp)
11927 (eq this-command 'org-time-stamp))
11929 (setq time (let ((this-command this-command))
11931 (org-insert-time-stamp time (or org-time-was-given arg)))
11933 (setq time (let ((this-command this-command))
11937 (setq org-last-changed-timestamp
11938 (org-insert-time-stamp time (or org-time-was-given arg))))
11941 (setq time (let ((this-command this-command))
11943 (org-insert-time-stamp time (or org-time-was-given arg))))))
11945 (defun org-time-stamp-inactive (&optional arg)
11946 "Insert an inactive time stamp.
11947 An inactive time stamp is enclosed in square brackets instead of angle
11950 So these are more for recording a certain time/date."
11952 (let (org-time-was-given time)
11953 (setq time (org-read-date arg 'totime))
11954 (org-insert-time-stamp time (or org-time-was-given arg) 'inactive)))
11963 (defun org-read-date (&optional with-time to-time from-string prompt)
11966 which will at least partially be understood by `parse-time-string'.
11979 but this can be configured with the variables `parse-time-months' and
11980 `parse-time-weekdays'.
11984 months. To scroll it to other months, use the keys `>' and `<'.
11989 to an internal time.
11991 insert a time. Note that when WITH-TIME is not set, you can still
11992 enter a time, and this function will inform the calling routine about
11994 used to insert the time stamp into the buffer to include the time."
11995 (require 'parse-time)
11996 (let* ((org-time-stamp-rounding-minutes
11997 (if (equal with-time '(16)) 0 org-time-stamp-rounding-minutes))
11998 (ct (org-current-time))
11999 (default-time
12000 ;; Default time is either today, or, when entering a range,
12007 'encode-time
12009 (parse-time-string (match-string 1))))
12014 (timestr (format-time-string
12015 (if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") default-time))
12027 (calendar-forward-day (- (time-to-days default-time)
12065 (use-local-map map)
12072 (use-local-map old-map))))))
12085 (string-to-number (format-time-string "%Y")))
12091 (setq tl (parse-time-string ans)
12092 year (or (nth 5 tl) (string-to-number (format-time-string "%Y" ct)))
12093 month (or (nth 4 tl) (string-to-number (format-time-string "%m" ct)))
12094 day (or (nth 3 tl) (string-to-number (format-time-string "%d" ct)))
12095 hour (or (nth 2 tl) (string-to-number (format-time-string "%H" ct)))
12096 minute (or (nth 1 tl) (string-to-number (format-time-string "%M" ct)))
12103 (setq wday1 (nth 6 (decode-time (encode-time 0 0 0 day month year))))
12106 (if (and (boundp 'org-time-was-given)
12108 (setq org-time-was-given t))
12110 (if to-time
12111 (encode-time second minute hour day month year)
12124 (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
12125 (setq org-ans2 (format-time-string "%Y-%m-%d" time))))
12135 (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
12136 (setq org-ans1 (format-time-string "%Y-%m-%d" time)))
12139 (defun org-insert-time-stamp (time &optional with-hm inactive pre post)
12141 WITH-HM means, use the stamp format that includes the time of the day.
12142 INACTIVE means use square brackets instead of angular ones, so that the
12146 The command returns the inserted time stamp."
12147 (let ((fmt (funcall (if with-hm 'cdr 'car) org-time-stamp-formats))
12151 (insert (setq stamp (format-time-string fmt time)))
12155 (defun org-toggle-time-stamp-overlays ()
12156 "Toggle the use of custom time stamp formats."
12176 (defun org-display-custom-time (beg end)
12177 "Overlay modified time stamp format over timestamp between BED and END."
12179 (org-parse-time-string (buffer-substring beg end) t)))
12182 (tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats))
12183 (time (org-fix-decoded-time t1))
12185 (format-time-string
12186 (substring tf 1 -1) (apply 'encode-time time))
12198 (defun org-translate-time (string)
12205 t1 with-hm inactive tf time str beg end)
12210 (org-parse-time-string (substring string beg end) t))
12214 org-time-stamp-custom-formats)
12215 time (org-fix-decoded-time t1)
12216 str (format-time-string
12220 (apply 'encode-time time))
12225 (defun org-fix-decoded-time (time)
12226 "Set 0 instead of nil for the first 6 elements of time.
12229 (mapcar (lambda (x) (if (< (setq n (1+ n)) 7) (or x 0) x)) time)))
12231 (defun org-days-to-time (timestamp-string)
12233 (- (time-to-days (org-time-string-to-time timestamp-string))
12234 (time-to-days (current-time))))
12237 "Is the time in TIMESTAMP-STRING close to the current date?"
12238 (and (< (org-days-to-time timestamp-string)
12249 (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
12250 (setq org-ans1 (format-time-string "%Y-%m-%d" time)))
12274 (defun org-evaluate-time-range (&optional to-buffer)
12275 "Evaluate a time range by computing the difference between start and end.
12278 If the time range is actually in a table, the result is inserted into the
12280 For time difference computation, a year is assumed to be exactly 365
12284 (org-clock-update-time-maybe)
12290 (error "Not at a time-stamp range, and none found in current line")))
12295 (time1 (org-time-string-to-time ts1))
12296 (time2 (org-time-string-to-time ts2))
12297 (t1 (time-to-seconds time1))
12298 (t2 (time-to-seconds time2))
12349 (defun org-time-string-to-time (s)
12350 (apply 'encode-time (org-parse-time-string s)))
12352 (defun org-parse-time-string (s &optional nodefault)
12353 "Parse the standard Org-mode time string.
12354 This should be a lot faster than the normal `parse-time-string'.
12355 If time is not given, defaults to 0:00. However, with optional NODEFAULT,
12386 "Increase the date in the time stamp by one day.
12395 "Decrease the date in the time stamp by one day.
12432 "Change the date in the time stamp at point.
12439 ts time time0)
12454 (setq time0 (org-parse-time-string ts))
12455 (setq time
12456 (apply 'encode-time
12477 (setq time (apply 'encode-time time0))))
12478 (setq org-last-changed-timestamp
12479 (org-insert-time-stamp time with-hm inactive))
12480 (org-clock-update-time-maybe)
12486 (org-recenter-calendar (time-to-days time)))))
12501 If there is a time stamp in the current line, go to that date.
12512 (let ((d1 (time-to-days (current-time)))
12513 (d2 (time-to-days
12514 (org-time-string-to-time (match-string 1)))))
12521 "Insert time stamp corresponding to cursor date in *Calendar* buffer.
12522 If there is already a time stamp at the cursor position, update it."
12526 ;;; The clock for measuring work time.
12529 "Marker recording the last clock-in.")
12540 (when (and (looking-at (concat "[ \t]*" org-keyword-time-regexp))
12548 (setq ts (org-insert-time-stamp (current-time) 'with-hm 'inactive))
12564 (if (and (looking-at (concat "[ \t]*" org-keyword-time-regexp))
12567 (if fail-quietly (throw 'exit nil) (error "Clock start time is gone")))
12570 (setq te (org-insert-time-stamp (current-time) 'with-hm 'inactive))
12571 (setq s (- (time-to-seconds (apply 'encode-time (org-parse-time-string te)))
12572 (time-to-seconds (apply 'encode-time (org-parse-time-string ts))))
12594 "Holds the file total time in minutes, after a call to `org-clock-sum'.")
12610 time)
12616 ;; A time
12619 ts (time-to-seconds
12620 (apply 'encode-time (org-parse-time-string ts)))
12621 te (time-to-seconds
12622 (apply 'encode-time (org-parse-time-string te)))
12632 (setq t1 0 time (aref ltimes level))
12636 (put-text-property (point) (point-at-eol) :org-clock-minutes time))))
12642 If TOTAL-ONLY is non-nil, only show the total time for the entire file
12646 (let (time h m p)
12653 (when (setq time (get-text-property p :org-clock-minutes))
12654 (org-put-clock-overlay time (funcall outline-level))))
12661 (message "Total file time: %d:%02d (%d hours and %d minutes)" h m h m)))
12666 (defun org-put-clock-overlay (time &optional level)
12668 If LEVEL is given, prefix time with a corresponding number of stars.
12671 (let* ((c 60) (h (floor (/ time 60))) (m (- time (* 60 h)))
12733 "Create a table containing a report about clocked time.
12751 (defun org-clock-update-time-maybe ()
12769 (setq s (- (time-to-seconds
12770 (apply 'encode-time (org-parse-time-string te)))
12771 (time-to-seconds
12772 (apply 'encode-time (org-parse-time-string ts))))
12780 (defun org-clock-special-range (key &optional time as-strings)
12781 "Return two times bordering a special time range.
12785 The range is determined relative to TIME. TIME defaults to the current time.
12787 returned by `current time' or `encode-time'. if AS-STRINGS is non-nil,
12789 (let* ((tm (decode-time (or time (current-time))))
12813 (t (error "No such time block %s" key)))
12814 (setq ts (encode-time s m h d month y)
12815 te (encode-time (or s1 s) (or m1 m) (or h1 h)
12817 (setq fm (cdr org-time-stamp-formats))
12819 (cons (format-time-string fm ts) (format-time-string fm te))
12827 ipos time h m p level hlc hdl maxlevel
12837 (if ts (setq ts (time-to-seconds
12838 (apply 'encode-time (org-parse-time-string ts)))))
12839 (if te (setq te (time-to-seconds
12840 (apply 'encode-time (org-parse-time-string te)))))
12845 (format-time-string (cdr org-time-stamp-formats))
12855 (insert-before-markers "|-\n|0|" "*Total file time*| "
12861 (when (setq time (get-text-property p :org-clock-minutes))
12869 h (/ time 60)
12870 m (- time (* 60 h)))
12887 (defun org-collect-clock-time-entries ()
12903 (setq beg (apply 'encode-time (org-parse-time-string beg))
12904 end (apply 'encode-time (org-parse-time-string end)))
12915 (setq closedp (re-search-forward org-closed-time-regexp next t))
12941 "Mode for time-sorted view on action items in Org-mode files.
12954 (use-local-map org-agenda-mode-map)
13022 (define-key org-agenda-mode-map "g" 'org-agenda-toggle-time-grid)
13121 ["Use Time Grid" org-agenda-toggle-time-grid
13122 :style toggle :selected org-agenda-use-time-grid :active (org-agenda-check-type nil 'agenda)])
13137 "List of undoable operations in the agenda since last refresh.")
13180 (if (not (eq this-command last-command))
13193 (let ((last-undo-buffer buf)
13218 (defvar org-agenda-last-dispatch-buffer nil)
13241 next use of \\[org-agenda]) restricted to the current file."
13255 (setq org-agenda-last-dispatch-buffer (current-buffer))
13543 Optional argument FILE means, use this file instead of the current."
13683 (defvar org-agenda-last-marker-time (time-to-seconds (current-time))
13684 "Creation time of the last agenda marker.")
13689 no longer in use."
13691 (setq org-agenda-last-marker-time (time-to-seconds (current-time)))
13698 (> (- (time-to-seconds (current-time))
13699 org-agenda-last-marker-time)
13762 "Show a time-sorted view of the entries in the current org file.
13763 Only entries with a time stamp of today or later will be listed. With
13782 (today (time-to-days (current-time)))
13824 ; (insert (format-time-string org-agenda-date-format
13825 ; (calendar-time-from-absolute d 0))
13845 inactive time stamps (those in square brackets) are included.
13850 (setq dates (list (time-to-days (current-time)))))
13854 (setq day (time-to-days (org-time-string-to-time
13862 day1 (time-to-days (org-time-string-to-time ts1))
13863 day2 (time-to-days (org-time-string-to-time ts2)))
13883 (defvar org-agenda-last-arguments nil
13907 (setq org-agenda-last-arguments (list include-all start-day ndays))
13917 (today (time-to-days (current-time)))
13995 ; (insert (format-time-string org-agenda-date-format
13996 ; (calendar-time-from-absolute d 0)) "\n")
14002 (org-agenda-add-time-grid-maybe
14025 (defvar org-last-arg nil)
14038 (let* ((today (time-to-days (current-time)))
14053 (org-set-local 'org-last-arg arg)
14056 '(org-todo-list (or current-prefix-arg org-last-arg)))
14209 (or current-prefix-arg org-last-arg))))))
14248 (setq x (org-format-agenda-item "" x "Diary" nil 'time))
14279 ;; Hook not avaiable, must use advice to make this work
14349 by the caller, because this is how the calendar works. Don't use this
14350 function from a program - use `org-agenda-get-day-entries' instead."
14470 (re-search-forward org-scheduled-time-regexp end t))
14472 (re-search-forward org-deadline-time-regexp end t)
14514 (format-time-string
14515 (car org-time-stamp-formats)
14516 (apply 'encode-time ; DATE bound by calendar
14540 ;; substring should only run to end of time stamp
14585 (format-time-string
14586 (car org-time-stamp-formats)
14587 (apply 'encode-time ; DATE bound by calendar
14603 ;; substring should only run to end of time stamp
14634 (regexp org-deadline-time-regexp)
14644 d2 (time-to-days
14645 (org-time-string-to-time (match-string 1)))
14648 ;; If the expiration is within wdays warning time.
14691 (regexp org-scheduled-time-regexp)
14701 d2 (time-to-days
14702 (org-time-string-to-time (match-string 1)))
14752 d1 (time-to-days (org-time-string-to-time s1))
14753 d2 (time-to-days (org-time-string-to-time s2)))
14783 (defconst org-plain-time-of-day-regexp
14791 "Regular expression to match a plain time or time range.
14795 1 the first time, range or not
14796 8 the second time, if it is a range.")
14798 (defconst org-stamp-time-of-day-regexp
14804 "Regular expression to match a timestamp time or time range.
14808 2 the first time, range or not
14809 4 the second time, if it is a range.")
14811 (defvar org-prefix-has-time nil
14826 time-of-day should be extracted from TXT for sorting of this entry, and for
14828 searched for a time before TXT is. NOPREFIX is a flag and indicates that
14841 time ; time and tag are needed for the eval of the prefix format
14843 (time-of-day (and dotime (org-get-time-of-day ts)))
14845 (when (and dotime time-of-day org-prefix-has-time)
14846 ;; Extract starting and ending time and move them to prefix
14847 (when (or (setq stamp (string-match org-stamp-time-of-day-regexp ts))
14848 (setq plain (string-match org-plain-time-of-day-regexp ts)))
14862 ;; Normalize the time(s) to 24 hour
14863 (if s1 (setq s1 (org-get-time-of-day s1 'string t)))
14864 (if s2 (setq s2 (org-get-time-of-day s2 'string t))))
14881 (setq time (cond (s2 (concat s1 "-" s2))
14893 'time-of-day time-of-day
14899 (defun org-agenda-add-time-grid-maybe (list ndays todayp)
14901 (cond ((not org-agenda-use-time-grid) (throw 'exit list))
14902 ((and todayp (member 'today (car org-agenda-time-grid))))
14903 ((and (= ndays 1) (member 'daily (car org-agenda-time-grid))))
14904 ((member 'weekly (car org-agenda-time-grid)))
14907 (lambda (x) (get-text-property 1 'time-of-day x))
14909 (string (nth 1 org-agenda-time-grid))
14910 (gridtimes (nth 2 org-agenda-time-grid))
14911 (req (car org-agenda-time-grid))
14913 new time)
14917 (while (setq time (pop gridtimes))
14918 (unless (and remove (member time have))
14919 (setq time (int-to-string time))
14922 (concat (substring time 0 -2) ":" (substring time -2)))
14925 1 (length (car new)) 'face 'org-time-grid (car new))))
14926 (if (member 'time-up org-agenda-sorting-strategy-selected)
14934 (setq org-prefix-has-time nil org-prefix-has-tag nil)
14946 '(("c" . category) ("t" . time) ("s" . extra)
14951 (if (equal var 'time) (setq org-prefix-has-time t))
14972 '(time-up category-keep priority-down)))))
14974 (defun org-get-time-of-day (s &optional string mod24)
14975 "Check string S for a time of day.
14976 If found, return it as a military time number between 0 and 2400.
15045 (let ((ta (car (last (get-text-property 1 'tags a))))
15046 (tb (car (last (get-text-property 1 'tags b)))))
15053 (defsubst org-cmp-time (a b)
15054 "Compare the time-of-day values of strings A and B."
15056 (ta (or (get-text-property 1 'time-of-day a) def))
15057 (tb (or (get-text-property 1 'time-of-day b) def)))
15066 (let* ((time-up (org-cmp-time a b))
15067 (time-down (if time-up (- time-up) nil))
15142 (let ((org-agenda-overriding-arguments org-agenda-last-arguments))
15155 "Go forward in time by `org-agenda-ndays' days.
15160 (list (car org-agenda-last-arguments)
15167 "Go back in time by `org-agenda-ndays' days.
15172 (list (car org-agenda-last-arguments)
15186 (list (car org-agenda-last-arguments)
15203 (list (car org-agenda-last-arguments)
15282 (defun org-agenda-toggle-time-grid ()
15283 "Toggle time grid in an agenda buffer."
15286 (setq org-agenda-use-time-grid (not org-agenda-use-time-grid))
15290 (if org-agenda-use-time-grid "on" "off")))
15300 (if org-agenda-use-time-grid " Grid" "")
15488 With a C-u prefix, make a separate frame for this tree (i.e. don't use the
15501 (defvar org-last-heading-marker (make-marker)
15502 "Marker pointing to the headline that last changed its TODO state
15532 (move-marker org-last-heading-marker (point))))
15575 (if org-last-todo-state-is-todo
15640 the tags of the current headline come last."
15655 (or org-use-tag-inheritance (error ""))
15725 (error "Cannot find time stamp"))
15727 (org-agenda-show-new-time marker org-last-changed-timestamp))
15728 (message "Time stamp changed to %s" org-last-changed-timestamp)))
15735 (defun org-agenda-show-new-time (marker stamp)
15737 ;; We use text properties to make this undoable
15762 The prefix ARG is passed to the `org-time-stamp' command and can therefore
15763 be used to request time specification in the time stamp."
15776 (error "Cannot find time stamp"))
15777 (org-time-stamp arg)
15778 (message "Time stamp changed to %s" org-last-changed-timestamp)))))
15877 (error "Don't know which date to use for diary entry"))
15900 (error "Don't know which date to use for calendar command"))
16106 (call-interactively (key-binding (vector last-input-event))))))
16115 (call-interactively (key-binding (vector last-input-event))))))
16949 (defvar org-last-level nil) ; dynamically scoped variable
16985 (date (format-time-string "%Y/%m/%d" (current-time)))
16986 (time (format-time-string "%X" (org-current-time)))
16999 (setq org-last-level 1)
17029 (if (and date time)
17030 (insert (concat (nth 2 lang-words) ": " date " " time "\n")))
17073 (setq org-last-level level))
17090 (setq line (org-translate-time line)))
17181 The copy is created in a temporary buffer and removed after use.
17186 continue to use it. The prefix arg ARG is passed through to the exporting
17388 (setq-default org-maybe-keyword-time-regexp org-maybe-keyword-time-regexp)
17425 (date (format-time-string "%Y/%m/%d" (current-time)))
17426 (time (format-time-string "%X" (org-current-time)))
17460 (setq org-last-level 1)
17503 date time author style))
17552 (if (> level org-last-level)
17554 (setq cnt (- level org-last-level))
17558 (if (< level org-last-level)
17560 (setq cnt (- org-last-level level))
17582 (setq org-last-level level))
17586 (while (> org-last-level 0)
17587 (setq org-last-level (1- org-last-level))
17650 (setq line (org-html-handle-time-stamps line))
17871 (when (and date time)
17874 date " " time "</p>\n")))
17894 "Find out which HTML converter to use and return the HTML code."
17912 ;; We can use my own converter with HTML conversions
17914 ;; Need to use the code generator in table.el, with the original text.
17945 (setq head nil) ;; head ends here, first time around
18013 This conversion does *not* use `table-generate-source' from table.el.
18070 (defun org-html-handle-time-stamps (s)
18071 "Format time stamps in string S, or remove them."
18074 (while (string-match org-maybe-keyword-time-regexp s)
18089 (org-translate-time (match-string 3 s)) 1 -1)))
18091 ;; Line break if line started and ended with time stamp stuff
18112 "Remove tags and time staps from lines going into the toc."
18116 (while (string-match org-maybe-keyword-time-regexp s)
18346 A good way to use this is to tell a desktop calenndar application to re-read
18355 (format-time-string (cdr org-time-stamp-formats) (current-time))
18429 (timezone (cadr (current-time-zone))))
18443 "Take a time string S and convert it to iCalendar format.
18445 When INC is non-nil, increase the hour by two (if time string contains
18446 a time), or the day by one (if it does not contain a time)."
18447 (let ((t1 (org-parse-time-string s 'nodefault))
18448 t2 fmt have-time time)
18450 (setq t2 t1 have-time t)
18451 (setq t2 (org-parse-time-string s)))
18455 (if have-time (setq h (+ 2 h)) (setq d (1+ d))))
18456 (setq time (encode-time s mi h d m y)))
18457 (setq fmt (if have-time ":%Y%m%dT%H%M%S" ";VALUE=DATE:%Y%m%d"))
18458 (concat keyword (format-time-string fmt time))))
18484 (last-level 1)
18507 ((> level last-level)
18510 ((< level last-level)
18511 (dotimes (- (- last-level level) 1)
18519 ((equal level last-level)
18524 (setq last-level level)
18533 (dotimes (- last-level 1)
18643 (define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding
18644 (define-key org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved
18645 (define-key org-mode-map "\C-c!" 'org-time-stamp-inactive) ; Minor-mode r.
18647 (define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range)
18680 (define-key org-mode-map "\C-c\C-x\C-t" 'org-toggle-time-stamp-overlays)
18696 "Like `self-insert-command', use overwrite-mode for whitespace in tables.
18704 (member last-command
19222 ["Timestamp" org-time-stamp t]
19223 ["Timestamp (inactive)" org-time-stamp-inactive t]
19229 ["Compute Time Range" org-evaluate-time-range t]
19233 ["Custom time format" org-toggle-time-stamp-overlays
19245 ["Record DONE time"
19494 from the other lists. Settings in the last list are the most significant
19577 ;; We want this to be just right, so use the full arsenal.
19595 "\\|[ \t]*" org-keyword-time-regexp
19602 ;; We use our own fill-paragraph function, to make sure that tables
19814 ;; So we have to use a one-time post-command-hook to do this.
19832 ;; We can use the hook
19834 ;; Hook not available, use advice