* lisp/progmodes/sql.el: Added password wallet using
`auth-source' package.
(sql-auth-source-search-wallet): New function.
(sql-password-wallet): New variable.
(sql-password-search-wallet-function): New variable.
(sql-get-login): Handle password wallet search.
(sql-product-interactive): Handle password function.
* test/lisp/progmodes/sql-test.el: Test wallet changes.
(sql-test-login-params): New test variable.
(with-sql-test-connect-harness): New macro to wrap test
configuration around calls to `sql-connect'.
(sql-test-connect, sql-test-connect-password-func)
(sql-test-connect-wallet-server-database)
(sql-test-connect-wallet-database)
(sql-test-connect-wallet-server): New ERT tests.
* etc/NEWS: Updated SQL Mode descriptions.
(sql-statement-regexp): if 'ansi' dialect is not defined, use "select"
(sql-interactive-mode): establish process sentinel iff there is a
process. Default values for :prompt-regexp and :prompt-length.
(sql-product-interactive): only check process status iff there is a
process.
Paul Eggert [Mon, 18 Feb 2019 22:42:45 +0000 (14:42 -0800)]
Minor profiler improvements
* src/profiler.c (evict_lower_half, record_backtrace)
(setup_cpu_timer, cmpfn_profiler, hashfn_profiler):
Assume C99. Use bool for boolean.
(timer_getoverrun): Remove; simplify use to not need it.
(Fprofiler_cpu_start): Any negative return from setup_cpu_timer fails.
(Fprofiler_cpu_stop): Simplify initialization.
Stefan Monnier [Mon, 18 Feb 2019 14:43:59 +0000 (09:43 -0500)]
* lisp/vc/smerge-mode.el (smerge-change-buffer-confirm): New var
(smerge-vc-next-conflict): Obey it. Save buffer before going to
the next. Don't emit message when vc-find-conflicted-file can't find
other conflicted file.
Paul Eggert [Mon, 18 Feb 2019 07:17:12 +0000 (23:17 -0800)]
emacs-init-time outputs more digits now
* lisp/time.el (emacs-init-time): Output more digits;
formerly this was always outputting "0.0 seconds" for me
because the number of seconds was less than 0.1.
Alan Mackenzie [Sun, 17 Feb 2019 18:57:10 +0000 (18:57 +0000)]
Fontify C function identifiers in parentheses correctly (e.g. in lisp.h)
Fix handling of CC Mode's syntactic WS cache. Make noise-macro option
variables buffer local.
* lisp/progmodes/cc-engine.el (c-put-is-sws, c-put-in-sws, c-remove-is-sws)
(c-remove-in-sws c-remove-is-and-in-sws): Add edebug specs.
(c-invalidate-sws-region-before): Add a `beg' parameter. Handle noise
macros like other literals.
(c-invalidate-sws-region-after-del): Move the adjustment of (cdr
c-sws-lit-limits) due to buffer change to c-invalidate-sws-region-after.
(c-invalidate-sws-region-after-ins): Move (goto-char end) to the correct
place.
(c-invalidate-sws-region-after): Adjust (cdr c-sws-lit-limits) due to buffer
change. Handle noise macros.
(c-backward-sws): Set simple-ws-beg appropriately when the start point is in
the middle of a noise macro.
(c-forward-decl-or-cast-1): Recognize a function identifier being declared in
parentheses.
* lisp/promodes/cc-mode.el (c-before-change): Supply a `beg' argument to
c-invalidate-sws-region-before.
* lisp/progmodes/cc-vars.el (c-noise-macro-with-parens-name-re)
(c-noise-macro-name-re, c-noise-macro-names, c-noise-macro-with-parens-names):
Make these buffer local variables.
Prevent over-eager rx character range condensation
`rx' incorrectly considers character ranges between ASCII and raw bytes to
cover all codes in-between, which includes all non-ASCII Unicode chars.
This causes (any "\000-\377" ?Å) to be simplified to (any "\000-\377"),
which is not at all the same thing: [\000-\377] really means
[\000-\177\200-\377] (Bug#34492).
* lisp/emacs-lisp/rx.el (rx-any-condense-range): Split ranges going
from ASCII to raw bytes.
* test/lisp/emacs-lisp/rx-tests.el (rx-char-any-raw-byte): Add test case.
* etc/NEWS: Mention the overall change (Bug#33205).
Eli Zaretskii [Sat, 16 Feb 2019 07:15:40 +0000 (09:15 +0200)]
Fix 'early-init-file' value when file is missing
* lisp/startup.el (command-line): Pass 'early-init.el', with
an explicit .el extension, to load-user-init-file.
Reported by Radon Rosborough <radon.neon@gmail.com> in
http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00314.html.
(compilation-shell-minor-mode, compilation-minor-mode): Use :lighter
rather than the old positional args.
(compilation-next-error): Make "No error here" into a user-error.
Eli Zaretskii [Fri, 15 Feb 2019 13:45:23 +0000 (15:45 +0200)]
Make ls-lisp.el behave like Posix hosts when directory doesn't exist
* lisp/ls-lisp.el (ls-lisp-insert-directory): For a directory
that cannot be accessed, signal an error, like insert-directory
does on Posix systems. This causes files-tests.el to pass on
MS-Windows.
Avoid errors in erc-dcc.el when erc-dcc-verbose is non-nil
* lisp/erc/erc-dcc.el (erc-dcc-get-filter): Don't assume STR
is always a string. Use 'buffer-name' to get the DCC file
name, as buffer-file-name is not set in the process buffer.
Gregor Zattler [Wed, 13 Feb 2019 20:01:17 +0000 (21:01 +0100)]
* doc/misc/eshell.texi (Built-ins): Fix alias description
Dear eamcs developers, eshells current documentation first states
that alias definitions are not saved to an alias file, later that
they are saved to an alias file. I tested it and the latter is
correct.
Please find attached a patch which fixes this.
Thanks for working on emacs which is really great, Gregor
>From 1fe51cc769ab7a30d0896fb3d6105c0561243fa7 Mon Sep 17 00:00:00 2001
From: Gregor Zattler <telegraph@gmx.net>
Date: Wed, 13 Feb 2019 20:19:38 +0100
Subject: * doc/misc/eshell.texi (Built-ins): Fix alias description.
Bring description of built-in 'alias' in line with (info "(eshell) Aliases"),
which describes the actual behaviur.
João Távora [Thu, 14 Feb 2019 23:33:49 +0000 (23:33 +0000)]
Change scoring strategy for 'flex' completion style
The previous strategy had problems comparing scores of matches to
strings of different lengths. This one seems slightly more sensible,
and uses a new constant `flex-score-match-tightness' instead of the
more abstract `flex-score-falloff'.
It's not completely without problems, and I think it shouldn't count
"holes" at the front and at the back, but that needs a different
"pattern-to-regexp" conversion in completion-pcm--hilit-commonality.
(defun test ()
(mapcar (lambda (a)
(cons (substring-no-properties a)
(get-text-property 0 'completion-score a)))
(sort (completion-pcm--hilit-commonality
'(prefix "f" star "o" star "o" point)
'("foo"
"barfoobaz"
"foobarbaz"
"barbazfoo"
"fabrobazo"
"foot"
"foto"
"fotttttttttttttttttttttttto"))
(lambda (a b)
(> (get-text-property 0 'completion-score a)
(get-text-property 0 'completion-score b))))))
Backport: js-indent-align-list-continuation: Make variable safe
* lisp/progmodes/js.el (js-indent-align-list-continuation): Indicate
variable is safe as a file-local variable. This fixes the
js-indent-align-list-continuation-nil test when run with make.
Gregor Zattler [Wed, 13 Feb 2019 20:01:17 +0000 (21:01 +0100)]
* doc/misc/eshell.texi (Built-ins): Fix alias description
Dear eamcs developers, eshells current documentation first states
that alias definitions are not saved to an alias file, later that
they are saved to an alias file. I tested it and the latter is
correct.
Please find attached a patch which fixes this.
Thanks for working on emacs which is really great, Gregor
>From 1fe51cc769ab7a30d0896fb3d6105c0561243fa7 Mon Sep 17 00:00:00 2001
From: Gregor Zattler <telegraph@gmx.net>
Date: Wed, 13 Feb 2019 20:19:38 +0100
Subject: * doc/misc/eshell.texi (Built-ins): Fix alias description.
Bring description of built-in 'alias' in line with (info "(eshell) Aliases"),
which describes the actual behaviur.
Paul Eggert [Wed, 13 Feb 2019 23:03:01 +0000 (15:03 -0800)]
Add missing dependency to ucs-normalize.el
* lisp/international/ucs-normalize.el:
Require regexp-opt when compiling. Problem reported by hx in:
https://lists.gnu.org/r/emacs-devel/2019-02/msg00334.html
João Távora [Tue, 12 Feb 2019 21:55:34 +0000 (21:55 +0000)]
Score flex-style completions according to match tightness
The new completion style needs to score completion matches so that we
can use it later on when sorting the completions. This is because
"foo" can flex-match "foobar", "frodo" and "barfromsober" but we
probably want "foobar" to appear at the top of the completion list.
This change introduces a scoring formula and adds scoring hints in the
candidate string's `completion-score' property.
* lisp/minibuffer.el (completion-pcm--hilit-commonality): Propertize
completion with 'completion-score
(flex-score-falloff): New variable.
Eli Zaretskii [Wed, 13 Feb 2019 15:39:31 +0000 (17:39 +0200)]
Avoid crashes upon C-g in nested invocations of 'read_char'
* src/keyboard.c (read_char, read_event_from_main_queue):
Ensure the global value of getcjmp is restored when the stack
is unwound by the likes of 'throw', by calling
record_unwind_protect_ptr instead of restoring the value
manually. (Bug#34394)
(restore_getcjmp): Argument is now 'void *', to match the
signature of record_unwind_protect_ptr.
Eli Zaretskii [Wed, 13 Feb 2019 15:39:31 +0000 (17:39 +0200)]
Avoid crashes upon C-g in nested invocations of 'read_char'
* src/keyboard.c (read_char, read_event_from_main_queue):
Ensure the global value of getcjmp is restored when the stack
is unwound by the likes of 'throw', by calling
record_unwind_protect_ptr instead of restoring the value
manually. (Bug#34394)
(restore_getcjmp): Argument is now 'void *', to match the
signature of record_unwind_protect_ptr.
Indent arrows’ expression bodies like function bodies (Bug#25904)
* lisp/progmodes/js.el (js--continued-expression-p): Don’t confuse
‘=>’ for a ‘>’ operator.
(js--line-terminating-arrow-re): New variable.
(js--looking-at-broken-arrow-function-p): New function.
(js--proper-indentation): Don’t align arrow functions’ expression
bodies starting on new lines like list continuations, instead align
them like function bodies (js-indent-align-list-continuation need not
be nil).
* test/manual/indent/js.js: Add test for Bug#25904.
js-indent-align-list-continuation: Make variable safe
* lisp/progmodes/js.el (js-indent-align-list-continuation): Indicate
variable is safe as a file-local variable. This fixes the
js-indent-align-list-continuation-nil test when run with make.
Paul Eggert [Tue, 12 Feb 2019 23:20:40 +0000 (15:20 -0800)]
Make xterm-mouse-truncate-wrap obsolete
* lisp/xt-mouse.el (xterm-mouse-truncate-wrap): Now obsolete,
since we no longer need to worry about integer overflow.
(xterm-mouse-event): Use plain ‘truncate’ instead.
Eli Zaretskii [Mon, 11 Feb 2019 16:07:35 +0000 (18:07 +0200)]
Fix Hunspell invocation for discovering its dictionaries
* lisp/textmodes/ispell.el
(ispell-find-hunspell-dictionaries): Invoke Hunspell with the
-a switch, to prevent it from initializing its curses UI.
(Bug#34272)
Paul Eggert [Mon, 11 Feb 2019 07:46:24 +0000 (23:46 -0800)]
Don’t assume CURRENT_TIME_LIST
Use timestamp accessors instead of delving into a timestamp
format that is planned to change in a future version.
* lisp/find-lisp.el (find-lisp-format-time):
* lisp/gnus/gnus-group.el (gnus-group-set-timestamp):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-show-org-agenda):
Use encode-time instead of delving into timestamp format.
* lisp/gnus/gnus-group.el (gnus-group-timestamp-delta):
Use float-time instead of delving into timestamp format.
* lisp/gnus/nnmaildir.el (nnmaildir-request-accept-article):
Use format-time-string instead of delving into timestamp format.
* lisp/gnus/nnmaildir.el (nnmaildir-request-expire-articles):
Use time-less-p instead of delving into timestamp format.
* lisp/ido.el (ido-wash-history, ido-file-name-all-completions):
Use time-equal-p instead of delving into timestamp format.
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
Use format-time-string to generate POSIX ‘test -t’ format instead
of timestamp-format-dependent code along with shell arithmetic
that can’t possibly do the right thing on a POSIX platform.
Stefan Monnier [Sun, 10 Feb 2019 23:12:05 +0000 (18:12 -0500)]
* test/lisp/emacs-lisp/package-tests.el: Allow extra extras
(package-test--compatible-p): New function.
(package-test-desc-from-buffer, package-test-install-single): Use it.
(package-x-test-upload-buffer, package-x-test-upload-new-version):
Don't burp in presence of extra extras.
Document that [:cntrl:] does not match DEL (Bug#34391)
* doc/lispref/searching.texi (Character Classes):
* lisp/emacs-lisp/rx.el (rx):
Document that [:cntrl:] excludes DEL.
* test/src/regex-emacs-tests.el (regex-tests-PTESTS-whitelist):
Swap misplaced comments and fix wrong code for DEL.
João Távora [Sun, 10 Feb 2019 21:38:46 +0000 (21:38 +0000)]
Properly remove stale Flymake diagnostics on :region reports
Among other bugs fixed, modifying a list structure while iterating it
is a no-no. This would again cause duplicate diagnostics. See
https://github.com/joaotavora/eglot/issues/223 for an example.
* lisp/progmodes/flymake.el (Version): Bump to 1.0.5
(flymake--handle-report): Use cl-loop.
Tassilo Horn [Fri, 8 Feb 2019 19:39:00 +0000 (20:39 +0100)]
Impl. json-pretty-print with replace-region-contents + minimization
* lisp/json.el (json-pretty-print): Use the new
replace-region-contents. Add prefix arg for minimzation.
(json-pretty-print-buffer): Add prefix arg for minimzation.
(json-pretty-print-buffer-ordered): Add prefix arg for minimzation.
(json-pretty-print-ordered): Add prefix arg for minimzation.
Tassilo Horn [Fri, 8 Feb 2019 19:36:00 +0000 (20:36 +0100)]
Add new function replace-buffer-contents
* src/editfns.c (Freplace_buffer_contents): Use lower value of
too_expensive and enable heuristic.
* lisp/subr.el (replace-region-contents): New convenient wrapper
function around replace-buffer-contents.
(package-generate-description-file): Make first line more informative.
(package-buffer-info): Include keywords, to more closely match
elpa.git's archive--metadata.
Glenn Morris [Fri, 8 Feb 2019 17:20:40 +0000 (09:20 -0800)]
Merge from origin/emacs-26
0cd7b52 (origin/emacs-26) Minor improvements to do strings in callproc.c b8c7017 Improve documentation of 'date-to-time' and 'parse-time-string' 46095a7 Fix downloading of URLs that end in a slash 3b60a0a * doc/misc/eww.texi (Basics): Fix eww keybindings. (Bug#34291) 8e22025 Fix process-thread docstring 459b669 Fix failures of vc-find-revision with non-ASCII file names e9ff190 * doc/lispref/tips.texi (Documentation Tips): Fix quotes. (B... 3e49a08 ; * src/coding.h (struct coding_system): Fix a typo in a comm... b657286 Add documentation for tabulated-list functions in the elisp m... 6e0f67b Fix URL in ucs-normalize.el ce3ae1f * etc/PROBLEMS: Amend entry for profiler bug #34235 to mentio...
Eli Zaretskii [Fri, 8 Feb 2019 08:33:13 +0000 (10:33 +0200)]
Improve documentation of 'date-to-time' and 'parse-time-string'
* doc/lispref/os.texi (Time Parsing): Document
'parse-time-string', and refer to it for the description of
the argument of 'date-to-time'.
* lisp/calendar/time-date.el (date-to-time): Refer in the doc
string to 'parse-time-string' for more information about the
format of the DATE argument. (Bug#34303)
Nick Drozd [Sat, 2 Feb 2019 18:35:02 +0000 (12:35 -0600)]
Download of URL in EWW falls back on current URL
* lisp/net/eww.el (eww-download): If there's no URL at point,
download the current URL instead. Previous behavior was to
signal an error if there was no URL at point. (Bug#34291)
* doc/misc/eww.texi (Basics): Update documentation.
Nick Drozd [Sat, 2 Feb 2019 18:50:03 +0000 (12:50 -0600)]
Fix downloading of URLs that end in a slash
* lisp/net/eww.el (eww-download-callback): Fix download URL
file name. Previously this wasn't handling download URLs
correctly, resulting in all downloaded pages being named
"!", "!(1)", etc. (Bug#34291)
Eli Zaretskii [Fri, 8 Feb 2019 06:59:23 +0000 (08:59 +0200)]
Fix failures of vc-find-revision with non-ASCII file names
* lisp/vc/vc.el (vc-find-revision): Instead of binding
coding-system-for-write, make the buffer-file-coding-system of
the temporary buffer be no-conversion. This avoids the
unwanted side effect of not encoding the command-line
arguments of the VCS commands invoked by the backend.
(Bug#34350)