1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
Commit Graph

3522 Commits

Author SHA1 Message Date
Glenn Morris
ef8bd7d856 Update tests for recent changes
* test/lisp/descr-text-tests.el (descr-text-test-desc):
Update for recent change to describe-char-eldoc.
* test/lisp/progmodes/elisp-mode-tests.el
(elisp--highlight-function-argument-indexed)
(elisp--highlight-function-argument-keyed-1)
(elisp--highlight-function-argument-keyed-2):
Update for recent change to elisp--highlight-function-argument.
2020-07-08 17:35:54 -07:00
Glenn Morris
3b36b38713 Merge from origin/emacs-27
59e768d64a Fix undefined behavior in json.c (Bug#42113)
cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el
0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix.
b9abf5ceb2 Improve do string of 'man'
b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...
2020-07-07 07:50:39 -07:00
Mattias Engdegård
58e27ebb92 Don't confuse errors with nil in bytecomp-tests.el
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-check-1)
(bytecomp-explain-1, test-byte-opt-arithmetic, bytecomp-lexbind-check-1)
(bytecomp-lexbind-explain-1):
If an expression raises an error when evaluated, don't treat it as if
it had succeeded with the value nil; use 'bytecomp-check-error' as the
result instead.
2020-07-05 17:44:34 +02:00
Paul Eggert
d0872638b4 * test/src/fns-tests.el (test-secure-hash): Test getrandom format. 2020-06-29 09:55:33 -07:00
Philipp Stephani
59e768d64a Fix undefined behavior in json.c (Bug#42113)
* src/json.c (lisp_to_json_toplevel_1, Fjson_parse_string): Check
whether input strings are actually strings.

* test/src/json-tests.el (json-parse-string/wrong-type)
(json-serialize/wrong-hash-key-type): New regression tests.
2020-06-29 12:32:56 +02:00
Michael Albinus
35e881c530 Fix problem in tramp-smb.el
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files):
Use `directory-file-name'.

* test/lisp/net/tramp-tests.el (trace): Require it.
(tramp--test-instrument-test-case): Print also function traces.
(tramp--test-smb-p): New defun.
(tramp-test03-file-name-method-rules)
(tramp-test05-expand-file-name-relative)
(tramp-test21-file-links, tramp--test-windows-nt-or-smb-p)
(tramp--test-check-files): Use it.
2020-06-23 21:18:08 +02:00
Eli Zaretskii
30ff2433b1 Minor improvements as followup to recent RGB string-parsing change
* src/xfaces.c (Finternal_color_values_from_color_spec): Rename to...
(Fcolor_values_from_color_spec): ...this.  Callers changed.
Rename the argument to SPEC and improve the doc string.
(parse_color_spec, parse_float_color_comp, parse_hex_color_comp):
Improve commentary.
(parse_color_spec): Rename the argument S to SPEC.

* etc/NEWS: Mention 'color-values-from-color-spec'.
2020-06-22 18:32:01 +03:00
Mattias Engdegård
6242605731 Fix spurious error in beginning-of-defun in pascal-mode (bug#41740)
* lisp/progmodes/pascal.el (pascal-beg-of-defun):
Ignore errors in forward-sexp.
* test/lisp/progmodes/pascal-tests.el (pascal-beg-of-defun): New test.
2020-06-22 09:51:17 +02:00
Mattias Engdegård
73daab9991 Preserve point in pascal-mode completion (bug#41740)
Failure to do so caused errors in several cases.
Reported by Shinichi Sakata.

* lisp/progmodes/pascal.el (pascal-type-completion)
(pascal-completion): Wrap code that may move point in save-excursion.
* test/lisp/progmodes/pascal-tests.el: New file.
2020-06-22 09:51:11 +02:00
Mattias Engdegård
9fe2bdb88a Consolidate #RGB string parsers
Use a single parser of color strings in the #RGB, rgb:R/G/B and
rgbi:R/G/B formats, replacing four existing ones.  Previously,
error-checking was spotty, handling of the rgbi: format not always
present, and normalization of the result was sometimes incorrect.

* src/dispextern.h: New prototype.
* src/xfaces.c (parse_hex_color_comp, parse_float_color_comp)
(parse_color_spec, Finternal-color_values_from_color_spec): New functions.
* test/src/xfaces-tests.el (xfaces-internal-color-values-from-color-spec):
New test.
* lisp/term/tty-colors.el (tty-color-standard-values):
Use internal-color-values-from-color-spec, replacing old parser.
* src/nsterm.m (ns_get_color):
* src/w32fns.c (x_to_w32_color):
* src/xterm.c (x_parse_color): Use parse_color_spec, replacing old
parsers.
(HEX_COLOR_NAME_LENGTH): Remove #define.
2020-06-21 21:22:26 +02:00
Basil L. Contovounesios
a4d3897d8f Replace some uses of cl-mapcan with mapcan
* lisp/progmodes/project.el (project-files, project-files):
* lisp/progmodes/xref.el (xref-backend-references)
(xref--convert-hits):
* test/lisp/emacs-lisp/package-tests.el
(package-test-strip-version): Replace cl-mapcan with equivalent
calls to mapcan.
2020-06-21 14:33:16 +01:00
Michael Albinus
f18b035763 Fix remaining problems with tramp-crypt.el
* lisp/net/tramp-compat.el (tramp-compat-make-temp-file):
Simplify implementation.

* lisp/net/tramp-crypt.el (tramp-crypt-handle-delete-file)
(tramp-crypt-handle-file-attributes, tramp-crypt-handle-file-system-info)
(tramp-crypt-handle-make-directory): Let-bind `tramp-crypt-enabled' to nil.

* lisp/net/tramp.el (tramp-file-name-for-operation): Fix for operations
with two arguments.
(tramp-handle-load): Suppress `signal-hook-function' when NOERROR
is non-nil.

* test/lisp/net/tramp-tests.el (tramp-test41-utf8)
(tramp-test41-utf8-with-stat, tramp-test41-utf8-with-perl)
(tramp-test41-utf8-with-ls): Skip if needed.
2020-06-21 15:19:51 +02:00
Basil L. Contovounesios
1ecd350f38 Evaluate some unnecessarily quoted lambdas
* lisp/cedet/semantic/complete.el
(semantic-displayer-tooltip-max-tags):
* lisp/emacs-lisp/benchmark.el (benchmark-run-compiled):
* lisp/emacs-lisp/package.el (package--default-summary)
(package-menu-filter-by-version):
* lisp/eshell/em-pred.el (eshell-pred-file-time):
* lisp/progmodes/verilog-mode.el (verilog-auto-lineup)
(verilog-auto-reset-widths, verilog-auto-arg-format)
(verilog-auto-inst-vector, verilog-auto-inst-template-numbers):
* lisp/textmodes/bibtex.el (bibtex-dialect):
* test/lisp/autoinsert-tests.el
(autoinsert-tests-define-auto-insert-before)
(autoinsert-tests-define-auto-insert-after): Remove some unnecessary
quoting around anonymous functions.
2020-06-21 13:42:14 +01:00
Basil L. Contovounesios
4cc6854cd4 Silence some warnings in tests
* test/lisp/emacs-lisp/package-tests.el
(package-test-suffix-matches): Evaluate lambda.
(package-test-list-filter-marked):
* test/lisp/vc/vc-tests.el
(vc-test--run-maybe-unsupported-function):
* test/src/undo-tests.el (undo-test-skip-invalidated-markers):
Silence "unused local variable" warnings.
* test/lisp/imenu-tests.el (imenu-simple-scan-deftest): Fix
docstring.  Don't shadow global major-mode.
2020-06-21 12:50:34 +01:00
Basil L. Contovounesios
453d30d92c Improve battery.el UPower support
For discussion, see the following threads:
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00843.html
https://lists.gnu.org/archive/html/emacs-devel/2020-02/msg00042.html
https://lists.gnu.org/archive/html/emacs-devel/2020-02/msg00282.html

* etc/NEWS: Announce that battery-upower is enabled by default.

* lisp/battery.el (battery-upower-device): Accept both battery and
line power device names, or a list thereof (bug#39491).
(battery-upower-line-power-device): Remove user option; superseded
by battery-upower-device.
(battery-upower-subscribe): New user option.
(battery-status-function): Check whether a UPower service is
provided without activating it.
(display-battery-mode): Subscribe to UPower signals when using
battery-upower.
(battery-upower): Merge data from multiple power sources.  Calculate
terse battery status %b based on average battery load percentage
rather than coarse and often missing BatteryLevel (bug#39491).  Add
support for average temperature %d.

(battery-upower-dbus-service)
(battery-upower-dbus-interface)
(battery-upower-dbus-path)
(battery-upower-dbus-device-interface)
(battery-upower-dbus-device-path)
(battery-upower-device-all-properties): Rename to...
(battery-upower-service)
(battery-upower-interface)
(battery-upower-path)
(battery-upower-device-interface)
(battery-upower-device-path)
(battery--upower-device-properties): ...these, respectively.

(battery-upower-device-list): Rename to...
(battery--upower-devices) ...this.  Return a flat list of device
names determined by battery-upower-device.
(battery-upower-types, battery-upower-states)
(battery-upower-device-property, battery-upower-device-autodetect):
Remove.
(battery--upower-signals): New variable.
(battery--upower-signal-handler, battery--upower-props-changed)
(battery--upower-unsubscribe, battery--upower-subsribe)
(battery--upower-state): New functions.

* test/lisp/battery-tests.el (battery-upower-state)
(battery-upower-state-unknown): New tests.
2020-06-18 13:11:17 +01:00
Basil L. Contovounesios
23a148c950 Various battery.el improvements (bug#41808)
* lisp/battery.el: Mention BSD support in Commentary.  Don't load
preloaded lisp/emacs-lisp/timer.el.
(battery--files): New function.
(battery--find-linux-sysfs-batteries): Use it and make fewer
syscalls.
(battery-status-function): Perform GNU/Linux checks in increasing
order of obsolescence: sysfs, ACPI, and then APM.  Simplify Darwin
check.  Add :version tag now that battery-upower is the default.
(battery-echo-area-format, battery-mode-line-format): Mention %s.
(battery-load-low, battery-load-critical): New faces.
(battery-update): Display battery-mode-line-format even if
percentage is N/A.  Apply faces battery-load-low or
battery-load-critical according to the percentage, but append them
so they don't override user customizations.  Update all mode lines
since we are in global-mode-string.
(battery-linux-proc-apm-regexp): Mark as obsolete, replacing with...
(battery--linux-proc-apm): ...this new rx definition.
(battery-linux-proc-apm): Use it.  Fix indentation.  Simplify.
(battery--acpi-rate, battery--acpi-capacity): New rx definitions.
(battery-linux-proc-acpi): Use them.  Fix pathological whitespace
regexps.  Simplify.
(battery-linux-sysfs): Fix docstring and indentation.  Reduce number
of file searches.  Simplify.
(battery-bsd-apm): Fix docstring.  Simplify.
(battery-pmset): Fix docstring.  Simplify ID regexp.

* lisp/emacs-lisp/rx.el (rx-define): Indent as a defun.

* test/lisp/battery-tests.el (battery-linux-proc-apm-regexp): Test
new battery--linux-proc-apm rx definition.
(battery-acpi-rate-regexp, battery-acpi-capacity-regexp): New tests.
2020-06-18 12:58:28 +01:00
Basil L. Contovounesios
0185d76e74 Fix and extend format-spec (bug#41758)
* lisp/format-spec.el: Use lexical-binding.  Remove dependence on
subr-x.el.
(format-spec-make): Clarify docstring.
(format-spec--parse-modifiers): Rename to...
(format-spec--parse-flags): ...this and simplify.  In particular,
don't bother parsing :space-pad which is redundant and unused.
(format-spec--pad): Remove, replacing with...
(format-spec--do-flags): ...this new helper function which performs
more of format-spec's supported text manipulation.
(format-spec): Autoload.  Allow optional argument to take on special
values 'ignore' and 'delete' for more control over what happens when
a replacement for a format specification isn't provided.  Bring back
proper support for a precision modifier similar to that of 'format'.

* lisp/battery.el (battery-format): Rewrite in terms of format-spec.
(battery-echo-area-format, battery-mode-line-format): Mention
support of format-spec syntax in docstrings.

* doc/lispref/strings.texi (Custom Format Strings):
* etc/NEWS: Document and announce these changes.

* lisp/dired-aux.el (dired-do-compress-to):
* lisp/erc/erc-match.el (erc-log-matches):
* lisp/erc/erc.el (erc-update-mode-line-buffer):
* lisp/gnus/gnus-sieve.el (gnus-sieve-update):
* lisp/gnus/gssapi.el (open-gssapi-stream):
* lisp/gnus/mail-source.el (mail-source-fetch-file)
(mail-source-fetch-directory, mail-source-fetch-pop)
(mail-source-fetch-imap):
* lisp/gnus/message.el (message-insert-formatted-citation-line):
* lisp/image-dired.el:
* lisp/net/eww.el:
* lisp/net/imap.el (imap-kerberos4-open, imap-gssapi-open)
(imap-shell-open):
* lisp/net/network-stream.el (network-stream-open-shell):
* lisp/obsolete/tls.el (open-tls-stream):
* lisp/textmodes/tex-mode.el:
Remove extraneous loads and autoloads of format-spec now that it is
autoloaded and simplify its uses where possible.

* test/lisp/battery-tests.el (battery-format): Test new format-spec
support.
* test/lisp/format-spec-tests.el (test-format-spec): Rename to...
(format-spec) ...this, extending test cases.
(test-format-unknown): Rename to...
(format-spec-unknown): ...this, extending test cases.
(test-format-modifiers): Rename to...
(format-spec-flags): ...this.
(format-spec-make, format-spec-parse-flags, format-spec-do-flags)
(format-spec-do-flags-truncate, format-spec-do-flags-pad)
(format-spec-do-flags-chop, format-spec-do-flags-case): New tests.
2020-06-18 12:46:21 +01:00
Basil L. Contovounesios
97d1f672ac Various dbus.el cleanups (bug#41744)
* etc/NEWS: Announce removal of aliases obsolete since Emacs 24.3.

* lisp/net/dbus.el: Remove unneeded dependency on cl-lib.el.  Quote
function symbols as such.
(dbus-ignore-errors): Don't add macro name to font-lock keywords, as
emacs-lisp-mode now dynamically fontifies new macro definitions.
(dbus-event-error-hooks, dbus-call-method-non-blocking): Remove
aliases obsolete since Emacs 24.3.
(dbus-register-signal, dbus-escape-as-identifier): Simplify.  Use
regexp \` and \' in place of ^ and $.
(dbus--parse-xml-buffer): New function for libxml2 compatibility.
(dbus-introspect-xml): Use it.

(dbus-string-to-byte-array, dbus-byte-array-to-string)
(dbus-unescape-from-identifier, dbus-list-known-names)
(dbus-introspect-get-all-nodes, dbus-get-all-properties)
(dbus-get-all-managed-objects): Simplify.

(dbus--introspect-names, dbus--introspect-name): New convenience
functions.
(dbus-introspect-get-node-names)
(dbus-introspect-get-interface-names)
(dbus-introspect-get-interface, dbus-introspect-get-method-names)
(dbus-introspect-get-method, dbus-introspect-get-signal-names)
(dbus-introspect-get-signal, dbus-introspect-get-property-names)
(dbus-introspect-get-property)
(dbus-introspect-get-annotation-names)
(dbus-introspect-get-annotation)
(dbus-introspect-get-argument-names, dbus-introspect-get-argument):
Use them to DRY.

* test/lisp/net/dbus-tests.el (dbus-test-all): Quote function
symbols as such.
2020-06-18 12:20:48 +01:00
Glenn Morris
21b03faed4 Merge from origin/emacs-27
229995ba2c (origin/emacs-27) Fix some Texinfo markup
01e86b9fdf Fix recentf typo in Emacs manual
cd4f75bb86 Rename default function to next-error-buffer-unnavigated-c...
1dff0a8949 * lisp/image-mode.el (image-toggle-display-image): Fix fit...
a71d1787f1 * doc/misc/tramp.texi (Predefined connection information):...
079b0dc430 Delete, don't kill, dir dir fragments in icomplete-fido-ba...
6cdecc2659 Revert markup change in with-coding-priority docs
22f4fba8a9 * lisp/emulation/cua-rect.el (cua--rectangle-region-insert...
6b9eac6759 * lisp/simple.el (shell-command-on-region): Fix docstring.
43ad7dc1af Clean up D-Bus documentation (bug#41744)
c43e5ed60d * lisp/image-mode.el (image-transform-original): New comma...
6eb18a950d Move tab-bar and tab-line faces to faces.el (part of bug#4...

# Conflicts:
#	etc/NEWS
#	lisp/simple.el
2020-06-17 08:47:53 -07:00
Basil L. Contovounesios
229995ba2c Fix some Texinfo markup
* doc/misc/gnus-faq.texi (FAQ 3-11):
* doc/emacs/frames.texi (Tab Bars): Consistently use @var with
lower-case metasyntactic variables and @minus instead of a dash.
(Text-Only Mouse):
* doc/emacs/files.texi (Auto Revert):
* doc/emacs/misc.texi (emacsclient Options)
(Embedded WebKit Widgets):
* doc/lispref/control.texi (pcase Macro):
* doc/lispref/debugging.texi (Backtraces):
* doc/lispref/files.texi (Truenames):
* doc/lispref/frames.texi (Management Parameters):
* doc/lispref/os.texi (Time Calculations):
* doc/lispref/text.texi (Parsing JSON):
* doc/misc/efaq-w32.texi (Other versions of Emacs, Debugging)
(Swap Caps NT, Printing, Bash, Developing with Emacs):
* doc/misc/efaq.texi (New in Emacs 25):
* doc/misc/emacs-gnutls.texi (Help For Users):
* doc/misc/message.texi (Using S/MIME, Passphrase caching):
* test/manual/etags/tex-src/gzip.texi (Overview): Use @. when a
sentence in the middle of a paragraph ends with an upper-case letter
as per "(texinfo) Ending a Sentence".
2020-06-17 13:07:51 +01:00
Philipp Stephani
e96f78fca6 Band-aid for edebugging generator bodies (Bug#40434).
Edebug doesn't support them well.  Rather than trying to fix Edebug,
disable instrumentation for now to prevent annoying bugs.

* lisp/emacs-lisp/generator.el (iter-defun, iter-lambda, iter-make)
(iter-do): Don't attempt to instrument bodies that are mangled by the
CPS transformer.

* test/lisp/emacs-lisp/generator-tests.el
(generator-tests-edebug): New regression test.
2020-06-14 20:01:28 +02:00
Philipp Stephani
62cf8f1649 Ensure that getters and setters can be edebugged at the same time.
It's necessary to add a name suffix to setters defined with
'gv-define-setter' so that Edebug can distinguish between the getter
and the setter (Bug#41853).

* lisp/emacs-lisp/gv.el (gv-define-setter): Add a name suffix to
setter definitions.

* test/lisp/emacs-lisp/gv-tests.el (gv-setter-edebug): New regression
test.
2020-06-14 18:18:13 +02:00
Michael Albinus
b3e7d046c3 Rearrange detecting remote uid and gid in Tramp
* 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-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'.

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Add `file-ownership-preserved-p'.
(tramp-crypt-add-directory): Check, that NAME is not quoted.
(tramp-crypt-handle-file-ownership-preserved-p): New defun.
(tramp-crypt-handle-insert-directory): Fix docstring.

* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'.
(tramp-gvfs-handle-file-readable-p): Call `tramp-get-remote-uid'.
(tramp-gvfs-handle-get-remote-uid)
(tramp-gvfs-handle-get-remote-gid): Rename from
`tramp-gvfs-get-remote-{uid,gid}'.  Do not cache result.
(tramp-gvfs-maybe-open-connection): No special handling for remote
uid and gid.

* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'.
(tramp-sh-handle-get-remote-uid, tramp-sh-handle-get-remote-gid):
Rename from `tramp-get-remote-{uid,gid}'.  Do not cache result.
(tramp-sh-handle-file-ownership-preserved-p): Distinguish by GROUP
when caching.

* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'.
(tramp-sudoedit-handle-get-remote-uid)
(tramp-sudoedit-handle-get-remote-gid): Rename from
`tramp-sudoedit-get-remote-{uid,gid}'.  Do not cache result.
(tramp-sudoedit-handle-set-file-uid-gid)
(tramp-sudoedit-handle-write-region): Call `tramp-get-remote-uid'
and `tramp-get-remote-gid'.
(tramp-sudoedit-maybe-open-connection): No special handling for
remote uid and gid.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'.
(tramp-handle-write-region, tramp-check-cached-permissions):
Call `tramp-get-remote-uid' and `tramp-get-remote-gid'.
(tramp-get-remote-uid, tramp-get-remote-gid): New defuns.
(tramp-local-host-p): Simplify `tramp-get-remote-uid' call.

* test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards)
Skip if needed.
2020-06-14 15:31:17 +02:00
Michael R. Mauger
82a632edc8 2020-03-29 Michael R. Mauger <michael@mauger.com>
* lisp/progmodes/sql.el (sql-add-product): Re-correct argument
       spec.  Previous change was due to my mistake; I have
       resolved back to the prior behavior (Bug#39960).
       * test/lisp/progmodes/sql-tests.el (sql-test-add-product): Added
       test to insure I don't make the same mistake again.
2020-06-13 18:36:27 -04:00
Glenn Morris
4823fa1077 Tag a test as unstable
* test/lisp/calendar/lunar-tests.el (lunar-test-phase-list):
Mark as unstable.  Eg fails on hydra.nixos.org.
2020-06-13 10:42:47 -07:00
Michael Albinus
459bd56f46 Further fixes while testing tramp-crypt
* doc/misc/tramp.texi (External methods): Remove experimental note
for rclone.
(Keeping files encrypted): Mark file encryption as experimental.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
Use `tramp-handle-file-truename'.
(tramp-adb-handle-file-truename): Remove.

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Add `file-writable-p'.
(tramp-crypt-send-command): Return t if no error.
(tramp-crypt-do-encrypt-or-decrypt-file-name)
(tramp-crypt-do-encrypt-or-decrypt-file): Raise an error if it fails.
(tramp-crypt-do-copy-or-rename-file): Flush file properties also
when copying a directory.
(tramp-crypt-handle-file-writable-p): New defun.
(tramp-crypt-handle-insert-directory): Check for library
`text-property-search'.

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-uid-gid):
Rename from `tramp-gvfs-set-file-uid-gid'.

* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename):
Use `tramp-handle-file-truename' as fallback.

* lisp/net/tramp.el (tramp-handle-file-truename):
Let-bind `tramp-crypt-enabled' to nil.
(tramp-handle-write-region): Set also file ownership.

* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory):
Skip if needed.
2020-06-12 20:17:02 +02:00
Michael Albinus
b19259c841 Futher tramp-crypt implementation and documentation
* doc/misc/tramp.texi (Top, Configuration): Insert section
`Keeping files encrypted' in menu.
(Keeping files encrypted): New node.

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Add `tramp-set-file-uid-gid'.
(tramp-crypt-maybe-open-connection): Simplify.
(tramp-crypt-do-encrypt-or-decrypt-file): Use `binary' coding system.
(tramp-crypt-handle-set-file-uid-gid): New defun.

* test/lisp/net/tramp-tests.el (tramp-test09-insert-file-contents):
Adapt test.
2020-06-10 19:36:53 +02:00
Philipp Stephani
ee8b2742d7 ; * test/lisp/emacs-lisp/generator-tests.el: Checkdoc fixes 2020-06-10 15:49:57 +02:00
Philipp Stephani
73be4d1ed5 Allow destructuring in &aux sections when using edebug (Bug#40431)
* lisp/emacs-lisp/cl-macs.el (cl-lambda-list, cl-lambda-list1)
(cl-macro-list, cl-macro-list1): Allow arbitrary 'cl-lambda'
arguments in the &aux section.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-aux-edebug): New
regression test.
2020-06-10 15:34:41 +02:00
Michael Albinus
4b21759b6f Continue implementation of tramp-crypt.el
* lisp/net/tramp-crypt.el (tramp-crypt-do-encrypt-or-decrypt-file):
Add leading "/" to infile.
(tramp-crypt-add-directory): Fix docstring.  Expand NAME.
(tramp-crypt-remove-directory)
(tramp-crypt-handle-file-name-all-completions)
(tramp-crypt-handle-set-file-times): New defuns.
(tramp-crypt-handle-file-executable-p)
(tramp-crypt-handle-file-readable-p)
(tramp-crypt-handle-file-system-info)
(tramp-crypt-handle-set-file-modes): Fix implementation.

* test/lisp/net/tramp-tests.el: Adapt call convention
for (tramp--test-crypt-p).
2020-06-09 13:43:30 +02:00
Michael Albinus
46304c474c Add autoload problem in tramp-crypt.el.
* lisp/net/tramp-crypt.el (tramp-crypt-encfs-config):
Add ;;;###tramp-autoload cookie.
(tramp-crypt-directories): Move it up.
(tramp-crypt-file-name-p): Move it up.  Add ;;;###tramp-autoload
cookie.  Make it a defsubst.

* test/lisp/net/tramp-tests.el (tramp-crypt): Do not require.
2020-06-08 10:18:35 +02:00
Stefan Kangas
80abaea1d9 Use lexical-binding in lunar.el and add tests
* lisp/calendar/lunar.el: Use lexical-binding.
(lunar-phases, diary-lunar-phases): Silence byte-compiler.
* test/lisp/calendar/lunar-tests.el: New file.
2020-06-07 19:57:45 +02:00
Glenn Morris
e42e98ec0b * test/lisp/net/tramp-tests.el: tramp-crypt-file-name-p not autoloaded. 2020-06-07 10:37:57 -07:00
Glenn Morris
fa6d56529f Merge from origin/emacs-27
35661ef943 (origin/emacs-27) Fix typo in "(elisp) Type Keywords"
1af0e95fec Gnus nnir-summary-line-format has no effect
dd366b5d3b Improve documentation of 'window-text-pixel-size'
fbd49f969e * src/xdisp.c (Fwindow_text_pixel_size): Doc fix.  (Bug#41...
d8593fd19f Minor improvements to EDE and EIEIO manuals
3916e63f9e Have Fido mode also imitate Ido mode in ignore-case options
cc35b197c7 Update package-menu-quick-help
bf09106256 Improve documentation of 'sort-subr'
73749efa13 Update Ukrainian transliteration
30a7ee505a Fix Arabic shaping when eww/shr fill the text to be rendered
7d323f07c0 Silence some byte-compiler warnings in tests
cf473e742f * test/lisp/battery-tests.el: New file.
b07e3b1d97 Improve format-spec documentation (bug#41571)

# Conflicts:
#	test/lisp/emacs-lisp/package-tests.el
2020-06-07 09:03:59 -07:00
Michael Albinus
a6b0e7202d Add file encryption to Tramp
* lisp/net/tramp-crypt.el: New file.

* lisp/net/tramp.el (tramp-run-real-handler):
Add `tramp-crypt-file-name-handler'.
(tramp-register-file-name-handlers):
Call `tramp-register-crypt-file-name-handler'.
(tramp-handle-insert-file-contents, tramp-local-host-p): Check for
`tramp-crypt-enabled'

* test/lisp/net/tramp-tests.el (tramp--test-crypt-p): New defun.
(tramp-test24-file-acl, tramp-test25-file-selinux)
(tramp-test28-process-file, tramp-test29-start-file-process)
(tramp-test30-make-process, tramp-test31-interrupt-process)
(tramp-test32-shell-command)
(tramp-test32-shell-command-dont-erase-buffer)
(tramp-test33-environment-variables)
(tramp-test33-environment-variables-and-port-numbers)
(tramp-test34-explicit-shell-file-name, tramp-test35-exec-path)
(tramp-test35-remote-path, tramp-test36-vc-registered)
(tramp--test-check-files, tramp-test43-asynchronous-requests): Use it.
2020-06-07 16:57:32 +02:00
Basil L. Contovounesios
8bcc781bc7 Un-deprecate oset and oset-default
For discussion see the following threads:
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00630.html
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00674.html
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00099.html

* lisp/emacs-lisp/eieio.el (oset, oset-default): Un-deprecate.
* lisp/emacs-lisp/eieio-core.el (eieio-oref): Declare gv-setter here
instead of in lisp/emacs-lisp/eieio.el.  Suggested by
Stefan Monnier <monnier@iro.umontreal.ca>.
(eieio-oref-default): Add gv-setter declaration.
* etc/NEWS: Announce these changes.
* doc/misc/eieio.texi (Accessing Slots): Document oref and
oref-default as generalized variables.  Consistently document
getters before setters.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el: Use
lexical-binding.
(eieio-test-13-init-methods): Simplify.
(eieio-test-33-instance-tracker): Declare IT-list as special.
2020-06-06 17:24:00 +01:00
Mattias Engdegård
4fff650236 ; * test/src/xfaces-tests.el (xfaces-color-distance): Fix bug id 2020-06-04 10:56:20 +02:00
Mattias Engdegård
7e8c1a6718 Make color-distance symmetric and more accurate
* src/xfaces.c (color_distance): Don't throw away the low 8 bits of
the colours, and make the function symmetric (bug41544)
(Fcolor_distance): Add caution about this not being a true metric.
* test/src/xfaces-tests.el: New file.
2020-06-03 19:09:33 +02:00
Basil L. Contovounesios
7d323f07c0 Silence some byte-compiler warnings in tests
* test/lisp/emacs-lisp/cl-generic-tests.el:
* test/lisp/progmodes/elisp-mode-tests.el: Declare functions
referred to within macroexpansions.
(xref-elisp-overloadable-no-default)
(xref-elisp-overloadable-co-located-default)
(xref-elisp-overloadable-separate-default): Prefix unused arguments
with underscore.

* test/lisp/international/ccl-tests.el:
* test/lisp/wdired-tests.el:
* test/lisp/emacs-lisp/package-tests.el: Declare functions used.
(package-test-update-archives, package-test-signed): Use
revert-buffer in place of its obsolete alias package-menu-refresh.

* test/lisp/eshell/eshell-tests.el:
* test/lisp/mail/footnote-tests.el:
* test/src/buffer-tests.el: Require dependencies used.

* test/lisp/image/exif-tests.el: Remove unneeded (require 'seq).
(test-exit-direct-ascii-value): Actually perform the test.
* test/lisp/progmodes/sql-tests.el (sql-test-add-existing-product):
Fix typo.

* test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer):
* test/src/data-tests.el (test-bool-vector-bv-from-hex-string)
(test-bool-vector-apply-mock-op): Remove unused local variables.
2020-06-03 01:22:41 +01:00
Basil L. Contovounesios
cf473e742f * test/lisp/battery-tests.el: New file. 2020-06-03 00:54:23 +01:00
Tino Calancha
abe7c22da9 occur: Add bindings for next-error-no-select
Make the navigation in the occur buffer closer
to the navigation in the compilation buffer.

Add bindings to navigate the occur matches (Bug#39121).
Honor `next-error-highlight' and `next-error-highlight-no-select'
when navigating the occurrences.

* lisp/replace.el (occur-highlight-regexp, occur-highlight-overlay):
New variables.
(occur-1): Set `occur-highlight-regexp' to the searched regexp.
(occur-goto-locus-delete-o, occur--highlight-occurrence): New defuns.
(occur-mode-display-occurrence, occur-mode-goto-occurrence):
Use `occur--highlight-occurrence'.
(occur-mode-map): Bind n to `next-error-no-select'
and p to `previous-error-no-select'

* etc/NEWS (Changes in Specialized Modes and Packages in Emacs 28.1):
Announce this change.

* test/lisp/replace-tests.el (replace-tests-with-highlighted-occurrence):
Add helper macro.
(occur-highlight-occurrence): Add test.
2020-05-31 12:31:27 +02:00
akater
1b2a881c9b * lisp/emacs-lisp/lisp-mode.el: Add new indentation convention
(calculate-lisp-indent): To distinguish code and data when indenting,
introduce the convention that a space between an open paren and
a symbol indicate that this should be indented as a simple data list.
2020-05-29 00:26:09 -04:00
Glenn Morris
dc78327e32 Merge from origin/emacs-27
e7a3ed8a6d Fix tab-bar-tab-name-ellipsis initialization
4737d0af75 Fix Elisp manual entry for format-spec
0195809bb6 Fix rare assertion violations in 'etags'
cddb0079ff ; * lisp/format-spec.el (format-spec): Fix typo.
2020-05-28 07:50:25 -07:00
Mattias Engdegård
c5cf630ecd Don't clobber match data in utf-8-hfs conversion (bug#41445)
Reported by Ture Pålsson.

* lisp/international/ucs-normalize.el
(ucs-normalize-hfs-nfd-post-read-conversion)
(ucs-normalize-hfs-nfd-pre-write-conversion):
Use save-match-data to avoid match data clobber in normalisation.
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-save-match-data): New test.
2020-05-27 16:29:43 +02:00
Eli Zaretskii
0195809bb6 Fix rare assertion violations in 'etags'
* lib-src/etags.c (pfnote): Instead of raising an assertion when
we get an empty tag name, return immediately.  (Bug#41465)

* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6: Adapt to latest changes in
etags.
2020-05-24 18:01:45 +03:00
Philipp Stephani
f8581bcf6a Reject invalid characters in XML strings (Bug#41094).
* lisp/xml.el (xml-escape-string): Search for invalid characters.
(xml-invalid-character): New error symbol.

* test/lisp/xml-tests.el (xml-print-invalid-cdata): New unit test.

* etc/NEWS: Document new behavior.
2020-05-23 14:01:17 +02:00
Basil L. Contovounesios
3f082af536 Various json.el improvements
* etc/NEWS: Announce that json-read-number is now stricter.

* json.el: Bump package version.
(json-encoding-lisp-style-closings, json-pre-element-read-function)
(json-post-element-read-function, json-advance, json-peek)
(json--path): Clarify and improve style of doc strings.
(json-join): Define as an obsolete alias of string-join.
(json-alist-p, json-plist-p): Refactor for speed and declare as
pure, side-effect-free, and error-free.
(json--plist-reverse): Rename function...
(json--plist-nreverse): ...to this, making it destructive for speed.
All callers changed.
(json--plist-to-alist): Remove, replacing single use with map-pairs.
(json--with-indentation): Accept multiple forms as arguments, fix
their indentation, and allow them to be instrumented for debugging.
Add docstring.
(json-pop, json-read-keyword, json-add-to-object)
(json-encode-array): Simplify for speed.
(json-skip-whitespace): Put newline before carriage return for
likely frequency of occurrence, and so that the characters appear in
increasing order.
(json--check-position): Use 1+.
(json-path-to-position): Open code apply-partially.
(json-keywords): Turn into a defconst and mark as obsolete now that
it is no longer used.
(json--post-value, json--number, json--escape): New rx definitions.
(json-encode-keyword): Declare as side-effect-free.
(json-read-number): Reject leading zeros and plus signs, and make
integer part mandatory in accordance with JSON standards and for
consistency with native JSON parsing functions.  Eagerly signal
json-number-format when garbage follows a valid number, e.g., when
reading "1.1.1", instead of leaving that up to the caller.  Remove
optional internal argument from advertised calling convention now
that the function is no longer recursive.
(json-encode-number): Define as an alias of number-to-string.
(json-special-chars): Turn into a defconst.
(json-read-escaped-char, json-new-object, json-read-file)
(json-pretty-print): Simplify.
(json-read-string): For consistency with other json.el error
reporting, remove check for leading '"', and use the integer value
rather than the printed representation of characters in error data.
At EOB signal json-end-of-file instead of json-string-format.
(json--long-string-threshold, json--string-buffer): New variables.
(json-encode-string): Reimplement in terms of buffer manipulation
for speed (bug#20154).
(json-read-object): Escape ?\} properly.
(json--encode-alist): New function extracted from json-encode-alist.
(json-encode-hash-table, json-encode-alist, json-encode-plist): Use
it to avoid destructively modifying the argument when
json-encoding-object-sort-predicate is non-nil without incurring
unnecessary copying (bug#40693).  Encode empty object as "{}" even
when pretty-printing.  Simplify for speed.
(json-read-array): Avoid recomputing list length on each iteration
when json-pre-element-read-function is non-nil.  Make first element
of json-array-format error data a string for consistency with
json-object-format and to make the displayed error message clearer.
(json-readtable-dispatch): Accept any kind of argument, not just
symbols.  Generate the table in a simpler manner so the dispatch
order is clearer.  Remove dispatch on ?+ and ?. now that
json-read-number is stricter and for consistency with native JSON
parsing functions.  Signal json-end-of-file if argument is nil.
(json-read): Simplify accordingly.
(json-encode): Avoid allocating a list on each invocation.

* lisp/jsonrpc.el (jsonrpc--json-read, jsonrpc--json-encode): Check
whether native JSON functions are fboundp only once, at load time.

* lisp/progmodes/python.el (python--parse-json-array): New function.
(python-shell-prompt-detect): Use it to parse JSON directly as a
list rather than converting from a vector.

* test/lisp/json-tests.el (json-tests--with-temp-buffer): Allow
instrumenting for debugging.
(test-json-join, test-json-plist-to-alist): Remove tests.

(test-json-alist-p, test-json-plist-p, test-json-advance)
(test-json-peek, test-json-pop, test-json-skip-whitespace)
(test-json-read-keyword, test-json-encode-keyword)
(test-json-encode-number, test-json-read-escaped-char)
(test-json-read-string, test-json-encode-string)
(test-json-encode-key, test-json-new-object)
(test-json-encode-hash-table, test-json-encode-plist)
(test-json-encode-list, test-json-read-array)
(test-json-encode-array, test-json-read)
(test-json-read-from-string, test-json-encode): Extend tests.

(test-json-plist-reverse): Rename test...
(test-json-plist-nreverse): ...to this and avoid modifying literal
lists.
(test-json-read-number): Rename test...
(test-json-read-integer): ...to this, focusing on integers.
(test-json-add-to-object): Rename test...
(test-json-add-to-alist): ...to this, focusing on alists.
(json-encode-simple-alist): Rename test...
(test-json-encode-alist): ...to this, extending it.
(test-json-encode-alist-with-sort-predicate): Rename test...
(test-json-encode-alist-sort): ...to this, extending it.
(test-json-encode-plist-with-sort-predicate): Rename test...
(test-json-encode-plist-sort): ...to this, extending it.

(test-json-read-keyword-invalid, test-json-read-fraction)
(test-json-read-exponent, test-json-read-fraction-exponent)
(test-json-read-number-invalid)
(test-json-read-escaped-char-invalid, test-json-add-to-plist)
(test-json-add-to-hash-table, test-json-read-object-empty)
(test-json-read-object-invalid, test-json-read-object-function)
(test-json-encode-hash-table-pretty)
(test-json-encode-hash-table-lisp-style)
(test-json-encode-hash-table-sort, test-json-encode-alist-pretty)
(test-json-encode-alist-lisp-style, test-json-encode-plist-pretty)
(test-json-encode-plist-lisp-style, test-json-read-array-function)
(test-json-encode-array-pretty, test-json-encode-array-lisp-style)
(test-json-read-invalid): New tests.

(test-json-path-to-position-no-match): Use should-not.
(test-json-read-object): Move error check to new test
test-json-read-object-invalid.
(test-json-pretty-print-object): Adapt test now that empty objects
are pretty-printed as "{}".
2020-05-22 15:16:13 +01:00
Kévin Le Gouguec
5352bda4ee Add test for bug#39680
* test/lisp/electric-tests.el (electric-pair-undo-unrelated-state):
New test.
2020-05-20 00:15:11 +01:00
Tassilo Horn
5af991872d Allow back-references in syntax-propertize-rules.
* lisp/emacs-lisp/syntax.el (syntax-propertize--shift-groups-and-backrefs):
Renamed from syntax-propertize--shift-groups, and also shift
back-references.
(syntax-propertize-rules): Adapt docstring and use renamed function.
* test/lisp/emacs-lisp/syntax-tests.el: New test.
(syntax-propertize--shift-groups-and-backrefs): New ERT test.
2020-05-19 20:50:14 +02:00
Glenn Morris
ca7224d5db Add test for recent buffer-local-variables change
* test/src/buffer-tests.el (buffer-tests-buffer-local-variables-undo):
New.
2020-05-18 13:08:27 -07:00