Hacker News new | past | comments | ask | show | jobs | submit login

Emacs is fantastic for Yak Shaving. You can spend hours or days tweaking and modifying its configuration files if you're not careful.

My advice for those seeking to get into Emacs: start from scratch. Learn how to split your custom.el from your init.el, and make sure you're using git to manage those files. Then start slowly and install org-mode from source and go from there:

   8   │ ;; Save customizations in a different file.  Prevents this file being
   9   │ ;; modified by Emacs.
  10   │ ;;; Code:
  11   │ (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
  12   │ (when (file-exists-p custom-file)
  13   │   (load custom-file))
  14   │ 
  15   │ ;; Before anything else, orgmode:
  16   │ (add-to-list 'load-path "~/.orgsrc/org-9.4/lisp")
  17   │ (require 'org-loaddefs)
  18   │ 
  19   │ ;; First off, we need MELPA and the org-mode repo:
  20   │ (require 'package)
  21   │ (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
  22   │ (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
  23   │ (package-initialize)



And some more snippets since I'm copying and pasting already. (I'm using "bat" to view files. Get it from https://github.com/sharkdp/bat )

  40   │ ;; Taken from https://karl-voit.at/2017/02/11/my-system-is-foobar/
  53   │ ;; Check if system is GNU/Linux
  54   │ (defun my-system-type-is-gnu ()
  55   │   "Return non-nil if system is GNU/Linux-based."
  56   │   (string-equal system-type "gnu/linux")
  57   │   )
  59   │ ;; make Linux a bit more mac-like
  60   │ (when (my-system-type-is-gnu)
  61   │   (global-set-key (kbd "s-/") 'comment-or-uncomment-region-or-line)
  62   │   (global-set-key (kbd "s-<backspace>") '(lambda () (interactive) (kill-line 0)))
  64   │   )


 362   │ (defun newer-than-7-days(file)
 363   │   "Return list of files newer than 7 days old in directory FILE."
 364   │   (> 7
 365   │     (/(float-time(time-subtract
 366   │                    (current-time)
 367   │                    (nth 5 (file-attributes file))))
 368   │       86400)))
 407   │   (setq org-agenda-files
 408   │     (seq-filter #'newer-than-7-days
 409   │       (directory-files-recursively "~/Org/Journal" "\\.org$")))
Yes, Emacs is an operating system that also edits text :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: