Glenn Morris [Wed, 20 Feb 2019 06:04:19 +0000 (22:04 -0800)]
Remove .art from the default list of ImageMagick extensions
It seems that .art files can be non-image files that
ImageMagick mistakenly treats as extremely large images.
Real .art images seem rare.
* lisp/image.el (imagemagick-enabled-types): Remove ART. (Bug#22289)
* lisp/emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
Simplify a one-argument call to "or" and use buffer-narrowed-p instead
of checking that condition by hand.
João Távora [Mon, 18 Feb 2019 20:32:38 +0000 (20:32 +0000)]
switch-to-buffer's completion table uses its own sorting
* src/minibuf.c (Finternal_complete_buffer): Add
Qcycle_sort_function to completion table's metadata.
(syms_of_minibuf): New symbol Qcycle_sort_function.
* 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 09:51:25 +0000 (11:51 +0200)]
Fix handling of manpage references divided by hyphenation
* lisp/man.el (Man-reference-regexp): Accept a newline as part
of a manpage name only if it's preceded by a hyphen. (Bug#34286)
(Man-translate-references): Adapt to change in
'Man-reference-regexp'.
(Man-default-man-entry): Support references divided between
two lines by an ASCII hyphen. This is a left-over from fixing
bug#6289.
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.