<commit_before>;; Time-stamp: <2015-06-19 10:06:05 kmodi>

;; Deft is an Emacs mode for quickly browsing, filtering, and editing
;; directories of plain text notes, inspired by Notational Velocity.
;; http://jblevins.org/projects/deft/

(use-package deft
  ;; :load-path "elisp/deft"
  :commands (modi/deft-dwim deft deft-new-file deft-find-file)
  :init
  (progn
    (bind-key "C-c d" #'modi/deft-dwim modi-mode-map)
    (bind-key "<f6>"  #'modi/deft-dwim modi-mode-map))
  :config
  (progn
    (setq deft-directory (concat org-directory "notes/"))
    (setq deft-extension "org")
    (setq deft-text-mode 'org-mode)
    (setq deft-use-filename-as-title nil) ; show actual titles in deft buf
    (setq deft-use-filter-string-for-filename t)
    (setq deft-auto-save-interval 0) ; default: 1.0; 0 to disable auto-save
    (setq deft-file-naming-rules '((nospace . "_")
                                   (case-fn . downcase)))

    ;; http://pragmaticemacs.com/emacs/tweaking-deft-quicker-notes/
    (defvar modi/pre-deft-window-configuration nil
      "Variable to store the window configuration before `deft' was called.")

    ;; Advise deft to save window config
    (defun modi/deft-dwim-save-windows (orig-fun &rest args)
      (setq modi/pre-deft-window-configuration (current-window-configuration))
      (apply orig-fun args))
    (advice-add 'deft :around #'modi/deft-dwim-save-windows)

    (defun modi/deft-quit ()
      "Save buffer, kill both the deft-opened file buffer and the *Deft* buffer,
and restore the window config to the way it was before deft was invoked."
      (interactive)
      (let ((buf (buffer-name)))
        (save-buffer)
        (kill-buffer buf)
        (delq buf deft-auto-save-buffers) ; Remove the buffer from `deft-auto-save-buffers'
        (kill-buffer "*Deft*")
        (when (window-configuration-p modi/pre-deft-window-configuration)
          (set-window-configuration modi/pre-deft-window-configuration)<commit_msg>Stop using deprecated deft variables<commit_after>;; Time-stamp: <2015-06-26 16:51:23 kmodi>

;; Deft is an Emacs mode for quickly browsing, filtering, and editing
;; directories of plain text notes, inspired by Notational Velocity.
;; http://jblevins.org/projects/deft/

(use-package deft
  :commands (modi/deft-dwim deft deft-new-file deft-find-file)
  :init
  (progn
    (bind-key "C-c d" #'modi/deft-dwim modi-mode-map)
    (bind-key "<f6>"  #'modi/deft-dwim modi-mode-map))
  :config
  (progn
    (setq deft-directory (concat org-directory "notes/"))
    (setq deft-extensions '("org"))
    (setq deft-use-filename-as-title nil) ; show actual titles in deft buf
    (setq deft-use-filter-string-for-filename t)
    (setq deft-auto-save-interval 0) ; default: 1.0; 0 to disable auto-save
    (setq deft-file-naming-rules '((nospace . "_")
                                   (case-fn . downcase)))

    ;; http://pragmaticemacs.com/emacs/tweaking-deft-quicker-notes/
    (defvar modi/pre-deft-window-configuration nil
      "Variable to store the window configuration before `deft' was called.")

    ;; Advise deft to save window config
    (defun modi/deft-dwim-save-windows (orig-fun &rest args)
      (setq modi/pre-deft-window-configuration (current-window-configuration))
      (apply orig-fun args))
    (advice-add 'deft :around #'modi/deft-dwim-save-windows)

    (defun modi/deft-quit ()
      "Save buffer, kill both the deft-opened file buffer and the *Deft* buffer,
and restore the window config to the way it was before deft was invoked."
      (interactive)
      (let ((buf (buffer-name)))
        (save-buffer)
        (kill-buffer buf)
        (delq buf deft-auto-save-buffers) ; Remove the buffer from `deft-auto-save-buffers'
        (kill-buffer "*Deft*")
        (when (window-configuration-p modi/pre-deft-window-configuration)
          (set-window-configuration modi/pre-deft-window-configuration)
{'fraction_non_alphanumeric': 0.13220164609053497, 'fraction_numerical': 0.00977366255144033, 'mean_word_length': 2.976482617586912, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3594467', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1331, 'n_words': 338}