From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Peter_M=C3=BCnster?= Subject: [PATCH]: Replace calls to obsolete macros in org-notify.el Date: Mon, 15 Jan 2018 19:35:06 +0100 Message-ID: <87vag33r8l.fsf@free.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb9bT-0000in-Jl for emacs-orgmode@gnu.org; Mon, 15 Jan 2018 13:35:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb9bO-0000Fy-H6 for emacs-orgmode@gnu.org; Mon, 15 Jan 2018 13:35:27 -0500 Received: from [195.159.176.226] (port=40619 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eb9bO-0000EU-7A for emacs-orgmode@gnu.org; Mon, 15 Jan 2018 13:35:22 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eb9ZL-0002Us-6m for emacs-orgmode@gnu.org; Mon, 15 Jan 2018 19:33:15 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi, Please find attached a patch that removes calls to obsolete macros. Kind regards, -- Peter --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Replace-calls-to-obsolete-macros.patch >From 8d2f68f7c01687565dcd248930ab949ab3b77516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCnster?= 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 --=-=-=--