* lisp/simple.el (next-error-buffer): New buffer-local variable
instead of making buffer-local next-error-last-buffer. (Bug#20489)
(next-error-found-function): New defcustom.
(next-error-buffer-on-selected-frame): Use t for avoid-current arg
of next-error-buffer-p.
(next-error-find-buffer): Add second rule for using the current
next-error-buffer if it's not visited by other navigation.
(next-error, next-error-internal): Call next-error-found.
(next-error-found): New function with body extracted mostly from
next-error.
* lisp/vc/add-log.el (change-log-goto-source-internal): New function
with body from change-log-goto-source.
(change-log-goto-source): Call change-log-goto-source-internal and
next-error-found.
(change-log-next-error): Call change-log-goto-source-internal
instead of change-log-goto-source.
(change-log-mode): Don't set next-error-last-buffer. (Bug#28864)
* lisp/net/shr.el (shr-insert-document): The computation of the
window width is apparently one pixel too wide for the shr line
folding algorithm (bug#31196).
Place point consistently in the Gnus group buffer on exit
* lisp/gnus/gnus-sum.el (gnus-summary-exit): Place point correctly
when exiting with `q' (and the like) from the article buffer when
only the article buffer is displayed (bug#31195). This is
apparently yet another fall-out from the "preserve-visible-point-
in-windows" patches of yesteryear...
Make mail-sendmail-undelimit-header actually remove the delimiter
* lisp/mail/sendmail.el (mail-sendmail-undelimit-header): Actually
remove the mail header separator (bug#17488). In all the cases
where this is called, the separator will probably already have
been removed, so the only thing this does is place point at the
end of the headers.
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.