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.
This commit is contained in:
Ihor Radchenko 2022-07-24 20:09:12 +08:00
parent e5cf0bc840
commit afe50b7132
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
4 changed files with 18 additions and 10 deletions

View File

@ -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)))

View File

@ -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

View File

@ -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)

View File

@ -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)))