Explorar el Código

Reenable git

Updated packages from Purcell's repository after upgradin to emacs 24.5
master
ßingen hace 9 años
padre
commit
a627c32098
Se han modificado 6 ficheros con 87 adiciones y 60 borrados
  1. +3
    -2
      init.el
  2. +23
    -0
      lisp/init-c.el
  3. +24
    -6
      lisp/init-elpa.el
  4. +33
    -47
      lisp/init-git.el
  5. +3
    -4
      lisp/init-github.el
  6. +1
    -1
      lisp/init-local.el

+ 3
- 2
init.el Ver fichero

@@ -53,9 +53,10 @@

(require 'init-editing-utils)

;(require 'init-git)
;(require 'init-github)
(require 'init-git)
(require 'init-github)

(require 'init-c)
(require 'init-crontab)
(require 'init-markdown)
(require 'init-csv)

+ 23
- 0
lisp/init-c.el Ver fichero

@@ -0,0 +1,23 @@
;https://www.emacswiki.org/emacs/IndentingC
;;(require-package 'guess-offset)
;; (setq c-default-style "linux"
;; c-basic-offset 4
;; tab-width 4
;; indent-tabs-mode t)

;; http://www.linuxfromscratch.org/alfs/view/hacker/part2/hacker/coding-style.html
(defun linux-c-mode ()
"C mode with adjusted defaults for use with the Linux kernel."
(interactive)
(c-mode)
(c-set-style "K&R")
(setq c-basic-offset 8))

(setq auto-mode-alist
(cons '("\\.[ch]$" . linux-c-mode)
auto-mode-alist))
;;http://www.delorie.com/gnu/docs/emacs/cc-mode_6.html
;;http://www.gnu.org/software/emacs/manual/html_mono/ccmode.html#Minor-Modes
(add-hook 'c-mode-common-hook '(lambda () (c-toggle-auto-state 1)))

(provide 'init-c)

+ 24
- 6
lisp/init-elpa.el Ver fichero

@@ -14,7 +14,9 @@
;;; Standard package repositories

;(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(when (< emacs-major-version 24)
;; Mainly for ruby-mode
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")))

;; We include the org repository for completeness, but don't normally
;; use it.
@@ -24,8 +26,9 @@
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))

;;; Also use Melpa for most packages
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))
(add-to-list 'package-archives `("melpa" . ,(if (< emacs-major-version 24)
"http://melpa.org/packages/"
"https://melpa.org/packages/")))


@@ -36,8 +39,8 @@
(setq package-check-signature (when (executable-find "gpg") 'allow-unsigned)))

(sanityinc/package-maybe-enable-signatures)
;;(after-load 'init-exec-path
;; (sanityinc/package-maybe-enable-signatures))
(after-load 'init-exec-path
(sanityinc/package-maybe-enable-signatures))


@@ -50,12 +53,27 @@ re-downloaded in order to locate PACKAGE."
(if (package-installed-p package min-version)
t
(if (or (assoc package package-archive-contents) no-refresh)
(package-install package)
(if (boundp 'package-selected-packages)
;; Record this as a package the user installed explicitly
(package-install package nil)
(package-install package))
(progn
(package-refresh-contents)
(require-package package min-version t)))))


(defun maybe-require-package (package &optional min-version no-refresh)
"Try to install PACKAGE, and return non-nil if successful.
In the event of failure, return nil and print a warning message.
Optionally require MIN-VERSION. If NO-REFRESH is non-nil, the
available package lists will not be re-downloaded in order to
locate PACKAGE."
(condition-case err
(require-package package min-version no-refresh)
(error
(message "Couldn't install package `%s': %S" package err)
nil)))

;;; Fire up package.el


+ 33
- 47
lisp/init-git.el Ver fichero

@@ -1,50 +1,34 @@
;; TODO: link commits from vc-log to magit-show-commit
;; TODO: smerge-mode
(require-package 'magit)
(require-package 'git-blame)
(require-package 'git-commit-mode)
(require-package 'git-rebase-mode)
(require-package 'gitignore-mode)
(require-package 'gitconfig-mode)
(require-package 'git-messenger) ;; Though see also vc-annotate's "n" & "p" bindings
(require-package 'git-timemachine)

(setq-default
magit-save-some-buffers nil
magit-process-popup-time 10
magit-diff-refine-hunk t
magit-completing-read-function 'magit-ido-completing-read)

;; Hint: customize `magit-repo-dirs' so that you can use C-u M-F12 to
;; quickly open magit on any one of your projects.
(global-set-key [(meta f12)] 'magit-status)
(when (maybe-require-package 'magit)
(setq-default
magit-process-popup-time 10
magit-diff-refine-hunk t
magit-completing-read-function 'magit-ido-completing-read)

;; Hint: customize `magit-repo-dirs' so that you can use C-u M-F12 to
;; quickly open magit on any one of your projects.
(global-set-key [(meta f12)] 'magit-status)
(global-set-key (kbd "C-x g") 'magit-status)
(global-set-key (kbd "C-x M-g") 'magit-dispatch-popup))

(after-load 'magit
(define-key magit-status-mode-map (kbd "C-M-<up>") 'magit-goto-parent-section))
(define-key magit-status-mode-map (kbd "C-M-<up>") 'magit-section-up)
(add-hook 'magit-popup-mode-hook 'sanityinc/no-trailing-whitespace))

(require-package 'fullframe)
(after-load 'magit
(fullframe magit-status magit-mode-quit-window))

(add-hook 'git-commit-mode-hook 'goto-address-mode)
(after-load 'session
(add-to-list 'session-mode-disable-list 'git-commit-mode))

;;; When we start working on git-backed files, use git-wip if available

(after-load 'magit
(global-magit-wip-save-mode)
(diminish 'magit-wip-save-mode))

(after-load 'magit
(diminish 'magit-auto-revert-mode))

(when *is-a-mac*
(after-load 'magit
(add-hook 'magit-mode-hook (lambda () (local-unset-key [(meta h)])))))

(when (maybe-require-package 'git-commit)
(add-hook 'git-commit-mode-hook 'goto-address-mode))

;; Convenient binding for vc-git-grep
@@ -54,12 +38,13 @@
;;; git-svn support

(require-package 'magit-svn)
(autoload 'magit-svn-enabled "magit-svn")
(defun sanityinc/maybe-enable-magit-svn-mode ()
(when (magit-svn-enabled)
(magit-svn-mode)))
(add-hook 'magit-status-mode-hook #'sanityinc/maybe-enable-magit-svn-mode)
;; (when (maybe-require-package 'magit-svn)
;; (require-package 'magit-svn)
;; (autoload 'magit-svn-enabled "magit-svn")
;; (defun sanityinc/maybe-enable-magit-svn-mode ()
;; (when (magit-svn-enabled)
;; (magit-svn-mode)))
;; (add-hook 'magit-status-mode-hook #'sanityinc/maybe-enable-magit-svn-mode))

(after-load 'compile
(dolist (defn (list '(git-svn-updated "^\t[A-Z]\t\\(.*\\)$" 1 nil nil 0 1)
@@ -68,19 +53,20 @@
(add-to-list 'compilation-error-regexp-alist (car defn))))

(defvar git-svn--available-commands nil "Cached list of git svn subcommands")

(defun git-svn (dir)
(defun git-svn--available-commands ()
(or git-svn--available-commands
(setq git-svn--available-commands
(sanityinc/string-all-matches
"^ \\([a-z\\-]+\\) +"
(shell-command-to-string "git svn help") 1))))

(defun git-svn (dir command)
"Run a git svn subcommand in DIR."
(interactive "DSelect directory: ")
(unless git-svn--available-commands
(setq git-svn--available-commands
(sanityinc/string-all-matches
"^ \\([a-z\\-]+\\) +"
(shell-command-to-string "git svn help") 1)))
(interactive (list (read-directory-name "Directory: ")
(completing-read "git-svn command: " (git-svn--available-commands) nil t nil nil (git-svn--available-commands))))
(let* ((default-directory (vc-git-root dir))
(compilation-buffer-name-function (lambda (major-mode-name) "*git-svn*")))
(compile (concat "git svn "
(ido-completing-read "git-svn command: " git-svn--available-commands nil t)))))
(compile (concat "git svn " command))))

(require-package 'git-messenger)

+ 3
- 4
lisp/init-github.el Ver fichero

@@ -1,13 +1,12 @@
(require 'init-git)

(require-package 'yagist)
(maybe-require-package 'yagist)
(require-package 'github-browse-file)
(require-package 'bug-reference-github)
(add-hook 'prog-mode-hook 'bug-reference-prog-mode)

(when (eval-when-compile (> emacs-major-version 23))
(require-package 'github-clone)
(require-package 'magit-gh-pulls))
(maybe-require-package 'github-clone)
(maybe-require-package 'magit-gh-pulls)




+ 1
- 1
lisp/init-local.el Ver fichero

@@ -4,7 +4,7 @@
(global-set-key (kbd "S-s-<left>") 'windmove-left)

;; linum-mode by default
(require linum)
(require 'linum)
(global-linum-mode 1)

(provide 'init-local)

Cargando…
Cancelar
Guardar