Update packages

This commit is contained in:
Gergely Polonkai 2016-10-14 11:16:35 +02:00
parent 7817e10c26
commit bf8b81b09f
53 changed files with 1287 additions and 466 deletions

View File

@ -1 +0,0 @@
(define-package "focus" "20160131.1418" "Dim the font color of text in surrounding sections" '((emacs "24") (cl-lib "0.5")) :url "http://github.com/larstvei/Focus")

View File

@ -1,9 +1,9 @@
;;; focus-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "focus" "focus.el" (22500 1789 464040 629000))
;;;### (autoloads nil "focus" "focus.el" (22528 41396 501073 373000))
;;; Generated autoloads from focus.el
(autoload 'focus-mode "focus" "\

View File

@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "focus" "20161013.401" "Dim the font color of text in surrounding sections" '((emacs "24") (cl-lib "0.5")) :url "http://github.com/larstvei/Focus")

View File

@ -4,7 +4,7 @@
;; Author: Lars Tveito <larstvei@ifi.uio.no>
;; URL: http://github.com/larstvei/Focus
;; Package-Version: 20160131.1418
;; Package-Version: 20161013.401
;; Created: 11th May 2015
;; Version: 0.1.0
;; Package-Requires: ((emacs "24") (cl-lib "0.5"))
@ -219,7 +219,7 @@ if active."
(thing (focus-get-thing)))
(forward-thing thing n)
(when (equal current-bounds (focus-bounds))
(forward-thing thing (signum n)))
(forward-thing thing (cl-signum n)))
(focus-goto-thing (focus-bounds))))
(defun focus-prev-thing (&optional n)

View File

@ -1,5 +0,0 @@
(define-package "go-mode" "20160913.944" "Major mode for the Go programming language" 'nil :url "https://github.com/dominikh/go-mode.el" :keywords
'("languages" "go"))
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@ -0,0 +1,551 @@
;;; go-guru.el --- Integration of the Go 'guru' analysis tool into Emacs.
;; Copyright 2016 The Go Authors. All rights reserved.
;; Use of this source code is governed by a BSD-style
;; license that can be found in the LICENSE file.
;; Version: 0.1
;; Package-Requires: ((go-mode "1.3.1") (cl-lib "0.5"))
;; Keywords: tools
;;; Commentary:
;; To enable the Go guru in Emacs, use this command to download,
;; build, and install the tool in $GOROOT/bin:
;;
;; $ go get golang.org/x/tools/cmd/guru
;;
;; Verify that the tool is on your $PATH:
;;
;; $ guru -help
;; Go source code guru.
;; Usage: guru [flags] <mode> <position>
;; ...
;;
;; Then copy this file to a directory on your `load-path',
;; and add this to your ~/.emacs:
;;
;; (require 'go-guru)
;;
;; Inside a buffer of Go source code, select an expression of
;; interest, and type `C-c C-o d' (for "describe") or run one of the
;; other go-guru-xxx commands. If you use `menu-bar-mode', these
;; commands are available from the Guru menu.
;;
;; To enable identifier highlighting mode in a Go source buffer, use:
;;
;; (go-guru-hl-identifier-mode)
;;
;; To enable it automatically in all Go source buffers,
;; add this to your ~/.emacs:
;;
;; (add-hook 'go-mode-hook #'go-guru-hl-identifier-mode)
;;
;; See http://golang.org/s/using-guru for more information about guru.
;;; Code:
(require 'compile)
(require 'easymenu)
(require 'go-mode)
(require 'json)
(require 'simple)
(require 'cl-lib)
(defgroup go-guru nil
"Options specific to the Go guru."
:group 'go)
(defcustom go-guru-command "guru"
"The Go guru command."
:type 'string
:group 'go-guru)
(defcustom go-guru-scope ""
"The scope of the analysis. See `go-guru-set-scope'."
:type 'string
:group 'go-guru)
(defvar go-guru--scope-history
nil
"History of values supplied to `go-guru-set-scope'.")
(defcustom go-guru-build-tags ""
"Build tags passed to guru."
:type 'string
:group 'go-guru)
(defface go-guru-hl-identifier-face
'((t (:inherit highlight)))
"Face used for highlighting identifiers in `go-guru-hl-identifier'."
:group 'go-guru)
(defcustom go-guru-debug nil
"Print debug messages when running guru."
:type 'boolean
:group 'go-guru)
(defcustom go-guru-hl-identifier-idle-time 0.5
"How long to wait after user input before highlighting the current identifier."
:type 'float
:group 'go-guru)
(defvar go-guru--current-hl-identifier-idle-time
0
"The current delay for hl-identifier-mode.")
(defvar go-guru--hl-identifier-timer
nil
"The global timer used for highlighting identifiers.")
(defvar go-guru--last-enclosing
nil
"The remaining enclosing regions of the previous go-expand-region invocation.")
;; Extend go-mode-map.
(let ((m (define-prefix-command 'go-guru-map)))
(define-key m "d" #'go-guru-describe)
(define-key m "f" #'go-guru-freevars)
(define-key m "i" #'go-guru-implements)
(define-key m "c" #'go-guru-peers) ; c for channel
(define-key m "r" #'go-guru-referrers)
(define-key m "j" #'go-guru-definition) ; j for jump
(define-key m "p" #'go-guru-pointsto)
(define-key m "s" #'go-guru-callstack) ; s for stack
(define-key m "e" #'go-guru-whicherrs) ; e for error
(define-key m "<" #'go-guru-callers)
(define-key m ">" #'go-guru-callees)
(define-key m "x" #'go-guru-expand-region)) ;; x for expand
(define-key go-mode-map (kbd "C-c C-o") #'go-guru-map)
(easy-menu-define go-guru-mode-menu go-mode-map
"Menu for Go Guru."
'("Guru"
["Jump to Definition" go-guru-definition t]
["Show Referrers" go-guru-referrers t]
["Show Free Names" go-guru-freevars t]
["Describe Expression" go-guru-describe t]
["Show Implements" go-guru-implements t]
"---"
["Show Callers" go-guru-callers t]
["Show Callees" go-guru-callees t]
["Show Callstack" go-guru-callstack t]
"---"
["Show Points-To" go-guru-pointsto t]
["Show Which Errors" go-guru-whicherrs t]
["Show Channel Peers" go-guru-peers t]
"---"
["Set pointer analysis scope..." go-guru-set-scope t]))
;;;###autoload
(defun go-guru-set-scope ()
"Set the scope for the Go guru, prompting the user to edit the previous scope.
The scope restricts analysis to the specified packages.
Its value is a comma-separated list of patterns of these forms:
golang.org/x/tools/cmd/guru # a single package
golang.org/x/tools/... # all packages beneath dir
... # the entire workspace.
A pattern preceded by '-' is negative, so the scope
encoding/...,-encoding/xml
matches all encoding packages except encoding/xml."
(interactive)
(let ((scope (read-from-minibuffer "Go guru scope: "
go-guru-scope
nil
nil
'go-guru--scope-history)))
(if (string-equal "" scope)
(error "You must specify a non-empty scope for the Go guru"))
(setq go-guru-scope scope)))
(defun go-guru--set-scope-if-empty ()
(if (string-equal "" go-guru-scope)
(go-guru-set-scope)))
(defun go-guru--json (mode)
"Execute the Go guru in the specified MODE, passing it the
selected region of the current buffer, requesting JSON output.
Parse and return the resulting JSON object."
;; A "what" query works even in a buffer without a file name.
(let* ((filename (file-truename (or buffer-file-name "synthetic.go")))
(cmd (go-guru--command mode filename '("-json")))
(buf (current-buffer))
;; Use temporary buffers to avoid conflict with go-guru--start.
(json-buffer (generate-new-buffer "*go-guru-json-output*"))
(input-buffer (generate-new-buffer "*go-guru-json-input*")))
(unwind-protect
;; Run guru, feeding it the input buffer (modified files).
(with-current-buffer input-buffer
(go-guru--insert-modified-files)
(unless (buffer-file-name buf)
(go-guru--insert-modified-file filename buf))
(let ((exitcode (apply #'call-process-region
(append (list (point-min)
(point-max)
(car cmd) ; guru
nil ; delete
json-buffer ; output
nil) ; display
(cdr cmd))))) ; args
(with-current-buffer json-buffer
(unless (zerop exitcode)
;; Failed: use buffer contents (sans final \n) as an error.
(error "%s" (buffer-substring (point-min) (1- (point-max)))))
;; Success: parse JSON.
(goto-char (point-min))
(json-read))))
;; Clean up temporary buffers.
(kill-buffer json-buffer)
(kill-buffer input-buffer))))
(define-compilation-mode go-guru-output-mode "Go guru"
"Go guru output mode is a variant of `compilation-mode' for the
output of the Go guru tool."
(set (make-local-variable 'compilation-error-screen-columns) nil)
(set (make-local-variable 'compilation-filter-hook) #'go-guru--compilation-filter-hook)
(set (make-local-variable 'compilation-start-hook) #'go-guru--compilation-start-hook))
(defun go-guru--compilation-filter-hook ()
"Post-process a blob of input to the go-guru-output buffer."
;; For readability, truncate each "file:line:col:" prefix to a fixed width.
;; If the prefix is longer than 20, show "…/last/19chars.go".
;; This usually includes the last segment of the package name.
;; Hide the line and column numbers.
(let ((start compilation-filter-start)
(end (point)))
(goto-char start)
(unless (bolp)
;; TODO(adonovan): not quite right: the filter may be called
;; with chunks of output containing incomplete lines. Moving to
;; beginning-of-line may cause duplicate post-processing.
(beginning-of-line))
(setq start (point))
(while (< start end)
(let ((p (search-forward ": " end t)))
(if (null p)
(setq start end) ; break out of loop
(setq p (1- p)) ; exclude final space
(let* ((posn (buffer-substring-no-properties start p))
(flen (cl-search ":" posn)) ; length of filename
(filename (if (< flen 19)
(substring posn 0 flen)
(concat "" (substring posn (- flen 19) flen)))))
(put-text-property start p 'display filename)
(forward-line 1)
(setq start (point))))))))
(defun go-guru--compilation-start-hook (proc)
"Erase default output header inserted by `compilation-mode'."
(with-current-buffer (process-buffer proc)
(let ((inhibit-read-only t))
(beginning-of-buffer)
(delete-region (point) (point-max)))))
(defun go-guru--start (mode)
"Start an asynchronous Go guru process for the specified query
MODE, passing it the selected region of the current buffer, and
feeding its standard input with the contents of all modified Go
buffers. Its output is handled by `go-guru-output-mode', a
variant of `compilation-mode'."
(or buffer-file-name
(error "Cannot use guru on a buffer without a file name"))
(let* ((filename (file-truename buffer-file-name))
(cmd (mapconcat #'shell-quote-argument (go-guru--command mode filename) " "))
(process-connection-type nil) ; use pipe (not pty) so EOF closes stdin
(procbuf (compilation-start cmd 'go-guru-output-mode)))
(with-current-buffer procbuf
(setq truncate-lines t)) ; the output is neater without line wrapping
(with-current-buffer (get-buffer-create "*go-guru-input*")
(erase-buffer)
(go-guru--insert-modified-files)
(process-send-region procbuf (point-min) (point-max))
(process-send-eof procbuf))
procbuf))
(defun go-guru--command (mode filename &optional flags)
"Return a command and argument list for a Go guru query of MODE, passing it
the selected region of the current buffer. FILENAME is the
effective name of the current buffer."
(let* ((posn (if (use-region-p)
(format "%s:#%d,#%d"
filename
(1- (go--position-bytes (region-beginning)))
(1- (go--position-bytes (region-end))))
(format "%s:#%d"
filename
(1- (go--position-bytes (point))))))
(cmd (append (list go-guru-command
"-modified"
"-scope" go-guru-scope
(format "-tags=%s" (mapconcat 'identity go-guru-build-tags ",")))
flags
(list mode
posn))))
;; Log the command to *Messages*, for debugging.
(when go-guru-debug
(message "go-guru--command: %s" cmd)
(message nil)) ; clear/shrink minibuffer
cmd))
(defun go-guru--insert-modified-files ()
"Insert the contents of each modified Go buffer into the
current buffer in the format specified by guru's -modified flag."
(mapc #'(lambda (b)
(and (buffer-modified-p b)
(buffer-file-name b)
(string= (file-name-extension (buffer-file-name b)) "go")
(go-guru--insert-modified-file (buffer-file-name b) b)))
(buffer-list)))
(defun go-guru--insert-modified-file (name buffer)
(insert (format "%s\n%d\n" name (go-guru--buffer-size-bytes buffer)))
(insert-buffer-substring buffer))
(defun go-guru--buffer-size-bytes (&optional buffer)
"Return the number of bytes in the current buffer.
If BUFFER, return the number of characters in that buffer instead."
(with-current-buffer (or buffer (current-buffer))
(string-bytes (buffer-substring (point-min)
(point-max)))))
(defun go-guru--goto-byte (offset)
"Go to the OFFSETth byte in the buffer."
(goto-char (byte-to-position offset)))
(defun go-guru--goto-byte-column (offset)
"Go to the OFFSETth byte in the current line."
(goto-char (byte-to-position (+ (position-bytes (point-at-bol)) (1- offset)))))
(defun go-guru--goto-pos (posn)
"Find the file containing the position POSN (of the form `file:line:col')
set the point to it, switching the current buffer."
(let ((file-line-pos (split-string posn ":")))
(find-file (car file-line-pos))
(goto-char (point-min))
(forward-line (1- (string-to-number (cadr file-line-pos))))
(go-guru--goto-byte-column (string-to-number (cl-caddr file-line-pos)))))
(defun go-guru--goto-pos-no-file (posn)
"Given `file:line:col', go to the line and column. The file
component will be ignored."
(let ((file-line-pos (split-string posn ":")))
(goto-char (point-min))
(forward-line (1- (string-to-number (cadr file-line-pos))))
(go-guru--goto-byte-column (string-to-number (cl-caddr file-line-pos)))))
;;;###autoload
(defun go-guru-callees ()
"Show possible callees of the function call at the current point."
(interactive)
(go-guru--set-scope-if-empty)
(go-guru--start "callees"))
;;;###autoload
(defun go-guru-callers ()
"Show the set of callers of the function containing the current point."
(interactive)
(go-guru--set-scope-if-empty)
(go-guru--start "callers"))
;;;###autoload
(defun go-guru-callstack ()
"Show an arbitrary path from a root of the call graph to the
function containing the current point."
(interactive)
(go-guru--set-scope-if-empty)
(go-guru--start "callstack"))
;;;###autoload
(defun go-guru-definition ()
"Jump to the definition of the selected identifier."
(interactive)
(or buffer-file-name
(error "Cannot use guru on a buffer without a file name"))
(let* ((res (go-guru--json "definition"))
(desc (cdr (assoc 'desc res))))
(push-mark)
(ring-insert find-tag-marker-ring (point-marker))
(go-guru--goto-pos (cdr (assoc 'objpos res)))
(message "%s" desc)))
;;;###autoload
(defun go-guru-describe ()
"Describe the selected syntax, its kind, type and methods."
(interactive)
(go-guru--start "describe"))
;;;###autoload
(defun go-guru-pointsto ()
"Show what the selected expression points to."
(interactive)
(go-guru--set-scope-if-empty)
(go-guru--start "pointsto"))
;;;###autoload
(defun go-guru-implements ()
"Describe the 'implements' relation for types in the package
containing the current point."
(interactive)
(go-guru--start "implements"))
;;;###autoload
(defun go-guru-freevars ()
"Enumerate the free variables of the current selection."
(interactive)
(go-guru--start "freevars"))
;;;###autoload
(defun go-guru-peers ()
"Enumerate the set of possible corresponding sends/receives for
this channel receive/send operation."
(interactive)
(go-guru--set-scope-if-empty)
(go-guru--start "peers"))
;;;###autoload
(defun go-guru-referrers ()
"Enumerate all references to the object denoted by the selected
identifier."
(interactive)
(go-guru--start "referrers"))
;;;###autoload
(defun go-guru-whicherrs ()
"Show globals, constants and types to which the selected
expression (of type 'error') may refer."
(interactive)
(go-guru--set-scope-if-empty)
(go-guru--start "whicherrs"))
(defun go-guru-what ()
"Run a 'what' query and return the parsed JSON response as an
association list."
(go-guru--json "what"))
(defun go-guru--hl-symbols (posn face id)
"Highlight the symbols at the positions POSN by creating
overlays with face FACE. The attribute 'go-guru-overlay on the
overlays will be set to ID."
(save-excursion
(mapc (lambda (pos)
(go-guru--goto-pos-no-file pos)
(let ((x (make-overlay (point) (+ (point) (length (current-word))))))
(overlay-put x 'go-guru-overlay id)
(overlay-put x 'face face)))
posn)))
;;;###autoload
(defun go-guru-unhighlight-identifiers ()
"Remove highlights from previously highlighted identifier."
(remove-overlays nil nil 'go-guru-overlay 'sameid))
;;;###autoload
(defun go-guru-hl-identifier ()
"Highlight all instances of the identifier under point. Removes
highlights from previously highlighted identifier."
(interactive)
(go-guru-unhighlight-identifiers)
(go-guru--hl-identifier))
(defun go-guru--hl-identifier ()
"Highlight all instances of the identifier under point."
(let ((posn (cdr (assoc 'sameids (go-guru-what)))))
(go-guru--hl-symbols posn 'go-guru-hl-identifier-face 'sameid)))
(defun go-guru--hl-identifiers-function ()
"Function run after an idle timeout, highlighting the
identifier at point, if necessary."
(when go-guru-hl-identifier-mode
(unless (go-guru--on-overlay-p 'sameid)
;; Ignore guru errors. Otherwise, we might end up with an error
;; every time the timer runs, e.g. because of a malformed
;; buffer.
(condition-case nil
(go-guru-hl-identifier)
(error nil)))
(unless (eq go-guru--current-hl-identifier-idle-time go-guru-hl-identifier-idle-time)
(go-guru--hl-set-timer))))
(defun go-guru--hl-set-timer ()
(if go-guru--hl-identifier-timer
(cancel-timer go-guru--hl-identifier-timer))
(setq go-guru--current-hl-identifier-idle-time go-guru-hl-identifier-idle-time)
(setq go-guru--hl-identifier-timer (run-with-idle-timer
go-guru-hl-identifier-idle-time
t
#'go-guru--hl-identifiers-function)))
;;;###autoload
(define-minor-mode go-guru-hl-identifier-mode
"Highlight instances of the identifier at point after a short
timeout."
:group 'go-guru
(if go-guru-hl-identifier-mode
(progn
(go-guru--hl-set-timer)
;; Unhighlight if point moves off identifier
(add-hook 'post-command-hook #'go-guru--hl-identifiers-post-command-hook nil t)
;; Unhighlight any time the buffer changes
(add-hook 'before-change-functions #'go-guru--hl-identifiers-before-change-function nil t))
(remove-hook 'post-command-hook #'go-guru--hl-identifiers-post-command-hook t)
(remove-hook 'before-change-functions #'go-guru--hl-identifiers-before-change-function t)
(go-guru-unhighlight-identifiers)))
(defun go-guru--on-overlay-p (id)
"Return whether point is on a guru overlay of type ID."
(cl-find-if (lambda (el) (eq (overlay-get el 'go-guru-overlay) id)) (overlays-at (point))))
(defun go-guru--hl-identifiers-post-command-hook ()
(if (and go-guru-hl-identifier-mode
(not (go-guru--on-overlay-p 'sameid)))
(go-guru-unhighlight-identifiers)))
(defun go-guru--hl-identifiers-before-change-function (_beg _end)
(go-guru-unhighlight-identifiers))
;; TODO(dominikh): a future feature may be to cycle through all uses
;; of an identifier.
(defun go-guru--enclosing ()
"Return a list of enclosing regions."
(cdr (assoc 'enclosing (go-guru-what))))
(defun go-guru--enclosing-unique ()
"Return a list of enclosing regions, with duplicates removed.
Two regions are considered equal if they have the same start and
end point."
(let ((enclosing (go-guru--enclosing)))
(cl-remove-duplicates enclosing
:from-end t
:test (lambda (a b)
(and (= (cdr (assoc 'start a))
(cdr (assoc 'start b)))
(= (cdr (assoc 'end a))
(cdr (assoc 'end b))))))))
(defun go-guru-expand-region ()
"Expand region to the next enclosing syntactic unit."
(interactive)
(let* ((enclosing (if (eq last-command #'go-guru-expand-region)
go-guru--last-enclosing
(go-guru--enclosing-unique)))
(block (if (> (length enclosing) 0) (elt enclosing 0))))
(when block
(go-guru--goto-byte (1+ (cdr (assoc 'start block))))
(set-mark (byte-to-position (1+ (cdr (assoc 'end block)))))
(setq go-guru--last-enclosing (cl-subseq enclosing 1))
(message "Region: %s" (cdr (assoc 'desc block)))
(setq deactivate-mark nil))))
(provide 'go-guru)
;; Local variables:
;; indent-tabs-mode: t
;; tab-width: 8
;; End
;;; go-guru.el ends here

View File

@ -3,8 +3,106 @@
;;; Code:
;;;### (autoloads nil "go-mode" "go-mode.el" (22490 24935 827407
;;;;;; 200000))
;;;### (autoloads nil "go-guru" "go-guru.el" (22528 41395 701074
;;;;;; 26000))
;;; Generated autoloads from go-guru.el
(autoload 'go-guru-set-scope "go-guru" "\
Set the scope for the Go guru, prompting the user to edit the previous scope.
The scope restricts analysis to the specified packages.
Its value is a comma-separated list of patterns of these forms:
golang.org/x/tools/cmd/guru # a single package
golang.org/x/tools/... # all packages beneath dir
... # the entire workspace.
A pattern preceded by '-' is negative, so the scope
encoding/...,-encoding/xml
matches all encoding packages except encoding/xml.
\(fn)" t nil)
(autoload 'go-guru-callees "go-guru" "\
Show possible callees of the function call at the current point.
\(fn)" t nil)
(autoload 'go-guru-callers "go-guru" "\
Show the set of callers of the function containing the current point.
\(fn)" t nil)
(autoload 'go-guru-callstack "go-guru" "\
Show an arbitrary path from a root of the call graph to the
function containing the current point.
\(fn)" t nil)
(autoload 'go-guru-definition "go-guru" "\
Jump to the definition of the selected identifier.
\(fn)" t nil)
(autoload 'go-guru-describe "go-guru" "\
Describe the selected syntax, its kind, type and methods.
\(fn)" t nil)
(autoload 'go-guru-pointsto "go-guru" "\
Show what the selected expression points to.
\(fn)" t nil)
(autoload 'go-guru-implements "go-guru" "\
Describe the 'implements' relation for types in the package
containing the current point.
\(fn)" t nil)
(autoload 'go-guru-freevars "go-guru" "\
Enumerate the free variables of the current selection.
\(fn)" t nil)
(autoload 'go-guru-peers "go-guru" "\
Enumerate the set of possible corresponding sends/receives for
this channel receive/send operation.
\(fn)" t nil)
(autoload 'go-guru-referrers "go-guru" "\
Enumerate all references to the object denoted by the selected
identifier.
\(fn)" t nil)
(autoload 'go-guru-whicherrs "go-guru" "\
Show globals, constants and types to which the selected
expression (of type 'error') may refer.
\(fn)" t nil)
(autoload 'go-guru-unhighlight-identifiers "go-guru" "\
Remove highlights from previously highlighted identifier.
\(fn)" nil nil)
(autoload 'go-guru-hl-identifier "go-guru" "\
Highlight all instances of the identifier under point. Removes
highlights from previously highlighted identifier.
\(fn)" t nil)
(autoload 'go-guru-hl-identifier-mode "go-guru" "\
Highlight instances of the identifier at point after a short
timeout.
\(fn &optional ARG)" t nil)
;;;***
;;;### (autoloads nil "go-mode" "go-mode.el" (22528 41395 693074
;;;;;; 32000))
;;; Generated autoloads from go-mode.el
(autoload 'go-mode "go-mode" "\
@ -96,8 +194,8 @@ Tries to look for a URL at point.
;;;***
;;;### (autoloads nil nil ("go-mode-pkg.el") (22490 24935 844909
;;;;;; 520000))
;;;### (autoloads nil nil ("go-mode-pkg.el") (22528 41395 685074
;;;;;; 38000))
;;;***

View File

@ -0,0 +1,5 @@
(define-package "go-mode" "20161013.1055" "Major mode for the Go programming language" 'nil :url "https://github.com/dominikh/go-mode.el" :keywords
'("languages" "go"))
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@ -3,8 +3,8 @@
;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "js2-imenu-extras" "js2-imenu-extras.el" (22523
;;;;;; 21232 276321 957000))
;;;### (autoloads nil "js2-imenu-extras" "js2-imenu-extras.el" (22528
;;;;;; 31234 288278 643000))
;;; Generated autoloads from js2-imenu-extras.el
(autoload 'js2-imenu-extras-setup "js2-imenu-extras" "\
@ -19,8 +19,8 @@ Toggle Imenu support for frameworks and structural patterns.
;;;***
;;;### (autoloads nil "js2-mode" "js2-mode.el" (22523 21232 296322
;;;;;; 105000))
;;;### (autoloads nil "js2-mode" "js2-mode.el" (22528 31234 308278
;;;;;; 621000))
;;; Generated autoloads from js2-mode.el
(autoload 'js2-highlight-unused-variables-mode "js2-mode" "\
@ -56,7 +56,7 @@ variables (`sgml-basic-offset' et al) locally, like so:
;;;***
;;;### (autoloads nil nil ("js2-mode-pkg.el" "js2-old-indent.el")
;;;;;; (22523 21232 288322 46000))
;;;;;; (22528 31234 300278 630000))
;;;***

View File

@ -1,4 +1,4 @@
(define-package "js2-mode" "20161009.341" "Improved JavaScript editing mode"
(define-package "js2-mode" "20161013.1644" "Improved JavaScript editing mode"
'((emacs "24.1")
(cl-lib "0.5"))
:url "https://github.com/mooz/js2-mode/" :keywords

View File

@ -115,7 +115,7 @@
decodeURI decodeURIComponent encodeURI
encodeURIComponent escape eval isFinite isNaN
parseFloat parseInt undefined unescape))
"Ecma-262 externs. Included in `js2-externs' by default.")
"Ecma-262 externs. Never highlighted as undeclared variables.")
(defvar js2-browser-externs
(mapcar 'symbol-name
@ -789,28 +789,10 @@ Will only be used when we finish implementing the interpreter.")
(defcustom js2-global-externs nil
"A list of any extern names you'd like to consider always declared.
This list is global and is used by all `js2-mode' files.
You can create buffer-local externs list using `js2-additional-externs'.
There is also a buffer-local variable `js2-default-externs',
which is initialized by default to include the Ecma-262 externs
and the standard browser externs. The three lists are all
checked during highlighting."
You can create buffer-local externs list using `js2-additional-externs'."
:type 'list
:group 'js2-mode)
(js2-deflocal js2-default-externs nil
"Default external declarations.
These are currently only used for highlighting undeclared variables,
which only worries about top-level (unqualified) references.
As js2-mode's processing improves, we will flesh out this list.
The initial value is set to `js2-ecma-262-externs', unless some
of the `js2-include-?-externs' variables are set to t, in which
case the browser, Rhino and/or Node.js externs are also included.
See `js2-additional-externs' for more information.")
(defcustom js2-include-browser-externs t
"Non-nil to include browser externs in the master externs list.
If you work on JavaScript files that are not intended for browsers,
@ -834,7 +816,7 @@ See `js2-additional-externs' for more information about externs."
(js2-deflocal js2-additional-externs nil
"A buffer-local list of additional external declarations.
It is used to decide whether variables are considered undeclared
for purposes of highlighting.
for purposes of highlighting. See `js2-highlight-undeclared-vars'.
Each entry is a Lisp string. The string should be the fully qualified
name of an external entity. All externs should be added to this list,
@ -1122,7 +1104,7 @@ another file, or you've got a potential bug."
(defcustom js2-include-jslint-globals t
"Non-nil to include the identifiers from JSLint global
declaration (see http://www.jslint.com/lint.html#global) in the
declaration (see http://www.jslint.com/help.html#global) in the
buffer-local externs list. See `js2-additional-externs' for more
information."
:type 'boolean
@ -7090,16 +7072,37 @@ later. NODE must be a name node."
(defun js2-highlight-undeclared-vars ()
"After entire parse is finished, look for undeclared variable references.
We have to wait until entire buffer is parsed, since JavaScript permits var
decls to occur after they're used.
declarations to occur after they're used.
If any undeclared var name is in `js2-externs' or `js2-additional-externs',
it is considered declared."
(let (name)
Some identifiers may be assumed to be externally defined.
These externs are not highlighted, even if there is no declaration
for them in the source code (in the current file).
The list of externs consists of the following:
- `js2-ecma262-externs' for basic names from the ECMAScript language standard.
- Depending on the buffer-local variables `js2-include-*-externs'
the corresponding `js2-*-externs' to add names for certain environments
like the browser, Node or Rhino.
- Two customizable lists `js2-global-externs' and `js2-additional-externs',
the latter of which should be set per-buffer.
See especially `js2-additional-externs' for further details about externs."
(let ((default-externs
(append js2-ecma-262-externs
(if (and js2-include-browser-externs
(>= js2-language-version 200)) js2-harmony-externs)
(if js2-include-rhino-externs js2-rhino-externs)
(if js2-include-node-externs js2-node-externs)
(if (or js2-include-browser-externs js2-include-node-externs)
js2-typed-array-externs)
(if js2-include-browser-externs js2-browser-externs)))
name)
(dolist (entry js2-recorded-identifiers)
(cl-destructuring-bind (name-node scope pos end) entry
(setq name (js2-name-node-name name-node))
(unless (or (member name js2-global-externs)
(member name js2-default-externs)
(member name default-externs)
(member name js2-additional-externs)
(js2-get-defining-scope scope name pos))
(js2-report-warning "msg.undeclared.variable" name pos (- end pos)
@ -7259,19 +7262,6 @@ are ignored."
(remove-hook 'js2-post-parse-callbacks
#'js2-highlight-unused-variables t)))
(defun js2-set-default-externs ()
"Set the value of `js2-default-externs' based on the various
`js2-include-?-externs' variables."
(setq js2-default-externs
(append js2-ecma-262-externs
(if js2-include-browser-externs js2-browser-externs)
(if (and js2-include-browser-externs
(>= js2-language-version 200)) js2-harmony-externs)
(if js2-include-rhino-externs js2-rhino-externs)
(if js2-include-node-externs js2-node-externs)
(if (or js2-include-browser-externs js2-include-node-externs)
js2-typed-array-externs))))
(defun js2-apply-jslint-globals ()
(setq js2-additional-externs
(nconc (js2-get-jslint-globals)
@ -11421,7 +11411,6 @@ highlighting features of `js2-mode'."
(set (make-local-variable 'max-lisp-eval-depth)
(max max-lisp-eval-depth 3000))
(setq next-error-function #'js2-next-error)
(js2-set-default-externs)
;; Experiment: make reparse-delay longer for longer files.
(if (cl-plusp js2-dynamic-idle-timer-adjust)
(setq js2-idle-timer-delay
@ -11600,8 +11589,6 @@ Selecting an error will jump it to the corresponding source-buffer error.
js2-mode-buffer-dirty-p t
js2-mode-parsing nil)
(js2-set-default-externs)
(when js2-include-jslint-globals
(add-hook 'js2-post-parse-callbacks 'js2-apply-jslint-globals nil t))

View File

@ -1,177 +0,0 @@
This is magit.info, produced by makeinfo version 5.2 from magit.texi.
Magit is an interface to the version control system Git, implemented as
an Emacs package. Magit aspires to be a complete Git porcelain. While
we cannot (yet) claim that Magit wraps and improves upon each and every
Git command, it is complete enough to allow even experienced Git users
to perform almost all of their daily version control tasks directly from
within Emacs. While many fine Git clients exist, only Magit and Git
itself deserve to be called porcelains.
Copyright (C) 2015-2016 Jonas Bernoulli <jonas@bernoul.li>
You can redistribute this document and/or modify it under the terms
of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version.
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* Magit: (magit). Using Git from Emacs with Magit.
END-INFO-DIR-ENTRY

Indirect:
magit.info-1: 1222
magit.info-2: 321010

Tag Table:
(Indirect)
Node: Top1222
Node: Introduction6446
Node: Installation11169
Node: Updating from an older release11544
Node: Installing from an Elpa archive13139
Node: Installing from the Git repository14478
Node: Post-installation tasks17325
Node: Getting started18714
Node: Interface concepts24443
Node: Modes and Buffers24717
Node: Switching Buffers26462
Node: Naming Buffers31003
Node: Quitting Windows33838
Node: Automatic Refreshing of Magit Buffers35470
Node: Automatic Saving of File-Visiting Buffers38238
Node: Automatic Reverting of File-Visiting Buffers39423
Node: Risk of Reverting Automatically44419
Node: Sections46802
Node: Section movement47743
Node: Section visibility51670
Node: Section hooks55261
Node: Section types and values57542
Node: Section options58812
Node: Popup buffers and prefix commands59284
Node: Completion and confirmation60598
Node: Running Git63504
Node: Viewing Git output63740
Node: Running Git manually64740
Node: Git executable66866
Node: Global Git arguments68873
Node: Inspecting69680
Node: Status buffer70827
Node: Status sections73692
Node: Status header sections79571
Node: Status options82128
Node: Repository list82852
Node: Logging85010
Node: Refreshing logs87748
Node: Log Buffer89133
Node: Select from log92429
Node: Reflog93369
Node: Diffing93847
Node: Refreshing diffs96867
Node: Diff buffer99848
Node: Diff options102074
Node: Revision buffer105440
Node: Ediffing106395
Node: References buffer109985
Node: References sections114695
Node: Bisecting115570
Node: Visiting blobs117309
Node: Blaming117818
Node: Manipulating121248
Node: Repository setup121564
Node: Staging and unstaging122604
Node: Staging from file-visiting buffers126693
Node: Applying127861
Node: Committing129754
Node: Initiating a commit130337
Node: Editing commit messages133649
Node: Branching144045
Node: The two remotes144245
Node: The branch popup146789
Node: The branch config popup156025
Node: Merging161931
Node: Resolving conflicts164099
Ref: orgradiotarget1165184
Node: Rebasing169056
Node: Editing rebase sequences172697
Node: Information about in-progress rebase175727
Ref: Information about in-progress rebase-Footnote-1182563
Node: Cherry picking183149
Node: Reverting184755
Node: Resetting186118
Node: Stashing187630
Node: Transferring190804
Node: Remotes191042
Node: Fetching192328
Node: Pulling193694
Node: Pushing194540
Node: Creating and sending patches199284
Node: Applying patches199979
Node: Miscellaneous200977
Node: Tagging201280
Node: Notes202065
Node: Submodules204590
Node: Listing submodules204805
Node: Submodule popup206624
Node: Subtree207907
Node: Common commands209155
Node: Wip modes210900
Node: Minor mode for buffers visiting files217636
Node: Minor mode for buffers visiting blobs221110
Node: Customizing221915
Node: Per-repository configuration223587
Node: Essential settings225221
Node: Safety225545
Node: Performance227378
Node: Plumbing235340
Node: Calling Git236164
Node: Getting a value from Git237687
Node: Calling Git for effect240791
Node: Section plumbing247295
Node: Creating sections247523
Node: Section selection251422
Node: Matching sections253102
Node: Refreshing buffers258311
Node: Conventions261446
Node: Confirmation and completion261623
Node: Theming Faces262521
Node: FAQ270672
Node: Magit is slow272285
Node: I changed several thousand files at once and now Magit is unusable272486
Node: I am having problems committing273202
Node: Diffs are collapsed after un-/staging273648
Node: I don't understand how branching and pushing work275126
Node: I don't like the key binding in v24275501
Node: I cannot install the pre-requisites for Magit v2275840
Node: I am using an Emacs release older than v244276305
Node: I am using a Git release older than v194277918
Node: I am using MS Windows and cannot push with Magit278905
Node: I am using OS X and SOMETHING works in shell but not in Magit279509
Node: How to install the gitman info manual?280300
Node: How can I show Git's output?282841
Node: Diffs contain control sequences283628
Node: Expanding a file to show the diff causes it to disappear284633
Node: Point is wrong in the COMMIT_EDITMSG buffer285168
Node: The mode-line information isn't always up-to-date286198
Node: Can Magit be used as ediff-version-control-package?287266
Node: How to show diffs for gpg-encrypted files?289310
Node: Emacs 245 hangs when loading Magit289907
Node: Symbol's value as function is void --some290482
Node: Where is the branch manager290816
Node: Keystroke Index291107
Node: Command Index321010
Node: Function Index351019
Node: Variable Index364913

End Tag Table

Local Variables:
coding: utf-8
End:

View File

@ -419,7 +419,9 @@ running 'man git-rebase' at the command line) for details."
(setq save-place nil)))
(defun git-rebase-cancel-confirm (force)
(or (not (buffer-modified-p)) force (magit-y-or-n-p "Abort this rebase? ")))
(or (not (buffer-modified-p))
force
(magit-confirm 'abort-rebase "Abort this rebase")))
(defun git-rebase-autostash-save ()
(--when-let (magit-file-line (magit-git-dir "rebase-merge/autostash"))

View File

@ -3,8 +3,8 @@
;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "git-rebase" "git-rebase.el" (22527 12701 974689
;;;;;; 557000))
;;;### (autoloads nil "git-rebase" "git-rebase.el" (22528 41393 93076
;;;;;; 154000))
;;; Generated autoloads from git-rebase.el
(autoload 'git-rebase-mode "git-rebase" "\
@ -23,7 +23,7 @@ running 'man git-rebase' at the command line) for details.
;;;***
;;;### (autoloads nil "magit" "magit.el" (22527 12702 54689 632000))
;;;### (autoloads nil "magit" "magit.el" (22528 41393 173076 88000))
;;; Generated autoloads from magit.el
(autoload 'magit-status "magit" "\
@ -501,8 +501,8 @@ Git, and Emacs in the echo area.
;;;***
;;;### (autoloads nil "magit-apply" "magit-apply.el" (22527 12701
;;;;;; 994689 575000))
;;;### (autoloads nil "magit-apply" "magit-apply.el" (22528 41393
;;;;;; 113076 138000))
;;; Generated autoloads from magit-apply.el
(autoload 'magit-stage-file "magit-apply" "\
@ -538,8 +538,8 @@ Remove all changes from the staging area.
;;;***
;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (22527
;;;;;; 12701 942689 527000))
;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (22528
;;;;;; 41393 49076 189000))
;;; Generated autoloads from magit-autorevert.el
(defvar magit-revert-buffers t)
@ -568,8 +568,8 @@ See `auto-revert-mode' for more information on Auto-Revert mode.
;;;***
;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (22527 12701
;;;;;; 990689 572000))
;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (22528 41393
;;;;;; 109076 140000))
;;; Generated autoloads from magit-bisect.el
(autoload 'magit-bisect-popup "magit-bisect" nil t)
@ -620,8 +620,8 @@ bisect run'.
;;;***
;;;### (autoloads nil "magit-blame" "magit-blame.el" (22527 12702
;;;;;; 38689 617000))
;;;### (autoloads nil "magit-blame" "magit-blame.el" (22528 41393
;;;;;; 161076 99000))
;;; Generated autoloads from magit-blame.el
(autoload 'magit-blame-popup "magit-blame" nil t)
@ -645,8 +645,8 @@ only arguments available from `magit-blame-popup' should be used.
;;;***
;;;### (autoloads nil "magit-commit" "magit-commit.el" (22527 12701
;;;;;; 950689 534000))
;;;### (autoloads nil "magit-commit" "magit-commit.el" (22528 41393
;;;;;; 57076 182000))
;;; Generated autoloads from magit-commit.el
(autoload 'magit-commit "magit-commit" "\
@ -728,8 +728,8 @@ Create a squash commit targeting COMMIT and instantly rebase.
;;;***
;;;### (autoloads nil "magit-diff" "magit-diff.el" (22527 12702 34689
;;;;;; 614000))
;;;### (autoloads nil "magit-diff" "magit-diff.el" (22528 41393 157076
;;;;;; 101000))
;;; Generated autoloads from magit-diff.el
(autoload 'magit-diff-popup "magit-diff" "\
@ -813,8 +813,8 @@ for a revision.
;;;***
;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (22527 12702
;;;;;; 18689 598000))
;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (22528 41393
;;;;;; 145076 110000))
;;; Generated autoloads from magit-ediff.el
(autoload 'magit-ediff-popup "magit-ediff" nil t)
@ -902,8 +902,8 @@ stash that were staged.
;;;***
;;;### (autoloads nil "magit-extras" "magit-extras.el" (22527 12701
;;;;;; 954689 537000))
;;;### (autoloads nil "magit-extras" "magit-extras.el" (22528 41393
;;;;;; 61076 179000))
;;; Generated autoloads from magit-extras.el
(autoload 'magit-run-git-gui "magit-extras" "\
@ -973,8 +973,8 @@ on a position in a file-visiting buffer.
;;;***
;;;### (autoloads nil "magit-log" "magit-log.el" (22527 12702 26689
;;;;;; 605000))
;;;### (autoloads nil "magit-log" "magit-log.el" (22528 41393 149076
;;;;;; 107000))
;;; Generated autoloads from magit-log.el
(autoload 'magit-log-buffer-file-popup "magit-log" "\
@ -1056,8 +1056,8 @@ Show commits in a branch that are not merged in the upstream branch.
;;;***
;;;### (autoloads nil "magit-remote" "magit-remote.el" (22527 12702
;;;;;; 66689 643000))
;;;### (autoloads nil "magit-remote" "magit-remote.el" (22528 41393
;;;;;; 189076 75000))
;;; Generated autoloads from magit-remote.el
(autoload 'magit-clone "magit-remote" "\
@ -1289,8 +1289,8 @@ is asked to pull. START has to be reachable from that commit.
;;;***
;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (22527
;;;;;; 12702 58689 636000))
;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (22528
;;;;;; 41393 177076 85000))
;;; Generated autoloads from magit-sequence.el
(autoload 'magit-sequencer-continue "magit-sequence" "\
@ -1440,8 +1440,8 @@ Abort the current rebase operation, restoring the original branch.
;;;***
;;;### (autoloads nil "magit-stash" "magit-stash.el" (22527 12702
;;;;;; 10689 590000))
;;;### (autoloads nil "magit-stash" "magit-stash.el" (22528 41393
;;;;;; 133076 121000))
;;; Generated autoloads from magit-stash.el
(autoload 'magit-stash-popup "magit-stash" nil t)
@ -1540,8 +1540,8 @@ Show all diffs of a stash in a buffer.
;;;***
;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (22527
;;;;;; 12702 78689 654000))
;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (22528
;;;;;; 41393 213076 56000))
;;; Generated autoloads from magit-submodule.el
(autoload 'magit-submodule-popup "magit-submodule" nil t)
@ -1631,8 +1631,8 @@ Display a list of the current repository's submodules.
;;;***
;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (22527 12701
;;;;;; 978689 560000))
;;;### (autoloads nil "magit-subtree" "magit-subtree.el" (22528 41393
;;;;;; 101076 146000))
;;; Generated autoloads from magit-subtree.el
(autoload 'magit-subtree-popup "magit-subtree" nil t)
@ -1668,8 +1668,8 @@ Extract the history of the subtree PREFIX.
;;;***
;;;### (autoloads nil "magit-wip" "magit-wip.el" (22527 12701 962689
;;;;;; 545000))
;;;### (autoloads nil "magit-wip" "magit-wip.el" (22528 41393 73076
;;;;;; 170000))
;;; Generated autoloads from magit-wip.el
(defvar magit-wip-after-save-mode nil "\
@ -1739,7 +1739,7 @@ command which is about to be called are committed.
;;;### (autoloads nil nil ("magit-core.el" "magit-git.el" "magit-mode.el"
;;;;;; "magit-pkg.el" "magit-process.el" "magit-section.el" "magit-utils.el")
;;;;;; (22527 12702 70689 646000))
;;;;;; (22528 41393 197076 69000))
;;;***

View File

@ -207,6 +207,20 @@ many spaces. Otherwise, highlight neither."
:group 'magit-diff
:type 'boolean)
(defcustom magit-diff-visit-previous-blob t
"Whether `magit-diff-visit-file' may visit the previous blob.
When this is t and point is on a removed line in a diff for a
committed change, then `magit-diff-visit-file' visits the blob
from the last revision which still had that line.
Currently this is only supported for committed changes, for
staged and unstaged changes `magit-diff-visit-file' always
visits the file in the working tree."
:package-version '(magit . "2.9.0")
:group 'magit-diff
:type 'boolean)
;;;; File Diff
(defcustom magit-diff-buffer-file-locked t
@ -498,6 +512,7 @@ and `:slant'."
:group 'magit-faces)
;;; Commands
;;;; Diff popups
(defconst magit-diff-popup-common
'(:variable magit-diff-arguments
@ -663,6 +678,8 @@ buffer."
(?p "[p]atience" "patience")
(?h "[h]istogram" "histogram")))
;;;; Diff commands
;;;###autoload
(defun magit-diff-dwim (&optional args files)
"Show changes for the thing at point."
@ -700,6 +717,17 @@ If no DWIM context is found, nil is returned."
(concat (car (last it)) ".." (car it))))
(magit-buffer-refname
(cons 'commit magit-buffer-refname))
((derived-mode-p 'magit-stash-mode)
(cons 'commit
(magit-section-case
(commit (magit-section-value it))
(file (-> it
magit-section-parent
magit-section-value))
(hunk (-> it
magit-section-parent
magit-section-parent
magit-section-value)))))
((derived-mode-p 'magit-revision-mode)
(cons 'commit (car magit-refresh-args)))
((derived-mode-p 'magit-diff-mode)
@ -894,6 +922,8 @@ for a revision."
(magit-section-cache-visibility child)))))))
(magit-mode-setup #'magit-revision-mode rev nil args files)))
;;;; Setting commands
(defun magit-diff-refresh (args files)
"Set the local diff arguments for the current buffer."
(interactive (magit-diff-arguments t))
@ -1018,6 +1048,8 @@ Customize variable `magit-diff-refine-hunk' to change the default mode."
(not magit-diff-refine-hunk)))
(magit-diff-update-hunk-refinement))
;;;; Visit commands
(defun magit-diff-visit-file (file &optional other-window force-worktree)
"From a diff, visit the corresponding file at the appropriate position.
@ -1030,10 +1062,6 @@ parent of the commit which removed that line, i.e. the last
commit where that line still existed. Otherwise visit the blob
for the commit whose changes are being shown.
When the diff is about a range of commits, then, for the time
being, the point this function jumps to often is only an
approximation.
When the file or blob to be displayed is already being displayed
in another window of the same frame, then just select that window
and adjust point. Otherwise, or with a prefix argument, display
@ -1044,66 +1072,42 @@ the buffer in another window."
current-prefix-arg))
(if (magit-file-accessible-directory-p file)
(magit-diff-visit-directory file other-window)
(let ((current (magit-current-section))
(rev (cond (force-worktree nil)
((derived-mode-p 'magit-revision-mode)
(car magit-refresh-args))
((derived-mode-p 'magit-stash-mode)
(magit-section-case
(file (-> it
magit-section-parent
magit-section-value))
(hunk (-> it
magit-section-parent
magit-section-parent
magit-section-value))))
((derived-mode-p 'magit-diff-mode)
(--when-let (car magit-refresh-args)
(and (string-match "\\.\\.\\([^.].*\\)?[ \t]*\\'" it)
(match-string 1 it))))
))
(unmerged-p (magit-anything-unmerged-p file))
hunk line col buffer)
(pcase (magit-diff-scope)
((or `hunk `region)
(cond ((not rev))
((save-excursion (goto-char (line-beginning-position))
(looking-at "-"))
(setq rev (magit-rev-name (concat rev "~"))))
((magit-rev-head-p rev)
(setq rev nil)))
(setq hunk current))
((or `file `files)
(setq hunk (car (magit-section-children current))))
(`list
(setq hunk (car (magit-section-children
(car (magit-section-children current)))))))
(when (and rev (magit-rev-head-p rev))
(setq rev nil))
(when (and hunk
;; Currently the `hunk' type is also abused for file
;; mode changes. Luckily such sections have no value.
(magit-section-value hunk))
(setq line (magit-diff-hunk-line hunk)
col (magit-diff-hunk-column hunk)))
(setq buffer (if rev
(let* ((hunk (magit-diff-visit--hunk))
(line (and hunk (magit-diff-hunk-line hunk)))
(col (and hunk (magit-diff-hunk-column hunk)))
(rev (if (and magit-diff-visit-previous-blob
(magit-section-match 'hunk)
(save-excursion
(goto-char (line-beginning-position))
(looking-at "-")))
(magit-diff-visit--range-beginning)
(magit-diff-visit--range-end)))
(buf (if (and (not force-worktree)
(stringp rev))
(magit-find-file-noselect rev file)
(or (get-file-buffer file)
(find-file-noselect file))))
(magit-display-file-buffer buffer)
(with-current-buffer buffer
(find-file-noselect file)))))
(magit-display-file-buffer buf)
(with-current-buffer buf
(when line
(setq line
(cond ((eq rev 'staged)
(apply 'magit-diff-visit--offset file nil line))
((and force-worktree
(stringp rev))
(apply 'magit-diff-visit--offset file rev line))
(t
(apply '+ line))))
(let ((pos (save-restriction
(widen)
(goto-char (point-min))
(forward-line (1- line))
(when col
(move-to-column col))
(move-to-column col)
(point))))
(unless (<= (point-min) pos (point-max))
(widen)
(goto-char pos))))
(when unmerged-p
(when (magit-anything-unmerged-p file)
(smerge-start-session))
(run-hooks 'magit-diff-visit-file-hook)))))
@ -1145,6 +1149,77 @@ or `HEAD'."
current-prefix-arg))
(magit-diff-visit-file file other-window t))
(defun magit-diff-visit--range-end ()
(let ((rev (magit-diff--dwim)))
(if (symbolp rev)
rev
(setq rev (if (consp rev)
(cdr rev)
(car (magit-split-range rev))))
(if (magit-rev-head-p rev)
'unstaged
rev))))
(defun magit-diff-visit--range-beginning ()
(let ((rev (magit-diff--dwim)))
(cond ((consp rev)
(concat (cdr rev) "^"))
((stringp rev)
(cdr (magit-split-range rev)))
(t
rev))))
(defun magit-diff-visit--hunk ()
(-when-let (scope (magit-diff-scope))
(let ((section (magit-current-section)))
(cl-case scope
((file files)
(setq section (car (magit-section-children section))))
(list
(setq section (car (magit-section-children section)))
(when section
(setq section (car (magit-section-children section))))))
(and
;; Unmerged files appear in the list of staged changes
;; but unlike in the list of unstaged changes no diffs
;; are shown here. In that case `section' is nil.
section
;; Currently the `hunk' type is also abused for file
;; mode changes, which we are not interested in here.
;; Such sections have no value.
(magit-section-value section)
section))))
(defun magit-diff-visit--offset (file rev hunk-start line-offset)
(let ((offset 0))
(with-temp-buffer
(save-excursion
(magit-with-toplevel
(magit-git-insert "diff" rev "--" file)))
(catch 'found
(while (re-search-forward
"^@@ -\\([0-9]+\\),\\([0-9]+\\) \\+\\([0-9]+\\),\\([0-9]+\\) @@"
nil t)
(let* ((abeg (string-to-number (match-string 1)))
(alen (string-to-number (match-string 2)))
(bbeg (string-to-number (match-string 3)))
(blen (string-to-number (match-string 4)))
(aend (+ abeg alen))
(bend (+ bbeg blen))
(hend (+ hunk-start line-offset)))
(if (<= abeg hunk-start)
(if (or (>= aend hend)
(>= bend hend))
(let ((line 0))
(while (<= line alen)
(forward-line 1)
(cl-incf line)
(cond ((looking-at "^\\+") (cl-incf offset))
((looking-at "^-") (cl-decf offset)))))
(cl-incf offset (- blen alen)))
(throw 'found nil))))))
(+ hunk-start line-offset offset)))
(defun magit-diff-hunk-line (section)
(let* ((value (magit-section-value section))
(prefix (- (length value) 2))
@ -1155,6 +1230,7 @@ or `HEAD'."
(prior (and (= (length value) 3)
(save-excursion (goto-char (line-beginning-position))
(looking-at "-"))))
(offset 0)
(line (if prior
(cadr value)
(car (last value)))))
@ -1171,9 +1247,9 @@ or `HEAD'."
(unless (string-match-p
(if prior "\\+" "-")
(buffer-substring (point) (+ (point) prefix)))
(cl-incf line))
(cl-incf offset))
(forward-line)))
line))
(list line offset)))
(defun magit-diff-hunk-column (section)
(if (or (< (point) (magit-section-content section))
@ -1192,6 +1268,8 @@ or `HEAD'."
'(display-buffer-same-window))))
(magit-status-internal directory))))
;;;; Scroll commands
(defun magit-diff-show-or-scroll-up ()
"Update the commit or diff buffer for the thing at point.

View File

@ -242,16 +242,12 @@ range)."
'ediff-revision))))
(defun magit-ediff-compare--read-revisions (&optional arg mbase)
(let ((input (or arg (magit-diff-read-range-or-commit "Compare range or commit"
nil mbase)))
revA revB)
(if (string-match magit-range-re input)
(progn (setq revA (or (match-string 1 input) "HEAD")
revB (or (match-string 3 input) "HEAD"))
(when (string= (match-string 2 input) "...")
(setq revA (magit-git-string "merge-base" revA revB))))
(setq revA input))
(list revA revB)))
(let ((input (or arg (magit-diff-read-range-or-commit
"Compare range or commit"
nil mbase))))
(--if-let (magit-split-range input)
(-cons-to-list it)
(list input nil))))
(defun magit-ediff-read-files (revA revB &optional fileB)
"Read file in REVB, return it and the corresponding file in REVA.

View File

@ -482,7 +482,8 @@ returning the truename."
"Return t if `default-directory' is below a repository directory."
;; This does not work if the gitdir is not located inside the
;; working tree: (magit-rev-parse-p "--is-inside-git-dir").
(file-in-directory-p default-directory (magit-git-dir)))
(-when-let (gitdir (magit-git-dir))
(file-in-directory-p default-directory gitdir)))
(defun magit-inside-worktree-p ()
"Return t if `default-directory' is below the work tree of a repository."
@ -1282,6 +1283,15 @@ Return a list of two integers: (A>B B>A)."
"\\(\\.\\.\\.?\\)" ; range marker
"\\([^.][^ \t]*\\)?\\'")) ; revB
(defun magit-split-range (range)
(when (string-match magit-range-re range)
(let ((beg (or (match-string 1 range) "HEAD"))
(end (or (match-string 3 range) "HEAD")))
(cons (if (string-equal (match-string 2) "...")
(magit-git-string "merge-base" beg end)
beg)
end))))
;;; Completion
(defvar magit-revision-history nil)

View File

@ -460,8 +460,11 @@ Magit is documented in info node `(magit)'."
(add-hook 'post-command-hook #'magit-section-update-highlight t t)
(setq-local redisplay-highlight-region-function 'magit-highlight-region)
(setq-local redisplay-unhighlight-region-function 'magit-unhighlight-region)
(when (fboundp 'linum-mode)
(linum-mode -1)))
(when (bound-and-true-p global-linum-mode)
(linum-mode -1))
(when (and (fboundp 'nlinum-mode)
(bound-and-true-p global-nlinum-mode))
(nlinum-mode -1)))
(defvar-local magit-region-overlays nil)

View File

@ -1,4 +1,4 @@
(define-package "magit" "20161012.1035" "A Git porcelain inside Emacs"
(define-package "magit" "20161013.1332" "A Git porcelain inside Emacs"
'((emacs "24.4")
(async "20160711.223")
(dash "20160820.501")

View File

@ -533,18 +533,23 @@ This command is intended for debugging purposes."
;;; Match
(defun magit-section-match (condition &optional section)
(cl-defun magit-section-match
(condition &optional (section (magit-current-section)))
"Return t if SECTION matches CONDITION.
SECTION defaults to the section at point.
Conditions can take the following forms:
SECTION defaults to the section at point. If SECTION is not
specified and there also is no section at point, then return
nil.
CONDITION can take the following forms:
(CONDITION...) matches if any of the CONDITIONs matches.
[TYPE...] matches if the first TYPE matches the type
of the section at point, the second matches
that of its parent, and so on.
of the section, the second matches that of
its parent, and so on.
[* TYPE...] matches sections that match [TYPE...] and
also recursively all their child sections.
TYPE matches TYPE regardless of its parents.
TYPE matches sections of TYPE regardless of the
types of the parent sections.
Each TYPE is a symbol. Note that it is not necessary to specify
all TYPEs up to the root section as printed by
@ -552,41 +557,42 @@ all TYPEs up to the root section as printed by
precise."
;; When recursing SECTION actually is a type list. Matching
;; macros also pass such a list instead of a section struct.
(let ((types (if (magit-section-p section)
(mapcar 'car (magit-section-ident section))
section)))
(when (or types section (magit-current-section))
(and section
(magit-section-match-1 condition
(mapcar #'car (magit-section-ident section)))))
(defun magit-section-match-1 (condition type-list)
(if (listp condition)
(--first (magit-section-match it types) condition)
(magit-section-match-1 (if (symbolp condition)
(--first (magit-section-match-1 it type-list) condition)
(magit-section-match-2 (if (symbolp condition)
(list condition)
(append condition nil))
types)))))
type-list)))
(defun magit-section-match-1 (l1 l2)
(defun magit-section-match-2 (l1 l2)
(or (null l1)
(if (eq (car l1) '*)
(or (magit-section-match-1 (cdr l1) l2)
(or (magit-section-match-2 (cdr l1) l2)
(and l2
(magit-section-match-1 l1 (cdr l2))))
(magit-section-match-2 l1 (cdr l2))))
(and l2
(equal (car l1) (car l2))
(magit-section-match-1 (cdr l1) (cdr l2))))))
(magit-section-match-2 (cdr l1) (cdr l2))))))
(defmacro magit-section-when (condition &rest body)
"If the section at point matches CONDITION evaluate BODY.
If the section matches evaluate BODY forms sequentially and
return the value of the last one, or if there are no BODY forms
return the value of the section. If the section does not match
return nil.
If the section matches, then evaluate BODY forms sequentially
with `it' bound to the section and return the value of the last
form. If there are no BODY forms, then return the value of the
section. If the section does not match or if there is no section
at point then return nil.
See `magit-section-match' for the forms CONDITION can take."
(declare (indent 1)
(debug (sexp body)))
`(--when-let (magit-current-section)
(when (magit-section-match ',condition
(mapcar 'car (magit-section-ident it)))
(when (magit-section-match ',condition it)
,@(or body '((magit-section-value it))))))
(defmacro magit-section-case (&rest clauses)
@ -610,7 +616,7 @@ at point."
(,ident (and it (mapcar 'car (magit-section-ident it)))))
(cond ,@(mapcar (lambda (clause)
`(,(or (eq (car clause) t)
`(and it (magit-section-match
`(and it (magit-section-match-1
',(car clause) ,ident)))
,@(cdr clause)))
clauses)))))

View File

@ -387,7 +387,7 @@ START has to be selected from a list of recent commits."
(setq commit (--if-let (magit-get-upstream-branch)
(magit-git-string "merge-base" it "HEAD")
nil))
(when (magit-git-failure "merge-base" "--is-ancestor" commit "HEAD")
(unless (magit-rev-ancestor-p commit "HEAD")
(user-error "%s isn't an ancestor of HEAD" commit))
(if (magit-commit-parents commit)
(setq commit (concat commit "^"))
@ -483,7 +483,8 @@ edit. With a prefix argument the old message is reused as-is."
"Abort the current rebase operation, restoring the original branch."
(interactive)
(if (magit-rebase-in-progress-p)
(magit-run-git "rebase" "--abort")
(when (magit-confirm 'abort-rebase "Abort this rebase")
(magit-run-git "rebase" "--abort"))
(user-error "No rebase in progress")))
(defun magit-rebase-in-progress-p ()

View File

@ -90,6 +90,17 @@ these commands do:
magit-worktree-branch
magit-tag))
(defconst magit--confirm-actions
'((const reverse) (const discard)
(const rename) (const resurrect)
(const trash) (const delete)
(const abort-rebase)
(const abort-merge) (const merge-dirty)
(const drop-stashes) (const resect-bisect)
(const kill-process) (const delete-unmerged-branch)
(const stage-all-changes) (const unstage-all-changes)
(const safe-with-wip)))
(defcustom magit-no-confirm nil
"A list of symbols for actions Magit should not confirm, or t.
@ -137,6 +148,10 @@ Sequences:
`reset-bisect' Aborting (known to Git as \"resetting\") a
bisect operation loses all information collected so far.
`abort-rebase' Aborting a rebase throws away all already
modified commits, but it's possible to restore those from the
reflog.
`abort-merge' Aborting a merge throws away all conflict
resolutions which has already been carried out by the user.
@ -182,24 +197,26 @@ Global settings:
:package-version '(magit . "2.1.0")
:group 'magit
:group 'magit-commands
:type '(choice (const :tag "No confirmation needed" t)
(set (const reverse) (const discard)
(const rename) (const resurrect)
(const trash) (const delete)
(const abort-merge) (const merge-dirty)
(const drop-stashes) (const resect-bisect)
(const kill-process) (const delete-unmerged-branch)
(const stage-all-changes) (const unstage-all-changes)
(const safe-with-wip))))
:type `(choice (const :tag "Always require confirmation" nil)
(const :tag "Never require confirmation" t)
(set :tag "Require confirmation only for"
,@magit--confirm-actions)))
(defcustom magit-slow-confirm nil
(defcustom magit-slow-confirm '(drop-stashes)
"Whether to ask user \"y or n\" or \"yes or no\" questions.
When this is nil (the default), then `y-or-n-p' is used when the
user has to confirm a potentially destructive action. When this
is non-nil, then `yes-or-no-p' is used instead."
When this is nil, then `y-or-n-p' is used when the user has to
confirm a potentially destructive action. When this is t, then
`yes-or-no-p' is used instead. If this is a list of symbols
identifying actions, then `yes-or-no-p' is used for those,
`y-or-no-p' for all others. The list of actions is the same as
for `magit-no-confirm' (which see)."
:package-version '(magit . "2.9.0")
:group 'magit-commands
:type 'boolean)
:type `(choice (const :tag "Always ask \"yes or no\" questions" t)
(const :tag "Always ask \"y or n\" questions" nil)
(set :tag "Ask yes or no questions only for"
,@magit--confirm-actions)))
(defcustom magit-no-message nil
"A list of messages Magit should not display.
@ -376,10 +393,12 @@ This is similar to `read-string', but
',(mapcar 'car clauses))
,@(--map `(,(car it) ,@(cddr it)) clauses)))
(defun magit-y-or-n-p (prompt)
"Ask user a \"y or n\" or a \"yes or no\" question.
Also see option `magit-slow-confirm'."
(if magit-slow-confirm
(defun magit-y-or-n-p (prompt &optional action)
"Ask user a \"y or n\" or a \"yes or no\" question using PROMPT.
Which kind of question is used depends on whether
ACTION is a member of option `magit-slow-confirm'."
(if (or (eq magit-slow-confirm t)
(and action (member action magit-slow-confirm)))
(yes-or-no-p prompt)
(y-or-n-p prompt)))
@ -400,9 +419,9 @@ Also see option `magit-slow-confirm'."
unstage-all-changes))))))
(or (not sitems) items))
((not sitems)
(magit-y-or-n-p prompt))
(magit-y-or-n-p prompt action))
((= (length items) 1)
(and (magit-y-or-n-p prompt) items))
(and (magit-y-or-n-p prompt action) items))
((> (length items) 1)
(let ((buffer (get-buffer-create " *Magit Confirm*")))
(with-current-buffer buffer
@ -411,7 +430,7 @@ Also see option `magit-slow-confirm'."
'((window-height . fit-window-to-buffer)))
(lambda (window _value)
(with-selected-window window
(unwind-protect (and (magit-y-or-n-p prompt-n) items)
(unwind-protect (and (magit-y-or-n-p prompt-n action) items)
(when (window-live-p window)
(quit-restore-window window 'kill)))))
(dolist (item items)

View File

@ -1009,7 +1009,7 @@ reference, but it is not checked out."
(let ((ref (magit-section-value (magit-current-section))))
(if current-prefix-arg
(magit-show-refs ref)
(if (magit-section-when [branch remote])
(if (magit-section-match [branch remote])
(let ((start ref)
(arg "-b"))
(string-match "^[^/]+/\\(.+\\)" ref)
@ -2938,6 +2938,7 @@ Use the options `magit-repository-directories'
and `magit-repository-directories-depth' to
control which repositories are displayed."
(interactive)
(if magit-repository-directories
(with-current-buffer (get-buffer-create "*Magit Repositories*")
(magit-repolist-mode)
(setq tabulated-list-entries
@ -2951,7 +2952,9 @@ control which repositories are displayed."
it)
(magit-list-repos)))))
(tabulated-list-print)
(switch-to-buffer (current-buffer))))
(switch-to-buffer (current-buffer)))
(message "You need to customize `magit-repository-directories' %s"
"before you can list repositories")))
(defvar magit-repolist-mode-map
(let ((map (make-sparse-keymap)))

View File

@ -0,0 +1,177 @@
This is magit.info, produced by makeinfo version 5.2 from magit.texi.
Magit is an interface to the version control system Git, implemented as
an Emacs package. Magit aspires to be a complete Git porcelain. While
we cannot (yet) claim that Magit wraps and improves upon each and every
Git command, it is complete enough to allow even experienced Git users
to perform almost all of their daily version control tasks directly from
within Emacs. While many fine Git clients exist, only Magit and Git
itself deserve to be called porcelains.
Copyright (C) 2015-2016 Jonas Bernoulli <jonas@bernoul.li>
You can redistribute this document and/or modify it under the terms
of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version.
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* Magit: (magit). Using Git from Emacs with Magit.
END-INFO-DIR-ENTRY

Indirect:
magit.info-1: 1222
magit.info-2: 321601

Tag Table:
(Indirect)
Node: Top1222
Node: Introduction6446
Node: Installation11169
Node: Updating from an older release11544
Node: Installing from an Elpa archive13139
Node: Installing from the Git repository14478
Node: Post-installation tasks17325
Node: Getting started18714
Node: Interface concepts24443
Node: Modes and Buffers24717
Node: Switching Buffers26462
Node: Naming Buffers31003
Node: Quitting Windows33838
Node: Automatic Refreshing of Magit Buffers35470
Node: Automatic Saving of File-Visiting Buffers38238
Node: Automatic Reverting of File-Visiting Buffers39423
Node: Risk of Reverting Automatically44419
Node: Sections46802
Node: Section movement47743
Node: Section visibility51670
Node: Section hooks55261
Node: Section types and values57542
Node: Section options58812
Node: Popup buffers and prefix commands59284
Node: Completion and confirmation60598
Node: Running Git63504
Node: Viewing Git output63740
Node: Running Git manually64740
Node: Git executable66866
Node: Global Git arguments68873
Node: Inspecting69680
Node: Status buffer70827
Node: Status sections73692
Node: Status header sections79571
Node: Status options82128
Node: Repository list82852
Node: Logging85010
Node: Refreshing logs87748
Node: Log Buffer89133
Node: Select from log92429
Node: Reflog93369
Node: Diffing93847
Node: Refreshing diffs96867
Node: Diff buffer99848
Node: Diff options102442
Node: Revision buffer105808
Node: Ediffing106763
Node: References buffer110353
Node: References sections115063
Node: Bisecting115938
Node: Visiting blobs117677
Node: Blaming118186
Node: Manipulating121616
Node: Repository setup121932
Node: Staging and unstaging122972
Node: Staging from file-visiting buffers127061
Node: Applying128229
Node: Committing130122
Node: Initiating a commit130705
Node: Editing commit messages134017
Node: Branching144413
Node: The two remotes144613
Node: The branch popup147157
Node: The branch config popup156393
Node: Merging162299
Node: Resolving conflicts164467
Ref: orgradiotarget1165552
Node: Rebasing169424
Node: Editing rebase sequences173065
Node: Information about in-progress rebase176095
Ref: Information about in-progress rebase-Footnote-1182931
Node: Cherry picking183517
Node: Reverting185123
Node: Resetting186486
Node: Stashing187998
Node: Transferring191172
Node: Remotes191410
Node: Fetching192696
Node: Pulling194062
Node: Pushing194908
Node: Creating and sending patches199652
Node: Applying patches200347
Node: Miscellaneous201345
Node: Tagging201648
Node: Notes202433
Node: Submodules204958
Node: Listing submodules205173
Node: Submodule popup206992
Node: Subtree208275
Node: Common commands209523
Node: Wip modes211268
Node: Minor mode for buffers visiting files218004
Node: Minor mode for buffers visiting blobs221478
Node: Customizing222283
Node: Per-repository configuration223955
Node: Essential settings225589
Node: Safety225913
Node: Performance227746
Node: Plumbing235708
Node: Calling Git236532
Node: Getting a value from Git238055
Node: Calling Git for effect241159
Node: Section plumbing247663
Node: Creating sections247891
Node: Section selection251790
Node: Matching sections253470
Node: Refreshing buffers258902
Node: Conventions262037
Node: Confirmation and completion262214
Node: Theming Faces263112
Node: FAQ271263
Node: Magit is slow272876
Node: I changed several thousand files at once and now Magit is unusable273077
Node: I am having problems committing273793
Node: Diffs are collapsed after un-/staging274239
Node: I don't understand how branching and pushing work275717
Node: I don't like the key binding in v24276092
Node: I cannot install the pre-requisites for Magit v2276431
Node: I am using an Emacs release older than v244276896
Node: I am using a Git release older than v194278509
Node: I am using MS Windows and cannot push with Magit279496
Node: I am using OS X and SOMETHING works in shell but not in Magit280100
Node: How to install the gitman info manual?280891
Node: How can I show Git's output?283432
Node: Diffs contain control sequences284219
Node: Expanding a file to show the diff causes it to disappear285224
Node: Point is wrong in the COMMIT_EDITMSG buffer285759
Node: The mode-line information isn't always up-to-date286789
Node: Can Magit be used as ediff-version-control-package?287857
Node: How to show diffs for gpg-encrypted files?289901
Node: Emacs 245 hangs when loading Magit290498
Node: Symbol's value as function is void --some291073
Node: Where is the branch manager291407
Node: Keystroke Index291698
Node: Command Index321601
Node: Function Index351610
Node: Variable Index365504

End Tag Table

Local Variables:
coding: utf-8
End:

View File

@ -2694,15 +2694,22 @@ File: magit.info, Node: Diff buffer, Next: Diff options, Prev: Refreshing dif
where that line still existed. Otherwise visit the blob for the
commit whose changes are being shown.
When the diff is about a range of commits, then, for the time
being, the point this function jumps to often is only an
approximation.
When the file or blob to be displayed is already being displayed in
another window of the same frame, then just select that window and
adjust point. Otherwise, or with a prefix argument, display the
buffer in another window.
-- User Option: magit-diff-visit-previous-blob
This option controls whether magit-diff-visit-file may visit the
previous blob. When this is t and point is on a removed line in
a diff for a committed change, then magit-diff-visit-file visits
the blob from the last revision which still had that line.
Currently this is only supported for committed changes, for staged
and unstaged changes magit-diff-visit-file always visits the file
in the working tree.
C-<return> (magit-diff-visit-file-worktree)
From a diff, visit the corresponding file at the appropriate
@ -6720,17 +6727,18 @@ File: magit.info, Node: Matching sections, Prev: Section selection, Up: Secti
-- Function: magit-section-match condition &optional section
Return t if SECTION matches CONDITION. SECTION defaults to the
section at point.
section at point. If SECTION is not specified and there also is no
section at point, then return nil.
Conditions can take the following forms:
CONDITION can take the following forms:
(CONDITION...)
matches if any of the CONDITIONs matches.
[TYPE...]
matches if the first TYPE matches the type of the section at
point, the second matches that of its parent, and so on.
matches if the first TYPE matches the type of the section, the
second matches that of its parent, and so on.
[* TYPE...]
@ -6739,7 +6747,8 @@ File: magit.info, Node: Matching sections, Prev: Section selection, Up: Secti
TYPE
matches TYPE regardless of its parents.
matches sections of TYPE regardless of the types of the parent
sections.
Each TYPE is a symbol. Note that it is not necessary to specify
all TYPEs up to the root section as printed by
magit-describe-type, unless of course you want to be that
@ -6749,9 +6758,11 @@ File: magit.info, Node: Matching sections, Prev: Section selection, Up: Secti
If the section at point matches CONDITION evaluate BODY.
If the section matches evaluate BODY forms sequentially and return
the value of the last one, or if there are no BODY forms return the
value of the section. If the section does not match return nil.
If the section matches, then evaluate BODY forms sequentially with
it bound to the section and return the value of the last form.
If there are no BODY forms, then return the value of the section.
If the section does not match or if there is no section at point
then return nil.
See magit-section-match for the forms CONDITION can take.
@ -7575,7 +7586,7 @@ Appendix B Keystroke Index
* c s: Initiating a commit. (line 54)
* c S: Initiating a commit. (line 62)
* c w: Initiating a commit. (line 32)
* C-<return>: Diff buffer. (line 29)
* C-<return>: Diff buffer. (line 36)
* C-<tab>: Section visibility. (line 13)
* C-c C-a: Editing commit messages.
(line 128)
@ -7656,7 +7667,7 @@ Appendix B Keystroke Index
* d w: Diffing. (line 43)
* D w: Refreshing diffs. (line 28)
* DEL: Log Buffer. (line 43)
* DEL <1>: Diff buffer. (line 56)
* DEL <1>: Diff buffer. (line 63)
* DEL <2>: Blaming. (line 44)
* DEL <3>: Editing rebase sequences.
(line 28)
@ -7690,7 +7701,7 @@ Appendix B Keystroke Index
(line 22)
* G: Automatic Refreshing of Magit Buffers.
(line 31)
* j: Diff buffer. (line 46)
* j: Diff buffer. (line 53)
* k: Viewing Git output. (line 19)
* k <1>: Applying. (line 40)
* k <2>: Editing rebase sequences.
@ -7838,7 +7849,7 @@ Appendix B Keystroke Index
(line 59)
* S-<tab>: Section visibility. (line 22)
* SPC: Log Buffer. (line 33)
* SPC <1>: Diff buffer. (line 52)
* SPC <1>: Diff buffer. (line 59)
* SPC <2>: Blaming. (line 34)
* SPC <3>: Editing rebase sequences.
(line 21)

View File

@ -4,8 +4,8 @@
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil nil ("magithub-cache.el" "magithub-ci.el" "magithub-core.el"
;;;;;; "magithub-issue.el" "magithub-pkg.el" "magithub.el") (22525
;;;;;; 59330 912480 205000))
;;;;;; "magithub-issue.el" "magithub-pkg.el" "magithub.el") (22528
;;;;;; 31239 328273 102000))
;;;***

View File

@ -109,11 +109,11 @@ See also `magithub-repo-id'."
(defun magithub-ci-status--parse-2.2.8 (output)
"Backwards compatibility for old versions of hub.
See `magithub-ci-status--parse'."
(--when-let (cdr (s-match (rx bos (group (+ (any alpha space)))
(-when-let (matches (cdr (s-match (rx bos (group (+ (any alpha space)))
(? ": " (group (+ (not (any " "))))) eos)
output))
(let ((status (list :status (intern (replace-regexp-in-string "\s" "-" (car it)))
:url (cadr it))))
output)))
(let ((status (list :status (intern (replace-regexp-in-string "\s" "-" (car matches)))
:url (cadr matches))))
(magithub-ci-update-urls (list status))
status)))
@ -122,11 +122,11 @@ See `magithub-ci-status--parse'."
(let* ((current-commit (magit-rev-parse "HEAD"))
(last-commit (or for-commit current-commit))
(output (magithub--command-output "ci-status" `("-v" ,last-commit))))
(--if-let (if (magithub-hub-version-at-least "2.3")
(-if-let (check (if (magithub-hub-version-at-least "2.3")
(car (magithub-ci-status--parse output))
(magithub-ci-status--parse-2.2.8 (car output)))
(prog1 (or (plist-get it :status) 'no-status)
(if (not (or for-commit (plist-get it :status)))
(magithub-ci-status--parse-2.2.8 (car output))))
(prog1 (or (plist-get check :status) 'no-status)
(if (not (or for-commit (plist-get check :status)))
(let ((last-commit (magithub-ci-status--last-commit)))
(unless (string-equal current-commit last-commit)
(magithub-ci-status--internal last-commit))
@ -158,10 +158,10 @@ The first status will be an `overall' status."
(defun magithub-ci-status--parse-line (line)
"Parse a single LINE of status into a status plist."
(--if-let (cdr (s-match magithub-ci-status-regex line))
(list :status (cdr (assoc (car it) magithub-ci-status-symbol-alist))
:url (car (cddr it))
:check (cadr it))
(-if-let (matches (cdr (s-match magithub-ci-status-regex line)))
(list :status (cdr (assoc (car matches) magithub-ci-status-symbol-alist))
:url (car (cddr matches))
:check (cadr matches))
(if (string= line "no-status")
'no-status
(if (string= line "") 'no-output))))

View File

@ -29,8 +29,8 @@
(defun magithub-github-repository-p ()
"Non-nil if \"origin\" points to GitHub or a whitelisted domain."
(--when-let (magit-get "remote" "origin" "url")
(-some? (lambda (domain) (s-contains? domain it))
(-when-let (origin (magit-get "remote" "origin" "url"))
(-some? (lambda (domain) (s-contains? domain origin))
(cons "github.com" (magit-get-all "hub" "host")))))
(defun magithub-repo-id ()

View File

@ -118,7 +118,7 @@ Returns a plist with the following properties:
"failed to parse issue"
"There was an error parsing issues."))))
(defun magithub-issue-list--internal-2.2.8 ()
(defun magithub--issue-list--internal-2.2.8 ()
"Backwards compatibility for old versions of hub.
See `magithub-issue-list--internal'."
(magithub-issue--sort
@ -141,19 +141,19 @@ Returns a plist with the following properties:
:title (s-join "," (cddr ss))
:type (magithub-issue--url-type (cadr ss)))))
(defun magithub-issue-list--internal ()
(defun magithub--issue-list--internal ()
"Return a new list of issues for the current repository."
(magithub-issue--sort
(mapcar #'magithub-issue--process-line
(magithub--command-output "issue" '("--format=%I,%U,%t%n")))))
(defun magithub-issue-list ()
(defun magithub--issue-list ()
"Return a list of issues for the current repository."
(magithub-cache (magithub-repo-id) :issues
'(with-temp-message "Retrieving issue list..."
(if (magithub-hub-version-at-least "2.3")
(magithub-issue-list--internal)
(magithub-issue-list--internal-2.2.8)))))
(magithub--issue-list--internal)
(magithub--issue-list--internal-2.2.8)))))
(defun magithub-issue--insert (issue)
"Insert an `issue' as a Magit section into the buffer."
@ -182,6 +182,7 @@ If `issue' is nil, open the repository's issues page."
(car (magithub--command-output "browse" '("--url-only" "--" "issues"))))))
(defun magithub-issue-refresh ()
"Refresh issues for this repository."
(interactive)
(magithub-cache-clear (magithub-repo-id) :issues)
(when (derived-mode-p 'magit-status-mode)
@ -208,26 +209,82 @@ If `issue' is nil, open the repository's issues page."
map)
"Keymap for `magithub-pull-request-list' sections.")
(defun magithub--issues-of-type (type)
"Filter `magithub--issue-list' for issues of type TYPE."
(-filter (lambda (i) (eq (plist-get i :type) type))
(magithub--issue-list)))
(defun magithub-issues ()
"Return a list of issue objects that are actually issues."
(magithub--issues-of-type 'issue))
(defun magithub-pull-requests ()
"Return a list of issue objects that are actually pull requests."
(magithub--issues-of-type 'pull-request))
(defun magithub-issue--insert-issue-section ()
"Insert GitHub issues if appropriate."
(when (magithub-usable-p)
(--when-let (-filter (lambda (i) (eq (plist-get i :type) 'issue))
(magithub-issue-list))
(-when-let (issues (magithub-issues))
(magit-insert-section (magithub-issue-list)
(magit-insert-heading "Issues:")
(mapc #'magithub-issue--insert it)
(mapc #'magithub-issue--insert issues)
(insert ?\n)))))
(defun magithub-issue--insert-pr-section ()
"Insert GitHub pull requests if appropriate."
(when (magithub-usable-p)
(--when-let (-filter (lambda (i) (eq (plist-get i :type) 'pull-request))
(magithub-issue-list))
(-when-let (pull-requests (magithub-pull-requests))
(magit-insert-section (magithub-pull-request-list)
(magit-insert-heading "Pull Requests:")
(mapc #'magithub-issue--insert it)
(mapc #'magithub-issue--insert pull-requests)
(insert ?\n)))))
(defun magithub-repolist-column-issue (_id)
"Insert the number of open issues in this repository."
(number-to-string (length (magithub-issues))))
(defun magithub-repolist-column-pull-request (_id)
"Insert the number of open pull requests in this repository."
(number-to-string (length (magithub-pull-requests))))
(defun magithub-pull-request--format-pr-for-read (pr)
"Format pull request PR as string suitable for completion."
(format "%3d %s" (plist-get pr :number) (plist-get pr :title)))
(defun magithub-pull-request--completing-read-list ()
"Return an alist of PR-strings to full pull-request issue objects.
See `magithub-pull-request--format-pr-for-am'."
(-when-let (pr-list (magithub-pull-requests))
(-zip-pair
(mapcar #'magithub-pull-request--format-pr-for-read pr-list)
pr-list)))
(defun magithub-pull-request-at-point ()
"The pull request object at point (or nil)."
(when (derived-mode-p 'magit-status-mode)
(-when-let* ((s (magit-current-section))
(v (magit-section-value s)))
(and (listp v)
(eq (plist-get v :type) 'pull-request)
v))))
(defun magithub-pull-request--completing-read ()
"Complete over all open pull requests returning its issue object.
If point is on a pull-request object, that object is selected by
default."
(let ((prs (magithub-pull-request--completing-read-list)) current-pr)
(-when-let (tap (magithub-pull-request-at-point))
(when (and (listp tap) (eq (plist-get tap :type) 'pull-request))
(setq current-pr (magithub-pull-request--format-pr-for-read tap))))
(cdr (assoc (completing-read "Pull request: " prs nil t current-pr) prs))))
(defun magithub-pull-request-checkout (pull-request)
"Checkout PULL-REQUEST as a local branch."
(interactive (list (magithub-pull-request--completing-read)))
(magithub-with-hub
(magit-checkout (plist-get pull-request :url))))
;;; Hook into the status buffer
(magithub--deftoggle magithub-toggle-issues
magit-status-sections-hook #'magithub-issue--insert-issue-section "issues")

View File

@ -1,9 +1,8 @@
(define-package "magithub" "20161011.2129" "Magit interfaces for GitHub"
(define-package "magithub" "20161013.2008" "Magit interfaces for GitHub"
'((emacs "24.4")
(magit "2.8.0")
(git-commit "20160821.1338")
(with-editor "20160828.1025")
(cl-lib "1.0")
(s "20160711.525"))
:url "https://github.com/vermiculus/magithub" :keywords
'("git" "tools" "vc"))

View File

@ -5,7 +5,7 @@
;; Author: Sean Allred <code@seanallred.com>
;; Keywords: git, tools, vc
;; Homepage: https://github.com/vermiculus/magithub
;; Package-Requires: ((emacs "24.4") (magit "2.8.0") (git-commit "20160821.1338") (with-editor "20160828.1025") (cl-lib "1.0") (s "20160711.525"))
;; Package-Requires: ((emacs "24.4") (magit "2.8.0") (git-commit "20160821.1338") (with-editor "20160828.1025") (s "20160711.525"))
;; Package-Version: 0.1
;; This program is free software; you can redistribute it and/or modify
@ -190,17 +190,16 @@ created by hub.
This function will return nil for matches to
`git-commit-filename-regexp'."
(when (and path (magit-inside-gitdir-p))
(let ((basename (file-name-base path)))
(and path
(s-suffix? "/.git/" (file-name-directory path))
(not (s-matches? git-commit-filename-regexp basename))
(cdr (assoc basename magithub--file-types)))))
(and (not (s-matches? git-commit-filename-regexp basename))
(cdr (assoc basename magithub--file-types))))))
(defun magithub-check-buffer ()
"If this is a buffer created by hub, perform setup."
(--when-let (magithub--edit-file-type buffer-file-name)
(-when-let (filetype (magithub--edit-file-type buffer-file-name))
(magithub-setup-edit-buffer)
(when (eq it 'issue)
(when (eq filetype 'issue)
(magithub-setup-new-issue-buffer))))
(add-hook 'find-file-hook #'magithub-check-buffer)