How to display all TODO items from a single file - emacs

I am still new to org-mode and emacs, so please forgive me for asking such a simple question.
I organise my org-mode files one per area of interest: so I have one for work, one for personal projects, etc. These files contain both notes and TODO entries, so it's really hard to see all the TODO items in the given file...
So here is my question:
Is there an easy way to easy filter all the todo items in agenda view by file they are in?
The only way I can think of right now is by using a special tag per file, but this will require me to update all files and all entries it's quite a lot of work I would prefer to avoid.
Thanks!

See the Basic TODO functionality section in the manual: C-c / t constructs a "sparse tree" of all TODO items in a single file; C-c a t constructs a global TODO list out of all files that have been added to the agenda.

You can also use a per-file tag in a "FILETAGS" header for the file, so although you'd need to edit each file it's only one line per file. I use three, "#work" "#home" "#personal". Can then filter on tags in agenda views.
#+FILETAGS: #work

Related

Is there an Emacs read-only or view mode that allows inserting some text?

Here's the use case: I'm writing a novel in Emacs (in org-mode). One part of my writing/editing flow is to read over some large portion of what I've written, collecting notes/possible edits/etc as I go. The sort of thing you'd do, on paper, by printing it all out and then writing notes in the margin.
I want to prevent myself from, as I do this kind of review, actually doing any writing -- but that's surprisingly hard. Like, if the buffer is editable, I start to type a brief note about a fix, then find myself starting to restructure / fix a sentence, and next thing I know, I've spent five minute polishing
a single paragraph. This not only slows me down, it breaks my ability to imagine a reader's response.
I've tried just putting the buffer in view-mode, and that sort of works -- but then it's laborious to try to identify the places I want to go back and review/fix up.
My ideal would be, to have something in view-mode, which I genuinely can't edit, but which, as I move the cursor through it, I could hit some key combination, and it would allow me to enter a brief note in the minibuffer, which would then get inserted into the main buffer, at point, possibly inside brackets or a comment or some such.
Does anyone know of something like that? Or have any pointers to something similar which I could try to adapt?
You can easily set bookmarks at any locations. And bookmarks can contain annotations.
If you use library Bookmark+:
The annotations are in Org Mode by default, and they can even be separate files (by default they are part of the bookmarks themselves, so stored in your bookmarks file).
You can bookmark not just a position but also a region of text, whether a sentence, paragraph, page, or an arbitrary span of text.
You can automatically name bookmarks as you set them, if you don't care about the names.
Updated after OP's comment saying "I prefer to shove the comments/questions/notes directly into the text of the novel. Because I end up adding/deleting/moving text a ton, and I want the notes to move with the text":
Bookmarks move with the surrounding text. That is, they generally get relocated automatically, since the surrounding text is recorded as part of the bookmark, and when jumping to a bookmark that text is looked for.
Occasionally the context has changed so much that a bookmark can't be relocated automatically, and you are prompted to relocate it manually.
But yes, bookmarks are stored in a bookmark file, separately from the files they target. There are both advantages and disadvantages to this feature. Advantages include (1) removing clutter from the text (annotations, including notes about possible text changes are metadata), (2) immediate access to particular text locations from anywhere, (3) a separate, persistent record/history of work or thoughts on it, (4) you can have multiple, separate sets of bookmarks/annotations for the same target text.
One thing you might find handy, when using bookmarks especially for annotating a particular file: C-x p C-l switches to a bookmark file that has only bookmarks for the current file or buffer, creating such a file on the fly if none
exists. (This is available only with Bookmark+.)

emacs package for working with tagged regions?

I'd like to be able to apply tags to regions of code and text and to be able to use these to narrow visibility to navigate - ideally across multiple files. So for example if I was researching C16th European history I could tag insert and and zoom around around cromwellish stuff quickly, limit my searches to cromwellish regions, etc. It's important that tags pairs shouldn't have to be "well-formed" because I might want to start an region inside of a but end first. And, obviously, I'd to be able to list all my tags, and to search or narrow on combinations of them.
I can't find anything like this. Org-mode comes closest, but its tags are headline based, which makes stopping one tag while continuing other painful - plus I need headlines as headlines, and I'd like to be able to tag code this way too.
Is there anything like this? Or any toolkit that would be a good start to write this?
Library Bookmark+ provides what you are asking for, I think. It enhances standard Emacs bookmarking in several ways, including some that respond to your request.
You can bookmark locations of all sorts, and the recorded bookmark information can include the region limits/context. (If the region is active when you set the bookmark then the region info is recorded.)
When you jump to the bookmark, the region is re-activated (if the region was recorded).
If the content of the destination file (or whatever) has been modified since the bookmark was last updated, so that the text around the recorded region has changed, the bookmark and region are automatically relocated (assuming that the new destination and limits are recognizable and thus locatable).
Bookmark+ also lets you tag any bookmark (or file), in multiple ways. Tags are arbitrary, free-form strings (but you can also optionally associate arbitrary Lisp values with them.)
And you can list all tags, search and narrow on tag combinations (unions, intersections, etc.). Tags are one of the most important Bookmark+ features.
Library Icicles provides additional enhancements regarding the use of Bookmark+ bookmarks and tags.

Tell find-name-dired to only show filenames

Is there any way to make find-name-dired to only show filenames that I can move through and select? I have a lot of files that are buried in subdirectories, and I don't want it to print out the entire subdirectory every time it finds a file.
Two problems with this:
How would you distinguish between two files with the same file name in different directories?
Dired needs the full path in order to be able to do anything with that file.
You could deal with (2) by using text properties or overlays to hide the directories, but due to (1) I really couldn't recommend that.
Edit: to otherwise customise the output of dired to reduce unwanted noise you can use Dired Details (optionally with Dired Details Plus)
How do I hide number of links in dired?
Emacs dired: too much information

Creating vim buffer (NarrowRegions) from multiple files

I was wondering if there's a way to allow a buffer to edit multiple files at once.
Recently, I got vim working with eclim. But now I was wondering if I could edit multiple files at once in one buffer. For example, say I have an interface and a class file where I need to update a method signature is there a way I can load both of them into the same buffer and edit them simultaneously. Narrow region for multiple file regions. It would also be awesome to remember my settings but that could be a future iteration.
I saw this solution but it seems inconvenient to create a separate file to handle this interaction.
You can open all files as split windows (so you see all of them together), and :windo, :bufdo, :argdo allow you to perform mass-operations (like a :substitute) on all of them at once. There's usually no need for such artificial concatenation schemes, and as the linked article shows, it has its downsides over keeping the files separate.

Microsoft Word to Org-mode

I am trying to put the Microsoft Word document in emacs using org-mode. I have copied the Word Document and pasted in emacs. I like to achieve the headings like 7.1.2.4 in org-mode format.
and then link the TOC to appropriate headings. How I can do that? Any suggestions? Any programming language like Perl has done it?
Thanks.
There is ODT2ORG (https://bitbucket.org/josemaria.alkala/odt2org/wiki/Home) which lets you import odt files in org-mode.
Use Openoffice/Libreoffice to produce an .odt from your .doc.
Use odt2org to get an .org.
About the headings: I am not entirely sure I understand you.
there is org-toc.el included in org-mode that provides a seperate buffer with a TOC of your current document (like in Reftex). All the entries there are already links to the individual headings. Also, an exported document will have a TOC included by default without your intervention.
Orgmode does not support automatically numbered headings (yet). However, if you want to export your document to html, docbook, latex, or pdf, your headings will appear numbered and nested (you can tweak the settings quite a lot).
I doubt that you will get your intended result purely automatically but it should work 70% automatically, especially if you have latex installed and simply want to have a good-looking pdf in the end. Convert doc to odt, convert odt to org, open and type "C-c C-e d".
Another option: Save as an HTML file, then use Pandoc to convert the HTML to an .org file.
I've converted loads of Word documents into Org files. It takes minutes to do it by hand.
If you want cross-references, use internal links (4.2 in the current manual).
The * and ** style headings are always likely to be there in Org. Think of the use case where exports are compiled from #+INCLUDEd files, or you have done a selective export using tags. Any kind of single sourcing technology isn't going to display the numbering.
There is a ruby gem which converts doc to md. With pandoc you can convert to org.
https://github.com/benbalter/word-to-markdown