* DONE 💻 Emacs integrations for efficient blogging :blog_sl:emacs:lazyblorg:lb_persistent: CLOSED: [2024-03-02 Sat 01:20] :PROPERTIES: :ID: emacs-blogging :CREATED: [2024-03-02 Sat 01:20] :END: :LOGBOOK: - State "DONE" from [2024-03-02 Sat 01:20] :END: Here I will try to describe a few of the customizations I made to simplify and streamline my blogging experience within Emacs. General information of requirements for lazyblorg are well described on the github page [[LbReadme'w][Readme file]]. We start from some org-mode file where you already have a heading and text section for something you want to blog about. ** Emacs helper function and configuration Let's make the heading =lazyblorg-ready= with a little Emacs function: #+begin_src emacs-lisp ;; lazyblorg blog entry generation (defun mvb/lazyblorg-new-entry () "Process the current heading in an Org mode buffer to become a blog entry." (interactive) (org-set-tags-to ":blog_sl:") (org-id-get-create) (org-entry-put (point) "CREATED" (format-time-string "[%Y-%m-%d %a %H:%M]" (current-time))) (org-todo 'done)) #+end_src Note that because I plan to manage several blogs, I changed the default =:blog:= tag to =:blog_sl:=, where the last two letters are my convention to make the tag blog-specific (here ~_sl~ for ~s~ mp ~l~ inux). I want a shortcut for this so that when the point is on the heading line I can just press it to instantiate the blog metadata. #+begin_src emacs-lisp (general-define-key "C-c B" 'mvb/lazyblorg-new-entry) #+end_src Note that I use the ~general~ package ([[GeneralElGit'w][general.el github]]) to manage my key bindings. Furthermore it is required that a logbook entry is created for the ~DONE~ status, which is not necessarily the default. Check the ~org-todo-keywords~ variable. The sequence specific to ~DONE~ needs to contain the exclamation mark as shown below in ~"DONE(d!)"~. #+begin_src emacs-lisp (setq org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)") : #+end_src