Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Right, fixed some battle-testing bugs. The main issue is when/how oft…

…en the function to determine the backend gets called; since it was being called from the history buffer as well, the algorithm looking at the current working directory etc was seeing a different value from when it was first invoked. I think the long term solution is to pass the backend through to any function that uses it, rather than working it out internally -- this is more referentially-transparent anyway, we just need to make sure that we don't thread too much state through and flood the api. The other fix involved setting a buffer-local variable with the value of the backend, and using that later.
  • Loading branch information...
1 parent f77bf7f commit de217f613d897c5a07c68cbb1e3c01b06e695cf4 Mark Hepburn committed
Showing with 9 additions and 4 deletions.
  1. +9 −4 tags-view.el
13 tags-view.el
@@ -137,12 +137,14 @@ etc). The following options will be available:
(let ((buf (get-buffer-create "*tags history*"))
- (tag-items (tv-get-tags-list)))
+ (tag-items (tv-get-tags-list))
+ (backend (tv-determine-backend)))
(pop-to-buffer buf)
(setq buffer-read-only nil)
(let ((inhibit-read-only t))
+ (set (make-local-variable 'tv-tags-backend) backend)
(tv-insert-items tag-items)
(setq buffer-read-only t)
(goto-char 0)))
@@ -237,9 +239,12 @@ Argument is a marker that will be displayed, along with
(defun tv-delete-tag-at-point (location)
(interactive "d")
(with-tag-info location (buf posn stack-pos)
- (tv--call-fn-for-backend 'clear-tag (tv-determine-backend) stack-pos)
- ;; redraw:
- (tv-view-history)))
+ (tv--call-fn-for-backend 'clear-tag tv-tags-backend stack-pos)
+ ;; redraw; hack here to make sure the same backend is used. I
+ ;; don't like this, and will probably refactor to fix it soon. It
+ ;; smells, to me:
+ (let ((tv-determine-backend-function (lambda () tv-tags-backend)))
+ (tv-view-history))))
;;; implementations:
(defun tv-delete-tag-for-etags (stack-position)
(ring-remove tags-location-ring stack-position))

0 comments on commit de217f6

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