X-Git-Url: https://iankelling.org/git/?p=iankelling.org;a=blobdiff_plain;f=iank-mod.el;h=b033cbc27f3d2efa009e7f7a0e262ad227bbf1a6;hp=26da79d7a68667b529f51fa7073f67a097a97069;hb=d0aafa5d6370307bdf0abe470be16f6a15f15162;hpb=d0a5b73d2a275bfff5957961f2360df8966bee22 diff --git a/iank-mod.el b/iank-mod.el index 26da79d..b033cbc 100644 --- a/iank-mod.el +++ b/iank-mod.el @@ -13,14 +13,24 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . -(defun iankmod-start () - (interactive) - (shell-command "/a/h/get-comments" "*messages*") - (find-file "/tmp/hcomments") - (iankmod 1)) + +;; generally, use m-x iankmod-start. c-u to run on local testing +;; instance. Alternatively, run get-comments with whatever args, +;; manually open /tmp/hcomments, then run (iankmod). + +(defun iankmod-start (arg) + (interactive "P") + (setq iankmod-last-arg (if (equal arg '(4)) " -l" "")) + (let ((cmd (concat "/a/h/get-comments" iankmod-last-arg))) + (shell-command cmd "*messages*") + (find-file "/tmp/hcomments") + (iankmod 1))) + (defun iankmod-save () (interactive) - (shell-command "/a/h/set-comments" "*messages*")) + (basic-save-buffer) + (let ((cmd (concat "/a/h/set-comments" iankmod-last-arg))) + (shell-command cmd "*messages*"))) (defun iankmod-set-state (state) @@ -38,6 +48,12 @@ (interactive) (iankmod-set-state "banned")) +;; for test comments, or comments we just want to delete from the +;; db for whatever reason. +(defun iankmod-delete () + (interactive) + (iankmod-set-state "delete")) + (defun iankmod-moderate () (interactive) (iankmod-set-state "moderated")) @@ -49,4 +65,5 @@ (define-key map (kbd "b") 'iankmod-ban) (define-key map (kbd "m") 'iankmod-moderate) (define-key map (kbd "x") 'iankmod-save) + (define-key map (kbd "d") 'iankmod-delete) map))