Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit de217f613d897c5a07c68cbb1e3c01b06e695cf4 1 parent f77bf7f
authored September 15, 2009

Showing 1 changed file with 9 additions and 4 deletions. Show diff stats Hide diff stats

  1. 13  tags-view.el
13  tags-view.el
@@ -137,12 +137,14 @@ etc).  The following options will be available:
137 137
 \\{tags-history-mode-map}"
138 138
   (interactive)
139 139
   (let ((buf (get-buffer-create "*tags history*"))
140  
-        (tag-items (tv-get-tags-list)))
  140
+        (tag-items (tv-get-tags-list))
  141
+        (backend (tv-determine-backend)))
141 142
     (pop-to-buffer buf)
142 143
     (setq buffer-read-only nil)
143 144
     (let ((inhibit-read-only t))
144 145
       (erase-buffer))
145 146
     (tags-history-mode)
  147
+    (set (make-local-variable 'tv-tags-backend) backend)
146 148
     (tv-insert-items tag-items)
147 149
     (setq buffer-read-only t)
148 150
     (goto-char 0)))
@@ -237,9 +239,12 @@ Argument is a marker that will be displayed, along with
237 239
 (defun tv-delete-tag-at-point (location)
238 240
   (interactive "d")
239 241
   (with-tag-info location (buf posn stack-pos)
240  
-    (tv--call-fn-for-backend 'clear-tag (tv-determine-backend) stack-pos)
241  
-    ;; redraw:
242  
-    (tv-view-history)))
  242
+    (tv--call-fn-for-backend 'clear-tag tv-tags-backend stack-pos)
  243
+    ;; redraw; hack here to make sure the same backend is used.  I
  244
+    ;; don't like this, and will probably refactor to fix it soon.  It
  245
+    ;; smells, to me:
  246
+    (let ((tv-determine-backend-function (lambda () tv-tags-backend)))
  247
+      (tv-view-history))))
243 248
 ;;; implementations:
244 249
 (defun tv-delete-tag-for-etags (stack-position)
245 250
   (ring-remove tags-location-ring stack-position))

0 notes on commit de217f6

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