;;; semantic/mru-bookmark.el --- Automatic bookmark tracking
-;; Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
(declare-function data-debug-new-buffer "data-debug")
(declare-function data-debug-insert-object-slots "eieio-datadebug")
(declare-function semantic-momentary-highlight-tag "semantic/decorate")
+(declare-function semantic-tag-similar-p "semantic/tag-ls")
;;; TRACKING CORE
;;
)
"A single bookmark.")
-(defmethod initialize-instance :AFTER ((sbm semantic-bookmark) &rest fields)
+(cl-defmethod initialize-instance :after ((sbm semantic-bookmark) &rest fields)
"Initialize the bookmark SBM with details about :tag."
(condition-case nil
(save-excursion
(error (message "Error bookmarking tag.")))
)
-(defmethod semantic-mrub-visit ((sbm semantic-bookmark))
+(cl-defmethod semantic-mrub-visit ((sbm semantic-bookmark))
"Visit the semantic tag bookmark SBM.
Uses `semantic-go-to-tag' and highlighting."
(require 'semantic/decorate)
(semantic-momentary-highlight-tag tag)
))
-(defmethod semantic-mrub-update ((sbm semantic-bookmark) point reason)
+(cl-defmethod semantic-mrub-update ((sbm semantic-bookmark) point reason)
"Update the existing bookmark SBM.
POINT is some important location.
REASON is a symbol. See slot `reason' on `semantic-bookmark'."
(error nil))
)
-(defmethod semantic-mrub-preflush ((sbm semantic-bookmark))
+(cl-defmethod semantic-mrub-preflush ((sbm semantic-bookmark))
"Method called on a tag before the current buffer list of tags is flushed.
If there is a buffer match, unlink the tag."
(let ((tag (oref sbm tag))
(when nearby (setq tag nearby))))
tag))
-(defmethod semantic-mrub-push ((sbr semantic-bookmark-ring) point
+(cl-defmethod semantic-mrub-push ((sbr semantic-bookmark-ring) point
&optional reason)
"Add a bookmark to the ring SBR from POINT.
REASON is why it is being pushed. See doc for `semantic-bookmark'
)))
(defun semantic-mrub-cache-flush-fcn ()
- "Function called in the `semantic-before-toplevel-cache-flush-hook`.
+ "Function called in the `semantic-before-toplevel-cache-flush-hook'.
Cause tags in the ring to become unlinked."
(let* ((ring (oref semantic-mru-bookmark-ring ring))
(len (ring-length ring))
(setq semantic-mru-bookmark-mode nil)
(error "Buffer %s was not set up for parsing"
(buffer-name)))
- (semantic-make-local-hook 'semantic-edits-new-change-hooks)
- (add-hook 'semantic-edits-new-change-hooks
+ (semantic-make-local-hook 'semantic-edits-new-change-functions)
+ (add-hook 'semantic-edits-new-change-functions
'semantic-mru-bookmark-change-hook-fcn nil t)
(add-hook 'semantic-edits-move-change-hooks
'semantic-mru-bookmark-change-hook-fcn nil t))
;; Remove hooks
- (remove-hook 'semantic-edits-new-change-hooks
+ (remove-hook 'semantic-edits-new-change-functions
'semantic-mru-bookmark-change-hook-fcn t)
(remove-hook 'semantic-edits-move-change-hooks
'semantic-mru-bookmark-change-hook-fcn t)))
(setq ans (assoc ans alist))
(if ans
(cdr ans)
- ;; no match. Custom word. Look it up somwhere?
+ ;; no match. Custom word. Look it up somewhere?
nil)
)))