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