]> code.delx.au - gnu-emacs/blobdiff - lisp/org/org-agenda.el
Simplify now that float-time etc. are built-in
[gnu-emacs] / lisp / org / org-agenda.el
index 3a87f6bedbdec886a30a4cd157ca721ed419021f..fd5253ab1b7f8fc08eda3bf721cc973bd95b94e6 100644 (file)
@@ -1,6 +1,6 @@
 ;;; org-agenda.el --- Dynamic task and appointment lists for Org
 
-;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2016 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -497,7 +497,7 @@ are prefix commands.  For the dispatcher to display useful information, you
 should provide a description for the prefix, like
 
  (setq org-agenda-custom-commands
-   '((\"h\" . \"HOME + Name tag searches\") ; describe prefix \"h\"
+   \\='((\"h\" . \"HOME + Name tag searches\") ; describe prefix \"h\"
      (\"hl\" tags \"+HOME+Lisa\")
      (\"hp\" tags \"+HOME+Peter\")
      (\"hk\" tags \"+HOME+Kim\")))"
@@ -1211,7 +1211,7 @@ For example, 9:30am would become 09:30 rather than  9:30."
   :type 'boolean)
 
 (defun org-agenda-time-of-day-to-ampm (time)
-  "Convert TIME of a string like ‘13:45’ to an AM/PM style time string."
+  "Convert TIME of a string like `13:45' to an AM/PM style time string."
   (let* ((hour-number (string-to-number (substring time 0 -3)))
          (minute (substring time -2))
          (ampm "am"))
@@ -1932,7 +1932,7 @@ list as second element:
 For example, to display a 16px horizontal space for Emacs
 category, you can use:
 
-  (\"Emacs\" '(space . (:width (16))))"
+  (\"Emacs\" \\='(space . (:width (16))))"
   :group 'org-agenda-line-format
   :version "24.1"
   :type '(alist :key-type (string :tag "Regexp matching category")
@@ -1975,7 +1975,7 @@ estimate."
   :type 'boolean)
 
 (defcustom org-agenda-auto-exclude-function nil
-  "A function called with a tag to decide if it is filtered on ‘/ RET’.
+  "A function called with a tag to decide if it is filtered on `/ RET'.
 The sole argument to the function, which is called once for each
 possible tag, is a string giving the name of the tag.  The
 function should return either nil if the tag should be included
@@ -2538,7 +2538,7 @@ For example, if you have a custom agenda command \"p\" and you
 want this command to be accessible only from plain text files,
 use this:
 
-   '((\"p\" ((in-file . \"\\.txt\"))))
+   \\='((\"p\" ((in-file . \"\\.txt\"))))
 
 Here are the available contexts definitions:
 
@@ -2556,7 +2556,7 @@ accessible if there is at least one valid check.
 You can also bind a key to another agenda custom command
 depending on contextual rules.
 
-    '((\"p\" \"q\" ((in-file . \"\\.txt\"))))
+    \\='((\"p\" \"q\" ((in-file . \"\\.txt\"))))
 
 Here it means: in .txt files, use \"p\" as the key for the
 agenda command otherwise associated with \"q\".  (The command
@@ -3625,9 +3625,9 @@ FILTER-ALIST is an alist of filters we need to apply when
          ;; Popup existing buffer
          (org-agenda-prepare-window (get-buffer org-agenda-buffer-name)
                                     filter-alist)
-         (message "Sticky Agenda buffer, use ‘r’ to refresh")
+         (message "Sticky Agenda buffer, use `r' to refresh")
          (or org-agenda-multi (org-agenda-fit-window-to-buffer))
-         (throw 'exit "Sticky Agenda buffer, use ‘r’ to refresh"))
+         (throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
       (setq org-todo-keywords-for-agenda nil)
       (setq org-drawers-for-agenda nil)
       (put 'org-agenda-tag-filter :preset-filter
@@ -3903,7 +3903,7 @@ functions do."
 
 (defvar org-agenda-markers nil
   "List of all currently active markers created by `org-agenda'.")
-(defvar org-agenda-last-marker-time (org-float-time)
+(defvar org-agenda-last-marker-time (float-time)
   "Creation time of the last agenda marker.")
 
 (defun org-agenda-new-marker (&optional pos)
@@ -3911,7 +3911,7 @@ functions do."
 Org-mode keeps a list of these markers and resets them when they are
 no longer in use."
   (let ((m (copy-marker (or pos (point)))))
-    (setq org-agenda-last-marker-time (org-float-time))
+    (setq org-agenda-last-marker-time (float-time))
     (if org-agenda-buffer
        (with-current-buffer org-agenda-buffer
          (push m org-agenda-markers))
@@ -4603,7 +4603,8 @@ in `org-agenda-text-search-extra-files'."
                                             (goto-char (1- end))
                                             (throw :skip t)))
                              (if todo-only
-                                 (cons (concat "^\*+[ \t]+" org-not-done-regexp)
+                                 (cons (concat "^\\*+[ \t]+"
+                                                org-not-done-regexp)
                                        regexps+)
                                regexps+))
                        (goto-char beg)
@@ -5230,7 +5231,7 @@ So the example above may also be written as
 The function expects the lisp variables `entry' and `date' to be provided
 by the caller, because this is how the calendar works.  Don't use this
 function from a program - use `org-agenda-get-day-entries' instead."
-  (when (> (- (org-float-time)
+  (when (> (- (float-time)
              org-agenda-last-marker-time)
           5)
     ;; I am not sure if this works with sticky agendas, because the marker
@@ -5242,7 +5243,7 @@ function from a program - use `org-agenda-get-day-entries' instead."
   (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
                    (list entry)
                  (org-agenda-files t)))
-        (time (org-float-time))
+        (time (float-time))
         file rtn results)
     (when (or (not org-diary-last-run-time)
              (> (- time
@@ -5911,9 +5912,9 @@ See also the user option `org-agenda-clock-consistency-checks'."
              (throw 'next t))
            (setq ts (match-string 1)
                  te (match-string 3)
-                 ts (org-float-time
+                 ts (float-time
                      (apply 'encode-time (org-parse-time-string ts)))
-                 te (org-float-time
+                 te (float-time
                      (apply 'encode-time (org-parse-time-string te)))
                  dt (- te ts))))
        (cond
@@ -7084,8 +7085,8 @@ their type."
 ;;;###autoload
 (defun org-agenda-set-restriction-lock (&optional type)
   "Set restriction lock for agenda, to current subtree or file.
-Restriction will be the file if TYPE is `file', or if type is the
-universal prefix '(4), or if the cursor is before the first headline
+Restriction will be the file if TYPE is `file', or if TYPE is the
+universal prefix `(4)', or if the cursor is before the first headline
 in the file.  Otherwise, restriction will be to the current subtree."
   (interactive "P")
   (and (equal type '(4)) (setq type 'file))
@@ -9596,7 +9597,7 @@ This is a command that has to be installed in `calendar-mode-map'."
             "Hebrew:     " (calendar-hebrew-date-string date) " (until sunset)\n"
             "Islamic:    " (calendar-islamic-date-string date) " (until sunset)\n"
             "French:     " (calendar-french-date-string date) "\n"
-            "Baha'i:     " (calendar-bahai-date-string date) " (until sunset)\n"
+            "Bahá’í:     " (calendar-bahai-date-string date) " (until sunset)\n"
             "Mayan:      " (calendar-mayan-date-string date) "\n"
             "Coptic:     " (calendar-coptic-date-string date) "\n"
             "Ethiopic:   " (calendar-ethiopic-date-string date) "\n"