Skip to content
Browse files

Fixing bug where front of the list wouldn't be deleted (oops, thought…

… I'd checked for that :S Possibly only partially..)
  • Loading branch information...
1 parent ce6f3cb commit 89838f510c7bc274ef602670101041f6ebfb37ef Mark Hepburn committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 tags-view.el
6 tags-view.el
@@ -249,9 +249,11 @@ Argument is a marker that will be displayed, along with
(defun tv-delete-tag-for-etags (stack-position)
(ring-remove tags-location-ring stack-position))
(defun tv-delete-tag-for-gtags (stack-position)
- (labels
+ (macrolet
((delete-nth (n lst)
- (setcdr (nthcdr (1- n) lst) (nthcdr (1+ n) lst))))
+ `(if (zerop ,n)
+ (setq ,lst (cdr ,lst))
+ (setcdr (nthcdr (1- ,n) ,lst) (nthcdr (1+ ,n) ,lst)))))
(delete-nth stack-position gtags-point-stack)
(delete-nth stack-position gtags-buffer-stack)))

0 comments on commit 89838f5

Please sign in to comment.
Something went wrong with that request. Please try again.