emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Peter Münster" <pmlists@free.fr>
To: emacs-orgmode@gnu.org
Subject: [PATCH]: Replace calls to obsolete macros in org-notify.el
Date: Mon, 15 Jan 2018 19:35:06 +0100	[thread overview]
Message-ID: <87vag33r8l.fsf@free.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 109 bytes --]

Hi,

Please find attached a patch that removes calls to obsolete macros.

Kind regards,
-- 
           Peter

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Replace-calls-to-obsolete-macros.patch --]
[-- Type: text/x-patch, Size: 3178 bytes --]

From 8d2f68f7c01687565dcd248930ab949ab3b77516 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20M=C3=BCnster?= <pmrb@free.fr>
Date: Mon, 15 Jan 2018 19:23:51 +0100
Subject: [PATCH] Replace calls to obsolete macros

* contrib/lisp/org-notify.el: Replace flet with cl-letf and macrolet
with cl-macrolet.
---
 contrib/lisp/org-notify.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/contrib/lisp/org-notify.el b/contrib/lisp/org-notify.el
index 96e7d4ee2..8e800eec7 100644
--- a/contrib/lisp/org-notify.el
+++ b/contrib/lisp/org-notify.el
@@ -118,7 +118,7 @@ simple timestamp string."
 
 (defun org-notify-make-todo (heading &rest ignored)
   "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))))
     (let* ((list (nth 1 heading))      (notify (or (get :NOTIFY) "default"))
            (deadline (org-notify-convert-deadline (get :deadline)))
@@ -157,7 +157,7 @@ PERIOD."
 (defun org-notify-process ()
   "Process the todo-list, and possibly notify user about upcoming or
 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))
       (let* ((deadline (td :deadline))  (heading (td :heading))
              (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))
           (org-with-wide-buffer
            (goto-char begin)
-           (show-entry))
+           (outline-show-entry))
           (goto-char begin)
           (search-forward "DEADLINE: <")
+          (search-forward ":")
           (if (display-graphic-p)
               (x-focus-frame nil)))
       (save-excursion
@@ -268,7 +269,7 @@ seconds.  The default value for SECS is 20."
 
 (defun org-notify-on-action-button (button)
   "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-delete-window (get 'buffer))
     (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)))
   (insert (org-notify-body-text plist))
   (funcall send-mail-function)
-  (flet ((yes-or-no-p (prompt) t))
+  (cl-letf (((symbol-function 'yes-or-no-p) (lambda (x) t)))
     (kill-buffer)))
 
 (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)
   "Pop up a window, mostly copied from `appt-disp-window'."
   (save-excursion
-    (macrolet ((get (k) `(plist-get plist ,k)))
+    (cl-macrolet ((get (k) `(plist-get plist ,k)))
       (let ((this-window (selected-window))
             (buf (get-buffer-create
                   (format org-notify-window-buffer-name (get :uid)))))
-- 
2.13.6


             reply	other threads:[~2018-01-15 18:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 18:35 Peter Münster [this message]
2018-01-15 22:03 ` [PATCH]: Replace calls to obsolete macros in org-notify.el Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vag33r8l.fsf@free.fr \
    --to=pmlists@free.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).