home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / emacs / bug / 1469 < prev    next >
Encoding:
Text File  |  1992-11-11  |  4.3 KB  |  146 lines

  1. Newsgroups: gnu.emacs.bug
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!netsys!agate!ames!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!osf.ORG!weisman
  3. From: weisman@osf.ORG (Dave Weisman)
  4. Subject: Small bug in harris-tags
  5. Message-ID: <WEISMAN.92Nov10185013@macaroni.osf.org>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Open Software Foundation
  8. Distribution: gnu
  9. Date: Tue, 10 Nov 1992 23:50:13 GMT
  10. Approved: bug-gnu-emacs@prep.ai.mit.edu
  11. Lines: 133
  12.  
  13. There is a small bug in the Harris tags package.  The symptom is
  14. that when using etags files, the wrong location may sometimes be
  15. found.
  16.  
  17. In the function find-tag there are several places where the
  18. buffer-local variable traditional-tags-table is (incorrectly)
  19. examined outside of its buffer.  The fix is to make a copy while
  20. in the correct buffer and subsequently examine the copy.  Context
  21. diff follows.
  22.  
  23. Dave
  24.  
  25. ======================================================================
  26.  
  27. *** c:/demacs/lisp2/harris-ta.el    Sat Aug 22 19:41:28 1992
  28. --- c:/demacs/lispdw/harris-ta.el    Mon Nov  9 14:10:48 1992
  29. ***************
  30. *** 320,326
  31.     (interactive (if current-prefix-arg
  32.              '(nil t)
  33.            (find-tag-tag "Find tag: ")))
  34. !   (let (buffer file linebeg startpos startline)
  35.       (save-excursion
  36.         (visit-tags-table-buffer)
  37.         (if next (setq tagname last-tag)
  38.  
  39. --- 320,326 -----
  40.     (interactive (if current-prefix-arg
  41.              '(nil t)
  42.            (find-tag-tag "Find tag: ")))
  43. !   (let (buffer file linebeg startpos startline traditional-tags-table-copy)
  44.       (save-excursion
  45.         (visit-tags-table-buffer)
  46.   
  47. ***************
  48. *** 323,328
  49.     (let (buffer file linebeg startpos startline)
  50.       (save-excursion
  51.         (visit-tags-table-buffer)
  52.         (if next (setq tagname last-tag)
  53.       (goto-char (point-min))
  54.       (setq last-tag tagname))
  55.  
  56. --- 323,332 -----
  57.     (let (buffer file linebeg startpos startline traditional-tags-table-copy)
  58.       (save-excursion
  59.         (visit-tags-table-buffer)
  60. +       ;; We need a local copy for when we're out of the tags buffer. 
  61. +       (setq traditional-tags-table-copy traditional-tags-table)
  62.         (if next (setq tagname last-tag)
  63.       (goto-char (point-min))
  64.       (setq last-tag tagname))
  65. ***************
  66. *** 367,373
  67.         (setq tags-file-name tags-file))
  68.       (widen)
  69.       (push-mark)
  70. !     (let ((offset (if traditional-tags-table 1000 20))
  71.         found
  72.         (pat (concat (if traditional-tags-table "^" "^[ \t]*")
  73.                  (regexp-quote linebeg))))
  74.  
  75. --- 371,377 -----
  76.         (setq tags-file-name tags-file))
  77.       (widen)
  78.       (push-mark)
  79. !     (let ((offset (if traditional-tags-table-copy 1000 20))
  80.         found
  81.         (pat (concat (if traditional-tags-table-copy "^" "^[ \t]*")
  82.                  (regexp-quote linebeg))))
  83. ***************
  84. *** 369,375
  85.       (push-mark)
  86.       (let ((offset (if traditional-tags-table 1000 20))
  87.         found
  88. !       (pat (concat (if traditional-tags-table "^" "^[ \t]*")
  89.                  (regexp-quote linebeg))))
  90.         (or traditional-tags-table
  91.         (setq startpos (if (null startline)
  92.  
  93. --- 373,379 -----
  94.       (push-mark)
  95.       (let ((offset (if traditional-tags-table-copy 1000 20))
  96.         found
  97. !       (pat (concat (if traditional-tags-table-copy "^" "^[ \t]*")
  98.                  (regexp-quote linebeg))))
  99.         (or traditional-tags-table-copy
  100.         (setq startpos (if (null startline)
  101. ***************
  102. *** 371,377
  103.         found
  104.         (pat (concat (if traditional-tags-table "^" "^[ \t]*")
  105.                  (regexp-quote linebeg))))
  106. !       (or traditional-tags-table
  107.         (setq startpos (if (null startline)
  108.                    (point-min)
  109.                  (goto-char 1)
  110.  
  111. --- 375,381 -----
  112.         found
  113.         (pat (concat (if traditional-tags-table-copy "^" "^[ \t]*")
  114.                  (regexp-quote linebeg))))
  115. !       (or traditional-tags-table-copy
  116.         (setq startpos (if (null startline)
  117.                    (point-min)
  118.                  (goto-char 1)
  119. ***************
  120. *** 385,391
  121.             (re-search-forward pat (+ startpos offset) t))
  122.       (setq offset (* 3 offset)))
  123.         (or found
  124. !       (if traditional-tags-table
  125.             (or (re-search-forward pat nil t)
  126.             (error "%s not found in %s" pat file))
  127.           (re-search-forward pat))))
  128.  
  129. --- 389,395 -----
  130.             (re-search-forward pat (+ startpos offset) t))
  131.       (setq offset (* 3 offset)))
  132.         (or found
  133. !       (if traditional-tags-table-copy
  134.             (or (re-search-forward pat nil t)
  135.             (error "%s not found in %s" pat file))
  136.           (re-search-forward pat))))
  137.  
  138.  
  139. --
  140.  
  141. -- Dave
  142.  
  143.  
  144.