Is there a way to customize breadcrumbs in Emacs Orgmode? - emacs

When I set org-agenda-prefix-format with %b, I got all higher levels headline shown in the agenda .Is there any way to show only parent level, without other higher levels shown.
I have tried:
'((todo . " %-25(concat \"[\"(truncate-string-to-width (car (last
(org-get-outline-path))) 21 nil nil t) \"]\")"))
It works ok with todo.
However, when I tried on agenda:
'((agenda . " %-25(concat \"[\"(truncate-string-to-width (car (last
(org-get-outline-path))) 21 nil nil t) \"]\")"))
my custom command:
("n" "Agenda and all TODOs"
((agenda "" nil)
(alltodo "" nil))
nil)
did not work, only agenda but no todo shown.
update:
If there is no agenda items for today, the agenda view shows ok with both todo and agenda. However, If there is an agenda items for today, the todo won't show any more. Does my org-agenda-prefix-format config affect the timeline or something? This really makes me confused.

Related

Get a view of scheduled tasks excluding some TODO states on Org Mode

Here are the todo states I use (on GNU Emacs 24.5.1):
(setq org-todo-keywords '((type "TODO" "NEXT" "DONE" "STARTED" "WAITING" "FROZEN" "REFERENCE" "CANCELLED" "DELEGATED")))
I would like to create a custom view showing all the scheduled tasks for the current week (next 8 days) that have TODO, NEXT, STARTED, WAITING, FROZEN, REFERENCE, or DELEGATED as a todo state.
(setq org-agenda-custom-commands
'(("8" "Scheduled this week"
((agenda ""
((org-agenda-start-day "+0")
(org-agenda-span 8)
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo '("DONE" "CANCELLED")))
)
))
))
)

Leaflet Popups with Clojurescript

I'm pretty sure this is a conceptual error, but I'm not sure where I'm making the incorrect call.
Following the leaflet tutorial, I'm trying to create a popup on a map. Per the tutorial, this is a simple operation
var popup = L.popup();
function onMapClick(e) {
popup
.setLatLng(e.latlng)
.setContent("You clicked the map at " + e.latlng.toString())
.openOn(mymap);
}
mymap.on('click', onMapClick);
However, when I translate this into clojurescript, I receive the following error:
Uncaught TypeError: t.openPopup is not a function
I'm 100% positive I'm calling the javascript incorrectly. I'm doing the following:
(defn onMapClick [e]
(let [popup (js/L.Popup.)]
(-> popup
(.setLatLng (.-latlng e))
(.setContent (str "You clicked the map at " (.-latlng e)))
(.openOn map))))
And then I call this as:
(.on map "click" onMapClick)
where map is correctly defined. (I say correctly because I am able to draw polygons and create popups that are bound to those polygons with .bindPopup)
I was thinking of not relying on return values at all. Just relying on the call sequence:
(defn onMapClick [e]
(let [popup (js/L.Popup.)]
(.setLatLng popup (.-latlng e))
(.setContent popup (str "You clicked the map at " (.-latlng e)))
(.openOn popup map)))
If the docs say that these js setter functions return popup then this won't make much of an answer!
You should be able to isolate the problem down to just one function call??

How tool-bar button in emacs works? [duplicate]

This question already has answers here:
How to add a tool-bar button in emacs?
(2 answers)
Closed 8 years ago.
i have a problem to add a tool-bar button in emacs.
I can run it with eval-buffer but not with my .emacs. When i add it with eval-buffer my button leave my toolbar after a scroll.
;;; Code:
(defun omar-hotel ()
"another nonce menu function"
(interactive)
(message "hotel, motel, holiday inn"))
(define-key-after global-map [tool-bar omar-button]
'(menu-item "Hotel" omar-hotel
:image (image :type xpm :file "/usr/share/emacs/23.4/etc/images/jump-to.xpm")
:help "OMG Omar!"
))
i also tried to add-hook like that but that's doesn't works.
(add-hook 'after-init-hook
(lambda ()
(define-key-after global-map [tool-bar omar-button]
'(menu-item "Hotel" omar-hotel
:image (image :type xpm :file "/usr/share/emacs/23.4/etc/images/jump-to.xpm")
:help "OMG Omar!"
))
))
Hi i found a simple solution to add a toolbar button "spell" is the image in /usr/share/emacs/23.4/etc/images/
(defun omar-hotel ()
"another nonce menu function"
(interactive)
(message "hotel, motel, holiday inn"))
(tool-bar-add-item "spell" 'omar-hotel
'omar-hotel
:help "Run fonction omar-hotel")

Blackberry 10 ListView - multiselect

I am in need of a bit of help regarding cascades ListView, I found some code a few weeks ago from this great site and have used it to show a tiled ListView in an application.
I have tried to go one step further now and have multiselect in the context menu - this is working ok apart from one issue which is when I select more in the context menu after pressing on a ListItem for a couple of seconds the highlighted ListItem doesn't remain highlighted any longer. So then the user will think they have to press it again to highlight it.
void CustomImageView::select(bool b) {
qDebug() << "select isselected=" << b;
if (b)
{
mHighlightContainer->setOpacity(0.9f);
}
else
{
mHighlightContainer->setOpacity(0.0f);
}
}
void CustomImageView::reset(bool selected, bool activated)
{
Q_UNUSED(activated);
qDebug() << "reset";
select(selected);
}
void CustomImageView::activate(bool activate)
{
qDebug() << "activate ";
select(activate);
}
Here is the output when I press select more in the menu (at which point the listitem is highlighted as required)
activate
select isselected= true
activate
select isselected= false
If I comment out select(activate); from activate function then the multiselect seems to work as required (it will highlight the item i long press) and stay highlighted but then when i just press (not long press) an item in the list it won't highlight any longer so there is no feedback for the user when tapping an item - it seems i can't have both!
Anybody know what I can do to solve this please?

Drag and drop events in embedded SVG?

Is there any possibility of receiving drag and drop events from SVG elements within a web page?
I tried the Google Closure library, to no avail.
Specifically, suppose my page contains
<ul id = "list">
<li class="item" id="item1">foo</li>
<li class="item">bar</li>
<li class="item">baz</li>
</ul>
And my script contains (Clojurescript/C2)
(let [items (select-all ".item")
lst (select "#list")
target (fx/DragDrop. lst nil)]
(dorun (map
(fn [item]
(let [source (fx/DragDrop. item nil)]
(. source (addTarget target))
(. source (init))))
items))
(. target (init)))
Then I do get a drag image (ghost), although I do not manage to receive drag events e.g. by doing
(on-raw "#item1" :dragstart (fn [e] (.log js/console (str "dragstart " e))))
Using similar code for SVG elements, I do not even get a ghost...
Any hints?
Thanks
Drag events are not supported on SVG Elements: http://www.w3.org/TR/SVG/svgdom.html#RelationshipWithDOM2Events.
You can fake the drag events with mouse events, see http://svg-whiz.com/svg/DragAndDrop.svg (view the source).
You can always implement it. Basically, you have to check if the element is touching another one when you are dragging:
this.isTouching = function(element){
if(this.x <= element.x && element.x <= (this.x + this.width) &&
this.y <= element.y && element.y <= (this.y + this.height)){
return true;
}else{
return false;
}
};
And it works in all browsers. Hope it helps :)