(hs-set-up-overlay, hs-adjust-block-beginning): Use non-nil default for
function variables, so `add-function` can be used on them.
(hs-toggle-hiding): Make it work for mouse bindings as well.
(hs-minor-mode-map): Use it for the mouse binding.
(hs-grok-mode-type): Use bound-and-true-p.
(hs-life-goes-on): Use `declare` for the debug spec.
(hs-mouse-toggle-hiding): Make it an obsolete alias.
* src/xterm.h (struct x_output): Remove member cr_surface.
Add members cr_surface_desired_width and cr_surface_desired_height.
(x_cr_destroy_frame_context) [USE_CAIRO]: Add extern.
* src/xterm.c (x_free_cr_resources): Remove function.
(FRAME_CR_SURFACE) [USE_CAIRO]: Remove macro.
(FRAME_CR_SURFACE_DESIRED_WIDTH, FRAME_CR_SURFACE_DESIRED_HEIGHT) [USE_CAIRO]:
New macros.
(x_cr_destroy_frame_context) [USE_CAIRO]: Rename from x_cr_destroy_surface.
All Uses changed. Don't use FRAME_CR_SURFACE. Make non-static.
(x_cr_update_surface_desired_size) [USE_CAIRO]: New function.
(x_begin_cr_clip) [USE_CAIRO]: Create Xlib surface if Xdbe is in use.
Use FRAME_CR_SURFACE_DESIRED_WIDTH and FRAME_CR_SURFACE_DESIRED_HEIGHT.
(x_end_cr_clip) [USE_CAIRO]: Call x_mark_frame_dirty if Xdbe is in use.
(x_cr_draw_frame, x_cr_export_frames) [USE_CAIRO]: Save and restore cairo
context instead of freeing and clearing it.
(x_update_begin) [USE_CAIRO]: Don't create cairo surface here.
(show_back_buffer) [USE_CAIRO]: Call cairo_surface_flush before swapping.
(x_update_end) [USE_CAIRO]: Don't copy image surface if Xdbe is in use.
Get image surface by cairo_get_target instead of FRAME_CR_SURFACE.
(x_scroll_run) [USE_CAIRO]: Use XCopyArea if Xdbe is in use.
(handle_one_xevent) [USE_CAIRO] <ConfigureNotify>: Call
x_cr_update_surface_desired_size instead of x_cr_destroy_surface.
(x_free_frame_resources) [USE_CAIRO]: Call x_cr_destroy_frame_context instead
of x_free_cr_resources.
* src/xfns.c (set_up_x_back_buffer, tear_down_x_back_buffer) [USE_CAIRO]:
Call x_cr_destroy_frame_context.
This is a different fix for bug#34909, which should also fix bug#35739.
Our downloading code used to automatically decode the result according
to the usual heuristics for files. This caused problems when we later
needed to save the data in a file that needed to be byte-for-byte
equal to the original in order to pass the signature verification,
especially because we didn't keep track of which coding-system was
used to decode the data.
(package--unless-error): New macro extracted from
package--with-response-buffer-1, so that we can specify edebug and
indent specs.
(package--with-response-buffer-1): Use it. More importantly, change
code so it runs `body` in a unibyte buffer with undecoded data.
(package--download-one-archive): Don't encode with utf-8 since the data
is not decoded yet.
(describe-package-1): Explicitly decode the readem.txt files here.
* lisp/url/url-handlers.el (url-insert-file-contents): Use it.
(url-insert): Don't decode if buffer is unibyte.
* lisp/url/url-http.el (url-http--insert-file-helper): New function,
extracted from url-insert-file-contents.
Prefer librsvg for display of splash.svg
When both librsvg and Imagemagick are available, Emacs should
prefer librsvg to render SVG images. However, Emacs was using
Imagemagick to render its own splash.svg file because
image-type-from-file-header returned nil for that file.
* lisp/image.el (image-type-from-buffer)
(image-type-from-file-header): Look at the first 8192 bytes of
the image, not just the first 256. For Emacs’s own splash.svg
file, image-type-header-regexps needs to look at 939 bytes.
8192 bytes is a reasonable number nowadays given typical file
system design.
* test/lisp/image-tests.el (image-tests--emacs-images-directory):
New contant.
(image-type-from-file-header-test): New test.
In the bug scenario, the second and subsequent noise macros with parentheses
were getting font-lock-type-face.
* lisp/progmodes/cc-engine.el (c-end-of-token)
(c-forward-noise-clause-not-macro-decl): New functions.
(c-find-decl-prefix-search): Handle noise macros by skipping over them.
(c-forward-decl-or-cast-1): In the loop checking for types, skip over all
consecutive noise macros with parens, not just one.
* src/image.c (initialize_image_type): Test if the type is in
Vlibrary_cache up front, and return true without calling the
'init' method if the type was already initialized.
* lisp/net/tramp-compat.el (format-spec): Do not require advice, cl-lib,
custom, password-cache, timer and ucs-normalize.
* lisp/net/tramp-gvfs.el: Do not require zeroconf. Declare
zeroconf-* functions.
(tramp-gvfs-enabled): Autoload `zeroconf-init'.
* lisp/net/tramp-sh.el: Do not require dired.
* lisp/net/tramp.el (tramp-get-debug-buffer): Do not require outline.
(tramp-file-name-for-operation): Extend docstring.
(tramp-parse-netrc): Do not require netrc. Autoload `netrc-parse'.
Allow non-file buffers to declare that notification on their
default-directory is sufficient to know when auto-revert updates are
required by setting the new variable `buffer-auto-revert-by-notification'
to non-nil. If nil, the default, then auto-revert will poll
those buffers instead. (bug#35418).
Currently, only Dired sets that variable.
* lisp/autorevert.el (auto-revert-buffers):
Modify condition for using notification.
* lisp/files.el (buffer-auto-revert-by-notification): New variable.
* lisp/dired.el (dired-mode): Set buffer-auto-revert-by-notification.
* doc/emacs/arevert-xtra.texi (Non-File Buffers): Document new variable.
* etc/NEWS (Changes in Specialized Modes and Packages): Describe new variable.
* lisp/international/mule.el (sgml-xml-auto-coding-function):
When the 'enncoding' tag specifies a UTF-16 encoding, enforce
saving the buffer with BOM, per the XML spec.
(xml-find-file-coding-system): Recognize UTF-16 encodings with
BOM. (Bug#35766) (Bug#8282)
* lisp/international/mule-cmds.el (select-safe-coding-system):
Don't consider UTF-16 encodings with and without BOM as
"different", so as not to annoy users with redundant questions
about mismatch between the XML/SGML header and the selected
explicit encoding.
* lisp/arc-mode.el (byte-after): Remove defsubst.
Replace all calls to byte-after with get-byte throughout the file,
because byte-after gave compilation warnings.
This also fixes an unlikely hang involving a circular image
description.
* src/dispextern.h (struct image.type): Now pointer-to-const.
* src/image.c (struct image_type.init) [!WINDOWSNT]: Omit.
(IMAGE_TYPE_INIT): New macro.
(image_types): Now a small array-of-const, not a pointer.
(CACHE_IMAGE_TYPE): Remove; the code’s simpler without it.
(ADD_IMAGE_TYPE): Remove this macro, replacing with ...
(add_image_type): ... this equivalent function. All uses changed.
(define_image_type): Remove. All uses removed.
(valid_image_p): Use FOR_EACH_TAIL_SAFE to avoid Emacs hanging
if the user creates a circular description of an image.
(xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
(gif_type, imagemagick_type, svg_type, gs_type):
Remove; now done by image_types.
(init_imagemagick_functions): Remove decl of nonexistent function.
(gs_clear_image): Remove; all uses replaced by image_clear_image.
(initialize_image_type): New function, which captures a lot
of the previously-scattered WINDOWSNT ifdefs.
(lookup_image_type): Use it.
(reset_image_types): Remove. All uses removed.
(syms_of_image): Don’t worry about ignoring image_types for
pdumper, since it’s a constant now.
The recent change to use lexical-binding introduced a bug because
gnus-summary-line-format-alist refers to variable `thread` which is now
lexical and hence not available there any more. Replace it with
a dynamically scoped var `gnus-tmp-thread` as was already done with
all other vars.
(gnus-summary-line-format-alist): Use it instead of `thread`.
(gnus-summary-prepare-threads): Bind it around call to (eval
gnus-summary-line-format-spec).
* lisp/select.el (gui-get-selection): Revert a recent
incorrect change. Add a comment explaining what we are trying
to do with C_STRING and why.
(xselect--encode-string): Add a comment explaining what we are
trying to do with C_STRING and why.
* lisp/imenu.el (imenu-example--create-c-index)
(imenu-example--function-name-regexp-c)
(imenu-example--create-lisp-index)
(imenu-example--lisp-extract-index-name): Remove functions (and
internal variables used by those functions) declared obsolete in
Emacs 23.2. The functions gave compilation warnings.
Use `mail-header-p` and `make-full-mail-header` instead of `vectorp` and
`vector`, respectively.
* lisp/gnus/message.el (message-cite-original-1, message-reply)
(message-followup):
* lisp/gnus/gnus-sum.el (gnus-get-newsgroup-headers):
Use make-full-mail-header instead of `vector`.
(gnus--dummy-mail-header): New const, using make-full-mail-header.
(gnus-update-summary-mark-positions): Use it instead of
an immediate vector.
(gnus-set-mode-line, gnus-summary-article-pseudo-p)
(gnus-summary-article-subject, gnus-summary-insert-subject)
(gnus-summary-find-subject, gnus-summary-goto-subject)
(gnus-summary-limit-to-age, gnus-summary-find-matching)
(gnus-summary-mark-article-as-unread, gnus-summary-mark-article)
(gnus-summary-save-article):
* lisp/gnus/gnus.el (gnus-news-group-p): Use mail-header-p instead
of vectorp.
* lisp/dired-aux.el (fileloop-continue): Declare to avoid
compilation warning. `fileloop-initialize-search' (used before
-continue) will load fileloop.el.
* lisp/w32-fns.el (w32-version, w32-read-registry): Declare these
functions to avoid byte compilation warnings. The functions
should be loaded when `w32--os-description' is called, as far as I
can tell.
* lisp/mouse.el (rectangle-dimensions)
(rectangle-position-as-coordinates, rectangle-intersect-p):
Declare these functions from rect.el to avoid compilation warnings.
This also has the side effect that the accessors are now defined as proper
functions rather than as macros, so they can be passed to `mapcar` etc..
* lisp/gnus/nnheader.el (mail-header-number, mail-header-subject)
(mail-header-from, mail-header-date, mail-header-id)
(mail-header-references, mail-header-chars, mail-header-lines)
(mail-header-xref, mail-header-extra): Define via cl-defstruct.
(mail-header-set-number, mail-header-set-subject)
(mail-header-set-from, mail-header-set-date, mail-header-set-id)
(mail-header-set-message-id, mail-header-set-references)
(mail-header-set-chars, mail-header-set-lines, mail-header-set-xref)
(mail-header-set-extra): Remove, use `setf` instead. All callers adjusted.
* lisp/gnus/gnus-sum.el (gnus-select-newsgroup)
(gnus-summary-pop-limit, gnus-summary-limit-mark-excluded-as-read)
(gnus-summary-find-matching, gnus-find-matching-articles):
* lisp/gnus/gnus-kill.el (gnus-apply-kill-file-internal, gnus-execute):
* lisp/gnus/gnus-score.el (gnus-score-adaptive):
Eta-reduce, now that mail-header-FIELD are functions.