#+TITLE: org-mode

* Org Mode Example

This is a *short* page /written/ in [[https://orgmode.org/][Org Mode]]. Go to ~pages/org-mode.org~ to edit it.

** Here is a nested header with some Emacs Lisp source code.

This snippet comes from [[https://github.com/hlissner/doom-emacs/blob/master/core/core-editor.el][Doom Emacs]].

#+BEGIN_SRC elisp
(defun doom|check-large-file ()
  "Check if the buffer's file is large (see `doom-large-file-size'). If so, ask
for confirmation to open it literally (read-only, disabled undo and in
fundamental-mode) for performance sake."
  (let* ((filename (buffer-file-name))
         (size (nth 7 (file-attributes filename))))
    (when (and (not (memq major-mode doom-large-file-modes-list))
               size (> size (* 1024 1024 doom-large-file-size))
               (y-or-n-p
                (format (concat "%s is a large file, open literally to "
                                "avoid performance issues?")
                        (file-relative-name filename))))
      (setq buffer-read-only t)
      (buffer-disable-undo)
(fundamental-mode))))
#+END_SRC
