magit/company updates and extensions
Stefan Bund [Fri, 6 Oct 2017 10:29:51 +0000 (12:29 +0200)]
emacs-custom.el
setup/bookmark+.el
setup/magit.el

index 8e8e465..f69a122 100644 (file)
@@ -16,6 +16,8 @@
  '(column-number-mode t)
  '(comment-column 60)
  '(comment-fill-column 98)
+ '(company-idle-delay 600)
+ '(company-tooltip-idle-delay 10)
  '(compilation-ask-about-save nil)
  '(compilation-scroll-output t)
  '(csv-align-padding 0)
@@ -66,6 +68,7 @@
  '(ls-lisp-dirs-first t)
  '(magit-default-tracking-name-function (quote magit-default-tracking-name-branch-only))
  '(magit-display-buffer-function (quote magit-display-buffer-same-window-except-diff-v1))
+ '(magit-log-arguments (quote ("-n256" "--graph" "--decorate")))
  '(magit-process-popup-time 1)
  '(magit-server-window-for-rebase (quote pop-to-buffer))
  '(magit-status-buffer-switch-function (quote switch-to-buffer))
@@ -77,7 +80,7 @@
  '(rng-validate-chunk-size 2000)
  '(rng-validate-delay 3)
  '(rng-validate-quick-delay 1.5)
- '(rtags-use-helm nil)
+ '(rtags-use-helm nil t)
  '(safe-local-variable-values
    (quote
     ((elisp-project-autoload-file-name . "cc-autoload.el")
index 26c8eb5..9e0f047 100644 (file)
@@ -1 +1,6 @@
 (require 'bookmark+)
+
+(defun g0dil-goto-equivalent-position (other-file)
+  (let ((bk (bookmark-make-record-default t)))
+    (setq bk (bookmark-set-filename bk other-file))
+    (bookmark-jump (cons "" bk))))
index a886155..8ae6b76 100644 (file)
 (magit-define-popup-action 'magit-diff-popup
   ?m "Diff merge-base master" 'magit-diff-master-mergebase)
 
+(magit-define-popup-switch 'magit-log-popup
+  ?f "first parent" "--first-parent")
+
+(require 'ffap)
+
+(defun g0dil-magit-old-version-jump-to-current ()
+  (interactive)
+  (let ((current-file (ffap-file-exists-string
+                       (file-name-nondirectory
+                        (replace-regexp-in-string "\\.~.*$" "" (buffer-name))))))
+    (if current-file
+        (g0dil-goto-equivalent-position current-file)
+      (error "current version of file not found"))))
+
+(define-key magit-blob-mode-map "c" 'g0dil-magit-old-version-jump-to-current)
+
+(defun g0dil-magit-diff-jump-to-current ()
+  (interactive)
+  (let ((section-file-name (loop for ident in (magit-section-ident (magit-current-section))
+                                 if (and (consp ident) (eq (car ident) 'file))
+                                 return (cdr ident)
+                                 finally return nil)))
+    (if (ffap-file-exists-string section-file-name)
+        (g0dil-goto-equivalent-position section-file-name)
+      (error "current version of file not found"))))
+
+(define-key magit-revision-mode-map (kbd "C-c RET") 'g0dil-magit-diff-jump-to-current)
+
 ; ignore whitespace
 ; (setq magit-diff-options '("-w"))