emacs

Using macros in Emacs

July 29, 2020
emacs

tags Emacs Emacs macros allows us to record sequence of keyboard keystrokes, mouse actions, menu actions that is bound to an Emacs command. It allows us to record these actions and repeat them when needed. Creating a new macro # C-x ( starts recording a macro C-x ) stops recording a macro C-x e executes the macro C-u 37 C-x e executes the macro 37 times C-u 0 C-x e executes the macro an infinite number of times until EOF. ...

Org-roam

June 4, 2020
orgmode, orgroam, emacs

Backlinks # Org-roam export backlinks on Hugo Org-roam Firefox bookmark Ox-hugo export all roam to Hugo tags Org-mode Emacs

Ox-hugo export all roam to Hugo

June 4, 2020
emacs, orgmode, hugo, orgroam, roam

tags Emacs Org-mode Org-roam Export all org-roam files to Hugo markdown (this might take some time) From: jethrokuan/dots (defun benmezger/org-roam-export-all () "Re-exports all Org-roam files to Hugo markdown." (interactive) (dolist (f (org-roam--list-all-files)) (with-current-buffer (find-file f) (when (s-contains? "SETUPFILE" (buffer-string)) (org-hugo-export-wim-to-md))))) Adding an empty #+SETUPFILE: forces benmezger/org-roam-export-all to export the file.

Emacs

June 4, 2020
emacs, editor

Backlinks # Org-roam export backlinks on Hugo Org-roam Org-roam Firefox bookmark Org-mode Firefox bookmarks Ox-hugo export all roam to Hugo Using macros in Emacs A brief introduction to Emacs Lisp for people with programming background | lgmoneda

Org-mode

June 4, 2020
orgmode, emacs

Backlinks # Org-roam export backlinks on Hugo Org-roam Org-roam Firefox bookmark Org-mode Firefox bookmarks Ox-hugo export all roam to Hugo

Org-roam export backlinks on Hugo

June 4, 2020
orgmode, emacs

tags Org-mode Emacs Org-roam Insert roam backlinks URL when exporting orgmode to HTML From: jethrokuan/dots (defun benmezger/org-roam-export-all () "Re-exports all Org-roam files to Hugo markdown." (interactive) (dolist (f (org-roam--list-all-files)) (with-current-buffer (find-file f) (when (s-contains? "SETUPFILE" (buffer-string)) (org-hugo-export-wim-to-md))))) (defun benmezger/org-roam--backlinks-list (file) (when (org-roam--org-roam-file-p file) (mapcar #'car (org-roam-db-query [:select :distinct [from] :from links :where (= to $s1) :and from :not :like $s2] file "%private%")))) (defun benmezger/org-export-preprocessor (_backend) (when-let ((links (benmezger/org-roam--backlinks-list (buffer-file-name)))) (insert "\n** Backlinks\n") (dolist (link links) (insert (format "- [[file:%s][%s]]\n" (file-relative-name link org-roam-directory) (org-roam--get-title-or-slug link)))))) (add-hook 'org-export-before-processing-hook #benmezger/org-export-preprocessor))

Org-roam Firefox bookmark

May 30, 2020
emacs, orgmode, roam, firefox

tags Org-mode Emacs Org-roam Org-roam has roam-protocol, which we can call throughout the system just like Org-mode Firefox bookmarks. Org-roam protocol supports specifying the roam template to use. Template is the template key for a template in org-roam-capture-ref-templates. More documentation on the templating system can be found here. These templates should contain a #+ROAM_KEY: ${ref} in it. Roam-ref protocol # Find and creates from with a specific ROAM_KEY ...

Org-mode Firefox bookmarks

May 30, 2020
emacs, orgmode, firefox

Backlinks # Org-roam Firefox bookmark tags Org-mode Emacs Add the following scripts to call org-capture from Firefox Call capture template # The following calls capture template key n javascript:location.href='org-protocol://capture?template=n'+'&url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection()); Without a capture template # If unspecified, the template key is set in the variable org-protocol-default-template-key. The following template placeholders are available: %:link The URL %:description The webpage title %:annotation Equivalent to [[%:link][%:description]] %i The selected text See: https:orgmode. ...

Hello, org-mode and hugo

April 23, 2020
blog, web
emacs, orgmode

Hello, world! This is my first post here. This blog is created using Hugo and Emacs org-mode. I am still busy migrating my posts from Asciidoc to org-mode, so this should take a bit of time.