<commit_before>;; * Support for Bourne-Compatible Shells -*- lexical-binding: t; -*-
;; Authors:
;;	jgd = <NAME>

;; ** Dependencies - provide and require

(provide 'ngender-shell)
(require 'ngender)

;; ** Everything Else

(defun ngender-sh-mode-hook ()
  (setq-default sh-basic-offset 2)
  (setq-default sh-indentation 2)
	(setq orgstruct-heading-prefix-regexp "##* ")
	(orgstruct-mode)
	(ngender-pitch-mode)
)

(add-hook 'sh-mode-hook 'ngender-sh-mode-hook)

;; Put the current directory of a shell in the mode-line
(defconst ngender-short-dirpath-max 40)
(defun ngender-short-dirpath (&optional path)
	(let ( (d (replace-regexp-in-string "\\`/[^/]*/[^/]*" "~" (expand-file-name (or path ".")))) (last-d nil) )
		(while (or (> (length d) ngender-short-dirpath-max) (equal d last-d))
			(setq last-d d)
			(setq d (replace-regexp-in-string "\\`[~/.]*[^/]*/?" "..." d)) )
		(replace-regexp-in-string "/?\\'" "" d)	) )
(defun add-mode-line-dirtrack ()
	(add-to-list 'mode-line-buffer-identification
;		'(:propertize (" " (:eval (ngender-short-dirpath)) " ") face dired-directory)
		'(:propertize (:eval (ngender-short-dirpath)) face dired-directory)<commit_msg>now also setting shell-mode-hook<commit_after>;; * Support for Bourne-Compatible Shells -*- lexical-binding: t; -*-
;; Authors:
;;	jgd = <NAME>

;; ** Dependencies - provide and require

(provide 'ngender-shell)
(require 'ngender)

;; ** Everything Else

(defun ngender-sh-mode-hook ()
  (setq-default sh-basic-offset 2)
  (setq-default sh-indentation 2)
	(setq orgstruct-heading-prefix-regexp "##* ")
	(orgstruct-mode)
	(ngender-pitch-mode)
)

(add-hook 'sh-mode-hook 'ngender-sh-mode-hook) ; this doesn't do it for shell-mode
(add-hook 'shell-mode-hook 'ngender-sh-mode-hook) ; this does

;; Put the current directory of a shell in the mode-line
(defconst ngender-short-dirpath-max 40)
(defun ngender-short-dirpath (&optional path)
	(let ( (d (replace-regexp-in-string "\\`/[^/]*/[^/]*" "~" (expand-file-name (or path ".")))) (last-d nil) )
		(while (or (> (length d) ngender-short-dirpath-max) (equal d last-d))
			(setq last-d d)
			(setq d (replace-regexp-in-string "\\`[~/.]*[^/]*/?" "..." d)) )
		(replace-regexp-in-string "/?\\'" "" d)	) )
(defun add-mode-line-dirtrack ()
	(add-to-list 'mode-line-buffer-identification
;		'(:propertize (" " (:eval (ngender-short-dirpath)) " ") face dired-directory)
		'(:propertize (:eval (ngender-short-dirpath)) face dired-directory)
{'fraction_non_alphanumeric': 0.2091020910209102, 'fraction_numerical': 0.003280032800328003, 'mean_word_length': 3.88, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4003850', 'n_tokens_mistral': 977, 'n_tokens_neox': 922, 'n_words': 195}