config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

magit-core.el (4470B)


      1 ;;; magit-core.el --- Core functionality  -*- lexical-binding:t -*-
      2 
      3 ;; Copyright (C) 2008-2024 The Magit Project Contributors
      4 
      5 ;; Author: Jonas Bernoulli <emacs.magit@jonas.bernoulli.dev>
      6 ;; Maintainer: Jonas Bernoulli <emacs.magit@jonas.bernoulli.dev>
      7 
      8 ;; SPDX-License-Identifier: GPL-3.0-or-later
      9 
     10 ;; Magit is free software: you can redistribute it and/or modify it
     11 ;; under the terms of the GNU General Public License as published by
     12 ;; the Free Software Foundation, either version 3 of the License, or
     13 ;; (at your option) any later version.
     14 ;;
     15 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
     16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     17 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
     18 ;; License for more details.
     19 ;;
     20 ;; You should have received a copy of the GNU General Public License
     21 ;; along with Magit.  If not, see <https://www.gnu.org/licenses/>.
     22 
     23 ;;; Commentary:
     24 
     25 ;; This library requires several other libraries, so that yet other
     26 ;; libraries can just require this one, instead of having to require
     27 ;; all the other ones.  In other words this separates the low-level
     28 ;; stuff from the rest.  It also defines some Custom groups.
     29 
     30 ;;; Code:
     31 
     32 (require 'magit-base)
     33 (require 'magit-git)
     34 (require 'magit-mode)
     35 (require 'magit-margin)
     36 (require 'magit-process)
     37 (require 'magit-transient)
     38 (require 'magit-autorevert)
     39 
     40 (when (and (not magit-inhibit-libgit)
     41            (magit--libgit-available-p))
     42   (condition-case err
     43       (require 'magit-libgit)
     44     (error
     45      (setq magit-inhibit-libgit 'error)
     46      (message "Error while loading `magit-libgit': %S" err)
     47      (message "That is not fatal.  The `libegit2' module just won't be used."))))
     48 
     49 ;;; Options
     50 
     51 (defgroup magit nil
     52   "Controlling Git from Emacs."
     53   :link '(url-link "https://magit.vc")
     54   :link '(info-link "(magit)FAQ")
     55   :link '(info-link "(magit)")
     56   :group 'tools)
     57 
     58 (defgroup magit-essentials nil
     59   "Options that every Magit user should briefly think about.
     60 
     61 Each of these options falls into one or more of these categories:
     62 
     63 * Options that affect Magit's behavior in fundamental ways.
     64 * Options that affect safety.
     65 * Options that affect performance.
     66 * Options that are of a personal nature."
     67   :link '(info-link "(magit)Essential Settings")
     68   :group 'magit)
     69 
     70 (defgroup magit-miscellaneous nil
     71   "Miscellaneous Magit options."
     72   :group 'magit)
     73 
     74 (defgroup magit-commands nil
     75   "Options controlling behavior of certain commands."
     76   :group 'magit)
     77 
     78 (defgroup magit-modes nil
     79   "Modes used or provided by Magit."
     80   :group 'magit)
     81 
     82 (defgroup magit-buffers nil
     83   "Options concerning Magit buffers."
     84   :link '(info-link "(magit)Modes and Buffers")
     85   :group 'magit)
     86 
     87 (defgroup magit-refresh nil
     88   "Options controlling how Magit buffers are refreshed."
     89   :link '(info-link "(magit)Automatic Refreshing of Magit Buffers")
     90   :group 'magit
     91   :group 'magit-buffers)
     92 
     93 (defgroup magit-faces nil
     94   "Faces used by Magit."
     95   :group 'magit
     96   :group 'faces)
     97 
     98 (custom-add-to-group 'magit-faces 'diff-refine-added   'custom-face)
     99 (custom-add-to-group 'magit-faces 'diff-refine-removed 'custom-face)
    100 
    101 (defgroup magit-extensions nil
    102   "Extensions to Magit."
    103   :group 'magit)
    104 
    105 (custom-add-to-group 'magit-modes   'git-commit        'custom-group)
    106 (custom-add-to-group 'magit-faces   'git-commit-faces  'custom-group)
    107 (custom-add-to-group 'magit-modes   'git-rebase        'custom-group)
    108 (custom-add-to-group 'magit-faces   'git-rebase-faces  'custom-group)
    109 (custom-add-to-group 'magit         'magit-section     'custom-group)
    110 (custom-add-to-group 'magit-faces   'magit-section-faces 'custom-group)
    111 (custom-add-to-group 'magit-process 'with-editor       'custom-group)
    112 
    113 (defgroup magit-related nil
    114   "Options that are relevant to Magit but that are defined elsewhere."
    115   :link '(custom-group-link vc)
    116   :link '(custom-group-link smerge)
    117   :link '(custom-group-link ediff)
    118   :link '(custom-group-link auto-revert)
    119   :group 'magit
    120   :group 'magit-extensions
    121   :group 'magit-essentials)
    122 
    123 (custom-add-to-group 'magit-related     'auto-revert-check-vc-info 'custom-variable)
    124 (custom-add-to-group 'magit-auto-revert 'auto-revert-check-vc-info 'custom-variable)
    125 
    126 (custom-add-to-group 'magit-related 'ediff-window-setup-function 'custom-variable)
    127 (custom-add-to-group 'magit-related 'smerge-refine-ignore-whitespace 'custom-variable)
    128 (custom-add-to-group 'magit-related 'vc-follow-symlinks 'custom-variable)
    129 
    130 ;;; _
    131 (provide 'magit-core)
    132 ;;; magit-core.el ends here