Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
I would like to bind semantic-mrub-switch-tag to F5 key.
I put the following to an ~/.emacs:
(define-key global-map [f5] 'semantic-mrub-switch-tag)
Unfortunately when I press F5 it does not switch back to a previous tag
get the following message:
Symbol's function definition is void: semantic-mrub-switch-tag
Do you know how can I map it to a F5 key ?
The best solution to me would be just to switch back to a previous tag
asking any question.
Great thanks for help
From: Eric M. Ludlam <eric@si...> - 2010-11-10 23:32:14
On 11/08/2010 05:29 AM, fajfusio@... wrote:
> I would like to bind semantic-mrub-switch-tag to F5 key.
> I put the following to an ~/.emacs:
> (define-key global-map [f5] 'semantic-mrub-switch-tag)
> Unfortunately when I press F5 it does not switch back to a previous tag
> and I
> get the following message:
> Symbol's function definition is void: semantic-mrub-switch-tag
> M-x semantic-mrub-switch-tag
> works fine.
That is because the function ends in an 's' and M-x auto-completes for
you when you press RET.
> Do you know how can I map it to a F5 key ?
> The best solution to me would be just to switch back to a previous tag
> asking any question.
That seems like a fine thing to be able to do. A command that cycles
backward through the mrub list would be pretty cool. The issue is that
it will be incomplete! The mrub list is constantly resorted, and
duplicates expunged, making the end result a bit less deterministic.
If someone wants to submit a patch, that would be great. Here is a
quick hack that vaguely works. Fix it up as needed:
(defun semantic-mrub-switch-to-mr-tag ()
"Switch to the most recently visited tag that is not the current tag.
Selects the new tag from the most recently used tags list."
(if (ring-empty-p (oref semantic-mru-bookmark-ring ring))
(error "Semantic Bookmark ring is currently empty"))
(let* ((ring (oref semantic-mru-bookmark-ring ring))
(alist (semantic-mrub-ring-to-assoc-list ring))
(first (cdr (car alist))))