Harald Jörg [Thu, 28 Jan 2021 03:22:21 +0000 (04:22 +0100)]
perl-mode.el: Eliminate keywords which are not in Perl.
* lisp/progmodes/perl-mode.el (perl-imenu-generic-expression):
Remove keywords which are not part of Perl.
(perl-font-lock-keywords-2): Remove keywords which are not part of
Perl (bug#46024). (These keywords are part of Raku; aka. Perl 6.)
Juri Linkov [Wed, 27 Jan 2021 18:08:43 +0000 (20:08 +0200)]
Support multi-line prompt and contents in previous-line-or-history-element.
* lisp/simple.el (previous-line-or-history-element): Move to the
beginning of minibuffer contents if there is editable minibuffer contents
on the same line after moving point to the prompt (bug#46033).
Fix minimal old-column from 0 to 1 to put point at the beginning of
minibuffer contents after going to the previous history element.
Stefan Monnier [Wed, 27 Jan 2021 17:25:52 +0000 (12:25 -0500)]
* lisp/international/titdic-cnv.el: Revert to utf-8 encoding
While it's true that using the iso-2022-jp encoding on the file does
allow Emacs to render the two strings differently, this only applies to
the source file. The .elc files all use `utf-8-emacs` encoding anyway,
so that info is lost. And the difference is even lost before we write
the .elc file because when Emacs byte-compiles that code the
byte-compiler considers those two strings as "equal" and emits only one
string in the byte-code (so the two branches return `eq` strings).
So, I think using `iso-2022-jp` is a bad idea here: it gives the
illusion that the the `charset` info exists, even it will be lost.
Eli discussed it with Handa-san a year ago, and they arrived at the
conclusion that the charset information is indeed no longer important.
Stefan Monnier [Wed, 27 Jan 2021 02:11:49 +0000 (21:11 -0500)]
Use lexical-binding in of all lisp/language
* lisp/international/titdic-cnv.el (pinyin-convert):
Enable lexical-binding in the generated file(s).
* lisp/language/ethio-util.el: Use lexical-binding.
(ethio-tex-to-fidel-buffer): Use `inhibit-read-only`. Remove unused
vars `p` and `ch`.
* lisp/language/hanja-util.el: Use lexical-binding.
* lisp/language/ind-util.el: Use lexical-binding.
(indian-translate-region): Actually use the `from` and `to` arguments.
(<toplevel>): Use `dlet`. Remove unused var `current-repertory`.
(indian-2-column-to-ucs-region): Remove unused var `pos`.
* lisp/language/japan-util.el: Use lexical-binding.
(japanese-katakana-region, japanese-hiragana-region)
(japanese-zenkaku-region): Remove unused var `next`.
* lisp/language/korea-util.el: Use lexical-binding.
* lisp/language/lao-util.el: Use lexical-binding.
(lao-composition-function): Remove unused var `glyph`.
* lisp/language/thai-util.el: Use lexical-binding.
(thai-composition-function): Remove unused var `glyph`.
* lisp/language/thai-word.el: Use lexical-binding.
(thai-forward-word): Remove unused var `tail`.
* lisp/language/tibet-util.el: Use lexical-binding.
(tibetan-add-components): Remove unused var `tmp`.
(tibetan-compose-region): Remove unused vars `str`, `result`, `chars`.
* lisp/language/viet-util.el:
* lisp/language/tv-util.el:
* lisp/language/cyril-util.el:
* lisp/language/china-util.el: Use lexical-binding.
Glenn Morris [Wed, 27 Jan 2021 15:55:11 +0000 (07:55 -0800)]
; Merge from origin/emacs-27
The following commits were skipped:
e79e377a4e (origin/emacs-27) Improve documentation of 'read-regexp' a... 0340e9eccb read-regexp-suggestions doc string improvement 932aba674c Try to improve the read-regexp doc string 809503431d ; xref-revert-buffer: Drop the (goto-char) at the end 0399cc2ab5 Erase the buffer only after fetching the new contents
Eli Zaretskii [Wed, 27 Jan 2021 15:52:51 +0000 (17:52 +0200)]
Fix display of stretches of whitespace in the display margins
* src/xdisp.c (produce_stretch_glyph): Truncate the stretch glyph
due to line wrap only when drawing in the text area.
* src/xterm.c (x_draw_stretch_glyph_string):
* src/w32term.c (w32_draw_stretch_glyph_string): Fix the
adjustment of the stretch X and width so that stretch glyphs could
be drawn in the left margin. Reported by Paul W. Rankin
<pwr@bydasein.com>.
Eli Zaretskii [Wed, 27 Jan 2021 15:15:46 +0000 (17:15 +0200)]
Improve documentation of 'read-regexp' and friends
* doc/emacs/glossary.texi (Glossary): Add "Tag" to the Glossary.
* doc/emacs/maintaining.texi (Xref): Mention that identifiers are
also known as "tags".
Eli Zaretskii [Wed, 27 Jan 2021 15:15:46 +0000 (17:15 +0200)]
Improve documentation of 'read-regexp' and friends
* doc/emacs/glossary.texi (Glossary): Add "Tag" to the Glossary.
* doc/emacs/maintaining.texi (Xref): Mention that identifiers are
also known as "tags".
* lisp/net/sieve-mode.el (sieve-mode-indent-function): New function.
(sieve-mode): Don't inherit from C mode, because the syntax
doesn't really resemble C mode that much (except being curly braced).
Stefan Monnier [Tue, 26 Jan 2021 23:17:00 +0000 (18:17 -0500)]
Use lexical-binding in all of `lisp/url`
* lisp/url/url-dav.el: Use lexical-binding.
(url-dav-process-DAV:prop): Remove unused var `handler-func`.
(url-dav-lock-resource): Remove unused var `child-url`.
(url-dav-active-locks): Remove unused var `properties`.
(url-dav-delete-directory): Remove unused var `props`.
(url-dav-file-name-completion): Remove unused var `result`.
* lisp/url/url-expand.el (url-expand-file-name): Use \s
Alexander Miller [Tue, 26 Jan 2021 09:36:52 +0000 (10:36 +0100)]
Add distinct controls for child frames' borders (Bug#45620)
The background of the 'child-frame-border' face instead of the
'internal-border' face now controls the color of child frames'
borders.
The 'child-frame-border-width' frame parameter is now used for the
width of child frames' borders instead of internal-border-width',
though we still fall back on using the latter if the former is not
set.
* doc/lispref/frames.texi (Frame Layout): Mention
'child-frame-border' and 'child-frame-border-width'.
(Layout Parameters): Mention 'child-frame-border-width'.
* etc/NEWS: Mention new face 'child-frame-border' and frame
parameter 'child-frame-border-width'.
* lisp/faces.el (child-frame-border): New face.
* src/dispextern.h (enum face_id): Add CHILD_FRAME_BORDER_FACE_ID.
* src/frame.c (Fframe_child_frame_border_width): New function.
(gui_report_frame_params): Add entry for Qchild_frame_border_width.
* src/frame.h (struct frame): New slot child_frame_border_width.
(FRAME_CHILD_FRAME_BORDER_WIDTH): New inlined function.
* src/nsfns.m (ns_set_child_frame_border_width): New function.
(Fx_create_frame): Handle Qchild_frame_border_width parameter.
(ns_frame_parm_handlers): Add ns_set_child_frame_border_width.
* src/nsterm.m (ns_clear_under_internal_border): Handle
CHILD_FRAME_BORDER_FACE_ID.
* src/w32fns.c (w32_clear_under_internal_border): Handle
CHILD_FRAME_BORDER_FACE_ID.
(w32_set_internal_border_width): New function.
(Fx_create_frame): Handle Qchild_frame_border_width parameter.
(w32_frame_parm_handlers): Add w32_set_child_frame_border_width.
* src/xfaces.c (lookup_basic_face, realize_basic_faces): Handle
CHILD_FRAME_BORDER_FACE_ID.
* src/xfns.c (x_set_child_frame_border_width): New function.
(Fx_create_frame): Handle Qchild_frame_border_width parameter.
(x_frame_parm_handlers): Add x_set_child_frame_border_width.
* src/xterm.c (x_clear_under_internal_border)
(x_after_update_window_line): Handle CHILD_FRAME_BORDER_FACE_ID.
* lisp/international/ja-dic-cnv.el: Use lexical-binding.
(skkdic-breakup-string): Remove unused var `kana-len`.
* lisp/international/latexenc.el: Use lexical-binding.
(tex-start-of-header): Declare.
* lisp/international/mule-diag.el: Use lexical-binding.
(list-character-sets): Remove unused var `pos`.
(list-character-sets-1): Remove unused vars `tail` and `charset`.
(list-charset-chars): Remove unused vars `chars` and `plane`.
(describe-coding-system): Remove unused var `extra-spec`.
(mule--print-opened): New var.
(print-fontset): Bind it.
(print-fontset-element): Use it instead of `print-opened`.
* lisp/international/quail.el: Use lexical-binding.
(quail-start-translation, quail-start-conversion):
Remove unused var `generated-events`.
(quail-help-insert-keymap-description): Use local dynbound var `the-keymap`.
* lisp/files.el (dir-locals-collect-variables): Compare directory
names after expanding. This makes a (subdirs . nil) in ~/ work as
expected (bug#17205).
* lisp/emacs-lisp/lisp-mode.el (lisp--el-match-keyword): Handle
special forms and macros the same way (bug#43265). This makes
things like (setq a '(if a b)) be fontified correctly (i.e., not
fontified as a keyword).
Rewrite lisp--el-funcall-position-p to be inverse of the -not function
* lisp/emacs-lisp/lisp-mode.el (lisp--el-funcall-position-p):
Rename and rewrite to return the inverse value. Non-inverted
predicate functions are easier to reason about.
(lisp--el-non-funcall-position-p): Make obsolete.
Michael Albinus [Sun, 24 Jan 2021 18:26:02 +0000 (19:26 +0100)]
Make Tramp's insert-directory more robust
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
Use `tramp-sh--quoting-style-options'.
* test/lisp/net/tramp-tests.el (tramp--test-hpux-p, tramp--test-ksh-p):
Remove superfluous nil.
(tramp--test-sh-no-ls--dired-p): New defun.
(tramp--test-special-characters): Use it.
Eric Abrahamsen [Sun, 24 Jan 2021 18:09:05 +0000 (10:09 -0800)]
Fix insertion logic of newly subscribed Gnus groups
* lisp/gnus/gnus-start.el (gnus-subscribe-newsgroup): This was a
misunderstanding of the next/previous argument: no group should ever
be inserted before "dummy.group".
(gnus-group-change-level): Make it clearer that PREVIOUS can be
nil. In fact none of this code would error on a nil value, but it
_looks_ like nil is unexpected.
Philipp Stephani [Sun, 24 Jan 2021 12:56:18 +0000 (13:56 +0100)]
Add more assertions to recently-added process test.
* test/src/process-tests.el (process-tests/multiple-threads-waiting):
Also check that 'thread-join' and 'thread-last-error' return the
expected errors.
For discussion, see the following thread:
https://lists.gnu.org/r/emacs-devel/2021-01/msg01111.html
* test/lisp/autorevert-tests.el
(auto-revert-test07-auto-revert-several-buffers):
* test/lisp/emacs-lisp/seq-tests.el (test-seq-do-indexed)
(test-seq-random-elt-take-all): Fix errors from using add-to-list on
lexical variables.
* test/lisp/emacs-lisp/cl-lib-tests.el
(cl-lib-defstruct-record): Expect test to succeed when byte-compiled
following change of 2021-01-23 'Fix missing file&line info in
"Unknown defun property" warnings'.
(cl-lib-tests--dummy-function): Remove; no longer needed.
(old-struct): Silence byte-compiler warning about unused lexical
variable.
* lisp/files.el (dir-locals-collect-variables): Don't
destructively modify the cached structure (bug#17205), because
that means that (subdirs . nil) doesn't work.
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.
Eli Zaretskii [Sat, 23 Jan 2021 09:28:32 +0000 (11:28 +0200)]
Fix last change
* doc/lispref/text.texi (Undo): Add a cross-reference to the
description of 'undo-amalgamate-change-group'.
(Atomic Changes): Expand and improve the description of
'undo-amalgamate-change-group'. (Bug#42303)
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.
Eli Zaretskii [Fri, 22 Jan 2021 07:57:19 +0000 (09:57 +0200)]
Improve documentation of sendmail.el defcustom's
* lisp/mail/sendmail.el (mail-archive-file-name)
(mail-default-reply-to, mail-self-blind, mail-default-headers):
Say in the doc string that 'message-default-mail-headers' shall be
customized when using 'message-mode' for email composition.
(Bug#46029)
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)