Browse Source

Replace calls to obsolete macros

* contrib/lisp/org-notify.el: Replace flet with cl-letf and macrolet
with cl-macrolet.
Peter Münster 6 years ago
parent
commit
1fd92b6637
1 changed files with 7 additions and 6 deletions
  1. 7 6
      contrib/lisp/org-notify.el

+ 7 - 6
contrib/lisp/org-notify.el

@@ -118,7 +118,7 @@ simple timestamp string."
 
 
 (defun org-notify-make-todo (heading &rest ignored)
 (defun org-notify-make-todo (heading &rest ignored)
   "Create one todo item."
   "Create one todo item."
-  (macrolet ((get (k) `(plist-get list ,k))
+  (cl-macrolet ((get (k) `(plist-get list ,k))
              (pr (k v) `(setq result (plist-put result ,k ,v))))
              (pr (k v) `(setq result (plist-put result ,k ,v))))
     (let* ((list (nth 1 heading))      (notify (or (get :NOTIFY) "default"))
     (let* ((list (nth 1 heading))      (notify (or (get :NOTIFY) "default"))
            (deadline (org-notify-convert-deadline (get :deadline)))
            (deadline (org-notify-convert-deadline (get :deadline)))
@@ -157,7 +157,7 @@ PERIOD."
 (defun org-notify-process ()
 (defun org-notify-process ()
   "Process the todo-list, and possibly notify user about upcoming or
   "Process the todo-list, and possibly notify user about upcoming or
 forgotten tasks."
 forgotten tasks."
-  (macrolet ((prm (k) `(plist-get prms ,k))  (td (k) `(plist-get todo ,k)))
+  (cl-macrolet ((prm (k) `(plist-get prms ,k))  (td (k) `(plist-get todo ,k)))
     (dolist (todo (org-notify-todo-list))
     (dolist (todo (org-notify-todo-list))
       (let* ((deadline (td :deadline))  (heading (td :heading))
       (let* ((deadline (td :deadline))  (heading (td :heading))
              (uid (td :uid))            (last-run-sym
              (uid (td :uid))            (last-run-sym
@@ -245,9 +245,10 @@ seconds.  The default value for SECS is 20."
           (switch-to-buffer (find-file-noselect file))
           (switch-to-buffer (find-file-noselect file))
           (org-with-wide-buffer
           (org-with-wide-buffer
            (goto-char begin)
            (goto-char begin)
-           (show-entry))
+           (outline-show-entry))
           (goto-char begin)
           (goto-char begin)
           (search-forward "DEADLINE: <")
           (search-forward "DEADLINE: <")
+          (search-forward ":")
           (if (display-graphic-p)
           (if (display-graphic-p)
               (x-focus-frame nil)))
               (x-focus-frame nil)))
       (save-excursion
       (save-excursion
@@ -268,7 +269,7 @@ seconds.  The default value for SECS is 20."
 
 
 (defun org-notify-on-action-button (button)
 (defun org-notify-on-action-button (button)
   "User wants to see action after button activation."
   "User wants to see action after button activation."
-  (macrolet ((get (k) `(button-get button ,k)))
+  (cl-macrolet ((get (k) `(button-get button ,k)))
     (org-notify-on-action (get 'plist) (get 'key))
     (org-notify-on-action (get 'plist) (get 'key))
     (org-notify-delete-window (get 'buffer))
     (org-notify-delete-window (get 'buffer))
     (cancel-timer (get 'timer))))
     (cancel-timer (get 'timer))))
@@ -311,7 +312,7 @@ seconds.  The default value for SECS is 20."
   (compose-mail user-mail-address (concat "TODO: " (plist-get plist :heading)))
   (compose-mail user-mail-address (concat "TODO: " (plist-get plist :heading)))
   (insert (org-notify-body-text plist))
   (insert (org-notify-body-text plist))
   (funcall send-mail-function)
   (funcall send-mail-function)
-  (flet ((yes-or-no-p (prompt) t))
+  (cl-letf (((symbol-function 'yes-or-no-p) (lambda (x) t)))
     (kill-buffer)))
     (kill-buffer)))
 
 
 (defun org-notify-select-highest-window ()
 (defun org-notify-select-highest-window ()
@@ -334,7 +335,7 @@ org-notify window.  Mostly copied from `appt-select-lowest-window'."
 (defun org-notify-action-window (plist)
 (defun org-notify-action-window (plist)
   "Pop up a window, mostly copied from `appt-disp-window'."
   "Pop up a window, mostly copied from `appt-disp-window'."
   (save-excursion
   (save-excursion
-    (macrolet ((get (k) `(plist-get plist ,k)))
+    (cl-macrolet ((get (k) `(plist-get plist ,k)))
       (let ((this-window (selected-window))
       (let ((this-window (selected-window))
             (buf (get-buffer-create
             (buf (get-buffer-create
                   (format org-notify-window-buffer-name (get :uid)))))
                   (format org-notify-window-buffer-name (get :uid)))))