Stefan Monnier [Sat, 23 Jan 2021 21:04:36 +0000 (16:04 -0500)]
Fix missing file&line info in "Unknown defun property" warnings
* lisp/emacs-lisp/byte-run.el (defmacro, defun): Use
`macroexp--warn-and-return` rather than `message`.
* lisp/emacs-lisp/macroexp.el: Fix `macroexp--compiling-p`.
(macroexp--warn-and-return): Don't try and detect repetition on forms
like `nil`.
(macroexp-macroexpand): Don't forget to bind `macroexpand-all-environment`.
* lisp/hl-line.el (hl-line-mode, global-hl-line-mode): Ensure
that 'maybe-unhighlight' is called after line is highlighted.
(Bug#45946)
(hl-line-unhighlight, global-hl-line-unhighlight): Set overlay
variable to nil after overlay is deleted.
Philipp Stephani [Sat, 23 Jan 2021 16:24:34 +0000 (17:24 +0100)]
Mark both ends of self-pipe a nonblocking.
While no deadlocks caused by the blocking write end have been reported
yet, marking both ends nonblocking is consistent and also recommended
in the GNU/Linux manpage of 'select'.
* src/process.c (child_signal_init): Mark write end of self-pipe as
nonblocking.
With `electric-indent-mode` enabled, `newline-and-indent` ends up indenting
3 times: once for the original line and twice on the new line.
`reindent-then-newline-and-indent` is even worse, indenting twice
both lines.
None of those commands should be affected by `electric-indent-mode`
since they even explicitly say in their name when and how they do
indentation.
(reindent-then-newline-and-indent): Temporarily disable
`electric-indent-mode` as well.
Paul Eggert [Fri, 22 Jan 2021 19:44:50 +0000 (11:44 -0800)]
Prepare for update from Gnulib
* configure.ac: Also create lib/malloc and lib/deps/malloc
if the dynarray module is in use, as Gnulib regex will
start needing it due to recent glibc changes.
Fix up previous mh-speed.el ignored variable change
* lisp/mh-e/mh-speed.el (mh-speed-toggle, mh-speed-view): Mark the
ignored parameter with _ instead of using the Common Lispish
(declare (ignore args)) (which Emacs Lisp doesn't really support),
except by accident.
Make nnml handle invalid non-ASCII headers more consistently
* lisp/gnus/nnml.el (nnml--encode-headers): New function to
RFC2047-encode invalid Subject/From headers (bug#45925). This
will make them be displayed more consistently in the Summary
buffer (but still "wrong" sometimes, since there's not that much
we can guess at at this stage, charset wise).
(nnml-parse-head): Use it.
Michael Albinus [Fri, 22 Jan 2021 16:39:52 +0000 (17:39 +0100)]
Use RemoteCommand option for Tramp's sshx and scpx methods
* doc/misc/tramp.texi (Inline methods) <sshx>:
(External methods) <scpx>: Adapt call sequence.
(Remote shell setup): Mention, that sshx and scpx overwrite
RemoteCommand.
(Remote processes): Restriction: direct asynchronous processes
cannot be used when RemoteCommand is in use.
`tramp-remote-process-environment' is not ignored any longer.
* lisp/net/tramp-sh.el (tramp-methods) <sshx, scpx>: Handle login
shell via RemoteCommand. Remove `tramp-direct-async' parameter.
(tramp-maybe-open-connection): Add "-i" to login.
* lisp/net/tramp-smb.el (tramp-smb-errors):
Add "NT_STATUS_NOT_SUPPORTED".
(tramp-smb-handle-insert-directory): Fix point moving error.
* test/lisp/net/tramp-tests.el (tramp-test34-explicit-shell-file-name):
Use `get-buffer-process' where appropriate.
Eli Zaretskii [Fri, 22 Jan 2021 12:16:51 +0000 (14:16 +0200)]
Fix last change for DOS_NT systems
* src/term.c (tty_draw_row_with_mouse_face)
(tty_write_glyphs_with_face): Don't define on MSDOS and WINDOWSNT,
as those have their own implementations of that.
João Távora [Sat, 16 Jan 2021 22:17:58 +0000 (14:17 -0800)]
Enable TTY mouse-face support when built without GPM support
* src/term.c (tty_write_glyphs_with_face): Move definition out of
ifdef block.
* src/xdisp.c (draw_row_with_mouse_face): Now called
unconditionally on all platforms.
Stefan Monnier [Thu, 21 Jan 2021 18:15:05 +0000 (13:15 -0500)]
Fix spurious "Lexical argument shadows the dynamic variable" due to inlining
Before this patch doing:
rm lisp/calendar/calendar.elc
make lisp/calendar/cal-hebrew.elc
would spew out lots of spurious such warnings about a `date` argument,
pointing to code which has no `date` argument in sight. This was
because that code had calls to inlinable functions (taking a `date`
argument) defined in `calendar.el`, and while `date` is a normal
lexical var at the site of those functions' definitions, it was
declared as dynbound at the call site.
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
Don't impose our local context onto the inlined function.
Don't have type-break-mode signal errors on corrupted files
* lisp/type-break.el (type-break-get-previous-time):
(type-break-get-previous-count): Signal a warning instead of an
error (bug#38246). type-break will still continue to work even if
the database can't be loaded after a restart, but this allows
Emacs to be started.
* lisp/gnus/message.el (message-forward-included-mime-headers):
Should probably not include Content-Transfer-Encoding, because we
will reencode anyway.
Make Message respect header removal instructions more
* doc/misc/message.texi (Forwarding): Document it.
* lisp/gnus/message.el (message-forward-ignored-headers): Improve
documentation.
(message-forward-included-headers): Ditto.
(message-forward-included-mime-headers): New user option.
(message-remove-ignored-headers): Use it to preserve the necessary
MIME headers.
(message-forward-make-body): Remove headers when forwarding as
MIME, too.
Eli Zaretskii [Thu, 21 Jan 2021 14:21:45 +0000 (16:21 +0200)]
A better fix for 'kill-visual-line'
* lisp/simple.el (kill-visual-line): Use the 6th element of the
return value of 'posn-at-point', which provides the coordinates in
terms or row and column, and is thus more reliable for deciding
whether we moved to the next screen line. (Bug#45837)
Stefan Monnier [Thu, 21 Jan 2021 04:45:18 +0000 (23:45 -0500)]
Use `lexical-binding` in all the cal-*.el files
* lisp/calendar/cal-bahai.el: Use lexical-binding.
(calendar-bahai-date-string): Use `calendar-dlet*`.
* lisp/calendar/cal-china.el: Use lexical-binding.
(calendar-chinese-zodiac-sign-on-or-after)
(calendar-chinese-new-moon-on-or-after): Declare `year`.
(calendar-chinese-from-absolute-for-diary)
(calendar-chinese-to-absolute-for-diary)
(calendar-chinese-mark-date-pattern): Avoid dynbound var `date` as
function argument.
* lisp/calendar/cal-coptic.el: Use lexical-binding.
(calendar-coptic-date-string): Use `calendar-dlet*`.
(calendar-ethiopic-to-absolute, calendar-ethiopic-from-absolute)
(calendar-ethiopic-date-string, calendar-ethiopic-goto-date):
Avoid dynbound var `date` as function argument.
* lisp/calendar/cal-french.el: Use lexical-binding.
* lisp/calendar/cal-hebrew.el: Use lexical-binding.
(holiday-hebrew-hanukkah): Don't use the third form in `dotimes`.
* lisp/calendar/cal-islam.el: Use lexical-binding.
(calendar-islamic-to-absolute): Comment out unused vars `month` and `day`.
* lisp/calendar/cal-move.el:
* lisp/calendar/cal-mayan.el:
* lisp/calendar/cal-iso.el: Use lexical-binding.
* lisp/calendar/cal-persia.el: Use lexical-binding.
(calendar-persian-date-string): Use `calendar-dlet*`.
* lisp/calendar/cal-html.el: Use lexical-binding.
(cal-html-insert-minical): Comment out unused var `date`.
(cal-html-cursor-month, cal-html-cursor-year): Mark `event` arg as unused.
* lisp/calendar/cal-menu.el: Use lexical-binding.
(diary-list-include-blanks): Declare var.
* lisp/calendar/cal-x.el: Use lexical-binding.
* lisp/calendar/cal-tex.el: Use lexical-binding.
(diary-list-include-blanks): Declare var.
(cal-tex-insert-days, cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-weekly-common, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-daily, cal-tex-daily-page): Declare `date`
as dynbound for the benefit of `cal-tex-daily-string`.
Stefan Monnier [Thu, 21 Jan 2021 04:08:25 +0000 (23:08 -0500)]
* lisp/calendar/cal-french.el (calendar-french-accents-p): Obsolete function
Always assume accented letters can be used
(calendar-french-month-name-array)
(calendar-french-special-days-array): Use the accented names.
(calendar-french-multibyte-month-name-array)
(calendar-french-multibyte-special-days-array): Make those vars
obsolete aliases.
(calendar-french-month-name-array, calendar-french-day-name-array)
(calendar-french-special-days-array): Mark functions as obsolete.
(calendar-french-date-string, calendar-french-goto-date): Always use
the text with accents.
Stefan Monnier [Thu, 21 Jan 2021 04:00:57 +0000 (23:00 -0500)]
* lisp/calendar/calendar.el (calendar-read-sexp): New function
(calendar-read): Mark as obsolete.
(calendar-read-date): Use it. Add `default-date` argument.
Provide defaults for the month and day (fixes bug#32105).
* lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-init): Always send
the Lisp words to the process (bug#6221). This allows an existing
ispell process to be correctly initialised.
and they allow the elimination of the test internal to `while` since
we can immediately know when we return `t` or `nil` what the result
of the test will be.
`cl-labels` tends to generate this kind of code when it applies the
tail-call optimization.
Stefan Monnier [Wed, 20 Jan 2021 18:59:58 +0000 (13:59 -0500)]
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Move some opts.
This moves two optimizations from the final pass to the main loop.
Both may enable further optimizations (and the second can be applied
repeatedly but "from the end", so the loop in the final pass only gets
to apply it once).
Fix footnote-mode problem when reopening an old file
* lisp/mail/footnote.el (footnote--regenerate-alist): New function
(bug#7258).
(footnote-mode): Use it to restore footnotes after opening an old
file with footnotes.
Make symbol-at-point return nil if there's no symbols in the buffer
* lisp/thingatpt.el (thing-at-point--beginning-of-symbol): Special
op that errors out when there's no symbols in the buffer before
point (bug#14234).
(symbol): Use it.
Make `symbol-at-point' work in buffers with no symbols
* lisp/thingatpt.el (thing-at-point--end-of-symbol): New function
(bug#14234).
(symbol): Use it instead of `forward-symbol', because the latter
will move to the end of the buffer even if there is no symbol
there. Instead error out like `forward-sexp' and friends.
Stefan Monnier [Tue, 19 Jan 2021 17:10:48 +0000 (12:10 -0500)]
* lisp/startup.el: Fix bug#45857, bug#30994, and bug#45913.
(command-line): Don't re-evaluate the `custom-delayed-init-variables`
a second time after reading the `early-init.el` file.
(x-apply-session-resources): Set `blink-cursor-mode` rather than
`no-blinking-cursor`.
* lisp/frame.el (blink-cursor-start): Turn `blink-cursor-mode` off
if `blink-cursor-mode` was set to nil.
(blink-cursor-mode): Default to it being enabled regardless of
`window-system`.
* lisp/custom.el (custom-initialize-delay): Fox docstring now that
autoload.el preserves the `:initialize` info.
* lisp/calc/calc-embed.el (calc-embedded-set-modes): Prevent
the-language and the-display-just from being lexically bound here,
because they may be assigned using 'set'.
Fix slow abbrev expansion in `message-mode' in some circumstances
* lisp/gnus/message.el (message--syntax-propertize): Use the
correct Message mode syntax table to avoid having
`message-cite-prefix-regexp' trigger very heavy backtracing when
called from an abbrev context (which defines "_" as a word
constituent) (bug#45944).
* lisp/gnus/nntp.el (nntp-send-authinfo): Don't signal an
`nntp-authinfo-rejected' error, because that will stop Gnus
startup (bug#45855). Instead signal an error that will be caught
higher up.
Drew Adams [Tue, 19 Jan 2021 12:11:18 +0000 (09:11 -0300)]
Tweaks to the color widget (Bug#45829)
* lisp/wid-edit.el (widget-color-match, widget-color-validate): New
functions.
(color): Use the new functions. Base size on longest defined color
name, defaulting to the longest RGB hex string.
* etc/NEWS: Document the new face (bug#45840).
* lisp/progmodes/perl-mode.el (perl-non-scalar-variable): Define new
face.
(perl-font-lock-keywords-2): Apply 'perl-non-scalar-variable' face.
Stephen Gildea [Mon, 18 Jan 2021 21:27:22 +0000 (13:27 -0800)]
time-stamp-tests now pass in more locales
Update time-stamp-tests to use format-time-string to generate the date
words (month, day of week, AM/PM) instead of hard-coding English. Now
the tests pass in locales other than "C" and US English.
Eric Abrahamsen [Wed, 18 Mar 2020 03:53:05 +0000 (20:53 -0700)]
Allow gnus-retrieve-headers to return headers directly
Previously, all Gnus backends returned header information by writing
nov lines into the nntp-server-buffer, which was later parsed. This
commit allows the backends to return their header information as a
list of already-parsed headers, though so far none of the backends
actually do that. The agent, cache, cloud etc. now operate on parsed
headers rather than nov text, ie. they use gnus-fetch-headers instead
of gnus-retrieve-headers.
* lisp/gnus/gnus-sum.el (gnus-fetch-headers): Handle the case in which
gnus-retrieve-headers returns headers directly.
* lisp/gnus/nnvirtual.el (nnvirtual-retrieve-headers): Use
gnus-fetch-headers rather than gnus-retrieve-headers to get headers,
meaning we're operating on already-parsed headers.
(nnvirtual-convert-headers): Remove now-unnecessary function.
(nnvirtual-update-xref-header): Rewrite to operate on parsed header.
* lisp/gnus/gnus-cloud.el (gnus-cloud-available-chunks): Use
gnus-fetch-headers instead of gnus-retrieve-headers.
* lisp/gnus/gnus-cache.el (gnus-cache-retrieve-headers): Use
gnus-fetch-headers.
(gnus-cache-braid-nov, gnus-cache-braid-heads): Delete unnecessary
functions -- we now do this work on a list of parsed headers.
* lisp/gnus/gnus-agent.el (gnus-agent-retrieve-headers): Use
gnus-fetch-headers.
(gnus-agent-braid-nov): Remove unnecessary function.
(gnus-agent-fetch-headers): Use gnus-fetch-headers.
* lisp/ibuffer.el (ibuffer--abbreviate-file-name): New function.
(filename): Use it.
* lisp/ibuf-ext.el (ibuffer-mark-by-file-name-regexp): Prefer
read-regexp over read-string for reading regexps. Determine file
name using ibuffer-buffer-file-name for consistency. Abbreviate
file name using ibuffer-directory-abbrev-alist (bug#18859).