diff options
Diffstat (limited to '')
| -rw-r--r-- | init.el | 103 |
1 files changed, 95 insertions, 8 deletions
@@ -1,3 +1,96 @@ +(defun make-obsolete (obsolete-name current-name &optional when) + "Make the byte-compiler warn that function OBSOLETE-NAME is obsolete. +OBSOLETE-NAME should be a function name or macro name (a symbol). + +The warning will say that CURRENT-NAME should be used instead. +If CURRENT-NAME is a string, that is the `use instead' message +\(it should end with a period, and not start with a capital). +WHEN should be a string indicating when the function +was first made obsolete, for example a date or a release number." + (declare (advertised-calling-convention + ;; New code should always provide the `when' argument. + (obsolete-name current-name when) "23.1")) + (put obsolete-name 'byte-obsolete-info + ;; The second entry used to hold the `byte-compile' handler, but + ;; is not used any more nowadays. + (purecopy (list current-name nil when))) + obsolete-name) + +(defmacro define-obsolete-function-alias (obsolete-name current-name + &optional when docstring) + "Set OBSOLETE-NAME's function definition to CURRENT-NAME and mark it obsolete. + +\(define-obsolete-function-alias \\='old-fun \\='new-fun \"22.1\" \"old-fun's doc.\") + +is equivalent to the following two lines of code: + +\(defalias \\='old-fun \\='new-fun \"old-fun's doc.\") +\(make-obsolete \\='old-fun \\='new-fun \"22.1\") + +WHEN should be a string indicating when the function was first +made obsolete, for example a date or a release number. + +See the docstrings of `defalias' and `make-obsolete' for more details." + (declare (doc-string 4) + (advertised-calling-convention + ;; New code should always provide the `when' argument. + (obsolete-name current-name when &optional docstring) "23.1")) + `(progn + (defalias ,obsolete-name ,current-name ,docstring) + (make-obsolete ,obsolete-name ,current-name ,when))) + +(defun make-obsolete-variable (obsolete-name current-name &optional when access-type) + "Make the byte-compiler warn that OBSOLETE-NAME is obsolete. +The warning will say that CURRENT-NAME should be used instead. +If CURRENT-NAME is a string, that is the `use instead' message. +WHEN should be a string indicating when the variable +was first made obsolete, for example a date or a release number. +ACCESS-TYPE if non-nil should specify the kind of access that will trigger + obsolescence warnings; it can be either `get' or `set'." + (declare (advertised-calling-convention + ;; New code should always provide the `when' argument. + (obsolete-name current-name when &optional access-type) "23.1")) + (put obsolete-name 'byte-obsolete-variable + (purecopy (list current-name access-type when))) + obsolete-name) + +(defmacro define-obsolete-variable-alias (obsolete-name current-name + &optional when docstring) + "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete. +This uses `defvaralias' and `make-obsolete-variable' (which see). +See the Info node `(elisp)Variable Aliases' for more details. + +If CURRENT-NAME is a defcustom or a defvar (more generally, any variable +where OBSOLETE-NAME may be set, e.g. in an init file, before the +alias is defined), then the define-obsolete-variable-alias +statement should be evaluated before the defcustom, if user +customizations are to be respected. The simplest way to achieve +this is to place the alias statement before the defcustom (this +is not necessary for aliases that are autoloaded, or in files +dumped with Emacs). This is so that any user customizations are +applied before the defcustom tries to initialize the +variable (this is due to the way `defvaralias' works). + +WHEN should be a string indicating when the variable was first +made obsolete, for example a date or a release number. + +For the benefit of Customize, if OBSOLETE-NAME has +any of the following properties, they are copied to +CURRENT-NAME, if it does not already have them: +`saved-value', `saved-variable-comment'." + (declare (doc-string 4) + (advertised-calling-convention + ;; New code should always provide the `when' argument. + (obsolete-name current-name when &optional docstring) "23.1")) + `(progn + (defvaralias ,obsolete-name ,current-name ,docstring) + ;; See Bug#4706. + (dolist (prop '(saved-value saved-variable-comment)) + (and (get ,obsolete-name prop) + (null (get ,current-name prop)) + (put ,current-name prop (get ,obsolete-name prop)))) + (make-obsolete-variable ,obsolete-name ,current-name ,when))) + ;;; init.el --- initialize emacs configuration ;;; Author: Benj Bellon <benjaminbellon@gmail.com> @@ -26,7 +119,7 @@ ;; Are we on a mac? (setq is-mac (equal system-type 'darwin)) - +(setq create-lockfiles nil) ;; Added by Package.el. This must come before configurations of ;; installed packages. Don't delete this line. If you don't want it, ;; just comment it out by adding a semicolon to the start of the line. @@ -65,7 +158,6 @@ dockerfile-mode elm-mode ember-mode - ensime erlang exec-path-from-shell flx-ido @@ -76,6 +168,7 @@ flycheck-pos-tip go-mode haskell-mode + hasklig-mode highlight-escape-sequences ido-vertical-mode json @@ -83,7 +176,6 @@ lsp-ui magit markdown-mode - merlin modern-cpp-font-lock multiple-cursors paredit @@ -97,7 +189,6 @@ rust-mode rust-playground sbt-mode - scala-mode slime smart-mode-line solarized-theme @@ -164,7 +255,6 @@ (require 'setup-purescript-mode) (require 'setup-python-mode) (require 'setup-rust-mode) -(require 'setup-scala-mode) (require 'setup-slime-mode) (require 'setup-terraform-mode) (require 'setup-treemacs) @@ -174,9 +264,6 @@ (require 'setup-yaml-mode) (require 'setup-yasnippet) -;; ## added by OPAM user-setup for emacs / base ## 56ab50dc8996d2bb95e7856a6eddb17b ## you can edit, but keep this line -(require 'setup-opam) -;; ## end of OPAM user-setup addition for emacs / base ## keep this line ;; utility globals (require 'fetch-includes) |
