Skip to content

Instantly share code, notes, and snippets.

@nchapon
Created November 15, 2015 22:01
Show Gist options
  • Save nchapon/a5de836f6b391bb7b391 to your computer and use it in GitHub Desktop.
Save nchapon/a5de836f6b391bb7b391 to your computer and use it in GitHub Desktop.
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(require 'f)
;; List all files
(f-files "/home/nchapon/notes/GTD/days")
(with-current-buffer
(find-file-noselect "/home/nchapon/notes/GTD/days/2015-10-22.org")
(goto-char (point-min))
(forward-line 0)
(insert "* ")
(insert (file-name-base "/home/nchapon/notes/GTD/days/2015-10-22.org"))
(insert "\n"))
(defun demote-entries (filename)
(with-current-buffer
(find-file-noselect filename)
(goto-char (point-min))
(forward-line 0)
(insert "* ")
(insert (file-name-base filename))
(insert "\n")))
(demote-entries "/home/nchapon/notes/GTD/days/2015-10-22.org")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment