emacs/elisp/init-const.el
2024-05-25 22:49:04 +02:00

81 lines
2.5 KiB
EmacsLisp

;;; init-const.el --- -*- lexical-binding: t -*-
;;
;; Filename: init-const.el
;; Description: Initialize Constants
;; Author: Mingde (Matthew) Zeng
;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Mon Mar 18 14:20:54 2019 (-0400)
;; Version: 3.0
;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d constants
;; Compatibility: emacs-version >= 26.1
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This initializes constants
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
;; UserInfo
(setq user-full-name "Mark van der Putten")
(setq user-mail-address "mark.van.der.putten@intemo.com")
;; -UserInfo
;; Consts
(defconst *sys/win32*
(eq system-type 'windows-nt)
"Are we running on a WinTel system?")
(defconst *sys/linux*
(eq system-type 'gnu/linux)
"Are we running on a GNU/Linux system?")
(defconst *sys/mac*
(eq system-type 'darwin)
"Are we running on a Mac system?")
(defconst python-p
(or (executable-find "python3")
(and (executable-find "python")
(> (length (shell-command-to-string "python --version | grep 'Python 3'")) 0)))
"Do we have python3?")
(defconst pip-p
(or (executable-find "pip3")
(and (executable-find "pip")
(> (length (shell-command-to-string "pip --version | grep 'python 3'")) 0)))
"Do we have pip3?")
(defconst clangd-p
(or (executable-find "clangd") ;; usually
(executable-find "/usr/local/opt/llvm/bin/clangd")) ;; macOS
"Do we have clangd?")
(defconst eaf-env-p
(and (display-graphic-p) python-p pip-p)
"Do we have EAF environment setup?")
;; -Consts
(provide 'init-const)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-const.el ends here