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

Lines Matching +refs:tramp +refs:time +refs:diff

38 ;; table editor.  Org-mode supports ToDo items, deadlines, time stamps,
79 (require 'time-date)
173 This option is only relevant at load-time of Org-mode, and must be set
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,
470 The highlights will automatically disappear the next time the buffer is
482 :group 'org-time
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
635 - Minimize the number of realigns. Normally, the table is aligned each time
1171 `remote' Matches a remote file, accessible through tramp or efs.
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)
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
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
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
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
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
2307 "If nil, do not export time stamps and associated keywords."
3007 (defface org-time-grid ;; font-lock-variable-name-face
3012 "Face used for time grids."
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)
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
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
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)))
4384 is kept so that you can work with several indirect buffers at the same time.
4577 (diff (abs (- level (length up-head)))))
4582 (if org-adapt-indentation (org-fixup-indentation (- diff)))))
4591 (diff (abs (- level (length down-head)))))
4595 (if org-adapt-indentation (org-fixup-indentation diff))))
4624 (defun org-fixup-indentation (diff)
4631 (prohibit (if (> diff 0)
4633 (concat "^ \\{0," (int-to-string (- diff)) "\\}\\S-")))
4639 (if (< diff 0) (replace-match ""))
4640 (indent-to (+ diff col))))
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
5013 (time-to-seconds
5014 (org-time-string-to-time (match-string 0 x)))
5465 heading be marked DONE, and the current time will be added.
5564 (when org-archive-stamp-time
5568 (org-insert-time-stamp (org-current-time) t t "(" ")"))
5976 ;; At the same time, we remove trailing space.
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
7101 (let (col (org-timecnt 0) diff h m s org-table-clip)
7129 (setq diff (* 3600 res)
7130 h (floor (/ diff 3600)) diff (mod diff 3600)
7131 m (floor (/ diff 60)) diff (mod diff 60)
7132 s diff)
7532 ;; a lot of work. However, I think calc still uses most of the time.
9057 (format-time-string
9058 (car org-time-stamp-formats)
9059 (apply 'encode-time
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
10077 ;; ange-ftp or efs or tramp access
10082 ((featurep 'tramp)
10083 ;; use tramp to access the file
10396 ((fboundp 'tramp-handle-file-remote-p)
10397 (tramp-handle-file-remote-p file))
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)
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
10588 ;; We need to add a headline: Use time and first buffer line
10590 first (concat "* " (current-time-string)
10993 (org-add-planning-info 'closed (org-current-time)
11043 (setq re (concat "\\(" org-scheduled-time-regexp "\\)\\|\\("
11044 org-deadline-time-regexp "\\)"))
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)
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))
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'.
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)
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.
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))
12299 (diff (abs (- t2 t1)))
12311 (setq ; y (floor (/ diff ys)) diff (mod diff ys)
12313 d (floor (/ diff ds)) diff (mod diff ds)
12314 h (floor (/ diff hs)) diff (mod diff hs)
12315 m (floor (/ diff 60)))
12316 (setq ; y (floor (/ diff ys)) diff (mod diff ys)
12318 d (floor (+ (/ diff ds) 0.5))
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))))
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.
12504 (let ((tsr org-ts-regexp) diff
12512 (let ((d1 (time-to-days (current-time)))
12513 (d2 (time-to-days
12514 (org-time-string-to-time (match-string 1)))))
12515 (setq diff (- d2 d1))))
12518 (if (and diff (not arg)) (calendar-forward-day diff))))
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.
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))))
12793 s1 m1 h1 d1 month1 y1 diff ts te fm)
12800 (setq diff (if (= dow 0) 6 (1- dow))
12801 m 0 h 0 d (- d diff) d1 (+ 7 d)))
12803 (setq diff (+ 7 (if (= dow 0) 6 (1- dow)))
12804 m 0 h 0 d (- d diff) d1 (+ 7 d)))
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.
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)])
13683 (defvar org-agenda-last-marker-time (time-to-seconds (current-time))
13684 "Creation time of the last agenda marker.")
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)))
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
14038 (let* ((today (time-to-days (current-time)))
14248 (setq x (org-format-agenda-item "" x "Diary" nil 'time))
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)
14637 d2 diff pos pos1 category tags
14644 d2 (time-to-days
14645 (org-time-string-to-time (match-string 1)))
14646 diff (- d2 d1))
14648 ;; If the expiration is within wdays warning time.
14650 (if (and (< diff wdays) todayp (not (= diff 0)))
14665 (format "In %3d d.: " diff) head category tags))))
14668 (setq face (cond ((<= diff 0) 'org-warning)
14669 ((<= diff 5) 'org-upcoming-deadline)
14674 'priority (+ (- 10 diff) (org-get-priority txt))
14691 (regexp org-scheduled-time-regexp)
14694 d2 diff pos pos1 category tags
14701 d2 (time-to-days
14702 (org-time-string-to-time (match-string 1)))
14703 diff (- d2 d1))
14706 (if (and (< diff 0) todayp)
14720 (format "Sched.%2dx: " (- 1 diff)) head
14727 'priority (+ (- 5 diff) (org-get-priority txt))
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.
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))
15155 "Go forward in time by `org-agenda-ndays' days.
15167 "Go back in time by `org-agenda-ndays' days.
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" "")
15725 (error "Cannot find time stamp"))
15727 (org-agenda-show-new-time marker org-last-changed-timestamp))
15735 (defun org-agenda-show-new-time (marker stamp)
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)
16985 (date (format-time-string "%Y/%m/%d" (current-time)))
16986 (time (format-time-string "%X" (org-current-time)))
17029 (if (and date time)
17030 (insert (concat (nth 2 lang-words) ": " date " " time "\n")))
17090 (setq line (org-translate-time line)))
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)))
17503 date time author style))
17650 (setq line (org-html-handle-time-stamps line))
17871 (when (and date time)
17874 date " " time "</p>\n")))
17945 (setq head nil) ;; head ends here, first time around
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)
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))))
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)
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"
19595 "\\|[ \t]*" org-keyword-time-regexp
19814 ;; So we have to use a one-time post-command-hook to do this.