TODO Tool window in Emacs? - eclipse

I'm looking for a functionality like:
the TODO tool window of IntelliJ IDEA (see https://www.jetbrains.com/help/idea/todo-example.html) or
the Tasks list of Eclipse (see https://dzone.com/articles/to-do-lists-with-eclipse-tasks-view).
And I'd like that window to be opened automatically (if not empty) when opening any file or, at least, to have a message in the echo area stating that there are some TODO/FIXME items in the file I'm currently opening.
So far, I did not find any matching package, only things (like fic-ext-mode) that would highlight TODO and FIXME in comments for common programming languages, but no more.
Is there something else, closer to what I'm looking for? I'm certainly not the first one looking for such a feature in our favorite editor ;-)

hl-todo has hl-todo-occur, which opens an occur buffer of all the keywords it's configured to highlight in the current buffer. You should be able to add it to a major mode hook like so:
(add-hook 'prog-mode-hook #'hl-todo-occur)
But this doesn't work. I think it's because hl-todo-mode is activated in prog-mode-hook, and it isn't ready yet. I don't have time to track this down right now.
If you use magit, I just saw a new package magit-todos. I haven't tried it, but it looks pretty nice.

Not aware of an existing module. It would be nice to have one. If you can write, use elisp and M-x Highlight-regexp and M-x occur and then write a hook to open occur window when you open a file. May be a macro will do for this too. You can do more with elisp, such as make occur window renamed as TODO-window and parse the entries to convert into org-mode table to sort entries while preserving the clicking etc.

Related

What is the correct way to show menu / help screens in Emacs?

When using tools like Org-mode and Magit the mode will sometimes show help menus. For instance, org-mode export will show a nice menu that accept single keys and then executes some command. In Magit, when looking at the status view it will accept tabs to expand the staged and commit areas.
These areas, for both Git and Org, are nicely placed to take up some portion of the emacs frame that is mostly convenient. How does emacs do choose this?
Additionally, these views are read-only, up until the user presses tab in the case of Magit and the status view. Is there a best practice when creating these views which control editing, but allows the mode to edit the file and present alternative text?
Perhaps the answer is take a look at these function A, B, and C. Which is fine, I'm just learning and experimenting on my own.
Magit in particular is not the simplest introduction to popup buffers in Emacs, but it certainly is sophisticated and a good read. Find magit-popup.el on your machine, for example M-x find-function RET magit-popup-mode-setup. To me, that function looks like a good candidate to start reading that file. You can see the macro magit-define-popup in use for example in magit-push-popup in the file magit-remote.el
In the end, it boils down to opening a new buffer in a new window and give it a dedicated major mode which has all the key-bindings.
Another good candidate is the family of temp-buffer-* functions.
Hope, that gives some pointers to start reading.
An easy way to show menus/help screens à la Magit and org-mode is with Hydras:
http://wikemacs.org/wiki/Discoverability#Hydra
https://github.com/abo-abo/hydra/
https://github.com/abo-abo/hydra/wiki
It's a short elisp method to write and it will give you a menu like org-mode. For example:
(defhydra hydra-zoom (global-map "<f2>")
"zoom"
("g" text-scale-increase "in")
("l" text-scale-decrease "out"))
ps: it's not what org-mode and magit use. Magit's system wasn't re-usable until recently and I don't know how it compares with Hydra. A nice feature of Hydras is that you can tell it to not disappear after a keypress, so than you can press many keys in a row.

Emacs: Automatically show files in directory with find-file

When navigating through a deep directory tree with find-file (C-x C-f), I often find myself 1) tapping the Tab key to autocomplete a directory name, and 2) immediately tapping the Tab key again to see the contents of that directory. I do this so routinely that I'd love it if I didn't have to hit Tab a second time to see those contents.
Is there a way to automatically display the contents of a directory after autocompleting its name?
Also, I've played around with ido-mode and helm, but I wasn't a huge fan of either, so I ended up switching back to the default find-file.
I hesitate to say this, as I doubt you will find it satisfactory wrt what you are looking for, but in case it helps:
You can configure Icicles so that it immediately shows all candidates and updates the matches as you type. See Icicles Incremental Completion.
The relevant options are icicle-show-Completions-initially-flag and icicle-incremental-completion (and maybe icicle-find-file-expand-directory-flag).
(There are also options icicle-incremental-completion-delay and icicle-incremental-completion-threshold.)
If you don't like ido-mode or helm, you might find icomplete-mode more to your liking: it doesn't overwrite as many keybindings as ido does.

How to achieve this in Emacs?

I saw the feature shown and described below in Sublime Text and was curious to know how does one achieve it in Emacs?
A brief description of the feature:
Have a condensed view of the entire code/text file currently opened and highlight the region, in the very same condensed view, which is currently being viewed. Clicking on any part of the condensed view would bring that part in focus.
Although I know, almost certainly, that I would rarely use this feature since it would be, in my view, a estate hog, considering the fact that I have even had my scroll-mode disabled, but still I am curious to know how it can be done in Emacs.
And yeah I went through(skimmed) Sublime's feature list to find the name of the feature, so that I could then try to find it for Emacs, but couldn't. Therefore, another question: What's this feature called?
Original source of the image above.
There is MiniMap package. From EmacsWiki:
Put minimap.el in your load path.
(require 'minimap)
Use M-x minimap-create in a buffer you’re currently editing.
Use M-x minimap-kill to kill the minimap.
Use M-x customize-groupRETminimap RET to adapt minimap to your needs.

Removing DocView Welcome Page on Emacs

Emacs 23 can view PDF files inside the editor which is great. However it also shows a welcome page, for every PDF page, like this:
How can I remove this welcome page? I understand Emacs is doing some processing for the PDF page, and it probably does not want the user to try to open the file over and over again while it is doing that, but I'd prefer and hourglass instead of a whole page.
I tried setting doc-view-conversion-refresh-interval to nil BTW, it didnt work.
I am on GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4).
Thanks,
WRT your answer, it sounds like you either edited the original file, or made a replacement copy of that entire library.
The first way will be lost when you update Emacs. The second way means you won't get any improvements to that library when you update Emacs. Neither is a very good option.
Instead you can tell Emacs that if and when it loads the original library, it should re-define that one function at that time.
This minimises the potential problems associated with upgrades, and does not require you to load the library unconditionally in your .emacs (which would increase your start-up time unnecessarily for sessions where you didn't load any PDFs).
(eval-after-load 'doc-view
'(defun doc-view-buffer-message ()
;; your definition here
))
I think you need to press C-c C-c
I found doc-view.el source for Emacs 23, and I removed the message from doc-view-buffer-message function. So now when PDF is loaded an empty page is shown which is less confusing, welcome page made it look like the PDF was loaded.
After the changes I did byte-compile-file on the el file, and at the end of my .emacs I load this overriding the original doc-view.

Better control over Emacs windows

I spend a lot of my time in emacs, and for the most part it's wonderful. But one thing really drives me nuts when I'm deep in it, and that's control over which window various new buffers are opened in. When I do find-file, it always opens in the current window, and this is what I like. But tons of other modes like to split my windows for me, change the layout, and do various other things that annoy me. For example running M-x manual-entry seems to have no rhyme or reason about where it opens the manpage, and various org-mode commands do the same thing, closing windows I want to keep open, etc. I don't like having to redo my layout everytime I want to look at my org agenda or open a manpage.
In short, is there anyway to globally control which windows are used for modes that want to open in a window other than the current one? Can I direct them more easily? Or will I have to hack each mode to act the way I want it to?
Try Winner mode:
http://www.emacswiki.org/emacs/WinnerMode
It provides an undo/redo for changes to the window configuration.
This question has always bugged me too. I found this:
http://www.gnu.org/software/emacs/elisp/html_node/Choosing-Window.html
It looks like you can use (setf pop-up-frames t) to make stuff show up in a new frame.
Also, it looks like you can use display-buffer-function to override the display function (how buffers are chosen.) Of course, you'd have to be good at elisp.