Commit graph

135324 commits

Author SHA1 Message Date
Glenn Morris
a29c70d29b Merge from origin/emacs-26
3f4b8e9 * src/data.c (Fmake_local_variable): Fix bug#34318
b384996 Minor fixes in ELisp manual wrt syntax-table properties
71fc6d2 * admin/notes/emba: New file.
3aaa2d2 Fix Hunspell invocation for discovering its dictionaries

# Conflicts:
#	test/src/data-tests.el
2019-02-15 13:25:30 -08:00
Stefan Monnier
877eba7249 * lisp/progmodes/compile.el: Remove redundant :groups
(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.
2019-02-15 10:29:02 -05:00
Eli Zaretskii
00b8c7ef96 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.
2019-02-15 15:45:23 +02:00
Eli Zaretskii
4d00262a8e Support ~USER for some names on MS-Windows
* src/w32.c (getpwnam): Support usernames provided through
LOGNAME or USERNAME environment variables, to mimic what
editfns.c:init_editfns does.
2019-02-15 12:22:49 +02:00
Alex Branham
c3f87efe3a Add basic conf-mode tests
* test/lisp/textmodes/conf-mode-tests.el: New file with tests for
conf-mode.  Mostly taken from conf-mode docstrings.  (Bug#34419)
2019-02-15 10:40:13 +02:00
Alex Branham
cef2489379 Use lexical binding for conf-mode
* lisp/textmodes/conf-mode.el: Use lexical binding.
(conf-align-assignments, conf-quote-normal, conf-mode-initialize):
Doc fix.  (Bug#34419)
2019-02-15 10:38:11 +02:00
Eli Zaretskii
b439b4393c Add documentation for last change in eww.el
* doc/misc/eww.texi (Basics): Document the prefix arg effect
on "M-x eww".  (Bug#34374)

* etc/NEWS: Mention the change in behavior of 'eww'.
2019-02-15 10:33:01 +02:00
İ. Göktuğ Kayaalp
3fa003a134 * lisp/net/eww.el (eww): With prefix arg, open url in new buffer.
Bug#34374
2019-02-15 10:24:14 +02:00
João Távora
0d19e08da6 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))))))

(let ((flex-score-match-tightness 100)) (test))
=> (("foo" . 1.0)
    ("foot" . 0.375)
    ("foto" . 0.375)
    ("foobarbaz" . 0.16260162601626016) ;; one hole
    ("barbazfoo" . 0.16260162601626016) ;; one hole
    ("barfoobaz" . 0.10964912280701755) ;; two holes
    ("fabrobazo" . 0.10964912280701755) ;; two holes
    ("fotttttttttttttttttttttttto" . 0.04982561036372696))

(let ((flex-score-match-tightness 0.1)) (test))
=> (("foo" . 1.0)
    ("foot" . 0.375)
    ("foto" . 0.375)
    ("barfoobaz" . 0.007751937984496124) ;; two holes
    ("fabrobazo" . 0.007751937984496124) ;; two holes
    ("foobarbaz" . 0.00641025641025641)  ;; one hole
    ("barbazfoo" . 0.00641025641025641)  ;; one hole
    ("fotttttttttttttttttttttttto" . 0.0004789272030651341))

* lisp/minibuffer.el (flex-score-falloff): Rename to
flex-score-match-tightness.
(completion-pcm--hilit-commonality): Update function.
2019-02-14 23:33:49 +00:00
Mattias Engdegård
a4c7de35de Add categories L, R, SPC and . to `rx' doc string
* lisp/emacs-lisp/rx.el (rx): Add new categories to doc string.
2019-02-14 16:09:55 +01:00
Mattias Engdegård
e205092081 Use lexical-binding in rx.el
* lisp/emacs-lisp/rx.el: Use lexical-binding.
(rx-form): Use `let' to bind the dynamic variable `rx-parent' instead
of binding it as an argument.
2019-02-14 15:28:58 +01:00
João Távora
959ba6ea79 * lisp/minibuffer.el (completion-styles-alist): Tweak flex's docstring 2019-02-14 13:46:40 +00:00
Michael Albinus
ef718cbe9e Adapt tramp-adb-handle-set-file-times
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
Use 'touch -d', 'touch -t' does not seem to work.  Use Universal Time.
2019-02-14 12:36:18 +01:00
João Távora
fabfb54d1f ; * etc/NEWS (New 'flex' completion style): New entry 2019-02-14 10:36:40 +00:00
Dmitry Gutov
33dbe23bb8 Rename project-query-replace to project-query-replace-regexp
* lisp/progmodes/project.el (project-query-replace): Rename to
project-query-replace-regexp.
2019-02-14 04:09:09 +03:00
Gregor Zattler
a48099ce7f
* 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.
2019-02-13 15:50:49 -08:00
Paul Eggert
9a7519ce8f 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
2019-02-13 15:03:30 -08:00
João Távora
b0e318d27f 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.
2019-02-13 21:23:03 +00:00
João Távora
e4896fcb11 Add a new 'flex' completion style
* lisp/minibuffer.el (completion-styles-alist): Add flex.
(completion-substring--all-completions): Accept
transform-pattern-fn arg.
(completion-flex-all-completions, completion-flex-try-completion)
(completion-flex--make-flex-pattern): New functions.
2019-02-13 21:21:51 +00:00
Eli Zaretskii
10527fca66 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.
2019-02-13 17:39:31 +02:00
Paul Eggert
ae4bfd52de Don’t assume CURRENT_TIME_LIST
* lisp/progmodes/cc-cmds.el (c-progress-init)
(c-progress-update):
* lisp/progmodes/cperl-mode.el (cperl-time-fontification):
* lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info)
(vhdl-fix-case-region-1):
Don’t assume (current-time) returns a list.
Fix unlikely bug if we’re called 65536 seconds apart.
2019-02-13 00:51:15 -08:00
Paul Eggert
8e0d35802c Don’t assume CURRENT_TIME_LIST
* lisp/url/url-util.el (url-lazy-message):
Don’t assume (current-time) returns a list.
Fix unlikely bug if we’re called 65536 seconds apart.
2019-02-13 00:23:58 -08:00
Paul Eggert
7ee12d95fb Simplify nnspool-request-newgroups arithmetic
* lisp/gnus/nnspool.el (nnspool-request-newgroups):
Simplify by compute time stamps as integers, not floats,
since integers don’t overflow any more.
2019-02-12 18:25:22 -08:00
Jackson Ray Hamilton
21eef9fa7f 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.

Co-authored-by: Felipe Ochoa <felipe@fov.space>
2019-02-13 03:23:50 +03:00
Jackson Ray Hamilton
dd319f2711 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.
2019-02-13 03:20:18 +03:00
Paul Eggert
e05ea0ea31 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.
2019-02-12 15:21:11 -08:00
Stefan Monnier
3f4b8e9a29 * src/data.c (Fmake_local_variable): Fix bug#34318
Revert part of ed962f2b8a.

* test/src/data-tests.el (data-tests-make-local-forwarded-var):
Add corresponding test.
2019-02-12 16:33:23 -05:00
Glenn Morris
5abaf16ab4 * admin/notes/hydra: Small updates. 2019-02-12 13:57:34 -05:00
Eli Zaretskii
b384996e86 Minor fixes in ELisp manual wrt syntax-table properties
* doc/lispref/syntax.texi (Syntax Properties): Fix reference
to syntax-table properties.  (Bug#34455)
(Control Parsing): Remove redundant @vindex entry.
2019-02-12 19:32:55 +02:00
Michael Albinus
71fc6d204b * admin/notes/emba: New file. 2019-02-12 12:58:15 +01:00
Mattias Engdegård
d41f9123ec Add missing categories L, R, . and SPC to rx
* lisp/emacs-lisp/rx.el (rx-categories):
Add missing categories L, R, . and SPC.  (Bug#34436)
2019-02-11 21:50:56 +01:00
Eli Zaretskii
3aaa2d2058 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)
2019-02-11 18:07:35 +02:00
Paul Eggert
2860f6cec5 Simplify url-digest-auth-make-cnonce
* lisp/url/url-auth.el (url-digest-auth-make-cnonce):
Simplify by using encode-time instead of round-tripping
through a format-time-string and ‘read’.
2019-02-11 00:08:41 -08:00
Paul Eggert
9324124253 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.
2019-02-10 23:54:35 -08:00
Paul Eggert
988e37fa0f Simplify use of encode-time
Most uses of (apply #'encode-time foo) can now be replaced
with (encode-time foo).  Make similar simplifications.
* lisp/calendar/time-date.el (date-to-time):
* lisp/calendar/timeclock.el (timeclock-when-to-leave)
(timeclock-day-base, timeclock-generate-report):
* lisp/emacs-lisp/timer.el (timer-set-idle-time):
* lisp/eshell/esh-util.el (eshell-parse-ange-ls):
* lisp/gnus/gnus-art.el (article-make-date-line):
* lisp/gnus/gnus-delay.el (gnus-delay-article)
(gnus-delay-send-queue):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event--decode-datefield):
* lisp/gnus/gnus-logic.el (gnus-advanced-date):
* lisp/gnus/message.el (message-make-expires-date):
* lisp/gnus/nndiary.el (nndiary-compute-reminders):
* lisp/mail/ietf-drums.el (ietf-drums-parse-date):
* lisp/net/tramp-adb.el (tramp-adb-ls-output-time-less-p):
* lisp/org/org-agenda.el (org-agenda-get-timestamps)
(org-agenda-get-progress, org-agenda-show-clocking-issues):
* lisp/org/org-capture.el (org-capture-set-target-location):
* lisp/org/org-clock.el (org-clock-get-sum-start, org-clock-sum)
(org-clocktable-steps):
* lisp/org/org-colview.el (org-colview-construct-allowed-dates)
* lisp/org/org-macro.el (org-macro--vc-modified-time):
* lisp/org/org-table.el (org-table-eval-formula):
* lisp/org/org.el (org-current-time, org-store-link)
(org-time-today, org-read-date, org-read-date-display)
(org-display-custom-time, org-time-string-to-time)
(org-timestamp-change, org-timestamp--to-internal-time):
* lisp/url/url-dav.el (url-dav-process-date-property):
* lisp/vc/vc-cvs.el (vc-cvs-annotate-current-time)
(vc-cvs-parse-entry):
Simplify use of encode-time.
* lisp/org/org-clock.el (org-clock-get-clocked-time):
(org-clock-resolve, org-resolve-clocks, org_clock_out)
(org-clock-update-time-maybe):
Avoid some rounding problems with encode-time and float-time.
* lisp/org/org-clock.el (org-clock-in, org-clock-update-time-maybe):
* lisp/org/org-colview.el (org-columns--age-to-minutes):
* lisp/org/org.el (org-get-scheduled-time, org-get-deadline-time)
(org-add-planning-info, org-2ft, org-time-string-to-absolute)
(org-closest-date):
Use org-time-string-to-time instead of doing it by hand with
encode-time.
* lisp/org/org.el (org-current-time): Simplify rounding.
(org-read-date): Avoid extra trip through encode-time.
2019-02-10 23:54:35 -08:00
Paul Eggert
3eb63da195 Fix doc string treatment of integer overflow
* lisp/calendar/cal-dst.el (calendar-dst-find-startend):
Fix doc string.
2019-02-10 23:54:34 -08:00
Paul Eggert
57c74793c4 Prefer encode-time to its alias
* lisp/calendar/icalendar.el, lisp/calendar/timeclock.el:
* lisp/emacs-lisp/timer.el, lisp/gnus/gnus-delay.el:
* lisp/gnus/gnus-sum.el, lisp/gnus/nndiary.el:
* lisp/gnus/nnrss.el, lisp/net/newst-backend.el:
* lisp/net/rcirc.el, lisp/obsolete/xesam.el:
* lisp/org/org-agenda.el, lisp/org/org-clock.el:
* lisp/org/org-element.el, lisp/org/org-timer.el:
* lisp/org/org.el, lisp/progmodes/flymake.el:
* lisp/url/url-cache.el, lisp/url/url-cookie.el:
Use encode-time instead of its alias seconds-to-time.
2019-02-10 23:54:34 -08:00
Stefan Monnier
54b9ee77ad * 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.
2019-02-10 18:12:05 -05:00
Mattias Engdegård
c8c6ad2429 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.
2019-02-10 23:36:42 +01:00
João Távora
459869a528 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.
2019-02-10 21:38:46 +00:00
Eli Zaretskii
24695e8977 Unbreak the Cygw32 build
* src/emacs.c (main) [HAVE_NTGUI]: Remove code that is only
for WINDOWSNT or condition it on WINDOWSNT.  (Bug#34409)
2019-02-10 17:10:04 +02:00
João Távora
b78363eb0f Cleanup stale diagnostics on Flymake restart
Not doing so would cause duplicate diagnostics.  See
https://github.com/joaotavora/eglot/issues/223 for an example.

* lisp/progmodes/flymake.el (Version): 1.0.4
(flymake-mode): Cleanup overlays before starting Flymake.
2019-02-10 12:06:24 +00:00
Paul Eggert
f8e9da8bb6 * lisp/ecomplete.el (ecomplete-add-item): Simplify. 2019-02-09 19:29:02 -08:00
Paul Eggert
57646401f1 Don’t assume CURRENT_TIME_LIST
* lisp/gnus/gnus-delay.el (gnus-delay-send-queue):
* lisp/gnus/nnmail.el (nnmail-activate):
* lisp/mh-e/mh-alias.el (mh-alias-tstamp):
* lisp/net/newst-backend.el (newsticker--cache-item-compare-by-time):
Use time-less-p instead of assuming timestamp format.
2019-02-09 19:23:53 -08:00
Alex Branham
1e155dcc8d
Fix byte compile warnings in checkdoc.el
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Fix
  byte compile warnings by requiring lisp-mnt top-level, remove XEmacs
  compatibility code.

Bug#34290
2019-02-08 16:26:29 -06:00
Tassilo Horn
b3092b2873 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.
2019-02-08 20:39:00 +01:00
Tassilo Horn
61748cd78f 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.
2019-02-08 20:36:00 +01:00
Stefan Monnier
ac1e5a5e2e * lisp/emacs-lisp/package.el: Improve generated foo-pkg.el
(package-generate-description-file): Make first line more informative.
(package-buffer-info): Include keywords, to more closely match
elpa.git's archive--metadata.
2019-02-08 14:16:31 -05:00
Glenn Morris
0f9940505f 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...

# Conflicts:
#	doc/lispref/os.texi
2019-02-08 09:20:40 -08:00
Glenn Morris
4f138318d3 ; Merge from origin/emacs-26
The following commit was skipped:

b51ac45 * make-dist: Remove references to src/stamp-h.in.
2019-02-08 09:18:08 -08:00