1 Elisp

1.1 Blog Post Fetch Functions

  ;; ---------------------------------------
  ;; Blog Post Fetch Functions
  ;; ---------------------------------------
  (cl-defun get-headings(&optional (N 5))
    (setq my-list '())
    (if (org-before-first-heading-p)
	(org-next-visible-heading 1))
    (while (< 0 N)
      (push (get_current_heading_text) my-list)
      (org-forward-heading-same-level 1)
      (setq N (1- N)))
    (print my-list))
  (get-headings 2)

  (cl-defun reverse-subset-list(_list &optional(N 0))
    ;; reverse a subset of N elements of a list.
    ;; If no subset is provided, the subset is the set.
    (cl-assert (>= (length _list) N) t
	       "ERROR: number of elements chosen is larger than length of list.")
    (setq _list (seq-subseq _list (- N)))
    (setq _newlist '())
    (while (> (length _list) 0)
      (push (pop _list) _newlist))
    (cl-assert (eq _list nil) t
	       "ERROR: _list still has element on the stack.")
    (print _newlist)

  (cl-defun get-blog-headers(&optional (N 5))
    (setq _header-list (get-headings N))
    (setq _header-list (reverse-subset-list _header-list N))
    (print _header-list))

  (get-blog-headers 7)

   (format "[[%s]]" (expand-file-name "")))
  (re-search-forward "^\*\s.+\n" nil t 5)

    (insert-file-contents "./")
    (while (search-forward-regexp "^\*\s.+\n" nil t 5)
      (match-string 0)
#+BEGIN_SRC emacs-lisp :exports none
  (defun get-string-from-file (filePath)
    "Return file content as string."
      (insert-file-contents filePath)
      (while (search-forward-regexp "^\*\s.+\n" nil t 5)
  (get-string-from-file "./")

1.2 Using a function to get subtree contents:

(cl-defun get-section(&optional (N 1))
(org-next-visible-heading N)
(get-section 2)

1.3 Greeting Maddie with a pop-up

  (defun greet-maddie?(x)
    (cond ((string= x "y") (message-box "Good morning, My Docchi!"))

(greet-maddie? "y")