Another two small patches.


(First I subscribed mail profile with a `name+tag@mail` format, after that understood that I can receive messages, but I can not write back from that tag address. Still do not see or know, if I reached the mailing list with the patches).
 
====

$ make test
---
Ran 808 tests, 808 results as expected (2019-09-29 03:24:36+0300)
13 expected failures

====
 
Regards,
Anton Latukha
 
From afb204303a388f2644a535dccef6f603d3519ead Mon Sep 17 00:00:00 2001
From: Anton-Latukha <anton.latu...@gmail.com>
Date: Sun, 29 Sep 2019 03:08:24 +0300
Subject: [PATCH 1/2] org: org-get-priority: rm: reduce negation operation

* org (org-get-priority): reducing bool negation operation by
switching if cases
---
 lisp/org.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 450d16083..72408f49f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11679,10 +11679,10 @@ and by additional input from the age of a schedules or deadline entry."
   (save-match-data
     (if (functionp org-get-priority-function)
 	(funcall org-get-priority-function)
-      (if (not (string-match org-priority-regexp s))
-	  (* 1000 (- org-lowest-priority org-default-priority))
+      (if (string-match org-priority-regexp s)
 	(* 1000 (- org-lowest-priority
-		   (string-to-char (match-string 2 s))))))))
+		   (string-to-char (match-string 2 s))))
+	(* 1000 (- org-lowest-priority org-default-priority))))))
 
 ;;;; Tags
 
-- 
2.23.0

From c1e5afed098133103c0d7c44db4da4a939aa6431 Mon Sep 17 00:00:00 2001
From: Anton-Latukha <anton.latu...@gmail.com>
Date: Sun, 29 Sep 2019 03:10:25 +0300
Subject: [PATCH 2/2] org: org-get-priority: push same magic (* 1000 .. ) op
 outside of if

* org (org-get-priority): Push the same magic (* 1000 ..) operation
outside applying it to if overall.
---
 lisp/org.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 72408f49f..8aabce5f4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11679,10 +11679,11 @@ and by additional input from the age of a schedules or deadline entry."
   (save-match-data
     (if (functionp org-get-priority-function)
 	(funcall org-get-priority-function)
-      (if (string-match org-priority-regexp s)
-	(* 1000 (- org-lowest-priority
-		   (string-to-char (match-string 2 s))))
-	(* 1000 (- org-lowest-priority org-default-priority))))))
+      (* 1000
+	 (if (string-match org-priority-regexp s)
+	     (- org-lowest-priority
+		(string-to-char (match-string 2 s)))
+	   (- org-lowest-priority org-default-priority))))))
 
 ;;;; Tags
 
-- 
2.23.0

Reply via email to