Remove ambiguities and convert to specifics

This commit is contained in:
nik gaffney 2022-04-05 12:51:36 +10:00
parent 531957d735
commit 28b053198f
2 changed files with 12 additions and 12 deletions

View file

@ -23,9 +23,11 @@ To install on macOS
brew install style brew install style
#+END_SRC #+END_SRC
To install from source, download from http://ftp.gnu.org/gnu/diction/
** Configure ** Configure
The package can be installed from [[https://melpa.org/][MELPA]] or manually via [[https://github.com/zzkt/smog][github]]. The emacs package can be installed from [[https://melpa.org/][MELPA]] or manually via [[https://github.com/zzkt/smog][github]].
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package smog) (use-package smog)
@ -49,10 +51,9 @@ e.g. to analyse a text in German and show sentences longer than 23 words…
** Analyse surface detail ** Analyse surface detail
=M-x smog-check-buffer= and/or =M-x smog-check-region= =M-x smog-check=
** Further ** Further
- [[https://wiki.christophchamp.com/index.php?title=Style_and_Diction][style]] is written by Michael Haardt with contributions from Jason Petrone, Uschi Stegemeier and Hans Lodder - [[https://wiki.christophchamp.com/index.php?title=Style_and_Diction][style]] is written by Michael Haardt with contributions from Jason Petrone, Uschi Stegemeier and Hans Lodder
- [[https://files.eric.ed.gov/fulltext/ED506404.pdf][The Classic Readability Studies]]. William H.DuBay, Editor - [[https://files.eric.ed.gov/fulltext/ED506404.pdf][The Classic Readability Studies]]. William H.DuBay, Editor
- [[https://en.wikipedia.org/wiki/Asemic_writing][Asemic writing]] - [[https://en.wikipedia.org/wiki/Asemic_writing][Asemic writing]]

11
smog.el
View file

@ -36,7 +36,7 @@
;; Measure Of Gobbledygook“). It also summarises word usage and provides ;; Measure Of Gobbledygook“). It also summarises word usage and provides
;; information about sentence and paragraph structure. ;; information about sentence and paragraph structure.
;; ;;
;; M-x smog-check-buffer ;; M-x smog-check
;;; Code: ;;; Code:
@ -93,7 +93,7 @@ The <<<Lix>>> formula developed by Bjornsson from Sweden is very simple and empl
** SMOG-Grading ** SMOG-Grading
The <<<SMOG-Grading>>> for English texts has been developed by McLaughlin in 1969. Its result is aschool grade. The <<<SMOG-Grading>>> for English texts has been developed by McLaughlin in 1969. Its result is a school grade.
*SMOG-Grading* = square root of (((wds >= 3 syll)/sent)*30) + 3 *SMOG-Grading* = square root of (((wds >= 3 syll)/sent)*30) + 3
@ -132,12 +132,11 @@ Further details can be found in the =style(1)= man page.\n"
"Is the style command installed?" "Is the style command installed?"
(let ((program "style")) (let ((program "style"))
(unless (executable-find program) (unless (executable-find program)
(message "The program 'style' isn't installed or can't be found.")) (message "The program 'style' isn't installed or can't be found.\nTry installing the 'diction' package for your OS or download the source from http://ftp.gnu.org/gnu/diction/"))
(eq 0 (condition-case nil (eq 0 (condition-case nil
(call-process program) (call-process program)
(error (message "The program 'style' test run exit abnormally.")))))) (error (message "The program 'style' test run exit abnormally."))))))
;;;###autoload
(defun smog-check-buffer () (defun smog-check-buffer ()
"Analyse the surface characteristics of a buffer." "Analyse the surface characteristics of a buffer."
(interactive) (interactive)
@ -166,8 +165,8 @@ Further details can be found in the =style(1)= man page.\n"
(org-update-radio-target-regexp)))))) (org-update-radio-target-regexp))))))
;;;###autoload ;;;###autoload
(defun smog-check-region () (defun smog-check ()
"Analyse the surface characteristics of a selected region." "Analyse the readability and word use of a selected region or buffer."
(interactive) (interactive)
(when (smog--style-installed-p) (when (smog--style-installed-p)
(let* ((smog-buffer (current-buffer)) (let* ((smog-buffer (current-buffer))