Created
February 21, 2021 07:54
-
-
Save preetpalS/28179b25cfcfe8aedca5c8ba8b133a18 to your computer and use it in GitHub Desktop.
Bug workarounds for Emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Provides workarounds for some bugs | |
;; Fixes issues related to not being able to connect to HTTPS (use at your own risk) | |
(when (version< emacs-version "26.3") | |
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")) | |
;; Fixes issue in certain packages related to change listed in Emacs news (for Emacs 28): | |
;; ** The WHEN argument of 'make-obsolete' and related functions is mandatory. | |
;; The use of those functions without a WHEN argument was marked obsolete | |
;; back in Emacs 23.1. The affected functions are: 'make-obsolete', | |
;; 'define-obsolete-function-alias', 'make-obsolete-variable', | |
;; 'define-obsolete-variable-alias'. | |
(defun bug-workarounds-wrap-obsolete (original-function &rest original-arguments) | |
"Adapted from https://github.com/syl20bnr/spacemacs/issues/14265#issue-780508460" | |
(let ((replacement-arguments (if (= (length original-arguments) 2) | |
(append original-arguments (list "0")) | |
original-arguments))) | |
(apply original-function replacement-arguments))) | |
(dolist (sym '(make-obsolete | |
define-obsolete-function-alias | |
make-obsolete-variable | |
define-obsolete-variable-alias)) | |
(advice-add sym :around #'bug-workarounds-wrap-obsolete)) | |
(provide 'bug-workarounds) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment