I [currently] don't use the menu feature for want of screen real estate, so it's possible the answer lies there.
Is there any way to associate a docstring with a keybinding such that it'll show up in the C-c C-h (or related) help displays? Right now all I get is either Prefix Command or the name of the function/lambda to which the key is bound. I'd like to have something about the purpose of the prefixed keymap for the former, and explanatory text for the more obscure functions for the latter.
Yes, I know that clicking on the function name will bring up a help window with details; I'm just looking for a one-liner property that can be shown in the original *Help* pane without disrupting the screen layout with new panes.
I suspect the answer is 'no,' but it seems a fairly obvious feature..
Thanks!
Related
My Current Workflow
I need to use 'doseq'
I don't remember it's args.
I go to clojuredocs , lookup 'doseq', and look at the examples.
My Ideal Setup
Inside emacs, I type some magic key combo, I type in doseq,
and it EXTRACTS EXAMPLES FROM A LOCAL MIRROR OF CLOJUREDOCS
and presents it inside my emacs browser.
What I found via Google:
https://www.reddit.com/r/emacs/comments/450x84/a_clojuredocsorg_for_emacs/
Basically other people also want this.
My Question:
Is there anyway to do this in emacs?
Thanks!
I use cider-grimoire. In Spacemacs, I just type the leader key, followed by hg. Behind the scene, cider will perform a search on conj.io and return the result in another Emacs buffer.
Late to the party, but here it is:
https://github.com/mbuczko/helm-clojuredocs
It is helm-based solution which redirects to the clojuredocs.org displaying documentation of given search phrase (if found). Most useful when used with helm-clojuredocs-at-point function which simply searches for phrase under the cursor.
If you use cider, C-c C-d C-d on a var will show you the docstring for that var. Not exactly what you're describing but for many use-cases the docstring is enough to figure out the arguments to a function.
cider will also show the arguments to the current function (under cursor) in the echo area.
I'm new to Eclipse. Is it possible in Eclipse to hit a keybinding and find the name of the command it is bound too?
For example, pressing Ctrl+Shift+R and have something like "open-dialog" come up in a list telling me that Ctrl+Shift+R is bound to the command "open-dialog".
Unfortunately, Eclipse doesn't make this easy. (Related note: IntelliJ IDEA does.) There are a few things that might help you out, though:
In the Eclipse settings for key bindings, you could do "Export to CSV". Then you can search that document for key combinations.
Also in the Eclipse settings for key bindings, you can sort the "Binding" column. The list is unwieldy to scroll through, but the ordering of multi-key combinations seems to be well defined so you could eventually find the key combination you're looking for.
If you want to look up a common command without going into the settings, you can assign a keyboard shortcut to "Show Key Assist". You can't sort the list by key combination, but it's at least a relatively short list to look through.
Windows > Preferences > General > Keys
You can TYPE ( not press ) the name of the keys, it will sort the list by the name of the keys
Going by the original wording,
pressing Ctrl+Shift+R and
have something like "open-dialog" come up
it sounds like the Show key binding when command is invoked -> Through keyboard option in the Keys preference page would at least partially do what you're looking for:
This will bring up a toast-like overlay each time you press a key combination that's associated with a command. It will show the command name and a more detailed command explanation, if available.
However, the overlay will only display for a few seconds and then disappear, i.e. an onlooker might miss it if they are distracted by other activities on the screen. I don't think that there is a way to display this information "in a list", i.e. in a more permanent fashion, but I think that this would be a great feature to help developers learn new keyboard shortcuts in a pair programming environment.
I've just found speedbar and it's a wonderfully useful tool. I really like how it can drill into (python) files to show me a list of classes, methods and functions.
Is there any way I can get speedbar to auto-expand the tree of class/function references for the file in the currently active buffer?
It would be a bonus too if I could just expand to where the current cursor is; for instance, if the cursor was located in the foo function of the bar class, speedbar would expand to myfile.py > class bar > foo.
There is no canned solution for what you are asking about. Speedbar does, of course, know how to do it, but you will need to write a new command to do it.
I'll guess you might be interested in ECB, which can serve a similar function. It breaks the side window into multiple parts, and one of the windows does follow the cursor around in the list of tags. I'll guess this is what you want.
I'd like to quickly move point to a function in my Emacs buffer. I'd like to run some function and get a prompt asking me for the function name, with completion provided for every function defined in the current buffer.
I generally use etags to navigate around, but sometimes I'm looking for a framework method that's been overridden in several files. In these cases, I can find the file I need but then I'd like to quickly jump to the function there. There is a similar feature in TextMate where you can select a definition from a list in the bottom right of the editor.
Just to jump around functions in the current file? Use imenu. It's the simplest and lightest of all the alternatives listed so far and might be enough for what you want. It's also built into Emacs and has minimum setup hassle. It features graphical and textual interfaces. Anything extra and you'll be better off using one of the other excellent suggestions made here.
speedbar comes standard, and gives you a collapsible menu for each file in the current directory, by default middle clicking on an entry for a function definition jumps to that def. With emacs23 this was changed to the more normal leftclick.
You can use etags-select to select from multiple matching tags. But the answer to what you asked is imenu.
Icicles is probably closer to what you are looking for:
http://www.emacswiki.org/emacs/Icicles_-_Tags_Enhancements
It's an enhancement to etags and includes (among other things) the file name with the tag so you can tell if it's the one you are looking for.
try CEDET. It is a bit difficult to set up the first, but here is an excellent tutorial: by Alex ott
And when he gets installed, you can use semantic-complete-jump. pressed tab couple times, and it is also brings up symbol definitions.
If M-. brings up the wrong method, you can type C-u M-. to find the next one with the same name.
global gtags is very good
To navigate within the current file or a set of files that you select, you do not need a TAGS file. You can use Imenu. But it is better to use Icicles imenu commands.
Why? Because they let you use completion. Substring, regexp, prefix, or fuzzy completion. Combine simple patterns to match, or subtract them.
Command icicle-imenu is bound in Icicle mode to C-c =. Butyou can also look up just a command or just a non-command function (non-interactive), using command icicle-imenu-command or icicle-imenu-non-interactive-function.
These commands are multi-commands, meaning that they are actually browsers: you can trip among function definitions using keys C-RET or C-mouse-2 (direct jumps) and C-down (cycle). Hit RET or click mouse-2 to settle down at a final destination.
I use C-M-a and C-M-e to jump between the beginning and end of functions.
Otherwise, open up Speedbar and click the + icon next to a file name to view a list of functions contained in the file. Then click on the function names to jump to them directly.
I would like to add custom tooltips to emacs.
More specifically, whenever I hover on a symbol (function/variable) name
with my mouse of I would like to see a tooltip with the symbol's definition.
I know that I can find this kind of info with a tool like cscope but I have no idea how
to attach the output of cscope to a tooltip.
does anyone have a partial (how to link a callback to a tooltip in emacs in general) or
a full (how do I actually link the output of cscope to a tooltip) solution to this?
Thanks,
Nir
Your Emacs installation should include the Elisp reference manual (if not, download it now - you're going to need it when developing your mode). To access it, go to Info (C-h i) and look for a node labeled "Elisp", sometimes in a separate "Emacs" menu. Type i for index and tooltip to look for information on tooltips. You should find node 32.19.4 Properties with Special Meanings, which tells you that the content of the help-echo property is a string that is the tooltip content, or a function that can construct the tooltip dynamically. Explore the manual around that node to find out more about text properties and how to set them.
Here's a simple example:
(insert (propertize "foo\n" 'help-echo "Tooltip!"))
Type this into your *scratch* buffer and press C-j to run the code. Then point your mouse at the word "foo" and you should see the tooltip.
There is an AutoOverlay package that can automatically add overlays, and tooltips associated with those overlays, based on a regex match of the buffer text.