Change ambiguities to specifics

This commit is contained in:
nik gaffney 2020-02-10 10:01:35 +11:00
parent b8260d0dd0
commit 732b09b4e1

37
smog.el
View file

@ -150,13 +150,18 @@ Further details can be found in the =style(1)= man page.\n"
;; output the results and add references (in org-mode if it's available)
(with-current-buffer smog-output
(goto-char (point-min))
(insert (format "\n*Style analysis* of the file \[\[%s\]\[%s\]\] \n\n"
smog-target smog-buffer))
(if (buffer-modified-p smog-buffer)
(insert (format
"\nChanges to the file '%s' have not been saved. Analysis may be inaccurate.\n\n"
smog-target))
(insert (format "\n*Style analysis* of the file \[\[%s\]\[%s\]\] \n\n"
smog-target smog-buffer)))
(goto-char (point-max))
(insert smog-reference)
(when (fboundp 'org-mode)
(progn (org-mode)
(org-update-radio-target-regexp)))))))
(org-mode))
(when (fboundp 'org-update-radio-target-regexp)
(org-update-radio-target-regexp))))))
;;;###autoload
(defun smog-check-region ()
@ -164,16 +169,16 @@ Further details can be found in the =style(1)= man page.\n"
(interactive)
(when (smog--style-installed-p)
(let* ((smog-buffer (current-buffer))
(smog-output (get-buffer-create "*Readability*"))
(region-p (use-region-p))
(smog-output (get-buffer-create "*Readability*"))
(region-p (use-region-p))
;; beginning of either buffer or region
(selection-start (if region-p
(region-beginning)
(point-min)))
;; end of either buffer or region
(selection-end (if region-p
(region-end)
(point-max))))
(selection-start (if region-p
(region-beginning)
(point-min)))
;; end of either buffer or region
(selection-end (if region-p
(region-end)
(point-max))))
;; run the shell command. synchronously.
(shell-command-on-region selection-start selection-end
(format "%s" smog-command) smog-output)
@ -185,9 +190,9 @@ Further details can be found in the =style(1)= man page.\n"
(goto-char (point-max))
(insert smog-reference)
(when (fboundp 'org-mode)
(progn (org-mode)
(org-update-radio-target-regexp)))))))
(org-mode))
(when (fboundp 'org-update-radio-target-regexp)
(org-update-radio-target-regexp))))))
(provide 'smog)