• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/gnus/

Lines Matching +defs:process +defs:send +defs:string

49 (defvoo nntp-server-opened-hook '(nntp-send-mode-reader)
51 The default value is `nntp-send-mode-reader', which makes an innd
54 (defvoo nntp-authinfo-function 'nntp-send-authinfo
55 "Function used to send AUTHINFO to the server.
60 (remove-hook 'nntp-server-opened-hook 'nntp-send-mode-reader))
77 respective doc string for more information), three of them establishing
210 (string :tag "Host")
214 (string :format "Login: %v"))
217 (string :format "Password: %v")))))))
238 (defvar nntp-process-wait-for nil)
239 (defvar nntp-process-to-buffer nil)
240 (defvar nntp-process-callback nil)
241 (defvar nntp-process-decode nil)
242 (defvar nntp-process-start-point nil)
253 (defvoo nntp-status-string "")
262 (string-match "^GNU Emacs 20\\.3\\." (emacs-version))
269 (defvar nntp-async-process-list nil)
273 "A string containing commands for SSL connections.
274 Within a string, %s is replaced with the server address and %p with
290 (defsubst nntp-send-string (process string)
296 nntp-last-command string)
298 (nntp-record-command string))
299 (process-send-string process (concat string nntp-end-of-line))
300 (or (memq (process-status process) '(open run))
303 (defun nntp-record-command (string)
309 (insert (format-time-string "%Y%m%dT%H%M%S" time)
311 " " nntp-address " " string "\n"))))
314 "Report an error from the nntp backend. The first string in ARGS
315 can be a format string. For some commands, the failed command may be
334 (defsubst nntp-wait-for (process wait-for buffer &optional decode discard)
337 (set-buffer (process-buffer process))
341 (memq (process-status process) '(open run)))
343 (nntp-handle-authinfo process))
349 (nntp-accept-process-output process)
357 ((not (memq (process-status process) '(open run)))
364 (nntp-accept-process-output process)
369 (setq response (match-string 0))
371 (setq nntp-process-response response)))
377 (insert-buffer-substring (process-buffer process))
395 process entry)
398 (setq process (car entry)
400 (when process
401 (if (memq (process-status process) '(open run))
402 process
403 (nntp-kill-buffer (process-buffer process))
412 "Return the process connection buffer tied to BUFFER."
413 (let ((process (nntp-find-connection buffer)))
414 (when process
415 (process-buffer process))))
420 (let ((process (or (nntp-find-connection buffer)
422 (if process
426 (set-buffer (process-buffer process))
431 (nntp-send-string process command))
436 (nntp-async-wait process wait-for buffer decode callback)
439 (nntp-wait-for process wait-for buffer decode))
452 (defsubst nntp-send-command (wait-for &rest strings)
460 (process (nntp-find-connection nntp-server-buffer))
461 (buffer (and process (process-buffer process)))
463 (if process
490 (defun nntp-send-command-nodelete (wait-for &rest strings)
493 (process (nntp-find-connection nntp-server-buffer))
494 (buffer (and process (process-buffer process)))
496 (if process
514 (defun nntp-send-command-and-decode (wait-for &rest strings)
522 (process (nntp-find-connection nntp-server-buffer))
523 (buffer (and process (process-buffer process)))
525 (if process
544 (defun nntp-send-buffer (wait-for)
554 (process-send-region (nntp-find-connection nntp-server-buffer)
593 connections are not detected until accept-process-output has updated
594 the process-status. Dropped connections are not detected until the
616 (let ((process (nntp-find-connection
618 (buffer (and process
619 (process-buffer process))))
667 (nntp-send-command
670 (int-to-string article)
737 (nntp-send-command nil command (pop groups))
816 (nntp-send-command
819 (int-to-string article)
883 (nntp-send-command "^\\.*\r?\n" "LIST ACTIVE" group)))
889 (nntp-send-command "^\\.*\r?\n" "LISTGROUP" group)))
894 (when (nntp-send-command-and-decode
896 (if (numberp article) (int-to-string article) article))
908 (when (nntp-send-command
910 (if (numberp article) (int-to-string article) article))
918 (nntp-send-command-and-decode
920 (if (numberp article) (int-to-string article) article))))
925 (when (nntp-send-command "^[245].*\n" "GROUP" group)
955 (let ((process (nntp-find-connection nntp-server-buffer)))
956 (while process
957 (when (memq (process-status process) '(open run))
959 (nntp-send-string process "QUIT")
964 ;; the process.
966 (nntp-kill-buffer (process-buffer process))
967 (setq process (car (pop nntp-connection-alist))))
971 (let (process)
972 (while (setq process (pop nntp-connection-list))
973 (when (memq (process-status process) '(open run))
975 (nntp-send-string process "QUIT")
980 ;; the process.
982 (nntp-kill-buffer (process-buffer process)))))
987 (nntp-send-command-and-decode "\r?\n\\.\r?\n" "LIST")))
992 (nntp-send-command "\r?\n\\.\r?\n" "LIST NEWSGROUPS")))
1010 (nntp-send-command
1012 (format-time-string "%y%m%d %H%M%S" time)
1019 (when (nntp-send-command "^[23].*\r?\n" "POST")
1021 nntp-process-response))
1024 (string-match "^[23].*\\(<[^\t\n @<>]+@[^\t\n @<>]+>\\)"
1026 (setq server-id (match-string 1 response))
1036 (nntp-send-buffer "^[23].*\n")))))
1046 (defun nntp-send-mode-reader ()
1049 It will make innd servers spawn an nnrpd process to allow actual article
1051 (nntp-send-command "^.*\n" "MODE READER"))
1053 (defun nntp-send-authinfo (&optional send-if-force)
1059 If SEND-IF-FORCE, only send authinfo to the server if the
1066 (when (or (not send-if-force)
1069 (setq user (read-string (format "NNTP (%s) user name: " nntp-address))
1072 (nntp-send-command "^3.*\r?\n" "AUTHINFO USER" user)
1074 (nntp-send-command
1082 (defun nntp-send-nosy-authinfo ()
1084 (let ((user (read-string (format "NNTP (%s) user name: " nntp-address))))
1086 (nntp-send-command "^3.*\r?\n" "AUTHINFO USER" user)
1088 (nntp-send-command "^2.*\r?\n" "AUTHINFO PASS"
1092 (defun nntp-send-authinfo-from-file ()
1101 (nntp-send-command "^3.*\r?\n" "AUTHINFO USER" (user-login-name))
1102 (nntp-send-command
1108 (defun nntp-handle-authinfo (process)
1112 ;; We have to re-send the function that was interrupted by
1117 (nntp-send-string process last)))
1119 (defun nntp-make-process-buffer (buffer)
1120 "Create a new, fresh buffer usable for nntp process connections."
1129 (set (make-local-variable 'nntp-process-wait-for) nil)
1130 (set (make-local-variable 'nntp-process-callback) nil)
1131 (set (make-local-variable 'nntp-process-to-buffer) nil)
1132 (set (make-local-variable 'nntp-process-start-point) nil)
1133 (set (make-local-variable 'nntp-process-decode) nil)
1139 (let* ((pbuffer (nntp-make-process-buffer buffer))
1146 (process
1159 (unless process
1162 process)
1163 (gnus-set-process-query-on-exit-flag process nil)
1164 (if (and (nntp-wait-for process "^2.*\n" buffer nil t)
1165 (memq (process-status process) '(open run)))
1167 (caar (push (list process buffer nil) nntp-connection-alist))
1168 (push process nntp-connection-list)
1176 (nntp-send-authinfo t))))
1177 (nntp-kill-buffer (process-buffer process))
1189 (let* ((process-connection-type nil)
1190 (proc (start-process "nntpd" buffer
1197 (gnus-set-process-query-on-exit-flag proc nil)
1201 (nntp-wait-for-string "^\r*20[01]"))
1208 (gnus-set-process-query-on-exit-flag proc nil)
1212 (nntp-wait-for-string "^\r*20[01]"))
1219 ;; Wait for the status string to arrive.
1220 (setq nntp-server-type (buffer-string))
1227 (when (string-match (car entry) nntp-server-type)
1233 (defun nntp-async-wait (process wait-for buffer decode callback)
1235 (set-buffer (process-buffer process))
1238 (setq nntp-process-wait-for wait-for
1239 nntp-process-to-buffer buffer
1240 nntp-process-decode decode
1241 nntp-process-callback callback
1242 nntp-process-start-point (point-max))
1245 (nntp-async-kluge process))))
1247 (defun nntp-async-kluge (process)
1248 ;; emacs 20.3 bug: process output with encoding 'binary
1253 (add-to-list 'nntp-async-process-list process))
1258 (if (memq (process-status proc) '(open run))
1261 nntp-async-process-list))
1264 (setq nntp-async-process-list (delq proc nntp-async-process-list))
1265 (when (and nntp-async-timer (not nntp-async-process-list))
1274 (let ((proc (get-buffer-process (current-buffer))))
1282 (defun nntp-async-trigger (process)
1284 (set-buffer (process-buffer process))
1285 (when nntp-process-callback
1287 (goto-char nntp-process-start-point)
1291 (nntp-handle-authinfo process)
1299 nntp-process-wait-for nntp-process-start-point t)
1300 (let ((response (match-string 0)))
1302 (setq nntp-process-response response)))
1303 (nntp-async-stop process)
1305 (when (gnus-buffer-exists-p nntp-process-to-buffer)
1307 (start nntp-process-start-point)
1308 (decode nntp-process-decode))
1310 (set-buffer nntp-process-to-buffer)
1320 (buffer-name (get-buffer nntp-process-to-buffer))))))))
1323 (let ((callback nntp-process-callback)
1325 (setq nntp-process-callback nil)
1330 (let ((message (buffer-string)))
1331 (while (string-match "[\r\n]+" message)
1336 (defun nntp-accept-process-output (process)
1346 (nnheader-accept-process-output process)
1347 ;; accept-process-output may update status of process to indicate
1350 ;; be the process's former output buffer (i.e. now killed)
1351 (or (and process
1352 (memq (process-status process) '(open run)))
1356 "Wait for output from the process that outputs to BUFFER."
1357 (nntp-accept-process-output (nntp-find-connection nntp-server-buffer)))
1375 (set-buffer (process-buffer (car entry)))
1377 (nntp-send-command "^[245].*\n" "GROUP" group)
1436 (nntp-send-xover-command
1456 ;; just send them off as fast as we can. That means that we have
1463 in-process-buffer-p
1465 (process-buffer (nntp-find-connection-buffer nntp-server-buffer))
1478 (setq in-process-buffer-p (stringp nntp-server-xover))
1479 (nntp-send-xover-command first (setq last (car articles)))
1482 (when (and nntp-server-xover in-process-buffer-p)
1496 (set-buffer process-buffer)
1503 (setq status (match-string 1))
1504 (if (string-match "^[45]" status)
1518 (set-buffer process-buffer))))
1534 (let ((low-limit (string-to-number
1542 (when in-process-buffer-p
1545 (insert-buffer-substring process-buffer)
1546 (set-buffer process-buffer)
1560 (defun nntp-send-xover-command (beg end &optional wait-for-reply)
1565 ;; If `nntp-server-xover' is a string, then we just send this
1568 (nntp-send-command-nodelete
1571 (nntp-send-command-nodelete nil nntp-server-xover range))
1576 (nntp-send-command-nodelete "\r?\n\\.\r?\n" (car commands) range)
1606 (string-to-number
1620 (not (string-match "," newsgroups)))
1632 (string-match
1634 (match-string 1 xref))
1638 (string-match
1643 (setq group (match-string 1 xref)
1644 number (string-to-number (match-string 2 xref))))
1647 (not (string-match "," newsgroups)))
1651 (when (string-match "\r" group)
1655 (defun nntp-wait-for-string (regexp)
1656 "Wait until string arrives in the buffer."
1660 (while (and (setq proc (get-buffer-process buf))
1661 (memq (process-status proc) '(open run))
1663 (accept-process-output proc)
1708 'start-process
1711 (when (memq (process-status proc) '(open run))
1712 (nntp-wait-for-string "^r?telnet")
1713 (process-send-string proc "set escape \^X\n")
1716 (process-send-string proc (concat "open " "-l" nntp-telnet-user-name
1719 (process-send-string proc (concat "open " nntp-address "\n"))))
1722 (nntp-wait-for-string "^\r*.?login:")
1723 (process-send-string
1726 (setq nntp-telnet-user-name (read-string "login: ")))
1728 (nntp-wait-for-string "^\r*.?password:")
1729 (process-send-string
1735 (nntp-wait-for-string nntp-telnet-shell-prompt)
1736 (process-send-string
1738 (nntp-wait-for-string "^\r*20[01]")
1741 (process-send-string proc "\^]")
1742 (nntp-wait-for-string "^r?telnet")
1743 (process-send-string proc "mode character\n")
1744 (accept-process-output proc 1)
1754 (apply 'start-process
1758 (apply 'start-process
1763 (nntp-wait-for-string "^\r*20[01]")
1789 (setq proc (apply 'start-process "nntpd" buffer command))
1792 (nntp-wait-for-string "^\r*20[01]")
1824 (setq proc (apply 'start-process "nntpd" buffer command))
1827 (nntp-wait-for-string "^r?telnet")
1828 (process-send-string proc (concat "open " nntp-address
1830 (nntp-wait-for-string "^\r*20[01]")
1833 (process-send-string proc "\^]")
1834 (nntp-wait-for-string "^r?telnet")
1835 (process-send-string proc "mode character\n")
1836 (accept-process-output proc 1)
1869 (setq proc (apply 'start-process "nntpd" buffer command))
1870 (when (memq (process-status proc) '(open run))
1871 (nntp-wait-for-string "^r?telnet")
1872 (process-send-string proc "set escape \^X\n")
1875 (process-send-string proc (concat "open " "-l" nntp-via-user-name
1878 (process-send-string proc (concat "open " nntp-via-address
1881 (nntp-wait-for-string "^\r*.?login:")
1882 (process-send-string proc
1886 (read-string "login: ")))
1888 (nntp-wait-for-string "^\r*.?password:")
1889 (process-send-string proc
1895 (nntp-wait-for-string nntp-via-shell-prompt)
1901 (process-send-string proc
1905 (nntp-wait-for-string "^\r*20[01]")
1908 (process-send-string proc "\^]")
1909 (nntp-wait-for-string "^r?telnet")
1910 (process-send-string proc "mode character\n")
1911 (accept-process-output proc 1)