Browse Source

Fix Emacs 26 compatibility

* lisp/org-plot.el (org-plot/gnuplot): Do not use `if-let'.
* lisp/ox-ascii.el (org-ascii--describe-links):
* lisp/ox-md.el (org-md--headline-referred-p): Do not use
`ignore-error'.
* testing/org-test.el (org-test-at-time): Fallback to older definition
of `decode-time' when it cannot accept 3 arguments.
Ihor Radchenko 2 years ago
parent
commit
afe50b7132
4 changed files with 18 additions and 10 deletions
  1. 4 3
      lisp/org-plot.el
  2. 4 3
      lisp/ox-ascii.el
  3. 3 2
      lisp/ox-md.el
  4. 7 2
      testing/org-test.el

+ 4 - 3
lisp/org-plot.el

@@ -682,9 +682,10 @@ line directly before or after the table."
 				  (looking-at "[[:space:]]*#\\+"))
 			(setf params (org-plot/collect-options params))))
       ;; Dump table to datafile
-      (if-let ((dump-func (plist-get type :data-dump)))
-	  (funcall dump-func table data-file num-cols params)
-	(org-plot/gnuplot-to-data table data-file params))
+      (let ((dump-func (plist-get type :data-dump)))
+        (if dump-func
+	    (funcall dump-func table data-file num-cols params)
+	  (org-plot/gnuplot-to-data table data-file params)))
       ;; Check type of ind column (timestamp? text?)
       (when (plist-get params :check-ind-type)
 	(let* ((ind (1- (plist-get params :ind)))

+ 4 - 3
lisp/ox-ascii.el

@@ -950,9 +950,10 @@ channel."
 			   (org-export-resolve-fuzzy-link link info)
                          ;; Ignore broken links.  On broken link,
                          ;; `org-export-resolve-id-link' will throw an
-                         ;; error and `ignore-error' will return nil.
-			 (ignore-error 'org-link-broken
-                           (org-export-resolve-id-link link info)))))
+                         ;; error and we will return nil.
+			 (condition-case nil
+                             (org-export-resolve-id-link link info)
+                           (org-link-broken nil)))))
              (when dest
 	       (concat
 	        (org-ascii--fill-string

+ 3 - 2
lisp/ox-md.el

@@ -195,8 +195,9 @@ of contents can refer to headlines."
        (lambda (link)
 	 (equal headline
                 ;; Ignore broken links.
-                (ignore-error 'org-link-broken
-                  (org-export-resolve-link link info))))
+                (condition-case nil
+                    (org-export-resolve-id-link link info)
+                  (org-link-broken nil))))
        info t))))
 
 (defun org-md--headline-title (style level title &optional anchor tags)

+ 7 - 2
testing/org-test.el

@@ -470,8 +470,13 @@ TIME can be a non-nil Lisp time value, or a string specifying a date and time."
 	       (apply ,(symbol-function 'current-time-zone)
 		      (or time ,at) args)))
 	    ((symbol-function 'decode-time)
-	     (lambda (&optional time zone form) (funcall ,(symbol-function 'decode-time)
-					            (or time ,at) zone form)))
+	     (lambda (&optional time zone form)
+               (condition-case nil
+                   (funcall ,(symbol-function 'decode-time)
+			    (or time ,at) zone form)
+                 (wrong-number-of-arguments
+                  (funcall ,(symbol-function 'decode-time)
+			   (or time ,at))))))
 	    ((symbol-function 'encode-time)
 	     (lambda (time &rest args)
 	       (apply ,(symbol-function 'encode-time) (or time ,at) args)))