* lisp/net/tramp.el (tramp-dissect-file-name): Check for proper method.
(tramp-file-name-for-operation): Take only 2nd argument into
account for file name handler.
(tramp-file-name-handler): Suppress checks for `file-remote-p'.
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test02-file-name-dissect): Suppress check for wrong
method.
* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Dump *all* Tramp buffers.
(tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate): Check also wrong method.
(tramp-test03-file-name-defaults): Check, that the respective
Tramp package is loaded.
(tramp-test04-substitute-in-file-name)
(tramp-test05-expand-file-name)
(tramp-test06-directory-file-name, tramp-test44-auto-load):
Suppress check for wrong method.
(tramp-test30-make-process): Remove instrumentation code.
(tramp-test31-interrupt-process, tramp-test36-vc-registered):
Guarantee that connection is established prior starting process.
Noam Postavsky [Sat, 25 May 2019 23:44:41 +0000 (19:44 -0400)]
Let untarring (and hence package installation) go faster (Bug#35909)
* lisp/subr.el (progress-reporter-update)
(progress-reporter-force-update, progress-reporter-do-update): Accept
new optional argument, SUFFIX.
* doc/lispref/display.texi (Progress): Document it.
* etc/NEWS: Announce it.
* lisp/tar-mode.el (tar-untar-buffer): Use a progress reporter instead
of calling message. Suppress message from write-region. Let-bind
write-region-inhibit-fsync to t.
Stefan Monnier [Mon, 3 Jun 2019 17:44:23 +0000 (13:44 -0400)]
* lisp/gnus/gnus-async.el: Use lexical-binding
Remove redundant :group args.
(gnus-async-post-fetch-function): Make it always be a function.
(gnus-make-async-article-function, gnus-async-prefetch-headers):
Use a closure rather than `(lambda ...)
the message seding is handled by an external program, so no Unicode
encoding is performed in Emacs. Thus Emacs must not assert that the
Unicode encoding was performed.
* lisp/gnus/gnus-sum.el (gnus-data-find-in): New function.
(gnus-data-find, gnus-data-find-list): Use it.
(gnus-summary-article-subject): Make it a function.
(gnus--dummy-data-list): New const.
(gnus-update-summary-mark-positions): Use it.
Glenn Morris [Sun, 2 Jun 2019 02:37:35 +0000 (19:37 -0700)]
Skip some flymake tests on hydra.nixos.org
* test/lisp/progmodes/flymake-tests.el (perl-backend)
(included-c-header-files, recurrent-backend):
Skip on hydra.nixos due to frequent intermittent failures. (Bug#32764)
Stefan Kangas [Sun, 2 Jun 2019 01:51:06 +0000 (18:51 -0700)]
Use lexical-binding in morse.el and studly.el and add tests
* lisp/play/morse.el: Use lexical-binding.
* lisp/play/studly.el: Use lexical-binding.
* test/lisp/play/morse-tests.el: New file.
* test/lisp/play/studly-tests.el: New file.
Stefan Kangas [Sun, 2 Jun 2019 01:47:14 +0000 (18:47 -0700)]
Use lexical-binding in paragraphs.el and add tests
* lisp/textmodes/paragraphs.el: Use lexical-binding.
(repunctuate-sentences): Make it work non-interactively.
* test/lisp/textmodes/paragraphs-tests.el: New file.
Noam Postavsky [Mon, 27 May 2019 00:17:38 +0000 (20:17 -0400)]
Handle argument to rcirc /part properly (Bug#11157)
* lisp/net/rcirc.el (part): Split out channel name and part reason.
* doc/misc/rcirc.texi (rcirc commands): Clarify that channel name may
be provided to /part.
Alan Mackenzie [Sat, 1 Jun 2019 20:15:13 +0000 (20:15 +0000)]
Debug and disentangle the literal cacheing in CC Mode
(Final Commit)
* lisp/progmodes/cc-engine.el (c-semi-trim-near-cache): Correct a comparison
with the wrong ...-limit variable.
(c-semi-pp-to-literal): Remove a wrong setting of c-lit-pos-cache-limit.
(c-full-get-near-cache-entry): Eliminate extravagant and unneeded coding.
(c-state-cache-init, c-record-parse-state-state): No longer manipulate
c-lit-pos-cache, which is no longer regarded as part of c-parse-state.
* lisp/progmodes/cc-mode.el (c-basic-common-init): Call
c-truncate-lit-pos-cache to initialize the literal cache.
* lisp/progmodes/cc-engine.el (c-semi-near-cache-limit): New variable.
(c-truncate-lit-pos-cache): This now truncates the cache variables for all
three lit- sub-caches.
(c-semi-put-near-cache-entry): Increase c-semi-near-cache-limit to the
position of the new entry.
(c-full-near-cache-limit, c-full-lit-near-cache): New variables.
(c-full-trim-near-cache, c-full-get-near-cache-entry)
(c-full-put-near-cache-entry): New functions.
(c-full-pp-to-literal): Amend to use the new functions, and to optimize the
use of the available caches, similarly to c-semi-pp-to-literal.
Glenn Morris [Sat, 1 Jun 2019 19:04:43 +0000 (12:04 -0700)]
Merge from origin/emacs-26
008b263 (origin/emacs-26, emacs-26) * lisp/gnus/gnus.el: Mark autoloa... daf32f1 Speed up redisplay of HELLO d8a6d82 Improve documentation of 'safe-local-variable' property
Glenn Morris [Sat, 1 Jun 2019 19:04:42 +0000 (12:04 -0700)]
Merge from origin/emacs-26
134edc1 Warn about wrong number of args for subrs (Bug#35767) 5f01af6 Use plain symbols for eieio type descriptors (Bug#29220) 4b24b01 Pacify GCC 9 -Wredundant-decls
Eli Zaretskii [Fri, 31 May 2019 09:13:56 +0000 (12:13 +0300)]
Unbreak MinGW64 build with pthreads.h installed
* nt/mingw-cfg.site (gl_cv_func_pthread_sigmask_macro): Set to
"no", to avoid compiling Gnulib's pthread_sigmask.c.
Reported by Richard Copley <rcopley@gmail.com>.
`url-insert-file-contents` saves in buffer-file-coding-system
the coding-system used to decode the contents. Preserve this
as the contents is moved from buffer to string to buffer, and use
it when saving the contents to file, so as to try and better preserve
the original byte sequence.
(package--buffer-string, package--cs): New functions.
(package--check-signature): Encode `string` if a coding-system
was specified in buffer-file-coding-system.
(package--download-one-archive, package-install-from-archive):
Obey and preserve the buffer-file-coding-system if specified.
Noam Postavsky [Mon, 27 May 2019 23:05:56 +0000 (19:05 -0400)]
Use plain symbols for eieio type descriptors (Bug#29220)
Since Emacs 26, eieio objects use a class record (with circular
references) as the type descriptor of the object record. This causes
problems when reading back an object from a string, because the class
record is not `eq' to the canonical one (which means that read objects
don't satisfy the foo-p predicate).
* lisp/emacs-lisp/eieio.el (make-instance): As a (partial) fix, set
the record's type descriptor to a plain symbol for the type descriptor
when eieio-backward-compatibility is non-nil (the default).
* lisp/emacs-lisp/eieio-core.el (eieio--object-class): Call
eieio--class-object on the type tag when eieio-backward-compatibility
is non-nil.
(eieio-object-p): Use eieio--object-class instead of
eieio--object-class-tag.
* test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
(eieio-test-persist-hash-and-vector)
(eieio-test-persist-interior-lists): Make into functions.
(eieio-persist-hash-and-vector-backward-compatibility)
(eieio-persist-hash-and-vector-no-backward-compatibility)
(eieio-test-persist-interior-lists-backward-compatibility)
(eieio-test-persist-interior-lists-no-backward-compatibility): New
tests which call them, eieio-backward-compatibility let-bound.
Paul Eggert [Thu, 30 May 2019 22:06:39 +0000 (15:06 -0700)]
Suppress GCC 9 “no longer supported” messages
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Remove -Wchkp.
This suppresses a boatload of warnings of the form
“gcc: warning: switch ‘-Wchkp’ is no longer supported”.
when using GCC 9. Do not merge to master.
Paul Eggert [Thu, 30 May 2019 22:06:39 +0000 (15:06 -0700)]
Pacify GCC 9 -Wredundant-decls
* src/gmalloc.c (_fraghead) [!HYBRID_MALLOC]:
Make it static in this case, too. This avoids having both
‘extern struct list _fraghead[];’ and
‘static struct list _fraghead[BLOCKLOG];’, which
GCC 9 complains about.
Alan Mackenzie [Thu, 30 May 2019 19:37:25 +0000 (19:37 +0000)]
Optimize one of CC Mode's syntax caches for long comments and strings.
* lisp/progmoes/cc-langs.el (c-block-comment-awkward-chars): New lang
constant and variable.
* lisp/progmodes/cc-engine.el (c-state-semi-nonlit-pos-cache): Enhance the
doc comment.
(c-state-semi-get-near-cache-entry, c-state-semi-pp-to-literal): Reuse entry
if the sought position is in a literal, and lies between the literal start and
the entry's position.
(c-cache-to-parse-ps-state, c-parse-ps-state-below): Amend such that instead
of cacheing a state for a position after a backslash or first character of a
2-character comment delimiter, this is done for the previous character
position.
Stefan Monnier [Wed, 29 May 2019 19:56:14 +0000 (15:56 -0400)]
* lisp/subr.el (add-hook): Turn `append` into `depth` (bug#35508)
Make it possible to control the relative ordering of functions on hooks by
specifying `depth` in the same was as was possible with `add-function`.
* lisp/electric.el (electric--sort-post-self-insertion-hook):
Delete function.
(electric-indent-mode, electric-layout-mode, electric-quote-mode):
* lisp/elec-pair.el (electric-pair-mode): Use new `depth` arg instead of
electric--sort-post-self-insertion-hook.
* lisp/emacs-lisp/syntax.el (syntax-propertize, syntax-ppss):
Use new `depth` arg to make sure noone accidentally gets added
after syntax-ppss-flush-cache.
* doc/lispref/modes.texi (Setting Hooks): Document new `depth` arg.
* test/lisp/subr-tests.el (subr-tests-add-hook-depth): New test.
* lisp/gnus/gnus-art.el: Make implicit seq.el dependency explicit.
(gnus-treat-predicate): Use seq-some in place of mapcar + gnus-or
and evaluate lambda predicate.
* lisp/gnus/gnus-util.el (gnus-or, gnus-and): Simplify.
Rework cairo image support to improve consistency (Bug#35871)
* src/dispextern.h (Emacs_Pix_Container) [USE_CAIRO]: New struct. Also used
as aliases of Emacs_Pixmap and Emacs_Pix_Context.
(x_kill_gs_process) [USE_CAIRO]: #ifdef out extern.
(RGB_PIXEL_COLOR) [USE_CAIRO]: Define as unsigned long.
* src/image.c: Include stdint.h. On cairo, remove existing image support
code, use non-X11-specific code for XBM/XPM, and remove POSTSCRIPT support.
(PUT_PIXEL): New macro. Use it instead of XPutPixel when not specific to X11.
(GET_PIXEL, NO_PIXMAP, PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, ARGB_TO_ULONG, RED_FROM_ULONG)
(GREEN_FROM_ULONG, BLUE_FROM_ULONG, RED16_FROM_ULONG)
(GREEN16_FROM_ULONG, BLUE16_FROM_ULONG) [USE_CAIRO]: New macros.
(image_create_pix_container, image_pix_container_put_pixel)
(image_pix_context_get_pixel, image_pix_container_create_from_bitmap_data)
(cr_create_cr_surface_from_image) [USE_CAIRO]: New functions.
(image_create_x_image_and_pixmap_1, image_destroy_x_image)
(image_check_image_size): Extract X11-specific code from here ...
(x_create_x_image_and_pixmap, x_destroy_x_image)
(x_check_image_size) [HAVE_X_WINDOWS]: ... to here.
(x_create_bitmap_mask) [HAVE_X_WINDOWS]: Use them. Inline specialized version
of four_corners_best.
(prepare_image_for_display, image_clear_image_1, image_destroy_x_image)
(gui_put_x_image, image_put_x_image, image_get_x_image, image_unget_x_image)
(Create_Pixmap_From_Bitmap_Data, lookup_rgb_color)
(image_to_emacs_colors) [USE_CAIRO]: Add cairo support.
(image_background, png_load_body) [USE_CAIRO]: Use image_alloc_image_color for
img->background.
(image_sync_to_pixmaps) [USE_CAIRO]: #ifdef out function.
(Create_Pixmap_From_Bitmap_Data) [HAVE_X_WINDOWS]: Move image_check_image_size
call from here ...
(xbm_load_image): ... to here.
(xpm_load_image):
(image_build_heuristic_mask, pbm_load, gif_load) [USE_CAIRO]: Use
lookup_rgb_color for argument of PUT_PIXEL.
(image_pixmap_draw_cross) [HAVE_X_WINDOWS || USE_CAIRO]: New function.
(image_disable_image) [HAVE_X_WINDOWS || USE_CAIRO]: Use it.
(CrossForeground) [!HAVE_NTGUI && !HAVE_NS]: New macro.
(image_disable_image) [!HAVE_NTGUI && !HAVE_NS]: Use it.
* src/xterm.c (handle_one_xevent) <ClientMessage> [USE_CAIRO]: #ifdef out
x_kill_gs_process call.
(x_free_pixmap) [USE_CAIRO]: Free Emacs_Pix_Container and data it contains.
Stefan Monnier [Tue, 28 May 2019 23:33:20 +0000 (19:33 -0400)]
* lisp/international/mule-cmds.el (encode-coding-char): Fix ASCII case
Don't bother with string-as-multibyte since `string` already returns
multibyte when needed. Don't forget to encode when the string is
ASCII, e.g. for ebcdic case and to make sure we always return
a unibyte string.
* test/lisp/international/mule-tests.el (mule-cmds-tests--encode-ebcdic):
New test.
Stefan Monnier [Tue, 28 May 2019 19:10:42 +0000 (15:10 -0400)]
* lisp/gnus/gnus-art.el: Use mail-header-p
(gnus-summary-save-in-pipe, gnus-article-prepare)
(gnus-request-article-this-buffer): Use mail-header-p instead of vectorp.
(gnus-request-article-this-buffer): Use insert-buffer-substring since
it doesn't behave like string-make-multibyte any more.
Eli Zaretskii [Tue, 28 May 2019 16:58:27 +0000 (19:58 +0300)]
Fix handling of -xrm on MS-Windows broken by recent commits
* src/w32reg.c (w32_get_string_resource): The argument V_RDB
is a 'char **', not a 'char *'. This fixes -xrm handling on
MS-Windows, broken by conversion of x_get_string_resource to
terminal-specific hook.
Stefan Monnier [Tue, 28 May 2019 13:05:25 +0000 (09:05 -0400)]
* lisp/frameset.el: Stop using obsolete registerv objects
(frameset-register): New type.
(register-val-jump-to): Define on this new type, replacing
frameset--jump-to-register.
(register-val-describe): Define on this new type, replacing
frameset--print-register.
(frameset-to-register): Use new frameset-make-register.
(frameset--reuse-frame): η-reduce.
Stefan Kangas [Sun, 26 May 2019 16:08:01 +0000 (18:08 +0200)]
Cleanup of TODO to prefer report-emacs-bug
* etc/TODO: Remove already completed removal of `report-calc-bug'.
* lisp/calc/calc.el: Remove any mention of `report-calc-bug'.
* lisp/epg-config.el: Redefine `epg-bug-report-address' as obsolete
variable alias for `report-emacs-bug-address'.
* lisp/expand.el: Remove any mention of `expand-submit-report'.
* lisp/obsolete/fast-lock.el: Remove commented out code for
`fast-lock-submit-bug-report'.
Support tool bar icon image also on GTK+2 with cairo
* src/gtkutil.c (xg_get_pixbuf_from_surface) [USE_CAIRO && !HAVE_GTK3]: New
function.
(xg_get_image_for_pixmap) [USE_CAIRO && !HAVE_GTK3]: Use it.
(xg_tool_item_stale_p, update_frame_tool_bar) [USE_CAIRO && !HAVE_GTK3]: Use
cairo code also on GTK+2.
Simen Heggestøyl [Mon, 27 May 2019 19:12:53 +0000 (21:12 +0200)]
Remap `complete-symbol' in CSS mode
* lisp/textmodes/css-mode.el (css-mode-map): Remap `complete-symbol'
to `completion-at-point'.
(css-mode): Update docstring to produce the right key binding.
Noam Postavsky [Mon, 27 May 2019 01:55:00 +0000 (21:55 -0400)]
; Fix read-multiple-choice test
* test/lisp/emacs-lisp/rmc-tests.el (test-read-multiple-choice):
Rebind read-event, read-multiple-choice uses that since 2019-05-26
"Avoid infloop in read-multiple-choice (Bug#32257)".
Noam Postavsky [Wed, 22 May 2019 00:33:09 +0000 (20:33 -0400)]
Avoid infloop in read-multiple-choice (Bug#32257)
* lisp/emacs-lisp/rmc.el (read-multiple-choice): When `read-char'
signals an error "Non-character input-event", call `read-event' to
take the non-character event out of the queue. Don't merge to master,
we just use `read-event' directly there, rather than this solution
which relies a particular error message.
Noam Postavsky [Wed, 22 May 2019 00:38:00 +0000 (20:38 -0400)]
Avoid infloop in read-multiple-choice (Bug#32257)
* lisp/emacs-lisp/rmc.el (read-multiple-choice): Use `read-event'
which won't get stuck (return the same event over and over again) for
non-character events, unlike `read-char'.
* test/lisp/tabify-tests.el (tabify-tests--test-changes): Rename
third argument to avoid "lexical argument shadows dynamic variable"
warnings. Use mapconcat in place of mapcar+concat.
(tabify-tests-untabify, tabify-tests-tabify): Quote function symbols
as such.
Paul Eggert [Sun, 26 May 2019 07:58:27 +0000 (00:58 -0700)]
Remove Maintainer: when it duplicates Author:
The convention is that a file with Author: but not Maintainer:
means the author is a maintainer, which makes it confusing
when a file lists the same person as author and maintainer.
Avoid the confusion by removing the duplicate Maintainer: line.
Paul Eggert [Sat, 25 May 2019 20:43:06 +0000 (13:43 -0700)]
Go back to "Maintainer: emacs-devel@gnu.org"
Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is
no special maintainer for a file. Although this wasn't documented
it was common practice and removing the lines didn't have consensus.