dgutov / diff-hl Goto Github PK
View Code? Open in Web Editor NEWEmacs package for highlighting uncommitted changes
License: GNU General Public License v3.0
Emacs package for highlighting uncommitted changes
License: GNU General Public License v3.0
Hi,
on emacs-24 trunk (Cocoa) the hunk indicators do not appear as solid blocks when line-spacing is set to something greater than zero; I guess that frame-char-height doesn't take the extra padding introduced by line-spacing into account. Please consider changing the line
(h (round (* (frame-char-height) scale))) in diff-hl-define-bitmaps
to something like
(h (round (* (+ 1.0 line-spacing) (* (frame-char-height) scale))))
I don't know if that is the right thing to do, but it seems to work for me.
thanks,
Sebastian
I am using latest version of diff-hl. I have (global-diff-hl-mode)
in my init.
When starting Emacs in daemon mode, there are no indicators on the fringe. If I call (global-diff-hl-mode)
twice (first disabling it, then enabling it back again), indicators appear.
Everything is working fine when using Emacs without daemon mode and with emacs -Q
.
I saw this problem was already fixed in issue #2, but as of today on Emacs 25.0.50.1
running on Debian unstable I am still experiencing the issue.
http://stackoverflow.com/questions/4045017/what-is-git-diff-patience-for
Apparently, it's the default one in Bazaar, and unavailable in other VCSes.
It seems that when visual-line-mode is on, the annotation is only present on the first (screen) line.
I don't know how vc-system specific you want to get, but I think it would be great if there was some way to tell if a given hunk is staged or not.
I would try adding this myself, but I don't currently understand vc.el
well enough to contribute.
I see that the (excellent) new diff-hl-flydiff.el
uses nadvice
, so diff-hl
now technically requires Emacs 24.4. It should therefore have a corresponding entry in its Package-Requires
. An alternative would be to distribute that as a separate package, but you might want to avoid that.
Is it possible to add a diff-hl-mark-hunk
function that just selects the current hunk when already in the middle of a hunk? I'm not sure how hard this is since I don't know elisp.
Hi,
I have installed diff-hl using 'M-x list-packages'
I am able to use it by opening a file in emacs and then 'M-x global-diff-hl-mode' manually. I see the diff bar on the left.
I want to enable this in my .emacs, so I added '(setq global-diff-hl-mode 1)' to my .emacs, I don't see the diff bar on the left.
i'm always using the emacsclient to get my GTK emacs frame.
(when (window-system)
(define-fringe-bitmap 'diff-hl-bmp-empty [0] 1 1 'center)
(diff-hl-define-bitmaps))
the window-system isn't available yet when the daemon starts. it should check for that when the frame is created and not when the mode is loaded
is it supposed to work without the GUI?
I really like this mode... it's kinda great to see the what changed and to be able to revert single hunks like that
I am experiencing an issue with diff-hl and Magit enabled on the following platform;
GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2015-04-10 on builder10-9.porkrind.org
Attempting to load a file checked into Git causes the following errors;
File mode specification error: (error "Lisp nesting exceeds 'max-lisp-eval-depth'")
Error in post-command-hook (magit-auto-revert-mode-check-buffers): (error "Lisp nesting exceeds 'max-lisp-eval-depth'")
Thereafter Emacs becomes unresponsive; for example M-x does not work, etc.
I can reproduce this by;
Any thoughts?
Is it possible to use diff-hl
on the right fringe, to avoid conflict with flycheck
and linum
?
When using the right side margin for diff symbol display with a vertical split window setup in the terminal, diff-hl only works for the file being displayed in the rightmost window.
The bug only appears in terminal mode, it works as expected in graphical Emacs.
(use-package diff-hl
:ensure t
:defer t
:init
(progn
(setq diff-hl-side 'right)
(global-diff-hl-mode)
(diff-hl-margin-mode)
(diff-hl-flydiff-mode)))
Is there a way to stage the current hunk?
Currently if you call diff-hl-revert-hunk
and answer Y or N it calls (quit-windows-on diff-buffer)
in the end:
https://github.com/dgutov/diff-hl/blob/master/diff-hl.el#L420
This keeps *diff-hl*
buffer open.
Consider this to be changed to (quit-windows-on diff-buffer t)
to kill the buffer.
Alternatively, we can introduce new var diff-hl-kill-revert-buffer-on-quit
OR new hook diff-hl-quit-hook
(as it is done in ediff
).
When I use dired mode to visit a directory which contains files under RCS control (and I even might now know about it), then I obtain the following error, and Emacs refuses to enter that directory.
I suggest to blacklist the RCS backend.
need better README with screenshots. I have no idea what this does.
Hello,
First of all, thanks a lot for this great package -- which should get much more publicity by the way!
Here a feature: when editing some code block in an Org buffer, we can use C-c ' to edit it in its major mode, in some sort of indirect buffer. There, we don't see the indicators, I guess because it's not bound to a file. That'd be great if that'd be possible, but this can be very complex? However, that's not the real problem...
The other problem is -- and I'm sure it's fixable -- that when returning to the Org buffer with C-c ', we don't get the indicators back for that code block. The indicators for the other code blocks are still there.
The current work around is to save the Org file another time.
Demo (with small window on purpose, to hide parts of my code) on http://screencast.com/t/45DMsPkpn.
Best regards.
When editing a file that isn't yet checked in, and has unsaved changes, I get the following error from diff-hl:
Debugger entered--Lisp error: (error "Running git --no-pager cat-file blob 2c... ....FAILED (status 128)")
signal(error ("Running git --no-pager cat-file blob 2c... ....FAILED (status 128)"))
error("Running %s...FAILED (%s)" "git --no-pager cat-file blob 2c... ." "status 128")
vc-do-command(#<buffer *temp file*> 0 "git" nil "--no-pager" "cat-file" "blob" "2c0b6bc6cba388030b5135e2f58e214699fdb4fa:a_new_file.py")
apply(vc-do-command #<buffer *temp file*> 0 "git" nil ("--no-pager" "cat-file" "blob" "2c0b6bc6cba388030b5135e2f58e214699fdb4fa:a_new_file.py"))
vc-git-command(#<buffer *temp file*> 0 nil "cat-file" "blob" "2c0b6bc6cba388030b5135e2f58e214699fdb4fa:a_new_file.py")
vc-git-find-revision("/users/whughes/test_repo/a_new_file.py" "2c0b6bc6cba388030b5135e2f58e214699fdb4fa" #<buffer *temp file*>)
apply(vc-git-find-revision ("/users/whughes/test_repo/a_new_file.py" "2c0b6bc6cba388030b5135e2f58e214699fdb4fa" #<buffer *temp file*>))
vc-call-backend(Git find-revision "/users/whughes/test_repo/a_new_file.py" "2c0b6bc6cba388030b5135e2f58e214699fdb4fa" #<buffer *temp file*>)
diff-hl-flydiff-create-revision("/users/whughes/test_repo/a_new_file.py" "2c0b6bc6cba388030b5135e2f58e214699fdb4fa")
diff-hl-flydiff-buffer-with-head("/users/whughes/test_repo/a_new_file.py" Git)
apply(diff-hl-flydiff-buffer-with-head ("/users/whughes/test_repo/a_new_file.py" Git))
diff-hl-changes-buffer("/users/whughes/test_repo/a_new_file.py" Git)
diff-hl-changes()
#[0 "byte-code-was-here" [diff-hl-draw-borders diff-hl-changes 1 diff-hl-remove-overlays 3 signal wrong-number-of-arguments nil 0 diff-hl-add-highlighting empty single bottom top middle make-overlay (diff-hl-overlay-modified) overlay-put diff-hl t diff-hl-hunk modification-hooks insert-in-front-hooks insert-behind-hooks] 15 "\n\n(fn)"]()
diff-hl-flydiff/update(#[0 "byte-code-was-here" [diff-hl-draw-borders diff-hl-changes 1 diff-hl-remove-overlays 3 signal wrong-number-of-arguments nil 0 diff-hl-add-highlighting empty single bottom top middle make-overlay (diff-hl-overlay-modified) overlay-put diff-hl t diff-hl-hunk modification-hooks insert-in-front-hooks insert-behind-hooks] 15 "\n\n(fn)"] t)
apply(diff-hl-flydiff/update #[0 "byte-code-was-here" [diff-hl-draw-borders diff-hl-changes 1 diff-hl-remove-overlays 3 signal wrong-number-of-arguments nil 0 diff-hl-add-highlighting empty single bottom top middle make-overlay (diff-hl-overlay-modified) overlay-put diff-hl t diff-hl-hunk modification-hooks insert-in-front-hooks insert-behind-hooks] 15 "\n\n(fn)"] t)
diff-hl-update(t)
apply(diff-hl-update t)
byte-code("r\301�\302H�\303H\"\210)\301\207" [timer apply 5 6] 4)
timer-event-handler([t 0 0 300000 t diff-hl-update (t) idle 0])
The command it's trying to run is this:
$ git --no-pager cat-file blob 2c0b6bc6cba388030b5135e2f58e214699fdb4fa:a_new_file.py
fatal: Not a valid object name 2c0b6bc6cba388030b5135e2f58e214699fdb4fa:a_new_file.py
$ echo $?
128
I only seem to get this error in Emacs for OS X (the GUI), so I believe the macro just isn't defined in that version.
This code snippet:
(defadvice svn-status-update-modeline (after svn-update-diff-hl activate)
(diff-hl-update))
will get diff-hl'ed buffers refreshed after SVN commits originated from svn-status mode. Due to hacky nature of it and psvn.el being some 3rd party thing, I'm not entirely sure if it could make a good pull request. Yet I think it is for the very least README-worthy.
It was bugging me big time, so someone might want it too.
Hi,
thanks for this extremely useful mode - I am now moving away from git gutter altogether. I'm afraid I'm still finding my way around diff-hl, so I got a newbie question for you. Back in the long gone svn days there used to be a utility that displayed a little circle in the modeline, providing a helpful indication if a file had changes[1]. It would be green for "no changes", red for "has changes" and blue for "new file" (IIRC).
Does diff-hl support something like this? It is a feature which unfortunately I rely on quite a lot. I don't necessarily need a "dot", just some kind of indicator on the modeline (e.g. red/green filename, an X, etc).
Many thanks for your work.
Marco
[1] I speak a little bit about this feature on this blog post; do a find for Git-emacs and you should see it. http://mcraveiro.blogspot.co.uk/2015/05/nerd-food-prelude-of-things-to-come.html
In one of my project which use the git version control,after I do 'chmod 777 xxx' to change the permission of some files,when I press enter to view the files in dired, the annoying error came out .
I guess , maybe when there is no edit changes , will cause this error.
Hi,
When I try to run diff-hl-mode
, I get
diff-hl-maybe-define-bitmaps: Attempt to modify read-only object: []
running GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.1.0, NS apple-appkit-1265.19)
and latest evil (off of MELPA)
Don't know if it has been suggested before, but maybe use indicators.el to mark (relative) fringes more precisely with bitmaps.
Also if using indicators.el, don't show deleted lines -- just mark the delete position in fringe too.
I'm using Emacs for Mac OS X on OS X 10.10.4.
As the screenshot shows, the fringe misses a left border.
My initialization script is like
(require 'package)
(package-initialize)
(global-diff-hl-mode)
Any ideas why?
Thanks.
Good evening,
Tonight I am writing to humbly put in a request for you to tag this project.
The reason is that a lot of users want to rely on the most "stable" release, by
the most broad definition of the term. For me, it is really simple, I am setting
up a "stable" Emacs configuration of my system here https://github.com/grettke/home/blob/master/.emacs.el
and I would like to rely 100% upon MELPA Stable http://stable.melpa.org/#/ .
I've used your package for a long time, love it, and so do many, many others.
This is a way to get that project out to the other thousands and thousands of
users who also rely upon MELPA stable.
All it takes is for you to create a tag, and within hours, it will show up on
MELPA stable.
Can't wait to hear about what you think and whether or not a tag is in this
project's future!
Kind regards,
Grant Rettke
P.S.
I use your software daily, hourly, every day. It is such a treat. It is stable and reliable, and time to
release it with a tag. Can't wait to point people at it out on table, too.
Since there is both a global-diff-hl-mode
and global-diff-hl-amend-mode
, it would be great if there were a mode I could enable in the terminal (ie, global-diff-hl-margin-mode
)
I'm pretty new to emacs so sorry if I'm doing something really easy wrong. I've installed emacs 24.3.1 on FreeBSD and installed diff-hl via package-install diff-hl the output looked like:
Compiling no file at Wed Sep 4 12:59:39 2013
Leaving directory /home/dominik/.emacs.d/elpa/diff-hl-20130903.1934' Compiling file /home/dominik/.emacs.d/elpa/diff-hl-20130903.1934/diff-hl-amend.el at Wed Sep 4 12:59:39 2013 Entering directory
/home/dominik/.emacs.d/elpa/diff-hl-20130903.1934/'
In diff-hl-amend-mode:
diff-hl-amend.el:41:17:Warning: assignment to free variable
diff-hl-reference-revision' diff-hl-amend.el:42:9:Warning: reference to free variable
diff-hl-mode'
In diff-hl-amend-setup:
diff-hl-amend.el:54:22:Warning: assignment to free variable
`diff-hl-reference-revision'
In end of data:
diff-hl-amend.el:68:1:Warning: the function diff-hl-update' is not known to be defined. Compiling file /home/dominik/.emacs.d/elpa/diff-hl-20130903.1934/diff-hl-pkg.el at Wed Sep 4 12:59:39 2013 Compiling file /home/dominik/.emacs.d/elpa/diff-hl-20130903.1934/diff-hl.el at Wed Sep 4 12:59:39 2013 diff-hl.el:138:1:Warning: Unused lexical variable
vc-svn-diff-switches'
In end of data:
diff-hl.el:429:1:Warning: the function `smartrep-define-key' is not known to
be defined.
afterwards i wanted to activate it via M-x diff-hl or diff-hl-mode but i got only a message:
Symbol's value as variable is void: diff-hl-mode. I don't really know where to start at so it would be very nice if someone could help.
When diff-hl-draw-borders is nil, I still see borders on dired buffers
I've noticed that highlights are not removed after committing from magit
. I guess this is related to this section of the README:
If you're using some package other than vc to commit changes, it might not run vc-checkin-hook after commits. In that case, you'll need to either add diff-hl-update to the hook it does run, or advise some function that's called in the buffer after its state has changed.
Given, magit's popularity, however, doesn't it make sense to support it out-of-the-box?
I use C-x as cut (consistency with other programs is nice sometimes) but any bindings using C-x as a prefix stomp this binding. I want to remove the C-x keybinds in diff-hl but currently the only way to do so seems to be by modifying the source code (which I can do, but is obviously not ideal).
Could you move the keybinds to a separate function which can be optionally called by the users? Or if that is too disruptive could you add a variable which can be used to disable them?
It would be super helpful for me (and other mercurial users, I think) if diff-hl could show the changed regions based upon the output of 'hg qdiff', which includes both changes in the working directory and the changes in the patch at the head of the patch queue. I suspect this is something you'd want to be able to toggle on and off - sometimes you might want to just see 'hg diff'. Do you think this is feasible?
Hi, great job with diff-hl!
I love the functionality so much that I want it to be active whenever possible. However, I don't want it to launch on buffers that are not associated with a file or buffers associated with files that are not in version control.
Here's my workaround, maybe it helps other users:
(defun custom-turn-on-diff-hl-mode ()
"Turn on diff hl mode only if buffer is associated with file in version control."
(interactive)
(let ((bfname buffer-file-name))
(when bfname
(when (vc-backend bfname)
(turn-on-diff-hl-mode))
))
)
Sometimes diff-hl update edit state fails after save file, I found that vc-state returns unregistered in such case, though the file is under svn control.
I have to revert the file ,then diff-hl can update edit state successfully again.
On Emacs 25.0 (rev 33b4235db671a6c5644a9ce73a8901f073cb0ecc
) I get a wrong-type-argument
error from Diff Hl during startup (backtrace), while restoring buffers from Desktop Save Mode.
I don't think that it's actually Diff Hl at fault here, because this issue is a very recent thing, and first occurred long after the last change in Diff Hl. I presume, it's rather caused by some of the recent changes to VC in the wake of the Git migration.
Still, I'm opening the issue, since I'm hoping that you might have some remote clue, and could give me some directions on how to debug this issue. Also, I much prefer Github to the abomination that is Debbugs.
hi,
I am using emacs 24.3 and ubuntu 12.04.
I have installed 'diff-hl' using 'M-x install package: diff-hl'
And then I start 'diff-hl' by adding in my .emacs
(require 'diff-hl)
(require 'diff-hl-amend)
(require 'diff-hl-dired)
(require 'diff-hl-margin)
but when I edit a file , I don't see change indicator on the left side of my editor.
Please tell me what do I need to get it work.
When I enable the diff-hl-margin-mode while using Emacs on the console, most* of the minibuffer queries become shifted by one character. I've tested it on a clean Emacs 24.3.1 so it's not some kind of conflict.
*) Helm works ok but the "native" Emacs queries are broken.
see: https://github.com/magit/magit/pull/1665/files
I think all it needs is:
(add-hook 'magit-not-reverted-hook 'diff-hl-update nil t)
added to the mode definition
Steps to reproduce:
diff-hl-flydiff-mode
.diff-hl
will slow down remote browsing with Dired, even for local virtual machine. It should be disabled by default.
When you are in a dired buffer, show on fringe that this file (or directory) have changes.
I get this with the latest HEAD Emacs as of 15 mins ago:
Debugger entered--Lisp error: (error "Running git --no-pager difftool --exit-code --no-prompt -x diff -U0 HEAD *diff-hl* -- init-haskell.el...FAILED (status 128)")
signal(error ("Running git --no-pager difftool --exit-code --no-prompt -x diff -U0 HEAD *diff-hl* -- init-haskell.el...FAILED (status 128)"))
error("Running %s...FAILED (%s)" "git --no-pager difftool --exit-code --no-prompt -x diff -U0 HEAD *diff-hl* -- init-haskell.el" "status 128")
vc-do-command("*vc-diff*" 1 "git" ("/Users/steve/.emacs.d/lisp/init-haskell.el") "--no-pager" "difftool" "--exit-code" "--no-prompt" "-x" "diff -U0" "HEAD" " *diff-hl* " "--")
apply(vc-do-command "*vc-diff*" 1 "git" ("/Users/steve/.emacs.d/lisp/init-haskell.el") ("--no-pager" "difftool" "--exit-code" "--no-prompt" "-x" "diff -U0" "HEAD" " *diff-hl* " "--"))
vc-git-command("*vc-diff*" 1 ("/Users/steve/.emacs.d/lisp/init-haskell.el") "difftool" "--exit-code" "--no-prompt" "-x" "diff -U0" "HEAD" " *diff-hl* " "--")
vc-git-diff(("/Users/steve/.emacs.d/lisp/init-haskell.el") nil nil " *diff-hl* ")
apply(vc-git-diff (("/Users/steve/.emacs.d/lisp/init-haskell.el") nil nil " *diff-hl* "))
vc-call-backend(Git diff ("/Users/steve/.emacs.d/lisp/init-haskell.el") nil nil " *diff-hl* ")
(let ((vc-git-diff-switches nil) (vc-hg-diff-switches nil) (vc-svn-diff-switches nil) (vc-diff-switches (quote ("-U0"))) (vc-disable-async-diff t)) (vc-call-backend backend (quote diff) (list file) diff-hl-reference-revision nil buf-name))
(let* ((buf-name " *diff-hl* ") diff-auto-refine-mode res) (let ((vc-git-diff-switches nil) (vc-hg-diff-switches nil) (vc-svn-diff-switches nil) (vc-diff-switches (quote ("-U0"))) (vc-disable-async-diff t)) (vc-call-backend backend (quote diff) (list file) diff-hl-reference-revision nil buf-name)) (save-current-buffer (set-buffer buf-name) (goto-char (point-min)) (if (eobp) nil (condition-case nil (progn (diff-beginning-of-hunk t)) (error nil)) (while (looking-at diff-hunk-header-re-unified) (let ((line (string-to-number ...)) (len (let ... ...)) (beg (point))) (diff-end-of-hunk) (let* ((inserts ...) (deletes ...) (type ...)) (if (eq type ...) (progn ... ...)) (setq res (cons ... res))))))) (nreverse res))
(cond ((or (eq state (quote edited)) (and (eq state (quote up-to-date)) (or revert-buffer-in-progress-p diff-hl-reference-revision))) (let* ((buf-name " *diff-hl* ") diff-auto-refine-mode res) (let ((vc-git-diff-switches nil) (vc-hg-diff-switches nil) (vc-svn-diff-switches nil) (vc-diff-switches (quote ("-U0"))) (vc-disable-async-diff t)) (vc-call-backend backend (quote diff) (list file) diff-hl-reference-revision nil buf-name)) (save-current-buffer (set-buffer buf-name) (goto-char (point-min)) (if (eobp) nil (condition-case nil (progn (diff-beginning-of-hunk t)) (error nil)) (while (looking-at diff-hunk-header-re-unified) (let (... ... ...) (diff-end-of-hunk) (let* ... ... ...))))) (nreverse res))) ((eq state (quote added)) (list (cons 1 (cons (line-number-at-pos (point-max)) (quote (insert)))))) ((eq state (quote removed)) (list (cons 1 (cons (line-number-at-pos (point-max)) (quote (delete)))))))
(let ((state (vc-state file backend))) (cond ((or (eq state (quote edited)) (and (eq state (quote up-to-date)) (or revert-buffer-in-progress-p diff-hl-reference-revision))) (let* ((buf-name " *diff-hl* ") diff-auto-refine-mode res) (let ((vc-git-diff-switches nil) (vc-hg-diff-switches nil) (vc-svn-diff-switches nil) (vc-diff-switches (quote ...)) (vc-disable-async-diff t)) (vc-call-backend backend (quote diff) (list file) diff-hl-reference-revision nil buf-name)) (save-current-buffer (set-buffer buf-name) (goto-char (point-min)) (if (eobp) nil (condition-case nil (progn ...) (error nil)) (while (looking-at diff-hunk-header-re-unified) (let ... ... ...)))) (nreverse res))) ((eq state (quote added)) (list (cons 1 (cons (line-number-at-pos (point-max)) (quote (insert)))))) ((eq state (quote removed)) (list (cons 1 (cons (line-number-at-pos (point-max)) (quote (delete))))))))
(progn (let ((state (vc-state file backend))) (cond ((or (eq state (quote edited)) (and (eq state (quote up-to-date)) (or revert-buffer-in-progress-p diff-hl-reference-revision))) (let* ((buf-name " *diff-hl* ") diff-auto-refine-mode res) (let ((vc-git-diff-switches nil) (vc-hg-diff-switches nil) (vc-svn-diff-switches nil) (vc-diff-switches ...) (vc-disable-async-diff t)) (vc-call-backend backend (quote diff) (list file) diff-hl-reference-revision nil buf-name)) (save-current-buffer (set-buffer buf-name) (goto-char (point-min)) (if (eobp) nil (condition-case nil ... ...) (while ... ...))) (nreverse res))) ((eq state (quote added)) (list (cons 1 (cons (line-number-at-pos ...) (quote ...))))) ((eq state (quote removed)) (list (cons 1 (cons (line-number-at-pos ...) (quote ...))))))))
(if backend (progn (let ((state (vc-state file backend))) (cond ((or (eq state (quote edited)) (and (eq state ...) (or revert-buffer-in-progress-p diff-hl-reference-revision))) (let* ((buf-name " *diff-hl* ") diff-auto-refine-mode res) (let (... ... ... ... ...) (vc-call-backend backend ... ... diff-hl-reference-revision nil buf-name)) (save-current-buffer (set-buffer buf-name) (goto-char ...) (if ... nil ... ...)) (nreverse res))) ((eq state (quote added)) (list (cons 1 (cons ... ...)))) ((eq state (quote removed)) (list (cons 1 (cons ... ...))))))))
(let* ((file buffer-file-name) (backend (vc-backend file))) (if backend (progn (let ((state (vc-state file backend))) (cond ((or (eq state ...) (and ... ...)) (let* (... diff-auto-refine-mode res) (let ... ...) (save-current-buffer ... ... ...) (nreverse res))) ((eq state (quote added)) (list (cons 1 ...))) ((eq state (quote removed)) (list (cons 1 ...))))))))
diff-hl-changes()
(let ((changes (diff-hl-changes)) (current-line 1)) (diff-hl-remove-overlays) (save-excursion (goto-char (point-min)) (let ((--dolist-tail-- changes)) (while --dolist-tail-- (let ((c (car --dolist-tail--))) (progn (let* (... ... ... ...) (forward-line ...) (setq current-line line) (let ... ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
diff-hl-update()
I see that vc-git-diff
is being called with 4 args:
vc-git-diff(("/Users/steve/.emacs.d/lisp/init-haskell.el") nil nil " *diff-hl* ")
but the current declaration of that function looks like
(defun vc-git-diff (files &optional async rev1 rev2 buffer)
...
so I'm guessing the async
arg has just been added. Not sure if that's something which can be easily detected and worked around in diff-hl
.
Hi,
AFAIK, "diff-hl-mode" just ignores any narrowing in effect, which gives random results for highlighting.
Not only that highlighting in the fringe is incorrect when narrowing is in effect. The current code can even freeze Emacs!
Yesterday, I had narrowed a buffer to a single defun and tried to edit it. The file has around 10000 lines and around 100 change hunks. Emacs got extremely sluggish; after inserting a character, Emacs got frozen for a few seconds. With the internal profiler, I got to know that time was spend in redisplaying. I typed M-: (overlay-lists) and found tons of overlays, all from diff-hl. I think they where all concentrated in the narrowed part; it's normal that Emacs gets sluggish in such circumstances. After "widen" the sluggishness immediately disappeared. However, the sluggishness does not always appear after narrowing, it's somewhat random.
I guess there is not much more to do than to wrap some code (in "diff-hl-update" or so) in
(save-restriction (widen) ...)
Thanks!
The README indicates that showing accurate diffs even if the buffer has been modified, but not saved is a possible feature. This is an issue to track the discussion and development of this feature, if this is deemed worthwhile to implement.
Debugger entered--Lisp error: (void-function diff-hl-global-mode-change)
(diff-hl-global-mode-change)
(custom-declare-variable (quote global-diff-hl-mode) (quote nil) (quote ("/home/ec2-user/.emacs.d/elpa/diff-hl-20150818.822$
Is it the problem with the new version?
I use Emacs in the terminal (no fringe) with linum-mode
. Using diff-hl-margin-mode
only the line numbers get displayed. Is there a way to make them work together?
For some reason the fringe background color is always white in the latest Emacs, at least using the fringe version of diff-hl
-- the margin version works fine, showing green and red etc. I'm guessing this is an Emacs issue, but it's possible the diff-hl
code needs to be modified, so I thought I'd mention it here.
When editing a buffer, having red - green - blue for deleted - inserted - changed looks very nice, by matching colors used in Diff mode.
However, in Dired, I'd prefer to see the modified files with an orange icon, to match my "vc-icon" in the modeline (à la Tortoise) : green for not modified since last commit, orange for modified.
See http://screencast.com/t/nUvy7GMnlmi.
Currently, in Dired, we have "diff-hl-unknown" for non-versioned files (not under version control, but have not been ignored). Can we have new faces:
For normal files, can we have a "v" indicator in the fringe?
For modified files, can we change the indicator to be "!" instead of "|" in the fringe?
Thanks in advance!
On file buffers would be great if there is a way to show up the signs without margin mode enabled.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.