Paul Eggert [Thu, 16 Jan 2020 01:36:59 +0000 (17:36 -0800)]
parse-time-string now parses ISO 8601 format strings
* lisp/calendar/parse-time.el (parse-time-string):
Parse strings in ISO 8601 format too (Bug#39001).
(parse-time--rfc-822ish): New internal function,
containing most of the old parse-time-string implementation.
(parse-iso8601-time-string): Simplify, now that
parse-time-string groks ISO 8601.
Stefan Monnier [Wed, 15 Jan 2020 21:50:50 +0000 (16:50 -0500)]
* admin/unidata/unidata-gen.el: Use lexical-binding
(unidata-prop): Use defstruct to define the 6 accessor functions.
(unidata-gen-table-character, unidata-gen-table, unidata-gen-table-name)
(unidata-check): Move common code out of `if`.
(unidata-word-list-diff, unidata-split-decomposition):
Move common code out of `if`; use `push`.
Juri Linkov [Wed, 15 Jan 2020 00:02:53 +0000 (02:02 +0200)]
* lisp/isearch.el: Fix corner cases of isearch-lazy-count.
* lisp/isearch.el (isearch-mode): Reset isearch-lazy-count-current
and isearch-lazy-count-total to nil, so when isearch-mode is started,
there should be no counts from previous Isearch.
(isearch-lazy-highlight-new-loop): Call isearch-message after resetting
lazy-count variables only when isearch-mode is started. This avoids
the problem of inappropriate calls of isearch-message-function
when query-replace in the minibuffer performs lazy-highlighting that
used to call minibuffer-history-isearch-message unnecessarily.
Michael Albinus [Tue, 14 Jan 2020 10:46:42 +0000 (11:46 +0100)]
Refactor Tramp async process code
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Update stderr buffer when process has finished. Do not call
`auto-revert'.
* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):
Tag it :unstable. Change `accept-process-output' arguments.
(tramp--test-async-shell-command): New defun.
(tramp--test-shell-command-to-string-asynchronously): Use it.
(tramp-test32-shell-command): Refactor code.
Paul Eggert [Tue, 14 Jan 2020 00:25:28 +0000 (16:25 -0800)]
Update from gnulib
This incorporates:
2020-01-10 fix major regression from 2020-01-04
2020-01-05 tests: avoid GCC over-optimization
2020-01-04 fix AC_CHECK_DECL so it deactivates clang's built-ins
2020-01-03 getopt-posix: fix compilation failure in testdirs
2020-01-03 doc: mention the 64-bit inode number problem
2020-01-02 wchar: make the HP-UX workaround work on HP-UX 11.31
* build-aux/config.guess, build-aux/config.sub, lib/inttypes.in.h:
* lib/stdlib.in.h, lib/unistd.in.h, m4/00gnulib.m4, m4/largefile.m4:
* m4/unistd_h.m4: Copy from Gnulib
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Paul Eggert [Tue, 14 Jan 2020 00:07:27 +0000 (16:07 -0800)]
Port configure.ac to future Gnulib
Rewrite an ancient Alpha ELF check to port to a future Gnulib
version that may require AC_CHECK_DECL to be set up properly as
per the ‘Expanded Before Required’ section of the Autoconf manual
Autoconf doesn’t guarantee that AC_CHECK_DECL will work properly
if called conditionally (e.g., inside a shell ‘case’ statement)
and the condition is false. Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-01/msg00088.html
* configure.ac (LD_SWITCH_MACHINE): Migrate ELF check later,
when AC_CHECK_DECL is properly set up.
Always use lexical-binding in lisp-interaction-mode (bug#38835)
* lisp/progmodes/elisp-mode.el (lisp-interaction-mode):
Set lexical-binding.
* lisp/startup.el (command-line, startup--get-buffer-create-scratch):
Don't set lexical-binding here.
* doc/lispref/variables.texi:
* etc/NEWS:
Make it clear that lisp-interaction-mode uses lexical-binding.
Amin Bandali [Mon, 18 Nov 2019 15:24:48 +0000 (10:24 -0500)]
Improve ERC's matching of nicks and URLs (bug#38257)
* lisp/erc/erc-{button,match}.el (erc-{button,match}-syntax-table):
Omit (, ), and '; as they're not valid nick characters, per RFC 2812
section 2.3.1. This enables correct matching/highlighting of nicks
when they're surrounded by parens, like (nick), and when adjacent to
an apostrophe, like nick's.
* lisp/erc/erc-button.el (erc-button-url-regexp): Use the regexp from
browse-url-button-regexp, which among other things, seems to handle
surrounding pair of parens better.
Glenn Morris [Sat, 11 Jan 2020 15:50:31 +0000 (07:50 -0800)]
Merge from origin/emacs-27
f0ebd919c1 (origin/emacs-27) ; * doc/lispref/anti.texi (Antinews): Fi... 6f059159ee Update Acknowledgments sections e1262d45f9 Update Antinews in ELisp manual fd8128f0c1 ; Move the description of define-inline to a different nod... 524441d6b3 Improve wording in the ELisp manual 8addfa91c8 Reset to the standard value when reverting session's custo... d6f9b09777 Fix saving multiple themes c556aabde8 Calc: fix interval entry (bug#39040) 91cd3c1372 Fix horizontal line display in Custom buffers 15c8e984ae ; * etc/NEWS: Fix a typo. ff8996a337 flymake: fix typo in variable binding (bug#38752) 16eaaa07e6 ; Minor spelling fixes 5efe795659 Update Antinews in the Emacs manual 5841240295 Use NSNumber instead of BOOL (bug#39047) beec9f64a5 Add comment on fido-mode's file-sorting semantics eb3c6ad325 Consider non-string minibuffer-default in icomplete
* lisp/calc/calc.el (calcDigit-start): Initialise calc-prev-char to
something more reasonable, so that non-algebraic entry of intervals
whose start is a single digit, like (1..10), works properly.
Reported by Michel Schinz.
Eli Zaretskii [Wed, 8 Jan 2020 18:53:00 +0000 (20:53 +0200)]
Fix build without threads
* src/systhread.c (sys_thread_create) [!THREADS_ENABLED]: Update
the function's signature to match prototype. Reported by Glenn
Morris <rgm@gnu.org>. (Bug#38632)
Glenn Morris [Wed, 8 Jan 2020 17:09:47 +0000 (09:09 -0800)]
Merge from origin/emacs-27
6cd9ccb0a2 (origin/emacs-27) Fix compression of directories in Dired 42329e6d3b ; * etc/NEWS: Review of the whole text. af5709f16b Further enhancement on `tramp-file-local-name' fb432446f5 Objective C Mode imenu: cease recognizing "functions" with... a18373a999 ; * etc/NEWS: Update the text about the XDG_CONFIG_HOME/em... 73fd8a4b53 Fix BSD and macOS builds w.r.t. pthread_setname_np (bug#38... f54b24304d Scale top-left coordinates in display-monitor-attributes-list b46c75b16c xref-matches-in-files: Big Tramp speed-up 883b3490d8 * lisp/net/tramp.el (tramp-file-local-name): Remove `save-... c01f55f126 Fix rendering bug due to unsynchronized cairo surface size... 075f21c0e3 Avoid crash by access to cleared img->pixmap->data/img->ma... 16c6dfb4f1 Avoid assertion violations in very small-height windows 9063124b91 Use pthread_setname_np to set thread name
Eli Zaretskii [Wed, 8 Jan 2020 16:21:53 +0000 (18:21 +0200)]
Fix compression of directories in Dired
This fixes comporession and uncompression of directories on
MS-Windows, but also on other systems. The original code used
":" as the REGEXP of the directory entry in
dired-compress-file-suffixes, which on Windows always matched any
absolute file name, and can also match unusual file names on Posix
hosts. This false match would cause dired-compress-file to act as
if we are decompressing a directory, but use a command suitable
for compression, which would fail in interesting ways.
We now use a REGEXP that can never match any valid file name.
* lisp/dired-aux.el (dired-compress-file-suffixes): Make the
"compress directory" entry's REGEXP really fail to match any valid
file name.
(dired-compress-file): Adapt to the change in
dired-compress-file-suffixes. (Bug#39024)
(dired-compress): If the current file is a directory, or if the
uncompressed file is a directory, don't remove the original from
the listing, since it is left in the filesystem.
Paul Eggert [Tue, 7 Jan 2020 19:23:11 +0000 (11:23 -0800)]
Fix sxhash-equal on bytecodes, markers, etc.
Problem reported by Pip Cet (Bug#38912#14).
* doc/lispref/objects.texi (Equality Predicates):
Document better when ‘equal’ looks inside objects.
* doc/lispref/windows.texi (Window Configurations):
Don’t say that ‘equal’ looks inside window configurations.
* etc/NEWS: Mention the change.
* src/fns.c (internal_equal):
Do not look inside window configurations.
(sxhash_obj): Hash markers, byte-code function objects,
char-tables, and font objects consistently with Fequal.
* src/window.c (compare_window_configurations):
Now static. Remove last argument. Caller changed.
* test/lisp/ffap-tests.el (ffap-other-window--bug-25352):
Use compare-window-configurations, not ‘equal’.
* test/src/fns-tests.el (test-sxhash-equal): New test.
Paul Eggert [Tue, 7 Jan 2020 19:23:11 +0000 (11:23 -0800)]
Help the compiler inline sxhash
* src/fns.c (sxhash_obj): Rename from sxhash and make
it static, so that the compiler can inline it better.
(sxhash): New function that does not take a depth arg.
All callers changed.
Alan Third [Tue, 7 Jan 2020 14:19:01 +0000 (14:19 +0000)]
Fix NS frame parameters (bug#39000)
* src/frame.c (make_frame): Use new system default setting.
* src/frame.h (enum ns_appearance_type): Add new system default
setting.
* src/nsfns.m (Fx_create_frame): Correctly handle Qunbound and support
system default appearance.
(syms_of_nsfns): Add Qlight.
* src/nsterm.h: New method definition.
* src/nsterm.m (ns_set_appearance): Correctly handle Qlight and use new
setAppearance method.
([EmacsView initFrameFromEmacs:]): Use new setAppearance method.
([EmacsWindow setAppearance]): New method.
* doc/lispref/frames.texi (Management Parameters): Document 'light'.
Eli Zaretskii [Mon, 6 Jan 2020 19:49:24 +0000 (21:49 +0200)]
Avoid assertion violations in very small-height windows
* src/xdisp.c (try_cursor_movement, redisplay_window)
(row_containing_pos): Skip tab-line glyph rows in addition to
header-line rows, when working on the top-most glyph row of a
window. This avoids assertion violations in set_cursor_from_row.
(Bug#38966)
Robert Pluim [Thu, 19 Dec 2019 16:33:16 +0000 (17:33 +0100)]
Use pthread_setname_np to set thread name
* configure.ac: Remove check for sys/prctl.h and prctl, check for
pthread_setname_np instead.
* systhread.c: Remove sys/prctl.h include.
(sys_thread_create) [HAVE_PTHREAD_SETNAME_NP]: Use pthread_setname_np
to set the name of the newly created thread (Bug#38632).
* thread.c (Fmake_thread): Use ENCODE_SYSTEM instead of
ENCODE_UTF_8 on the thread name.
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.4-pre".
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file, tramp-adb-handle-process-file):
Use `tramp-file-local-name'.
(tramp-adb-handle-exec-path): Expand `default-directory'.
* lisp/net/tramp-cmds.el (tramp-rename-files):
Use `tramp-file-local-name'.
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
(tramp-do-copy-or-rename-file-directly)
(tramp-sh-handle-process-file, tramp-set-remote-path)
(tramp-find-inline-encoding, tramp-get-remote-touch):
Use `tramp-file-local-name'.
(tramp-sh-handle-make-process): Support `stderr' as file name.
Delete temporary stderr file.
(tramp-sh-handle-exec-path): Expand `default-directory'.
* lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link)
(tramp-smb-handle-process-file): Use `tramp-file-local-name'.
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file)
(tramp-sudoedit-handle-set-file-uid-gid):
Use `tramp-unquote-file-local-name'.
(tramp-sudoedit-handle-make-symbolic-link):
Use `tramp-file-local-name'.
(tramp-sudoedit-handle-file-system-info): Fix a scoping error.
* lisp/net/tramp.el: Bump version to 2.4.4-pre.
(tramp-ignored-file-name-regexp, tramp-time-dont-know)
(tramp-time-doesnt-exist): Fix typo.
(tramp-file-local-name): Extend for non-remote file names.
(tramp-unquote-file-local-name): New defun.
(tramp-completion-make-tramp-file-name): Simplify.
(tramp-set-connection-local-variables-for-buffer)
(tramp-equal-remote, tramp-handle-make-auto-save-file-name):
Use `tramp-tramp-file-p'.
(tramp-handle-file-name-case-insensitive-p)
(tramp-handle-file-truename, tramp-get-remote-tmpdir)
(tramp-make-tramp-temp-file): Use `tramp-file-local-name'.
(tramp-handle-shell-command, tramp-handle-start-file-process):
Implement asynchronous `error-buffer'.
Mark 'catch' and 'condition-case' bytecodes as obsolete
They have not been generated by the byte-compiler since Emacs 25.
* lisp/emacs-lisp/bytecomp.el (byte-catch, byte-condition-case):
* src/bytecode.c (BYTE_CODES, exec_byte_code):
Mark as obsolete (since Emacs 25; they were still generated in 24.4).
Paul Eggert [Sun, 5 Jan 2020 20:29:05 +0000 (12:29 -0800)]
Go back to iso-2022-7bit for titdic-cnv.el again
* admin/notes/unicode: Mention this.
* lisp/international/titdic-cnv.el:
Go back to iso-2022-7bit for this file, since utf-8-emacs unified
characters that tsanq-quick-converter did not want unified.
Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2020-01/msg00156.html
Paul Eggert [Sun, 5 Jan 2020 19:48:59 +0000 (11:48 -0800)]
Move “Fix some broken conditional forms” to master
Revert 2020-01-04T19:17:12Z!eggert@cs.ucla.edu
which recently I installed into the emacs-27 branch by mistake.
These patches are now on master instead (via merging).
Do not merge to master.
Paul Eggert [Sun, 5 Jan 2020 19:44:48 +0000 (11:44 -0800)]
Merge from origin/emacs-27
448df8fec7 Improve doc-strings of 'quit-window' and 'quit-restore-win... 7f01dfca56 Fix MH-E bug #470: Show buffer discards text properties f95a2b8301 Fix some broken conditional forms 28727444f1 Fix a scoping error in tramp-sudoedit.el 6cbdd048bd * lisp/autorevert.el (auto-revert-notify-handler): Fix bra... 076dd1f69a Fix typo in 'window_box_height'
Also print function data when printing module functions.
This is especially useful in cases where modules only use a single
entry point and use the data to dispatch to the actual function. Such
a design is common for languages such as Go and C++.
* src/emacs-module.c (module_function_data): New function.
* src/print.c (print_vectorlike): Use it to print module function data
if not NULL.
(print_object): Adapt size of buffer.
* test/data/emacs-module/mod-test.c (emacs_module_init): Pass some
non-NULL data to ‘mod-test-sum’.
(Fmod_test_sum): Check that correct data is passed through.
* test/src/emacs-module-tests.el (mod-test-sum-test)
(module-function-object): Adapt unit tests.
Martin Rudalics [Sun, 5 Jan 2020 08:59:01 +0000 (09:59 +0100)]
Improve doc-strings of 'quit-window' and 'quit-restore-window' (Bug#38819)
* lisp/window.el (quit-restore-window, quit-window): Make
doc-strings more consistent; add references to corresponding
section of the Elisp manual (Bug#38819).
Paul Eggert [Sun, 5 Jan 2020 03:07:02 +0000 (19:07 -0800)]
Simplify x-dnd.el due to bignums
* lisp/x-dnd.el (x-dnd-get-drop-x-y, x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags, x-dnd-get-motif-value)
(x-dnd-motif-value-to-list): Do not worry about pairs of
16-bit numbers, as the C code no longer generates them;
it generates bignums now, when needed on 32-bit platforms.
Stephen Gildea [Sat, 4 Jan 2020 23:28:07 +0000 (15:28 -0800)]
Fix MH-E bug #470: Show buffer discards text properties
* lisp/mh-e/mh-show.el (mh-display-msg): reset font lock and set
major mode *before* formatting message content. This changes lets
fonts work when the Show buffer is reused for a new message.
(mh-show-mode): no longer set buffer-read-only; that is better done
by mh-display-msg after setting all content.
Paul Eggert [Sat, 4 Jan 2020 21:33:44 +0000 (13:33 -0800)]
Fix bug in recent allocate_string_data patch
Reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2020-01/msg00098.html
* src/alloc.c (allocate_string_data): If the string is small and
there is not enough room in the current block, clear the string if
CLEARIT.
Paul Eggert [Sat, 4 Jan 2020 19:17:12 +0000 (11:17 -0800)]
Fix some broken conditional forms
Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2020-01/msg00088.html
* lisp/cedet/ede/cpp-root.el (ede-create-lots-of-projects-under-dir):
Remove this quick hack, which didn’t do anything anyway.
* lisp/cedet/ede/pconf.el (ede-proj-configure-test-required-file):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-col):
* lisp/net/nsm.el (nsm-check-tls-connection):
Use ‘when’ rather than bypassing it. This doesn’t affect behavior
and is better style.
* lisp/cedet/srecode/semantic.el (srecode-semantic-handle-:tag):
Fix typo that suppressed an error.
* lisp/filesets.el (filesets-run-cmd): Fix typo that mishandled spacing.
* lisp/gnus/gnus-cloud.el (gnus-cloud-update-newsrc-data):
Fix typo that caused “GROUP has older different info in the cloud
as of DATE, update it here?” prompt result to always be treated as
“yes”.
* lisp/gnus/mml-smime.el (mml-smime-openssl-encrypt): Simplify,
since smime-encrypt-buffer signals error on failure.
* lisp/international/titdic-cnv.el (tsang-quick-converter): Simplify.
The conversion of this file to utf-8-emacs in
2019-01-08T02:18:40Z!monnier@iro.umontreal.ca removed the
distinction between Big5 and CNS fulltitles in the generated docstring.
* lisp/org/org-agenda.el (org-agenda-show-and-scroll-up):
* lisp/textmodes/table.el (table--generate-source-cell-contents):
Simplify by removing useless code.
* lisp/org/ox-odt.el (org-odt--format-timestamp): Fix typo that
always output time-of-day even when the timestamp lacked it.
* test/src/emacs-module-tests.el (module/function-finalizer): Create
100 leaked functions to increase the probability that at least one
gets garbage-collected.
* src/emacs-module.h.in: Remove 'noexcept' from function pointer type
aliases. It is illegal there in C++11, see
https://en.cppreference.com/w/cpp/language/noexcept_spec.
Paul Eggert [Sat, 4 Jan 2020 01:14:00 +0000 (17:14 -0800)]
Let the OS clear new large strings of NUL
On my platform, this sped up (make-string 4000000000 0) from 2.5
to 0.015 seconds (not that people should want to do this much :-).
* src/alloc.c (allocate_string_data): New arg CLEARIT.
Callers changed.
(Fmake_string): Prefer calloc to malloc+memset when allocating a
large string of NUL bytes.
(make_clear_string): New function.
(make_uninit_string): Use it.
(make_clear_multibyte_string): New function.
(make_uninit_multibyte_string): Use it.