]> git.eshelyaron.com Git - emacs.git/log
emacs.git
4 years agoauth-source-reveal-mode: fixes from code review scratch/tzz/auth-source-reveal-mode
Ted Zlatanov [Mon, 22 Jun 2020 20:29:25 +0000 (16:29 -0400)]
auth-source-reveal-mode: fixes from code review

4 years agoCreate and document auth-source-reveal-mode
Ted Zlatanov [Thu, 18 Jun 2020 18:32:51 +0000 (14:32 -0400)]
Create and document auth-source-reveal-mode

* lisp/auth-source.el (auth-source-reveal-mode): Add new minor
mode to hide passwords. Remove authinfo-mode which provided a
major mode for the same purpose before.

* doc/misc/auth.texi (Hiding passwords in text buffers): Document
auth-source-reveal-mode.

4 years agoSupport regular expressions and API for prettify-symbols-mode
Ted Zlatanov [Thu, 18 Jun 2020 18:30:18 +0000 (14:30 -0400)]
Support regular expressions and API for prettify-symbols-mode

* lisp/progmodes/prog-mode.el (prettify-symbols-add-prettification-entry)
(prettify-symbols-add-prettification-rx)
(prettify-symbols-add-prettification-string)
(prettify-symbols-remove-prettification)
(prettify-symbols-remove-prettifications)
(prettify-symbols--make-regexp-keywords, prettify-symbols-alist)
(prettify-symbols-compose-replacer): Support and document
prettify-symbols-mode regular expressions in addition to fixed
strings. Provide API functions to add and remove prettifications
instead of manipulating prettify-symbols-alist directly.

4 years agolisp/progmodes/prog-mode.el: prevent font-lock-flush boundary errors
Ted Zlatanov [Wed, 17 Jun 2020 14:28:27 +0000 (10:28 -0400)]
lisp/progmodes/prog-mode.el: prevent font-lock-flush boundary errors

4 years agoMinor improvements as followup to recent RGB string-parsing change
Eli Zaretskii [Mon, 22 Jun 2020 15:32:01 +0000 (18:32 +0300)]
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'.

4 years agoproject-switch-to-buffer: Improve Ido compatibility
Dmitry Gutov [Mon, 22 Jun 2020 13:58:02 +0000 (16:58 +0300)]
project-switch-to-buffer: Improve Ido compatibility

* lisp/progmodes/project.el (project-switch-to-buffer):
Check that the entry contains a non-nil CDR.

4 years agoproject-switch-to-buffer: Do not require matching input
Dmitry Gutov [Mon, 22 Jun 2020 13:48:43 +0000 (16:48 +0300)]
project-switch-to-buffer: Do not require matching input

* lisp/progmodes/project.el (project-switch-to-buffer):
Do not require matching input, to allow creating buffers as well
(bug#41879).

4 years agoAccept lexical lambda in auto-insert-alist
Mattias Engdegård [Mon, 22 Jun 2020 11:07:37 +0000 (13:07 +0200)]
Accept lexical lambda in auto-insert-alist

This bug was exposed by a previous removal of quoting around lambda
expressions in autoinsert-tests.el (1ecd350f38ee), which caused some
of those tests to fail.

* lisp/autoinsert.el (auto-insert): Cope with lexical closures.

4 years agoFix spurious error in beginning-of-defun in pascal-mode (bug#41740)
Mattias Engdegård [Sun, 21 Jun 2020 19:11:17 +0000 (21:11 +0200)]
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.

4 years agoPreserve point in pascal-mode completion (bug#41740)
Mattias Engdegård [Sun, 21 Jun 2020 19:04:30 +0000 (21:04 +0200)]
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.

4 years agoFix display-buffer-override-next-command to call action only once (bug#39722)
Juri Linkov [Sun, 21 Jun 2020 23:36:16 +0000 (02:36 +0300)]
Fix display-buffer-override-next-command to call action only once (bug#39722)

* lisp/vc/vc-dir.el (vc-dir-bookmark-jump): Don't use save-window-excursion.

* lisp/window.el (display-buffer-override-next-command): Reset
display-buffer-overriding-action after the first buffer display action.

* lisp/tab-bar.el (switch-to-buffer-other-tab): Don't reuse frame tabs.
(other-tab-prefix): Don't reuse frame tabs.

4 years agoNew commands other-window-prefix (C-x 4 4) and other-frame-prefix (C-x 5 5)
Juri Linkov [Sun, 21 Jun 2020 23:17:02 +0000 (02:17 +0300)]
New commands other-window-prefix (C-x 4 4) and other-frame-prefix (C-x 5 5)

* lisp/window.el (other-window-prefix, same-window-prefix): New commands.
(ctl-x-4-map): Bind 'C-x 4 4' to 'other-window-prefix'.  (Bug#41691)

* lisp/frame.el (other-frame-prefix): New command.
(ctl-x-5-map): Bind 'C-x 5 5' to 'other-frame-prefix'.

4 years agoForward declare eshell-buffer-name in project-eshell
Theodor Thornhill [Sun, 21 Jun 2020 22:49:20 +0000 (01:49 +0300)]
Forward declare eshell-buffer-name in project-eshell

* lisp/progmodes/project.el: Forward declare 'eshell-buffer-name' so
that 'project-eshell' can use dynamically scoping with it.

4 years ago; project-shell, project-eshell: Doc fixes
Dmitry Gutov [Sun, 21 Jun 2020 22:47:55 +0000 (01:47 +0300)]
; project-shell, project-eshell: Doc fixes

4 years agoConsolidate #RGB string parsers
Mattias Engdegård [Fri, 12 Jun 2020 16:12:37 +0000 (18:12 +0200)]
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.

4 years agoRevert last change in benchmark.el
Basil L. Contovounesios [Sun, 21 Jun 2020 18:01:40 +0000 (19:01 +0100)]
Revert last change in benchmark.el

For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00791.html

* lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): Revert to
giving byte-compile a form rather than a closure.

4 years agoImprove doc strings of 'project-shell' and 'project-eshell'
Eli Zaretskii [Sun, 21 Jun 2020 16:20:37 +0000 (19:20 +0300)]
Improve doc strings of 'project-shell' and 'project-eshell'

* lisp/progmodes/project.el (project-shell, project-eshell): Doc
fixes.

4 years agoReplace some uses of cl-mapcan with mapcan
Basil L. Contovounesios [Sun, 21 Jun 2020 13:31:16 +0000 (14:31 +0100)]
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.

4 years agoFix remaining problems with tramp-crypt.el
Michael Albinus [Sun, 21 Jun 2020 13:19:51 +0000 (15:19 +0200)]
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.

4 years agoEvaluate some unnecessarily quoted lambdas
Basil L. Contovounesios [Sun, 21 Jun 2020 12:42:14 +0000 (13:42 +0100)]
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.

4 years agoSilence some warnings in tests
Basil L. Contovounesios [Sun, 21 Jun 2020 11:50:34 +0000 (12:50 +0100)]
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.

4 years ago; project-shell, project-eshell: Docstring tweaks
Dmitry Gutov [Sun, 21 Jun 2020 01:19:29 +0000 (04:19 +0300)]
; project-shell, project-eshell: Docstring tweaks

4 years agoPop to an existing Eshell buffer by default
Theodor Thornhill [Sat, 20 Jun 2020 09:54:22 +0000 (11:54 +0200)]
Pop to an existing Eshell buffer by default

* lisp/progmodes/project.el (project-shell): Improve docstring to
include information about an implementation detail.

* list/progmodes/project.el (project-eshell): Modelled after
'project-shell', change default behavior such that we don't create too
many eshell buffers by default.  Use universal argument to create
subsequent buffers.

4 years agoFix a byte-compile warning.
Philipp Stephani [Sat, 20 Jun 2020 20:12:19 +0000 (22:12 +0200)]
Fix a byte-compile warning.

* lisp/gnus/gnus-cloud.el (gnus-cloud-download-data): Don't use
'mapcar' or effect.

4 years agoFix last change for bug#41619
Eli Zaretskii [Sat, 20 Jun 2020 08:46:52 +0000 (11:46 +0300)]
Fix last change for bug#41619

* lisp/progmodes/python.el (python-shell-virtualenv-root): Fix
last change.  (Bug#41619)

4 years agoDocumentation followup to the last change
Eli Zaretskii [Sat, 20 Jun 2020 08:31:19 +0000 (11:31 +0300)]
Documentation followup to the last change

* doc/emacs/cmdargs.texi (General Variables):
* etc/NEWS: Document the COLORTERM environment variable.
(Bug#41846)

4 years agoAdd fallback for 24-bit terminal color via COLORTERM=truecolor
Jan Beich [Sun, 14 Jun 2020 03:51:24 +0000 (03:51 +0000)]
Add fallback for 24-bit terminal color via COLORTERM=truecolor

* src/term.c (init_tty): When COLORTERM=truecolor is defined,
override setaf/setab/colors terminfo capabilities with 24-bit
color support.

* doc/misc/efaq.texi (Colors on a TTY): Mention the possibility to
enable 24-bit color via the COLORTERM environment variable.

(Bug#41846)

Copyright-paperwork-exempt: yes

4 years agoRevert "Don't mention non-GNU package archives."
Eli Zaretskii [Sat, 20 Jun 2020 07:51:51 +0000 (10:51 +0300)]
Revert "Don't mention non-GNU package archives."

This reverts commit 5daa7a5fd4aced33a2ae016bde5bb37d1d95edf6.
A proper fix will be committed to the emacs-27 branch, and
will be later merged to master.

4 years agoFix bug with deactivation of mark in 'cua-cancel'
Andrew Burgess [Sun, 7 Jun 2020 08:20:19 +0000 (09:20 +0100)]
Fix bug with deactivation of mark in 'cua-cancel'

* lisp/emulation/cua-base.el (cua-cancel): Use 'deactivate-mark'
instead of setting 'mark-active' directly.

Copyright-paperwork-exempt: yes

4 years agoproject-shell: Pop to an existing shell buffer by default
Theodor Thornhill [Sat, 20 Jun 2020 01:02:18 +0000 (04:02 +0300)]
project-shell: Pop to an existing shell buffer by default

* lisp/progmodes/project.el (project-shell):
Pop to an existing shell buffer by default.
If there's none, or if universal argument is used, open a subsequent
shell buffer and jump to it.  Prefix shell buffer name with the base
name of project root directory. (Bug#41858)

4 years agoFix last change in doc strings of project.el
Eli Zaretskii [Fri, 19 Jun 2020 18:50:30 +0000 (21:50 +0300)]
Fix last change in doc strings of project.el

* lisp/progmodes/project.el (project-switch-to-buffer): More accurate
doc string.

4 years agoFix various problems in Tramp
Michael Albinus [Fri, 19 Jun 2020 13:12:31 +0000 (15:12 +0200)]
Fix various problems in Tramp

* lisp/net/tramp-compat.el (tramp-temp-name-prefix): Declare.
(tramp-compat-make-temp-name):
* lisp/net/tramp.el (tramp-make-tramp-temp-name): New defuns.

* lisp/net/tramp.el (tramp-make-tramp-temp-file):
* lisp/net/tramp-sh.el (tramp-find-inline-encoding)
(tramp-maybe-open-connection, tramp-get-remote-touch)
(tramp-get-remote-chmod-h):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory): Use them.

* lisp/net/tramp-sh.el (tramp-do-file-attributes-with-stat):
Simplify shell command.  Suppress errors (interpret as nil).
(tramp-sh-handle-make-process): Do not visit with
`insert-file-contents'.  Delete tmp file only if exists.
(tramp-send-command-and-read): Suppress `signal-hook-function'
when reading expression.

4 years agoImprove doc strings of project.el
Eli Zaretskii [Fri, 19 Jun 2020 07:52:00 +0000 (10:52 +0300)]
Improve doc strings of project.el

* lisp/progmodes/project.el (project-dired, project-shell)
(project-eshell, project-switch-to-buffer, project-kill-buffers)
(project-list-file, project--read-project-list)
(project--ensure-read-project-list, project--write-project-list)
(project--add-to-project-list-front)
(project--remove-from-project-list, project-prompt-project-dir)
(project-switch-commands, project-switch-project): Fix wording and
formatting of doc strings.

4 years agoFix newly introduced errors in Tramp
Michael Albinus [Fri, 19 Jun 2020 07:24:27 +0000 (09:24 +0200)]
Fix newly introduced errors in Tramp

* lisp/net/tramp-gvfs.el (tramp-gvfs-unload-hook):
Remove `tramp-gvfs-dbus-event-error' from `dbus-event-error-functions'.

* lisp/net/tramp.el (tramp-autoload-file-name-handler): Revert patch.

4 years agoproject-switch-to-buffer: Use the "other buffer" as default
Andrii Kolomoiets [Thu, 18 Jun 2020 23:21:55 +0000 (02:21 +0300)]
project-switch-to-buffer: Use the "other buffer" as default

* lisp/progmodes/project.el
(project-switch-to-buffer): Pass the "other buffer" as DEF to
read-buffer if it belongs to the current project (bug#41879).

4 years agoCheck AREF and aref_addr subscripts
Paul Eggert [Thu, 18 Jun 2020 21:01:56 +0000 (14:01 -0700)]
Check AREF and aref_addr subscripts

* src/lisp.h (gc_asize): Move before first use.
(AREF, aref_addr): Check subscripts.
Co-authored-by: Tino Calancha <tino.calancha@gmail.com>
4 years ago; * lisp/faces.el (color-luminance-dark-limit): Better doc string.
Mattias Engdegård [Thu, 18 Jun 2020 19:55:36 +0000 (21:55 +0200)]
; * lisp/faces.el (color-luminance-dark-limit): Better doc string.

4 years agoDefine the dark luminance limit as a named constant
Mattias Engdegård [Thu, 18 Jun 2020 19:16:42 +0000 (21:16 +0200)]
Define the dark luminance limit as a named constant

To make the meaning of the color-dark-p cutoff luminance clear,
define it as a named constant.  (We no longer use the somewhat
obscure 0.6^2.2 definition since it doesn't really make sense
to define the limit in gamma-compressed space.)

* lisp/faces.el (color-luminance-dark-limit): New constant.
(color-dark-p): Use color-luminance-dark-limit.

4 years ago* etc/NEWS: Fix inconsistencies. Add `tramp-crypt-add-directory'.
Michael Albinus [Thu, 18 Jun 2020 18:00:39 +0000 (20:00 +0200)]
* etc/NEWS: Fix inconsistencies.  Add `tramp-crypt-add-directory'.

4 years agoSome Tramp cleanups, mainly in tramp-crypt.el
Michael Albinus [Thu, 18 Jun 2020 18:00:26 +0000 (20:00 +0200)]
Some Tramp cleanups, mainly in tramp-crypt.el

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Add `add-name-to-file', `make-directory-internal',
`make-nearby-temp-file', `temporary-file-directory' and
`unhandled-file-name-directory'.
(tramp-crypt-file-name-for-operation):
Use `tramp-compat-temporary-file-directory'.
(tramp-crypt-do-encrypt-or-decrypt-file-name)
(tramp-crypt-do-encrypt-or-decrypt-file): Fix syntax error in
`tramp-error'.

* lisp/net/tramp.el (tramp-autoload-file-name-handler):
* lisp/net/tramp-rclone.el (tramp-rclone-mounted-p)
(tramp-rclone-flush-directory-cache):
Use `tramp-compat-temporary-file-directory'.

4 years agoAdd binding for project-kill-buffers
Dmitry Gutov [Thu, 18 Jun 2020 15:42:28 +0000 (18:42 +0300)]
Add binding for project-kill-buffers

* lisp/progmodes/project.el (project-prefix-map):
Add binding for project-kill-buffers (bug#41868).

4 years agoPropertize all shr fragment IDs as shr-target-id
Basil L. Contovounesios [Thu, 7 May 2020 23:25:38 +0000 (00:25 +0100)]
Propertize all shr fragment IDs as shr-target-id

* lisp/net/shr.el (shr-target-id): Add docstring.
(shr-descend, shr-tag-a): Display dummy anchor characters as the
empty string.  Give all relevant 'id' or 'name' fragment identifier
attributes the shr-target-id text property.  This ensures that
cached content, such as tables, retains the property across
renders.  (Bug#40532)

* lisp/net/eww.el: (eww-display-html): Adapt shr-target-id property
search accordingly.

4 years agoImprove battery.el UPower support
Basil L. Contovounesios [Thu, 11 Jun 2020 12:49:31 +0000 (13:49 +0100)]
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.

4 years agoVarious battery.el improvements (bug#41808)
Basil L. Contovounesios [Thu, 11 Jun 2020 12:48:37 +0000 (13:48 +0100)]
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.

4 years agoFix and extend format-spec (bug#41758)
Basil L. Contovounesios [Fri, 29 May 2020 18:56:14 +0000 (19:56 +0100)]
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.

4 years agoVarious dbus.el cleanups (bug#41744)
Basil L. Contovounesios [Sat, 6 Jun 2020 12:20:06 +0000 (13:20 +0100)]
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.

4 years ago;Fix error in commit dcdf6d7124
Tassilo Horn [Thu, 18 Jun 2020 10:44:42 +0000 (12:44 +0200)]
;Fix error in commit dcdf6d7124

4 years agoMake bug-reference auto-setup work in vc-dir or Magit like modes
Tassilo Horn [Thu, 18 Jun 2020 08:39:01 +0000 (10:39 +0200)]
Make bug-reference auto-setup work in vc-dir or Magit like modes

* lisp/progmodes/bug-reference.el (bug-reference-try-setup-from-vc):
Use default-directory if not in a file-visiting buffer to determine
VC URL.

4 years agoBind default-directory to given DIR.
Tassilo Horn [Thu, 18 Jun 2020 05:53:45 +0000 (07:53 +0200)]
Bind default-directory to given DIR.

Otherwise, "git config branch.<branch>.remote" would return the global
default "origin" instead of the actual, project-specific remote name.

* lisp/vc/vc-git.el (vc-git-dir-extra-headers): Bind default-directory
to given DIR.

4 years agoNew command: project-kill-buffers
Philip K [Thu, 18 Jun 2020 01:00:38 +0000 (04:00 +0300)]
New command: project-kill-buffers

* lisp/progmodes/project.el
(project-kill-buffers-skip-conditions): New variable.
(project--buffer-list): New function.
(project-kill-buffers): New command (bug#41868).

4 years ago; Add a heading and a binding
Dmitry Gutov [Wed, 17 Jun 2020 23:10:33 +0000 (02:10 +0300)]
; Add a heading and a binding

4 years agoNew command: project-switch-to-buffer
Theodor Thornhill [Wed, 17 Jun 2020 23:09:41 +0000 (02:09 +0300)]
New command: project-switch-to-buffer

* lisp/progmodes/project.el (project-switch-to-buffer): New command.

4 years agoAdd global bindings for project commands
Theodor Thornhill [Wed, 17 Jun 2020 23:05:31 +0000 (02:05 +0300)]
Add global bindings for project commands

* lisp/progmodes/project.el
(project-prefix-map): New variable.
Add the new keymap to ctl-x-map.

4 years agoFix setting project-vc-merge-submodules via .dir-locals.el
Dmitry Gutov [Wed, 17 Jun 2020 22:30:32 +0000 (01:30 +0300)]
Fix setting project-vc-merge-submodules via .dir-locals.el

* lisp/progmodes/project.el
(project--vc-merge-submodules-p): New function.
(project-try-vc, project--vc-list-files): Use it.

4 years agovc-git-dir-extra-headers: Fix recent breakage
Dmitry Gutov [Wed, 17 Jun 2020 22:09:29 +0000 (01:09 +0300)]
vc-git-dir-extra-headers: Fix recent breakage

* lisp/vc/vc-git.el (vc-git-dir-extra-headers): Account for
'remote' being set to "" when not found
(https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00582.html).
(vc-git-dir-extra-headers): Check the value of remote-url instead.

4 years agoAuto-setup for bug-reference-mode
Tassilo Horn [Thu, 11 Jun 2020 15:02:02 +0000 (17:02 +0200)]
Auto-setup for bug-reference-mode

Tries to guess suitable bug-reference-bug-regexp and
bug-reference-url-format values based on version control URL (in file
buffers) and mail information (in Gnus summary and article buffers).

* lisp/progmodes/bug-reference.el
(bug-reference--maybe-setup-from-vc): New defun.
(bug-reference-setup-from-vc-alist): New defvar defining setup rules
based on version control URL.
(bug-reference-try-setup-from-vc): New defun using above defvar.
(bug-reference--maybe-setup-from-mail): New defun.
(bug-reference-setup-from-mail-alist): New defvar defining setup rules
based on mail/newsgroups and header values.
(bug-reference-try-setup-from-gnus): New defun using above defvar.
(bug-reference--try-setup-gnus-article): New defun.
(bug-reference--run-auto-setup): New defun.
(bug-reference-mode): Call bug-reference--run-auto-setup as
:after-hook.
(bug-reference-prog-mode): Call bug-reference--run-auto-setup as
:after-hook.

4 years agoMerge from origin/emacs-27
Glenn Morris [Wed, 17 Jun 2020 15:47:53 +0000 (08:47 -0700)]
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

4 years agoFix some Texinfo markup
Basil L. Contovounesios [Wed, 17 Jun 2020 11:53:40 +0000 (12:53 +0100)]
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".

4 years agoFix recentf typo in Emacs manual
Basil L. Contovounesios [Wed, 17 Jun 2020 00:10:20 +0000 (01:10 +0100)]
Fix recentf typo in Emacs manual

* doc/emacs/files.texi (File Conveniences): Fix misspelling of
recentf-list.

4 years ago* lisp/dired-aux.el (dired-vc-deduce-fileset): Add autoload cookie.
Juri Linkov [Tue, 16 Jun 2020 23:18:11 +0000 (02:18 +0300)]
* lisp/dired-aux.el (dired-vc-deduce-fileset): Add autoload cookie.

4 years agoRename default function to next-error-buffer-unnavigated-current (bug#40919)
Juri Linkov [Tue, 16 Jun 2020 23:14:12 +0000 (02:14 +0300)]
Rename default function to next-error-buffer-unnavigated-current (bug#40919)

* lisp/simple.el (next-error-find-buffer-function): Rename default function
from next-error-no-navigation-try-current
to next-error-buffer-unnavigated-current.

4 years ago* lisp/image-mode.el (image-toggle-display-image): Fix fit of rotated images.
Juri Linkov [Tue, 16 Jun 2020 22:58:32 +0000 (01:58 +0300)]
* lisp/image-mode.el (image-toggle-display-image): Fix fit of rotated images.

When fitting rotated image to width and height, swap width and height
when changing orientation between portrait and landscape (bug#41886).

4 years agoBump the project.el package version
Dmitry Gutov [Tue, 16 Jun 2020 22:27:37 +0000 (01:27 +0300)]
Bump the project.el package version

* lisp/progmodes/project.el: Bump the package version.

4 years agoChange the key for project-find-regexp
Dmitry Gutov [Tue, 16 Jun 2020 22:24:01 +0000 (01:24 +0300)]
Change the key for project-find-regexp

* lisp/progmodes/project.el (project-switch-commands):
Change the key for 'project-find-regexp' to 'g', which seems to be
the consensus.

4 years agoMake project file name completion adhere to customization
Dmitry Gutov [Tue, 16 Jun 2020 21:50:31 +0000 (00:50 +0300)]
Make project file name completion adhere to customization

* lisp/progmodes/project.el (project-find-file-in):
Bind completion-ignore-case to the value of
read-file-name-completion-ignore-case (bug#41902).

4 years agognus-cloud: Improve cloud sync
David Edmondson [Sat, 28 Mar 2020 19:03:58 +0000 (19:03 +0000)]
gnus-cloud: Improve cloud sync

After replaying a set of actions downloaded by gnus-cloud, persist the
highest sequence number seen as the local `gnus-cloud-sequence'
number, in order that a future download will not unnecessarily replay
previously seen actions and any future uploads from this emacs
instance use a higher sequence number than that downloaded.

Remove the test on whether individual newsrc entries are older than
the current time, as that is always going to be the case.

4 years ago* doc/misc/tramp.texi (Predefined connection information): Add "tmpdir".
Michael Albinus [Tue, 16 Jun 2020 10:34:00 +0000 (12:34 +0200)]
* doc/misc/tramp.texi (Predefined connection information): Add "tmpdir".

4 years agoFix some Tramp problems seen during tests
Michael Albinus [Mon, 15 Jun 2020 14:24:22 +0000 (16:24 +0200)]
Fix some Tramp problems seen during tests

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Add `access-file'.
(tramp-crypt-file-name-for-operation): Rewrite.  Take second
argument into account.
(tramp-crypt-file-name-handler): Use it.
(tramp-crypt-send-command): Set buffer multibyte (but utf8 files
still don't work).
(tramp-crypt-handle-access-file): New defun.
(tramp-crypt-do-copy-or-rename-file): Short track if both files
are on a crypted remote dir.

* lisp/net/tramp.el (file-notify-rm-watch): Declare.
(tramp-inhibit-progress-reporter): New defvar.
(tramp-message): Display message only if not suppressed by
progress reporter.
(with-tramp-progress-reporter): Suppress concurrent progress
reporter messages.
(tramp-file-notify-process-sentinel): Simplify.

4 years agoUse vc-git-repository-url in vc-git-dir-extra-headers
Tassilo Horn [Mon, 15 Jun 2020 07:07:12 +0000 (09:07 +0200)]
Use vc-git-repository-url in vc-git-dir-extra-headers

* lisp/vc/vc-git.el (vc-git-dir-extra-headers): Use
vc-git-repository-url for getting the remote's URL.

4 years agoAdd optional remote-name argument to VC repository-url command
Tassilo Horn [Mon, 15 Jun 2020 06:56:11 +0000 (08:56 +0200)]
Add optional remote-name argument to VC repository-url command

* lisp/vc/vc.el: Document new remote-name argument of VC
repository-url command.
* lisp/vc/vc-git.el (vc-git-repository-url): Add and use new arg.
* lisp/vc/vc-hg.el (vc-hg-repository-url): Add and use new arg.
* lisp/vc/vc-bzr.el (vc-bzr-repository-url): Add new arg but ignore
it.
* lisp/vc/vc-svn.el (vc-svn-repository-url): Add new arg but ignore
it.

4 years agoAdd new VC command `repository-url'
Tassilo Horn [Sun, 14 Jun 2020 16:24:14 +0000 (18:24 +0200)]
Add new VC command `repository-url'

* lisp/vc/vc.el: Document repository-url command.
* lisp/vc/vc-bzr.el (vc-bzr-repository-url): New defun.
* lisp/vc/vc-git.el (vc-git-repository-url): New defun.
* lisp/vc/vc-hg.el (vc-hg-repository-url): New defun.
* lisp/vc/vc-svn.el (vc-svn-repository-url): New defun.

4 years agoBand-aid for edebugging generator bodies (Bug#40434).
Philipp Stephani [Wed, 10 Jun 2020 17:01:03 +0000 (19:01 +0200)]
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.

4 years agoEnsure that getters and setters can be edebugged at the same time.
Philipp Stephani [Sun, 14 Jun 2020 16:18:13 +0000 (18:18 +0200)]
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.

4 years agoRearrange detecting remote uid and gid in Tramp
Michael Albinus [Sun, 14 Jun 2020 13:31:17 +0000 (15:31 +0200)]
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.

4 years ago2020-03-29 Michael R. Mauger <michael@mauger.com>
Michael R. Mauger [Mon, 30 Mar 2020 00:52:10 +0000 (20:52 -0400)]
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.

4 years agoDelete, don't kill, dir dir fragments in icomplete-fido-backward-updir
João Távora [Sat, 13 Jun 2020 17:45:40 +0000 (18:45 +0100)]
Delete, don't kill, dir dir fragments in icomplete-fido-backward-updir

Reported by: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>

* lisp/icomplete.el (icomplete-fido-backward-updir): Don't save
dir fragments to kill ring.

4 years agoTag a test as unstable
Glenn Morris [Sat, 13 Jun 2020 17:42:47 +0000 (10:42 -0700)]
Tag a test as unstable

* test/lisp/calendar/lunar-tests.el (lunar-test-phase-list):
Mark as unstable.  Eg fails on hydra.nixos.org.

4 years agoRevert markup change in with-coding-priority docs
Basil L. Contovounesios [Sat, 13 Jun 2020 16:53:59 +0000 (17:53 +0100)]
Revert markup change in with-coding-priority docs

This partially reverts commit fc759eb9b3
"Fix with-coding-priority markup in Elisp manual"
of 2019-10-13T15:36:02Z!contovob@tcd.ie.

For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00550.html
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00473.html

* doc/lispref/nonascii.texi (Specifying Coding Systems): Use more
specific cross-reference to progn even if info.el displays it
suboptimally.

4 years agoMark python-shell-virtualenv-root as safe for directories
Philip K [Sat, 30 May 2020 19:47:51 +0000 (21:47 +0200)]
Mark python-shell-virtualenv-root as safe for directories

* lisp/progmodes/python.el (python-shell-virtualenv-root):
Require a directory name.  (Bug#41619)

4 years agoHighlight typed variables in Python
Konstantin Kharlamov [Wed, 3 Jun 2020 11:51:03 +0000 (14:51 +0300)]
Highlight typed variables in Python

* progmodes/python.el
(python-font-lock-keywords-maximum-decoration): Recognize
typed variables like "foo: int = 1" as well.  (Bug#41684)

4 years agoFurther fixes while testing tramp-crypt
Michael Albinus [Fri, 12 Jun 2020 18:17:02 +0000 (20:17 +0200)]
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.

4 years agoDerive gnus-edit-form-mode from lisp-data-mode, fix mode map
Eric Abrahamsen [Sat, 6 Jun 2020 19:13:15 +0000 (12:13 -0700)]
Derive gnus-edit-form-mode from lisp-data-mode, fix mode map

* lisp/gnus/gnus-eform.el (gnus-edit-form-mode): Derive from
lisp-data-mode, which can be handy for users who have turned on things
like paredit for lisp-data-mode.
(gnus-edit-form-mode-map): Put creation of the map inside the defvar.

4 years ago; * lisp/faces.el (readable-foreground-color): Fix editing mistake.
Mattias Engdegård [Wed, 10 Jun 2020 22:06:24 +0000 (00:06 +0200)]
; * lisp/faces.el (readable-foreground-color): Fix editing mistake.

4 years agoImproved light/dark colour predicate (bug#41544)
Mattias Engdegård [Wed, 10 Jun 2020 17:18:58 +0000 (19:18 +0200)]
Improved light/dark colour predicate (bug#41544)

Add a predicate, color-dark-p, for deciding whether a colour is more
readable with black or white as contrast.  It has experimentally been
shown to be more accurate and robust than the various methods
currently employed.

The new predicate compares the relative luminance of the colour to an
empirically determined cut-off value, and it seems to get it right in
almost all cases, with no value leading to outright bad results.

* lisp/faces.el (readable-foreground-color): Use color-dark-p.
(color-dark-p): New function.
* lisp/facemenu.el (list-colors-print): Use readable-foreground-color,
improving readability of list-colors-display.
* lisp/textmodes/css-mode.el (css--contrasty-color): Remove.
(css--fontify-region): Use readable-foreground-color.

4 years agoFuther tramp-crypt implementation and documentation
Michael Albinus [Wed, 10 Jun 2020 17:36:53 +0000 (19:36 +0200)]
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.

4 years ago; * test/lisp/emacs-lisp/generator-tests.el: Checkdoc fixes
Philipp Stephani [Wed, 10 Jun 2020 13:49:57 +0000 (15:49 +0200)]
; * test/lisp/emacs-lisp/generator-tests.el: Checkdoc fixes

4 years agoSlightly improve commit 73be4d1ed5b190bd93e9bad6aebe43d0dea0d7d3.
Philipp Stephani [Wed, 10 Jun 2020 13:46:12 +0000 (15:46 +0200)]
Slightly improve commit 73be4d1ed5b190bd93e9bad6aebe43d0dea0d7d3.

* lisp/emacs-lisp/cl-macs.el (cl-lambda-list, cl-lambda-list1)
(cl-macro-list, cl-macro-list1): Use exactly the same specification as
for &optional (sans the third optional list element).

4 years agoAllow destructuring in &aux sections when using edebug (Bug#40431)
Philipp Stephani [Wed, 10 Jun 2020 13:34:41 +0000 (15:34 +0200)]
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.

4 years ago; Simplify last change
Basil L. Contovounesios [Wed, 10 Jun 2020 00:00:01 +0000 (01:00 +0100)]
; Simplify last change

* lisp/progmodes/project.el (project--read-project-list): We are
already at BOB after insert-file-contents.

4 years ago* lisp/emulation/cua-rect.el (cua--rectangle-region-insert): New function.
Juri Linkov [Tue, 9 Jun 2020 23:03:06 +0000 (02:03 +0300)]
* lisp/emulation/cua-rect.el (cua--rectangle-region-insert): New function.

Add cua--insert-rectangle around region-insert-function (bug#41440).

4 years agoSave project list as lisp data
Simen Heggestøyl [Fri, 5 Jun 2020 17:32:30 +0000 (19:32 +0200)]
Save project list as lisp data

Save the project list file as lisp data instead of line separated
strings to make it more extendable in the future.

* lisp/progmodes/project.el (project--read-project-list)
(project--write-project-list, project--add-to-project-list-front)
(project--remove-from-project-list): Adjust to `project--list' now
being an alist.

4 years agoOrthographical amendments to commit 145aab0672ae259736ee9230f8e0ff4effa5f4fd
Alan Mackenzie [Tue, 9 Jun 2020 16:58:52 +0000 (16:58 +0000)]
Orthographical amendments to commit 145aab0672ae259736ee9230f8e0ff4effa5f4fd

* etc/NEWS: Correct the spelling of CC Mode.

* lisp/progmodes/cc-fonts.el (doxygen-font-lock-doc-comments): Replace curly
  quotes in comments by ASCII ones.

4 years agoContinue implementation of tramp-crypt.el
Michael Albinus [Tue, 9 Jun 2020 11:43:30 +0000 (13:43 +0200)]
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).

4 years ago* lisp/simple.el (shell-command-on-region): Handle nil replace on rectangles.
Juri Linkov [Mon, 8 Jun 2020 23:34:53 +0000 (02:34 +0300)]
* lisp/simple.el (shell-command-on-region): Handle nil replace on rectangles.

When 'region-noncontiguous-p' is non-nil (rectangular region)
but 'replace' is nil, pop up the shell output buffer (bug#41440).
When 'replace' is non-nil, trim the trailing newline.

4 years ago* lisp/simple.el (shell-command-on-region): Fix docstring.
Juri Linkov [Mon, 8 Jun 2020 23:28:53 +0000 (02:28 +0300)]
* lisp/simple.el (shell-command-on-region): Fix docstring.

* lisp/simple.el (shell-command-on-region): Mention REGION-NONCONTIGUOUS-P
in docstring (bug#41440)

* etc/NEWS: Better example for 'windmove-display-default-keybindings'.

4 years agoClean up D-Bus documentation (bug#41744)
Basil L. Contovounesios [Fri, 5 Jun 2020 23:58:37 +0000 (00:58 +0100)]
Clean up D-Bus documentation (bug#41744)

* doc/lispref/errors.texi (Standard Errors): The error symbol
dbus-error is defined even when Emacs is built without D-Bus.

* doc/misc/dbus.texi (Bus Names, Introspection)
(Nodes and Interfaces, Methods and Signal)
(Properties and Annotations, Arguments and Signatures)
(Synchronous Methods, Receiving Method Calls, Signals)
(Alternative Buses, Errors and Events): Clarify wording.  Fix
indentation of and simplify examples where possible.  Improve
Texinfo markup and cross-referencing where possible.
(Type Conversion): Ditto.  Remove mentions of Emacs' fixnum range
now that we have bignums.

* lisp/net/dbus.el (dbus-return-values-table)
(dbus-call-method-asynchronously, dbus-send-signal)
(dbus-register-signal, dbus-register-method)
(dbus-string-to-byte-array, dbus-byte-array-to-string)
(dbus-escape-as-identifier, dbus-check-event, dbus-event-bus-name)
(dbus-event-message-type, dbus-event-serial-number)
(dbus-event-service-name, dbus-event-path-name)
(dbus-event-interface-name, dbus-event-member-name)
(dbus-list-activatable-names, dbus-list-queued-owners, dbus-ping)
(dbus-introspect-get-interface-names, dbus-introspect-get-interface)
(dbus-introspect-get-method, dbus-introspect-get-signal)
(dbus-introspect-get-property, dbus-introspect-get-annotation-names)
(dbus-introspect-get-annotation, dbus-introspect-get-argument-names)
(dbus-introspect-get-argument, dbus-introspect-get-signature)
(dbus-set-property, dbus-register-property)
(dbus-get-all-managed-objects, dbus-init-bus): Clarify docstring and
improve formatting where possible.
(dbus-call-method): Ditto.  Remove mentions of Emacs' fixnum range
now that we have bignums.

4 years agoMore robust NS hex colour string parsing
Mattias Engdegård [Mon, 8 Jun 2020 11:06:51 +0000 (13:06 +0200)]
More robust NS hex colour string parsing

Invalid arguments to color-values, such as "#abcdefg" or "#1234", or
valid ones like "#111222333", should not yield nonsense values.

* src/nsterm.m (ns_get_color):
Only accept "#RGB" strings with 1-4 digits per components, equal number
of digits each, and no trailing characters.  Parse 12-bit colours
correctly.

4 years agoAdd autoload problem in tramp-crypt.el.
Michael Albinus [Mon, 8 Jun 2020 08:18:35 +0000 (10:18 +0200)]
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.

4 years ago* lisp/image-mode.el (image-transform-original): New command (bug#41222).
Juri Linkov [Mon, 8 Jun 2020 00:30:27 +0000 (03:30 +0300)]
* lisp/image-mode.el (image-transform-original): New command (bug#41222).

(image-mode-map): Bind it to "so" and add to menu.

4 years agoMove tab-bar and tab-line faces to faces.el (part of bug#41200)
Juri Linkov [Mon, 8 Jun 2020 00:21:42 +0000 (03:21 +0300)]
Move tab-bar and tab-line faces to faces.el (part of bug#41200)

These are basic faces, so they need to be defined in
faces.el, otherwise (get 'tab-line 'face) returns 0.

* lisp/faces.el (tab-bar, tab-line): Move faces here
from tab-bar.el and tab-line.el.

* lisp/tab-bar.el (tab-bar): Move face to faces.el.
(tab-bar-faces): Add '((tab-bar custom-face))
to the second arg MEMBERS of 'defgroup'.

* lisp/tab-line.el (tab-line): Move face to faces.el.
(tab-line-faces): Add '((tab-line custom-face))
to the second arg MEMBERS of 'defgroup'.