(defun perl-journal-post-entry (&optional uid &optional passwd &optional comment &optional subject) "Post the contents of the the current region as a use.perl.org journal entry." (interactive) (make-local-variable 'perl-journal-uid) (make-local-variable 'perl-journal-passwd) (make-local-variable 'perl-journal-command) (make-local-variable 'passwd-invert-frame-when-keyboard-grabbed) (let* ((p-command (cond (perl-journal-command) (t "upj_post.pl"))) (p-uid (cond (uid) (perl-journal-uid) (t (read-string "use.perl.org UID: ")))) (p-passwd (cond (passwd) (perl-journal-passwd) (t (read-passwd "use.perl.org Password: ")))) (p-comment (cond ((= comment "no") "no") (t "yes"))) (p-subject (cond (subject) (t (read-string "Entry subject: ")))) (passwd-invert-frame-when-keyboard-grabbed nil) (command (format "%s -m %S -c %s -C %S" p-command p-subject p-comment (format "%s:%s" p-uid p-passwd)))) (shell-command-on-region (region-beginning) (region-end) command)))