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

2681 Commits

Author SHA1 Message Date
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