In an org file, I want to find undone headlines that are not scheduled, and have no undone children that are scheduled either.
That is, headlines like the following:
* TODO Parent
* TODO Parent
** DONE Child 1
** DONE Child 2
But not like the following:
* TODO Parent
** TODO Child 1
*** TODO Child 1.1
SCHEDULED: <2016-08-22>
I'd like to limit that search to headlines in a specific TODO state (that is, if they are marked as "WAITING", then it's fine to be unscheduled).
Is it possible to do so, ideally with a sparse tree in the text buffer? (I specifically want to avoid the agenda for this.)
Related
I have a large tree and I can 'select' (i.e.highlight) any node of it. But if I have a large tree with all nodes expanded the user still needs to manually scroll down or up in order to locate the highlighted element. Is there a way which not only highlights the selected element but also locates it by automatically scrolling up/down in the tree?
TreePath path = createTreePath(editorID, treeObject);
getTreeViewer().setSelection(new TreeSelection(path), true);
getTreeViewer().refresh();
getTreeViewer().jumpToSelectedElement(true); // I need something like this. I made up the name of this imaginary method.
Use
public void reveal(Object elementOrTreePath)
As its name suggests elementOrTreePath can be a tree path or just an element.
I’m often putting bullet lists in “//“-style comments, e.g.:
// * Here’s a very long line containing a bullet and I want
// it to fill like this. Note the leading space here
//
// * Here’s the next bullet in that same bullet list.
However, I am unable to get M-q to fill the list that way by any obvious customization of newcomment.el variables. It always comes out like this:
// * Here’s a very long line containing a bullet and I want
// it to fill like this.
It doesn’t seem to be possible to make this work easily using regexps (with comment-use-syntax set to nil). Do I need to use syntax tables?
Paragraphs inside comments still work, you just need to separate them by empty commented line:
// * Here’s a very long line containing a bullet and I want
// it to fill like this.
//
// * Here’s the next bullet in that same bullet list.
Note that the 2nd and following lines aren't indented.
I want to make a skeleton application for some students, and I want to be able to direct the order in which the //TODO Task tags appear in the Task List View.
This is necessary so that the order in which the students will do the tasks actually teaches them something, rather than confusing them and having them spend too much time on understanding the application, rather its parts.
Is there any way to do this? Thank you
Well, the simple solution is just to add a number to the description.
//TODO 1. Fix this
//TODO 2. Fix this later
Then when sorting the tasts according to description they will appear in the order you choose.
You can sort the Tasks list by clicking on the column headings. So if you make your TODO text sort in the order you want you can click on the Description header to get that sort.
Starting the TODO text with a number would be one way to get the TODO to sort:
// TODO 001 First todo
// TODO 002 Second todo
I've been learning more about the d3 visualization library, and I've seen a few examples of bar charts that have a snippet that looks like
chart.selectAll("rect")
.data(data)
.enter().append("rect")
.attr("y", y)
.attr("width", x)
.attr("height", y.rangeBand());
My confusion is with the first selectAll line. What is the purpose of selecting all rects before they exist since we'll be appending new rects on data enter? Does what goes in the selectAll matter if none of those elements exist?
It is part of the declarative nature of the D3 language. The Thinking with Joins article explains it in detail. An excerpt:
But what’s with the selectAll("circle")? Why do you have to select
elements that don’t exist in order to create new ones? WAT.
Here’s the deal: instead of telling D3 how to do something, tell D3
what you want. In this case, you want the circle elements to
correspond to data: you want one circle per datum. Instead of
instructing D3 to create circles, then, tell D3 that the selection
"circle" should correspond to data—and describe how to get there. This
concept is called the data-join:
This Venn diagram illustrates the data-join. Data bound to existing
elements produce the update (inner) selection. Unbound data produce
the enter selection (left), and unbound elements produce the exit
selection (right). Data Enter Update Elements Exit Thinking with joins
reveals the mystery behind the sequence:
The selectAll("circle") returns the empty selection, since the SVG
container element (svg) is empty. No magic here.
The empty selection is joined to data: data(data). The data method
binds data to elements, producing three virtual selections: enter,
update and exit. The enter selection contains placeholders for any
missing elements. The update selection contains existing elements,
bound to data. Any remaining elements end up in the exit selection for
removal.
Since the selection was empty, all data ends up as placeholder nodes
in enter().
This is the same append as in the first example, but applied to
multiple placeholders; selection methods implicitly iterate over
selected elements. The missing elements are added to the SVG container
by append("circle").
So that’s it. You wanted the selection "circle" to correspond to data,
and you described how to create the missing elements.
In your example selectAll("rect") is called first. But it returns an empty selection.
data(data) will bind the empty selection with the data. It creates new empty selections.
.enter() identifies any DOM elements that needs to be added when the joined array is longer than the selection.
append("rect") appends a rectangle to each empty selection, which is no longer empty
It is well explained and detailed on this section: D3.js data binding, How it works?
We're using GWT and We're required to create two drag and drop tree grids. Each tree contains parents and children (max two level for now).
Here's what we need to be able to do:
Use cases
Drag a parent from one tree grid to the other.
Drag a parent 1 to parent 2 (1 will become child of 2, and all 1's children will become children of 2) -> please don't ask :D
Drag a child from one parent to another (within the same tree grid)
Drag a child to top level within the same tree grid (child will become a parent)
Drag a child to the other tree grid with two options
1 - Top level - child from tree 1 will become a parent on tree 2.
2 - Parent - Child from tree 1 will become child of a parent on the tree grid 2.
If this doesn't make much sense, we don't have the full context yet, so that's all we know.
Problem
We can drag on the same tree grid. If the row we want to drag the cell to is hidden, we set the scroll to true, so that the grid scrolls when the user is dragging inside it. Something like so:
private void setDraggableOptions(DragAndDropColumn<?, ?> column) {
// retrieve draggableOptions on the column
DraggableOptions draggableOptions = column.getDraggableOptions();
draggableOptions.setScroll(true);
// use template to construct the helper. The content of the div will be set
// after
draggableOptions.setHelper(HelperType.CLONE);
// opacity of the helper
draggableOptions.setOpacity((float) 0.8);
// cursor to use during the drag operation
draggableOptions.setCursor(Cursor.MOVE);
// set the revert option
draggableOptions.setRevert(RevertOption.ON_INVALID_DROP);
// prevents dragging when user click on the category drop-down list
draggableOptions.setCancel("select");
column.setDraggableOptions(draggableOptions);
}
Now the problem is, setting the tree grid to scroll, the user will never be able to drag the object to the second tree as the scroll will try to keep the object always inside the grid.
We're using the gwtquery-plugins
Is there any idea to work around this? Thank you very much in advance.
See my response to your question here