annotate lisp/cedet/semantic/mru-bookmark.el @ 112453:06719a229a46 default tip

* calc/calc.el (calc-default-power-reference-level) (calc-default-field-reference-level): New variables. * calc/calc-units.el (math-standard-units): Add dB and Np. (math-logunits): New variable. (math-extract-logunits, math-logcombine, calcFunc-luplus) (calcFunc-luminus, calc-luplus, calc-luminus, math-logunit-level) (calcFunc-fieldlevel, calcFunc-powerlevel, calc-level): New functions. (math-find-base-units-rec): Add entry for ln(10). * calc/calc-help.el (calc-u-prefix-help): Add logarithmic help. (calc-ul-prefix-help): New function. * calc/calc-ext.el (calc-init-extensions): Autoload new units functions. Add keybindings for new units functions.
author Jay Belanger <jay.p.belanger@gmail.com>
date Sun, 23 Jan 2011 23:08:04 -0600
parents ef719132ddfa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1 ;;; semantic/mru-bookmark.el --- Automatic bookmark tracking
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 110828
diff changeset
3 ;; Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 ;; the Free Software Foundation, either version 3 of the License, or
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; (at your option) any later version.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; GNU General Public License for more details.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22 ;;; Commentary:
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;; Using editing hooks, track the most recently visited or poked tags,
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 ;; and keep a list of them, with the current point in from, and sorted
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 ;; by most recently used.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28 ;; I envision this would be used in place of switch-buffers once
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29 ;; someone got the hang of it.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 ;; I'd also like to see this used to provide some nice defaults for
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 ;; other programs where logical destinations or targets are the tags
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33 ;; that have been recently edited.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35 ;; Quick Start:
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37 ;; M-x global-semantic-mru-bookmark-mode RET
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39 ;; < edit some code >
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
41 ;; C-x B <select a tag name> RET
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42 ;;
105308
f81bcc25ab59 Fix comment typos.
Glenn Morris <rgm@gnu.org>
parents: 104509
diff changeset
43 ;; In the above, the history is pre-filled with the tags you recently
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44 ;; edited in the order you edited them.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 ;;; Code:
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47
105652
51bc239bdc37 * cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents: 105377
diff changeset
48 (eval-when-compile (require 'cl))
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 (require 'semantic)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50 (require 'eieio-base)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 (require 'ring)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53 (declare-function data-debug-new-buffer "data-debug")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
54 (declare-function data-debug-insert-object-slots "eieio-datadebug")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
55 (declare-function semantic-momentary-highlight-tag "semantic/decorate")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
56
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
57 ;;; TRACKING CORE
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
59 ;; Data structure for tracking MRU tag locations
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
60
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
61 (defclass semantic-bookmark (eieio-named)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
62 ((tag :initarg :tag
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
63 :type semantic-tag
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
64 :documentation "The TAG this bookmark belongs to.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
65 (parent :type (or semantic-tag null)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
66 :documentation "The tag that is the parent of :tag.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67 (offset :type number
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68 :documentation "The offset from `tag' start that is
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69 somehow interesting.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
70 (filename :type string
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
71 :documentation "String the tag belongs to.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
72 Set this when the tag gets unlinked from the buffer it belongs to.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73 (frequency :type number
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
74 :initform 0
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
75 :documentation "Track the frequency this tag is visited.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
76 (reason :type symbol
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77 :initform t
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78 :documentation
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
79 "The reason this tag is interesting.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
80 Nice values are 'edit, 'read, 'jump, and 'mark.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
81 edit - created because the tag text was edited.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
82 read - created because point lingered in tag text.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
83 jump - jumped to another tag from this tag.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
84 mark - created a regular mark in this tag.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
85 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
86 "A single bookmark.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
87
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
88 (defmethod initialize-instance :AFTER ((sbm semantic-bookmark) &rest fields)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
89 "Initialize the bookmark SBM with details about :tag."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
90 (condition-case nil
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
91 (save-excursion
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
92 (oset sbm filename (semantic-tag-file-name (oref sbm tag)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
93 (semantic-go-to-tag (oref sbm tag))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
94 (oset sbm parent (semantic-current-tag-parent)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
95 (error (message "Error bookmarking tag.")))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
96 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
97
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
98 (defmethod semantic-mrub-visit ((sbm semantic-bookmark))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99 "Visit the semantic tag bookmark SBM.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
100 Uses `semantic-go-to-tag' and highlighting."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
101 (require 'semantic/decorate)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102 (with-slots (tag filename) sbm
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
103 ;; Go to the tag
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
104 (when (not (semantic-tag-in-buffer-p tag))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
105 (let ((fn (or (semantic-tag-file-name tag)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
106 filename)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
107 (set-buffer (find-file-noselect fn))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
108 (semantic-go-to-tag (oref sbm tag) (oref sbm parent))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
109 ;; Go back to the offset.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
110 (condition-case nil
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
111 (let ((o (oref sbm offset)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
112 (forward-char o))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
113 (error nil))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
114 ;; make it visible
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
115 (switch-to-buffer (current-buffer))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
116 (semantic-momentary-highlight-tag tag)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
117 ))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
118
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
119 (defmethod semantic-mrub-update ((sbm semantic-bookmark) point reason)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
120 "Update the existing bookmark SBM.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
121 POINT is some important location.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
122 REASON is a symbol. See slot `reason' on `semantic-bookmark'."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
123 (condition-case nil
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
124 (progn
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
125 (with-slots (tag offset frequency) sbm
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
126 (setq offset (- point (semantic-tag-start tag)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
127 (setq frequency (1+ frequency))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
128 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
129 (oset sbm reason reason))
105308
f81bcc25ab59 Fix comment typos.
Glenn Morris <rgm@gnu.org>
parents: 104509
diff changeset
130 ;; This can fail on XEmacs at miscellaneous times.
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
131 (error nil))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
132 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
133
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
134 (defmethod semantic-mrub-preflush ((sbm semantic-bookmark))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
135 "Method called on a tag before the current buffer list of tags is flushed.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
136 If there is a buffer match, unlink the tag."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
137 (let ((tag (oref sbm tag))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
138 (parent (when (slot-boundp sbm 'parent)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
139 (oref sbm parent))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
140 (let ((b (semantic-tag-in-buffer-p tag)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
141 (when (and b (eq b (current-buffer)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
142 (semantic--tag-unlink-from-buffer tag)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
143
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
144 (when parent
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
145 (let ((b (semantic-tag-in-buffer-p parent)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
146 (when (and b (eq b (current-buffer)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
147 (semantic--tag-unlink-from-buffer parent))))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
148
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
149 (defclass semantic-bookmark-ring ()
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
150 ((ring :initarg :ring
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
151 :type ring
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
152 :documentation
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
153 "List of `semantic-bookmark' objects.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
154 This list is maintained as a list with the first item
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
155 being the current location, and the rest being a list of
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
156 items that were recently visited.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
157 (current-index :initform 0
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
158 :type number
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
159 :documentation
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
160 "The current index into RING for some operation.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
161 User commands use this to move through the ring, or reset.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
162 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
163 "Track the current MRU stack of bookmarks.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
164 We can't use the built-in ring data structure because we need
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
165 to delete some items from the ring when we don't have the data.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
166
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
167 (defvar semantic-mru-bookmark-ring (semantic-bookmark-ring
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
168 "Ring"
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
169 :ring (make-ring 20))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
170 "The MRU bookmark ring.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
171 This ring tracks the most recent active tags of interest.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
172
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
173 (defun semantic-mrub-find-nearby-tag (point)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
174 "Find a nearby tag to be pushed for this current location.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
175 Argument POINT is where to find the tag near."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
176 ;; I thought this was a good idea, but it is not!
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
177 ;;(semantic-fetch-tags) ;; Make sure everything is up-to-date.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
178 (let ((tag (semantic-current-tag)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
179 (when (or (not tag) (semantic-tag-of-class-p tag 'type))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
180 (let ((nearby (or (semantic-find-tag-by-overlay-next point)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
181 (semantic-find-tag-by-overlay-prev point))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
182 (when nearby (setq tag nearby))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
183 tag))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
184
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
185 (defmethod semantic-mrub-push ((sbr semantic-bookmark-ring) point
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
186 &optional reason)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
187 "Add a bookmark to the ring SBR from POINT.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
188 REASON is why it is being pushed. See doc for `semantic-bookmark'
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
189 for possible reasons.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
190 The resulting bookmark is then sorted within the ring."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
191 (let* ((ring (oref sbr ring))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
192 (tag (semantic-mrub-find-nearby-tag (point)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
193 (idx 0))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
194 (when tag
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
195 (while (and (not (ring-empty-p ring)) (< idx (ring-size ring)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
196 (if (semantic-tag-similar-p (oref (ring-ref ring idx) tag)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
197 tag)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
198 (ring-remove ring idx))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
199 (setq idx (1+ idx)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
200 ;; Create a new mark
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
201 (let ((sbm (semantic-bookmark (semantic-tag-name tag)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
202 :tag tag)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
203 ;; Take the mark, and update it for the current state.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
204 (ring-insert ring sbm)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
205 (semantic-mrub-update sbm point reason))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
206 )))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
207
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
208 (defun semantic-mrub-cache-flush-fcn ()
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
209 "Function called in the `semantic-before-toplevel-cache-flush-hook`.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
210 Cause tags in the ring to become unlinked."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
211 (let* ((ring (oref semantic-mru-bookmark-ring ring))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
212 (len (ring-length ring))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
213 (idx 0)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
214 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
215 (while (< idx len)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
216 (semantic-mrub-preflush (ring-ref ring idx))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
217 (setq idx (1+ idx)))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
218
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
219 (add-hook 'semantic-before-toplevel-cache-flush-hook
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
220 'semantic-mrub-cache-flush-fcn)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
221
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
222 ;;; EDIT tracker
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
223 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
224 (defvar semantic-mrub-last-overlay nil
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
225 "The last overlay bumped by `semantic-mru-bookmark-change-hook-fcn'.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
226
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
227 (defun semantic-mru-bookmark-change-hook-fcn (overlay)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
228 "Function set into `semantic-edits-new/move-change-hook's.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
229 Argument OVERLAY is the overlay created to mark the change.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
230 This function pushes tags onto the tag ring."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
231 ;; Dup?
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
232 (when (not (eq overlay semantic-mrub-last-overlay))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
233 (setq semantic-mrub-last-overlay overlay)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
234 (semantic-mrub-push semantic-mru-bookmark-ring
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
235 (point)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
236 'edit)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
237
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
238 ;;; MINOR MODE
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
239 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
240 ;; Tracking minor mode.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
241
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
242 (defcustom global-semantic-mru-bookmark-mode nil
106568
a54ddff7ac90 * cedet/semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
Chong Yidong <cyd@stupidchicken.com>
parents: 106197
diff changeset
243 "If non-nil, enable `semantic-mru-bookmark-mode' globally.
a54ddff7ac90 * cedet/semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
Chong Yidong <cyd@stupidchicken.com>
parents: 106197
diff changeset
244 When this mode is enabled, Emacs keeps track of which tags have
a54ddff7ac90 * cedet/semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
Chong Yidong <cyd@stupidchicken.com>
parents: 106197
diff changeset
245 been edited, and you can re-visit them with \\[semantic-mrub-switch-tags]."
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
246 :group 'semantic
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
247 :group 'semantic-modes
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
248 :type 'boolean
110828
2ceb09ee5949 Fix more CEDET require statements.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
249 :require 'semantic/util-modes
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
250 :initialize 'custom-initialize-default
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
251 :set (lambda (sym val)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
252 (global-semantic-mru-bookmark-mode (if val 1 -1))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
253
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
254 ;;;###autoload
108210
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
255 (define-minor-mode global-semantic-mru-bookmark-mode
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
256 "Toggle global use of option `semantic-mru-bookmark-mode'.
108210
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
257 If ARG is positive or nil, enable, if it is negative, disable."
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
258 :global t :group 'semantic :group 'semantic-modes
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
259 ;; Not needed because it's autoloaded instead.
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
260 ;; :require 'semantic-util-modes
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
261 (semantic-toggle-minor-mode-globally
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
262 'semantic-mru-bookmark-mode (if global-semantic-mru-bookmark-mode 1 -1)))
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
263
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
264 (defcustom semantic-mru-bookmark-mode-hook nil
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
265 "*Hook run at the end of function `semantic-mru-bookmark-mode'."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
266 :group 'semantic
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
267 :type 'hook)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
268
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
269 (defvar semantic-mru-bookmark-mode-map
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
270 (let ((km (make-sparse-keymap)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
271 (define-key km "\C-xB" 'semantic-mrub-switch-tags)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
272 km)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
273 "Keymap for mru-bookmark minor mode.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
274
108210
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
275 (define-minor-mode semantic-mru-bookmark-mode
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
276 "Minor mode for tracking tag-based bookmarks automatically.
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
277 When this mode is enabled, Emacs keeps track of which tags have
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
278 been edited, and you can re-visit them with \\[semantic-mrub-switch-tags].
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
279
108210
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
280 \\{semantic-mru-bookmark-mode-map}
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
281
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
282 With prefix argument ARG, turn on if positive, otherwise off. The
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
283 minor mode can be turned on only if semantic feature is available and
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
284 the current buffer was set up for parsing. Return non-nil if the
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
285 minor mode is enabled."
108210
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
286 :keymap semantic-mru-bookmark-mode-map
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
287 (if semantic-mru-bookmark-mode
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
288 (if (not (and (featurep 'semantic) (semantic-active-p)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
289 (progn
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
290 ;; Disable minor mode if semantic stuff not available
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
291 (setq semantic-mru-bookmark-mode nil)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
292 (error "Buffer %s was not set up for parsing"
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
293 (buffer-name)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
294 (semantic-make-local-hook 'semantic-edits-new-change-hooks)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
295 (add-hook 'semantic-edits-new-change-hooks
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
296 'semantic-mru-bookmark-change-hook-fcn nil t)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
297 (add-hook 'semantic-edits-move-change-hooks
108210
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
298 'semantic-mru-bookmark-change-hook-fcn nil t))
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
299 ;; Remove hooks
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
300 (remove-hook 'semantic-edits-new-change-hooks
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
301 'semantic-mru-bookmark-change-hook-fcn t)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
302 (remove-hook 'semantic-edits-move-change-hooks
108211
73a1ddc06d0e Use a mode-line spec rather than a static string in Semantic.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 108210
diff changeset
303 'semantic-mru-bookmark-change-hook-fcn t)))
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
304
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
305 (semantic-add-minor-mode 'semantic-mru-bookmark-mode
108210
5143700578d0 Use define-minor-mode in CEDET where applicable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
306 "k")
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
307
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
308 ;;; COMPLETING READ
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
309 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
310 ;; Ask the user for a tag in MRU order.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
311 (defun semantic-mrub-read-history nil
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
312 "History of `semantic-mrub-completing-read'.")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
313
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
314 (defun semantic-mrub-ring-to-assoc-list (ring)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
315 "Convert RING into an association list for completion."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
316 (let ((idx 0)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
317 (len (ring-length ring))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
318 (al nil))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
319 (while (< idx len)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
320 (let ((r (ring-ref ring idx)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
321 (setq al (cons (cons (oref r :object-name) r)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
322 al)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
323 (setq idx (1+ idx)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
324 (nreverse al)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
325
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
326 (defun semantic-mrub-completing-read (prompt)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
327 "Do a `completing-read' on elements from the mru bookmark ring.
105308
f81bcc25ab59 Fix comment typos.
Glenn Morris <rgm@gnu.org>
parents: 104509
diff changeset
328 Argument PROMPT is the prompt to use when reading."
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
329 (if (ring-empty-p (oref semantic-mru-bookmark-ring ring))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
330 (error "Semantic Bookmark ring is currently empty"))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
331 (let* ((ring (oref semantic-mru-bookmark-ring ring))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
332 (ans nil)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
333 (alist (semantic-mrub-ring-to-assoc-list ring))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
334 (first (cdr (car alist)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
335 (semantic-mrub-read-history nil)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
336 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
337 ;; Don't include the current tag.. only those that come after.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
338 (if (semantic-equivalent-tag-p (oref first tag)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
339 (semantic-current-tag))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
340 (setq first (cdr (car (cdr alist)))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
341 ;; Create a fake history list so we don't have to bind
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
342 ;; M-p and M-n to our special cause.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
343 (let ((elts (reverse alist)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
344 (while elts
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
345 (setq semantic-mrub-read-history
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
346 (cons (car (car elts)) semantic-mrub-read-history))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
347 (setq elts (cdr elts))))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
348 (setq semantic-mrub-read-history (nreverse semantic-mrub-read-history))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
349
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
350 ;; Do the read/prompt
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
351 (let ((prompt (if first (format "%s (%s): " prompt
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
352 (semantic-format-tag-name
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
353 (oref first tag) t)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
354 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
355 (concat prompt ": ")))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
356 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
357 (setq ans
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
358 (completing-read prompt alist nil nil nil 'semantic-mrub-read-history)))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
359 ;; Calculate the return tag.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
360 (if (string= ans "")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
361 (setq ans first)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
362 ;; Return the bookmark object.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
363 (setq ans (assoc ans alist))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
364 (if ans
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
365 (cdr ans)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
366 ;; no match. Custom word. Look it up somwhere?
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
367 nil)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
368 )))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
369
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
370 (defun semantic-mrub-switch-tags (tagmark)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
371 "Switch tags to TAGMARK.
105308
f81bcc25ab59 Fix comment typos.
Glenn Morris <rgm@gnu.org>
parents: 104509
diff changeset
372 Selects a new tag via prompt through the mru tag ring.
104507
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
373 Jumps to the tag and highlights it briefly."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
374 (interactive (list (semantic-mrub-completing-read "Switch to tag")))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
375 (if (not (semantic-bookmark-p tagmark))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
376 (signal 'wrong-type-argument tagmark))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
377
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
378 (semantic-mrub-push semantic-mru-bookmark-ring
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
379 (point)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
380 'jump)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
381 (semantic-mrub-visit tagmark)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
382 )
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
383
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
384 ;;; Debugging
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
385 ;;
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
386 (defun semantic-adebug-mrub ()
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
387 "Display a list of items in the MRU bookmarks list.
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
388 Useful for debugging mrub problems."
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
389 (interactive)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
390 (require 'eieio-datadebug)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
391 (let* ((out semantic-mru-bookmark-ring))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
392 (data-debug-new-buffer "*TAG RING ADEBUG*")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
393 (data-debug-insert-object-slots out "]")
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
394 ))
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
395
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
396
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
397 (provide 'semantic/mru-bookmark)
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
398
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
399 ;; Local variables:
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
400 ;; generated-autoload-file: "loaddefs.el"
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
401 ;; generated-autoload-load-name: "semantic/mru-bookmark"
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
402 ;; End:
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
403
51e316109fba lisp/cedet/semantic/mru-bookmark.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
404 ;;; semantic/mru-bookmark.el ends here