From: Andreas Gerler Date: Wed, 21 May 2025 11:47:42 +0000 (+0200) Subject: update artbollocks-mode X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=014034d8a5b78f0a796bb98a6c04372b47cfbf2e;p=emacsconfig.git update artbollocks-mode --- diff --git a/elpa/artbollocks-mode-20170524.422/artbollocks-mode-autoloads.el b/elpa/artbollocks-mode-20170524.422/artbollocks-mode-autoloads.el deleted file mode 100644 index c55305a9..00000000 --- a/elpa/artbollocks-mode-20170524.422/artbollocks-mode-autoloads.el +++ /dev/null @@ -1,28 +0,0 @@ -;;; artbollocks-mode-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - - -;;;### (autoloads nil "artbollocks-mode" "artbollocks-mode.el" (0 -;;;;;; 0 0 0)) -;;; Generated autoloads from artbollocks-mode.el - -(autoload 'artbollocks-mode "artbollocks-mode" "\ -Highlight passive voice, weasel words and artbollocks jargon in text, and provide useful text metrics - -\(fn &optional ARG)" t nil) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "artbollocks-mode" '("artbollocks-" "interactive-optional-region"))) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; artbollocks-mode-autoloads.el ends here diff --git a/elpa/artbollocks-mode-20170524.422/artbollocks-mode-pkg.el b/elpa/artbollocks-mode-20170524.422/artbollocks-mode-pkg.el deleted file mode 100644 index db595889..00000000 --- a/elpa/artbollocks-mode-20170524.422/artbollocks-mode-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "artbollocks-mode" "20170524.422" "Improve your writing (especially about art)" 'nil :commit "33a41ca4f8206f57e5498a526d3b0ea18d08bb93" :authors '(("Rob Myers , Sacha Chua" . "sacha@sachachua.com")) :maintainer '("Rob Myers , Sacha Chua" . "sacha@sachachua.com") :url "https://github.com/sachac/artbollocks-mode") diff --git a/elpa/artbollocks-mode-20170524.422/artbollocks-mode.el b/elpa/artbollocks-mode-20170524.422/artbollocks-mode.el deleted file mode 100644 index e3f64c71..00000000 --- a/elpa/artbollocks-mode-20170524.422/artbollocks-mode.el +++ /dev/null @@ -1,320 +0,0 @@ -;;; artbollocks-mode.el --- Improve your writing (especially about art) -;; -;; Copyright (c) 2011,2012 Rob Myers -;; Minor changes (c) 2012 Sacha Chua -;; -;; Author: Rob Myers , Sacha Chua -;; URL: https://github.com/sachac/artbollocks-mode -;; Package-Version: 20170524.422 -;; Version: 1.1.2 -;; -;; Based on fic-mode.el -;; Copyright (C) 2010, Trey Jackson -;; -;; Non-artbollocks words from: http://matt.might.net/articles/ -;; -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU Affero General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; at your option any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . -;; -;; 2012-06-16: Renamed functions and variables to avoid collisions. -;; Incompatible changes, so please review your configuration. - Sacha -;; Chua -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Extra thanks to: -;; Brian van den Broek (words: contextuality, dialetic, problematize) -;; Isabel Brison (words: alterity, mise en abîme) -;; mneilsen, behaghel, russell, xfq, gleb, ejmr, tarsius (Emacs Lisp improvements) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; Commentary: - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Usage -;; -;; To use, save artbollocks-mode.el to a directory in your load-path. -;; -;; (require 'artbollocks-mode) -;; (add-hook 'text-mode-hook 'artbollocks-mode) -;; -;; or -;; -;; M-x artbollocks-mode -;; -;; NOTE: If you manually turn on artbollocks-mode, -;; you you might need to force re-fontification initially: -;; -;; M-x font-lock-fontify-buffer -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; Code: - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Customization -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; Enable features individually - -(defcustom artbollocks-lexical-illusions t - "Whether to check for lexical illusions" - :type '(boolean) - :group 'artbollocks-mode) - -(defcustom artbollocks-passive-voice t - "Whether to check for passive voice" - :type '(boolean) - :group 'artbollocks-mode) - -(defcustom artbollocks-weasel-words t - "Whether to check for weasel words" - :type '(boolean) - :group 'artbollocks-mode) - -(defcustom artbollocks-jargon t - "Whether to check for artbollocks jargon" - :type '(boolean) - :group 'artbollocks-mode) - -(defface artbollocks-lexical-illusions-face - '((t (:foreground "black" :background "magenta"))) - "The face for lexical illusions words" - :group 'artbollocks-mode) - -(defface artbollocks-passive-voice-face - '((t (:foreground "Gray" :background "White"))) - "The face for passive voice words" - :group 'artbollocks-mode) - -(defface artbollocks-weasel-words-face - '((t (:foreground "Brown" :background "White"))) - "The face for weasel-words words" - :group 'artbollocks-mode) - -(defface artbollocks-face - '((t (:foreground "Purple" :background "White"))) - "The face for jargon words" - :group 'artbollocks-mode) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Lexical illusions -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defconst artbollocks-lexical-illusions-regex "\\b\\(\\w+\\)\\W+\\(\\1\\)\\b") - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Passive voice -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defconst artbollocks-passive-voice-regex "\\b\\(am\\|are\\|were\\|being\\|is\\|been\\|was\\|be\\)\\s-+\\(\\w+ed\\|awoken\\|been\\|born\\|beat\\|become\\|begun\\|bent\\|beset\\|bet\\|bid\\|bidden\\|bound\\|bitten\\|bled\\|blown\\|broken\\|bred\\|brought\\|broadcast\\|built\\|burnt\\|burst\\|bought\\|cast\\|caught\\|chosen\\|clung\\|come\\|cost\\|crept\\|cut\\|dealt\\|dug\\|dived\\|done\\|drawn\\|dreamt\\|driven\\|drunk\\|eaten\\|fallen\\|fed\\|felt\\|fought\\|found\\|fit\\|fled\\|flung\\|flown\\|forbidden\\|forgotten\\|foregone\\|forgiven\\|forsaken\\|frozen\\|gotten\\|given\\|gone\\|ground\\|grown\\|hung\\|heard\\|hidden\\|hit\\|held\\|hurt\\|kept\\|knelt\\|knit\\|known\\|laid\\|led\\|leapt\\|learnt\\|left\\|lent\\|let\\|lain\\|lighted\\|lost\\|made\\|meant\\|met\\|misspelt\\|mistaken\\|mown\\|overcome\\|overdone\\|overtaken\\|overthrown\\|paid\\|pled\\|proven\\|put\\|quit\\|read\\|rid\\|ridden\\|rung\\|risen\\|run\\|sawn\\|said\\|seen\\|sought\\|sold\\|sent\\|set\\|sewn\\|shaken\\|shaven\\|shorn\\|shed\\|shone\\|shod\\|shot\\|shown\\|shrunk\\|shut\\|sung\\|sunk\\|sat\\|slept\\|slain\\|slid\\|slung\\|slit\\|smitten\\|sown\\|spoken\\|sped\\|spent\\|spilt\\|spun\\|spit\\|split\\|spread\\|sprung\\|stood\\|stolen\\|stuck\\|stung\\|stunk\\|stridden\\|struck\\|strung\\|striven\\|sworn\\|swept\\|swollen\\|swum\\|swung\\|taken\\|taught\\|torn\\|told\\|thought\\|thrived\\|thrown\\|thrust\\|trodden\\|understood\\|upheld\\|upset\\|woken\\|worn\\|woven\\|wed\\|wept\\|wound\\|won\\|withheld\\|withstood\\|wrung\\|written\\)\\b") - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Weasel words -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defconst artbollocks-weasel-words-regex "\\b\\(many\\|various\\|very\\|fairly\\|several\\|extremely\\|exceedingly\\|quite\\|remarkably\\|few\\|surprisingly\\|mostly\\|largely\\|huge\\|tiny\\|\\(\\(are\\|is\\) a number\\)\\|excellent\\|interestingly\\|significantly\\|substantially\\|clearly\\|vast\\|relatively\\|completely\\)\\b") - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Artbollocks -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defconst artbollocks-jargon-regex "\\b\\(a priori\\|ad hoc\\|affirmation\\|affirm\\|affirms\\|alterity\\|altermodern\\|aporia\\|aporetic\\|appropriates\\|appropriation\\|archetypal\\|archetypical\\|archetype\\|archetypes\\|autonomous\\|autonomy\\|baudrillardian\\|baudrillarian\\|commodification\\|committed\\|commitment\\|commonalities\\|contemporaneity\\|context\\|contexts\\|contextual\\|contextualise\\|contextualises\\|contextualisation\\|contextialize\\|contextializes\\|contextualization\\|contextuality\\|convention\\|conventional\\|conventions\\|coterminous\\|critique\\|cunning\\|cunningly\\|death of the author\\|debunk\\|debunked\\|debunking\\|debunks\\|deconstruct\\|deconstruction\\|deconstructs\\|deleuzian\\|desire\\|desires\\|dialectic\\|dialectical\\|dialectically\\|discourse\\|discursive\\|disrupt\\|disrupts\\|engage\\|engagement\\|engages\\|episteme\\|epistemic\\|ergo\\|fetish\\|fetishes\\|fetishise\\|fetishised\\|fetishize\\|fetishized\\|gaze\\|gender\\|gendered\\|historicise\\|historicisation\\|historicize\\|historicization\\|hegemonic\\|hegemony\\|identity\\|identity politics\\|intensifies\\|intensify\\|intensifying\\|interrogate\\|interrogates\\|interrogation\\|intertextual\\|intertextuality\\|irony\\|ironic\\|ironical\\|ironically\\|ironisation\\|ironization\\|ironises\\|ironizes\\|jouissance\\|juxtapose\\|juxtaposes\\|juxtaposition\\|lacanian\\|lack\\|loci\\|locus\\|locuses\\|matrix\\|mise en abyme\\|mocking\\|mockingly\\|modalities\\|modality\\|myth\\|mythologies\\|mythology\\|myths\\|narrative\\|narrativisation\\|narrativization\\|narrativity\\|nexus\\|nodal\\|node\\|normative\\|normativity\\|notion\\|notions\\|objective\\|objectivity\\|objectivities\\|objet petit a\\|ontology\\|ontological\\|operate\\|operates\\|otherness\\|othering\\|paradigm\\|paradigmatic\\|paradigms\\|parody\\|parodic\\|parodies\\|physicality\\|plenitude\\|poetics\\|popular notions\\|position\\|post hoc\\|post internet\\|post-internet\\|postmodernism\\|postmodernist\\|postmodernity\\|postmodern\\|practice\\|practise\\|praxis\\|problematic\\|problematics\\|problematise\\|problematize\\|proposition\\|qua\\|reading\\|readings\\|reification\\|relation\\|relational\\|relationality\\|relations\\|representation\\|representations\\|rhizomatic\\|rhizome\\|simulacra\\|simulacral\\|simulation\\|simulationism\\|simulationism\\|situate\\|situated\\|situates\\|stereotype\\|stereotypes\\|strategy\\|strategies\\|subjective\\|subjectivity\\|subjectivities\\|subvert\\|subversion\\|subverts\\|text\\|textual\\|textuality\\|thinker\\|thinkers\\|trajectory\\|transgress\\|transgresses\\|transgression\\|transgressive\\|unfolding\\|undermine\\|undermining\\|undermines\\|work\\|works\\|wry\\|wryly\\|zizekian\\|zižekian\\)\\b") - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Highlighting -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defun artbollocks-search-for-keyword (regex limit) - "Match REGEX in buffer until LIMIT. -Search is case-insensitive." - (let (match-data-to-set - found - (case-fold-search t)) - (save-match-data - (while (and (null match-data-to-set) - (re-search-forward regex limit t)) - (setq match-data-to-set (match-data)))) - (when match-data-to-set - (set-match-data match-data-to-set) - (goto-char (match-end 0)) - t))) - -(defun artbollocks-lexical-illusions-search-for-keyword (limit) - (artbollocks-search-for-keyword artbollocks-lexical-illusions-regex limit)) - -(defun artbollocks-passive-voice-search-for-keyword (limit) - (artbollocks-search-for-keyword artbollocks-passive-voice-regex limit)) - -(defun artbollocks-weasel-words-search-for-keyword (limit) - (artbollocks-search-for-keyword artbollocks-weasel-words-regex limit)) - -(defun artbollocks-search-for-jargon (limit) - (artbollocks-search-for-keyword artbollocks-jargon-regex limit)) - -(defconst artbollocks-lexicalkwlist - '((artbollocks-lexical-illusions-search-for-keyword - (2 'artbollocks-lexical-illusions-face t)))) - -(defconst artbollocks-passivekwlist - '((artbollocks-passive-voice-search-for-keyword - (0 'artbollocks-passive-voice-face t)))) - -(defconst artbollocks-weaselkwlist - '((artbollocks-weasel-words-search-for-keyword - (0 'artbollocks-weasel-words-face t)))) - -(defconst artbollocks-kwlist - '((artbollocks-search-for-jargon - (0 'artbollocks-face t)))) - -(defun artbollocks-add-keywords () - (when artbollocks-lexical-illusions - (font-lock-add-keywords nil artbollocks-lexicalkwlist)) - (when artbollocks-passive-voice - (font-lock-add-keywords nil artbollocks-passivekwlist)) - (when artbollocks-weasel-words - (font-lock-add-keywords nil artbollocks-weaselkwlist)) - (when artbollocks-jargon - (font-lock-add-keywords nil artbollocks-kwlist))) - -(defun artbollocks-remove-keywords () - (font-lock-remove-keywords nil artbollocks-lexicalkwlist) - (font-lock-remove-keywords nil artbollocks-passivekwlist) - (font-lock-remove-keywords nil artbollocks-weaselkwlist) - (font-lock-remove-keywords nil artbollocks-kwlist)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Utility macros -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defmacro interactive-optional-region () - "Flexible variation of (interactive \"r\"). -Bind START and END parameters to either a selected region or the -entire buffer, subject to narrowing." - `(interactive - (if (use-region-p) - (list (region-beginning) (region-end)) - (list (point-min) (point-max))))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Text metrics -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defun artbollocks-count-letters (&optional start end) - (how-many "\\w" (or start (point-min)) (or end (point-max)))) - -(defun artbollocks-count-syllables (&optional start end) - ;; Naively count vowel runs as syllable markers - (how-many "[aeiouy]+" (or start (point-min)) (or end (point-max)))) - -(defun artbollocks-count-words (&optional start end) - "Count the number of words between START and END." - (interactive-optional-region) - (let* ((s (or start (point-min))) - (e (or end (point-max))) - (result - (if (fboundp 'count-words) - (count-words s e) - (how-many "\\w+" s e)))) - (if (called-interactively-p 'any) - (message "Word count: %s" result)) - result)) - -(defun artbollocks-count-sentences (&optional start end) - "Count the number of words between START and END." - (interactive-optional-region) - (let* ((s (or start (point-min))) - (e (or end (point-max))) - (result - (how-many "\\w[!?.]" s e))) - (if (called-interactively-p 'any) - (message "Sentence count: %s" result)) - result)) - -(defun artbollocks-automated-readability-index (&optional start end) - (let ((words (float (artbollocks-count-words start end))) - (letters (float (artbollocks-count-letters start end))) - (sentences (float (artbollocks-count-sentences start end)))) - (if (and (> words 0) (> sentences 0)) - (- (+ (* 4.71 (/ letters words)) - (* 0.5 (/ words sentences))) - 21.43) - 0.0))) - -(defun artbollocks-flesch-reading-ease (&optional start end) - (let ((words (float (artbollocks-count-words start end))) - (sentences (float (artbollocks-count-sentences start end))) - (syllables (float (artbollocks-count-syllables start end)))) - (if (and (> sentences 0) (> words 0)) - (- 206.834 - (* 1.015 (/ words sentences)) - (* 84.6 (/ syllables words))) - 0.0))) - -(defun artbollocks-flesch-kinkaid-grade-level (&optional start end) - (let ((words (float (artbollocks-count-words start end))) - (sentences (float (artbollocks-count-sentences start end))) - (syllables (float (artbollocks-count-syllables start end)))) - (if (and (> words 0) (> sentences 0)) - (- (+ (* 11.8 (/ syllables words)) - (* 0.39 (/ words sentences))) - 15.59) - 0.0))) - -(defalias 'artbollocks-word-count 'artbollocks-count-words) -(defalias 'artbollocks-sentence-count 'artbollocks-count-sentences) - -(defun artbollocks-readability-index (&optional start end) - "Determine the automated readability index between START and END." - (interactive-optional-region) - (message "Readability index: %s" (artbollocks-automated-readability-index start end))) - -(defun artbollocks-reading-ease (&optional start end) - "Determine the Flesch reading ease between START and END." - (interactive-optional-region) - (message "Reading ease: %s" (artbollocks-flesch-reading-ease start end))) - -(defun artbollocks-grade-level (&optional start end) - "Determine the Flesch-Kinkaid grade level between START and END." - (interactive-optional-region) - (message "Grade level: %s" (artbollocks-flesch-kinkaid-grade-level start end))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; The mode -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defconst artbollocks-mode-keymap (make-keymap)) - -(define-key artbollocks-mode-keymap (kbd "C-c [") 'artbollocks-word-count) -(define-key artbollocks-mode-keymap (kbd "C-c ]") 'artbollocks-sentence-count) -(define-key artbollocks-mode-keymap (kbd "C-c \\") 'artbollocks-readability-index) -(define-key artbollocks-mode-keymap (kbd "C-c /") 'artbollocks-reading-ease) -(define-key artbollocks-mode-keymap (kbd "C-c =") 'artbollocks-grade-level) - -;;;###autoload -(define-minor-mode artbollocks-mode "Highlight passive voice, weasel words and artbollocks jargon in text, and provide useful text metrics" - :lighter " AB" - :keymap artbollocks-mode-keymap - :group 'artbollocks-mode - (if artbollocks-mode - (artbollocks-add-keywords) - (artbollocks-remove-keywords))) - -(provide 'artbollocks-mode) - -;; TODO -;; Toggle adding word/sentence count to status bar -;; Pluralization -;; Incorporate diction commands if available (and advise on installation if not) -;; Split general writing back out - -;;; artbollocks-mode.el ends here diff --git a/elpa/artbollocks-mode-20250327.1744/artbollocks-mode-autoloads.el b/elpa/artbollocks-mode-20250327.1744/artbollocks-mode-autoloads.el new file mode 100644 index 00000000..b9d77cea --- /dev/null +++ b/elpa/artbollocks-mode-20250327.1744/artbollocks-mode-autoloads.el @@ -0,0 +1,48 @@ +;;; artbollocks-mode-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + +;;; Code: + +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + + + +;;; Generated autoloads from artbollocks-mode.el + +(autoload 'artbollocks-mode "artbollocks-mode" "\ +Highlight passive voice, weasel words and artbollocks jargon in text, and provide useful text metrics + +This is a minor mode. If called interactively, toggle the `Artbollocks +mode' mode. If the prefix argument is positive, enable the mode, and if +it is zero or negative, disable the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the +mode if ARG is nil, omitted, or is a positive number. Disable the mode +if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate the variable `artbollocks-mode'. + +The mode's hook is called both when the mode is enabled and when it is +disabled. + +\\{artbollocks-mode-keymap} + +(fn &optional ARG)" t) +(register-definition-prefixes "artbollocks-mode" '("artbollocks-" "interactive-optional-region")) + +;;; End of scraped data + +(provide 'artbollocks-mode-autoloads) + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; no-native-compile: t +;; coding: utf-8-emacs-unix +;; End: + +;;; artbollocks-mode-autoloads.el ends here diff --git a/elpa/artbollocks-mode-20250327.1744/artbollocks-mode-pkg.el b/elpa/artbollocks-mode-20250327.1744/artbollocks-mode-pkg.el new file mode 100644 index 00000000..b786eed4 --- /dev/null +++ b/elpa/artbollocks-mode-20250327.1744/artbollocks-mode-pkg.el @@ -0,0 +1,11 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "artbollocks-mode" "20250327.1744" + "Improve your writing (especially about art)." + () + :url "https://github.com/sachac/artbollocks-mode" + :commit "1ef30f2cabaa2054e77d66eb7999381dde26eb18" + :revdesc "1ef30f2cabaa" + :authors '(("Rob Myers" . "rob@robmyers.org") + ("Sacha Chua" . "sacha@sachachua.com")) + :maintainers '(("Rob Myers" . "rob@robmyers.org") + ("Sacha Chua" . "sacha@sachachua.com"))) diff --git a/elpa/artbollocks-mode-20250327.1744/artbollocks-mode.el b/elpa/artbollocks-mode-20250327.1744/artbollocks-mode.el new file mode 100644 index 00000000..08f57457 --- /dev/null +++ b/elpa/artbollocks-mode-20250327.1744/artbollocks-mode.el @@ -0,0 +1,321 @@ +;;; artbollocks-mode.el --- Improve your writing (especially about art) +;; +;; Copyright (c) 2011,2012 Rob Myers +;; Minor changes (c) 2012 Sacha Chua +;; +;; Author: Rob Myers , Sacha Chua +;; URL: https://github.com/sachac/artbollocks-mode +;; Package-Version: 20250327.1744 +;; Package-Revision: 1ef30f2cabaa +;; +;; Based on fic-mode.el +;; Copyright (C) 2010, Trey Jackson +;; +;; Non-artbollocks words from: http://matt.might.net/articles/ +;; +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU Affero General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; at your option any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . +;; +;; 2012-06-16: Renamed functions and variables to avoid collisions. +;; Incompatible changes, so please review your configuration. - Sacha +;; Chua +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Extra thanks to: +;; Brian van den Broek (words: contextuality, dialetic, problematize) +;; Isabel Brison (words: alterity, mise en abîme) +;; mneilsen, behaghel, russell, xfq, gleb, ejmr, tarsius (Emacs Lisp improvements) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Commentary: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Usage +;; +;; To use, save artbollocks-mode.el to a directory in your load-path. +;; +;; (require 'artbollocks-mode) +;; (add-hook 'text-mode-hook 'artbollocks-mode) +;; +;; or +;; +;; M-x artbollocks-mode +;; +;; NOTE: If you manually turn on artbollocks-mode, +;; you you might need to force re-fontification initially: +;; +;; M-x font-lock-fontify-buffer +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Code: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Customization +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Enable features individually + +(defcustom artbollocks-lexical-illusions t + "Whether to check for lexical illusions" + :type '(boolean) + :group 'artbollocks-mode) + +(defcustom artbollocks-passive-voice t + "Whether to check for passive voice" + :type '(boolean) + :group 'artbollocks-mode) + +(defcustom artbollocks-weasel-words t + "Whether to check for weasel words" + :type '(boolean) + :group 'artbollocks-mode) + +(defcustom artbollocks-jargon t + "Whether to check for artbollocks jargon" + :type '(boolean) + :group 'artbollocks-mode) + +(defface artbollocks-lexical-illusions-face + '((t (:foreground "black" :background "magenta"))) + "The face for lexical illusions words" + :group 'artbollocks-mode) + +(defface artbollocks-passive-voice-face + '((t (:foreground "Gray" :background "White"))) + "The face for passive voice words" + :group 'artbollocks-mode) + +(defface artbollocks-weasel-words-face + '((t (:foreground "Brown" :background "White"))) + "The face for weasel-words words" + :group 'artbollocks-mode) + +(defface artbollocks-face + '((t (:foreground "Purple" :background "White"))) + "The face for jargon words" + :group 'artbollocks-mode) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Lexical illusions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defconst artbollocks-lexical-illusions-regex "\\b\\(\\w+\\)\\W+\\(\\1\\)\\b") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Passive voice +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defconst artbollocks-passive-voice-regex "\\b\\(am\\|are\\|were\\|being\\|is\\|been\\|was\\|be\\)\\s-+\\(\\w+ed\\|awoken\\|been\\|born\\|beat\\|become\\|begun\\|bent\\|beset\\|bet\\|bid\\|bidden\\|bound\\|bitten\\|bled\\|blown\\|broken\\|bred\\|brought\\|broadcast\\|built\\|burnt\\|burst\\|bought\\|cast\\|caught\\|chosen\\|clung\\|come\\|cost\\|crept\\|cut\\|dealt\\|dug\\|dived\\|done\\|drawn\\|dreamt\\|driven\\|drunk\\|eaten\\|fallen\\|fed\\|felt\\|fought\\|found\\|fit\\|fled\\|flung\\|flown\\|forbidden\\|forgotten\\|foregone\\|forgiven\\|forsaken\\|frozen\\|gotten\\|given\\|gone\\|ground\\|grown\\|hung\\|heard\\|hidden\\|hit\\|held\\|hurt\\|kept\\|knelt\\|knit\\|known\\|laid\\|led\\|leapt\\|learnt\\|left\\|lent\\|let\\|lain\\|lighted\\|lost\\|made\\|meant\\|met\\|misspelt\\|mistaken\\|mown\\|overcome\\|overdone\\|overtaken\\|overthrown\\|paid\\|pled\\|proven\\|put\\|quit\\|read\\|rid\\|ridden\\|rung\\|risen\\|run\\|sawn\\|said\\|seen\\|sought\\|sold\\|sent\\|set\\|sewn\\|shaken\\|shaven\\|shorn\\|shed\\|shone\\|shod\\|shot\\|shown\\|shrunk\\|shut\\|sung\\|sunk\\|sat\\|slept\\|slain\\|slid\\|slung\\|slit\\|smitten\\|sown\\|spoken\\|sped\\|spent\\|spilt\\|spun\\|spit\\|split\\|spread\\|sprung\\|stood\\|stolen\\|stuck\\|stung\\|stunk\\|stridden\\|struck\\|strung\\|striven\\|sworn\\|swept\\|swollen\\|swum\\|swung\\|taken\\|taught\\|torn\\|told\\|thought\\|thrived\\|thrown\\|thrust\\|trodden\\|understood\\|upheld\\|upset\\|woken\\|worn\\|woven\\|wed\\|wept\\|wound\\|won\\|withheld\\|withstood\\|wrung\\|written\\)\\b") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Weasel words +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defconst artbollocks-weasel-words-regex "\\b\\(many\\|various\\|very\\|fairly\\|several\\|extremely\\|exceedingly\\|quite\\|remarkably\\|few\\|surprisingly\\|mostly\\|largely\\|huge\\|tiny\\|\\(\\(are\\|is\\) a number\\)\\|excellent\\|interestingly\\|significantly\\|substantially\\|clearly\\|vast\\|relatively\\|completely\\)\\b") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Artbollocks +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defconst artbollocks-jargon-regex "\\b\\(a priori\\|ad hoc\\|affirmation\\|affirm\\|affirms\\|alterity\\|altermodern\\|aporia\\|aporetic\\|appropriates\\|appropriation\\|archetypal\\|archetypical\\|archetype\\|archetypes\\|autonomous\\|autonomy\\|baudrillardian\\|baudrillarian\\|commodification\\|committed\\|commitment\\|commonalities\\|contemporaneity\\|context\\|contexts\\|contextual\\|contextualise\\|contextualises\\|contextualisation\\|contextialize\\|contextializes\\|contextualization\\|contextuality\\|convention\\|conventional\\|conventions\\|coterminous\\|critique\\|cunning\\|cunningly\\|death of the author\\|debunk\\|debunked\\|debunking\\|debunks\\|deconstruct\\|deconstruction\\|deconstructs\\|deleuzian\\|desire\\|desires\\|dialectic\\|dialectical\\|dialectically\\|discourse\\|discursive\\|disrupt\\|disrupts\\|engage\\|engagement\\|engages\\|episteme\\|epistemic\\|ergo\\|fetish\\|fetishes\\|fetishise\\|fetishised\\|fetishize\\|fetishized\\|gaze\\|gender\\|gendered\\|historicise\\|historicisation\\|historicize\\|historicization\\|hegemonic\\|hegemony\\|identity\\|identity politics\\|intensifies\\|intensify\\|intensifying\\|interrogate\\|interrogates\\|interrogation\\|intertextual\\|intertextuality\\|irony\\|ironic\\|ironical\\|ironically\\|ironisation\\|ironization\\|ironises\\|ironizes\\|jouissance\\|juxtapose\\|juxtaposes\\|juxtaposition\\|lacanian\\|lack\\|loci\\|locus\\|locuses\\|matrix\\|mise en abyme\\|mocking\\|mockingly\\|modalities\\|modality\\|myth\\|mythologies\\|mythology\\|myths\\|narrative\\|narrativisation\\|narrativization\\|narrativity\\|nexus\\|nodal\\|node\\|normative\\|normativity\\|notion\\|notions\\|objective\\|objectivity\\|objectivities\\|objet petit a\\|ontology\\|ontological\\|operate\\|operates\\|otherness\\|othering\\|paradigm\\|paradigmatic\\|paradigms\\|parody\\|parodic\\|parodies\\|physicality\\|plenitude\\|poetics\\|popular notions\\|position\\|post hoc\\|post internet\\|post-internet\\|postmodernism\\|postmodernist\\|postmodernity\\|postmodern\\|practice\\|practise\\|praxis\\|problematic\\|problematics\\|problematise\\|problematize\\|proposition\\|qua\\|reading\\|readings\\|reification\\|relation\\|relational\\|relationality\\|relations\\|representation\\|representations\\|rhizomatic\\|rhizome\\|simulacra\\|simulacral\\|simulation\\|simulationism\\|simulationism\\|situate\\|situated\\|situates\\|stereotype\\|stereotypes\\|strategy\\|strategies\\|subjective\\|subjectivity\\|subjectivities\\|subvert\\|subversion\\|subverts\\|text\\|textual\\|textuality\\|thinker\\|thinkers\\|trajectory\\|transgress\\|transgresses\\|transgression\\|transgressive\\|unfolding\\|undermine\\|undermining\\|undermines\\|work\\|works\\|wry\\|wryly\\|zizekian\\|zižekian\\)\\b") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Highlighting +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun artbollocks-search-for-keyword (regex limit) + "Match REGEX in buffer until LIMIT. +Search is case-insensitive." + (let (match-data-to-set + found + (case-fold-search t)) + (save-match-data + (while (and (null match-data-to-set) + (re-search-forward regex limit t)) + (setq match-data-to-set (match-data)))) + (when match-data-to-set + (set-match-data match-data-to-set) + (goto-char (match-end 0)) + t))) + +(defun artbollocks-lexical-illusions-search-for-keyword (limit) + (artbollocks-search-for-keyword artbollocks-lexical-illusions-regex limit)) + +(defun artbollocks-passive-voice-search-for-keyword (limit) + (artbollocks-search-for-keyword artbollocks-passive-voice-regex limit)) + +(defun artbollocks-weasel-words-search-for-keyword (limit) + (artbollocks-search-for-keyword artbollocks-weasel-words-regex limit)) + +(defun artbollocks-search-for-jargon (limit) + (artbollocks-search-for-keyword artbollocks-jargon-regex limit)) + +(defconst artbollocks-lexicalkwlist + '((artbollocks-lexical-illusions-search-for-keyword + (2 'artbollocks-lexical-illusions-face t)))) + +(defconst artbollocks-passivekwlist + '((artbollocks-passive-voice-search-for-keyword + (0 'artbollocks-passive-voice-face t)))) + +(defconst artbollocks-weaselkwlist + '((artbollocks-weasel-words-search-for-keyword + (0 'artbollocks-weasel-words-face t)))) + +(defconst artbollocks-kwlist + '((artbollocks-search-for-jargon + (0 'artbollocks-face t)))) + +(defun artbollocks-add-keywords () + (when artbollocks-lexical-illusions + (font-lock-add-keywords nil artbollocks-lexicalkwlist)) + (when artbollocks-passive-voice + (font-lock-add-keywords nil artbollocks-passivekwlist)) + (when artbollocks-weasel-words + (font-lock-add-keywords nil artbollocks-weaselkwlist)) + (when artbollocks-jargon + (font-lock-add-keywords nil artbollocks-kwlist))) + +(defun artbollocks-remove-keywords () + (font-lock-remove-keywords nil artbollocks-lexicalkwlist) + (font-lock-remove-keywords nil artbollocks-passivekwlist) + (font-lock-remove-keywords nil artbollocks-weaselkwlist) + (font-lock-remove-keywords nil artbollocks-kwlist)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Utility macros +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defmacro interactive-optional-region () + "Flexible variation of (interactive \"r\"). +Bind START and END parameters to either a selected region or the +entire buffer, subject to narrowing." + `(interactive + (if (use-region-p) + (list (region-beginning) (region-end)) + (list (point-min) (point-max))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Text metrics +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun artbollocks-count-letters (&optional start end) + (how-many "\\w" (or start (point-min)) (or end (point-max)))) + +(defun artbollocks-count-syllables (&optional start end) + ;; Naively count vowel runs as syllable markers + (how-many "[aeiouy]+" (or start (point-min)) (or end (point-max)))) + +(defun artbollocks-count-words (&optional start end) + "Count the number of words between START and END." + (interactive-optional-region) + (let* ((s (or start (point-min))) + (e (or end (point-max))) + (result + (if (fboundp 'count-words) + (count-words s e) + (how-many "\\w+" s e)))) + (if (called-interactively-p 'any) + (message "Word count: %s" result)) + result)) + +(defun artbollocks-count-sentences (&optional start end) + "Count the number of words between START and END." + (interactive-optional-region) + (let* ((s (or start (point-min))) + (e (or end (point-max))) + (result + (how-many "\\w[!?.]" s e))) + (if (called-interactively-p 'any) + (message "Sentence count: %s" result)) + result)) + +(defun artbollocks-automated-readability-index (&optional start end) + (let ((words (float (artbollocks-count-words start end))) + (letters (float (artbollocks-count-letters start end))) + (sentences (float (artbollocks-count-sentences start end)))) + (if (and (> words 0) (> sentences 0)) + (- (+ (* 4.71 (/ letters words)) + (* 0.5 (/ words sentences))) + 21.43) + 0.0))) + +(defun artbollocks-flesch-reading-ease (&optional start end) + (let ((words (float (artbollocks-count-words start end))) + (sentences (float (artbollocks-count-sentences start end))) + (syllables (float (artbollocks-count-syllables start end)))) + (if (and (> sentences 0) (> words 0)) + (- 206.834 + (* 1.015 (/ words sentences)) + (* 84.6 (/ syllables words))) + 0.0))) + +(defun artbollocks-flesch-kinkaid-grade-level (&optional start end) + (let ((words (float (artbollocks-count-words start end))) + (sentences (float (artbollocks-count-sentences start end))) + (syllables (float (artbollocks-count-syllables start end)))) + (if (and (> words 0) (> sentences 0)) + (- (+ (* 11.8 (/ syllables words)) + (* 0.39 (/ words sentences))) + 15.59) + 0.0))) + +(defalias 'artbollocks-word-count 'artbollocks-count-words) +(defalias 'artbollocks-sentence-count 'artbollocks-count-sentences) + +(defun artbollocks-readability-index (&optional start end) + "Determine the automated readability index between START and END." + (interactive-optional-region) + (message "Readability index: %s" (artbollocks-automated-readability-index start end))) + +(defun artbollocks-reading-ease (&optional start end) + "Determine the Flesch reading ease between START and END." + (interactive-optional-region) + (message "Reading ease: %s" (artbollocks-flesch-reading-ease start end))) + +(defun artbollocks-grade-level (&optional start end) + "Determine the Flesch-Kinkaid grade level between START and END." + (interactive-optional-region) + (message "Grade level: %s" (artbollocks-flesch-kinkaid-grade-level start end))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; The mode +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defconst artbollocks-mode-keymap (make-keymap)) + +(define-key artbollocks-mode-keymap (kbd "C-c [") 'artbollocks-word-count) +(define-key artbollocks-mode-keymap (kbd "C-c ]") 'artbollocks-sentence-count) +(define-key artbollocks-mode-keymap (kbd "C-c \\") 'artbollocks-readability-index) +(define-key artbollocks-mode-keymap (kbd "C-c /") 'artbollocks-reading-ease) +(define-key artbollocks-mode-keymap (kbd "C-c =") 'artbollocks-grade-level) + +;;;###autoload +(define-minor-mode artbollocks-mode "Highlight passive voice, weasel words and artbollocks jargon in text, and provide useful text metrics" + :lighter " AB" + :keymap artbollocks-mode-keymap + :group 'artbollocks-mode + (if artbollocks-mode + (artbollocks-add-keywords) + (artbollocks-remove-keywords)) + (font-lock-flush)) + +(provide 'artbollocks-mode) + +;; TODO +;; Toggle adding word/sentence count to status bar +;; Pluralization +;; Incorporate diction commands if available (and advise on installation if not) +;; Split general writing back out + +;;; artbollocks-mode.el ends here diff --git a/elpa/artbollocks-mode-readme.txt b/elpa/artbollocks-mode-readme.txt deleted file mode 100644 index 517ae2bc..00000000 --- a/elpa/artbollocks-mode-readme.txt +++ /dev/null @@ -1,15 +0,0 @@ -Usage - -To use, save artbollocks-mode.el to a directory in your load-path. - -(require 'artbollocks-mode) -(add-hook 'text-mode-hook 'artbollocks-mode) - -or - -M-x artbollocks-mode - -NOTE: If you manually turn on artbollocks-mode, -you you might need to force re-fontification initially: - - M-x font-lock-fontify-buffer