Commit aceeea6c authored by Paul Eggert's avatar Paul Eggert
Browse files

Merge from mainline.

parents 79f5556a 25666126
2011-05-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
* misc.texi (Emacs Server): Document `server-eval-at'.
2011-04-24 Chong Yidong <cyd@stupidchicken.com>
* maintaining.texi (List Tags): Document next-file. Suggested by
......
......@@ -1495,6 +1495,15 @@ server-name @key{RET} foo @key{RET}} sets the server name to
@samp{foo}. The @code{emacsclient} program can specify a server by
name, using the @samp{-s} option (@pxref{emacsclient Options}).
@findex server-eval-at
If you have defined a server by a unique server name, you can
connect to this server from other Emacs instances and evaluate forms
on it by using the @code{server-eval-at} function.
@code{(server-eval-at "foo" '(+ 1 2))} gives the result @code{3}, if
there's a server with that name that is listening. If not, an error
will be signaled.
@menu
* Invoking emacsclient:: Connecting to the Emacs server.
* emacsclient Options:: Emacs client startup options.
......
2011-04-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
* processes.texi (Synchronous Processes): Document the (:file
"/file-name") syntax for `call-process'.
2011-04-23 Juanma Barranquero <lekktu@gmail.com>
* windows.texi (Choosing Window): Fix typo.
......
......@@ -299,6 +299,9 @@ function returns.
MS-DOS doesn't support asynchronous subprocesses, so this option doesn't
work there.
@item @code{(:file @var{file-name})}
Send the output to the file name specified.
@item @code{(@var{real-destination} @var{error-destination})}
Keep the standard output stream separate from the standard error stream;
deal with the ordinary output as specified by @var{real-destination},
......
2011-05-03 Leo Liu <sdl.web@gmail.com>
* NEWS: Mention the new command isearch-yank-pop.
2011-05-03 Teodor Zlatanov <tzz@lifelogs.com>
* NEWS: Mention new library gnutls.el and explain GnuTLS
functionality. Mention new configure.bat options --without-gnutls
and --lib for W32.
2011-05-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
* NEWS: Mention `url-retrieve-queue', (:file "file") and
`server-eval-at'.
2011-04-28 Juanma Barranquero <lekktu@gmail.com>
* NEWS: Document `delayed-warnings-list' and `delayed-warnings-hook'.
......
......@@ -281,6 +281,10 @@ replaced with Lisp commands `doc-file-to-man' and `doc-file-to-info'.
*** C-y in Isearch is now bound to isearch-yank-kill, instead of
isearch-yank-line.
---
*** M-y in Isearch is now bound to isearch-yank-pop, instead of
isearch-yank-kill.
+++
*** M-s C-e in Isearch is now bound to isearch-yank-line.
......@@ -396,6 +400,9 @@ Just set shell-dir-cookie-re to an appropriate regexp.
** browse-url has gotten a new variable that is used for mailto: URLs,
`browse-url-mailto-function', which defaults to `browse-url-mail'.
** `url-queue-retrieve' downloads web pages asynchronously, but allow
controlling the degree of parallelism.
** Directory local variables can apply to file-less buffers, in certain modes
(eg dired, vc-dir, log-edit). For example, adding
"(diff-mode . ((mode . whitespace)))" to your .dir-locals.el file,
......@@ -822,6 +829,12 @@ Instead, the offending function is removed.
** New low-level function run-hook-wrapped.
** `server-eval-at' is provided to allow evaluating forms on different
Emacs server instances.
** `call-process' allows a `(:file "file")' spec to redirect STDOUT to
a file.
** byte-compile-disable-print-circle is obsolete.
** deferred-action-list and deferred-action-function are obsolete.
** Removed the stack-trace-on-error variable.
......@@ -894,7 +907,21 @@ Emacs Lisp parse tree.
FIXME: These should be front-ended by xml.el.
** FIXME GnuTLS
** GnuTLS
*** Emacs can be compiled with libgnutls support
This is the default. You will then be able to use the functionality
in gnutls.el, namely the `open-gnutls-stream' and `gnutls-negotiate'
functions. It's easiest to use these functions through
`open-network-stream' because it can upgrade connections through
STARTTLS opportunistically or use plain SSL, depending on your needs.
Only versions 2.8.x and higher or GnuTLS have been tested.
*** gnutls-log-level
Set `gnutls-log-level' higher than 0 to get debug output. 1 is for
important messages, 2 is for debug data, and higher numbers are as per
the GnuTLS logging conventions. The output is in *Messages*.
** Isearch
......@@ -922,6 +949,12 @@ runtime checks.
** New configure.bat option --distfiles to specify files to be
included in binary distribution.
** New configure.bat option --without-gnutls to disable automatic
GnuTLS detection.
** New configure.bat option --lib for general library linkage, works
with the USER_LIBS build variable.
** New make target `dist' to create binary distribution for MS Windows.
......
2011-05-03 Leo Liu <sdl.web@gmail.com>
* isearch.el (isearch-yank-pop): New command.
(isearch-mode-map): bind it to `M-y'.
(isearch-forward): Mention it.
2011-05-03 Stefan Monnier <monnier@iro.umontreal.ca>
* simple.el (minibuffer-complete-shell-command): Remove.
(minibuffer-local-shell-command-map): Use completion-at-point.
(read-shell-command): Setup completion vars here instead.
(read-expression-map): Bind TAB to symbol completion.
* textmodes/ispell.el (lookup-words): Use with-temp-buffer; signal
error directly rather via storing it into `results'.
2011-05-02 Leo Liu <sdl.web@gmail.com>
* vc/diff.el: Fix description.
2011-05-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
* server.el (server-eval-at): New function.
2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/network-stream.el (open-network-stream): Take a :nowait
parameter and pass it on to `make-network-process'.
(network-stream-open-plain): Ditto.
2011-04-30 Andreas Schwab <schwab@linux-m68k.org>
* faces.el (face-spec-set-match-display): Don't match toolkit
......
2011-05-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-html.el (gnus-html-schedule-image-fetching): Use
url-queue-retrieve, if it exists.
* shr.el (shr-tag-img): Ditto.
* gnus.el: Autoload more gnus-agent functions.
* gnus-art.el (gnus-request-article-this-buffer): Store articles in the
agent if we haven't already (bug#8502).
* gnus-async.el (gnus-async-article-callback): Put prefetched articles
into the Agent, too.
* gnus-agent.el (gnus-agent-store-article): New function.
* nnheader.el (nnheader-insert-buffer-substring): Renamed from nntp-
and moved from that file for reuse.
* pop3.el (pop3-open-server): Error messages are "-ERR".
2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* pop3.el (pop3-open-server): Upgrade opportunistically to STARTTLS.
(open-tls-stream): Remove superfluous tls/starttls autoloads.
2011-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
* gnus-sum.el (gnus-summary-next-article): Don't bug out if the summary
buffer has moved to a different frame.
2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* nnimap.el (nnimap-request-article): Use nntp-insert-buffer-substring
to get the conversion from unibyte to multibyte buffers to work on
Emacs 22.
* nntp.el (nntp-request-article): Slight clean-up.
2011-04-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
 
* shr.el (shr-strike-through): New face.
......
......@@ -3876,6 +3876,15 @@ has been fetched."
(insert-file-contents file))
t))))
(defun gnus-agent-store-article (article group)
(let* ((gnus-command-method (gnus-find-method-for-group group))
(file (gnus-agent-article-name (number-to-string article) group))
(file-name-coding-system nnmail-pathname-coding-system)
(coding-system-for-write gnus-cache-coding-system))
(when (not (file-exists-p file))
(gnus-make-directory (file-name-directory file))
(write-region (point-min) (point-max) file nil 'silent))))
(defun gnus-agent-regenerate-group (group &optional reread)
"Regenerate GROUP.
If REREAD is t, all articles in the .overview are marked as unread.
......
......@@ -6841,7 +6841,10 @@ If given a prefix, show the hidden text instead."
gnus-summary-buffer)
(when gnus-keep-backlog
(gnus-backlog-enter-article
group article (current-buffer))))
group article (current-buffer)))
(when (and gnus-agent
(gnus-agent-group-covered-p group))
(gnus-agent-store-article article group)))
(setq result 'article))
(methods
(setq gnus-override-method (pop methods)))
......
......@@ -237,6 +237,12 @@ that was fetched."
(save-excursion
(save-restriction
(narrow-to-region mark (point-max))
;; Put the articles into the agent, if they aren't already.
(when (and gnus-agent
(gnus-agent-group-covered-p group))
(save-restriction
(narrow-to-region mark (point-max))
(gnus-agent-store-article article group)))
;; Prefetch images for the groups that want that.
(when (fboundp 'gnus-html-prefetch-images)
(gnus-html-prefetch-images summary))
......
......@@ -386,16 +386,14 @@ Use ALT-TEXT for the image string."
"Retrieve IMAGE, and place it into BUFFER on arrival."
(gnus-message 8 "gnus-html-schedule-image-fetching: buffer %s, image %s"
buffer image)
(let ((args (list (car image)
'gnus-html-image-fetched
(list buffer image))))
(when (> (length (if (featurep 'xemacs)
(cdr (split-string (function-arglist 'url-retrieve)))
(help-function-arglist 'url-retrieve)))
4)
(setq args (nconc args (list t))))
(if (fboundp 'url-queue-retrieve)
(url-queue-retrieve (car image)
'gnus-html-image-fetched
(list buffer image) t)
(ignore-errors
(push (apply #'url-retrieve args) gnus-buffers))))
(url-retrieve (car image)
'gnus-html-image-fetched
(list buffer image)))))
(defun gnus-html-image-fetched (status buffer image)
"Callback function called when image has been fetched."
......
......@@ -7783,7 +7783,8 @@ If BACKWARD, the previous article is selected instead of the next."
;; Somehow or other, we may now have selected a different
;; window. Make point go back to the summary buffer.
(when (eq current-summary (current-buffer))
(select-window (get-buffer-window current-summary)))
;; FIXME: This burps when get-buffer-window returns nil.
(select-window (get-buffer-window current-summary 0)))
(gnus-summary-walk-group-buffer
gnus-newsgroup-name cmd unread backward point))))))))
......
......@@ -2910,7 +2910,8 @@ gnus-registry.el will populate this if it's loaded.")
gnus-agent-save-active gnus-agent-method-p
gnus-agent-get-undownloaded-list gnus-agent-fetch-session
gnus-summary-set-agent-mark gnus-agent-save-group-info
gnus-agent-request-article gnus-agent-retrieve-headers)
gnus-agent-request-article gnus-agent-retrieve-headers
gnus-agent-store-article gnus-agent-group-covered-p)
("gnus-agent" :interactive t
gnus-unplugged gnus-agentize gnus-agent-batch)
("gnus-vm" :interactive t gnus-summary-save-in-vm
......
......@@ -1099,6 +1099,19 @@ See `find-file-noselect' for the arguments."
backend-marks)))))
backend-marks)
(defmacro nnheader-insert-buffer-substring (buffer &optional start end)
"Copy string from unibyte buffer to multibyte current buffer."
(if (featurep 'xemacs)
`(insert-buffer-substring ,buffer ,start ,end)
`(if enable-multibyte-characters
(insert (with-current-buffer ,buffer
(mm-string-to-multibyte
,(if (or start end)
`(buffer-substring (or ,start (point-min))
(or ,end (point-max)))
'(buffer-string)))))
(insert-buffer-substring ,buffer ,start ,end))))
(when (featurep 'xemacs)
(require 'nnheaderxm))
......
......@@ -545,10 +545,9 @@ textual parts.")
(nnimap-get-whole-article article))
(let ((buffer (current-buffer)))
(with-current-buffer (or to-buffer nntp-server-buffer)
(erase-buffer)
(insert-buffer-substring buffer)
(nnheader-ms-strip-cr)
(cons group article)))))))))
(nnheader-insert-buffer-substring buffer)
(nnheader-ms-strip-cr)))
(cons group article)))))))
(deffoo nnimap-request-head (article &optional group server to-buffer)
(when (nnimap-possibly-change-group group server)
......
......@@ -364,19 +364,6 @@ be restored and the command retried."
(throw 'nntp-with-open-group-error t))
(defmacro nntp-insert-buffer-substring (buffer &optional start end)
"Copy string from unibyte buffer to multibyte current buffer."
(if (featurep 'xemacs)
`(insert-buffer-substring ,buffer ,start ,end)
`(if enable-multibyte-characters
(insert (with-current-buffer ,buffer
(mm-string-to-multibyte
,(if (or start end)
`(buffer-substring (or ,start (point-min))
(or ,end (point-max)))
'(buffer-string)))))
(insert-buffer-substring ,buffer ,start ,end))))
(defmacro nntp-copy-to-buffer (buffer start end)
"Copy string from unibyte current buffer to multibyte buffer."
(if (featurep 'xemacs)
......@@ -434,7 +421,7 @@ be restored and the command retried."
(unless discard
(with-current-buffer buffer
(goto-char (point-max))
(nntp-insert-buffer-substring (process-buffer process))
(nnheader-insert-buffer-substring (process-buffer process))
;; Nix out "nntp reading...." message.
(when nntp-have-messaged
(setq nntp-have-messaged nil)
......@@ -996,7 +983,7 @@ command whose response triggered the error."
(narrow-to-region
(setq point (goto-char (point-max)))
(progn
(nntp-insert-buffer-substring buf last-point (cdr entry))
(nnheader-insert-buffer-substring buf last-point (cdr entry))
(point-max)))
(setq last-point (cdr entry))
(nntp-decode-text)
......@@ -1028,16 +1015,15 @@ command whose response triggered the error."
(deffoo nntp-request-article (article &optional group server buffer command)
(nntp-with-open-group
group server
group server
(when (nntp-send-command-and-decode
"\r?\n\\.\r?\n" "ARTICLE"
(if (numberp article) (int-to-string article) article))
(if (and buffer
(not (equal buffer nntp-server-buffer)))
(with-current-buffer nntp-server-buffer
(copy-to-buffer buffer (point-min) (point-max))
(nntp-find-group-and-number group))
(nntp-find-group-and-number group)))))
(when (and buffer
(not (equal buffer nntp-server-buffer)))
(with-current-buffer nntp-server-buffer
(copy-to-buffer buffer (point-min) (point-max))))
(nntp-find-group-and-number group))))
(deffoo nntp-request-head (article &optional group server)
(nntp-with-open-group
......@@ -1473,7 +1459,7 @@ password contained in '~/.nntp-authinfo'."
(goto-char (point-max))
(save-restriction
(narrow-to-region (point) (point))
(nntp-insert-buffer-substring buf start)
(nnheader-insert-buffer-substring buf start)
(when decode
(nntp-decode-text))))))
;; report it.
......@@ -1701,7 +1687,7 @@ password contained in '~/.nntp-authinfo'."
(when in-process-buffer-p
(set-buffer buf)
(goto-char (point-max))
(nntp-insert-buffer-substring process-buffer)
(nnheader-insert-buffer-substring process-buffer)
(set-buffer process-buffer)
(erase-buffer)
(set-buffer buf))
......
......@@ -33,6 +33,13 @@
;;; Code:
(eval-when-compile (require 'cl))
(eval-and-compile
;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for
;; `make-network-stream'.
(unless (fboundp 'open-protocol-stream)
(require 'proto-stream)))
(require 'mail-utils)
(defvar parse-time-months)
......@@ -257,10 +264,6 @@ Use streaming commands."
(pop3-quit process)
message-count))
(autoload 'open-tls-stream "tls")
(autoload 'starttls-open-stream "starttls")
(autoload 'starttls-negotiate "starttls") ; avoid warning
(defcustom pop3-stream-type nil
"*Transport security type for POP3 connexions.
This may be either nil (plain connexion), `ssl' (use an
......@@ -286,64 +289,37 @@ this is nil, `ssl' is assumed for connexions to port
Returns the process associated with the connection."
(let ((coding-system-for-read 'binary)
(coding-system-for-write 'binary)
process)
result)
(with-current-buffer
(get-buffer-create (concat " trace of POP session to "
mailhost))
(erase-buffer)
(setq pop3-read-point (point-min))
(setq process
(cond
((or (eq pop3-stream-type 'ssl)
(and (not pop3-stream-type) (member port '(995 "pop3s"))))
;; gnutls-cli, openssl don't accept service names
(if (or (equal port "pop3s")
(null port))
(setq port 995))
(let ((process (open-tls-stream "POP" (current-buffer)
mailhost port)))
(when process
;; There's a load of info printed that needs deleting.
(let ((again 't))
;; repeat until
;; - either we received the +OK line
;; - or accept-process-output timed out without getting
;; anything
(while (and again
(setq again (memq (process-status process)
'(open run))))
(setq again (pop3-accept-process-output process))
(goto-char (point-max))
(forward-line -1)
(cond ((looking-at "\\+OK")
(setq again nil)
(delete-region (point-min) (point)))
((not again)
(pop3-quit process)
(error "POP SSL connexion failed")))))
process)))
((eq pop3-stream-type 'starttls)
;; gnutls-cli, openssl don't accept service names
(if (equal port "pop3")
(setq port 110))
;; Delay STLS until server greeting is read (Bug#7438).
(starttls-open-stream "POP" (current-buffer)
mailhost (or port 110)))
(t
(open-network-stream "POP" (current-buffer) mailhost port))))
(let ((response (pop3-read-response process t)))
(setq pop3-timestamp
(substring response (or (string-match "<" response) 0)
(+ 1 (or (string-match ">" response) -1)))))
(when (eq pop3-stream-type 'starttls)
(pop3-send-command process "STLS")
(let ((response (pop3-read-response process t)))
(if (and response (string-match "+OK" response))
(starttls-negotiate process)
(pop3-quit process)
(error "POP server doesn't support starttls"))))
(pop3-set-process-query-on-exit-flag process nil)
process)))
(setq result
(open-protocol-stream
"POP" (current-buffer) mailhost port
:type (cond
((or (eq pop3-stream-type 'ssl)
(and (not pop3-stream-type)
(member port '(995 "pop3s"))))
'tls)
(t
(or pop3-stream-type 'network)))
:capability-command "CAPA\r\n"
:end-of-command "^\\.\r?\n\\|^\\(-ERR\\|+OK \\).*\n"
:success "^\\+OK.*\n"
:return-list t
:starttls-function
(lambda (capabilities)
(and (string-match "\\bSTLS\\b" capabilities)
"STLS\r\n"))))
(when result
(let ((response (plist-get (cdr result) :greeting)))
(setq pop3-timestamp
(substring response (or (string-match "<" response) 0)
(+ 1 (or (string-match ">" response) -1)))))
(pop3-set-process-query-on-exit-flag (car result) nil)
(car result)))))
;; Support functions
......
......@@ -871,10 +871,13 @@ ones, in case fg and bg are nil."
(shr-put-image (shr-get-image-data url) alt))
(t
(insert alt)
(ignore-errors
(url-retrieve (shr-encode-url url) 'shr-image-fetched
(list (current-buffer) start (point-marker))
t))))
(funcall
(if (fboundp 'url-queue-retrieve)
'url-queue-retrieve
'url-retrieve)
(shr-encode-url url) 'shr-image-fetched
(list (current-buffer) start (point-marker))
t)))
(put-text-property start (point) 'keymap shr-map)
(put-text-property start (point) 'shr-alt alt)
(put-text-property start (point) 'image-url url)
......
......@@ -473,7 +473,7 @@ This is like `describe-bindings', but displays only Isearch keys."
(define-key map "\M-n" 'isearch-ring-advance)
(define-key map "\M-p" 'isearch-ring-retreat)
(define-key map "\M-y" 'isearch-yank-kill)
(define-key map "\M-y" 'isearch-yank-pop)
(define-key map "\M-\t" 'isearch-complete)
......@@ -637,6 +637,8 @@ Type \\[isearch-yank-char] to yank char from buffer onto end of search\
Type \\[isearch-yank-line] to yank rest of line onto end of search string\
and search for it.
Type \\[isearch-yank-kill] to yank the last string of killed text.
Type \\[isearch-yank-pop] to replace string just yanked into search prompt
with string killed before it.
Type \\[isearch-quote-char] to quote control character to search for it.
\\[isearch-abort] while searching or when search has failed cancels input\
back to what has
......@@ -1497,6 +1499,18 @@ If search string is empty, just beep."
(interactive)
(isearch-yank-string (current-kill 0)))
(defun isearch-yank-pop ()
"Replace just-yanked search string with previously killed string."
(interactive)
(if (not (memq last-command '(isearch-yank-kill isearch-yank-pop)))
;; Fall back on `isearch-yank-kill' for the benefits of people
;; who are used to the old behavior of `M-y' in isearch mode. In
;; future, this fallback may be changed if we ever change
;; `yank-pop' to do something like the kill-ring-browser.
(isearch-yank-kill)
(isearch-pop-state)
(isearch-yank-string (current-kill 1))))
(defun isearch-yank-x-selection ()
"Pull current X selection into search string."
(interactive)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment