| 471 | | (shell-command (simple-hatena-internal-build-command flag) |
| 472 | | "*SimpleHatenaOutput*" "*SimpleHatenaError*") |
| 473 | | (run-hooks 'simple-hatena-after-submit-hook))) |
| | 476 | (let* ((buffer (get-buffer-create simple-hatena-process-buffer-name)) |
| | 477 | (proc (get-buffer-process buffer))) |
| | 478 | (if (and |
| | 479 | proc |
| | 480 | (eq (process-status proc) 'run) |
| | 481 | (yes-or-no-p (format "A %s process is running; kill it?" |
| | 482 | (process-name proc)))) |
| | 483 | (progn |
| | 484 | (interrupt-process proc) |
| | 485 | (sit-for 1) |
| | 486 | (delete-process proc))) |
| | 487 | (with-current-buffer buffer |
| | 488 | (progn |
| | 489 | (erase-buffer) |
| | 490 | (buffer-disable-undo (current-buffer)))) |
| | 491 | (make-comint-in-buffer |
| | 492 | "simple-hatena-submit" buffer shell-file-name nil |
| | 493 | shell-command-switch (simple-hatena-internal-build-command flag)) |
| | 494 | (set-process-sentinel |
| | 495 | (get-buffer-process buffer) |
| | 496 | '(lambda (process signal) |
| | 497 | (if (string= signal "finished\n") |
| | 498 | (let ((max-mini-window-height 10)) |
| | 499 | (display-message-or-buffer (process-buffer process)) |
| | 500 | (run-hooks 'simple-hatena-after-submit-hook)))))))) |