1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-17 10:06:13 +00:00
Commit Graph

2884 Commits

Author SHA1 Message Date
Glenn Morris
5a04e82614 Expect tramp environment test to fail on hydra
* test/lisp/net/tramp-tests.el (tramp-test32-environment-variables):
Expect failure on hydra.nixos.org.
2018-12-18 08:29:05 -08:00
Glenn Morris
5486a46d3e A filenotify test now passes on hydra
* test/lisp/filenotify-tests.el (file-notify-test04-autorevert):
Remote test now passes on hydra.nixos.org, since PATH
workaround for bug#33781.
2018-12-18 08:25:55 -08:00
Michael Albinus
710e79a6c5 Fix Bug#33781
* lisp/net/tramp-cache.el (tramp-connection-properties):
* lisp/net/tramp-sh.el (tramp-remote-path)
(tramp-remote-process-environment, tramp-sh-extra-args):
Reinsert autoload cookie.  (Bug#33781)

* test/lisp/net/tramp-tests.el: Do not require tramp-sh before
changing tramp-remote-path.
2018-12-18 13:58:00 +01:00
Nicolas Petton
5a9eba603d
New convenience functions in seq.el
Functions to access the first or all but the first elements of
sequences have been repeatedly asked for (the last occurrence being
https://github.com/NicolasPetton/seq.el/issues/9).

* lisp/emacs-lisp/seq.el (seq-first, seq-rest): New functions.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-first, test-seq-rest):
New tests for seq-first and seq-rest.
2018-12-18 09:42:50 +01:00
Stefan Monnier
55838e4e6a * lisp/emacs-lisp/map.el: Avoid special casing lists.
(map-not-inplace, map-inplace): New errors.
(map-insert): New generic function.
(map-put!): Signal map-not-inplace rather than a generic 'error'.
(map-elt): Use map-not-inplace and map-insert to avoid hardcoding
a special case for lists.

* test/lisp/emacs-lisp/map-tests.el (test-map-put!): Rename from
test-map-put.  Also test the errors signaled.
2018-12-17 14:51:01 -05:00
Glenn Morris
2c3f7f9c45 Avoid tests failures on hydra due to Tramp autoload changes
* test/lisp/filenotify-tests.el, test/lisp/shadowfile-tests.el:
* test/lisp/net/tramp-tests.el: Require tramp-sh before changing
tramp-remote-path.
2018-12-17 13:52:46 -05:00
Paul Eggert
3621593616 One more flatten-tree test
* test/lisp/subr-tests.el (subr-tests-flatten-tree):
Add a test for lots of nothing.
2018-12-17 10:26:15 -08:00
Alex Branham
36b05dc842 New function flatten-tree
Co-authored-by: Basil L. Contovounesios <contovob@tcd.ie>

* doc/lispref/lists.texi: Document `flatten-tree'.

* lisp/progmodes/js.el (js--maybe-join):
* lisp/printing.el (pr-switches):
* lisp/lpr.el (lpr-print-region):
* lisp/gnus/nnimap.el (nnimap-find-wanted-parts):
* lisp/gnus/message.el (message-talkative-question):
* lisp/gnus/gnus-sum.el (gnus-remove-thread)
(gnus-thread-highest-number, gnus-thread-latest-date):
* lisp/eshell/esh-util.el (eshell-flatten-and-stringify):
* lisp/eshell/esh-opt.el (eshell-eval-using-options):
* lisp/eshell/esh-ext.el (eshell-external-command):
* lisp/eshell/em-xtra.el (eshell/expr):
* lisp/eshell/em-unix.el (eshell/rm, eshell-mvcpln-template)
(eshell/cat, eshell/make, eshell-poor-mans-grep, eshell-grep)
(eshell/du, eshell/time, eshell/diff, eshell/locate):
* lisp/eshell/em-tramp.el (eshell/su, eshell/sudo):
* lisp/eshell/em-term.el (eshell-exec-visual):
* lisp/eshell/em-dirs.el (eshell-dirs-substitute-cd, eshell/cd):
* lisp/eshell/em-basic.el (eshell/printnl):
Use new flatten-tree.

* lisp/progmodes/js.el (js--flatten-list):
* lisp/lpr.el (lpr-flatten-list):
* lisp/gnus/message.el (message-flatten-list):
* lisp/eshell/esh-util.el (eshell-flatten-list):
Obsolete in favor of Emacs-wide `flatten-tree'.

* lisp/subr.el (flatten-list): Alias to `flatten-tree' for
discoverability.

* lisp/subr.el (flatten-tree): New defun.

* test/lisp/subr-tests.el (subr-tests-flatten-tree): New test.
2018-12-17 12:15:09 +01:00
Michael Albinus
3e9ecaec3b Reduce autoloaded objects in Tramp
* lisp/net/tramp-adb.el (tramp-adb-program)
(tramp-adb-connect-if-not-connected, tramp-adb-prompt):
Remove autoload cookie.

* lisp/net/tramp-cache.el (tramp-connection-properties)
(tramp-persistency-file-name): Remove autoload cookie.

* lisp/net/tramp-ftp.el (tramp-ftp-enable-ange-ftp):
Use `tramp-autoload' cookie.

* lisp/net/tramp-gvfs.el (tramp-gvfs-zeroconf-domain):
Remove autoload cookie.

* lisp/net/tramp-rclone.el (tramp-rclone-program): Remove autoload
cookie.
(tramp-set-completion-function): Use `tramp--with-startup'.

* lisp/net/tramp-sh.el (tramp-inline-compress-start-size)
(tramp-copy-size-limit, tramp-histfile-override)
(tramp-use-ssh-controlmaster-options, tramp-remote-path)
(tramp-remote-process-environment, tramp-sh-extra-args):
Remove autoload cookie.
(tramp-stat-marker, tramp-stat-quoted-marker): Move to tramp.el.

* lisp/net/tramp-smb.el (tramp-smb-program)
(tramp-smb-acl-program, tramp-smb-conf)
(tramp-smb-winexe-program, tramp-smb-winexe-shell-command)
(tramp-smb-winexe-shell-command-switch): Remove autoload cookie.

* lisp/net/tramp-sudoedit.el (server, tramp-sh): Do not require.

* lisp/net/tramp.el (tramp--startup-hook): Define.
(tramp-stat-marker, tramp-stat-quoted-marker): New defconsts,
taken from tramp-sh.el.

* test/lisp/net/tramp-archive-tests.el (tramp-copy-size-limit)
(tramp-persistency-file-name): Declare.

* test/lisp/net/tramp-tests.el (tramp-connection-properties)
(tramp-display-escape-sequence-regexp)
(tramp-inline-compress-start-size, tramp-remote-path): Declare.
2018-12-17 11:50:06 +01:00
Michael Albinus
e8199e765f Add Tramp sudoedit method
* doc/misc/tramp.texi (Quick Start Guide): New section "Using sudoedit".
(External methods) <sudoedit>: Describe.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist)
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Add handler.

* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-uid-gid): Rename from
`tramp-sh-handle-set-file-uid-gid'.  Handle only remote file names.

* lisp/net/tramp-sudoedit.el: New file.

* lisp/net/tramp.el (tramp-file-name-for-operation): Handle also
`tramp-set-file-uid-gid'.
(tramp-set-file-uid-gid): New defun.
(tramp-get-local-uid, tramp-get-local-gid): Cache result.

* test/lisp/net/tramp-tests.el (tramp--test-sudoedit-p): New defun.
(tramp-test20-file-modes, tramp-test22-file-times)
(tramp--test-sudoedit-p): Use it.
2018-12-16 15:49:07 +01:00
Glenn Morris
61dbe6bab1 Expect two epg tests to fail on hydra
* test/lisp/epg-tests.el (epg-decrypt-1, epg-roundtrip-1):
These currently fail for unknown reasons on hydra.nixos.org.
2018-12-15 18:17:01 -08:00
Glenn Morris
2e2fb82e5f Merge from origin/emacs-26
fa953b5 (origin/emacs-26) Fix an epg test for recent GnuPG versions (...
3015636 Document font structure layout constraints
f14d574 Document font structure layout constraints
f519aa1 Fix display of line numbers in empty lines beyond EOB
24b5026 Fix redisplay when a window's scroll bar or fringes are changed
5d1b158 Tiny markup fix in Elisp manual
2018-12-15 15:19:25 -08:00
Glenn Morris
498b6cb0bf Ensure flymake tests use gcc rather than $CC
* test/lisp/progmodes/flymake-resources/Makefile: Force use of gcc.
This seems to be what the tests expect.  (Bug#33735)
2018-12-15 15:08:28 -08:00
Glenn Morris
aca60820e1 Suppress filenotify remote test failures on hydra.nixos.org
* test/lisp/filenotify-tests.el (file-notify--deftest-remote):
Add optional argument to pass expected-result.
(file-notify-test04-autorevert-remote)
(file-notify-test08-backup-remote): Expect failure on hydra (bug#33735).
2018-12-15 15:04:24 -08:00
Glenn Morris
34b4da377a Fix an eshell ls dired test for non-recent files
* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844):
Work around an eshell issue with non-recent files.  (Bug#33734)
2018-12-15 14:49:46 -08:00
Glenn Morris
fa953b58af Fix an epg test for recent GnuPG versions (bug#33439)
* test/lisp/epg-tests.el (epg-decrypt-1):
Tell recent GnuPG (e.g. 2.2.11) not to worry about missing MDC.
2018-12-14 20:09:02 -05:00
Glenn Morris
d72b69650e * test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844): Remove debug. 2018-12-13 21:02:15 -05:00
Stephen Leake
d4fb269070 Get long package description for installed packages from installed files
* doc/lispref/package.texi (Archive Web Server): New; document web
server interface.

* lisp/emacs-lisp/package.el (package--get-description): New; get long
description from installed files.
(describe-package-1): Use it, improve comments. No longer writing
NAME-readme.txt.

* test/lisp/emacs-lisp/package-tests.el:
(package-test-describe-package): There is now a description for an
installed package.
(package-test-describe-installed-multi-file-package): New test.
2018-12-13 14:45:05 -08:00
Glenn Morris
ef922e774a * test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844): Add debug. 2018-12-13 13:41:19 -05:00
Glenn Morris
f318300959 Improve em-ls-test-bug27844
* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844):
Skip if source-directory absent.
2018-12-12 17:01:06 -05:00
Eli Zaretskii
6e76e11c42 Fix regression in expand-file-name with drive-relative HOME
* src/fileio.c (get_homedir) [DOS_NT]: Expand drive-relative
$HOME to begin with "X:/".

* test/src/fileio-tests.el (fileio-tests--relative-HOME): Add
testing of drive-relative value of $HOME on MS-Windows and
MS-DOS.
2018-12-12 18:27:05 +02:00
Michael Albinus
8c28ac8023 Fix Bug#33568
* test/lisp/net/secrets-tests.el (secrets-test02-collections)
(secrets-test03-items): Do not expect "login" collection to
exist.  (Bug#33568)
2018-12-12 10:49:59 +01:00
Glenn Morris
7f95e1aec3 Add test/Makefile machinery to exclude test .el files
* test/Makefile.in (EXCLUDE_TESTS): New variable.
(ELFILES): Filter out any specified exclude files.
2018-12-10 20:40:16 -05:00
Nobuyoshi Nakada
3729a3f88f Support Ruby block arguments ending with , or *
* lisp/progmodes/ruby-mode.el (ruby-smie--forward-token):
Recognize punctuation before "closing-|" as a separate token.
(ruby-smie--backward-token): Same (bug#33487).

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-forward-sexp-jumps-do-end-block-with-no-args)
(ruby-backward-sexp-jumps-do-end-block-with-no-args)
(ruby-forward-sexp-jumps-do-end-block-with-empty-args)
(ruby-backward-sexp-jumps-do-end-block-with-empty-args)
(ruby-forward-sexp-jumps-do-end-block-with-args)
(ruby-backward-sexp-jumps-do-end-block-with-args)
(ruby-forward-sexp-jumps-do-end-block-with-any-args)
(ruby-forward-sexp-jumps-do-end-block-with-expanded-one-arg)
(ruby-forward-sexp-jumps-do-end-block-with-one-and-any-args)
(ruby-backward-sexp-jumps-do-end-block-with-one-and-any-args):
New tests.
2018-12-11 03:14:35 +02:00
Glenn Morris
87bc518afc * test/lisp/eshell/eshell-tests.el (with-temp-eshell):
Avoid permanently changing HISTFILE.
2018-12-09 15:56:48 -08:00
Michael Albinus
38f2b58271 * test/lisp/net/tramp-tests.el (tramp-test03-file-name-host-rules):
Use proper error symbol.
2018-12-09 17:09:53 +01:00
Eli Zaretskii
c2fdd50c3c Fix resolving symlinks in Eshell history file names
* lisp/eshell/em-dirs.el (eshell-write-last-dir-ring):
* lisp/eshell/em-hist.el (eshell-write-history): Don't call
file-truename with argument of nil.  (Bug#33477)

* test/lisp/eshell/eshell-tests.el (with-temp-eshell): Remove
HISTFILE from the environment, to make sure the Eshell history
file is nil.
2018-12-09 09:45:40 +02:00
Michael Albinus
7d33c775b2 Add missing handler to tramp-rclone.el, improve robustness
* lisp/net/tramp-rclone.el (tramp-adb): Require.
(tramp-rclone-file-name-handler-alist):
Use `tramp-adb-handle-expand-file-name'.
(tramp-rclone-flush-directory-cache): New defun, derived from
`tramp-rclone-flush-mount'.
(tramp-rclone-do-copy-or-rename-file)
(tramp-rclone-handle-delete-directory)
(tramp-rclone-handle-delete-file)
(tramp-rclone-handle-make-directory): Use it.
(tramp-rclone-handle-directory-files)
(tramp-rclone-local-file-name):
Use `tramp-compat-file-name-quoted-p', 	`tramp-compat-file-name-quote'
and ´tramp-compat-file-name-unquote'.
(tramp-rclone-handle-file-executable-p)
(tramp-rclone-handle-file-readable-p): Cache result.
(tramp-rclone-handle-file-name-all-completions)
(tramp-rclone-mounted-p, tramp-rclone-remote-file-name)
(tramp-rclone-maybe-open-connection): Rewrite.

* test/lisp/net/tramp-tests.el (tramp--test-rclone-p): New defun.
(tramp-test05-expand-file-name-relative)
(tramp--test-special-characters): Use it.
2018-12-06 16:11:27 +01:00
Michael Albinus
8f3fde3884 Make stronger tests for Tramp multi hops
* lisp/net/tramp.el (tramp-dissect-file-name, tramp-dissect-hop-name):
Check, that method is capable of multi hops.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate): Suppress check for multihops.
(tramp-test03-file-name-method-rules): Check for error if multi
hops cannot be applied.
2018-12-06 15:25:22 +01:00
Glenn Morris
8e28aee664 Skip an autorevert test on hydra.nixos.org (bug#32645)
* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Skip on hydra.
2018-12-04 12:54:01 -05:00
Stefan Monnier
eaeeece92d * lisp/shell.el (shell--parse-pcomplete-arguments): Stop at semi-colon
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
New corresponding test.
2018-12-04 12:39:47 -05:00
Michael Heerdegen
1808d254a5 Replace insignificant backquotes
Replace most insignificant occurrences of '`' with a straight quote,
sharp quote or nothing.  This includes backquotes in 'pcase' patterns.

* admin/admin.el:
* lisp/apropos.el:
* lisp/arc-mode.el:
* lisp/auth-source.el:
* lisp/avoid.el:
* lisp/bindings.el:
* lisp/bs.el:
* lisp/calculator.el:
* lisp/calendar/todo-mode.el:
* lisp/cedet/semantic.el:
* lisp/cedet/semantic/analyze/debug.el:
* lisp/cedet/semantic/bovine.el:
* lisp/cedet/semantic/dep.el:
* lisp/cedet/semantic/grammar.el:
* lisp/cedet/semantic/wisent/comp.el:
* lisp/cedet/semantic/wisent/grammar.el:
* lisp/cedet/srecode/mode.el:
* lisp/cus-edit.el:
* lisp/doc-view.el:
* lisp/elec-pair.el:
* lisp/electric.el:
* lisp/emacs-lisp/autoload.el:
* lisp/emacs-lisp/benchmark.el:
* lisp/emacs-lisp/byte-opt.el:
* lisp/emacs-lisp/bytecomp.el:
* lisp/emacs-lisp/cconv.el:
* lisp/emacs-lisp/cl-extra.el:
* lisp/emacs-lisp/cl-generic.el:
* lisp/emacs-lisp/cl-macs.el:
* lisp/emacs-lisp/copyright.el:
* lisp/emacs-lisp/debug.el:
* lisp/emacs-lisp/eieio-compat.el:
* lisp/emacs-lisp/ert.el:
* lisp/emacs-lisp/generator.el:
* lisp/emacs-lisp/inline.el:
* lisp/emacs-lisp/macroexp.el:
* lisp/emacs-lisp/map.el:
* lisp/emacs-lisp/package-x.el:
* lisp/emacs-lisp/package.el:
* lisp/emacs-lisp/radix-tree.el:
* lisp/emacs-lisp/smie.el:
* lisp/epa.el:
* lisp/erc/erc-dcc.el:
* lisp/erc/erc-track.el:
* lisp/erc/erc.el:
* lisp/eshell/em-ls.el:
* lisp/eshell/esh-cmd.el:
* lisp/files.el:
* lisp/filesets.el:
* lisp/font-lock.el:
* lisp/frameset.el:
* lisp/gnus/gnus-agent.el:
* lisp/gnus/gnus-art.el:
* lisp/gnus/gnus-cite.el:
* lisp/gnus/gnus-group.el:
* lisp/gnus/gnus-msg.el:
* lisp/gnus/gnus-salt.el:
* lisp/gnus/gnus-srvr.el:
* lisp/gnus/gnus-sum.el:
* lisp/gnus/gnus-topic.el:
* lisp/gnus/gnus-util.el:
* lisp/gnus/gnus.el:
* lisp/gnus/message.el:
* lisp/gnus/mm-util.el:
* lisp/gnus/mml.el:
* lisp/gnus/nnheader.el:
* lisp/gnus/nnimap.el:
* lisp/gnus/nnmairix.el:
* lisp/gnus/spam.el:
* lisp/hexl.el:
* lisp/hi-lock.el:
* lisp/ibuf-ext.el:
* lisp/ibuffer.el:
* lisp/ido.el:
* lisp/info.el:
* lisp/international/mule-cmds.el:
* lisp/international/mule-util.el:
* lisp/json.el:
* lisp/jsonrpc.el:
* lisp/language/cyrillic.el:
* lisp/language/european.el:
* lisp/language/georgian.el:
* lisp/language/tibetan.el:
* lisp/language/utf-8-lang.el:
* lisp/language/vietnamese.el:
* lisp/ldefs-boot.el:
* lisp/mail/mail-extr.el:
* lisp/man.el:
* lisp/menu-bar.el:
* lisp/mh-e/mh-acros.el:
* lisp/mh-e/mh-folder.el:
* lisp/mh-e/mh-mime.el:
* lisp/mh-e/mh-show.el:
* lisp/mh-e/mh-speed.el:
* lisp/minibuffer.el:
* lisp/mpc.el:
* lisp/net/ange-ftp.el:
* lisp/net/hmac-def.el:
* lisp/net/newst-backend.el:
* lisp/net/quickurl.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-compat.el:
* lisp/notifications.el:
* lisp/obsolete/pgg-parse.el:
* lisp/obsolete/vc-arch.el:
* lisp/obsolete/xesam.el:
* lisp/org/ob-C.el:
* lisp/org/ob-core.el:
* lisp/org/ob-exp.el:
* lisp/org/ob-groovy.el:
* lisp/org/ob-haskell.el:
* lisp/org/ob-io.el:
* lisp/org/ob-lisp.el:
* lisp/org/ob-lob.el:
* lisp/org/ob-lua.el:
* lisp/org/ob-octave.el:
* lisp/org/ob-perl.el:
* lisp/org/ob-python.el:
* lisp/org/ob-ref.el:
* lisp/org/ob-ruby.el:
* lisp/org/ob-sql.el:
* lisp/org/org-agenda.el:
* lisp/org/org-capture.el:
* lisp/org/org-clock.el:
* lisp/org/org-colview.el:
* lisp/org/org-duration.el:
* lisp/org/org-element.el:
* lisp/org/org-entities.el:
* lisp/org/org-gnus.el:
* lisp/org/org-indent.el:
* lisp/org/org-info.el:
* lisp/org/org-inlinetask.el:
* lisp/org/org-lint.el:
* lisp/org/org-list.el:
* lisp/org/org-mouse.el:
* lisp/org/org-plot.el:
* lisp/org/org-src.el:
* lisp/org/org-table.el:
* lisp/org/org.el:
* lisp/org/ox-ascii.el:
* lisp/org/ox-html.el:
* lisp/org/ox-latex.el:
* lisp/org/ox-man.el:
* lisp/org/ox-md.el:
* lisp/org/ox-org.el:
* lisp/org/ox-publish.el:
* lisp/org/ox-texinfo.el:
* lisp/org/ox.el:
* lisp/play/bubbles.el:
* lisp/play/gamegrid.el:
* lisp/progmodes/autoconf.el:
* lisp/progmodes/cc-defs.el:
* lisp/progmodes/cc-engine.el:
* lisp/progmodes/cc-fonts.el:
* lisp/progmodes/cc-langs.el:
* lisp/progmodes/cperl-mode.el:
* lisp/progmodes/ebrowse.el:
* lisp/progmodes/elisp-mode.el:
* lisp/progmodes/flymake-cc.el:
* lisp/progmodes/flymake.el:
* lisp/progmodes/fortran.el:
* lisp/progmodes/grep.el:
* lisp/progmodes/gud.el:
* lisp/progmodes/idlwave.el:
* lisp/progmodes/js.el:
* lisp/progmodes/m4-mode.el:
* lisp/progmodes/make-mode.el:
* lisp/progmodes/mixal-mode.el:
* lisp/progmodes/modula2.el:
* lisp/progmodes/octave.el:
* lisp/progmodes/opascal.el:
* lisp/progmodes/prolog.el:
* lisp/progmodes/ps-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/ruby-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/progmodes/sql.el:
* lisp/progmodes/verilog-mode.el:
* lisp/ps-mule.el:
* lisp/rtree.el:
* lisp/ruler-mode.el:
* lisp/ses.el:
* lisp/simple.el:
* lisp/startup.el:
* lisp/subr.el:
* lisp/term/ns-win.el:
* lisp/textmodes/bibtex.el:
* lisp/textmodes/conf-mode.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/refill.el:
* lisp/textmodes/sgml-mode.el:
* lisp/textmodes/tex-mode.el:
* lisp/tutorial.el:
* lisp/url/url-dav.el:
* lisp/url/url-gw.el:
* lisp/url/url-http.el:
* lisp/url/url-methods.el:
* lisp/url/url-privacy.el:
* lisp/vc/cvs-status.el:
* lisp/vc/diff-mode.el:
* lisp/vc/ediff-init.el:
* lisp/vc/ediff-ptch.el:
* lisp/vc/log-edit.el:
* lisp/vc/log-view.el:
* lisp/vc/pcvs-info.el:
* lisp/vc/pcvs.el:
* lisp/vc/smerge-mode.el:
* lisp/vc/vc-git.el:
* lisp/vc/vc-hg.el:
* lisp/vc/vc-mtn.el:
* lisp/vc/vc-rcs.el:
* lisp/whitespace.el:
* lisp/window.el:
* test/lisp/electric-tests.el:
* test/lisp/emacs-lisp/cl-lib-tests.el:
* test/lisp/emacs-lisp/ert-tests.el:
* test/lisp/epg-tests.el:
* test/lisp/jsonrpc-tests.el:
* test/src/data-tests.el:
* test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-25 21:08:08 +01:00
Glenn Morris
166f1400b4 Merge from origin/emacs-26
edcd6b7 Small documentation correction.
168a8c2 * src/coding.c (Fcheck_coding_systems_region): Doc fix.  (Bug...
3287a7c Fix Bug#33364
acee0a8 ; Cosmetic changes in etc/NEWS
a6ef167 * test/README: Explain $REMOTE_TEMPORARY_FILE_DIRECTORY.

# Conflicts:
#	etc/NEWS
2018-11-16 08:30:19 -08:00
Paul Eggert
900276502f Act like POSIX sh if $HOME is relative
POSIX says sh ~/foo should act like $HOME/foo even if $HOME is
relative, so be consistent with that (Bug#33255).
* admin/merge-gnulib (GNULIB_MODULES): Add dosname.
* src/buffer.c (init_buffer): Use emacs_wd to get
initial working directory with slash appended if needed.
(default-directory): Say it must be absolute.
* src/emacs.c (emacs_wd): New global variable.
(init_cmdargs): Dir arg is now char const *.
(main): Set emacs_wd.
* src/emacs.c (main) [NS_IMPL_COCOA]:
* src/fileio.c (Fexpand_file_name):
Use get_homedir instead of egetenv ("HOME").
* src/fileio.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
(splice_dir_file, get_homedir): New functions.
* src/xrdb.c (gethomedir): Remove.  All callers changed
to use get_homedir and splice_dir_file.
* test/src/fileio-tests.el (fileio-tests--relative-HOME): New test.
2018-11-13 09:32:50 -08:00
Michael Albinus
a6ef167b8d * test/README: Explain $REMOTE_TEMPORARY_FILE_DIRECTORY. 2018-11-13 09:44:06 +01:00
Glenn Morris
a004d3bbba ; * test/src/editfns-tests.el (test-group-name): Ignore getent errors. 2018-11-10 19:15:59 -08:00
Glenn Morris
c30f24d03d * test/src/editfns-tests.el (test-group-name): Improve test.
Make more portable and hopefully more robust using getent.  (Bug#33195)
2018-11-10 19:13:20 -08:00
Glenn Morris
663613a1c0 * test/src/editfns-tests.el (test-group-name): Small fix.
Do not assume user 1000 has group name = user name.
2018-11-10 10:37:47 -08:00
Allen Li
5578112e18 Add 'ring-resize' function
* lisp/emacs-lisp/ring.el (ring-resize): New function.  (Bug#32849)
* doc/lispref/sequences.texi (Rings): Document new function 'ring-resize'.
* etc/NEWS: Document new function 'ring-resize'.
* test/lisp/emacs-lisp/ring-tests.el (ring-test-ring-resize): New tests.
2018-11-10 11:41:51 +02:00
Eli Zaretskii
d6b7b60cd0 Fix last change
* src/editfns.c (Fgroup_name): Fix the doc string.  Move
closer to the "group" functions.
* src/w32.c (getgrgid): Return NULL if GID is not the group ID
of the user of this Emacs session

* test/src/editfns-tests.el (test-group-name): Rename from
'group-name'.  Add tests for non-Posix hosts.  Test error when
the argument to group-name is invalid.

* etc/NEWS: Fix wording of last added entry.
2018-11-10 11:16:17 +02:00
Jules Tamagnan
ffb4c76d99 src/editfns.c (group-name): New function. 2018-11-10 10:06:50 +02:00
Michael Albinus
3abe7bfe30 Handle also port and domain in Tramp proxy definitions
* doc/misc/tramp.texi (Multi-hops): Exclude ports and domains from
pattern expansion.

* lisp/net/tramp-cmds.el (tramp-cleanup-all-connections):
Remove ad-hoc proxies.

* lisp/net/tramp-sh.el (tramp-compute-multi-hops): Handle also
port and domain in the proxy.  Propertize ad-hoc proxies.

* lisp/net/tramp.el (tramp-default-proxies-alist): Adapt docstring.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate): Extend tests.
2018-11-06 15:48:05 +01:00
Gemini Lasswell
c3cf85b1c1 Add regression test for Bug#33014
Backport from master.
* test/src/eval-tests.el:
(eval-tests-byte-code-being-evaluated-is-protected-from-gc): New test.
(eval-tests-33014-var): New variable.
(eval-tests-33014-func, eval-tests-33014-redefine): New functions.
2018-10-30 21:17:34 -07:00
Michael Heerdegen
049bd5d267 Don't quote self-quoting pcase patterns
* admin/bzrmerge.el:
* lisp/char-fold.el:
* lisp/dired.el:
* lisp/emacs-lisp/derived.el:
* lisp/emacs-lisp/easy-mmode.el:
* lisp/emacs-lisp/easymenu.el:
* lisp/emacs-lisp/eieio-core.el:
* lisp/emacs-lisp/package.el:
* lisp/emacs-lisp/smie.el:
* lisp/faces.el:
* lisp/filesets.el:
* lisp/progmodes/modula2.el:
* lisp/progmodes/octave.el:
* lisp/progmodes/opascal.el:
* lisp/progmodes/perl-mode.el:
* lisp/progmodes/prolog.el:
* lisp/progmodes/ruby-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/server.el:
* lisp/subr.el:
* lisp/textmodes/css-mode.el:
* test/lisp/emacs-lisp/pcase-tests.el: Don't quote self-quoting
'pcase' patterns.
2018-10-30 16:17:45 +01:00
Gemini Lasswell
0e484c66fd Keep a stack reference to bytecode objects being executed (Bug#33014)
* src/eval.c (Ffuncall): Make local variable 'fun' volatile.
* test/src/eval-tests.el
(eval-tests-byte-code-being-evaluated-is-protected-from-gc):
Add regression test for Bug#33014.
(eval-tests-33014-var): New variable.
(eval-tests-33014-func, eval-tests-33014-redefine): New functions.
2018-10-29 11:05:00 -07:00
Paul Eggert
a381285617 Improve rounding in recent timer fix
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Use more-precise arithmetic to handle some boundary cases better
when rounding errors occur (Bug#33071).
* test/lisp/emacs-lisp/timer-tests.el:
(timer-next-integral-multiple-of-time-3):
New test, to test one of the boundary cases.
(timer-next-integral-multiple-of-time-2):
Redo so as to not assume a particular way of rounding 0.01.
2018-10-22 19:34:49 -07:00
Michael Albinus
67d3b40e0c Expand host names in Tramp's ad-hoc multi-hop file names
* doc/misc/tramp.texi (Quick Start Guide): Improve wording.
(Change file name syntax): Say, that `tramp-file-name-regexp' is
not constant.
(Ad-hoc multi-hops): Explain host name expansion.

* etc/NEWS: Mention that host names in Tramp ad-hoc multi-hop file
names must match the previous hop for methods like "su" or "sudo".
Fix typos.

* lisp/net/tramp.el (tramp-find-method, tramp-find-user):
Adapt docstring.
(tramp-find-host): Mark default value.
(tramp-dissect-file-name): Expand host name for hops.
(tramp-dissect-hop-name, tramp-make-tramp-hop-name): New defuns.
(tramp-clear-passwd): Simplify.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate)
(tramp-test26-file-name-completion): Extend tests.
2018-10-20 13:38:31 +02:00
Eli Zaretskii
efb214622a Fix 'timer-next-integral-multiple-of-time'
* lisp/emacs-lisp/timer.el
(timer-next-integral-multiple-of-time): Fix recent change for
fractional values of SECS.  (Bug#33071)
* test/lisp/emacs-lisp/timer-tests.el
(timer-next-integral-multiple-of-time-2): New test.
2018-10-20 12:52:52 +03:00
Eli Zaretskii
7356743232 Avoid assertion violation when comparing with main-thread
* src/thread.c (unmark_main_thread): New function.
* src/lisp.h (unmark_main_thread): Prototype it.
* src/alloc.c (garbage_collect_1): Call it after sweeping.
(Bug#33073)

* test/src/thread-tests.el (threads-test-bug33073): New test.
2018-10-17 18:19:47 +03:00
Stefan Monnier
8c68e4afa8 * src/buffer.c (Fmove_overlay): Don't call Fdelete_overlay
... because the data structure is not in a consistent state.

* test/src/buffer-tests.el (overlay-evaporation-after-killed-buffer):
New test.
2018-10-14 16:44:21 -04:00
Eli Zaretskii
95f69e7db2 Improve 'json-insert' so it doesn't cons a string from JSON
* src/json.c (struct json_buffer_and_size): New member
inserted_bytes.
(json_insert): Instead of creating a string and inserting it
into the current buffer, copy the unibyte text into the gap.
(struct json_insert_data): New member inserted_bytes.
(json_insert_callback): Update commentary.  Pass the
inserted_bytes value to json_insert and on its return copy the
updated value back into DATA.
(Fjson_insert): Decode the unibyte text inserted into the gap.
Call before-change-functions and after-change-functions only
once, before and after processing the insertion of the entire
JSON representation.

* test/src/json-tests.el (json-insert/throw): Adapt to the
modified implementation of json-insert: it no longer calls the
modification hooks once for each inserted chunk of JSON
representation.
2018-10-13 10:13:10 +03:00
Michael Albinus
9c231a4470 * test/lisp/net/tramp-tests.el (tramp--test-timeout-handler):
Add docstring.  Remove `interactive' call.
2018-10-12 13:42:34 +02:00
Allen Li
f5896e2cbf Rework empty abbrev table omitting
There were two problems with the original implementation:

1. It changed the behavior of insert-abbrev-table-description when
READABLE is nil to sometimes insert one Emacs Lisp expression and
sometimes insert nothing.
2. It broke the tests.

This commit reworks this so that insert-abbrev-table-description
always inserts an expressions even if no abbrevs need to be saved and
making only write-abbrev-file check that a table has any abbrevs to
save before calling insert-abbrev-table-description.  This duplicates
the work of filtering the table for savable abbrevs, but the benefit
of keeping the API is worth it.

* doc/lispref/abbrevs.texi (Abbrev Tables): Update documentation.
* lisp/abbrev.el (write-abbrev-file): Skip tables without user abbrevs
(insert-abbrev-table-description): Always insert the define
expression.
(abbrev--table-symbols): New function.
* test/lisp/abbrev-tests.el (abbrev--table-symbols-test):
Add test for abbrev--table-symbols.
2018-10-12 11:44:15 +03:00
Paul Eggert
5bd8cfc14d Fix mishandling of symbols that look like numbers
* src/bignum.c (make_neg_biguint): New function.
* src/lread.c (read1): Do not mishandle an unquoted symbol
with name equal to something like "1\0x", i.e., a string
of numeric form followed by a NUL byte.
Formerly these symbols were misread as numbers.
(string_to_number): Change last argument from an integer flag
to a pointer to the length.  This lets the caller figure out
how much of the prefix was used.  All callers changed.
Add a fast path if the integer (sans sign) fits in uintmax_t.
Update comments and simplify now that bignums are present.
* src/print.c (print_object): Fix quoting of symbols that look
like numbers, by relying on string_to_number for the tricky
cases rather than trying to redo its logic, incorrectly.  For
example, (read (prin1-to-string '\1e+NaN)) formerly returned
"1e+NaN", which was wrong: a backslash is needed in the output
to prevent it from being read as a NaN.  Escape NO_BREAK_SPACE
too, since lread.c treats it like SPACE.
* test/src/print-tests.el (print-read-roundtrip):
Add tests illustrating the abovementioned bugs.
2018-10-10 23:19:42 -07:00
Eli Zaretskii
cd7caee630 Unbreak 'revert-buffer' in Occur buffers
* lisp/replace.el (occur-revert-function): Use the value of
occur-revert-function from the correct buffer.  (Bug#32987)

* test/lisp/replace-tests.el (replace-occur-revert-bug32543)
(replace-occur-revert-bug32987): New tests.
2018-10-09 17:46:31 +03:00
Paul Eggert
3cc452327e Improvements on (TICKS . HZ)
This patch is in response to Eli's review (Bug#32902#10).
* src/systime.c: Doc strings of affected functions now refer
to format-time-string instead of to Lisp manual, and
format-time-string's doc string covers time values.
* test/src/systime-tests.el (format-time-string-with-zone):
Check decode-time too.
(decode-then-encode-time, time-arith-tests): New tests.
2018-10-06 23:31:04 -07:00
Paul Eggert
93fe420942 New (TICKS . HZ) timestamp format
This follows on a suggestion by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00991.html
(Bug#32902).
* doc/lispref/buffers.texi (Modification Time):
* doc/lispref/os.texi (Processor Run Time, Time Calculations)
* doc/lispref/processes.texi (System Processes):
* doc/lispref/text.texi (Undo):
Let the "Time of Day" section cover timestamp format details.
* doc/lispref/os.texi (Time of Day):
Say that timestamp internal format should not be assumed.
Document new (ticks . hz) format.  Omit mention of seconds-to-time
since it is now just an alias for encode-time.
(Time Conversion): Document encode-time extension.
* etc/NEWS: Mention changes.
* lisp/calendar/cal-dst.el (calendar-system-time-basis): Now const.
* lisp/calendar/cal-dst.el (calendar-absolute-from-time)
(calendar-time-from-absolute)
(calendar-next-time-zone-transition):
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Simplify by using bignums, (TICKS . HZ), and new encode-time.
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Simplify by using bignums and new encode-time.
* lisp/calendar/parse-time.el (parse-iso8601-time-string):
Handle DST more accurately, by using new encode-time.
* lisp/calendar/time-date.el (seconds-to-time):
* lisp/calendar/timeclock.el (timeclock-seconds-to-time):
Now just an alias for encode-time.
* lisp/calendar/time-date.el (days-to-time):
* lisp/emacs-lisp/timer.el (timer--time-setter):
* lisp/net/ntlm.el (ntlm-compute-timestamp):
* lisp/obsolete/vc-arch.el (vc-arch-add-tagline):
* lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36):
* lisp/tar-mode (tar-octal-time):
Don't assume timestamps default to list form.
* lisp/tar-mode.el (tar-parse-octal-long-integer):
Now an obsolete alias for tar-parse-octal-integer.
* src/keyboard.c (decode_timer): Adjust to changes to
time decoding functions elsewhere.
* src/timefns.c: Include bignum.h, limits.h.
(FASTER_TIMEFNS): New macro.
(WARN_OBSOLETE_TIMESTAMPS, CURRENT_TIME_LIST)
(timespec_hz, trillion, ztrillion):
New constants.
(make_timeval): Use TIME_T_MAX instead of its definiens.
(check_time_validity, time_add, time_subtract):
Remove.  All uses removed.
(disassemble_lisp_time): Remove; old code now folded into
decode_lisp_time.  All callers changed.
(invalid_hz, s_ns_to_double, ticks_hz_list4, mpz_set_time)
(timespec_mpz, timespec_ticks, time_hz_ticks)
(lisp_time_hz_ticks, lisp_time_seconds)
(time_form_stamp, lisp_time_form_stamp, decode_ticks_hz)
(decode_lisp_time, mpz_time, list4_to_timespec):
New functions.
(decode_float_time, decode_time_components, lisp_to_timespec):
Adjust to new struct lisp_time, which does not lose
information like the old one did.
(enum timeform): New enum.
(decode_time_components): New arg FORM.  All callers changed.
RESULT and DRESULT are now mutually exclusive; no callers need
to change because of this.
(decode_time_components, lisp_time_struct)
(lisp_seconds_argument, time_arith, make_lisp_time, Ffloat_time)
(Fencode_time):
Add support for (TICKS . HZ) form.
(DECODE_SECS_ONLY): New constant.
(lisp_time_struct): 2nd arg is now enum timeform, not int.
All callers changed.
(check_tm_member): Support bignums.m
(Fencode_time): Add new two-arg functionality.
* src/systime.h (struct lisp_time): Now ticks+hz rather than
hi+lo+us+ps, since ticks+hz does not lose info.
* test/src/systime-tests.el (time-equal-p-nil-nil):
New test.
2018-10-06 23:31:04 -07:00
Paul Eggert
b5d08da1e9 Move timestamp-related stuff to timefns.c
This does not change behavior; it’s just long-overdue
refactoring (Bug#32902).
* src/emacs.c (main): Call init_timefns, syms_of_timefns.
* src/timefns.c: New file, containing timestamp-related stuff
from editfns.c and sysdep.c.
* src/Makefile.in (base_obj): Add timefns.o.
* src/editfns.c: Simplify by moving a big chunk to timefns.c.
Do not include systime.h, sys/resource.h, sys/param.h,
strftime.h, coding.h.
(HAVE_TZALLOC_BUG, TM_YEAR_BASE, HAVE_TM_GMTOFF, tzeqlen)
(local_tz, utc_tz, emacs_localtime_rz, emacs_mktime_z)
(invalid_time_zone_specification, xtzfree, tzlookup)
(TIME_T_MIN, TIME_T_MAX, time_overflow, invalid_time)
(check_time_validity, hi_time, lo_time, Fcurrent_time)
(time_add, time_subtract, time_arith, Ftime_add)
(Ftime_subtract, Ftime_less_p, Fget_internal_run_time)
(make_lisp_time, disassemble_lisp_time, decode_float_time)
(lisp_to_timespec, lisp_time_struct, lisp_time_argument)
(lisp_seconds_argument, Ffloat_time, emacs_nmemftime)
(Fformat_time_string, format_time_string, Fdecode_time)
(check_tm_member, Fencode_time, Fcurrent_time_string)
(tm_gmtoff, Fcurrent_time_zone, Fset_time_zone_rule)
(emacs_getenv_TZ, emacs_setenv_TZ): Move to timefns.c.
* src/emacs.c (main): Adjust to initialization changes.
* src/sysdep.c: Include <sys/resource.h> if it's present.
Regularize includes a bit.
(Fget_internal_run_time): Move here from editfns.c.
(init_timefns, syms_of_timefns): New functions.
* src/w32.h (w32_get_internal_run_time): Move decl here
so that it need not be cloned.
* test/src/editfns-tests.el:
* test/src/editfns-tests.el (format-time-string-with-zone)
(format-time-string-with-outlandish-zone)
(editfns-tests--have-leap-seconds)
(format-time-string-with-bignum-on-32-bit):
Move to ...
* test/src/timefns-tests.el: ... this new file.
2018-10-06 23:31:03 -07:00
Michael Albinus
ce0da8a427 Rework time-* functions in Tramp
* doc/misc/emacs-mime.texi (time-date): Add time-equal-p.

* lisp/net/tramp-compat.el (tramp-compat-time-equal-p): New defsubst.

* lisp/net/tramp.el (tramp-file-name-handler): Remove `debug'
error handler.
(tramp-half-a-year): Remove.
(tramp-time-dont-know, tramp-time-doesnt-exist): New defconst.
(tramp-time-diff): Remove compat code.
(tramp-handle-set-visited-file-modtime)
(tramp-handle-verify-visited-file-modtime):
* lisp/net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls)
(tramp-adb-handle-set-file-times):
* lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls)
(tramp-sh-handle-set-visited-file-modtime)
(tramp-sh-handle-verify-visited-file-modtime)
(tramp-sh-handle-set-file-times)
(tramp-sh-handle-file-newer-than-file-p):
Use `tramp-time-dont-know', `tramp-time-doesnt-exist' and
`tramp-compat-time-equal-p'.
(tramp-sh-handle-verify-visited-file-modtime): Simplify check.

* lisp/net/tramp-smb.el (tramp-smb-handle-file-attributes)
(tramp-smb-read-file-entry): Use `tramp-time-dont-know'.
(tramp-smb-handle-insert-directory): Adapt half-a-year check.

* src/editfns.c (Ftime_equal_p): Adapt docstring.

* test/lisp/net/tramp-tests.el
(tramp-test19-directory-files-and-attributes)
(tramp-test22-file-times): Use `tramp-compat-time-equal-p' and
`tramp-time-dont-know'.
(tramp-test23-visited-file-modtime): Extend test.
2018-09-29 15:33:48 +02:00
Andrew Schwartzmeyer
48ff4c0b2f Support mode aliases in 'provided-mode-derived-p'
* lisp/subr.el (provided-mode-derived-p): Check aliases of
MODES as well as MODES themselves.  (Bug#32795)

* test/lisp/subr-tests.el (provided-mode-derived-p): New test.

Copyright-paperwork-exempt: yes
2018-09-29 09:56:46 +03:00
Paul Eggert
857c2c2710 Rename time-equal to time-equal-p
This is for consistency with time-less-p.
* doc/lispref/os.texi (Time Calculations), etc/NEWS:
* src/editfns.c (Ftime_equal_p, syms_of_editfns):
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
Rename.
2018-09-28 10:37:53 -07:00
Paul Eggert
06e2814e1f time-equal, and time values of infinity and NaN
* doc/lispref/os.texi (Time Calculations):
Document time-equal, and the behavior on NaNs and infinities of
time-less-p, time-add, time-subtract.
* etc/NEWS: Mention the change.
* src/editfns.c (time_arith): Change last arg from function
to bool.  All callers changed.  Do the right thing with
infinities and NaNs.
(time_cmp): New function, which handlesx infinities and NaNs.
(Ftime_less_p): Use it.
(Ftime_equal): New function.
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
Use it.
2018-09-27 18:43:54 -07:00
Paul Eggert
d0c77a1894 Remove some assumptions about timestamp format
These changes remove some assumptions of Lisp code on timestamp
format.  Although we’re not going to change the default format any
time soon, I went looking for code that was too intimate about
details of timestamp format and removed assumptions where this was
easy to do with current Emacs primitives.
* lisp/ido.el (ido-wash-history):
Fix test for zero timestamp.
* lisp/time.el (display-time-event-handler):
Use time-less-p rather than doing it by hand.
(display-time-update): Simplify by using float-time
instead of doing the equivalent by hand.
* lisp/url/url-auth.el (url-digest-auth-make-cnonce):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
* test/lisp/net/tramp-tests.el:
(tramp-test19-directory-files-and-attributes)
(tramp-test22-file-times, tramp-test23-visited-file-modtime):
Don’t assume detailed format of returned Lisp timestamps.
2018-09-24 19:15:23 -07:00
Paul Eggert
3624317969 Fix ‘make clean’ with a file named ‘-.o’
Problem reported by T.V Raman in:
https://lists.gnu.org/r/emacs-devel/2018-09/msg00866.html
* Makefile.in (clean, extraclean):
* doc/emacs/Makefile.in (mostlyclean):
* doc/lispintro/Makefile.in (mostlyclean):
* doc/lispref/Makefile.in (mostlyclean):
* doc/misc/Makefile.in (mostlyclean, clean):
* etc/refcards/Makefile (clean):
* lib-src/Makefile.in (mostlyclean, extraclean):
* lib/Makefile.in (clean):
* lwlib/Makefile.in (clean mostlyclean):
* oldXMenu/Makefile.in (clean mostlyclean):
* src/Makefile.in (mostlyclean, extraclean):
* test/Makefile.in (mostlyclean):
Say ‘rm ./*.o’ instead of ‘rm *.o’ to avoid undesirable failure
when a file name begins with ‘-’.
2018-09-24 10:45:07 -07:00
Paul Eggert
0b36041d2a Round bignums consistently with other integers
* src/bignum.c (mpz_bufsize): New function.
(bignum_bufsize): Use it.
(mpz_get_d_rounded): New function.
(bignum_to_double): Use it.
* src/bignum.c (bignum_to_double):
* src/data.c (bignum_arith_driver):
When converting bignums to double, round instead of
truncating, to be consistent with what happens with fixnums.
* test/src/floatfns-tests.el (bignum-to-float): Test rounding.
2018-09-22 09:01:26 -07:00
Paul Eggert
3727bc7d59 Fix (+ bignum float) bug
* src/data.c (bignum_arith_driver): Fix typo: missing ‘return’.
* test/src/data-tests.el (data-tests-bignum): Test for the typo.
2018-09-21 23:09:08 -07:00
Paul Eggert
0bec064454 Fix ambiguity in nil DST flag
Formerly nil meant both that DST was not in effect and that
the DST flag was unknown, and different functions interpreted
the flag differently.  Now the meaning is consistently nil for
DST not in effect, and -1 for DST flag not known.
* doc/lispref/os.texi (Time Conversion): The DST slot is
now three-valued, not two-.
* doc/misc/emacs-mime.texi (time-date): Adjust to new behavior.
* etc/NEWS: Mention this.
* lisp/calendar/parse-time.el (parse-time-string):
* src/editfns.c (Fdecode_time):
Return -1 for unknown DST flag.
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
Adjust tests to match new behavior, and add a new
test for nil vs -1.
2018-09-21 14:25:19 -07:00
Philipp Stephani
9f10e1a0ee Support bignums when serializing JSON
* src/json.c (lisp_to_json): Support bignums.
* test/src/json-tests.el (json-serialize/bignum): New test.
2018-09-21 21:50:56 +02:00
Paul Eggert
3937b5b52a Fix icalendar tests to match new behavior
* test/lisp/calendar/icalendar-tests.el (icalendar--create-uid):
Do not intrude into or rely upon undocumented internal
implementation details of icalendar--create-uid.
Problem reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2018-09/msg00660.html
2018-09-15 14:11:10 -07:00
Glenn Morris
9e79d59790 Merge from origin/emacs-26
e133b63 (origin/emacs-26) Avoid adverse side effects of fixing bug#21824
cc8f334 Document changes called out in NEWS
20ecc52 ; * etc/NEWS: Document recent change in 'thing-at-point'.
1fc5283 ; INSTALL: Fix a typo in the last commit.
24f240d Tiny doc updates re yum/dnf etc
41c2d25 Remove unused variable
1e3b3fa Fix (thing-at-point 'list) regression (Bug#31772)
219893a Clarify meaning of '*'
41cdda2 * etc/PROBLEMS: Document Ubuntu 16.04 issue.
1c22f03 Increase default value for imenu-auto-rescan-maxout
ee84389 Improve recent change to ELisp manual
ff374e4 * doc/lispref/display.texi (SVG Images): Improve wording.
3a0caf6 * doc/lispref/display.texi (SVG Images): Fix a typo.  (Bug#32...

Conflicts:
	doc/lispref/lists.texi
	etc/NEWS
2018-09-15 09:20:32 -07:00
Eli Zaretskii
e133b63062 Avoid adverse side effects of fixing bug#21824
* test/src/buffer-tests.el
(overlay-modification-hooks-deleted-overlay): New test.

* src/buffer.c (report_overlay_modification): Don't bypass all
the overlay-modification hooks; instead, invoke each function
only if the buffer associated with the overlay is the current
buffer.  (Bug#30823)
2018-09-15 12:21:12 +03:00
Leo Liu
1e3b3fa615 Fix (thing-at-point 'list) regression (Bug#31772)
* lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Revert
  to pre 26.1 behavior.  Return whole sexp at point if no enclosing
  list.
  (list-at-point): New optional arg to ignore comments and strings.

* test/lisp/thingatpt-tests.el
  (thing-at-point-bounds-of-list-at-point): Fix and augment tests.
2018-09-14 22:38:58 +08:00
Michael Albinus
383c9a253b ; Instrument autorevert-tests.el 2018-09-14 10:03:27 +02:00
Paul Eggert
c44bc4d370 Fix (floor 54043195528445955 3.0) bug
* src/floatfns.c (rounding_driver): Fix rounding error
that can occur when both args have values exactly
representable as integers but at least one arg is a float.
* test/src/floatfns-tests.el (big-round): New test.
2018-09-13 14:29:58 -07:00
Paul Eggert
038a09041a Fix (round 1e+INF) core dump
* src/bignum.c (double_to_integer): Signal an error
if D cannot be converted, instead of dumping core.
* test/src/floatfns-tests.el (special-round): New test.
2018-09-11 11:34:44 -07:00
Gemini Lasswell
2f5a65a769 Add tests for list-threads and the *Threads* buffer
* test/lisp/thread-tests.el: New file.
2018-09-09 07:41:50 -07:00
Michael Albinus
79d7138c18 * test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Extend test.
2018-09-06 10:12:02 +02:00
Paul Eggert
67475a59e9 Fix timer.el minor rounding error
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Fix rounding error by using integers rather than floats.
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
New test.
2018-09-05 16:21:42 -07:00
Paul Eggert
ccb3891ff5 Fix format-time-string bignum bug
The problem can occur on 32-bit platforms with current timestamps.
* src/editfns.c (disassemble_lisp_time, decode_time_components):
Support seconds counts that are bignums.
* test/src/editfns-tests.el (editfns-tests--have-leap-seconds):
New function.
(format-time-string-with-bignum-on-32-bit): New test.
2018-09-04 19:15:57 -07:00
Paul Eggert
21637d5e5b Fix (round FLOAT BIGNUM) bug
* src/floatfns.c (rounding_driver): Fix bug when one
argument is a float and the other is a bignum.
* test/src/floatfns-tests.el (bignum-round): Test for the bug.
2018-09-04 11:50:54 -07:00
Stephen Berman
40f8ade7c8 Make todo-show work when adding and deleting a new todo file
* lisp/calendar/todo-mode.el (todo-add-file): Since
todo-current-todo-file must be set before calling todo-show, but
the buffer is not yet in todo-mode, which makes it buffer local,
explicitly set it buffer locally (bug#32627).

* test/lisp/calendar/todo-mode-tests.el (todo-test--add-file)
(todo-test--delete-file): New functions.
(todo-test-add-and-delete-file): New test.
2018-09-03 22:40:24 +02:00
Michael Albinus
ee2509bd82 Mark thread-alive-p as obsolete
* etc/NEWS (thread-alive-p):
* lisp/emacs-lisp/thread.el (thread-alive-p): Mark it as obsolete.

* test/src/thread-tests.el (threads-join-error)
(threads-signal-main-thread): Use `thread-live-p'.
2018-08-31 11:45:37 +02:00
Michael Albinus
6f3cf12e4f Merge from origin/emacs-26
ac7936cb8f Rename thread-alive-p to thread-live-p
3d09d533d1 rcirc: Document /reconnect as a built-in command (Bug#29656)
a1e615618d * test/lisp/calc/calc-tests.el (calc-imaginary-i): New test.
2018-08-31 11:15:48 +02:00
Michael Albinus
ac7936cb8f Rename thread-alive-p to thread-live-p
* doc/lispref/threads.texi (Basic Thread Functions): Use thread-live-p.

* etc/NEWS: 'thread-alive-p' has been renamed to 'thread-live-p'.

* src/thread.c (thread_live_p): Rename from thread_alive_p.  Adapt
all callees.
(Fthread_live_p): Rename from Fthread_alive_p.
(syms_of_threads): Make thread-alive-p an alias of thread-live-p.

* test/src/thread-tests.el (all): Replace `thread-alive-p' by
`thread-live-p'.
(threads-live): Rename from `threads-alive'.
2018-08-31 10:47:03 +02:00
Paul Eggert
db2fed3bdf Several fixes for formatting bignums
* src/bignum.c: Include stdlib.h, for abs.
(bignum_bufsize, bignum_to_c_string): New functions.
* src/bignum.c (bignum_to_string):
* src/print.c (print_vectorlike): Use them.
* src/editfns.c (styled_format): Instead of having a separate
buffer for sprintf (which does not work for bignums), just append
to the main buffer.  When formatting bignums, add support for the
standard integer flags -, #, 0, + and space.  Fix some comments.
Capitalize properly when formatting bignums with %X.  Use
functions like c_isdigit rather than reinventing the wheel.
Simplify computation of excess precision.
* src/print.c: Do not include bignum.h; no longer needed.
(print_vectorlike): Avoid recalculating string length.
* test/src/editfns-tests.el (format-bignum):
Test some of the above fixes.
2018-08-31 00:28:58 -07:00
Michael Albinus
54b92132e1 Handle thread-signal towards the main thread (Bug#32502)
* doc/lispref/threads.texi (Basic Thread Functions):
* etc/NEWS: Document thread-signal towards the main thread.

* lisp/emacs-lisp/thread.el: New package.

* src/keyboard.c (read_char): Check for Qthread_event.
(kbd_buffer_get_event, make_lispy_event): Handle THREAD_EVENT.
(syms_of_keyboard): Declare Qthread_event.
(keys_of_keyboard): Add thread-handle-event to special-event-map.

* src/termhooks.h (enum event_kind): Add THREAD_EVENT.

* src/thread.c: Include "keyboard.h".
(poll_suppress_count) Don't declare extern.
(Fthread_signal): Raise event if THREAD is the main thread.  (Bug#32502)

* test/src/thread-tests.el (thread): Require it.
(threads-signal-main-thread): New test.
2018-08-30 21:29:04 +02:00
Noam Postavsky
a1e615618d * test/lisp/calc/calc-tests.el (calc-imaginary-i): New test. 2018-08-29 22:47:00 -04:00
Michael Albinus
c252cd9d20 Improve tramp-convert-file-attributes backward compatibility
* lisp/net/tramp-sh.el (tramp-convert-file-attributes):
Use `seconds-to-time' for {access, modification, status change}
time.  Simplify check for inode.

* test/lisp/net/tramp-tests.el (tramp-test22-file-times):
Use `seconds-to-time'.
2018-08-29 10:05:34 +02:00
Glenn Morris
1afd313334 Merge from origin/emacs-26
54fb383 (origin/emacs-26) Fix detection of freed emacs_values (Bug#32...
769d0cd ; Fix out-of-tree build for mod-test.so
9a1329e Avoid crashes with very wide TTY frames on MS-Windows
9a613d3 Prevent `modify-file-local-variable-prop-line' from adding ex...
624e7dc Update GNOME bugtracker URLs
51ef6d5 Clarify in the Emacs manual that ChangeLog files are not used
6e08019 Recognize codepage 65001 as a valid encoding
1a350d7 ; * etc/NEWS: Fix format of first lines of some entries.
22d1f53 Avoid compilation warning in nt/addpm.c
7bc9ce7 Fix duplicate custom group names in bibtex.el
a9cf938 Fix outdated text in the Calc manual

Conflicts:
	etc/NEWS
	etc/PROBLEMS
	src/emacs-module.c
	src/gtkutil.c
	src/image.c
	src/xterm.c
	test/Makefile.in
2018-08-26 15:10:50 -07:00
Sergey Vinokurov
54fb383af6 Fix detection of freed emacs_values (Bug#32479)
* src/emacs-module.c (module_free_global_ref): Compare a value to be
freed with all entries of the list.

* test/data/emacs-module/mod-test.c (Fmod_test_globref_free): New
function.
(emacs_module_init): Make it accessible from Lisp.
* test/src/emacs-module-tests.el (mod-test-globref-free-test): New
test which uses it.
2018-08-25 18:57:56 -04:00
Noam Postavsky
769d0cdaa9 ; Fix out-of-tree build for mod-test.so
* test/Makefile.in: Don't look for emacs-module.h in $(srcdir), since
it is generated.
2018-08-25 18:57:28 -04:00
Noam Postavsky
161139a42c Detect Chinese sudo password prompts (Bug#31075)
* lisp/comint.el (comint-password-prompt-regexp): Allow text between
the prompt prefix and password equivalent.
* lisp/eshell/esh-mode.el (eshell-password-prompt-regexp): Accept some
unicode alternatives to ":".
* test/lisp/comint-tests.el (comint-testsuite-password-strings): Add
test case.
2018-08-23 22:50:15 -04:00
Noam Postavsky
74277b0e88 Fix comint-password-prompt-regexp
The change from 2017-12-22 "Support French password prompts in shell"
tried to allow nonbreaking space in addition to whitespace syntax
characters around the colon, but used square brackets which cause "\s"
to be interpreted literally rather than as a backslash construct.
* lisp/comint.el (comint-password-prompt-regexp): Use [[:blank:]]
instead, which also has the benefit of not relying on the major mode's
whitespace syntax setting.
* test/lisp/comint-tests.el (comint-testsuite-password-strings):
Update French localized entry to have a space before the colon, as
reported in Bug#29729.
2018-08-23 22:49:04 -04:00
Paul Eggert
ee641b87cf Fix bugs when rounding to bignums
Also, since Emacs historically reported a range error when
rounding operations overflowed, do that consistently for all
bignum overflows.
* doc/lispref/errors.texi (Standard Errors):
* doc/lispref/numbers.texi (Integer Basics): Document range errors.
* src/alloc.c (range_error): Rename from integer_overflow.
All uses changed.
* src/floatfns.c (rounding_driver): When the result of a floating
point rounding operation does not fit into a fixnum, put it
into a bignum instead of always signaling an range error.
* test/src/floatfns-tests.el (divide-extreme-sign):
These tests now return the mathematically-correct answer
instead of signaling an error.
(bignum-round): Check that integers round to themselves.
2018-08-22 19:30:57 -07:00
Paul Eggert
30efb8ed6c Add bignum support to floor, ceiling, etc.
Problem reported by Andy Moreton (Bug#32463#35 (d)).
* src/floatfns.c (rounding_driver): Change the signature
of the integer rounder to use mpz_t rather than EMACS_INT.
All uses changed.  Support bignums.
(ceiling2, floor2, truncate2, round2): Remove.
All uses changed to rounddiv_q or to a GMP library function.
(rounddiv_q): New function.
* test/src/floatfns-tests.el (bignum-round): New test.
2018-08-21 19:24:38 -07:00
Paul Eggert
f8069952ab Fix assertion failure when reading 'BIGNUM.'
Problem reported by Stefan Monnier (Bug#32476).
* src/lread.c (string_to_number): Don't pass leading "+"
or trailing "." or junk to make_bignum_str.
* test/src/lread-tests.el (lread-string-to-number-trailing-dot):
New test.
2018-08-21 15:51:05 -07:00
Paul Eggert
f18af6cd5c Audit use of lsh and fix glitches
I audited use of lsh in the Lisp source code, and fixed the
glitches that I found.  While I was at it, I replaced uses of lsh
with ash when either will do.  Replacement is OK when either
argument is known to be nonnegative, or when only the low-order
bits of the result matter, and is a (minor) win since ash is a bit
more solid than lsh nowadays, and is a bit faster.
* lisp/calc/calc-ext.el (math-check-fixnum):
Prefer most-positive-fixnum to (lsh -1 -1).
* lisp/vc/vc-hg.el (vc-hg-state-fast): When testing fixnum width,
prefer (zerop (ash most-positive-fixnum -32)) to (zerop (lsh -1
32)) (Bug#32485#11).
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
Tighten sanity-check for bytecode overflow, by checking that the
result of (ash pc -8) is nonnegative.  Formerly this check was not
needed since lsh was used and the number overflowed differently.
* lisp/net/dns.el (dns-write): Fix some obvious sign typos in
shift counts.  Evidently this part of the code has never been
exercised.
* lisp/progmodes/hideif.el (hif-shiftleft, hif-shiftright):
* lisp/term/common-win.el (x-setup-function-keys):
Simplify.
* admin/unidata/unidata-gen.el, admin/unidata/uvs.el:
* doc/lispref/keymaps.texi, doc/lispref/syntax.texi:
* doc/misc/calc.texi, doc/misc/cl.texi, etc/NEWS.19:
* lisp/arc-mode.el, lisp/calc/calc-bin.el, lisp/calc/calc-comb.el:
* lisp/calc/calc-ext.el, lisp/calc/calc-math.el:
* lisp/cedet/semantic/wisent/comp.el, lisp/composite.el:
* lisp/disp-table.el, lisp/dos-fns.el, lisp/edmacro.el:
* lisp/emacs-lisp/bindat.el, lisp/emacs-lisp/byte-opt.el:
* lisp/emacs-lisp/bytecomp.el, lisp/emacs-lisp/cl-extra.el:
* lisp/erc/erc-dcc.el, lisp/facemenu.el, lisp/gnus/message.el:
* lisp/gnus/nndoc.el, lisp/gnus/nnmaildir.el, lisp/image.el:
* lisp/international/ccl.el, lisp/international/fontset.el:
* lisp/international/mule-cmds.el, lisp/international/mule.el:
* lisp/json.el, lisp/mail/binhex.el, lisp/mail/rmail.el:
* lisp/mail/uudecode.el, lisp/md4.el, lisp/net/dns.el:
* lisp/net/ntlm.el, lisp/net/sasl.el, lisp/net/socks.el:
* lisp/net/tramp.el, lisp/obsolete/levents.el:
* lisp/obsolete/pgg-parse.el, lisp/org/org.el:
* lisp/org/ox-publish.el, lisp/progmodes/cc-defs.el:
* lisp/progmodes/ebnf2ps.el, lisp/progmodes/hideif.el:
* lisp/ps-bdf.el, lisp/ps-print.el, lisp/simple.el:
* lisp/tar-mode.el, lisp/term/common-win.el:
* lisp/term/tty-colors.el, lisp/term/xterm.el, lisp/vc/vc-git.el:
* lisp/vc/vc-hg.el, lisp/x-dnd.el, test/src/data-tests.el:
Prefer ash to lsh when either will do.
2018-08-21 13:44:32 -07:00
Paul Eggert
77fc272598 Fix glitches introduced by nthcdr changes
* src/fns.c (Fnthcdr): Fix recently-introduced bug when
nthcdr is supposed to yield a non-nil non-cons.
Reported by Glenn Morris and by Pip Cet here:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00699.html
https://lists.gnu.org/r/emacs-devel/2018-08/msg00708.html
Speed up nthcdr for small N, as suggested by Pip Cet here:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00707.html
* test/src/fns-tests.el (test-nthcdr-simple): New test.
2018-08-21 02:05:31 -07:00
Paul Eggert
eb83344fc7 Speed up (nthcdr N L) when L is circular
Also, fix bug when N is a positive bignum, a problem reported
by Eli Zaretskii and Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00690.html
* src/fns.c (Fnthcdr): If a cycle is found, reduce the count
modulo the cycle length before continuing.  This reduces the
worst-case cost of (nthcdr N L) from N to min(N, C) where C is
the number of distinct cdrs of L.  Reducing modulo the cycle
length also allows us to do arithmetic with machine words
instead of with GMP.
* test/src/fns-tests.el (test-nthcdr-circular): New test.
2018-08-20 16:01:31 -07:00
Paul Eggert
47b7a5bd49 Add bignum support to expt
Problem and initial solution reported by Andy Moreton in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00503.html
* doc/lispref/numbers.texi (Math Functions): expt integer
overflow no longer causes truncation; it now signals an error
since bignum overflow is a big deal.
* src/floatfns.c (Fexpt): Support bignum arguments.
* test/src/floatfns-tests.el (bignum-expt): New test.
2018-08-19 01:22:25 -07:00
Paul Eggert
06b5bcd639 Fix bug with ‘mod’ and float+bignum
Problem reported by Andy Moreton in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00442.html
* src/floatfns.c (fmod_float): Work even if an arg is a bignum.
* test/src/floatfns-tests.el (bignum-mod): New test.
2018-08-18 23:29:16 -07:00
Paul Eggert
1d2df2fd03 Improve bignum comparison (Bug#32463#50)
* src/data.c (isnan): Remove, as we can assume C99.
(bignumcompare): Remove, folding its functionality
into arithcompare.
(arithcompare): Compare bignums directly here.
Fix bugs when comparing NaNs to bignums.
When comparing a bignum to a fixnum, just look at the
bignum’s sign, as that’s all that is needed.
Decrease scope of locals when this is easy.
* test/src/data-tests.el (data-tests-bignum): Test bignum vs NaN.
2018-08-18 16:13:34 -07:00
Paul Eggert
673b1785db Restore traditional lsh behavior on fixnums
* doc/lispref/numbers.texi (Bitwise Operations): Document that
the traditional (lsh A B) behavior is for fixnums, and that it
is an error if A and B are both negative and A is a bignum.
See Bug#32463.
* lisp/subr.el (lsh): New function, moved here from src/data.c.
* src/data.c (ash_lsh_impl): Remove, moving body into Fash
since it’s the only caller now.
(Fash): Check for out-of-range counts.  If COUNT is zero,
return first argument instead of going through libgmp.  Omit
lsh code since lsh is now done in Lisp.  Add code for shifting
fixnums right, to avoid a round trip through libgmp.
(Flsh): Remove; moved to lisp/subr.el.
* test/lisp/international/ccl-tests.el (shift):
Test for traditional lsh behavior, instead of assuming
lsh is like ash when bignums are present.
* test/src/data-tests.el (data-tests-logand)
(data-tests-logior, data-tests-logxor, data-tests-ash-lsh):
New tests.
2018-08-18 15:22:35 -07:00
Paul Eggert
64eb9b71da Fix problems with logxor etc. and fixnums
These operations incorrectly treated negative fixnums as
bignums greater than most-positive-fixnum.
* src/alloc.c (mpz_set_intmax_slow): Avoid undefined
behavior if signed unary negation overflows, while
we’re in the neighborhood.
(mpz_set_uintmax_slow): Remove.  All uses removed.
* src/data.c (arith_driver): Treat fixnums as signed, not
unsigned, even for logical operations.
* src/lisp.h (mpz_set_uintmax): Remove.  All uses removed.
* test/src/data-tests.el (data-tests-logand)
(data-tests-logior, data-tests-logxor): New tests.
2018-08-17 00:26:19 -07:00
Stephen Berman
6d24402d63 Fix last todo-edit-mode change
* lisp/calendar/todo-mode.el (todo-edit-mode): For editing an item
instead of the whole file, the current todo-file must be set from
todo-global-current-todo-file.

* test/lisp/calendar/todo-mode-tests.el (todo-test-current-file-in-edit-mode):
New test.
2018-08-15 00:14:41 +02:00
Stephen Berman
a2ec595e5d Fix exiting from editing todo archive file (bug#32437)
* lisp/calendar/todo-mode.el (todo-edit-file): Make the warning
also suitable for Todo Archive mode, and add more space to it.
(todo-edit-quit): On quitting editing an archive file, return to
the Todo Archive mode buffer editing was invoked in.
(todo-check-format): Display a warning instead of a message when
the categories sexp isn't as expected.
(todo-mode-external-set): Remove.
(todo-edit-mode): Set buffer local values of
todo-current-todo-file and todo-categories from the todo or
archive file being edited.
(todo-categories-mode): Set buffer local values of
todo-current-todo-file and todo-categories as before but directly
instead of using superfluous todo-mode-external-set function.

* test/lisp/calendar/todo-mode-tests.el (todo-test-edit-quit): New test.
2018-08-14 21:39:24 +02:00
Glenn Morris
2eabf4c13c Merge from origin/emacs-26
34e75c1 Add comment about floating point test
e73e683 Ibuffer: Add toggle ibuffer-do-toggle-lock
12f7116 Ibuffer: Detect correctly the buffers running a process
2018-08-14 09:06:43 -07:00
Paul Eggert
34e75c144e Add comment about floating point test
* test/src/data-tests.el (data-tests--float-greater-than-fixnums):
New constant.
(data-tests-=, data-tests-<, data-tests->, data-tests-<=)
(data-tests->=, data-tests-min): Use it.
2018-08-13 09:37:09 -07:00
Raimon Grau
eb787d749f Add uuid as allowed thingatpt symbol (Bug#32372)
* etc/NEWS: Mention changes in thingatpt.el.
* lisp/thingatpt.el (thing-at-point-uuid-regexp): Add regexp for uuid.
(top-level): Add 'bounds-of-thing-at-point' operation for 'uuid'.
* test/lisp/thingatpt-tests.el: Add tests for uuid at point.
2018-08-13 07:46:35 -04:00
Michael Albinus
184229766f Backport fix for Bug#32226
* test/lisp/shadowfile-tests.el: Set Tramp variables for hydra.
(shadow-test06-literal-groups, shadow-test07-regexp-groups)
(shadow-test08-shadow-todo, shadow-test09-shadow-copy-files):
Use `set-visited-file-name' instead of setting the value in
`buffer-file-name' directly.
(shadow-test08-shadow-todo, shadow-test09-shadow-copy-files):
Test for writable temporary directory.  Suppress errors in
cleanup.  (Bug#32226)
2018-08-12 18:15:24 +02:00
Michael Albinus
4532def340 ; Remove instrumentation for Bug#32226 2018-08-12 17:38:24 +02:00
Glenn Morris
d0d7bd6816 ; * test/lisp/international/ccl-tests.el: Add license notice. 2018-08-11 14:44:49 -07:00
Tom Tromey
78ec68e18f Merge branch 'feature/bignum' 2018-08-11 13:34:17 -06:00
Michael Albinus
ba1c4f63e3 Fix Bug#32226, hopefully
* test/lisp/shadowfile-tests.el: Set Tramp variables for hydra.
2018-08-11 20:30:39 +02:00
Michael Albinus
1d8fa1c981 ; More instrumentation for shadowfile-tests.el and files.el 2018-08-11 17:03:41 +02:00
Glenn Morris
bd6b6cdb62 Merge from origin/emacs-26
71c92d8 Fix copying text properties by 'format'
96be6b6 Improve error messages regarding initial-buffer-choice (Bug#2...
00fb127 * test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):...

Conflicts:
	lisp/startup.el
2018-08-10 11:37:11 -07:00
Filipp Gunbin
5e42c349a0 Fix bugs in `auth-source-netrc-parse-one'.
* lisp/auth-source.el (auth-source-netrc-parse-one): Ensure that match
  data is not overwritten in `auth-source-netrc-parse-next-interesting'.
  Ensure that blanks are skipped before and after going over comments
  and eols.
* test/lisp/auth-source-tests.el (auth-source-test-netrc-parse-one): New test.

(cherry picked from commit 60ff810144)
2018-08-10 08:36:24 -04:00
Michael Albinus
243b68f73f ; More instrumentation for shadowfile-tests.el and files.el
* test/lisp/shadowfile-tests.el (shadow-test06-literal-groups)
(shadow-test07-regexp-groups, shadow-test08-shadow-todo)
(shadow-test09-shadow-copy-files): Use `set-visited-file-name'
instead of setting the value in `buffer-file-name' directly.
(Bug#32226)
2018-08-10 13:34:10 +02:00
Michael Albinus
7fbf124796 Another try to fix Bug#32226
* test/lisp/shadowfile-tests.el (shadow-test06-literal-groups)
(shadow-test07-regexp-groups, shadow-test08-shadow-todo)
(shadow-test09-shadow-copy-files): Use `set-visited-file-name'
instead of setting the value in `buffer-file-name' directly.
(Bug#32226)
2018-08-10 10:58:00 +02:00
Tom Tromey
accb7b7ecc Merge remote-tracking branch 'origin/master' into feature/bignum 2018-08-09 17:56:53 -06:00
Eli Zaretskii
71c92d8913 Fix copying text properties by 'format'
* src/editfns.c (styled_format): Add the spec beginning index
to the info recorded for each format spec, and use it to
detect the case that a format spec and its text property end
where the next spec with another property begins.  (Bug#32404)

* test/src/editfns-tests.el (format-properties): Add tests for
bug#32404.
2018-08-09 18:08:35 +03:00
Michael Albinus
53483df0de ; More instrumentation for shadowfile-tests.el and files.el 2018-08-09 15:40:37 +02:00
Michael Albinus
f1a385ded2 Fix Bug#32304
* test/lisp/net/tramp-tests.el (tramp-test45-unload):
Handle tramp-archive autoloaded objects.  Remove tag :unstable.
2018-08-09 14:08:25 +02:00
Glenn Morris
00fb127031 * test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01): Fix typo. 2018-08-08 19:58:29 -04:00
Tom Tromey
90dba077cf Fix mod-test-sum-test for bignums
* test/src/emacs-module-tests.el (mod-test-sum-test): Update
for bignums.
2018-08-08 17:34:42 -06:00
Michael Albinus
5025fb617d Fix problems in tramp-tests
* test/lisp/net/tramp-tests.el (tramp-test45-unload): Filter out
tramp-archive objects.  (Bug#32304)

* test/lisp/net/tramp-tests.el (tramp-test43-auto-load):
Add skip condition.  (Bug#32304)
(tramp-test43-unload): Tag as :unstable.
2018-08-08 19:57:54 +02:00
Michael Albinus
c85ff212dc ; More instrumentation for shadowfile-tests.el 2018-08-08 16:22:23 +02:00
Michael Albinus
c9f13b9ea3 Filter out tramp-archive objects in tramp-test45-unload
* test/lisp/net/tramp-tests.el (tramp-test45-unload): Filter out
tramp-archive objects.  (Bug#32304)
2018-08-08 15:38:10 +02:00
Michael Albinus
31929031e3 Tag expensive tests in tramp-archive.el (Bug#30807)
* test/lisp/net/tramp-archive-tests.el (tramp-archive-test44-auto-load)
(tramp-archive-test44-delay-load): Rename.
(tramp-archive-test07-file-exists-p)
(tramp-archive-test08-file-local-copy)
(tramp-archive-test09-insert-file-contents)
(tramp-archive-test11-copy-file)
(tramp-archive-test15-copy-directory)
(tramp-archive-test16-directory-files)
(tramp-archive-test17-insert-directory)
(tramp-archive-test18-file-attributes)
(tramp-archive-test19-directory-files-and-attributes)
(tramp-archive-test20-file-modes)
(tramp-archive-test21-file-links)
(tramp-archive-test26-file-name-completion)
(tramp-archive-test44-auto-load)
(tramp-archive-test44-delay-load): Tag them as :expensive-test,
because they run longer than 10 seconds.  (Bug#30807)
2018-08-08 14:59:56 +02:00
Paul Eggert
e5652268a9 Rename src/regex.c to src/regex-emacs.c.
This is in preparation for using Gnulib regex for etags,
to avoid collisions in include directives.
* src/regex-emacs.c: Rename from src/regex.c.
* src/regex-emacs.h: Rename from src/regex.h.  All uses changed.
* test/src/regex-emacs-tests.el: Rename from test/src/regex-tests.el.
2018-08-05 19:36:09 -07:00
Andy Moreton
68ebff23f7 Fix test and comment in CCL change
* lisp/international/ccl.el (ccl-fixnum): Update comment.
* test/lisp/international/ccl-tests.el (prog-midi-dump): Add
trailing space to expected result.
2018-08-05 12:56:33 -06:00
Tom Tromey
1303f8a480 Fix hash functions for bignums
* src/fns.c (cmpfn_eql, hashfn_eql): Handle bignums.
(sxhash_bignum): New function.
(sxhash): Use it.
* test/src/fns-tests.el (test-bignum-hash): New test.
2018-08-04 11:08:31 -06:00
Tom Tromey
91d505d8e2 Fix bignum comparisons with NaN
* src/data.c (isnan): Move earlier.
(bignumcompare): Explicitly handle NaN.
* test/src/data-tests.el (data-tests-min): Add NaN tests
for bignum.
(data-check-sign): Fix for previous patch.
* test/src/fns-tests.el (test-bignum-eql): Add NaN test.
2018-08-04 10:50:35 -06:00
Andy Moreton
bc8ff54efe Make bignums work better when EMACS_INT is larger than long
* lisp/international/ccl.el (ccl-fixnum): New function.
(ccl-embed-data, ccl-embed-current-address, ccl-dump): Use it.
* src/alloc.c (make_number): Handle case where EMACS_INT is
larger than long.
* src/data.c (bignumcompare): Handle case where EMACS_INT is
larger than long.
(arith_driver): Likewise.  Coerce markers.
(float_arith_driver): Coerce markers.
(Flogcount): Use mpz_sgn.
(ash_lsh_impl): Fix bugs.
(Fsub1): Fix underflow check.
* src/lisp.h (NUMBERP): Don't check BIGNUMP.
(CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER): Fix indentation.
* test/lisp/international/ccl-tests.el: New file.
2018-08-04 10:28:13 -06:00
Noam Postavsky
6328d2ff6f Merge from emacs-26
951c5a127f Fix wdired test failure when byte compiled (bug#32318)
0252f7311f * test/lisp/wdired-tests.el (wdired-test-symlink-name): Ne...
dd51434714 Fix url's thing-at-point beginning-op (Bug#32028)
2018-08-04 11:55:03 -04:00
Juri Linkov
cc233365a9 New function read-answer (Bug#31782)
* lisp/emacs-lisp/map-ynp.el (read-answer-short): New defcustom.
(read-answer): New function.
* lisp/subr.el (assoc-delete-all): New function.
* etc/NEWS: Announce them.

* lisp/dired.el (dired-delete-file): Use read-answer.
(dired--yes-no-all-quit-help): Remove function.
(dired-delete-help): Remove defconst.

(backported from master, "New function read-answer (bug#30073)" and
"Respect non-saved value of `read-short-answer' (Bug#31782)")
2018-08-04 11:37:39 -04:00
Michael Albinus
b9e2a91ec5 Rename Tramp method "owncloud" to "nextcloud"
In the spirit of freedom, "nextcloud" is preferred over "owncloud".

* doc/misc/tramp.texi (Quick Start Guide, GVFS based methods):
* etc/NEWS: Rename "owncloud" method to "nextcloud".

* lisp/net/tramp-gvfs.el (tramp-gvfs-methods, tramp-goa-methods)
(tramp-gvfs-url-file-name, tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec)
(tramp-get-goa-accounts): Use "nextcloud" instead of "owncloud".
(tramp-gvfs-nextcloud-default-prefix)
(tramp-gvfs-nextcloud-default-prefix-regexp): Rename them.  Adapt
all callees.

* test/lisp/net/tramp-tests.el (tramp--test-nextcloud-p):
Rename from `tramp--test-owncloud-p'.
(tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-08-04 12:05:28 +02:00
Ken Brown
5dc3d0a9b0 Fix a filenotify test failure on Cygwin
* test/lisp/filenotify-tests.el
(file-notify-test04-autorevert): Increase a sleep-for time
from 2 to 3 on Cygwin.  This avoids sporadic failures of the
test.  (Bug#32363)
2018-08-03 15:33:33 -04:00
Gemini Lasswell
3cd6a6846b Give two backtrace-mode commands better names
* lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Update
bindings and menu items with new function names.
(backtrace-collapse, backtrace-pretty-print)
(backtrace--collapse, backtrace--pretty-print): Remove functions.
(backtrace-single-line, backtrace-multi-line)
(backtrace--single-line, backtrace--multi-line): New functions.
(backtrace--reformat-sexp): Remove 'error-message' argument.
* test/lisp/emacs-lisp/backtrace-tests.el
(backtrace-tests--pretty-print-and-collapse): Remove.
(backtrace-tests--single-and-multi-line): New test.
(backtrace-tests--verify-pp-and-collapse): Remove.
(backtrace-tests--verify-single-and-multi-line): New function.
2018-08-03 08:54:08 -07:00
Gemini Lasswell
ca98377280 Add new commands to Edebug backtraces
Add commands to go to source if available, and to show and hide
Edebug's instrumentation.  Make Edebug pop to backtraces instead of
displaying them, which makes Edebug consistant with the behavior of
ERT and the Lisp Debugger.
* doc/lispref/edebug.texi (Edebug Misc): Document when and how you can
jump to source code from an Edebug backtrace.  Document
'edebug-backtrace-show-instrumentation' and
'edebug-backtrace-hide-instrumentation'.
* lisp/emacs-lisp/backtrace.el (backtrace-frame): Add comments to
describe the fields.
(backtrace-goto-source-functions): New
abnormal hook.
(backtrace-mode-map): Add keybinding and menu item for
backtrace-goto-source.
(backtrace--flags-width): New constant.
(backtrace-update-flags): Use it.
(backtrace-goto-source): New command.
(backtrace--print-flags): Print the :source-available flag.
* lisp/emacs-lisp/edebug.el (edebug-backtrace-frames)
(edebug-instrumented-backtrace-frames): New variables.
(edebug-backtrace, edebug--backtrace-frames): Remove functions.
(edebug-pop-to-backtrace, edebug--backtrace-goto-source)
(edebug--add-source-info): New functions.
(edebug-mode-map, edebug-mode-menus): Replace 'edebug-backtrace' with
'edebug-pop-to-backtrace'.
(edebug--strip-instrumentation): New function.
(edebug--unwrap-and-add-info): Remove.
(edebug-unwrap-frame, edebug-add-source-info): New functions.
(edebug-backtrace-show-instrumentation)
(edebug-backtrace-hide-instrumentation): New commands.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-check-keymap):
Verify keybindings in backtrace-mode-map used by new test.
Update with binding for 'edebug-pop-to-backtrace'.
(edebug-tests-backtrace-goto-source): New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-range): Add a new stop point.
2018-08-03 08:54:08 -07:00
Gemini Lasswell
a3ba34aeac Add new command to expand all "..."s in a backtrace frame
* doc/lispref/debugging.texi (Backtraces): Document new keybinding.
* lisp/emacs-lisp/backtrace.el (backtrace-line-length): Add the
option of unlimited line length.
(backtrace--match-ellipsis-in-string): Add a comment to explain
why this function is necessary.
(backtrace-mode-map): Add keybinding for 'backtrace-expand-ellipses'.
(backtrace-expand-ellipsis): Use 'cl-print-to-string-with-limit'.
(backtrace-expand-ellipses): New command.
(backtrace-print-to-string): Use 'cl-print-to-string-with-limit'.
Tag the printed forms with a gensym instead of the values of
print-length and print-level.
(backtrace--print): Add 'stream' argument.
* test/lisp/emacs-lisp/backtrace-tests.el
(backtrace-tests--expand-ellipsis): Make the test less dependent
on the implementation.
(backtrace-tests--expand-ellipses): New test.

Move the fitting of a printed representation into a limited number of
characters using appropriate values of print-level and print-length
from 'backtrace-print-to-string' to cl-print.el for future use by
other parts of Emacs.
* lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): New
function.
* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-print-to-string-with-limit): New test.
2018-08-03 08:53:02 -07:00
Gemini Lasswell
04cc0b6158 Add more tests for backtrace-mode
* test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--variables)
(backtrace-tests--backward-frame, backtrace-tests--forward-frame)
(backtrace-tests--pretty-print-and-collapse)
(backtrace-tests--verify-pp-and-collapse)
(backtrace-tests--print-circle, backtrace-tests--make-regexp)
(backtrace-tests--expand-ellipsis): New tests.
(backtrace-tests--to-string): Use backtrace-tests--make-backtrace.
(backtrace-tests--get-substring): New function.

Change the method of generating sample backtraces in backtrace tests
to work whether or not the tests are byte-compiled.
* test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--func1)
(backtrace-tests--func2, backtrace-tests--func3)
(backtrace-tests--create-backtrace-frames): Remove.
(backtrace-tests--uncompiled-functions): New constant.
(backtrace-tests--make-backtrace, backtrace-tests--setup-buffer):
New functions.
(backtrace-tests--backtrace-lines)
(backtrace-tests--backtrace-lines-with-locals): New functions.
(backtrace-tests--line-count): New constant.
(backtrace-tests--result, backtrace-tests--result-with-locals):
New functions.
(backtrace-tests--header): New constant.
(backtrace-tests--insert-header): Use backtrace-tests--header.
(backtrace-tests--with-buffer): Remove.
2018-08-03 08:53:02 -07:00
Gemini Lasswell
e09120d686 Add backtrace-mode and use it in the debugger, ERT and Edebug
* doc/lispref/debugging.texi (Using Debugger): Remove explanation of
backtrace buffer.  Refer to new node.
(Backtraces): New node.
(Debugger Commands): Refer to new node.  Remove 'v'.
* doc/lispref/edebug.texi (Edebug Misc): Refer to new node.
* doc/misc/ert.texi (Running Tests Interactively): Refer to new node.

* lisp/emacs-lisp-backtrace.el: New file.
* test/lisp/emacs-lisp/backtrace-tests.el: New file.

* lisp/emacs-lisp/debug.el: (debugger-buffer-state): New cl-defstruct.
(debugger--restore-buffer-state): New function.
(debug): Use a debugger-buffer-state object to save and restore buffer
state.  Fix bug#15749 by leaving an unused buffer in debugger-mode,
empty, instead of in fundamental-mode, and then when reusing a buffer,
not calling debugger-mode if the buffer is already in debugger-mode.
(debugger-insert-backtrace): Remove.
(debugger-setup-buffer): Use backtrace-mode.
(debugger--insert-header): New function.
(debugger-continue, debugger-return-value): Change check for flags to
use backtrace-frames.
(debugger-frame-number): Determine backtrace frame number from
backtrace-frames.
(debugger--locals-visible-p, debugger--insert-locals)
(debugger--show-locals, debugger--hide-locals)
(debugger-toggle-locals): Remove.
(debugger-mode-map): Make a child of backtrace-mode-map.  Move
navigation commands to backtrace-mode-map.  Bind 'q' to debugger-quit
instead of top-level.  Make Help Follow menu item call
backtrace-help-follow-symbol.
(debugger-mode): Derive from backtrace-mode.
(debug-help-follow): Remove.  Move body of this function to
'backtrace-help-follow-symbol' in backtrace.el.
(debugger-quit): New function.

* lisp/emacs-lisp/edebug.el (edebug-unwrap-results): Remove warning
in docstring about circular results.
(edebug-unwrap): Use pcase.
(edebug-unwrap1): New function to unwrap circular objects.
(edebug-unwrap*): Use it.
(edebug--frame): New cl-defstruct.
(edebug-backtrace): Call the buffer *Edebug Backtrace* and use
backtrace-mode.  Get the frames from edebug--backtrace-frames.
(edebug--backtrace-frames, edebug--unwrap-and-add-info)
(edebug--symbol-not-prefixed-p): New functions.

* lisp/emacs-lisp/lisp-mode.el
(lisp-el-font-lock-keywords-for-backtraces)
(lisp-el-font-lock-keywords-for-backtraces-1)
(lisp-el-font-lock-keywords-for-backtraces-2): New constants.

* lisp/emacs-lisp/ert.el (ert--print-backtrace): Remove.
(ert--run-test-debugger): Use backtrace-get-frames.
(ert-run-tests-batch): Use backtrace-to-string.
(ert-results-pop-to-backtrace-for-test-at-point): Use backtrace-mode.
(ert--insert-backtrace-header): New function.

* tests/lisp/emacs-lisp/ert-tests.el (ert-test--which-file):
Use backtrace-frame slot accessor.
2018-08-03 08:53:02 -07:00
Gemini Lasswell
8a7620955b Add methods for strings to cl-print
* lisp/emacs-lisp/cl-print.el (cl-print-object) <string>: New method.
(cl-print-object-contents) <string>: New method.
(cl-print--find-sharing): Look in string property lists.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-3): Test
printing of long strings.
(cl-print-tests-4): Test printing of strings nested in other objects.
(cl-print-tests-strings, cl-print-tests-ellipsis-string): New
tests.
2018-08-03 08:53:02 -07:00
Gemini Lasswell
eba16e5e58 Support ellipsis expansion in cl-print
* lisp/emacs-lisp/cl-print.el (cl-print-object-contents): New
generic method.
(cl-print-object-contents) <cons, vector,cl-structure-object>: New
methods.
(cl-print-object) <cons>: Use cl-print-insert-ellipsis.
(cl-print-object) <vector, cl-structure-object>: Elide whole object if
print-level exceeded.  Use cl-print-insert-ellipsis.
(cl-print-insert-ellipsis, cl-print-propertize-ellipsis)
(cl-print-expand-ellipsis): New functions.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-4): Test
printing of objects nested in other objects.
(cl-print-tests-strings, cl-print-tests-ellipsis-cons)
(cl-print-tests-ellipsis-vector, cl-print-tests-ellipsis-struct)
(cl-print-tests-ellipsis-circular): New tests.
(cl-print-tests-check-ellipsis-expansion)
(cl-print-tests-check-ellipsis-expansion-rx): New functions.
2018-08-03 08:53:01 -07:00
Gemini Lasswell
df7371b84e Fix Edebug spec for cl-macrolet (bug#29919)
Add an Edebug matching function for cl-macrolet which keeps track of
its bindings and treats them as macros without Edebug specs when found
in the body of the expression.
* lisp/emacs-lisp/edebug.el (edebug--cl-macrolet-defs): New variable.
(edebug-list-form-args): Use it.
(edebug--current-cl-macrolet-defs): New variable.
(edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name)
(edebug-match-cl-macrolet-body): New functions.
* lisp/emacs-lisp/cl-macs.el (cl-macrolet): Use cl-macrolet-expr
for Edebug spec.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-cl-macrolet):
New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-use-cl-macrolet): New function.
2018-08-01 13:59:49 -07:00
Stephen Berman
22d463ed5c Fix todo-mode commands called on done items separator
The done items separator is not reachable by todo-mode navigation
commands, but it is e.g. by C-n and C-p.  Ensure that invoking
todo-mode commands with point on the separator does not result in
unexpected results, errors or file corruption (bug#32343).

* lisp/calendar/todo-mode.el (todo-insert-item--basic): Make
copying item and inserting item "here" noops when invoked on done
items separator.  Consolidate error handling of these cases.  Also
restrict "here" insertion to valid positions in the current
category, since this is simpler than the previous behavior of
inserting as the first item, which was moreover undocumented,
counterintuitive and superfluous.
(todo-set-item-priority, todo-move-item, todo-item-done)
(todo-item-start, todo-item-end): Make noops when invoked on done
items separator.

* test/lisp/calendar/todo-mode-tests.el: Require ert-x.
(todo-test--insert-item): Add formal parameters of
todo-insert-item--basic.
(todo-test--done-items-separator): New function.
(todo-test-done-items-separator01-bol)
(todo-test-done-items-separator01-eol)
(todo-test-done-items-separator02-bol)
(todo-test-done-items-separator02-eol)
(todo-test-done-items-separator03-bol)
(todo-test-done-items-separator03-eol)
(todo-test-done-items-separator04-bol)
(todo-test-done-items-separator04-eol)
(todo-test-done-items-separator05-bol)
(todo-test-done-items-separator05-eol)
(todo-test-done-items-separator06-bol)
(todo-test-done-items-separator06-eol)
(todo-test-done-items-separator07): New tests.
2018-08-01 14:42:57 +02:00
Stephen Berman
951c5a127f Fix wdired test failure when byte compiled (bug#32318)
* test/lisp/wdired-tests.el: Require wdired.  Defvar dired-query
to silence byte-compiler.
2018-07-31 00:42:52 +02:00
Stephen Berman
0252f7311f * test/lisp/wdired-tests.el (wdired-test-symlink-name): New test. 2018-07-30 14:12:50 +02:00
Paul Eggert
d7052cf393 Merge from origin/emacs-26
39d3e8b Fix last change in 'char_width'
67679f0 Add initial tests for wdired.el
2018-07-29 09:47:10 -07:00
Stephen Berman
67679f0c08 Add initial tests for wdired.el
* test/lisp/wdired-tests.el: New file.
2018-07-29 00:22:02 +02:00
Glenn Morris
4713f5d742 Merge from origin/emacs-26
bd52f37 (origin/emacs-26) ; Fix last change: only MinGW runtime 5.0.2...
024d20f Fix compilation with mingw.org's MinGW 5.x headers
38b6748 Update the list of special forms in the ELisp manual
8579105 Don't fail to indent-sexp before a full sexp (Bug#31984)
d24c5f2 Fix calls to modifications hooks in replace-buffer-contents
71a9151 * src/character.c (char_width): Support glyphs with faces.  (...
0feb673 Display raw bytes as belonging to 'eight-bit' charset
2e2f00f ; * doc/emacs/mule.texi (International Chars): Fix last change.
00561b5 Fix inaccurate text in the user manual
5cfb7a3 Copyedits in tramp.texi, improved example with bash's readline
6f8f358 Minor Tramp doc update
2585fcb File Shadowing is not available on MS Windows
39da592 ; Minor markup change in indent.texi
2f00ffe ; bookmark-jump: Add comment about last change.
2018-07-28 07:50:36 -07:00
Noam Postavsky
8579105393 Don't fail to indent-sexp before a full sexp (Bug#31984)
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Only signal error if the
initial forward-sexp fails.  Suppress scan-error forn any of the
forward-sexp calls after that.
* test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-cant-go): New
test.
2018-07-27 19:41:39 -04:00
Michael Albinus
22f549e305 ; More instrumentation for shadowfile-tests.el 2018-07-27 15:49:31 +02:00
Michael Albinus
a8f2d97b12 ; More instrumentation for shadowfile-tests.el 2018-07-26 16:12:15 +02:00
Paul Eggert
4a56ca5bbf %o and %x can now format signed integers
Optionally treat integers as signed numbers with %o
and %x format specifiers, instead of treating them as
a machine-dependent two’s complement representation.
This option is more machine-independent, allows formats
like "#x%x" to be useful for reading later, and is
better-insulated for future changes involving bignums.
Setting the new variable ‘binary-as-unsigned’ to nil
enables the new behavior (Bug#32252).
This is a simplified version of the change proposed in:
https://lists.gnu.org/r/emacs-devel/2018-07/msg00763.html
I simplified that proposal by omitting bitwidth modifiers, as
I could not find an any example uses in the Emacs source code
that needed them and doing them correctly would have been
quite a bit more work for apparently little benefit.
* doc/lispref/strings.texi (Formatting Strings):
Document that %x and %o format negative integers in a
platform-dependent way.  Also, document how to format
numbers so that the same values can be read back in.
* etc/NEWS: Document the change.
* src/editfns.c (styled_format): Treat integers as signed
numbers even with %o and %x, if binary-as-unsigned is nil.
Support the + and space flags with %o and %x, since they’re
about signs.
(syms_of_editfns): New variable binary-as-unsigned.
* test/src/editfns-tests.el (read-large-integer):
Test that maximal integers can be read after printing
with all integer formats, if binary-as-unsigned is nil.
2018-07-26 00:39:17 -07:00
Michael Albinus
244b682725 ; More instrumentation for shadowfile-tests.el 2018-07-25 22:04:34 +02:00
Michael Albinus
7d96ed541c ; More instrumentation for shadowfile-tests.el 2018-07-25 20:48:10 +02:00
Michael Albinus
2585fcb1d7 File Shadowing is not available on MS Windows
* doc/emacs/files.texi (File Shadowing): File Shadowing is not
available on MS Windows.

* test/lisp/shadowfile-tests.el (shadow-test00-clusters)
(shadow-test01-sites, shadow-test02-files)
(shadow-test03-expand-cluster-in-file-name)
(shadow-test04-contract-file-name, shadow-test05-file-match)
(shadow-test06-literal-groups, shadow-test07-regexp-groups)
(shadow-test08-shadow-todo, shadow-test09-shadow-copy-files):
Skip under MS Windows.
2018-07-25 17:34:55 +02:00
Michael Albinus
c67407e752 Instrument shadowfile{-tests} for error hunting on hydra.
* lisp/shadowfile.el (shadow-make-fullname): Use changed
`tramp-make-tramp-file-name' from Tramp 2.4.

* test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo):
Instrument test.  Suppress errors in cleanup.
(shadow-test09-shadow-copy-files): Suppress errors in cleanup.
2018-07-25 13:18:46 +02:00
Glenn Morris
64f94785c7 Merge from origin/emacs-26
f64c277 (origin/emacs-26) Let bookmark-jump override window-point (Bu...
1208aaa Omit keymap from subword-mode docstring (Bug#32212)
2b70b54 Prevent line-mode term from showing user passwords
5de4441 Check for special filenames in eshell (Bug#30724)
1b4b965 Fix indent-sexp of #s(...) (Bug#31984)
59e8533 Add save-match-data to abbreviate-file-name (Bug#32201)
47f75b1 Fix last change in editfns.c
671dc5a Fix calls to buffer modification hooks from replace-buffer-co...
cc4ceed ; etc/NEWS: Remove unnecessary reference to a bug number.
e0f33ea Fix Bug#32226
7308fa0 Improve doc strings of several variables in keyboard.c
2018-07-24 06:40:58 -07:00
Michael Albinus
e23727978d thread-join returns the result of finished thread
* doc/lispref/threads.texi (Basic Thread Functions):
* etc/NEWS: Document return value of `thread-join'.

* src/thread.c (invoke_thread_function, Fmake_thread)
(init_main_thread): Set result.
(Fthread_join): Propagate signals, and return result.
(Vmain_thread): New defvar.

* src/thread.h (struct thread_state): Add `result' field.

* test/src/thread-tests.el (threads-join): Test also return value.
(threads-join-error): New test.
(threads-mutex-signal): Check for propagation of `quit' signal.
2018-07-22 11:53:24 +02:00
Noam Postavsky
1b4b96597c Fix indent-sexp of #s(...) (Bug#31984)
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Look for a sexp that
ends after the current line.
* test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-go): New test.
2018-07-21 21:07:07 -04:00
Michael Albinus
e0f33ea394 Fix Bug#32226
* lisp/shadowfile.el (shadow-site-name, shadow-name-site):
Use "[-.[:word:]]+" as hostname regexp.  (Bug#32226)

* test/lisp/shadowfile-tests.el (shadow-test06-literal-groups)
(shadow-test07-regexp-groups, shadow-test08-shadow-todo)
(shadow-test09-shadow-copy-files): Skip if needed.
2018-07-21 12:29:06 +02:00
Glenn Morris
6ee0032461 Merge from origin/emacs-26
3e72298 Improve documentation of 'pcase-defmacro rx'
ba9b9bb Fix TTY colors breakage by 'clear-face-cache'
f56ad42 * admin/MAINTAINERS: Add files maintained by me (Michael Albi...
7a258fa Adapt shadowfile.el for Tramp  (Bug#4526, Bug#4846)
cb50077 Fix auth-source-delete (Bug#26184)
a4767a6 Avoid assertion violations in gnutls.c
90110f8 Don't use a literal "C-u" in ispell.el  help message text
f4e7f6d Improve documentation of 'seqp'
ed13639 Clarify usage and dependencies between several Flyspell features

Conflicts:
	etc/NEWS
	test/lisp/auth-source-tests.el
2018-07-20 10:00:32 -07:00
Michael Albinus
61de292c72 Fix (Bug#32218). Do not merge with master
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.4.26.2".
(customize-package-emacs-version-alist): Add Tramp version
integrated in Emacs 26.2.

* lisp/net/tramp.el (tramp-handle-file-truename):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-truename):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename): Fix problem
with trailing slash.  (Bug#32218)

* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Remove `tramp--test-emacs27-p' check.
2018-07-20 10:56:41 +02:00
Michael Albinus
7a258fa0bb Adapt shadowfile.el for Tramp (Bug#4526, Bug#4846)
* etc/NEWS: Mention changes in shadowfile.el.

* lisp/shadowfile.el (top): Require 'tramp instead of 'ange-ftp.
(shadow-cluster): New defstruct.
(shadow-make-cluster, shadow-cluster-name, shadow-cluster-primary)
(shadow-cluster-regexp, shadow-get-user)
(shadow-parse-fullname): Remove.
(shadow-info-file, shadow-todo-file, shadow-system-name)
(shadow-homedir, shadow-regexp-superquote, shadow-suffix)
(shadow-set-cluster, shadow-get-cluster, shadow-site-name)
(shadow-name-site, shadow-site-primary, shadow-site-cluster)
(shadow-read-site, shadow-parse-name, shadow-make-fullname)
(shadow-replace-name-component, shadow-local-file)
(shadow-expand-cluster-in-file-name, shadow-contract-file-name)
(shadow-same-site, shadow-file-match, shadow-define-cluster)
(shadow-define-literal-group, shadow-define-regexp-group)
(shadow-make-group, shadow-shadows-of-1, shadow-read-files)
(shadow-write-info-file, shadow-write-todo-file)
(shadow-initialize): Adapt variables and functions.

* test/lisp/shadowfile-tests.el: New file.
2018-07-18 16:51:56 +02:00
Paul Eggert
c70d22f70b Fix bug with eql etc. on NaNs
Fix a bug where eql, sxhash-eql, memql, and make-hash-table
were not consistent on NaNs.  Likewise for equal,
sxhash-equal, member, and make-hash-table.  Some of these
functions ignored NaN significands, whereas others treated
them as significant.  It's more logical to treat significands
as significant, and this typically makes eql a bit more
efficient on floats, with just one integer comparison instead
of one to three floating-point comparisons.
* doc/lispref/numbers.texi (Float Basics): Document that
NaNs are never numerically equal, but might be eql.
* src/fns.c (WORDS_PER_DOUBLE): Move to top level of this file.
(union double_and_words): Now named, and at the top level of this file.
(same_float): New function.
(Fmemql, Feql, internal_equal, cmpfn_eql): Use it, so that
the corresponding functions treat NaNs consistently.
(sxhash_float): Simplify based on above-mentioned changes.

* test/src/fns-tests.el (fns-tests-equality-nan): New test.
2018-07-18 03:18:53 -07:00
Noam Postavsky
cb50077b1e Fix auth-source-delete (Bug#26184)
* lisp/auth-source.el (auth-source-delete): Fix `auth-source-search'
call.
* test/lisp/auth-source-tests.el (auth-source-delete): New test.
2018-07-17 21:28:26 -04:00
Michael Albinus
798cbac170 Add variable main-thread, fix Bug#32169
* doc/lispref/threads.texi (Basic Thread Functions): Add example,
how to propagate signals to the main thread.  Describe variable
`main-thread'.  Document optional argument CLEANUP of
`thread-last-error'.

* src/thread.c (Fthread_last_error): Add optional argument
CLEANUP.  (Bug#32169)
(main-thread): New defvar.

* test/src/thread-tests.el (thread-last-error): Adapt declaration.
(main-thread): Declare.
(threads-main-thread): New test.
(threads-errors): Extend test.
2018-07-17 12:03:43 +02:00
Noam Postavsky
46d7c78632 ; Remove tracing for epg-tests (Bug#23561) 2018-07-16 07:12:07 -04:00
Noam Postavsky
6de91809a3 ; Trace epg-tests (Bug#23561) 2018-07-15 19:09:36 -04:00
Noam Postavsky
7acb87ab97 Don't test symmetric operations on gpg 2.0 (Bug#23561)
On the Hydra test machines, which have gpg 2.0, the symmetric tests
fail.
* test/lisp/epg-tests.el (with-epg-tests): Pass REQUIRE-PUBLIC-KEY to
`epg-tests-find-usable-gpg-configuration' and call it before
`epg-make-context' so that the latter uses the resulting cached
config.
(epg-tests-find-usable-gpg-configuration): Only allow gpg 2.0 for
symmetric operations.  Clear `epg--configurations' and don't pass
NO-CACHE to `epg-find-configuration'.
(epg-tests--config-program-alist): Use copy-tree to avoid modifying
the epg-config--program-alist cons values.
* test/lisp/emacs-lisp/package-tests.el (package-test-signed): Allow
running with gpg 2.0.
2018-07-15 16:26:22 -04:00
Michael Albinus
02db06fc8e Fix Bug#32147
* test/lisp/net/secrets-tests.el (secrets-test02-collections)
(secrets-test03-items): Test for both "Login" or "login"
collection.  (Bug#32147)
2018-07-15 09:47:08 +02:00
Noam Postavsky
b1ebc12339 Update package.el test for message format changes
* test/lisp/emacs-lisp/package-tests.el (package-test-signed): Update
the expected message.  The message was changed in 2018-06-25 "Reformat
package.el message strings for future l10n".
(with-package-test, with-fake-help-buffer): Add debug declarations.
2018-07-15 00:15:52 -04:00
Noam Postavsky
10a7e91956 Fix gpg detection for tests (Bug#23561)
* test/lisp/emacs-lisp/package-tests.el (package-test-signed): Stop
using epg-check-configuration and ignore-errors, they're redundant
because epg-find-configuration already does all that.
* test/lisp/epg-tests.el (epg-tests-find-usable-gpg-configuration):
Remove tracing.
(with-epg-tests): Skip test if no gpg config is found.
(epg-decrypt-1 epg-roundtrip-1, epg-sign-verify-1, epg-sign-verify-2)
(epg-import-1): Don't check gpg configuration at top-level, rely on
`with-epg-tests' instead.  Checking the gpg configuration requires a
valid HOME (or GNUPGHOME), which is provided by `with-epg-tests'.
2018-07-14 23:45:27 -04:00
Noam Postavsky
5936f6cdac ; Trace epg-tests gpg config finding (Bug#23561) 2018-07-14 09:01:39 -04:00
Glenn Morris
cda7e1850f Merge from origin/emacs-26
17ebb6e (origin/emacs-26) Use consistent function names in thread-tes...
1c86229 Fix format error in Faccept_process_output
b38b91a Lessen stack consumption in recursive read1
3eb4603 Match w32 paths in grep sans --null hits (Bug#32051)
5cc7c4b Fix previous make-network-process change
d6a1b69 Another documentation improvement in flyspell.el
9b49a8e Improve documentation of Flyspell
3744fda Provide feature 'threads
ef9025f Save the server alias on reconnect (Bug#29657)
db3874b Refer to "proper lists" instead of "true lists"
35e0305 Avoid turning on the global-minor-mode recursively
51bf4e4 Fix Bug#32085
2018-07-13 09:28:15 -07:00
Basil L. Contovounesios
1013e0392b Tweak subr-x.el substring functions
* lisp/emacs-lisp/subr-x.el (string-join): #'-quote function symbol.
(string-trim-left, string-trim-right):
Make better use of substring for minor speedup.
* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-string-trim-left, subr-x-test-string-trim-right)
(subr-x-test-string-remove-prefix)
(subr-x-test-string-remove-suffix): New tests.
2018-07-13 11:28:16 -04:00
Basil L. Contovounesios
70d702d3b1 Fix custom-available-themes file expansion
For discussion, see thread starting at
https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00222.html.
* lisp/custom.el: (custom-available-themes): Use directory-files
instead of performing arbitrary wildcard expansion in file names.
(custom-theme--load-path): Document return value.
* test/lisp/custom-tests.el: New file.
(custom-theme--load-path): New test.
2018-07-13 11:28:16 -04:00
Michael Albinus
17ebb6e5ae Use consistent function names in thread-tests.el
* test/src/thread-tests.el (threads-call-error, threads-custom)
(threads-errors, threads-sticky-point, threads-signal-early):
Rename, using naming convention to prefix with "threads-".
2018-07-13 14:28:12 +02:00
Tom Tromey
27980e3604 Make ash and lsh handle bignums
* src/data.c (ash_lsh_impl): Handle bignums.
* test/src/data-tests.el (data-tests-ash-lsh): New test.
2018-07-12 22:12:28 -06:00
Tom Tromey
cca0e79ea8 Make logb handle bignums
* src/floatfns.c (Flogb): Handle bignums.
* test/src/floatfns-tests.el (bignum-logb): New test.
2018-07-12 22:12:28 -06:00
Tom Tromey
3dea8f8f53 Make % and mod handle bignums
* src/data.c (Frem, Fmod): Handle bignums.
* src/lisp.h (CHECK_INTEGER_COERCE_MARKER): New macro.
* test/src/data-tests.el (data-tests-check-sign)
(data-tests-%-mod): New tests.
2018-07-12 22:12:28 -06:00
Tom Tromey
8fb995b9e3 Make min and max handle bignums
* src/data.c (minmax_driver): Handle bignums.
* test/src/data-tests.el (data-tests-minmax): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
a770fb4428 Make logcount handle bignums
* src/data.c (Flogcount): Handle bignums.
* test/src/data-tests.el (data-tests-logcount): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
0d868917ef Make 1+ and 1- handle bignums
* src/data.c (Fadd1, Fsub1): Handle bignums.
* test/src/data-tests.el (data-tests-1+, data-tests-1-): New tests.
2018-07-12 22:12:27 -06:00
Tom Tromey
025adce2cf Make abs handle bignums
* src/floatfns.c (Fabs): Handle bignums.
* test/src/floatfns-tests.el (bignum-abs): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
872faabbd8 Allow conversion of bignums to floats
* src/floatfns.c (extract_float, Ffloat): Handle bignums.
* src/lisp.h (XFLOATINT): Handle bignums.
* test/src/floatfns-tests.el (bignum-to-float): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
d14808cd27 Make format handle bignums
* src/editfns.c (styled_format): Handle bignums.
* test/src/editfns-tests.el (read-large-integer): Update.
(format-bignum): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
23eab9a6a6 Make number-to-string work for bignums
* src/data.c (Fnumber_to_string): Handle bignum.
* test/src/data-tests.el (data-tests-number-to-string): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
6d4bf2ceda Add some bignum tests
* test/src/data-tests.el (data-tests-bignum, data-tests-+)
(data-tests-/, data-tests-number-predicates): New tests.
* test/src/fns-tests (test-bignum-eql): New test.
* test/src/lread-tests (lread-long-hex-integer): Expect bignum.
* test/src/print-tests (print-bignum): New test.
2018-07-12 22:12:27 -06:00
Noam Postavsky
3eb4603b0d Match w32 paths in grep sans --null hits (Bug#32051)
* lisp/progmodes/grep.el (grep-regexp-alist): Add an optional part to
match paths starting with C: (other drive letters).
* test/lisp/progmodes/compile-tests.el
(compile-tests--grep-regexp-testcases)
(compile-tests--grep-regexp-tricky-testcases)
(compile-test-grep-regexps): New tests.
(compile--test-error-line): Return `compilation-message'.
2018-07-12 21:49:50 -04:00
Noam Postavsky
1222ff5275 Don't skip epg-tests even with gpg 2.0 (Bug#23561)
* test/lisp/epg-tests.el (epg-tests--config-program-alist): New
constant, which allows gpg2 version 2.0+.
(epg-tests-find-usable-gpg-configuration): Pass it to
epg-find-configuration.
2018-07-12 21:45:30 -04:00
Michael Albinus
3744fda5fa Provide feature 'threads
* src/thread.c (syms_of_threads): Provide feature "threads".

* test/src/thread-tests.el (top): Declare the functions.
(all): Use (featurep 'threads) check.
2018-07-12 10:49:06 +02:00
Basil L. Contovounesios
2fde6275b6 Add predicate proper-list-p
For discussion, see emacs-devel thread starting at
https://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00460.html.

* lisp/subr.el (proper-list-p): New function.
Implementation suggested by Paul Eggert <eggert@cs.ucla.edu> in
https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00138.html.
* doc/lispref/lists.texi (List Elements):
* etc/NEWS: Document proper-list-p.
* lisp/org/ob-core.el (org-babel-insert-result):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
* lisp/emacs-lisp/cl-macs.el (cl--make-usage-args): Use proper-list-p.
* lisp/emacs-lisp/ert.el (ert--proper-list-p): Remove.
Replaced by proper-list-p in lisp/subr.el.
(ert--explain-equal-rec): Use proper-list-length.
* lisp/format.el (format-proper-list-p): Remove.
Replaced by proper-list-p in lisp/subr.el.
(format-annotate-single-property-change): Use proper-list-p.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-proper-list-p):
Move from here...
* test/lisp/subr-tests.el (subr-tests--proper-list-length):
...to here, mutatis mutandis.
2018-07-09 19:00:43 -07:00
Noam Postavsky
e4ad2d1a8f Respect field boundaries in indent-line-to (Bug#32014)
* lisp/indent.el (indent-line-to): Use the back-to-indentation point
as the end-point of whitespace removal, rather than
backward-to-indentation which doesn't respect field boundaries.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): Don't expect to fail.
2018-07-09 20:08:13 -04:00
Noam Postavsky
6b8349a902 Merge from emacs-26
db3f779780 ; Test for Bug#32014
90d95b000c Explicitly reject :server and :nowait (Bug#31903)
917158f8c9 Fix Bug#32090

# Conflicts:
#	src/process.c
2018-07-09 20:06:27 -04:00
Noam Postavsky
7bcb697e19 Merge from emacs-26
65889a6d12 Fix bootstrap infloop in GNU/Linux alpha
48efd1c98b Minor fix of a recent documentation change
3302b7cd7f Mention the NSM in the gnutls variable doc strings
40c2ce743b Remove test code from last commit
e02d8e29c6 Fix Bug#32084
da5d6dbe39 Fix (length NON-SEQUENCE) documentation
2018-07-09 20:03:30 -04:00
Noam Postavsky
8f7d35cabd Stop using indent-line-to in lisp-indent-line (Bug#32014)
This is partial revert of "Remove ignored argument from
lisp-indent-line", because `indent-line-to' doesn't respect field
boundaries.
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-line): Use delete-region
and indent-to instead of `indent-line-to'.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): Expect to pass.

Don't merge to master, we will fix indent-line-to there instead.
2018-07-09 19:39:03 -04:00
Noam Postavsky
db3f779780 ; Test for Bug#32014
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): New test.
2018-07-09 19:39:03 -04:00
Michael Albinus
917158f8c9 Fix Bug#32090
* lisp/files-x.el (connection-local-normalize-criteria): Do not
use PROPERTIES anymore.
(connection-local-get-profiles): Rewrite, in order to accept any
property as optional.  (Bug#32090)
(connection-local-set-profiles):
Adapt ´connection-local-normalize-criteria' call.

* test/lisp/files-x-tests.el
(files-x-test-connection-local-set-profiles)
(files-x-test-hack-connection-local-variables-apply): Extend tests.
2018-07-09 16:03:49 +02:00
Michael Albinus
40c2ce743b Remove test code from last commit 2018-07-08 13:08:05 +02:00
Michael Albinus
e02d8e29c6 Fix Bug#32084
* test/lisp/net/dbus-tests.el (dbus-test02-register-service-own-bus):
Unset $DISPLAY when calling dbus-launch, in order to avoid
possible X11 authentication errors.  (Bug#32084)
2018-07-08 13:02:19 +02:00
Tom Tromey
38ea8e147a Fix Tcl indentation in a namespace
Fixes bug#32035
* lisp/progmodes/tcl.el (tcl-proc-list): Add "namespace".
* test/lisp/progmodes/tcl-tests.el (tcl-mode-namespace-indent): New
test.
2018-07-03 22:13:27 -06:00
João Távora
4ee502ca9d Adjust previous jsonrpc change
(nth 2) is probably a better alternative to caddr, and in Emacs 26.1
we can pass 0 as :service to automatically find an available port.

* lisp/jsonrpc.el (jsonrpc--call-deferred): Use cl-caddr.

* test/lisp/jsonrpc-tests.el
(jsonrpc--call-with-emacsrpc-fixture): Pass 0 as :service to when
making the listen server.
2018-07-03 08:21:56 +01:00
João Távora
332f4656b0 Make lisp/jsonrpc.el work with Emacs 25.1
* jsonrpc.el (Package-Requires): Require Emacs 25.1
(jsonrpc-lambda): Use cl-gensym.
(jsonrpc--call-deferred): Caddr doesn't exist in
emacs 25.1.

* jsonrpc-tests.el
(jsonrpc--call-with-emacsrpc-fixture): New function.
(jsonrpc--with-emacsrpc-fixture): Use it.
(deferred-action-complex-tests): Adjust test for Emacs 25.1
2018-07-02 17:30:35 +01:00
Michael Albinus
8b6812fd90 Minor change in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test03-file-name-host-rules):
Cleanup before running the test.
2018-07-01 11:58:55 +02:00
João Távora
8af26410a9 Add lisp/jsonrpc.el
* doc/lispref/text.texi (Text): Add JSONRPC.
(JSONRPC): New node.

* etc/NEWS (New Modes and Packages in Emacs 27.1): Mention jsonrpc.el

* lisp/jsonrpc.el: New file.

* test/lisp/jsonrpc-tests.el: New file.
2018-06-30 19:46:06 +01:00
Michael Albinus
45390596e6 Sync with Tramp 2.4.0
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.0".

* lisp/net/tramp-gvfs.el (tramp-gvfs-handler-mounted-unmounted):
Ignore unknown GVFS methods.

* test/lisp/net/tramp-tests.el (tramp-test42-asynchronous-requests):
Tag as :unstable.
2018-06-29 10:17:46 +02:00
Michael Albinus
1f5037925b Sync with Tramp 2.3.4. Do not merge with master
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.4".

* lisp/net/tramp-smb.el (tramp-smb-handle-delete-directory):
Check, that the directory has been removed indeed.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links): Adapt test.
(tramp--test-emacs25-p): New defun.
(tramp-test34-vc-registered): Use it.
2018-06-27 13:08:18 +02:00
Jean-Christophe Helary
61f73703c7 Reformat package.el message strings for future l10n
* lisp/emacs-lisp/package.el (package-buffer-info)
(package--download-one-archive, package-install-selected-packages)
(package-autoremove, describe-package-1, package-menu-toggle-hiding)
(package-menu-hide-package, package-menu--mark-upgrades-1)
(package-menu--list-to-prompt, package-menu--prompt-transaction-p)
(package-menu-execute, package-menu--find-and-notify-upgrades):
Reformat message strings to remove need for plural computation.  Try
to put full sentences in source string literals.
* test/lisp/emacs-lisp/package-tests.el
(package-test-describe-package): Update to match new message format.
2018-06-25 19:18:55 -04:00
Paul Eggert
d0e2a341dd (format "%d" F) now truncates floating F
Problem reported by Paul Pogonyshev (Bug#31938).
* src/editfns.c: Include math.h, for trunc.
(styled_format): For %d, truncate floating-point numbers and
convert -0 to 0, going back to how Emacs 26 did things.
* doc/lispref/strings.texi (Formatting Strings):
Document behavior of %o, %d, %x, %X on floating-point numbers.
* src/floatfns.c (trunc) [!HAVE_TRUNC]: Rename from emacs_trunc
and make it an extern function, so that editfns.c can use it.
All callers changed.
* test/src/editfns-tests.el (format-%d-float): New test.
2018-06-25 12:23:08 -07:00
Tom Tromey
cd5bb4bf3d Fix two tcl-mode defun-related bugs
Fixes bug#23565
* lisp/progmodes/tcl.el (tcl-mode): Set beginning-of-defun-function
and end-of-defun-function.
(tcl-beginning-of-defun-function, tcl-end-of-defun-function): New
defuns.
* test/lisp/progmodes/tcl-tests.el: New file.
2018-06-24 11:33:02 -06:00
Glenn Morris
b81e193ac0 Merge from origin/emacs-26
5cb3991 Fix a typo in emacs-lisp-intro.texi
d6aa55e Avoid segfaults in replace-buffer-contents with large buffers
d22b8d1 Adjust for scaling for mode-line popup menus (Bug#31880)
3d2e3dc Change name of `seqp' argument (Bug#26411)
40e1db8 Change index of ";" to better reflect it's usage (Bug#31623)
d289e7e Fix bug of 'mouse-drag-and-drop-region' to detect edges of re...
e292c09 Fix #'fun handling inside `labels' (Bug#31792)
2018-06-23 07:50:59 -07:00
Michael Albinus
e6476c914e Improve backward compatibility of Tramp
* lisp/net/tramp-adb.el (tramp-adb-handle-exec-path):
* lisp/net/tramp-sh.el (tramp-sh-handle-exec-path): Use ´file-remote-p'.
(tramp-get-ls-command-with): Handle busybox specially.

* test/lisp/net/tramp-tests.el (tramp-test34-exec-path): Check for
`fboundp'.  Use `file-remote-p'.  Hide compiler warning for older
Emacsen.
2018-06-22 16:17:17 +02:00
Michael Albinus
6f649e77b8 Implement command completion in remote shells. (Bug#31704)
* doc/lispref/files.texi (Locating Files): Describe optional
argument REMOTE of `executable-find'.
(Magic File Names): Add `exec-path'.

* doc/lispref/processes.texi (Subprocess Creation): Describe
function `exec-path'.

* doc/misc/tramp.texi (Remote programs): Explain refresh of search
paths by `tramp-cleanup-this-connection'.

* etc/NEWS: Mention 'exec-path' and 'executable-find'.

* lisp/files.el (exec-path): New defun.
(executable-find): Add optional argument REMOTE.

* lisp/shell.el (shell-completion-vars): Set `comint-file-name-prefix'.
(shell--command-completion-data): Use `(exec-path)'.  (Bug#31704)

* lisp/net/ange-ftp.el (exec-path):
* lisp/net/tramp.el (tramp-file-name-for-operation):
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist)
<exec-path>: Add handler.

* lisp/net/tramp-adb.el (tramp-adb-handle-exec-path): New defun.
(tramp-adb-maybe-open-connection): Do not set "remote-path"
connection property.

* lisp/net/tramp-compat.el (tramp-compat-exec-path): New defun.

* lisp/net/tramp-sh.el (tramp-sh-handle-exec-path): New defun.

* lisp/net/tramp.el (tramp-eshell-directory-change): Use it.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test38-make-nearby-temp-file)
(tramp-archive-test41-file-system-info)
(tramp-archive-test43-auto-load)
(tramp-archive-test43-delay-load): Rename.

* test/lisp/net/tramp-tests.el (tramp-test34-exec-path): New test.
(tramp-test36-make-auto-save-file-name)
(tramp-test37-find-backup-file-name)
(tramp-test38-make-nearby-temp-file)
(tramp-test39-special-characters)
(tramp-test39-special-characters-with-stat)
(tramp-test39-special-characters-with-perl)
(tramp-test39-special-characters-with-ls, tramp-test40-utf8)
(tramp-test40-utf8-with-stat, tramp-test40-utf8-with-perl)
(tramp-test40-utf8-with-ls, tramp-test41-file-system-info)
(tramp-test42-asynchronous-requests, tramp-test43-auto-load)
(tramp-test43-delay-load, tramp-test43-recursive-load)
(tramp-test43-remote-load-path, tramp-test44-unload): Rename.
2018-06-20 12:13:56 +02:00
Noam Postavsky
e292c0973c Fix #'fun handling inside `labels' (Bug#31792)
* lisp/emacs-lisp/cl.el (labels): Apply the equivalent of the
cl-labels change from 2015-01-16 "* lisp/emacs-lisp/cl-macs.el: Fix
last change".
* test/lisp/emacs-lisp/cl-tests.el (labels-function-quoting): New
test.
* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Improve docstring,
link to relevant manual page.
* doc/misc/cl.texi (Function Bindings): Don't imply that function
cells of symbols are modified by cl-flet.  Don't claim that cl-flet or
cl-labels affect references of the form (quote FUNC).
2018-06-19 20:02:16 -04:00
João Távora
1e2e48c13c Skip a json.c test unless functions being tested exist
* test/src/json-tests.el
(json-parse-with-custom-null-and-false-objects): Skip this test
unless functions being tested exist.
2018-06-19 03:02:09 +01:00
João Távora
d37d30cef5 Mark a specific electric-pair-mode test as an expected failure
See https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00535.html

* test/lisp/electric-tests.el
(electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings):
Mark as failing.
2018-06-19 02:53:10 +01:00
Glenn Morris
b455a1b2a8 Merge from origin/emacs-26
63ba73a Fix documentation of ':propertize' in mode-line-format
22aa665 Reject invalid 5-byte sequences when detecting UTF-8 encoding
0d3c358 Fix 'replace-buffer-contents' in multibyte buffers
c79a627 Update etc/NEWS for mail-source-movemail-program change
63f1dc4 Improve movemail default
0b1a2ae Delete description of deleted Customize functions
fcd66d0 Keep vc-print-log from putting point at buffer end (Bug#31764)

Conflicts:
	etc/NEWS
2018-06-18 12:14:25 -07:00
Glenn Morris
ef02c9fd1a Merge from origin/emacs-26
5bdc344 ; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744)
b6b793b ; test/Makefile.in: Add TEST_INTERACTIVE option (Bug#31744).
1aa906f Make 'tags' targets respect --with-silent-rules (Bug#31744)

Conflicts:
	test/Makefile.in
	test/README
2018-06-18 12:14:24 -07:00
Glenn Morris
2d1b774dbc * test/lisp/simple-tests.el (simple-tests-async-shell-command-30280):
Use the correct emacs executable, not first in PATH.
2018-06-17 10:22:28 -07:00
Michael Albinus
39ccbacf9c Cleanup secrets-tests
* test/lisp/net/secrets-tests.el (secrets-test03-items)
(secrets-test04-search): Cleanup "session" collection initially.
2018-06-17 11:19:16 +02:00
Noam Postavsky
6021e1db92 Don't forget to analyze args of lambda lifted functions (Bug#30872)
* lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): New function.
(cconv--convert-function): Extracted from here.
(cconv-convert): Also use it here, in the lambda lifted case, so that
mutated args are properly accounted for.
* test/lisp/emacs-lisp/cconv-tests.el: New test.
2018-06-16 18:34:19 -04:00
Noam Postavsky
05345babc9 Fix off by one error in python-mode assertion (Bug#30964)
* lisp/progmodes/python.el (python-nav-end-of-statement): Don't assert
that string-start is strictly greater than last-string-end, because
the string end is a position outside of the string and may therefore
be the same as the following string's start.
* test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-2):
New test.
2018-06-16 18:34:19 -04:00
Paul Eggert
e1284341fd Fix byte compilation of (eq foo 'default)
Backport from master.
Do not use the symbol ‘default’ as a special marker.
Instead, use a value that cannot appear in the program,
improving on a patch proposed by Robert Cochran (Bug#31718#14).
* lisp/emacs-lisp/bytecomp.el (byte-compile--default-val):
New constant.
(byte-compile-cond-jump-table-info)
(byte-compile-cond-jump-table): Use it instead of 'default.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(byte-opt-testsuite-arith-data): Add a test for the bug.
2018-06-16 09:44:05 -07:00
Paul Eggert
9af399fd80 Fix byte compilation of (eq foo 'default)
Do not use the symbol ‘default’ as a special marker.
Instead, use a value that cannot appear in the program,
improving on a patch proposed by Robert Cochran (Bug#31718#14).
* lisp/emacs-lisp/bytecomp.el (byte-compile--default-val):
New constant.
(byte-compile-cond-jump-table-info)
(byte-compile-cond-jump-table): Use it instead of 'default.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(byte-opt-testsuite-arith-data): Add a test for the bug.
2018-06-16 07:48:51 -07:00
Eli Zaretskii
0d3c35807d Fix 'replace-buffer-contents' in multibyte buffers
* src/editfns.c (buffer_chars_equal): Pass a byte position to
BUF_FETCH_CHAR_AS_MULTIBYTE, not a character position.
(Bug#31837)

* test/src/editfns-tests.el (replace-buffer-contents-bug31837):
New test.
2018-06-15 11:27:56 +03:00
João Távora
51adab5de2 Also allow custom false and null when serializing to JSON
* doc/lispref/text.texi (Parsing JSON): Describe new arguments of
json-serialize and json-insert.

* src/json.c (enum json_object_type, struct json_configuration):
Move up in file before first usage.
(lisp_to_json_toplevel, lisp_to_json_toplevel_1, lisp_to_json):
Accept a struct json_configuration*.
(Fjson_serialize, Fjson_insert): Accept multiple args.
(json_parse_args): Accept new boolean configure_object_type.

* test/src/json-tests.el
(json-serialize, json-insert): Update forward decls.
(json-parse-with-custom-null-and-false-objects): Add assertions for
json-serialize.
2018-06-15 00:13:00 +01:00
João Távora
9348039ed4 Support custom null and false objects when parsing JSON
* doc/lispref/text.texi (Parsing JSON): Describe new :null-object
and :false-object kwargs to json-parse-string and
json-parse-buffer.

* src/json.c
(struct json_configuration): New type.
(json_to_lisp): Accept a struct json_configuration* param.
(json_parse_args): Rename from json_parse_object_type.
(Fjson_parse_string): Rework docstring.
(Fjson_parse_string, Fjson_parse_buffer): Update call to
json_to_lisp.
(syms_of_json): Two new syms, QCnull_object and QCfalse_object.

* test/src/json-tests.el
(json-parse-with-custom-null-and-false-objects): New test.
2018-06-15 00:11:56 +01:00
Damien Cassou
8cb9beb321
Fix pretty-printing empty objects as null
* lisp/json.el (json-pretty-print): Force distinction between empty
  objects and null.
(json-encode-list): Remove responsibility to print "null" as this
value is not a list.
(json-encode): Give higher precedence to lists so that an empty list
is printed as an empty object, not as "null".

* test/lisp/json-tests.el (test-json-encode): Add many tests to check
  the behavior of pretty-printing.
2018-06-14 11:01:49 +02:00
Noam Postavsky
c912db0836 Give warning if losing value to defvaralias (Bug#5950)
* src/eval.c (Fdefvaralias): Call `display-warning' if the alias
target has a non-eq value to the variable being aliased.
* test/src/eval-tests.el (defvaralias-overwrite-warning): New test.
2018-06-12 07:40:33 -04:00
Noam Postavsky
5bdc344780 ; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744)
Before:

    make -C test SELECTOR='\"foo\"'
    make -C test SELECTOR='(quote (tag :some-tag))'

After:

    make -C test SELECTOR='"foo"'
    make -C test SELECTOR='(tag :some-tag)'

* test/Makefile.in: Use single quotes around the command line call to
ert, this means the user doesn't have to backslash escape double
quotes when writing lisp strings for the selector.  Also wrap the
SELECTOR value in (quote ...) so the user won't have to type it
in (and not get tempted to use the '... reader syntax form which would
now fail to work due to using single quotes around the whole shell
arg).
* test/README: Update instructions accordingly.
2018-06-12 07:26:06 -04:00
Noam Postavsky
b6b793bd77 ; test/Makefile.in: Add TEST_INTERACTIVE option (Bug#31744).
* test/README: Note the new option.
2018-06-12 07:26:06 -04:00
Noam Postavsky
962547791e Merge from emacs-26
8a1576cc03 Fix term.el cursor movement at bottom margin (Bug#31690)
2018-06-10 18:47:27 -04:00
Noam Postavsky
7adf1a361d Merge from emacs-26
3434edc731 Enlarge DUMPED_HEAP_SIZE for 64-bit Windows builds
36bbdfc017 Update Unicode data files to version 11.0.0 of Unicode
b7b7a5f4f3 * etc/NEWS: Belatedly call out vc-hg changes in v26.1.  (B...
5b6f8b54d1 Clarify the documentation of 'dired-recursive-deletes'
9db97b49cd ; * etc/DEBUG: Add information about debugging libXft prob...
0214ffbe60 Clarify doc string of 'update-glyphless-char-display'
ef35d405b1 Clarify subtle issues with 'eq' in byte-compiled code
c6ef3c8321 Make cl-print respect print-quoted (bug#31649)
26b52ac40e Fix unexpected jumps of window-point in 'set-window-config...
4af077ab4d * etc/emacs.appdata.xml: Update Emacs screenshot.
e5ab25deae Fix cursor movement by 'next-logical-line' after 'next-line'
d20beef5f1 Fix prompt in bookmark.el (Bug#24726)
c57e7eaae8 Improve documentation of 'empty' whitespace-style

# Conflicts:
#	etc/NEWS
2018-06-10 18:43:49 -04:00
Noam Postavsky
8a1576cc03 Fix term.el cursor movement at bottom margin (Bug#31690)
* lisp/term.el (term-handle-ansi-escape) <\E[B cud>: Allow moving the
cursor to the bottom margin line, rather than stopping one line
before.
2018-06-10 17:57:50 -04:00
Eli Zaretskii
36bbdfc017 Update Unicode data files to version 11.0.0 of Unicode
* admin/unidata/UnicodeData.txt:
* admin/unidata/SpecialCasing.txt:
* admin/unidata/NormalizationTest.txt:
* admin/unidata/copyright.html:
* admin/unidata/BidiMirroring.txt:
* admin/unidata/BidiBrackets.txt: Import from Unicode 11.0.
* admin/notes/unicode: Update the URL for OTF script tags.

* lisp/international/mule-cmds.el (ucs-names): Update unused ranges.
* lisp/international/fontset.el (script-representative-chars): Add
hanifi-rohingya, old-sogdian, sogdian, dogra, gunjala-gondi,
makasar, and medefaidrin.
(otf-script-alist): Add old-hungarian.
* lisp/international/characters.el (tbl): Add syntax entries for
Supplemental Mathematical Operators, Miscellaneous Symbols and
Arrows, and Supplemental Punctuation.
Update the list of wide characters.

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part2): Update to match
admin/unidata/NormalizationTest.txt.

* doc/lispref/nonascii.texi (Character Properties): Update the
reference to the Unicode Standard.
* doc/misc/efaq.texi (New in Emacs 26):
* etc/NEWS: Mention compatibility with Unicode 11.0.
2018-06-09 15:41:21 +03:00
Gemini Lasswell
c6ef3c8321 Make cl-print respect print-quoted (bug#31649)
* lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Observe
print-quoted when printing quote and its relatives.  Add printing of
'function' as #'.
2018-06-07 08:27:43 -07:00
João Távora
3509aaaefe Accept plists when serializing and parsing JSON
* doc/lispref/text.texi (Parsing JSON): Mention plist support.

* src/json.c (lisp_to_json_toplevel_1): Serialize plists to json.
(Fjson_serialize): Mention plists in docstring.
(enum json_object_type): Add json_object_plist.
(json_to_lisp): Parse JSON into plists.
(json_parse_object_type): Consider plists.
(Fjson_parse_string): Mention plists in docstring.
(syms_of_json): New Qplist sym_of_json.
(lisp_to_json): Update comment.

* test/src/json-tests.el (json-serialize/object)
(json-parse-string/object): New plist tests.
2018-06-07 12:30:39 +01:00
Damien Cassou
47ccee220a
Test checking that auth-source-pass backend is correctly installed
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-can-start-from-auth-source-search): Add test.
2018-06-05 15:53:33 +02:00
Jelle Licht
1d2551f8e7
Fix auth-source-pass.el to properly handle special inputs
* lisp/auth-source-pass.el (auth-source-pass-search): Warn when
passing multiple hosts in SPEC. Early return and warn when passing a
wildcard as host in SPEC. Early return when host is nil.
* test/lisp/auth-source-pass-tests.el (auth-source-pass-any-host,
auth-source-pass-undefined-host): Add corresponding tests.
2018-06-05 15:51:26 +02:00
Damien Cassou
b43ed61ef9
auth-source-pass: Take care of matching hosts when port is provided
* lisp/auth-source-pass.el (auth-source-pass--find-match): Add PORT
parameter and reorganize code by extracting `find-match-unambiguous'.
(auth-source-pass--find-match-unambiguous): New function.
(auth-source-pass--build-result): Fix the call to `find-match'.
(auth-source-pass--hostname, auth-source-pass--hostname-with-user,
auth-source-pass--user): Remove functions.
* test/lisp/auth-source-pass-tests.el: Fix the calls to `find-match'.
(auth-source-pass-find-host-without-port) Add corresponding test.
2018-06-05 15:51:14 +02:00
Damien Cassou
a52661b58b
Add missing test cases to auth-source-pass-tests.el
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-build-result-passes-full-host-to-find-match): Add
missing test cases.
2018-06-05 15:51:09 +02:00
Damien Cassou
5b31e6de99
Add a test to auth-source-pass-tests.el
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-build-result-passes-full-host-to-find-match): Add
test making sure find-match is called with full host.
2018-06-05 15:51:00 +02:00
Damien Cassou
53f044c22f
Fix indentation in auth-source-pass-tests.el
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-only-return-entries-that-can-be-open): Fix indentation.
2018-06-05 15:50:54 +02:00
Edison Ibañez
59d44b528e
* test/lisp/auth-source-pass-tests.el: Add assertions for host:port 2018-06-05 15:50:46 +02:00
Michael Albinus
7c1fa17955 Fix selinux test in files-tests.el
* test/lisp/files-tests.el
(files-tests-file-name-non-special-set-file-selinux-context):
Adapt test.
2018-06-05 09:43:34 +02:00
Gemini Lasswell
5d448ca98c Make cl-print respect print-level and print-length (bug#31559)
* lisp/emacs-lisp/cl-print.el (cl-print--depth): New variable.
(cl-print-object) <cons>: Print ellipsis if printing depth greater
than 'print-level' or length of list greater than 'print-length'.
(cl-print-object) <vector>: Truncate printing with ellipsis if
vector is longer than 'print-length'.
(cl-print-object) <cl-structure-object>: Truncate printing with
ellipsis if structure has more slots than 'print-length'.
(cl-print-object) <:around>: Bind 'cl-print--depth'.
* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-3, cl-print-tests-4): New tests.

(cherry picked from commit 0f48d18fd2)
2018-06-04 08:57:10 -07:00