Andy Moreton [Sat, 30 Sep 2017 13:21:39 +0000 (16:21 +0300)]
Avoid assertions in vc-hg.el on MS-Windows
* lisp/vc/vc-hg.el (vc-hg--pcre-to-elisp-re)
(vc-hg--slurp-hgignore, vc-hg--read-repo-requirements)
(vc-hg-state-fast): Use file-name-absolute-p and directory-name-p
instead of relying on Unix file-name syntax. This avoids
assertion violations on MS-Windows.
Eli Zaretskii [Sat, 30 Sep 2017 12:08:47 +0000 (15:08 +0300)]
Improve indexing of multi-file/buffer Isearch commands
* doc/emacs/maintaining.texi (Identifier Search): Change wording
of index entries to make them different from those for multi-file
isearch commands. (Bug#28584)
* doc/emacs/search.texi (Other Repeating Search): Index the
multi-* commands. (Bug#28584) Rearrange the indexing to keep
each index entry close to its subject.
Wait for frame visibility with timeout in w32term too
* src/w32term.c (syms_of_w32term) [x-wait-for-event-timeout]: New
variable.
(x_make_frame_visible): Wait for frame to become visible according to
its value.
(input_signal_count): Remove.
Noam Postavsky [Thu, 31 Aug 2017 03:12:22 +0000 (23:12 -0400)]
Bring back the busy wait after x_make_frame_visible (Bug#25521)
But wait specfically for a MapNotify event, and only for a
configurable amount of time.
* src/xterm.c (syms_of_xterm) [x-wait-for-event-timeout]: New
variable.
(x_wait_for_event): Use it instead of hardcoding the wait to 0.1s.
(x_make_frame_visible): Call x_wait_for_event at the end.
* etc/NEWS: Announce x_wait_for_event.
* test/lisp/textmodes/css-mode-tests.el (css-test-current-defun-name)
(css-test-current-defun-name-nested)
(css-test-current-defun-name-complex): New tests for
`css-current-defun-name'.
João Távora [Wed, 27 Sep 2017 21:35:49 +0000 (22:35 +0100)]
Revert "Split flymake.el into flymake-proc.el and flymake-ui.el"
In other words, re-coalesce the two files,
lisp/progmodes/flymake-proc.el and lisp/progmodes/flymake-ui.el, back
into a single one, lisp/progmodes/flymake.el.
The changesets "Prefer HTTPS to FTP and HTTP in documentation" and
"allow nil init in flymake-allowed-file-name-masks to disable flymake"
are kept in place in the new lisp/progmodes/flymake.el.
Don't merge this back to master as development happening there builds
upon this work. See also
https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00932.html.
Don't merge this back to master as development happening there builds
upon this work. See also
https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00932.html
Paul Eggert [Tue, 26 Sep 2017 23:31:57 +0000 (16:31 -0700)]
Avoid some unnecessary copying in Fformat etc.
This patch is just for performance; it should not affect behavior.
On my platform, it made the microbenchmark (format "%S" load-path)
run about 45% faster. It should also speed up calls like (message
"%s" STRING).
* src/callint.c (Fcall_interactively):
* src/dbusbind.c (XD_OBJECT_TO_STRING):
* src/editfns.c (Fmessage, Fmessage_box):
* src/xdisp.c (vadd_to_log, Ftrace_to_stderr):
Use styled_format instead of Fformat or Fformat_message,
to avoid unnecessary copying.
* src/editfns.c (styled_format): New arg NEW_RESULT.
All uses changed. Reuse an input string if it has the
right value and if !NEW_RESULT.
* src/lisp.h (style_format): New decl.
Use a separate syntax-ppss cache for narrowed buffers
* lisp/emacs-lisp/syntax.el (syntax-ppss-wide):
New variable, to contain the data from `syntax-ppss-last' and
`syntax-ppss-cache'.
(syntax-ppss-cache, syntax-ppss-last): Remove.
(syntax-ppss-narrow, syntax-ppss-narrow-start): New variables.
(syntax-ppss-flush-cache): Flush both caches.
(syntax-ppss--data): Return the appropriate last result and
buffer cache for the current restriction.
(syntax-ppss, syntax-ppss-debug): Use it (bug#22983).
Improve python3-compatibility of fallback completion (Bug#28499)
* lisp/progmodes/python.el (python-eldoc-setup-code): Use
inspect.getfullargspec instead of inspect.getargspec to avoid a
deprecation warning on every usage of eldoc in python-mode.
Noam Postavsky [Wed, 30 Aug 2017 23:42:47 +0000 (19:42 -0400)]
Make sh-indentation into an alias for sh-basic-offset (Bug#21751)
* lisp/progmodes/sh-script.el (sh-indentation): Redefine as obsolete
variable alias for `sh-basic-offset'.
(sh-mode, sh-smie--indent-continuation)
(sh-smie-rc-rules, sh-basic-indent-line): Replace `sh-indentation'
with `sh-basic-offset'.
Noam Postavsky [Wed, 30 Aug 2017 23:31:48 +0000 (19:31 -0400)]
Fix loading of smie-config rules (Bug#24848)
* lisp/emacs-lisp/smie.el (smie-config--setter): Use `set-default'
instead of `setq-default'.
(smie-config): Use `custom-initialize-set' instead of
`custom-initialize-default' as the :initialize argument.
* lisp/progmodes/sh-script.el (sh-learn-buffer-indent): Mention that
we call `smie-config-guess' so that the user will have a chance to
find the correct docstring to consult. Remove hedging comments
regarding use of abnormal hooks.
Mark Oteiza [Mon, 25 Sep 2017 12:45:08 +0000 (08:45 -0400)]
Loosen strict parsing requirement for desktop files
There are other desktop-looking files, for instance those having to do
with MIME typess, that would benefit from being able to be read by this
function. It helps to have some flexibility.
* lisp/xdg.el (xdg-desktop-read-file): Remove an error condition.
* test/lisp/xdg-tests.el: Remove a test.
* lisp/files.el (buffer-offer-save): In addition to nil and t, now
allows a third symbol value, `always'. A buffer where this option is
set to `always' will always be offered for save by
`save-some-buffers'.
(save-some-buffers): Check the exact value of this buffer-local
variable. No longer check the buffer name, or the value of
`write-contents-functions'.
* doc/lispref/buffers.texi (Killing Buffers): Note change in manual.
* doc/lispref/files.texi (Saving Buffers): Remove note about buffer
names.
* etc/NEWS: Mention in NEWS.
Alan Third [Sat, 23 Sep 2017 18:43:58 +0000 (19:43 +0100)]
Fix undecorated frame resizing issues on NS (bug#28512)
* src/nsterm.m (EmacsView::updateFrameSize): Don't wait for the
toolbar on undecorated frames.
(EmacsView::initFrameFromEmacs): Group window flags correctly.
Eli Zaretskii [Fri, 22 Sep 2017 14:52:47 +0000 (17:52 +0300)]
Fix restoring in GUI sessions desktop saved in TTY sessions
* lisp/frameset.el (frameset-filter-font-param): New function.
(frameset-persistent-filter-alist): Use it for processing the
'font' frame parameter. (Bug#17352)
Mark Oteiza [Fri, 22 Sep 2017 02:47:24 +0000 (22:47 -0400)]
Expose viewing conditions in CAM02-UCS metric
Also add tests from the colorspacious library. Finally, catch an
errant calculation, where degrees were not being converted to radians.
* src/lcms.c (deg2rad, default_viewing_conditions):
(parse_viewing_conditions): New functions.
(lcms-cam02-ucs): Add comments pointing to references used. Expand
the docstring and explain viewing conditions. JCh hue is given in
degrees and needs to be converted to radians.
(lcms-d65-xyz): Remove. No need to duplicate this in Lisp or make the
API needlessly impure.
* test/src/lcms-tests.el: Reword commentary.
(lcms-rgb255->xyz): New function.
(lcms-cri-cam02-ucs): Fix let-binding.
(lcms-dE-cam02-ucs-silver): New test, assimilated from colorspacious.
* lisp/emacs-lisp/ert-x.el (ert-with-message-capture): Capture
messages from prin1, princ and print.
(ert--make-message-advice): New function.
(ert--make-print-advice): New function.
Tak Kunihiro [Thu, 21 Sep 2017 08:26:00 +0000 (11:26 +0300)]
Support setting region from secondary selection and vice versa
* lisp/mouse.el (secondary-selection-exist-p): New function to
allow callers to tell existence of the secondary selection
in current buffer.
(secondary-selection-to-region): New function to set
beginning and end of the region from those of the secondary
selection.
(secondary-selection-from-region): New function to set
beginning and end of the secondary selection from those of
the region. (Bug#27530)
Paul Eggert [Wed, 20 Sep 2017 18:49:12 +0000 (11:49 -0700)]
Fix new copy-directory bug with empty dirs
Problem reported by Afdam Plaice (Bug#28520) and by Eli Zaretskii
(Bug#28483#34). This is another bug that I introduced in my
recent copy-directory changes.
* lisp/files.el (copy-directory): Work with empty subdirectories, too.
* test/lisp/files-tests.el (files-tests--copy-directory):
Test for this bug.
Eli Zaretskii [Wed, 20 Sep 2017 07:16:11 +0000 (10:16 +0300)]
Fix 2 testsuite tests for MS-Windows
* test/lisp/ibuffer-tests.el (test-buffer-list): Don't try to
create files with "*" in their names.
* test/src/editfns-tests.el (format-time-string-with-zone): Adapt
results to MS-Windows build. Reported by Fabrice Popineau
<fabrice.popineau@gmail.com>.
Alan Third [Fri, 8 Sep 2017 18:26:47 +0000 (19:26 +0100)]
Provide native touchpad scrolling on macOS
* etc/NEWS: Describe changes.
* lisp/term/ns-win.el (mouse-wheel-scroll-amount,
mouse-wheel-progressive-speed): Set to smarter values for macOS
touchpads.
* src/nsterm.m (emacsView::mouseDown): Use precise scrolling deltas to
calculate scrolling for touchpads and mouse wheels.
(syms_of_nsterm): Add variables 'ns-use-system-mwheel-acceleration',
'ns-touchpad-scroll-line-height' and 'ns-touchpad-use-momentum'.
* src/keyboard.c (make_lispy_event): Pass on .arg when relevant.
* src/termhooks.h (event_kind): Update comments re. WHEEL_EVENT.
* lisp/mwheel.el (mwheel-scroll): Use line count.
* lisp/subr.el (event-line-count): New function.
Eli Zaretskii [Tue, 19 Sep 2017 16:48:27 +0000 (19:48 +0300)]
Fix a minor inaccuracy in the Emacs manual
* doc/emacs/cmdargs.texi (Action Arguments): Don't mention
'find-file', as the implementation has changed. Reported by
Everton J. Carpes <everton.carpes@gmail.com> in
http://lists.gnu.org/archive/html/help-gnu-emacs/2017-09/msg00146.html.
Eli Zaretskii [Tue, 19 Sep 2017 16:32:09 +0000 (19:32 +0300)]
Fix errors in flyspell-post-command-hook
* lisp/textmodes/ispell.el (ispell-get-decoded-string): Handle the
case of a nil Nth element of the language dictionary slot. This
avoids errors in 'flyspell-post-command-hook' when switching
dictionaries with some spell-checkers. (Bug#28501)
Michael Albinus [Tue, 19 Sep 2017 16:12:35 +0000 (18:12 +0200)]
Work on Tramp's file-truename
* lisp/net/tramp-sh.el (tramp-perl-file-truename):
Check also for symlinks.
(tramp-sh-handle-file-truename): Move check for a symlink
cycle to the end. Do not blame symlinks which look like a
remote file name.
Paul Eggert [Tue, 19 Sep 2017 08:47:39 +0000 (01:47 -0700)]
Fix bug with make-directory on MS-Windows root
* lisp/files.el (files--ensure-directory): Treat any error, not
just file-already-exists, as an opportunity to check whether DIR
is already a directory (Bug#28508).
Ken Brown [Mon, 18 Sep 2017 21:22:52 +0000 (17:22 -0400)]
Adapt fileio-tests--symlink-failure to Cygwin
* test/src/fileio-tests.el (fileio-tests--symlink-failure)
[CYGWIN]: Skip the case of a symlink target starting with '\';
this is treated specially on Cygwin.
Paul Eggert [Mon, 18 Sep 2017 05:32:31 +0000 (22:32 -0700)]
Remove old cl-assert calls in 'newline'
* lisp/simple.el (newline): Remove cl-assert calls
that didn't seem to be helping us debug Bug#18913,
and that caused problems as reported in Bug#28280.
Suggested by Glenn Morris (Bug#28280#8).
Paul Eggert [Mon, 18 Sep 2017 05:01:56 +0000 (22:01 -0700)]
Avoid crash with C-g C-g in GC
Problem reported by Richard Stallman (Bug#17406).
Based on fix suggested by Eli Zaretskii (Bug#28279#16).
* src/term.c (tty_send_additional_strings):
Use only safe accessors, to avoid crash when C-g C-g in GC.
Paul Eggert [Mon, 18 Sep 2017 03:38:12 +0000 (20:38 -0700)]
Fix format-time-string %Z bug with negative tz
* src/editfns.c (tzlookup): Fix sign error in %Z when a purely
numeric zone is negative (Bug#28746).
* test/src/editfns-tests.el (format-time-string-with-zone):
Add test for this bug.
Paul Eggert [Sun, 17 Sep 2017 22:25:44 +0000 (15:25 -0700)]
Fix bug with min and max and NaNs
* src/data.c (minmax_driver): Fix bug with (min 0 NaN), which
mistakenly yielded 0. Also, pacify GCC in a better way.
* test/src/data-tests.el (data-tests-min): Test for the bug.
Paul Eggert [Sun, 17 Sep 2017 19:56:00 +0000 (12:56 -0700)]
Fix recently-introduced copy-directory bug
Problem reported by Andrew Christianson (Bug#28451):
* lisp/files.el (copy-directory): If COPY-CONTENTS, make the
destination directory if it does not exist, even if it is a
directory name. Simplify, and omit unnecessary test for an
already-existing non-directory target, since make-directory
diagnoses that for us now.
* test/lisp/files-tests.el (files-tests--copy-directory):
Test for this bug.
Michael Albinus [Sun, 17 Sep 2017 17:16:59 +0000 (19:16 +0200)]
Fix compatibility problem in Tramp
* lisp/net/tramp.el (tramp-interrupt-process): Better error handling.
* lisp/net/tramp-compat.el (default-toplevel-value): Move up.
(top): Do not call `tramp-change-syntax' anymore.
(tramp-compat-directory-name-p): New defalias.
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-copy-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-copy-file): Use it.