dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

magit-core.el (4385B)


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