Stefan Monnier [Thu, 15 Mar 2018 00:06:47 +0000 (20:06 -0400)]
EUDC: Enable lexical binding and do some cleanups
* lisp/net/eudc.el: Enable lexical binding.
(cl-lib): Always require cl-lib, not only when byte compiling.
(eudc-mode-map): Set parent keymap within let form.
(eudc-update-local-variables): Use #' read syntax for function
argument to map function.
(eudc-select): Likewise.
(eudc-format-attribute-name-for-display): Likewise
(eudc-filter-duplicate-attributes): Likewise.
(eudc-format-query): Likewise.
(eudc-expand-inline): Likewise.
(eudc-query-form): Likewise.
(eudc-print-attribute-value): Use mapc instead of mapcar.
(eudc-filter-partial-records): Use cl-every.
(eudc-distribute-field-on-records): Use delete-dups to
simplify function.
(eudc-expand-inline): Replace while with dolist and let form.
(eudc-query-form): Set inhibit-read-only after switching
buffers. Remove useless and call.
(eudc-load-eudc): Add a FIXME comment.
Tweak the look of the cookie buffer after cookie deletion
* lisp/url/url-cookie.el (url-cookie--generate-buffer): Factor out
into its own function.
(url-cookie-delete): Use it to make the buffer look consistent
after deleting a cookie.
* lisp/url/url-cookie.el (url-cookie-write-file): If
`url-cookie-file' isn't set (due to url.el not being used yet),
don't error out in this function (bug#23183).
Don't warn the user about large files if they are unreadable
* lisp/files.el (abort-if-file-too-large): There's no point in
warning the user about a too-large file if we're not able to read
it (bug#29549). Hopefully this doesn't introduce a race condition
between this test and the `file-readable-p' test later.
Only save the mailer choice after sending the mail
* lisp/mail/sendmail.el (sendmail-query-once): Only save the
mailer choice after we've sent the mail, so that if that fails,
the user has an easy way to back out of the choice and make
another (bug#14487).
(sendmail-query-user-about-smtp): Return the choice; don't save it.
Query the user whether to increase stack depth in shr
* lisp/net/shr.el (shr-insert-document): Bind `max-specpdl-size'
here... (bug#30675).
(shr-descend): So that we can increase it temporarily here if the
user wants to.
Divert to call `gnus-activate-group' with the SCAN argument set
* lisp/gnus/gnus-group.el (gnus-group-get-new-news-this-group):
Divert to call `gnus-activate-group' with the SCAN argument set,
if request-group-scan is not defined for the backend. Ensure that
the server is open when calling `gnus-request-group-scan'
(bug#22649).
Abort Gnus exit if we have unsaved Message buffers
* lisp/gnus/gnus-group.el
(gnus--abort-on-unsaved-message-buffers): New function (bug#28843).
(gnus-group-exit): Use it to abort exit if we have unsaved Message
buffers.
Avoid an infloop in shr filling when not using fonts
* lisp/net/shr.el (shr-fill-line): If we have an indentation
that's wider than the width of what we're trying to fill, just
give up. This avoids an infloop when `shr-use-fonts' in nil.
Remove calls from string-to-multibyte in nnheader/nntp
* lisp/gnus/nntp.el (nntp-copy-to-buffer): Apparently `insert' now
behaves more like string-make-multibyte, but it now behaves more
like string-to-multibyte, so remove that call here. I'm not quite
sure I follow that logic, but apparently there are no ill effects.
* lisp/gnus/nndoc.el (nndoc-oe-dbx-type-p): My testing shows that
no matter whether we're in a unibyte or a multibyte buffer, doing
the looking-at here without the string-to-multibyte, we'll get a
match. We did not get a match with the call in and if we were in
a unibyte buffer, but we presumably never are.
Fix calculation in gnus-update-group-mark-positions
* lisp/gnus/gnus-group.el (gnus-update-group-mark-positions):
Rewrite a call to string-to-multibyte that didn't even work.
After the rewrite it gives the correct result and should allow
people to customise Gnus group process mark positions (but that's
a pretty obscure feature).
Rewrite string-as-unibyte/string-as-multibyte logic in nnmail
* lisp/gnus/nnmail.el (nnmail-insert-xref): Rewrite
string-as-unibyte/string-as-multibyte logic and confirm that the
result is the same in both multibyte and unibyte buffers after the
change.
* lisp/gnus/nnmail.el (nnmail-parse-active): Remove call to
string-as-unibyte; the alist before and after the change are
`equal' to each other, so it should presumably have no impact.
* lisp/gnus/nnir.el (nnir-get-active): Remove two calls to
string-as-unibyte from code that seems cargo-culted from Gnus
functions where it is not needed, so it's presumably not needed
here, either.
Remove call to string-as-unibyte from gnus-start.el
* lisp/gnus/gnus-start.el (gnus-update-active-hashtb-from-killed):
Remove a string-as-unibyte call here, which appears not to be
necessary: I'm able to complete over non-ASCII names both before
and after.
* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): We do not
seem to need the string-as-unibyte here: We read a multibyte
string from the *nntpd* buffer and then decode it later, and this
apparently by some strange magic leads to the correct results in
my test cases.
* lisp/gnus/gnus-art.el (gnus-request-article-this-buffer): The
original article buffer is multibyte, and we're inserting into the
article buffer, which is also multibyte, so the `string-to-multibyte'
here should be unnecessary?
Make erc-current-logfile work with explicit parameter
* lisp/erc/erc-log.el (erc-current-logfile): This function
apparently refers to buffer-local variables, so switch to the
buffer given before calculating the file name (bug#16111).
Tweak shr link text property adjustments when folding
* lisp/net/shr.el (shr-fill-line): If a link starts at the first
word on a new folded line, then don't copy the link properties to
the newline inserted.
* lisp/erc/erc-log.el (erc-truncate-buffer-on-save): Doc
clarification (bug#18207) since "truncate" is a word used by
erc-truncate to mean something else.
* lisp/erc/erc-button.el (erc-button-search-url): Renamed from
url-button-google-url (bug#25717). Suggested by Andrew Robbins.
(erc-button-alist): Use it.
(libxml-parse-html-region): Make DISCARD-COMMENTS obsolete
* lisp/subr.el (libxml-parse-xml-region)
(libxml-parse-html-region): Make DISCARD-COMMENTS obsolete.
* src/xml.c (Flibxml_parse_html_region)
(Flibxml_parse_xml_region): Don't mention DISCARD-COMMENTS, since
it's now no longer part of the advertised signature (bug#27178).
Make DISCARD-COMMENTS in `libxml-parse-{html,xml}-region' obsolete
* doc/lispref/text.texi (Parsing HTML/XML): Mention that
discard-comments is obsolete.
* lisp/xml.el (xml-remove-comments): New function (bug#27178).
* src/xml.c (Flibxml_parse_html_region): Clarify what
DISCARD-COMMENTS actually does, and say that the parameter is
obsolete.
(Flibxml_parse_xml_region): Ditto.
Make image-mode respect `imagemagick-types-inhibit'
* lisp/image-mode.el (image--imagemagick-wanted-p): New function
(bug#29584).
(image-toggle-display-image): Use it to see whether we want to use
imagemagick.
Tweak mailcap precedence so that Emacs values are heeded better
* lisp/net/mailcap.el (mailcap-parse-mailcaps): Place entries from
system-wide mailcap files after the values that are distributed
with Emacs, and the ones from ~/.mailcap before.
(mailcap-parse-mailcap): Take an optional `after' parameter to
achieve that.
(mailcap-add-mailcap-entry): Ditto.
* lisp/gnus/mm-decode.el: Do not require shr.el at the top
of the file; `mm-shr' already requires shr.el in its body, and
this function is the only `mm-convert-shr-links' caller (Bug#31151).
* lisp/net/eww.el (eww-link-keymap): Only inherit the normal shr
keymap.
(eww-image-link-keymap): New keymap with the image bindings.
(eww-tag-a): Use the appropriate one on links (bug#30148).
* doc/misc/url.texi (file/ftp): Remove mention of the
url-directory-index-file variable, which is no longer consulted.
* lisp/url/url-file.el (url-file-build-filename): Remove the DWIM
code from the file: handler (bug#30195): It would look for
index.html in a directory if we asked it to fetch the directory.
Determining what to do in a directory should be left up to the
programs that use this low-level library. If the library decides
to load a different file than we specified, then things start
falling apart, as demonstrated by this bug report.
Don't bind image commands on non-image links in Gnus
* lisp/gnus/mm-decode.el (mm--images-in-region-p): New utility
function.
(mm-convert-shr-links): Only use the shr image map on links that
contain images. This avoids binding commands like `r' on links
that don't need it.
From the discussion on the ding mailing list, I said:
I think the colours should be reverted back to what they were before the
change. Normal text should be white on black (if you have a dark
background), and colours should be used to emphasise or de-emphasise
certain text. Following that principle, normal Gnus groups should be
white, not ... er... what are they now? Teal?
* lisp/gnus/gnus-sum.el (gnus-summary-exit-no-update): When
exiting the summary buffer with `Q', move point to the next unread
group (which is the same thing that happens on `q' exit.)
Tweak point placement in gnus-summary-select-article-buffer
* lisp/gnus/gnus-sum.el (gnus-summary-select-article-buffer):
Tweak where point is placed because when the user selects the
article buffer, it's probably to cite something or click on
something, and not do anything with the headers.
Eric Abrahamsen [Sun, 8 Apr 2018 23:49:20 +0000 (16:49 -0700)]
Further fix to eieio-persistent
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value):
Make handling of hash tables and vectors recursive. This is
necessary because the write process, in `eieio-override-prin1' is
also recursive. With any luck, this will be the last fix of its
kind. If that's true, cherry-pick to Emacs 26.2 later on.
Make nnimap parse pathological spam headers better
* lisp/gnus/nnimap.el (nnimap-transform-headers): Unfold certain
pathological IMAP headers more correctly (bug#25502). Perhaps
this function should be re-implemented.
* lisp/url/url-http.el (url-http--get-referer): Be IDNA-aware.
(url-http-create-request): Don't de-Unicodify host names, because
they may be IDNA names (that are later encoded).
* lisp/url/url-util.el (url-domain): Be IDNA-aware when doing
domain name computations.
* doc/misc/url.texi (Customization): Describe the new user
option url-lastloc-privacy-level.
* lisp/net/eww.el (eww-render): Set url-current-lastloc to the
url we are rendering, to get the referer header right on
subsequent requests.
* lisp/url/url-http.el (url-http--get-referer): New function
to determine which referer to send, if any, considering the
users privacy settings and the target url we are visiting.
(url-http-referer): New variable keeping track of the referer
computed by url-http--get-referer
(url-http-create-request): Use url-http-referer instead of the
optional argument to set up the referer header. Leave
checking of privacy settings to url-http--get-referer.
(url-http): Set up url-http-referer by using
url-http--get-referer.
* lisp/url/url-queue.el (url-queue): New struct member
context-buffer for keeping track of the context a queued job
started from.
(url-queue-retrieve): Store the current buffer in the queue
object.
(url-queue-start-retrieve): Make sure url-retrieve is called
in the context of the original buffer, if available.
* lisp/url/url-util.el (url-domain): New function to determine
the domain of a given URL.
* lisp/url/url-vars.el (url-current-lastloc): New variable to
keep track of the desired "last location" (referer header).
(url-lastloc-privacy-level): New custom setting for more
fine-grained control over how lastloc (referer) is sent to
servers (Bug#27012).
* lisp/net/eww.el (eww-render): When we have a #link link, then
url.el will say that we have a redirect to a non-#link link, so
get the anchor before url.el mangles the URL (bug#28441).
(eww-display-html): ... and don't get it here, because it's gone
by now.
Eli Zaretskii [Fri, 13 Apr 2018 12:48:04 +0000 (15:48 +0300)]
Avoid segfault in processes of type 'pipe'
* src/process.c (Fmake_pipe_process): Set up the decoding and
encoding buffers. For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00295.html.