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

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")))
)
))
))
)

Related

Is there a way to customize breadcrumbs in Emacs Orgmode?

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.

Visual Studio Code Snippets - Using a number over 9 for a placeholder?

Whenever I make a snippet using ${#:Default}, if the # is over 9 then it will mess up the tabbing.
Am I doing something wrong here? Is this a limitation to the snippet placeholders?
Ok so. I solved this quickly. I considered deleting this but I had difficulty getting clarification so this example may help someone.
Doing the following will tab to any 3# before moving on.
"Create a Timeline Event" : {
"prefix": "event_timeline",
"body":
[
"- Title: ${1:Title}",
" Description: ${2:description.}",
" EventDate:",
" Year: ${30:Year}",
" Month: ${31:Month}",
" Day: ${32:Day}",
" Hour: ${33:Hour}",
" Minute: ${34:Minute}",
"${4:TimelineEntry}"
],
"description": "Creates a timeline event for the DnD timeline"
}
Check these docs out. It does show [0-9]+ for the ints, so maybe this is intended.

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 to fix two clicks in dialog

I've created a dialog to ask the user if he really want to proceed creating another file (text buffer). However, there is something with my approach that requires me to click twice at the button yes or at the button no.
What am I doing wrong?
The code for the specific function is:
def createnew ()
var Hello=new MessageDialog (null, Gtk.DialogFlags.MODAL,
Gtk.MessageType.INFO, Gtk.ButtonsType.YES_NO, "Hello world!")
Hello.format_secondary_text ("This will delete the contets. Are you sure?")
Hello.run ()
case Hello.run()
when ResponseType.YES
_view.buffer.set_text("")
Hello.destroy ()
when ResponseType.NO
Hello.destroy ()
The function is working fine otherwise.
You are calling Hello.run () twice. The fist time, you discard the result and the second time you use it for the case block.

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")