최강혁

first commit

Showing 169 changed files with 2108 additions and 0 deletions
1 +(use-package smex
2 + :config (smex-initialize)
3 + :bind (("M-x" . smex)))
4 +
5 +
6 +(use-package neotree
7 + :bind (([f8] . neotree-toggle)))
8 +
9 +
10 +(use-package magit
11 + :bind (("C-c g" . magit-status)))
12 +
13 +
14 +(windmove-default-keybindings)
15 +
16 +(global-set-key (kbd "M-<left>") 'shrink-window-horizontally)
17 +(global-set-key (kbd "M-<right>") 'enlarge-window-horizontally)
18 +(global-set-key (kbd "M-<down>") 'shrink-window)
19 +(global-set-key (kbd "M-<up>") 'enlarge-window)
20 +
21 +
22 +(setq backup-inhibited t)
23 +(setq auto-save-default nil)
1 +(require 'package)
2 +(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
3 +(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
4 +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
5 +(package-initialize)
6 +
7 +(unless (package-installed-p 'use-package)
8 + (package-refresh-contents)
9 + (package-install 'use-package))
10 +
11 +(require 'use-package)
12 +(setq use-package-always-ensure t)
1 +(use-package rainbow-delimiters
2 + :init
3 + (add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode)
4 + (add-hook 'lisp-mode-hook 'rainbow-delimiters-mode))
5 +
6 +
7 +(use-package paredit
8 + :init
9 + (add-hook 'emacs-lisp-mode-hook 'paredit-mode)
10 + (add-hook 'lisp-mode-hook 'paredit-mode))
This diff is collapsed. Click to expand it.
1 +Good signature from 474F05837FBDEF9B GNU ELPA Signing Agent <elpasign@elpa.gnu.org> (trust undefined) created at 2017-09-18T18:10:02+0900 using DSA
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
1 +;;; async-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;;;### (autoloads nil "async" "async.el" (22975 64424 737697 260000))
7 +;;; Generated autoloads from async.el
8 +
9 +(autoload 'async-start-process "async" "\
10 +Start the executable PROGRAM asynchronously. See `async-start'.
11 +PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the
12 +process object when done. If FINISH-FUNC is nil, the future
13 +object will return the process object when the program is
14 +finished. Set DEFAULT-DIRECTORY to change PROGRAM's current
15 +working directory.
16 +
17 +\(fn NAME PROGRAM FINISH-FUNC &rest PROGRAM-ARGS)" nil nil)
18 +
19 +(autoload 'async-start "async" "\
20 +Execute START-FUNC (often a lambda) in a subordinate Emacs process.
21 +When done, the return value is passed to FINISH-FUNC. Example:
22 +
23 + (async-start
24 + ;; What to do in the child process
25 + (lambda ()
26 + (message \"This is a test\")
27 + (sleep-for 3)
28 + 222)
29 +
30 + ;; What to do when it finishes
31 + (lambda (result)
32 + (message \"Async process done, result should be 222: %s\"
33 + result)))
34 +
35 +If FINISH-FUNC is nil or missing, a future is returned that can
36 +be inspected using `async-get', blocking until the value is
37 +ready. Example:
38 +
39 + (let ((proc (async-start
40 + ;; What to do in the child process
41 + (lambda ()
42 + (message \"This is a test\")
43 + (sleep-for 3)
44 + 222))))
45 +
46 + (message \"I'm going to do some work here\") ;; ....
47 +
48 + (message \"Waiting on async process, result should be 222: %s\"
49 + (async-get proc)))
50 +
51 +If you don't want to use a callback, and you don't care about any
52 +return value from the child process, pass the `ignore' symbol as
53 +the second argument (if you don't, and never call `async-get', it
54 +will leave *emacs* process buffers hanging around):
55 +
56 + (async-start
57 + (lambda ()
58 + (delete-file \"a remote file on a slow link\" nil))
59 + 'ignore)
60 +
61 +Note: Even when FINISH-FUNC is present, a future is still
62 +returned except that it yields no value (since the value is
63 +passed to FINISH-FUNC). Call `async-get' on such a future always
64 +returns nil. It can still be useful, however, as an argument to
65 +`async-ready' or `async-wait'.
66 +
67 +\(fn START-FUNC &optional FINISH-FUNC)" nil nil)
68 +
69 +;;;***
70 +
71 +;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (22975
72 +;;;;;; 64424 733697 222000))
73 +;;; Generated autoloads from async-bytecomp.el
74 +
75 +(autoload 'async-byte-recompile-directory "async-bytecomp" "\
76 +Compile all *.el files in DIRECTORY asynchronously.
77 +All *.elc files are systematically deleted before proceeding.
78 +
79 +\(fn DIRECTORY &optional QUIET)" nil nil)
80 +
81 +(defvar async-bytecomp-package-mode nil "\
82 +Non-nil if Async-Bytecomp-Package mode is enabled.
83 +See the command `async-bytecomp-package-mode' for a description of this minor mode.
84 +Setting this variable directly does not take effect;
85 +either customize it (see the info node `Easy Customization')
86 +or call the function `async-bytecomp-package-mode'.")
87 +
88 +(custom-autoload 'async-bytecomp-package-mode "async-bytecomp" nil)
89 +
90 +(autoload 'async-bytecomp-package-mode "async-bytecomp" "\
91 +Byte compile asynchronously packages installed with package.el.
92 +Async compilation of packages can be controlled by
93 +`async-bytecomp-allowed-packages'.
94 +
95 +\(fn &optional ARG)" t nil)
96 +
97 +;;;***
98 +
99 +;;;### (autoloads nil "dired-async" "dired-async.el" (22975 64424
100 +;;;;;; 721697 111000))
101 +;;; Generated autoloads from dired-async.el
102 +
103 +(defvar dired-async-mode nil "\
104 +Non-nil if Dired-Async mode is enabled.
105 +See the command `dired-async-mode' for a description of this minor mode.
106 +Setting this variable directly does not take effect;
107 +either customize it (see the info node `Easy Customization')
108 +or call the function `dired-async-mode'.")
109 +
110 +(custom-autoload 'dired-async-mode "dired-async" nil)
111 +
112 +(autoload 'dired-async-mode "dired-async" "\
113 +Do dired actions asynchronously.
114 +
115 +\(fn &optional ARG)" t nil)
116 +
117 +;;;***
118 +
119 +;;;### (autoloads nil nil ("async-pkg.el" "smtpmail-async.el") (22975
120 +;;;;;; 64424 752618 495000))
121 +
122 +;;;***
123 +
124 +;; Local Variables:
125 +;; version-control: never
126 +;; no-byte-compile: t
127 +;; no-update-autoloads: t
128 +;; End:
129 +;;; async-autoloads.el ends here
1 +;;; async-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;; Local Variables:
7 +;; version-control: never
8 +;; no-byte-compile: t
9 +;; no-update-autoloads: t
10 +;; End:
11 +;;; async-autoloads.el ends here
1 +;;; async-bytecomp.el --- Compile elisp files asynchronously -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
4 +
5 +;; Authors: John Wiegley <jwiegley@gmail.com>
6 +;; Thierry Volpiatto <thierry.volpiatto@gmail.com>
7 +
8 +;; Keywords: dired async byte-compile
9 +;; X-URL: https://github.com/jwiegley/dired-async
10 +
11 +;; This program is free software; you can redistribute it and/or
12 +;; modify it under the terms of the GNU General Public License as
13 +;; published by the Free Software Foundation; either version 2, or (at
14 +;; your option) any later version.
15 +
16 +;; This program is distributed in the hope that it will be useful, but
17 +;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 +;; General Public License for more details.
20 +
21 +;; You should have received a copy of the GNU General Public License
22 +;; along with GNU Emacs; see the file COPYING. If not, write to the
23 +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 +;; Boston, MA 02111-1307, USA.
25 +
26 +;;; Commentary:
27 +;;
28 +;; This package provide the `async-byte-recompile-directory' function
29 +;; which allows, as the name says to recompile a directory outside of
30 +;; your running emacs.
31 +;; The benefit is your files will be compiled in a clean environment without
32 +;; the old *.el files loaded.
33 +;; Among other things, this fix a bug in package.el which recompile
34 +;; the new files in the current environment with the old files loaded, creating
35 +;; errors in most packages after upgrades.
36 +;;
37 +;; NB: This package is advicing the function `package--compile'.
38 +
39 +;;; Code:
40 +
41 +(require 'cl-lib)
42 +(require 'async)
43 +
44 +(defcustom async-bytecomp-allowed-packages
45 + '(async helm helm-core helm-ls-git helm-ls-hg magit)
46 + "Packages in this list will be compiled asynchronously by `package--compile'.
47 +All the dependencies of these packages will be compiled async too,
48 +so no need to add dependencies to this list.
49 +The value of this variable can also be a list with a single element,
50 +the symbol `all', in this case packages are always compiled asynchronously."
51 + :group 'async
52 + :type '(repeat (choice symbol)))
53 +
54 +(defvar async-byte-compile-log-file "~/.emacs.d/async-bytecomp.log")
55 +
56 +;;;###autoload
57 +(defun async-byte-recompile-directory (directory &optional quiet)
58 + "Compile all *.el files in DIRECTORY asynchronously.
59 +All *.elc files are systematically deleted before proceeding."
60 + (cl-loop with dir = (directory-files directory t "\\.elc\\'")
61 + unless dir return nil
62 + for f in dir
63 + when (file-exists-p f) do (delete-file f))
64 + ;; Ensure async is reloaded when async.elc is deleted.
65 + ;; This happen when recompiling its own directory.
66 + (load "async")
67 + (let ((call-back
68 + (lambda (&optional _ignore)
69 + (if (file-exists-p async-byte-compile-log-file)
70 + (let ((buf (get-buffer-create byte-compile-log-buffer))
71 + (n 0))
72 + (with-current-buffer buf
73 + (goto-char (point-max))
74 + (let ((inhibit-read-only t))
75 + (insert-file-contents async-byte-compile-log-file)
76 + (compilation-mode))
77 + (display-buffer buf)
78 + (delete-file async-byte-compile-log-file)
79 + (unless quiet
80 + (save-excursion
81 + (goto-char (point-min))
82 + (while (re-search-forward "^.*:Error:" nil t)
83 + (cl-incf n)))
84 + (if (> n 0)
85 + (message "Failed to compile %d files in directory `%s'" n directory)
86 + (message "Directory `%s' compiled asynchronously with warnings" directory)))))
87 + (unless quiet
88 + (message "Directory `%s' compiled asynchronously with success" directory))))))
89 + (async-start
90 + `(lambda ()
91 + (require 'bytecomp)
92 + ,(async-inject-variables "\\`\\(load-path\\)\\|byte\\'")
93 + (let ((default-directory (file-name-as-directory ,directory))
94 + error-data)
95 + (add-to-list 'load-path default-directory)
96 + (byte-recompile-directory ,directory 0 t)
97 + (when (get-buffer byte-compile-log-buffer)
98 + (setq error-data (with-current-buffer byte-compile-log-buffer
99 + (buffer-substring-no-properties (point-min) (point-max))))
100 + (unless (string= error-data "")
101 + (with-temp-file ,async-byte-compile-log-file
102 + (erase-buffer)
103 + (insert error-data))))))
104 + call-back)
105 + (unless quiet (message "Started compiling asynchronously directory %s" directory))))
106 +
107 +(defvar package-archive-contents)
108 +(defvar package-alist)
109 +(declare-function package-desc-reqs "package.el" (cl-x))
110 +
111 +(defun async-bytecomp--get-package-deps (pkg &optional only)
112 + ;; Same as `package--get-deps' but parse instead `package-archive-contents'
113 + ;; because PKG is not already installed and not present in `package-alist'.
114 + ;; However fallback to `package-alist' in case PKG no more present
115 + ;; in `package-archive-contents' due to modification to `package-archives'.
116 + ;; See issue #58.
117 + (let* ((pkg-desc (cadr (or (assq pkg package-archive-contents)
118 + (assq pkg package-alist))))
119 + (direct-deps (cl-loop for p in (package-desc-reqs pkg-desc)
120 + for name = (car p)
121 + when (or (assq name package-archive-contents)
122 + (assq name package-alist))
123 + collect name))
124 + (indirect-deps (unless (eq only 'direct)
125 + (delete-dups
126 + (cl-loop for p in direct-deps append
127 + (async-bytecomp--get-package-deps p))))))
128 + (cl-case only
129 + (direct direct-deps)
130 + (separate (list direct-deps indirect-deps))
131 + (indirect indirect-deps)
132 + (t (delete-dups (append direct-deps indirect-deps))))))
133 +
134 +(defun async-bytecomp-get-allowed-pkgs ()
135 + (when (and async-bytecomp-allowed-packages
136 + (listp async-bytecomp-allowed-packages))
137 + (if package-archive-contents
138 + (cl-loop for p in async-bytecomp-allowed-packages
139 + when (assq p package-archive-contents)
140 + append (async-bytecomp--get-package-deps p) into reqs
141 + finally return
142 + (delete-dups
143 + (append async-bytecomp-allowed-packages reqs)))
144 + async-bytecomp-allowed-packages)))
145 +
146 +(defadvice package--compile (around byte-compile-async)
147 + (let ((cur-package (package-desc-name pkg-desc))
148 + (pkg-dir (package-desc-dir pkg-desc)))
149 + (if (or (equal async-bytecomp-allowed-packages '(all))
150 + (memq cur-package (async-bytecomp-get-allowed-pkgs)))
151 + (progn
152 + (when (eq cur-package 'async)
153 + (fmakunbound 'async-byte-recompile-directory))
154 + ;; Add to `load-path' the latest version of async and
155 + ;; reload it when reinstalling async.
156 + (when (string= cur-package "async")
157 + (cl-pushnew pkg-dir load-path)
158 + (load "async-bytecomp"))
159 + ;; `async-byte-recompile-directory' will add directory
160 + ;; as needed to `load-path'.
161 + (async-byte-recompile-directory (package-desc-dir pkg-desc) t))
162 + ad-do-it)))
163 +
164 +;;;###autoload
165 +(define-minor-mode async-bytecomp-package-mode
166 + "Byte compile asynchronously packages installed with package.el.
167 +Async compilation of packages can be controlled by
168 +`async-bytecomp-allowed-packages'."
169 + :group 'async
170 + :global t
171 + (if async-bytecomp-package-mode
172 + (ad-activate 'package--compile)
173 + (ad-deactivate 'package--compile)))
174 +
175 +(provide 'async-bytecomp)
176 +
177 +;;; async-bytecomp.el ends here
No preview for this file type
1 +(define-package "async" "20170916.2256" "Asynchronous processing in Emacs" 'nil :keywords
2 + '("async")
3 + :url "https://github.com/jwiegley/emacs-async")
4 +;; Local Variables:
5 +;; no-byte-compile: t
6 +;; End:
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; smtpmail-async.el --- Send e-mail with smtpmail.el asynchronously -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
4 +
5 +;; Author: John Wiegley <jwiegley@gmail.com>
6 +;; Created: 18 Jun 2012
7 +
8 +;; Keywords: email async
9 +;; X-URL: https://github.com/jwiegley/emacs-async
10 +
11 +;; This program is free software; you can redistribute it and/or
12 +;; modify it under the terms of the GNU General Public License as
13 +;; published by the Free Software Foundation; either version 2, or (at
14 +;; your option) any later version.
15 +
16 +;; This program is distributed in the hope that it will be useful, but
17 +;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 +;; General Public License for more details.
20 +
21 +;; You should have received a copy of the GNU General Public License
22 +;; along with GNU Emacs; see the file COPYING. If not, write to the
23 +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 +;; Boston, MA 02111-1307, USA.
25 +
26 +;;; Commentary:
27 +
28 +;; Send e-mail with smtpmail.el asynchronously. To use:
29 +;;
30 +;; (require 'smtpmail-async)
31 +;;
32 +;; (setq send-mail-function 'async-smtpmail-send-it
33 +;; message-send-mail-function 'async-smtpmail-send-it)
34 +;;
35 +;; This assumes you already have smtpmail.el working.
36 +
37 +;;; Code:
38 +
39 +(defgroup smtpmail-async nil
40 + "Send e-mail with smtpmail.el asynchronously"
41 + :group 'smptmail)
42 +
43 +(require 'async)
44 +(require 'smtpmail)
45 +(require 'message)
46 +
47 +(defvar async-smtpmail-before-send-hook nil
48 + "Hook running in the child emacs in `async-smtpmail-send-it'.
49 +It is called just before calling `smtpmail-send-it'.")
50 +
51 +(defun async-smtpmail-send-it ()
52 + (let ((to (message-field-value "To"))
53 + (buf-content (buffer-substring-no-properties
54 + (point-min) (point-max))))
55 + (message "Delivering message to %s..." to)
56 + (async-start
57 + `(lambda ()
58 + (require 'smtpmail)
59 + (with-temp-buffer
60 + (insert ,buf-content)
61 + (set-buffer-multibyte nil)
62 + ;; Pass in the variable environment for smtpmail
63 + ,(async-inject-variables
64 + "\\`\\(smtpmail\\|async-smtpmail\\|\\(user-\\)?mail\\)-\\|auth-sources\\|epg\\|nsm"
65 + nil "\\`\\(mail-header-format-function\\|smtpmail-address-buffer\\|mail-mode-abbrev-table\\)")
66 + (run-hooks 'async-smtpmail-before-send-hook)
67 + (smtpmail-send-it)))
68 + (lambda (&optional _ignore)
69 + (message "Delivering message to %s...done" to)))))
70 +
71 +(provide 'smtpmail-async)
72 +
73 +;;; smtpmail-async.el ends here
No preview for this file type
1 +;;; bind-key-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;;;### (autoloads nil "bind-key" "bind-key.el" (22975 64419 449648
7 +;;;;;; 126000))
8 +;;; Generated autoloads from bind-key.el
9 +
10 +(autoload 'bind-key "bind-key" "\
11 +Bind KEY-NAME to COMMAND in KEYMAP (`global-map' if not passed).
12 +
13 +KEY-NAME may be a vector, in which case it is passed straight to
14 +`define-key'. Or it may be a string to be interpreted as
15 +spelled-out keystrokes, e.g., \"C-c C-z\". See documentation of
16 +`edmacro-mode' for details.
17 +
18 +If PREDICATE is non-nil, it is a form evaluated to determine when
19 +a key should be bound. It must return non-nil in such cases.
20 +Emacs can evaluate this form at any time that it does redisplay
21 +or operates on menu data structures, so you should write it so it
22 +can safely be called at any time.
23 +
24 +\(fn KEY-NAME COMMAND &optional KEYMAP PREDICATE)" nil t)
25 +
26 +(autoload 'unbind-key "bind-key" "\
27 +Unbind the given KEY-NAME, within the KEYMAP (if specified).
28 +See `bind-key' for more details.
29 +
30 +\(fn KEY-NAME &optional KEYMAP)" nil t)
31 +
32 +(autoload 'bind-key* "bind-key" "\
33 +Similar to `bind-key', but overrides any mode-specific bindings.
34 +
35 +\(fn KEY-NAME COMMAND &optional PREDICATE)" nil t)
36 +
37 +(autoload 'bind-keys "bind-key" "\
38 +Bind multiple keys at once.
39 +
40 +Accepts keyword arguments:
41 +:map MAP - a keymap into which the keybindings should be
42 + added
43 +:prefix KEY - prefix key for these bindings
44 +:prefix-map MAP - name of the prefix map that should be created
45 + for these bindings
46 +:prefix-docstring STR - docstring for the prefix-map variable
47 +:menu-name NAME - optional menu string for prefix map
48 +:filter FORM - optional form to determine when bindings apply
49 +
50 +The rest of the arguments are conses of keybinding string and a
51 +function symbol (unquoted).
52 +
53 +\(fn &rest ARGS)" nil t)
54 +
55 +(autoload 'bind-keys* "bind-key" "\
56 +
57 +
58 +\(fn &rest ARGS)" nil t)
59 +
60 +(autoload 'describe-personal-keybindings "bind-key" "\
61 +Display all the personal keybindings defined by `bind-key'.
62 +
63 +\(fn)" t nil)
64 +
65 +;;;***
66 +
67 +;; Local Variables:
68 +;; version-control: never
69 +;; no-byte-compile: t
70 +;; no-update-autoloads: t
71 +;; End:
72 +;;; bind-key-autoloads.el ends here
1 +;;; bind-key-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;; Local Variables:
7 +;; version-control: never
8 +;; no-byte-compile: t
9 +;; no-update-autoloads: t
10 +;; End:
11 +;;; bind-key-autoloads.el ends here
1 +(define-package "bind-key" "20161218.1520" "A simple way to manage personal keybindings" 'nil :commit "360df30683a711c443f87e495ba14cdd125a505d" :url "https://github.com/jwiegley/use-package" :keywords '("keys" "keybinding" "config" "dotemacs"))
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; dash-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;;;### (autoloads nil nil ("dash.el") (22975 64423 535040 166000))
7 +
8 +;;;***
9 +
10 +;; Local Variables:
11 +;; version-control: never
12 +;; no-byte-compile: t
13 +;; no-update-autoloads: t
14 +;; End:
15 +;;; dash-autoloads.el ends here
1 +;;; dash-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;; Local Variables:
7 +;; version-control: never
8 +;; no-byte-compile: t
9 +;; no-update-autoloads: t
10 +;; End:
11 +;;; dash-autoloads.el ends here
1 +(define-package "dash" "20170810.137" "A modern list library for Emacs" 'nil :commit "0df0ff1a65d54377381e50c08d88b247db44c3dd" :keywords '("lists"))
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; diminish-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;;;### (autoloads nil "diminish" "diminish.el" (22975 64418 521639
7 +;;;;;; 497000))
8 +;;; Generated autoloads from diminish.el
9 +
10 +(autoload 'diminish "diminish" "\
11 +Diminish mode-line display of minor mode MODE to TO-WHAT (default \"\").
12 +
13 +Interactively, enter (with completion) the name of any minor mode, followed
14 +on the next line by what you want it diminished to (default empty string).
15 +The response to neither prompt should be quoted. However, in Lisp code,
16 +both args must be quoted, the first as a symbol, the second as a string,
17 +as in (diminish 'jiggle-mode \" Jgl\").
18 +
19 +The mode-line displays of minor modes usually begin with a space, so
20 +the modes' names appear as separate words on the mode line. However, if
21 +you're having problems with a cramped mode line, you may choose to use single
22 +letters for some modes, without leading spaces. Capitalizing them works
23 +best; if you then diminish some mode to \"X\" but have abbrev-mode enabled as
24 +well, you'll get a display like \"AbbrevX\". This function prepends a space
25 +to TO-WHAT if it's > 1 char long & doesn't already begin with a space.
26 +
27 +\(fn MODE &optional TO-WHAT)" t nil)
28 +
29 +(autoload 'diminish-undo "diminish" "\
30 +Restore mode-line display of diminished mode MODE to its minor-mode value.
31 +Do nothing if the arg is a minor mode that hasn't been diminished.
32 +
33 +Interactively, enter (with completion) the name of any diminished mode (a
34 +mode that was formerly a minor mode on which you invoked \\[diminish]).
35 +To restore all diminished modes to minor status, answer `diminished-modes'.
36 +The response to the prompt shouldn't be quoted. However, in Lisp code,
37 +the arg must be quoted as a symbol, as in (diminish-undo 'diminished-modes).
38 +
39 +\(fn MODE)" t nil)
40 +
41 +(autoload 'diminished-modes "diminish" "\
42 +Echo all active diminished or minor modes as if they were minor.
43 +The display goes in the echo area; if it's too long even for that,
44 +you can see the whole thing in the *Messages* buffer.
45 +This doesn't change the status of any modes; it just lets you see
46 +what diminished modes would be on the mode-line if they were still minor.
47 +
48 +\(fn)" t nil)
49 +
50 +;;;***
51 +
52 +;; Local Variables:
53 +;; version-control: never
54 +;; no-byte-compile: t
55 +;; no-update-autoloads: t
56 +;; End:
57 +;;; diminish-autoloads.el ends here
1 +;;; diminish-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;; Local Variables:
7 +;; version-control: never
8 +;; no-byte-compile: t
9 +;; no-update-autoloads: t
10 +;; End:
11 +;;; diminish-autoloads.el ends here
1 +(define-package "diminish" "20170419.1036" "Diminished modes are minor modes with no modeline display" 'nil :commit "d5c61a14e1a5590a65f83c099a5bd42fcadff24d" :url "https://github.com/myrjola/diminish.el" :keywords '("extensions" "diminish" "minor" "codeprose"))
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; git-commit-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;;;### (autoloads nil "git-commit" "git-commit.el" (22975 64427 569723
7 +;;;;;; 550000))
8 +;;; Generated autoloads from git-commit.el
9 +
10 +(defvar global-git-commit-mode t "\
11 +Non-nil if Global-Git-Commit mode is enabled.
12 +See the command `global-git-commit-mode' for a description of this minor mode.
13 +Setting this variable directly does not take effect;
14 +either customize it (see the info node `Easy Customization')
15 +or call the function `global-git-commit-mode'.")
16 +
17 +(custom-autoload 'global-git-commit-mode "git-commit" nil)
18 +
19 +(autoload 'global-git-commit-mode "git-commit" "\
20 +Edit Git commit messages.
21 +This global mode arranges for `git-commit-setup' to be called
22 +when a Git commit message file is opened. That usually happens
23 +when Git uses the Emacsclient as $GIT_EDITOR to have the user
24 +provide such a commit message.
25 +
26 +\(fn &optional ARG)" t nil)
27 +
28 +(defconst git-commit-filename-regexp "/\\(\\(\\(COMMIT\\|NOTES\\|PULLREQ\\|TAG\\)_EDIT\\|MERGE_\\|\\)MSG\\|\\(BRANCH\\|EDIT\\)_DESCRIPTION\\)\\'")
29 +
30 +(autoload 'git-commit-setup "git-commit" "\
31 +
32 +
33 +\(fn)" nil nil)
34 +
35 +;;;***
36 +
37 +;; Local Variables:
38 +;; version-control: never
39 +;; no-byte-compile: t
40 +;; no-update-autoloads: t
41 +;; End:
42 +;;; git-commit-autoloads.el ends here
1 +;;; git-commit-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;; Local Variables:
7 +;; version-control: never
8 +;; no-byte-compile: t
9 +;; no-update-autoloads: t
10 +;; End:
11 +;;; git-commit-autoloads.el ends here
1 +(define-package "git-commit" "20170914.258" "Edit Git commit messages" '((emacs "24.4") (dash "20170810") (with-editor "20170817")) :commit "746f2361ba5e0299f05a7878e530da2c7c8f749b" :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc"))
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
File mode changed
File mode changed
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +This is the file .../info/dir, which contains the
2 +topmost node of the Info hierarchy, called (dir)Top.
3 +The first time you invoke Info you start off looking at this node.
4 +
5 +File: dir, Node: Top This is the top of the INFO tree
6 +
7 + This (the Directory node) gives a menu of major topics.
8 + Typing "q" exits, "?" lists all Info commands, "d" returns here,
9 + "h" gives a primer for first-timers,
10 + "mEmacs<Return>" visits the Emacs manual, etc.
11 +
12 + In Emacs, you can click mouse button 2 on a menu item or cross reference
13 + to select it.
14 +
15 +* Menu:
16 +
17 +Emacs
18 +* Magit: (magit). Using Git from Emacs with Magit.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
1 +;;; magit-autoloads.el --- automatically extracted autoloads
2 +;;
3 +;;; Code:
4 +(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
5 +
6 +;; Local Variables:
7 +;; version-control: never
8 +;; no-byte-compile: t
9 +;; no-update-autoloads: t
10 +;; End:
11 +;;; magit-autoloads.el ends here
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; magit-bisect.el --- bisect support for Magit -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2011-2017 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 +;; Magit is free software; you can redistribute it and/or modify it
12 +;; under the terms of the GNU General Public License as published by
13 +;; the Free Software Foundation; either version 3, or (at your option)
14 +;; any later version.
15 +;;
16 +;; Magit is distributed in the hope that it will be useful, but WITHOUT
17 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 +;; License for more details.
20 +;;
21 +;; You should have received a copy of the GNU General Public License
22 +;; along with Magit. If not, see http://www.gnu.org/licenses.
23 +
24 +;;; Commentary:
25 +
26 +;; Use a binary search to find the commit that introduced a bug.
27 +
28 +;;; Code:
29 +
30 +(require 'magit)
31 +
32 +;;; Options
33 +
34 +(defcustom magit-bisect-show-graph t
35 + "Whether to use `--graph' in the log showing commits yet to be bisected."
36 + :package-version '(magit . "2.8.0")
37 + :group 'magit-status
38 + :type 'boolean)
39 +
40 +(defface magit-bisect-good
41 + '((t :foreground "DarkOliveGreen"))
42 + "Face for good bisect revisions."
43 + :group 'magit-faces)
44 +
45 +(defface magit-bisect-skip
46 + '((t :foreground "DarkGoldenrod"))
47 + "Face for skipped bisect revisions."
48 + :group 'magit-faces)
49 +
50 +(defface magit-bisect-bad
51 + '((t :foreground "IndianRed4"))
52 + "Face for bad bisect revisions."
53 + :group 'magit-faces)
54 +
55 +;;; Commands
56 +
57 +;;;###autoload (autoload 'magit-bisect-popup "magit-bisect" nil t)
58 +(magit-define-popup magit-bisect-popup
59 + "Popup console for bisect commands."
60 + :man-page "git-bisect"
61 + :actions '((?B "Start" magit-bisect-start)
62 + (?s "Start script" magit-bisect-run))
63 + :sequence-actions '((?b "Bad" magit-bisect-bad)
64 + (?g "Good" magit-bisect-good)
65 + (?k "Skip" magit-bisect-skip)
66 + (?r "Reset" magit-bisect-reset)
67 + (?s "Run script" magit-bisect-run))
68 + :sequence-predicate 'magit-bisect-in-progress-p)
69 +
70 +;;;###autoload
71 +(defun magit-bisect-start (bad good)
72 + "Start a bisect session.
73 +
74 +Bisecting a bug means to find the commit that introduced it.
75 +This command starts such a bisect session by asking for a know
76 +good and a bad commit. To move the session forward use the
77 +other actions from the bisect popup (\
78 +\\<magit-status-mode-map>\\[magit-bisect-popup])."
79 + (interactive (if (magit-bisect-in-progress-p)
80 + (user-error "Already bisecting")
81 + (magit-bisect-start-read-args)))
82 + (magit-git-bisect "start" (list bad good) t))
83 +
84 +(defun magit-bisect-start-read-args ()
85 + (let ((b (magit-read-branch-or-commit "Start bisect with bad revision")))
86 + (list b (magit-read-other-branch-or-commit "Good revision" b))))
87 +
88 +;;;###autoload
89 +(defun magit-bisect-reset ()
90 + "After bisecting, cleanup bisection state and return to original `HEAD'."
91 + (interactive)
92 + (when (magit-confirm 'reset-bisect)
93 + (magit-run-git "bisect" "reset")
94 + (ignore-errors (delete-file (magit-git-dir "BISECT_CMD_OUTPUT")))))
95 +
96 +;;;###autoload
97 +(defun magit-bisect-good ()
98 + "While bisecting, mark the current commit as good.
99 +Use this after you have asserted that the commit does not contain
100 +the bug in question."
101 + (interactive)
102 + (magit-git-bisect "good"))
103 +
104 +;;;###autoload
105 +(defun magit-bisect-bad ()
106 + "While bisecting, mark the current commit as bad.
107 +Use this after you have asserted that the commit does contain the
108 +bug in question."
109 + (interactive)
110 + (magit-git-bisect "bad"))
111 +
112 +;;;###autoload
113 +(defun magit-bisect-skip ()
114 + "While bisecting, skip the current commit.
115 +Use this if for some reason the current commit is not a good one
116 +to test. This command lets Git choose a different one."
117 + (interactive)
118 + (magit-git-bisect "skip"))
119 +
120 +;;;###autoload
121 +(defun magit-bisect-run (cmdline &optional bad good)
122 + "Bisect automatically by running commands after each step.
123 +
124 +Unlike `git bisect run' this can be used before bisecting has
125 +begun. In that case it behaves like `git bisect start; git
126 +bisect run'."
127 + (interactive (let ((args (and (not (magit-bisect-in-progress-p))
128 + (magit-bisect-start-read-args))))
129 + (cons (read-shell-command "Bisect shell command: ") args)))
130 + (when (and bad good)
131 + (magit-bisect-start bad good))
132 + (magit-git-bisect "run" (list shell-file-name shell-command-switch cmdline)))
133 +
134 +(defun magit-git-bisect (subcommand &optional args no-assert)
135 + (unless (or no-assert (magit-bisect-in-progress-p))
136 + (user-error "Not bisecting"))
137 + (magit-with-toplevel
138 + (magit-run-git-with-logfile
139 + (magit-git-dir "BISECT_CMD_OUTPUT") "bisect" subcommand args)))
140 +
141 +;;; Sections
142 +
143 +(defun magit-bisect-in-progress-p ()
144 + (file-exists-p (magit-git-dir "BISECT_LOG")))
145 +
146 +(defun magit-insert-bisect-output ()
147 + "While bisecting, insert section with output from `git bisect'."
148 + (when (magit-bisect-in-progress-p)
149 + (let* ((lines
150 + (or (magit-file-lines (magit-git-dir "BISECT_CMD_OUTPUT"))
151 + (list "Bisecting: (no saved bisect output)"
152 + "It appears you have invoked `git bisect' from a shell."
153 + "There is nothing wrong with that, we just cannot display"
154 + "anything useful here. Consult the shell output instead.")))
155 + (done-re "^\\([a-z0-9]\\{40\\}\\) is the first bad commit$")
156 + (bad-line (or (and (string-match done-re (car lines))
157 + (pop lines))
158 + (--first (string-match done-re it) lines))))
159 + (magit-insert-section ((eval (if bad-line 'commit 'bisect-output))
160 + (and bad-line (match-string 1 bad-line)))
161 + (magit-insert-heading
162 + (propertize (or bad-line (pop lines))
163 + 'face 'magit-section-heading))
164 + (dolist (line lines)
165 + (insert line "\n"))))
166 + (insert "\n")))
167 +
168 +(defun magit-insert-bisect-rest ()
169 + "While bisecting, insert section visualizing the bisect state."
170 + (when (magit-bisect-in-progress-p)
171 + (magit-insert-section (bisect-view)
172 + (magit-insert-heading "Bisect Rest:")
173 + (magit-git-wash (apply-partially 'magit-log-wash-log 'bisect-vis)
174 + "bisect" "visualize" "git" "log"
175 + "--format=%h%d%x00%s" "--decorate=full"
176 + (and magit-bisect-show-graph "--graph")))))
177 +
178 +(defun magit-insert-bisect-log ()
179 + "While bisecting, insert section logging bisect progress."
180 + (when (magit-bisect-in-progress-p)
181 + (magit-insert-section (bisect-log)
182 + (magit-insert-heading "Bisect Log:")
183 + (magit-git-wash #'magit-wash-bisect-log "bisect" "log")
184 + (insert ?\n))))
185 +
186 +(defun magit-wash-bisect-log (_args)
187 + (let (beg)
188 + (while (progn (setq beg (point-marker))
189 + (re-search-forward "^\\(git bisect [^\n]+\n\\)" nil t))
190 + (magit-bind-match-strings (heading) nil
191 + (magit-delete-match)
192 + (save-restriction
193 + (narrow-to-region beg (point))
194 + (goto-char (point-min))
195 + (magit-insert-section (bisect-log heading t)
196 + (insert (propertize heading 'face 'magit-section-secondary-heading))
197 + (magit-insert-heading)
198 + (magit-wash-sequence
199 + (apply-partially 'magit-log-wash-rev 'bisect-log
200 + (magit-abbrev-length)))
201 + (insert ?\n)))))
202 + (when (re-search-forward
203 + "# first bad commit: \\[\\([a-z0-9]\\{40\\}\\)\\] [^\n]+\n" nil t)
204 + (magit-bind-match-strings (hash) nil
205 + (magit-delete-match)
206 + (magit-insert-section (bisect-log)
207 + (insert hash " is the first bad commit\n"))))))
208 +
209 +(provide 'magit-bisect)
210 +;;; magit-bisect.el ends here
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; magit-core.el --- core functionality -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2010-2017 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 +;; Magit is free software; you can redistribute it and/or modify it
12 +;; under the terms of the GNU General Public License as published by
13 +;; the Free Software Foundation; either version 3, or (at your option)
14 +;; any later version.
15 +;;
16 +;; Magit is distributed in the hope that it will be useful, but WITHOUT
17 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 +;; License for more details.
20 +;;
21 +;; You should have received a copy of the GNU General Public License
22 +;; along with Magit. If not, see http://www.gnu.org/licenses.
23 +
24 +;;; Commentary:
25 +
26 +;; This library requires several other libraries, so that yet other
27 +;; libraries can just require this one, instead of having to require
28 +;; all the other ones. In other words this separates the low-level
29 +;; stuff from the rest. It also defines some Custom groups.
30 +
31 +;;; Code:
32 +
33 +(require 'magit-popup)
34 +(require 'magit-utils)
35 +(require 'magit-section)
36 +(require 'magit-git)
37 +(require 'magit-mode)
38 +(require 'magit-margin)
39 +(require 'magit-process)
40 +(require 'magit-autorevert)
41 +
42 +(defgroup magit nil
43 + "Controlling Git from Emacs."
44 + :link '(url-link "https://magit.vc")
45 + :link '(info-link "(magit)FAQ")
46 + :link '(info-link "(magit)")
47 + :group 'tools)
48 +
49 +(defgroup magit-essentials nil
50 + "Options that every Magit user should briefly think about.
51 +
52 +Each of these options falls into one or more of these categories:
53 +
54 +* Options that affect Magit's behavior in fundamental ways.
55 +* Options that affect safety.
56 +* Options that affect performance.
57 +* Options that are of a personal nature."
58 + :link '(info-link "(magit)Essential Settings")
59 + :group 'magit)
60 +
61 +(defgroup magit-miscellaneous nil
62 + "Miscellanous Magit options."
63 + :group 'magit)
64 +
65 +(defgroup magit-commands nil
66 + "Options controlling behavior of certain commands."
67 + :group 'magit)
68 +
69 +(defgroup magit-git-arguments nil
70 + "Options controlling what arguments are passed to Git.
71 +
72 +Most of these options can be set using the respective popup,
73 +and it is recommended that you do that because then you can
74 +be certain that Magit supports the arguments that you select.
75 +
76 +An option `magit-NAME-argument' specifies the arguments that
77 +are enabled by default by the popup `magit-NAME-popup'."
78 + :link '(info-link "(magit-popup)Customizing Existing Popups")
79 + :link '(info-link "(magit-popup)Usage")
80 + :group 'magit-commands)
81 +
82 +(defgroup magit-modes nil
83 + "Modes used or provided by Magit."
84 + :group 'magit)
85 +
86 +(defgroup magit-buffers nil
87 + "Options concerning Magit buffers."
88 + :link '(info-link "(magit)Modes and Buffers")
89 + :group 'magit)
90 +
91 +(defgroup magit-refresh nil
92 + "Options controlling how Magit buffers are refreshed."
93 + :link '(info-link "(magit)Automatic Refreshing of Magit Buffers")
94 + :group 'magit
95 + :group 'magit-buffers)
96 +
97 +(defgroup magit-faces nil
98 + "Faces used by Magit."
99 + :group 'magit
100 + :group 'faces)
101 +
102 +(defgroup magit-extensions nil
103 + "Extensions to Magit."
104 + :group 'magit)
105 +
106 +(custom-add-to-group 'magit-modes 'magit-popup 'custom-group)
107 +(custom-add-to-group 'magit-faces 'magit-popup-faces 'custom-group)
108 +(custom-add-to-group 'magit-modes 'git-commit 'custom-group)
109 +(custom-add-to-group 'magit-faces 'git-commit-faces 'custom-group)
110 +(custom-add-to-group 'magit-modes 'git-rebase 'custom-group)
111 +(custom-add-to-group 'magit-faces 'git-rebase-faces 'custom-group)
112 +(custom-add-to-group 'magit-process 'with-editor 'custom-group)
113 +
114 +(defgroup magit-related nil
115 + "Options that are relevant to Magit but that are defined elsewhere."
116 + :link '(custom-group-link vc)
117 + :link '(custom-group-link smerge)
118 + :link '(custom-group-link ediff)
119 + :link '(custom-group-link auto-revert)
120 + :group 'magit
121 + :group 'magit-extensions
122 + :group 'magit-essentials)
123 +
124 +(custom-add-to-group 'magit-related 'auto-revert-check-vc-info 'custom-variable)
125 +(custom-add-to-group 'magit-auto-revert 'auto-revert-check-vc-info 'custom-variable)
126 +
127 +(custom-add-to-group 'magit-related 'ediff-window-setup-function 'custom-variable)
128 +(custom-add-to-group 'magit-related 'smerge-refine-ignore-whitespace 'custom-variable)
129 +(custom-add-to-group 'magit-related 'vc-follow-symlinks 'custom-variable)
130 +
131 +(provide 'magit-core)
132 +;;; magit-core.el ends here
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; magit-extras.el --- additional functionality for Magit -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2008-2017 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 +;; Magit is free software; you can redistribute it and/or modify it
9 +;; under the terms of the GNU General Public License as published by
10 +;; the Free Software Foundation; either version 3, or (at your option)
11 +;; any later version.
12 +;;
13 +;; Magit is distributed in the hope that it will be useful, but WITHOUT
14 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 +;; License for more details.
17 +;;
18 +;; You should have received a copy of the GNU General Public License
19 +;; along with Magit. If not, see http://www.gnu.org/licenses.
20 +
21 +;;; Commentary:
22 +
23 +;; Additional functionality for Magit.
24 +
25 +;;; Code:
26 +
27 +(require 'magit)
28 +
29 +(declare-function dired-do-shell-command 'dired-aux)
30 +(declare-function dired-read-shell-command 'dired-aux)
31 +
32 +(defgroup magit-extras nil
33 + "Additional functionality for Magit."
34 + :group 'magit-extensions)
35 +
36 +;;; External Tools
37 +
38 +(defcustom magit-gitk-executable
39 + (or (and (eq system-type 'windows-nt)
40 + (let ((exe (expand-file-name
41 + "gitk" (file-name-nondirectory magit-git-executable))))
42 + (and (file-executable-p exe) exe)))
43 + (executable-find "gitk") "gitk")
44 + "The Gitk executable."
45 + :group 'magit-extras
46 + :set-after '(magit-git-executable)
47 + :type 'string)
48 +
49 +;;;###autoload
50 +(defun magit-run-git-gui ()
51 + "Run `git gui' for the current git repository."
52 + (interactive)
53 + (magit-with-toplevel
54 + (magit-process-file magit-git-executable nil 0 nil "gui")))
55 +
56 +;;;###autoload
57 +(defun magit-run-git-gui-blame (commit filename &optional linenum)
58 + "Run `git gui blame' on the given FILENAME and COMMIT.
59 +Interactively run it for the current file and the `HEAD', with a
60 +prefix or when the current file cannot be determined let the user
61 +choose. When the current buffer is visiting FILENAME instruct
62 +blame to center around the line point is on."
63 + (interactive
64 + (let (revision filename)
65 + (when (or current-prefix-arg
66 + (not (setq revision "HEAD"
67 + filename (magit-file-relative-name nil 'tracked))))
68 + (setq revision (magit-read-branch-or-commit "Blame from revision"))
69 + (setq filename (magit-read-file-from-rev revision "Blame file")))
70 + (list revision filename
71 + (and (equal filename
72 + (ignore-errors
73 + (magit-file-relative-name buffer-file-name)))
74 + (line-number-at-pos)))))
75 + (magit-with-toplevel
76 + (apply #'magit-process-file magit-git-executable nil 0 nil "gui" "blame"
77 + `(,@(and linenum (list (format "--line=%d" linenum)))
78 + ,commit
79 + ,filename))))
80 +
81 +;;;###autoload
82 +(defun magit-run-gitk ()
83 + "Run `gitk' in the current repository."
84 + (interactive)
85 + (magit-process-file magit-gitk-executable nil 0))
86 +
87 +;;;###autoload
88 +(defun magit-run-gitk-branches ()
89 + "Run `gitk --branches' in the current repository."
90 + (interactive)
91 + (magit-process-file magit-gitk-executable nil 0 nil "--branches"))
92 +
93 +;;;###autoload
94 +(defun magit-run-gitk-all ()
95 + "Run `gitk --all' in the current repository."
96 + (interactive)
97 + (magit-process-file magit-gitk-executable nil 0 nil "--all"))
98 +
99 +;;; Emacs Tools
100 +
101 +;;;###autoload
102 +(defun ido-enter-magit-status ()
103 + "Drop into `magit-status' from file switching.
104 +
105 +To make this command available use something like:
106 +
107 + (add-hook \\='ido-setup-hook
108 + (lambda ()
109 + (define-key ido-completion-map
110 + (kbd \"C-x g\") \\='ido-enter-magit-status)))
111 +
112 +Starting with Emacs 25.1 the Ido keymaps are defined just once
113 +instead of every time Ido is invoked, so now you can modify it
114 +like pretty much every other keymap:
115 +
116 + (define-key ido-common-completion-map
117 + (kbd \"C-x g\") 'ido-enter-magit-status)"
118 + (interactive)
119 + (with-no-warnings ; FIXME these are internal variables
120 + (setq ido-exit 'fallback fallback 'magit-status))
121 + (exit-minibuffer))
122 +
123 +;;;###autoload
124 +(defun magit-dired-jump (&optional other-window)
125 + "Visit file at point using Dired.
126 +With a prefix argument, visit in another window. If there
127 +is no file at point, then instead visit `default-directory'."
128 + (interactive "P")
129 + (dired-jump other-window (-if-let (file (magit-file-at-point))
130 + (progn (setq file (expand-file-name file))
131 + (if (file-directory-p file)
132 + (concat file "/.")
133 + file))
134 + (concat default-directory "/."))))
135 +
136 +;;;###autoload
137 +(defun magit-do-async-shell-command (file)
138 + "Open FILE with `dired-do-async-shell-command'.
139 +Interactively, open the file at point."
140 + (interactive (list (or (magit-file-at-point)
141 + (completing-read "Act on file: "
142 + (magit-list-files)))))
143 + (require 'dired-aux)
144 + (dired-do-async-shell-command
145 + (dired-read-shell-command "& on %s: " current-prefix-arg (list file))
146 + nil (list file)))
147 +
148 +;;; Clean
149 +
150 +;;;###autoload
151 +(defun magit-clean (&optional arg)
152 + "Remove untracked files from the working tree.
153 +With a prefix argument also remove ignored files,
154 +with two prefix arguments remove ignored files only.
155 +\n(git clean -f -d [-x|-X])"
156 + (interactive "p")
157 + (when (yes-or-no-p (format "Remove %s files? "
158 + (pcase arg
159 + (1 "untracked")
160 + (4 "untracked and ignored")
161 + (_ "ignored"))))
162 + (magit-wip-commit-before-change)
163 + (magit-run-git "clean" "-f" "-d" (pcase arg (4 "-x") (16 "-X")))))
164 +
165 +(put 'magit-clean 'disabled t)
166 +
167 +;;; Gitignore
168 +
169 +;;;###autoload
170 +(defun magit-gitignore (file-or-pattern &optional local)
171 + "Instruct Git to ignore FILE-OR-PATTERN.
172 +With a prefix argument only ignore locally."
173 + (interactive (list (magit-gitignore-read-pattern current-prefix-arg)
174 + current-prefix-arg))
175 + (let ((gitignore
176 + (if local
177 + (magit-git-dir (convert-standard-filename "info/exclude"))
178 + (expand-file-name ".gitignore" (magit-toplevel)))))
179 + (make-directory (file-name-directory gitignore) t)
180 + (with-temp-buffer
181 + (when (file-exists-p gitignore)
182 + (insert-file-contents gitignore))
183 + (goto-char (point-max))
184 + (unless (bolp)
185 + (insert "\n"))
186 + (insert (replace-regexp-in-string "\\(\\\\*\\)" "\\1\\1" file-or-pattern))
187 + (insert "\n")
188 + (write-region nil nil gitignore))
189 + (if local
190 + (magit-refresh)
191 + (magit-run-git "add" ".gitignore"))))
192 +
193 +;;;###autoload
194 +(defun magit-gitignore-locally (file-or-pattern)
195 + "Instruct Git to locally ignore FILE-OR-PATTERN."
196 + (interactive (list (magit-gitignore-read-pattern t)))
197 + (magit-gitignore file-or-pattern t))
198 +
199 +(defun magit-gitignore-read-pattern (local)
200 + (let* ((default (magit-current-file))
201 + (choices
202 + (delete-dups
203 + (--mapcat
204 + (cons (concat "/" it)
205 + (-when-let (ext (file-name-extension it))
206 + (list (concat "/" (file-name-directory "foo") "*." ext)
207 + (concat "*." ext))))
208 + (magit-untracked-files)))))
209 + (when default
210 + (setq default (concat "/" default))
211 + (unless (member default choices)
212 + (setq default (concat "*." (file-name-extension default)))
213 + (unless (member default choices)
214 + (setq default nil))))
215 + (magit-completing-read (concat "File or pattern to ignore"
216 + (and local " locally"))
217 + choices nil nil nil nil default)))
218 +
219 +;;; ChangeLog
220 +
221 +;;;###autoload
222 +(defun magit-add-change-log-entry (&optional whoami file-name other-window)
223 + "Find change log file and add date entry and item for current change.
224 +This differs from `add-change-log-entry' (which see) in that
225 +it acts on the current hunk in a Magit buffer instead of on
226 +a position in a file-visiting buffer."
227 + (interactive (list current-prefix-arg
228 + (prompt-for-change-log-name)))
229 + (let (buf pos)
230 + (save-window-excursion
231 + (call-interactively #'magit-diff-visit-file)
232 + (setq buf (current-buffer))
233 + (setq pos (point)))
234 + (save-excursion
235 + (with-current-buffer buf
236 + (goto-char pos)
237 + (add-change-log-entry whoami file-name other-window)))))
238 +
239 +;;;###autoload
240 +(defun magit-add-change-log-entry-other-window (&optional whoami file-name)
241 + "Find change log file in other window and add entry and item.
242 +This differs from `add-change-log-entry-other-window' (which see)
243 +in that it acts on the current hunk in a Magit buffer instead of
244 +on a position in a file-visiting buffer."
245 + (interactive (and current-prefix-arg
246 + (list current-prefix-arg
247 + (prompt-for-change-log-name))))
248 + (magit-add-change-log-entry whoami file-name t))
249 +
250 +;;; Miscellaneous
251 +
252 +;;;###autoload
253 +(defun magit-abort-dwim ()
254 + "Abort current operation.
255 +Depending on the context, this will abort a merge, a rebase, a
256 +patch application, a cherry-pick, a revert, or a bisect."
257 + (interactive)
258 + (cond ((magit-merge-state) (magit-merge-abort))
259 + ((magit-rebase-in-progress-p) (magit-rebase-abort))
260 + ((magit-am-in-progress-p) (magit-am-abort))
261 + ((magit-sequencer-in-progress-p) (magit-sequencer-abort))
262 + ((magit-bisect-in-progress-p) (magit-bisect-reset))))
263 +
264 +(provide 'magit-extras)
265 +;;; magit-extras.el ends here
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; magit-imenu.el --- Integrate Imenu in magit major modes -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2010-2017 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: Damien Cassou <damien@cassou.me>
9 +;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
10 +
11 +;; Magit is free software; you can redistribute it and/or modify it
12 +;; under the terms of the GNU General Public License as published by
13 +;; the Free Software Foundation; either version 3, or (at your option)
14 +;; any later version.
15 +;;
16 +;; Magit is distributed in the hope that it will be useful, but WITHOUT
17 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 +;; License for more details.
20 +;;
21 +;; You should have received a copy of the GNU General Public License
22 +;; along with Magit. If not, see http://www.gnu.org/licenses.
23 +
24 +;;; Commentary:
25 +
26 +;; Emacs' major modes can facilitate navigation in their buffers by
27 +;; supporting Imenu. In such major modes, launching Imenu (M-x imenu)
28 +;; makes Emacs display a list of items (e.g., function definitions in
29 +;; a programming major mode). Selecting an item from this list moves
30 +;; point to this item.
31 +
32 +;; magit-imenu.el adds Imenu support to every major mode in Magit
33 +
34 +;;; Code:
35 +
36 +(require 'subr-x)
37 +
38 +(require 'magit)
39 +(require 'git-rebase)
40 +
41 +(defun magit-imenu--index-function (entry-types menu-types)
42 + "Return an alist of imenu entries in current buffer.
43 +
44 +ENTRY-TYPES is a list of section types to be selected through
45 +`imenu'.
46 +
47 +MENU-TYPES is a list of section types containing elements of
48 +ENTRY-TYPES. Elements of MENU-TYPES are are used to categories
49 +elements of ENTRY-TYPES.
50 +
51 +This function is used as a helper for functions set as
52 +`imenu-create-index-function'."
53 + (let ((entries (make-hash-table :test 'equal)))
54 + (goto-char (point-max))
55 + (while (magit-section--backward-find
56 + (lambda ()
57 + (let* ((section (magit-current-section))
58 + (type (magit-section-type section))
59 + (parent (magit-section-parent section))
60 + (parent-type (magit-section-type parent)))
61 + (and (-contains-p entry-types type)
62 + (-contains-p menu-types parent-type)))))
63 + (let* ((section (magit-current-section))
64 + (name (buffer-substring-no-properties
65 + (line-beginning-position)
66 + (line-end-position)))
67 + (parent (magit-section-parent section))
68 + (parent-title (buffer-substring-no-properties
69 + (magit-section-start parent)
70 + (1- (magit-section-content parent)))))
71 + (puthash parent-title
72 + (cons (cons name (point))
73 + (gethash parent-title entries (list)))
74 + entries)))
75 + (-map (lambda (menu-title)
76 + (cons menu-title (gethash menu-title entries)))
77 + (hash-table-keys entries))))
78 +
79 +;;; Log mode
80 +
81 +;;;###autoload
82 +(defun magit-imenu--log-prev-index-position-function ()
83 + "Move point to previous line in current buffer.
84 +This function is used as a value for
85 +`imenu-prev-index-position-function'."
86 + (magit-section--backward-find
87 + (lambda ()
88 + (-contains-p '(commit stash)
89 + (magit-section-type (magit-current-section))))))
90 +
91 +;;;###autoload
92 +(defun magit-imenu--log-extract-index-name-function ()
93 + "Return imenu name for line at point.
94 +This function is used as a value for
95 +`imenu-extract-index-name-function'. Point should be at the
96 +beginning of the line."
97 + (save-match-data
98 + (looking-at "\\([^ ]+\\)[ *|]+\\(.+\\)$")
99 + (format "%s: %s"
100 + (match-string-no-properties 1)
101 + (match-string-no-properties 2))))
102 +
103 +;;; Diff mode
104 +
105 +;;;###autoload
106 +(defun magit-imenu--diff-prev-index-position-function ()
107 + "Move point to previous file line in current buffer.
108 +This function is used as a value for
109 +`imenu-prev-index-position-function'."
110 + (magit-section--backward-find
111 + (lambda ()
112 + (and (equal (magit-section-type (magit-current-section)) 'file)
113 + (not (equal (magit-section-type
114 + (magit-section-parent (magit-current-section)))
115 + 'diffstat))))))
116 +
117 +;;;###autoload
118 +(defun magit-imenu--diff-extract-index-name-function ()
119 + "Return imenu name for line at point.
120 +This function is used as a value for
121 +`imenu-extract-index-name-function'. Point should be at the
122 +beginning of the line."
123 + (buffer-substring-no-properties (line-beginning-position)
124 + (line-end-position)))
125 +
126 +;;; Status mode
127 +
128 +;;;###autoload
129 +(defun magit-imenu--status-create-index-function ()
130 + "Return an alist of all imenu entries in current buffer.
131 +This function is used as a value for
132 +`imenu-create-index-function'."
133 + (magit-imenu--index-function
134 + '(file commit stash)
135 + '(unpushed unstaged unpulled untracked staged stashes)))
136 +
137 +;;;; Refs mode
138 +
139 +;;;###autoload
140 +(defun magit-imenu--refs-create-index-function ()
141 + "Return an alist of all imenu entries in current buffer.
142 +This function is used as a value for
143 +`imenu-create-index-function'."
144 + (magit-imenu--index-function
145 + '(branch commit tag)
146 + '(local remote tags)))
147 +
148 +;;;; Cherry mode
149 +
150 +;;;###autoload
151 +(defun magit-imenu--cherry-create-index-function ()
152 + "Return an alist of all imenu entries in current buffer.
153 +This function is used as a value for
154 +`imenu-create-index-function'."
155 + (magit-imenu--index-function
156 + '(commit)
157 + '(cherries)))
158 +
159 +;;;; Submodule list mode
160 +
161 +;;;###autoload
162 +(defun magit-imenu--submodule-prev-index-position-function ()
163 + "Move point to previous line in magit-submodule-list buffer.
164 +This function is used as a value for
165 +`imenu-prev-index-position-function'."
166 + (unless (bobp)
167 + (forward-line -1)))
168 +
169 +;;;###autoload
170 +(defun magit-imenu--submodule-extract-index-name-function ()
171 + "Return imenu name for line at point.
172 +This function is used as a value for
173 +`imenu-extract-index-name-function'. Point should be at the
174 +beginning of the line."
175 + (elt (tabulated-list-get-entry) 0))
176 +
177 +;;;; Repolist mode
178 +
179 +;;;###autoload
180 +(defun magit-imenu--repolist-prev-index-position-function ()
181 + "Move point to previous line in magit-repolist buffer.
182 +This function is used as a value for
183 +`imenu-prev-index-position-function'."
184 + (unless (bobp)
185 + (forward-line -1)))
186 +
187 +;;;###autoload
188 +(defun magit-imenu--repolist-extract-index-name-function ()
189 + "Return imenu name for line at point.
190 +This function is used as a value for
191 +`imenu-extract-index-name-function'. Point should be at the
192 +beginning of the line."
193 + (let ((entry (tabulated-list-get-entry)))
194 + (format "%s (%s)"
195 + (elt entry 0)
196 + (elt entry (1- (length entry))))))
197 +
198 +;;;; Process mode
199 +
200 +;;;###autoload
201 +(defun magit-imenu--process-prev-index-position-function ()
202 + "Move point to previous process in magit-process buffer.
203 +This function is used as a value for
204 +`imenu-prev-index-position-function'."
205 + (magit-section--backward-find
206 + (lambda ()
207 + (eq
208 + (magit-section-type (magit-current-section))
209 + 'process))))
210 +
211 +;;;###autoload
212 +(defun magit-imenu--process-extract-index-name-function ()
213 + "Return imenu name for line at point.
214 +This function is used as a value for
215 +`imenu-extract-index-name-function'. Point should be at the
216 +beginning of the line."
217 + (buffer-substring-no-properties (line-beginning-position)
218 + (line-end-position)))
219 +
220 +;;;; Rebase mode
221 +
222 +;;;###autoload
223 +(defun magit-imenu--rebase-prev-index-position-function ()
224 + "Move point to previous commit in git-rebase buffer.
225 +This function is used as a value for
226 +`imenu-prev-index-position-function'."
227 + (catch 'found
228 + (while (not (bobp))
229 + (git-rebase-backward-line)
230 + (when (git-rebase-line-p)
231 + (throw 'found t)))))
232 +
233 +;;;###autoload
234 +(defun magit-imenu--rebase-extract-index-name-function ()
235 + "Return imenu name for line at point.
236 +This function is used as a value for
237 +`imenu-extract-index-name-function'. Point should be at the
238 +beginning of the line."
239 + (buffer-substring-no-properties (line-beginning-position)
240 + (line-end-position)))
241 +
242 +(provide 'magit-imenu)
243 +;;; magit-imenu.el ends here
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; magit-margin.el --- margins in Magit buffers -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2010-2017 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 +;; Magit is free software; you can redistribute it and/or modify it
12 +;; under the terms of the GNU General Public License as published by
13 +;; the Free Software Foundation; either version 3, or (at your option)
14 +;; any later version.
15 +;;
16 +;; Magit is distributed in the hope that it will be useful, but WITHOUT
17 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 +;; License for more details.
20 +;;
21 +;; You should have received a copy of the GNU General Public License
22 +;; along with Magit. If not, see http://www.gnu.org/licenses.
23 +
24 +;;; Commentary:
25 +
26 +;; This library implements support for showing additional information
27 +;; in the margins of Magit buffers. Currently this is only used for
28 +;; commits, for which the committer date or age, and optionally the
29 +;; author name are shown.
30 +
31 +;;; Code:
32 +
33 +(require 'dash)
34 +
35 +(require 'magit-section)
36 +(require 'magit-mode)
37 +
38 +(defgroup magit-margin nil
39 + "Information Magit displays in the margin.
40 +
41 +You can change the STYLE and AUTHOR-WIDTH of all `magit-*-margin'
42 +options to the same values by customizing `magit-log-margin'
43 +*before* `magit' is loaded. If you do that, then the respective
44 +values for the other options will default to what you have set
45 +for that variable. Likewise if you set `magit-log-margin's INIT
46 +to nil, then that is used in the default of all other options. But
47 +setting it to t, i.e. re-enforcing the default for that option,
48 +does not carry to other options."
49 + :link '(info-link "(magit)Log Margin")
50 + :group 'magit-log)
51 +
52 +(defvar-local magit-buffer-margin nil)
53 +(put 'magit-buffer-margin 'permanent-local t)
54 +
55 +(defvar-local magit-set-buffer-margin-refresh nil)
56 +
57 +(defvar magit--age-spec)
58 +
59 +;;; Commands
60 +
61 +(magit-define-popup magit-margin-popup
62 + "Popup console for changing appearance of the margin."
63 + :actions '("Margin"
64 + (?L "toggle visibility" magit-toggle-margin)
65 + (?l "cycle style" magit-cycle-margin-style)
66 + (?d "toggle details" magit-toggle-margin-details))
67 + :max-action-columns 1)
68 +
69 +(defun magit-toggle-margin ()
70 + "Show or hide the Magit margin."
71 + (interactive)
72 + (unless (magit-margin-option)
73 + (user-error "Magit margin isn't supported in this buffer"))
74 + (setcar magit-buffer-margin (not (magit-buffer-margin-p)))
75 + (magit-set-buffer-margin))
76 +
77 +(defun magit-cycle-margin-style ()
78 + "Cycle style used for the Magit margin."
79 + (interactive)
80 + (unless (magit-margin-option)
81 + (user-error "Magit margin isn't supported in this buffer"))
82 + ;; This is only suitable for commit margins (there are not others).
83 + (setf (cadr magit-buffer-margin)
84 + (pcase (cadr magit-buffer-margin)
85 + (`age 'age-abbreviated)
86 + (`age-abbreviated
87 + (let ((default (cadr (symbol-value (magit-margin-option)))))
88 + (if (stringp default) default "%Y-%m-%d %H:%M ")))
89 + (_ 'age)))
90 + (magit-set-buffer-margin nil t))
91 +
92 +(defun magit-toggle-margin-details ()
93 + "Show or hide details in the Magit margin."
94 + (interactive)
95 + (unless (magit-margin-option)
96 + (user-error "Magit margin isn't supported in this buffer"))
97 + (setf (nth 3 magit-buffer-margin)
98 + (not (nth 3 magit-buffer-margin)))
99 + (magit-set-buffer-margin nil t))
100 +
101 +;;; Core
102 +
103 +(defun magit-buffer-margin-p ()
104 + (car magit-buffer-margin))
105 +
106 +(defun magit-margin-option ()
107 + (pcase major-mode
108 + (`magit-cherry-mode 'magit-cherry-margin)
109 + (`magit-log-mode 'magit-log-margin)
110 + (`magit-log-select-mode 'magit-log-select-margin)
111 + (`magit-reflog-mode 'magit-reflog-margin)
112 + (`magit-refs-mode 'magit-refs-margin)
113 + (`magit-stashes-mode 'magit-stashes-margin)
114 + (`magit-status-mode 'magit-status-margin)))
115 +
116 +(defun magit-set-buffer-margin (&optional reset refresh)
117 + (-when-let (option (magit-margin-option))
118 + (let* ((default (symbol-value option))
119 + (default-width (nth 2 default)))
120 + (when (or reset (not magit-buffer-margin))
121 + (setq magit-buffer-margin (copy-sequence default)))
122 + (-let [(enable style _width details details-width)
123 + magit-buffer-margin]
124 + (when (functionp default-width)
125 + (setf (nth 2 magit-buffer-margin)
126 + (funcall default-width style details details-width)))
127 + (dolist (window (get-buffer-window-list nil nil 0))
128 + (with-selected-window window
129 + (magit-set-window-margin window)
130 + (if enable
131 + (add-hook 'window-configuration-change-hook
132 + 'magit-set-window-margin nil t)
133 + (remove-hook 'window-configuration-change-hook
134 + 'magit-set-window-margin t))))
135 + (when (and enable (or refresh magit-set-buffer-margin-refresh))
136 + (magit-refresh-buffer))))))
137 +
138 +(defun magit-set-window-margin (&optional window)
139 + (when (or window (setq window (get-buffer-window)))
140 + (with-selected-window window
141 + (set-window-margins nil (car (window-margins))
142 + (and (magit-buffer-margin-p)
143 + (nth 2 magit-buffer-margin))))))
144 +
145 +(defun magit-make-margin-overlay (&optional string previous-line)
146 + (if previous-line
147 + (save-excursion
148 + (forward-line -1)
149 + (magit-make-margin-overlay string))
150 + ;; Don't put the overlay on the complete line to work around #1880.
151 + (let ((o (make-overlay (1+ (line-beginning-position))
152 + (line-end-position)
153 + nil t)))
154 + (overlay-put o 'evaporate t)
155 + (overlay-put o 'before-string
156 + (propertize "o" 'display
157 + (list (list 'margin 'right-margin)
158 + (or string " ")))))))
159 +
160 +(defun magit-maybe-make-margin-overlay ()
161 + (when (or (magit-section-match
162 + '(unpulled unpushed recent stashes local cherries)
163 + magit-insert-section--current)
164 + (and (eq major-mode 'magit-refs-mode)
165 + (magit-section-match
166 + '(remote commit tags)
167 + magit-insert-section--current)))
168 + (magit-make-margin-overlay nil t)))
169 +
170 +;;; Custom Support
171 +
172 +(defun magit-margin-set-variable (mode symbol value)
173 + (set-default symbol value)
174 + (message "Updating margins in %s buffers..." mode)
175 + (dolist (buffer (buffer-list))
176 + (with-current-buffer buffer
177 + (when (eq major-mode mode)
178 + (magit-set-buffer-margin t)
179 + (magit-refresh))))
180 + (message "Updating margins in %s buffers...done" mode))
181 +
182 +(defconst magit-log-margin--custom-type
183 + '(list (boolean :tag "Show margin initially")
184 + (choice :tag "Show committer"
185 + (string :tag "date using time-format" "%Y-%m-%d %H:%M ")
186 + (const :tag "date's age" age)
187 + (const :tag "date's age (abbreviated)" age-abbreviated))
188 + (const :tag "Calculate width using magit-log-margin-width"
189 + magit-log-margin-width)
190 + (boolean :tag "Show author name by default")
191 + (integer :tag "Show author name using width")))
192 +
193 +;;; Time Utilities
194 +
195 +(defvar magit--age-spec
196 + `((?Y "year" "years" ,(round (* 60 60 24 365.2425)))
197 + (?M "month" "months" ,(round (* 60 60 24 30.436875)))
198 + (?w "week" "weeks" ,(* 60 60 24 7))
199 + (?d "day" "days" ,(* 60 60 24))
200 + (?h "hour" "hours" ,(* 60 60))
201 + (?m "minute" "minutes" 60)
202 + (?s "second" "seconds" 1))
203 + "Time units used when formatting relative commit ages.
204 +
205 +The value is a list of time units, beginning with the longest.
206 +Each element has the form (CHAR UNIT UNITS SECONDS). UNIT is the
207 +time unit, UNITS is the plural of that unit. CHAR is a character
208 +abbreviation. And SECONDS is the number of seconds in one UNIT.
209 +
210 +This is defined as a variable to make it possible to use time
211 +units for a language other than English. It is not defined
212 +as an option, because most other parts of Magit are always in
213 +English.")
214 +
215 +(defun magit--age (date &optional abbreviate)
216 + (cl-labels ((fn (age spec)
217 + (-let [(char unit units weight) (car spec)]
218 + (let ((cnt (round (/ age weight 1.0))))
219 + (if (or (not (cdr spec))
220 + (>= (/ age weight) 1))
221 + (list cnt (cond (abbreviate char)
222 + ((= cnt 1) unit)
223 + (t units)))
224 + (fn age (cdr spec)))))))
225 + (fn (abs (- (float-time) (string-to-number date)))
226 + magit--age-spec)))
227 +
228 +(provide 'magit-margin)
229 +;;; magit-margin.el ends here
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
1 +;;; magit-notes.el --- notes support -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2010-2017 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 +;; Magit is free software; you can redistribute it and/or modify it
12 +;; under the terms of the GNU General Public License as published by
13 +;; the Free Software Foundation; either version 3, or (at your option)
14 +;; any later version.
15 +;;
16 +;; Magit is distributed in the hope that it will be useful, but WITHOUT
17 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 +;; License for more details.
20 +;;
21 +;; You should have received a copy of the GNU General Public License
22 +;; along with Magit. If not, see http://www.gnu.org/licenses.
23 +
24 +;;; Commentary:
25 +
26 +;; This library implements support for `git-notes'.
27 +
28 +;;; Code:
29 +
30 +(require 'magit)
31 +
32 +;;; Popup
33 +
34 +;;;###autoload (autoload 'magit-notes-popup "magit" nil t)
35 +(magit-define-popup magit-notes-popup
36 + "Popup console for notes commands."
37 + :man-page "git-tag"
38 + :switches '("Switch for prune"
39 + (?n "Dry run" "--dry-run"))
40 + :options '("Option for edit and remove"
41 + (?r "Manipulate ref" "--ref=" magit-notes-popup-read-ref)
42 + "Option for merge"
43 + (?s "Merge strategy" "--strategy="))
44 + :actions '((?T "Edit" magit-notes-edit)
45 + (?r "Remove" magit-notes-remove)
46 + (?m "Merge" magit-notes-merge)
47 + (?p "Prune" magit-notes-prune)
48 + (?s "Set ref" magit-notes-set-ref)
49 + (?S "Set display refs" magit-notes-set-display-refs))
50 + :sequence-actions '((?c "Commit merge" magit-notes-merge-commit)
51 + (?a "Abort merge" magit-notes-merge-abort))
52 + :sequence-predicate 'magit-notes-merging-p
53 + :default-action 'magit-notes-edit)
54 +
55 +(defun magit-notes-merging-p ()
56 + (let ((dir (magit-git-dir "NOTES_MERGE_WORKTREE")))
57 + (and (file-directory-p dir)
58 + (directory-files dir nil "^[^.]"))))
59 +
60 +(defun magit-notes-popup-read-ref (prompt &optional initial-input)
61 + (magit-completing-read prompt (nconc (list "refs/" "refs/notes/")
62 + (magit-list-notes-refnames))
63 + nil nil initial-input))
64 +
65 +;;; Commands
66 +
67 +(defun magit-notes-edit (commit &optional ref)
68 + "Edit the note attached to COMMIT.
69 +REF is the notes ref used to store the notes.
70 +
71 +Interactively or when optional REF is nil use the value of Git
72 +variable `core.notesRef' or \"refs/notes/commits\" if that is
73 +undefined."
74 + (interactive (magit-notes-read-args "Edit notes"))
75 + (magit-run-git-with-editor "notes" (and ref (concat "--ref=" ref))
76 + "edit" commit))
77 +
78 +(defun magit-notes-remove (commit &optional ref)
79 + "Remove the note attached to COMMIT.
80 +REF is the notes ref from which the note is removed.
81 +
82 +Interactively or when optional REF is nil use the value of Git
83 +variable `core.notesRef' or \"refs/notes/commits\" if that is
84 +undefined."
85 + (interactive (magit-notes-read-args "Remove notes"))
86 + (magit-run-git-with-editor "notes" (and ref (concat "--ref=" ref))
87 + "remove" commit))
88 +
89 +(defun magit-notes-merge (ref)
90 + "Merge the notes ref REF into the current notes ref.
91 +
92 +The current notes ref is the value of Git variable
93 +`core.notesRef' or \"refs/notes/commits\" if that is undefined.
94 +
95 +When there are conflicts, then they have to be resolved in the
96 +temporary worktree \".git/NOTES_MERGE_WORKTREE\". When
97 +done use `magit-notes-merge-commit' to finish. To abort
98 +use `magit-notes-merge-abort'."
99 + (interactive (list (magit-read-string-ns "Merge reference")))
100 + (magit-run-git-with-editor "notes" "merge" ref))
101 +
102 +(defun magit-notes-merge-commit ()
103 + "Commit the current notes ref merge.
104 +Also see `magit-notes-merge'."
105 + (interactive)
106 + (magit-run-git-with-editor "notes" "merge" "--commit"))
107 +
108 +(defun magit-notes-merge-abort ()
109 + "Abort the current notes ref merge.
110 +Also see `magit-notes-merge'."
111 + (interactive)
112 + (magit-run-git-with-editor "notes" "merge" "--abort"))
113 +
114 +(defun magit-notes-prune (&optional dry-run)
115 + "Remove notes about unreachable commits."
116 + (interactive (list (and (member "--dry-run" (magit-notes-arguments)) t)))
117 + (when dry-run
118 + (magit-process-buffer))
119 + (magit-run-git-with-editor "notes" "prune" (and dry-run "--dry-run")))
120 +
121 +(defun magit-notes-set-ref (ref &optional global)
122 + "Set the current notes ref to REF.
123 +The ref is made current by setting the value of the Git variable
124 +`core.notesRef'. With a prefix argument GLOBAL change the global
125 +value, else the value in the current repository. When this is
126 +undefined, then \"refs/notes/commit\" is used.
127 +
128 +Other `magit-notes-*' commands, as well as the sub-commands
129 +of Git's `note' command, default to operate on that ref."
130 + (interactive
131 + (list (magit-completing-read "Set notes ref"
132 + (nconc (list "refs/" "refs/notes/")
133 + (magit-list-notes-refnames))
134 + nil nil
135 + (--when-let (magit-get "core.notesRef")
136 + (if (string-match "^refs/notes/\\(.+\\)" it)
137 + (match-string 1 it)
138 + it)))
139 + current-prefix-arg))
140 + (if ref
141 + (magit-run-git "config" (and global "--global") "core.notesRef"
142 + (if (string-prefix-p "refs/" ref)
143 + ref
144 + (concat "refs/notes/" ref)))
145 + (magit-run-git "config" (and global "--global")
146 + "--unset" "core.notesRef")))
147 +
148 +(defun magit-notes-set-display-refs (refs &optional global)
149 + "Set notes refs to be display in addition to \"core.notesRef\".
150 +REFS is a colon separated list of notes refs. The values are
151 +stored in the Git variable `notes.displayRef'. With a prefix
152 +argument GLOBAL change the global values, else the values in
153 +the current repository."
154 + (interactive
155 + (list (magit-completing-read "Set additional notes ref(s)"
156 + (nconc (list "refs/" "refs/notes/")
157 + (magit-list-notes-refnames))
158 + nil nil
159 + (mapconcat #'identity
160 + (magit-get-all "notes.displayRef")
161 + ":"))
162 + current-prefix-arg))
163 + (when (and refs (atom refs))
164 + (setq refs (split-string refs ":")))
165 + (when global
166 + (setq global "--global"))
167 + (magit-git-success "config" "--unset-all" global "notes.displayRef")
168 + (dolist (ref refs)
169 + (magit-call-git "config" "--add" global "notes.displayRef" ref))
170 + (magit-refresh))
171 +
172 +(defun magit-notes-read-args (prompt)
173 + (list (magit-read-branch-or-commit prompt)
174 + (--when-let (--first (string-match "^--ref=\\(.+\\)" it)
175 + (magit-notes-arguments))
176 + (match-string 1 it))))
177 +
178 +(provide 'magit-notes)
179 +;;; magit-notes.el ends here
No preview for this file type
1 +;;; magit-obsolete.el --- obsolete definitions -*- lexical-binding: t -*-
2 +
3 +;; Copyright (C) 2010-2017 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 +;; Magit is free software; you can redistribute it and/or modify it
12 +;; under the terms of the GNU General Public License as published by
13 +;; the Free Software Foundation; either version 3, or (at your option)
14 +;; any later version.
15 +;;
16 +;; Magit is distributed in the hope that it will be useful, but WITHOUT
17 +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 +;; License for more details.
20 +;;
21 +;; You should have received a copy of the GNU General Public License
22 +;; along with Magit. If not, see http://www.gnu.org/licenses.
23 +
24 +;;; Commentary:
25 +
26 +;; This library defines aliases for obsolete variables and functions.
27 +
28 +;;; Code:
29 +
30 +(require 'magit)
31 +
32 +;;; Obsolete since v2.1.0
33 +
34 +(define-obsolete-variable-alias 'magit-git-standard-options
35 + 'magit-git-global-arguments "Magit 2.1.0")
36 +
37 +;;; Obsolete since v2.2.0
38 +
39 +(define-obsolete-variable-alias 'magit-log-section-args
40 + 'magit-log-section-arguments "Magit 2.2.0")
41 +
42 +;;; Obsolete since v2.3.0
43 +
44 +(define-obsolete-function-alias 'global-magit-file-buffer-mode
45 + 'global-magit-file-mode "Magit 2.3.0")
46 +
47 +;;; Obsolete since v2.4.0
48 +
49 +(define-obsolete-function-alias 'magit-get-tracked-ref
50 + 'magit-get-upstream-ref "Magit 2.4.0")
51 +
52 +(define-obsolete-function-alias 'magit-get-tracked-branch
53 + 'magit-get-upstream-branch "Magit 2.4.0")
54 +
55 +(define-obsolete-function-alias 'magit-get-tracked-remote
56 + 'magit-get-upstream-remote "Magit 2.4.0")
57 +
58 +(define-obsolete-function-alias 'magit-insert-head-header
59 + 'magit-insert-head-branch-header "Magit 2.4.0")
60 +
61 +(define-obsolete-function-alias 'magit-insert-pull-branch-header
62 + 'magit-insert-upstream-branch-header "Magit 2.4.0")
63 +
64 +(define-obsolete-function-alias 'magit-insert-unpulled-or-recent-commits
65 + 'magit-insert-unpulled-from-upstream-or-recent "Magit 2.4.0")
66 +
67 +(define-obsolete-function-alias 'magit-insert-upstream-header
68 + 'magit-insert-upstream-branch-header "Magit 2.4.0")
69 +
70 +(make-obsolete-variable 'magit-revert-buffers
71 + 'magit-auto-revert-mode
72 + "Magit 2.4.0")
73 +
74 +(make-obsolete-variable 'magit-status-refresh-hook "\
75 +use `magit-pre-refresh-hook', `magit-post-refresh-hook',
76 + `magit-refresh-buffer-hook', or `magit-status-mode-hook' instead.
77 +
78 + If you want to run a function every time the status buffer is
79 + refreshed, in order to do something with that buffer, then use:
80 +
81 + (add-hook 'magit-refresh-buffer-hook
82 + (lambda ()
83 + (when (derived-mode-p 'magit-status-mode)
84 + ...)))
85 +
86 + If your hook function should run regardless of whether the
87 + status buffer exists or not, then use `magit-pre-refresh-hook'
88 + or `magit-post-refresh-hook'.
89 +
90 + If your hook function only has to be run once, when the buffer
91 + is first created, then `magit-status-mode-hook' instead.
92 +" "Magit 2.4.0")
93 +
94 +;;; Obsolete since v2.6.0
95 +
96 +(define-obsolete-function-alias 'magit-insert-unpulled-module-commits
97 + 'magit-insert-modules-unpulled-from-upstream "Magit 2.6.0")
98 +
99 +(define-obsolete-function-alias 'magit-insert-unpushed-module-commits
100 + 'magit-insert-modules-unpushed-to-upstream "Magit 2.6.0")
101 +
102 +;;; Obsolete since v2.8.0
103 +
104 +(make-obsolete-variable 'magit-repository-directories-depth
105 + 'magit-repository-directories "Magit 2.8.0")
106 +
107 +;;; Obsolete since v2.9.0
108 +
109 +(define-obsolete-variable-alias 'magit-duration-spec
110 + 'magit--age-spec "Magit 2.9.0")
111 +
112 +(make-obsolete-variable 'magit-diff-show-lines-boundary
113 + 'magit-diff-highlight-hunk-region-functions
114 + "Magit 2.9.0")
115 +
116 +(define-obsolete-variable-alias 'magit-log-output-coding-system
117 + 'magit-git-output-coding-system "Magit 2.9.0")
118 +
119 +;;; Obsolete since v2.9.1
120 +
121 +(define-obsolete-function-alias 'magit-checkout-file
122 + 'magit-file-checkout "Magit 2.9.1")
123 +
124 +;;; Obsolete since v2.11.0
125 +
126 +(define-obsolete-function-alias 'magit-modified-files
127 + 'magit-unstaged-files "Magit 2.11.0")
128 +
129 +(define-obsolete-function-alias 'magit-insert-submodules
130 + 'magit-insert-modules-overview "Magit 2.11.0")
131 +
132 +(provide 'magit-obsolete)
133 +;;; magit-obsolete.el ends here
No preview for this file type
1 +(define-package "magit" "20170913.1424" "A Git porcelain inside Emacs"
2 + '((emacs "24.4")
3 + (async "20170823")
4 + (dash "20170810")
5 + (with-editor "20170817")
6 + (git-commit "20170823")
7 + (magit-popup "20170824"))
8 + :url "https://github.com/magit/magit" :keywords
9 + '("git" "tools" "vc"))
10 +;; Local Variables:
11 +;; no-byte-compile: t
12 +;; End:
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.