Paul Eggert [Sat, 30 Sep 2017 05:06:14 +0000 (22:06 -0700)]
Merge from origin/emacs-26
1e5949642a ; * src/gtkutil.c (xg_create_frame_widgets): Add FIXME re.... e7c8da4d05 bug#28609: simple.el 827db6b559 Use a separate syntax-ppss cache for narrowed buffers a2244f417a Improve python3-compatibility of fallback completion (Bug#... 79162cb0db Fix subr-x-tests when running from elc 66d35ae49d * lisp/eshell/esh-util.el (eshell-condition-case): Add deb... f5e72b04d9 Make sh-indentation into an alias for sh-basic-offset (Bug... a58d0c590a Fix loading of smie-config rules (Bug#24848) 3a68dec327 ; Update NEWS for the change in eldoc-message 5a41dd0a1f Reset default-directory inside *xref-grep* buffer 49cd561dc6 * test/lisp/tramp-tests.el (tramp-test21-file-links): Spec... b719f6b20b Loosen strict parsing requirement for desktop files c7a0c13777 * lisp/xdg.el (xdg-thumb-uri): Fix doc string. dc6b3560e5 Fix documentation of `make-frame' and related variables an... 3d3778d82a Accept new `always' value for option `buffer-offer-save' 638f64c40a Improve new NS scrolling variable names d93301242f Document 'replace-buffer-contents' in the manual. 00e4e3e9d2 Fix undecorated frame resizing issues on NS (bug#28512) 820739bbb5 ; * doc/emacs/display.texi (Display Custom): Fix wording. f2b2201594 ; Spelling and URL fixes 0e143b1fc5 Documentation improvements for 'display-line-numbers' f656ccdb43 ; Fix typo d64da52d57 Fix last change in bat-mode.el 908af46abd Fix restoring in GUI sessions desktop saved in TTY sessions 51cbd85454 Improve syntax highlighting in bat-mode 0273916618 Document the 'list-FOO' convention d24ec58540 Expose viewing conditions in CAM02-UCS metric a81d5a3d3f Revert "Set frame size to actual requested size (bug#18215)" 0bf066d4b2 Add tests for Edebug 68baca3ee1 Catch more messages in ert-with-message-capture 28e0c410c9 ; * lisp/mouse.el (secondary-selection-exist-p): Doc fix. 31e1d9ef2f Support setting region from secondary selection and vice v... 047f02f00f Fix new copy-directory bug with empty dirs fbd15836af * doc/lispref/strings.texi (Formatting Strings): Improve i... f16a8d5dbd Fix 2 testsuite tests for MS-Windows 965cffd89c Rename timer-list to list-timers a5fec62b51 Provide native touchpad scrolling on macOS 7b3d1c6beb Fix MinGW64 build broken by recent MinGW64 import libraries c83d0c5fdf Fix crashes in 'move-point-visually' in minibuffer windows 7f3d5f929d * src/emacs.c (usage_message): Don't mention 'find-file'. 6845282200 Fix a minor inaccuracy in the Emacs manual 74d7bb9498 Fix errors in flyspell-post-command-hook 40fdbb01d0 Work on Tramp's file-truename 1a01423b3c Fix bug with make-directory on MS-Windows root 066efb8666 Fix log-view-diff-common when point is after last entry 3f006b56cd Adapt fileio-tests--symlink-failure to Cygwin ee512e9a82 Ignore buffers whose name begins with a space in save-some... 9e1b5bd92c Improve tramp-interrupt-process robustness 8d4223e61b Minor Tramp doc update 331d0e520f Fix gensym 466df76f7d Cleanup in files-tests.el 6359fe630a Remove old cl-assert calls in 'newline' 059184e645 Avoid crash with C-g C-g in GC 541006c536 Fix format-time-string %Z bug with negative tz 679e05eeb9 message-citation-line-format %Z is now tz name 4e8888d438 Use doc-view or pdf-tools on any window-system 5f28f0db73 Fix bug with min and max and NaNs 37b5e661d2 Fix recently-introduced copy-directory bug 6bbbc38b34 Merge from Gnulib 57249fb297 Fix compatibility problem in Tramp 411bec82c4 Avoid GCC 7 compilation warning in eval.c 34a6774daa ; Partially revert c3445aed5194 3003ac0469 Adapt Tramp version. Do not merge 48d39c39e8 Search for Syntax section when viewing MDN 9d101376b4 Allow smerge-keep-current to work for empty hunks 13aba24add Call vc-setup-buffer in vc-git-log-{in,out}going 1d599df5e0 Fix last change to textmodes/page-ext.el a726e09a9a * test/src/lcms-tests.el (lcms-cri-cam02-ucs): Skip if lcm... 546413e1ac * test/src/lcms-tests.el (lcms-whitepoint): Skip if lcms2 ... 96aaeaaffa ; * src/lcms.c: Minor stylistic changes in comments. c3df816585 Fix compilation warning in etags.c
Mark Oteiza [Thu, 28 Sep 2017 11:52:00 +0000 (07:52 -0400)]
Add indent spec to easy-mmode macros
Ideally these macros should expand to the proper code instead of
relegating all the work to a function call.
* lisp/emacs-lisp/easy-mmode.el (easy-mmode-defmap):
(easy-mmode-define-syntax): Add indent spec.
Stefan Monnier [Wed, 27 Sep 2017 17:00:44 +0000 (13:00 -0400)]
* lisp/textmodes/page-ext.el: Misc cleanup, add RET binding
Use lexical-binding.
Remove redundant :group args.
(pages-directory-mode-map): Bind RET.
(pages-buffer, pages-pos-list): Define as buffer-local.
(pages-directory-map): Define as alias *before* the defvar.
Mark as obsolete.
(pages-buffer-original-position, pages-buffer-original-page):
Move declaration to before the first use.
(pages-directory): Remove unused var `linenum`.
(pages-directory-goto): Add optional `event` arg and make it work when
bound to mouse events.
(pages-directory-goto-with-mouse): Make it an obsolete alias.
Mark Oteiza [Mon, 25 Sep 2017 02:28:51 +0000 (22:28 -0400)]
Add MIME apps spec utilities
Facilitates finding associations between MIME types and desktop files
that report an association with that type. Combined with mailcap.el's
MIME facilities, it should be easy to use desktop files.
* lisp/xdg.el (xdg-mime-table): New variable.
(xdg-mime-apps-files, xdg-mime-collect-associations, xdg-mime-apps):
New functions.
* test/data/xdg/mimeapps.list: New file.
* test/data/xdg/mimeinfo.cache: New file.
* test/lisp/xdg-tests.el (xdg-mime-associations): New test.
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.
Paul Eggert [Mon, 25 Sep 2017 18:19:07 +0000 (11:19 -0700)]
Merge from origin/emacs-26
49cd561dc6 * test/lisp/tramp-tests.el (tramp-test21-file-links): Spec... b719f6b20b Loosen strict parsing requirement for desktop files c7a0c13777 * lisp/xdg.el (xdg-thumb-uri): Fix doc string. dc6b3560e5 Fix documentation of `make-frame' and related variables an... 3d3778d82a Accept new `always' value for option `buffer-offer-save' 638f64c40a Improve new NS scrolling variable names d93301242f Document 'replace-buffer-contents' in the manual. 00e4e3e9d2 Fix undecorated frame resizing issues on NS (bug#28512) 820739bbb5 ; * doc/emacs/display.texi (Display Custom): Fix wording. f2b2201594 ; Spelling and URL fixes 0e143b1fc5 Documentation improvements for 'display-line-numbers' f656ccdb43 ; Fix typo d64da52d57 Fix last change in bat-mode.el 908af46abd Fix restoring in GUI sessions desktop saved in TTY sessions 51cbd85454 Improve syntax highlighting in bat-mode 0273916618 Document the 'list-FOO' convention d24ec58540 Expose viewing conditions in CAM02-UCS metric a81d5a3d3f Revert "Set frame size to actual requested size (bug#18215)" 0bf066d4b2 Add tests for Edebug 68baca3ee1 Catch more messages in ert-with-message-capture 28e0c410c9 ; * lisp/mouse.el (secondary-selection-exist-p): Doc fix. 31e1d9ef2f Support setting region from secondary selection and vice v... 047f02f00f Fix new copy-directory bug with empty dirs fbd15836af * doc/lispref/strings.texi (Formatting Strings): Improve i... f16a8d5dbd Fix 2 testsuite tests for MS-Windows 965cffd89c Rename timer-list to list-timers a5fec62b51 Provide native touchpad scrolling on macOS 7b3d1c6beb Fix MinGW64 build broken by recent MinGW64 import libraries c83d0c5fdf Fix crashes in 'move-point-visually' in minibuffer windows 7f3d5f929d * src/emacs.c (usage_message): Don't mention 'find-file'. 6845282200 Fix a minor inaccuracy in the Emacs manual 74d7bb9498 Fix errors in flyspell-post-command-hook 40fdbb01d0 Work on Tramp's file-truename 1a01423b3c Fix bug with make-directory on MS-Windows root 066efb8666 Fix log-view-diff-common when point is after last entry 3f006b56cd Adapt fileio-tests--symlink-failure to Cygwin ee512e9a82 Ignore buffers whose name begins with a space in save-some... 9e1b5bd92c Improve tramp-interrupt-process robustness 8d4223e61b Minor Tramp doc update 331d0e520f Fix gensym 466df76f7d Cleanup in files-tests.el 6359fe630a Remove old cl-assert calls in 'newline' 059184e645 Avoid crash with C-g C-g in GC 541006c536 Fix format-time-string %Z bug with negative tz 679e05eeb9 message-citation-line-format %Z is now tz name 4e8888d438 Use doc-view or pdf-tools on any window-system 5f28f0db73 Fix bug with min and max and NaNs 37b5e661d2 Fix recently-introduced copy-directory bug 6bbbc38b34 Merge from Gnulib 57249fb297 Fix compatibility problem in Tramp 411bec82c4 Avoid GCC 7 compilation warning in eval.c 34a6774daa ; Partially revert c3445aed5194
Paul Eggert [Mon, 25 Sep 2017 18:16:05 +0000 (11:16 -0700)]
Merge from origin/emacs-26
48d39c39e8 Search for Syntax section when viewing MDN 9d101376b4 Allow smerge-keep-current to work for empty hunks 13aba24add Call vc-setup-buffer in vc-git-log-{in,out}going 1d599df5e0 Fix last change to textmodes/page-ext.el a726e09a9a * test/src/lcms-tests.el (lcms-cri-cam02-ucs): Skip if lcm...
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.
Mark Oteiza [Sun, 24 Sep 2017 12:17:34 +0000 (08:17 -0400)]
Expand recognized time intervals for MPC seeking
Now accepts [+-]H:M:S and subsets. Also accepts some odd variations of
it since the regexp is not strict. One unpleasant caveat is that
string-to-number simply returns zero on failure instead of signaling an
error. At the moment, there are cases where instead of getting
a user-error, the seek may simply not go where one expects it.
* lisp/mpc.el (mpc-read-seek): New function.
(mpc-seek-current): Use it.
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.
Philipp Stephani [Sun, 27 Aug 2017 10:41:06 +0000 (12:41 +0200)]
Don't call deprecated GTK function gtk_adjustment_changed
* src/gtkutil.c (xg_set_toolkit_scroll_bar_thumb)
(xg_set_toolkit_horizontal_scroll_bar_thumb): Remove calls to
deprecated function gtk_adjustment_changed. This function has been
deprecated since GTK+ 3.18.
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.
Alan Mackenzie [Mon, 18 Sep 2017 08:52:24 +0000 (08:52 +0000)]
Fix irregularities with CC Mode fontification, particularly with "known types"
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Introduce a new
optional parameter, template-class. In "class <X = Y>", fontify "Y" as a
type.
(c-font-lock-single-decl): New variable template-class, set to non-nil when we
have a construct like the above. Pass this as argument to
c-font-lock-declarators.
(c-font-lock-cut-off-declarators): Check more rigorously that a declaration
being processed starts before the function's starting position.
(c-complex-decl-matchers): Remove the redundant clause which fontified "types
preceded by, e.g., "struct"".
* lisp/progmodes/cc-langs.el (c-template-typename-kwds)
(c-template-typename-key): New lang defconsts and defvar.
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.
Eli Zaretskii [Sun, 17 Sep 2017 16:50:43 +0000 (19:50 +0300)]
Avoid GCC 7 compilation warning in eval.c
* src/eval.c (push_handler_nosignal): Use CACHEABLE to work around
GCC compilation warning. Suggested by Paul Eggert <eggert@cs.ucla.edu>
in http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00492.html.
The pdf-view-mode entry had been added recently and should not have been
removed.
* lisp/net/mailcap.el: Restore pdf-view-mode entry from the pdf-tools
package.
Michael Albinus [Sun, 17 Sep 2017 08:03:18 +0000 (10:03 +0200)]
Adapt Tramp version. Do not merge
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.3.26.1".
(customize-package-emacs-version-alist): Add Tramp version
integrated in Emacs 26.1.