Nicholas Strauss [Wed, 22 Jan 2020 14:12:58 +0000 (15:12 +0100)]
Support solar and lunar eclipses in Calendar
* lisp/calendar/lunar.el (eclipse-check): New function to display
solar and lunar eclipses (bug#20414).
(lunar-phase): Use it.
(calendar-lunar-phases): Ditto.
Helmut Eller [Wed, 22 Jan 2020 13:18:17 +0000 (14:18 +0100)]
Default lisp-mode to use Common Lisp indentation
* lisp/emacs-lisp/lisp-mode.el (lisp-mode): Use
common-lisp-indent-function instead of lisp-indent-function as
Common Lisp is the most common non-Emacs Lisp today (bug#10097).
Glenn Morris [Mon, 20 Jan 2020 15:50:26 +0000 (07:50 -0800)]
Merge from origin/emacs-27
f3d30b5303 Remove some doc references to old Emacs versions 4217bc229b Fix infloop in shell.el 74b151195d Fix erc-notifications-notify for non-PRIVMSGs, broken in l... db4436eaf9 Fix the notification action for PRIVMSG in erc-notificatio... 36a4068105 ERC: New maintainer. 2391d3f45d ; spelling fixes e898442be3 Honor tags-case-fold-search during xref identifer completion
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
Go back to actually testing completion before semicolon.
(shell-tests-completion-after-semi): Test completion after semicolon,
correctly (bug#39075).
Paul Eggert [Mon, 20 Jan 2020 09:08:42 +0000 (01:08 -0800)]
Work better if stat etc. are interrupted
Quit or retry if fstat, lstat, stat or openat fail with EINTR.
This should fix some bugs on platforms where accessing files via
NFS can fail that way (Bug#9256).
* src/dired.c (file_attributes):
* src/fileio.c (file_directory_p) [O_PATH]:
Use emacs_openat instead of openat.
* src/dired.c (file_attributes): Use emacs_fstatat instead of fstatat.
* src/fileio.c (barf_or_query_if_file_exists, Frename_file):
* src/filelock.c (rename_lock_file):
Use emacs_fstatat instead of lstat.
* src/fileio.c (file_directory_p, Ffile_regular_p, Ffile_modes)
(Ffile_newer_than_file_p, Fverify_visited_file_modtime)
(Fset_visited_file_modtime, auto_save_1):
* src/lread.c (Fload):
* src/sysdep.c (get_current_dir_name_or_unreachable):
Use emacs_fstatat instead of stat.
* src/sysdep.c (emacs_fstatat, emacs_openat): New functions.
(emacs_open): Redo in terms of emacs_open.
Paul Eggert [Mon, 20 Jan 2020 07:40:45 +0000 (23:40 -0800)]
Fix drag and drop from some Qt versions
* lisp/x-dnd.el (x-dnd-handle-xdnd): Fix XdndDrop time stamp bug.
Problem and tiny change reported by Urs Fleisch (Bug#20804).
Copyright-paperwork-exempt: yes
Use the new `prefix-command-*` hooks and functions so it interacts
better with other prefix commands (and with itself), and so the
pre/post-command-hook and other command-loop operations are performed
"normally".
(mule-cmds--prefixed-command-next-coding-system)
(mule-cmds--prefixed-command-last-coding-system): New vars.
(mule-cmds--prefixed-command-pch, mule-cmds--prefixed-command-echo)
(mule-cmds--prefixed-command-preserve): New functions.
* test/lisp/net/tramp-tests.el (inhibit-message): Don't declare.
(tramp-message-show-message): Don't set.
(tramp-test06-directory-file-name): Use `non-essential'.
(tramp-test10-write-region): Use `inhibit-message'.
(tramp-test36-vc-registered): No special handling for old Emacsen.
(tramp--test-emacs25-p): Remove.
(tramp-test45-unload): Special case of `tramp-completion-mode'.
Tino Calancha [Sun, 19 Jan 2020 10:13:02 +0000 (11:13 +0100)]
Fix shell-command-dont-erase-buffer feature
* lisp/simple.el (shell-command-dont-erase-buffer):
The default, nil, is backward compatible, i.e. it erases the buffer
only if the output buffer is not the current one; the new value 'erase
always erases the output buffer.
Update docstring.
(shell-command-save-pos-or-erase):
Add optional arg output-to-current-buffer.
Rename it so that it's not internal. All callers updated.
(shell-command-set-point-after-cmd): Rename it so that it's not internal.
All callers updated.
Adjust it to cover a side case.
(shell-command): Adjust logic to match the specification (Bug#39067).
Enable the feature when the output buffer is the current one.
(shell-command-on-region): Little tweak to follow
`shell-command-dont-erase-buffer' specification.
Paul Eggert [Sun, 19 Jan 2020 04:54:29 +0000 (20:54 -0800)]
Remove Gnulib putenv code
It’s not needed, since Emacs always uses the system putenv and all
platforms have putenv. This improves on the fix for Bug#19874.
Suggested by Bruno Haible.
* admin/merge-gnulib (GNULIB_MODULES): Remove putenv.
* configure.ac: Remove workarounds for Gnulib putenv module.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/putenv.c, m4/putenv.m4: Remove.
Paul Eggert [Sun, 19 Jan 2020 04:34:55 +0000 (20:34 -0800)]
Update from Gnulib
This incorporates:
2020-01-18 Rename ~~gnulib.m4 to zzgnulib.m4
2020-01-18 Fix "m4_require: circular dependency of AC_LANG_COMPILER(C)"
2020-01-18 Ensure Automake does not drop ~~gnulib.m4
2020-01-18 Fix major regression from 2020-01-10
* m4/00gnulib.m4, m4/gnulib-common.m4: Copy from Gnulib.
* m4/gnulib-comp.m4: Regenerate.
* m4/zzgnulib.m4: New file, from Gnulib.
Add space before messsage in byte compiler warnings
According to the GNU coding standards (info "(standards) Errors"):
> If you want to mention the column number, use one of these formats:
> SOURCE-FILE-NAME:LINENO:COLUMN: MESSAGE
> SOURCE-FILE-NAME:LINENO.COLUMN: MESSAGE
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): Add space
before message in byte compiler warnings to comply with the GNU coding
standards. (Bug#18969)
Eric Abrahamsen [Sat, 18 Jan 2020 19:08:11 +0000 (11:08 -0800)]
Ensure that gnus-summary-attach-article finds the right articles
* lisp/gnus/gnus-msg.el (gnus-summary-attach-article): Before
iterating over the articles to attach, first close any open
article. Using `set-buffer' required `gnus-summary-select-article' to
re-set the buffer every time, meaning we never got off the original
article.
Paul Eggert [Sat, 18 Jan 2020 21:18:27 +0000 (13:18 -0800)]
Don’t assume sizeof (size_t) == 4 in allocators
This removes some old 32-bit assumptions in Emacs allocator tuning,
and improves performance of ‘make compile-always’ by about 7% on a
couple of 64-bit GNU/Linux platforms I tried it on. It should not
affect performance on 32-bit platforms.
* src/alloc.c (MALLOC_SIZE_NEAR): New macro.
(MALLOC_ALIGNMENT): New constant.
(INTERVAL_BLOCK_SIZE, SBLOCK_SIZE, STRING_BLOCK_SIZE): Use the new
macro. Make these enum constants since they need not be macros.
Eric Abrahamsen [Sat, 18 Jan 2020 19:08:11 +0000 (11:08 -0800)]
Ensure that gnus-summary-attach-article finds the right articles
* lisp/gnus/gnus-msg.el (gnus-summary-attach-article): Before
iterating over the articles to attach, first close any open
article. Using `set-buffer' required `gnus-summary-select-article' to
re-set the buffer every time, meaning we never got off the original
article.
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
Amend the shell.el tests to catch errors such as bug#39057.
* lisp/shell.el (shell--parse-pcomplete-arguments): Skip the
semi-colon as well. This avoids inflooping when a semi-colon is
typed by the user. (Bug#39057)
Paul Eggert [Sat, 18 Jan 2020 07:59:51 +0000 (23:59 -0800)]
Improve performance when a string's byte count changes
* src/alloc.c (allocate_string_data): Now static.
Remove code for when Faset calls this function when S
already has data assigned, as that can no longer happen.
(resize_string_data): New function, which avoids relocation in
more cases than the old code did, by not bothering to relocate
when the size changes falls within the alignment slop.
* src/data.c (Faset): Use resize_string_data.
Change a while to a do-while since it must iterate at least once.
Amin Bandali [Sat, 18 Jan 2020 04:38:04 +0000 (23:38 -0500)]
Fix erc-notifications-notify for non-PRIVMSGs, broken in last commit
* lisp/erc/erc-desktop-notifications.el (erc-notifications-notify):
Take optional argument `privp', to be non-nil when notifying for a
PRIVMSG. This is to work around bug introduced in last commit, as
`erc-get-buffer' may return nil for non-PRIVMSG cases.
(erc-notifications-PRIVMSG): Call erc-notifications-notify with
non-nil `privp', as described above.
Amin Bandali [Sat, 18 Jan 2020 03:33:03 +0000 (22:33 -0500)]
Fix the notification action for PRIVMSG in erc-notifications-notify
* lisp/erc/erc-desktop-notifications.el (erc-notifications-notify):
explicitly request the buffer for `nick', rather than relying on
(current-buffer) returning it. That works fine for the very first
PRIVMSG sent by `nick', but ERC seems to handle subsequent PRIVMSGs
differently, where (current-buffer) would return the server buffer
rather than the existing buffer for PRIVMSGs from `nick'.
Alan Mackenzie [Fri, 17 Jan 2020 21:53:13 +0000 (21:53 +0000)]
Introduce element &error into edebug specification lists for macros
This fixes bug #37540.
* lisp/emacs-lisp/edebug.el (top level): New entry for &error in alist used to
associate elements with their handling functions.
(edebug-match-&error): New function.
(nested-backquote-form): Use the new element &error to abort instrumentation
on encountering a three deep nesting of backquotes (without intervening
commas).
* doc/lispref/edebug.texi (Specification List): Add an entry for &error.
Dmitry Gutov [Fri, 17 Jan 2020 21:14:24 +0000 (00:14 +0300)]
Honor tags-case-fold-search during xref identifer completion
* etc/NEWS: New entry.
* lisp/progmodes/etags.el (tags-case-fold-search):
Mark as safe-local.
(find-tag--completion-ignore-case):
Extract from tags-completion-at-point-function, find-tag-tag and
etags--xref-find-definitions.
(xref-backend-identifier-completion-ignore-case):
New method. Use it here as well.
* lisp/progmodes/xref.el
(xref-backend-identifier-completion-ignore-case): New generic.
(xref--read-identifier): Use it here.
Damien Cassou [Fri, 27 Dec 2019 14:35:52 +0000 (15:35 +0100)]
Add unattended spell-checking to checkdoc
This commit makes checkdoc capable of spell-checking even when the
user isn't using it interactively. When TAKE-NOTES is non-nil,
checkdoc will run spell-checking (with ispell) and report spelling
mistakes.
Fixes: (bug#38583).
* lisp/textmodes/ispell.el (ispell-word): Extract part of it to
`ispell--run-on-word`.
(ispell--run-on-word): New function, extracted from `ispell-word`.
(ispell-error-checking-word): New function.
(ispell-correct-p): New function. Use `ispell--run-on-word` and
`ispell-error-checking-word`.
* lisp/emacs-lisp/checkdoc.el (checkdoc-current-buffer): Pass
TAKE-NOTES to `checkdoc-start`.
(checkdoc-continue): Pass TAKE-NOTES to `checkdoc-this-string-valid`.
(checkdoc-this-string-valid): Add optional argument TAKE-NOTES and
pass it to `checkdoc-this-string-valid-engine`.
(checkdoc-this-string-valid-engine): Add optional argument TAKE-NOTES
and pass it to `checkdoc-ispell-docstring-engine`.
(checkdoc-ispell-init): Call `ispell-set-spellchecker-params` and
`ispell-accept-buffer-local-defs`. These calls are required to
properly use ispell. The problem went unnoticed until now because
checkdoc was only using ispell through the high-level command
`ispell-word` which takes care of all the initialization for the user.
(checkdoc-ispell-docstring-engine): Add optional argument TAKE-NOTES
to force reporting of spell-checking errors. Throw error
when (checkdoc-ispell-init) fails configuring ispell. Replace a
few (if cond nil body) with (unless cond body). Replace (let ((var
nil))) with (let (var)). Replace (if (not (eq checkdoc-autofix-flag
'never)) body) with just body because `checkdoc-autofix-flag` is
checked at the beginning of the function.
Stefan Kangas [Fri, 17 Jan 2020 05:55:30 +0000 (06:55 +0100)]
Make sb-image.el obsolete (Bug#37837)
* lisp/sb-image.el: Move from here...
* lisp/obsolete/sb-image.el: ...to here.
* lisp/speedbar.el (ezimage): Require instead of 'sb-image'.
(speedbar-use-images, speedbar-expand-image-button-alist)
(speedbar-insert-image-button-maybe, speedbar-image-dump): Move
here from 'sb-image.el'.
Stefan Kangas [Thu, 16 Jan 2020 23:23:06 +0000 (00:23 +0100)]
Remove a FIXME from package.el
* lisp/emacs-lisp/package.el (package-unpack): Remove FIXME about
maybe deleting the package directory. It was decided that this was
undesirable. (Bug#7756)
Paul Eggert [Thu, 16 Jan 2020 18:49:29 +0000 (10:49 -0800)]
Fix hexl jumping to end of file
Plus some other small fixes nearby.
* lisp/hexl.el (hexl-end-of-line): Simplify to match next fix.
(hexl-end-of-1k-page, hexl-end-of-512b-page): Use min instead
of max. Tiny change by Vladimir Nikishkin (Bug#39131).
(hexl-insert-char): Use = instead of eq to compare integers.
Damien Cassou [Fri, 27 Dec 2019 14:35:52 +0000 (15:35 +0100)]
Add unattended spell-checking to checkdoc
This commit makes checkdoc capable of spell-checking even when the
user isn't using it interactively. When TAKE-NOTES is non-nil,
checkdoc will run spell-checking (with ispell) and report spelling
mistakes.
Fixes: (bug#38583).
* lisp/textmodes/ispell.el (ispell-word): Extract part of it to
`ispell--run-on-word`.
(ispell--run-on-word): New function, extracted from `ispell-word`.
(ispell-error-checking-word): New function.
(ispell-correct-p): New function. Use `ispell--run-on-word` and
`ispell-error-checking-word`.
* lisp/emacs-lisp/checkdoc.el (checkdoc-current-buffer): Pass
TAKE-NOTES to `checkdoc-start`.
(checkdoc-continue): Pass TAKE-NOTES to `checkdoc-this-string-valid`.
(checkdoc-this-string-valid): Add optional argument TAKE-NOTES and
pass it to `checkdoc-this-string-valid-engine`.
(checkdoc-this-string-valid-engine): Add optional argument TAKE-NOTES
and pass it to `checkdoc-ispell-docstring-engine`.
(checkdoc-ispell-init): Call `ispell-set-spellchecker-params` and
`ispell-accept-buffer-local-defs`. These calls are required to
properly use ispell. The problem went unnoticed until now because
checkdoc was only using ispell through the high-level command
`ispell-word` which takes care of all the initialization for the user.
(checkdoc-ispell-docstring-engine): Add optional argument TAKE-NOTES
to force reporting of spell-checking errors. Throw error
when (checkdoc-ispell-init) fails configuring ispell. Replace a
few (if cond nil body) with (unless cond body). Replace (let ((var
nil))) with (let (var)). Replace (if (not (eq checkdoc-autofix-flag
'never)) body) with just body because `checkdoc-autofix-flag` is
checked at the beginning of the function.
Robert Pluim [Wed, 15 Jan 2020 11:24:43 +0000 (12:24 +0100)]
Make emacs prefer an existing ~/.emacs.d to an existing XDG location
* doc/emacs/custom.texi (Find Init): Update description of how Emacs
finds its init file directory and the interaction with
$XDG_CONFIG_HOME
(Early Init File): Correct XDG location of early-init.el
* etc/NEWS: Update description to make it clear the ~/.emacs.d is
preferred, even if the XDG location exists.
* lisp/startup.el: Prefer ~/.emacs.d even if the XDG location exists.
* lib-src/emacsclient.c (open_config): Prefer home directory the XDG
location.
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.