]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoImprove documentation of 'read-regexp' and friends
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/replace.el (read-regexp, read-regexp-suggestions): Improve
wording of doc strings.  (Bug#46088)  (Bug#46089)

3 years ago* lisp/subr.el (empty-history): Move defvar to functions where it's used.
Juri Linkov [Wed, 27 Jan 2021 09:42:30 +0000 (11:42 +0200)]
* lisp/subr.el (empty-history): Move defvar to functions where it's used.

3 years agoSupport variable name for previous-window in display-buffer-in-previous-window
Juri Linkov [Mon, 25 Jan 2021 20:10:15 +0000 (22:10 +0200)]
Support variable name for previous-window in display-buffer-in-previous-window

* lisp/window.el (display-buffer-in-previous-window): Support the value of
'previous-window' entry as a symbol for variable name (bug#45688).

3 years agoFix indentation in sieve-mode
Lars Ingebrigtsen [Wed, 27 Jan 2021 06:04:08 +0000 (07:04 +0100)]
Fix indentation in sieve-mode

* 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).

3 years agoFix setting of line/point style in calc gnuplot
Lars Ingebrigtsen [Wed, 27 Jan 2021 03:27:42 +0000 (04:27 +0100)]
Fix setting of line/point style in calc gnuplot

* lisp/calc/calc-graph.el (calc-graph-set-styles): Modern gnuplot
requires "ls" before the line style and "ps" before the point
style (bug#46070).

3 years agoread-regexp-suggestions doc string improvement
Lars Ingebrigtsen [Wed, 27 Jan 2021 02:47:02 +0000 (03:47 +0100)]
read-regexp-suggestions doc string improvement

* lisp/replace.el (read-regexp-suggestions): Add a link to the
manual to explain what a tag is (bug#46089).

3 years agoTry to improve the read-regexp doc string
Lars Ingebrigtsen [Wed, 27 Jan 2021 02:38:49 +0000 (03:38 +0100)]
Try to improve the read-regexp doc string

* lisp/replace.el (read-regexp): Attempt to clarify the semantics
(bug#46088).

3 years agoUse lexical-binding in all of `lisp/url`
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

* lisp/url/url-file.el (url-file): Improve regexp.

* lisp/url/url-gw.el: Use lexical-binding.
(url-open-stream): Remove unused var `cur-retries`, `retry`, `errobj`.

* lisp/url/url-imap.el: Use lexical-binding.
(imap-username, imap-password): Declare.

* lisp/url/url-mailto.el: Use lexical-binding.
(url-mailto): Remove unused var `func`.  Use `push`.

* lisp/url/url-news.el: Use lexical-binding.
(url-news): Remove unused var `article-brackets`.

* lisp/url/url-cid.el:
* lisp/url/url-cache.el:
* lisp/url/url-about.el:
* lisp/url/url-tramp.el:
* lisp/url/url-proxy.el:
* lisp/url/url-privacy.el:
* lisp/url/url-nfs.el:
* lisp/url/url-ldap.el:
* lisp/url/url-misc.el:
* lisp/url/url-methods.el: Use lexical-binding.

3 years ago* lisp/progmodes/sh-script.el (sh-smie-sh-rules): Tweak indent of new `for`
Stefan Monnier [Tue, 26 Jan 2021 22:57:26 +0000 (17:57 -0500)]
* lisp/progmodes/sh-script.el (sh-smie-sh-rules): Tweak indent of new `for`

The new `for (TEST) { BODY }` syntax introduces various challenges.
This patch just fixes a trivial subcase.

3 years agoRevert "Allow gnus-retrieve-headers to return headers directly"
Eric Abrahamsen [Tue, 26 Jan 2021 16:47:07 +0000 (08:47 -0800)]
Revert "Allow gnus-retrieve-headers to return headers directly"

This reverts commit 20add1cd22f9775a4475148b300cf2a4de4bd54a. This
needs more work before it's ready to merge.

3 years agoFix typos and punctuation
Eli Zaretskii [Tue, 26 Jan 2021 16:24:53 +0000 (18:24 +0200)]
Fix typos and punctuation

* src/w32fns.c:
* src/frame.h:
* doc/lispref/frames.texi (Frame Layout):
* etc/NEWS: Fix typos and punctuation in recent changes.

3 years agoFix typo in last change of FRAME_INTERNAL_BORDER_WIDTH
Martin Rudalics [Tue, 26 Jan 2021 09:59:59 +0000 (10:59 +0100)]
Fix typo in last change of FRAME_INTERNAL_BORDER_WIDTH

* src/frame.h (FRAME_INTERNAL_BORDER_WIDTH): Fix typo in last
change.

3 years agoAdd distinct controls for child frames' borders (Bug#45620)
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.

3 years agoUse `lexical-binding` in all `lisp/international` files
Stefan Monnier [Tue, 26 Jan 2021 03:58:19 +0000 (22:58 -0500)]
Use `lexical-binding` in all `lisp/international` files

* lisp/startup.el (keyboard-type): Make obsolete and lex-bound.

* admin/unidata/unidata-gen.el (unidata-gen-file)
(unidata-gen-charprop): Mark the generated files to use lexical binding.

* lisp/international/isearch-x.el: Use lexical-binding.
(junk-hist): Declare locally.

* lisp/international/iso-cvt.el:
* lisp/international/utf-7.el:
* lisp/international/robin.el:
* lisp/international/ogonek.el:
* lisp/international/latin1-disp.el:
* lisp/international/kkc.el:
* lisp/international/kinsoku.el:
* lisp/international/ja-dic-utl.el: Use lexical-binding.

* 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`.

3 years agoMake subdirs . nil in dir-locals in ~/ work
Lars Ingebrigtsen [Tue, 26 Jan 2021 00:12:45 +0000 (01:12 +0100)]
Make subdirs . nil in dir-locals in ~/ work

* lisp/files.el (dir-locals-collect-variables): Compare directory
names after expanding.  This makes a (subdirs . nil) in ~/ work as
expected (bug#17205).

Test case:

((nil . ((a .  "hallo")
         (subdirs . nil))))

in ~/

3 years agoDon't move point to the prompt in previous-line-or-history-element (bug#46033)
Juri Linkov [Mon, 25 Jan 2021 17:14:22 +0000 (19:14 +0200)]
Don't move point to the prompt in previous-line-or-history-element (bug#46033)

* lisp/simple.el (previous-line-or-history-element):
Avoid moving point to the prompt.

3 years agoFontify special forms and macros the same
Lars Ingebrigtsen [Mon, 25 Jan 2021 06:44:29 +0000 (07:44 +0100)]
Fontify special forms and macros the same

* 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).

3 years agoRewrite lisp--el-funcall-position-p to be inverse of the -not function
Lars Ingebrigtsen [Sun, 24 Jan 2021 22:25:52 +0000 (23:25 +0100)]
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.

3 years agoFix macro fontification in `condition-case' handler bodies
Lars Ingebrigtsen [Sun, 24 Jan 2021 20:43:25 +0000 (21:43 +0100)]
Fix macro fontification in `condition-case' handler bodies

* lisp/emacs-lisp/lisp-mode.el (lisp--el-non-funcall-position-p):
Fontify macros in the BODY of HANDLERS in `condition-case'
correctly (bug#43265).

3 years agoTweak `condition-case' keyword highlights
Lars Ingebrigtsen [Sun, 24 Jan 2021 20:31:09 +0000 (21:31 +0100)]
Tweak `condition-case' keyword highlights

* lisp/emacs-lisp/lisp-mode.el (lisp--el-non-funcall-position-p):
Tweak `condition-case' position check to skip the VAR form.

3 years agoAdd some elisp-mode font lock tests
Lars Ingebrigtsen [Sun, 24 Jan 2021 19:53:36 +0000 (20:53 +0100)]
Add some elisp-mode font lock tests

3 years agoMake Tramp's insert-directory more robust
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.

3 years agoFix insertion logic of newly subscribed Gnus groups
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.

3 years agoAdd more assertions to recently-added process test.
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.

3 years agoFix recently uncovered 'make check' failures
Basil L. Contovounesios [Sat, 23 Jan 2021 23:31:13 +0000 (23:31 +0000)]
Fix recently uncovered 'make check' failures

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.

3 years agoAdd support for dired compressing .lz/.lzo files
Jean Louis [Sat, 23 Jan 2021 23:34:44 +0000 (00:34 +0100)]
Add support for dired compressing .lz/.lzo files

* lisp/dired-aux.el (dired-compress-files-alist): Add support for
.lz/.lzo files (bug#44901).

3 years agoProperly initialize gnus-search-namazu-index-directory
Eric Abrahamsen [Sat, 23 Jan 2021 22:24:09 +0000 (14:24 -0800)]
Properly initialize gnus-search-namazu-index-directory

* lisp/gnus/gnus-search.el (gnus-search-namazu): We were missing the
appropriate :initform on this slot definition (Bug#46047).

3 years agoMake (subdirs . nil) in .dir-locals.el work
Lars Ingebrigtsen [Sat, 23 Jan 2021 22:12:05 +0000 (23:12 +0100)]
Make (subdirs . nil) in .dir-locals.el work

* 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.

3 years agoFix missing file&line info in "Unknown defun property" warnings
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`.

3 years agoProvide a (thing-at-point 'url) in eww buffers
Lars Ingebrigtsen [Sat, 23 Jan 2021 19:39:45 +0000 (20:39 +0100)]
Provide a (thing-at-point 'url) in eww buffers

* lisp/net/eww.el (eww-mode): Allow (thing-at-point 'url) to work
in eww buffers.
(eww--url-at-point): New function.

3 years agoAdd a mechanism for buffer-local thing-at-points
Lars Ingebrigtsen [Sat, 23 Jan 2021 19:38:54 +0000 (20:38 +0100)]
Add a mechanism for buffer-local thing-at-points

* doc/lispref/text.texi (Buffer Contents): Document it.

* lisp/thingatpt.el (thing-at-point-provider-alist): New variable.
(thing-at-point): Use it.

3 years agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sat, 23 Jan 2021 19:35:44 +0000 (11:35 -0800)]
Update from Gnulib by running admin/merge-gnulib

3 years agoUse single post-command-hook on hl-line modes
Gabriel do Nascimento Ribeiro [Sat, 23 Jan 2021 18:38:42 +0000 (15:38 -0300)]
Use single post-command-hook on hl-line modes

* 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.

3 years ago; * src/process.c (child_signal_read): Remove FIXME comment.
Eli Zaretskii [Sat, 23 Jan 2021 19:04:13 +0000 (21:04 +0200)]
; * src/process.c (child_signal_read): Remove FIXME comment.

3 years agoAdd a unit test testing interaction between threads and processes.
Philipp Stephani [Sat, 23 Jan 2021 18:10:22 +0000 (19:10 +0100)]
Add a unit test testing interaction between threads and processes.

This unit test tests that we can call 'accept-process-output' in
parallel from multiple threads.

* test/src/process-tests.el (process-tests/multiple-threads-waiting):
New unit test.

3 years agoAvoid a few compilation warnings in Objective-C code.
Philipp Stephani [Sat, 23 Jan 2021 18:08:52 +0000 (19:08 +0100)]
Avoid a few compilation warnings in Objective-C code.

* src/nsfns.m (Fns_frame_restack): Remove unused variable 'flag'.

* src/nsmenu.m (ns_update_menubar): Remove unused variable 'pool'.

* src/nsterm.m (focus_view, hide_bell): Define conditionally.
(ns_update_end): Define variable 'view' conditionally.
(ns_redraw_scroll_bars): Don't define unused function.
(copyRect): Don't perform arithmetic on 'void' pointers.
(nswindow_orderedIndex_sort): Make static.

3 years ago* .clang-format: Fix base style.
Philipp Stephani [Sat, 23 Jan 2021 18:04:53 +0000 (19:04 +0100)]
* .clang-format: Fix base style.

3 years agoAdd a FIXME comment to improve the SIGCHLD race condition handling.
Philipp Stephani [Sat, 23 Jan 2021 17:39:20 +0000 (18:39 +0100)]
Add a FIXME comment to improve the SIGCHLD race condition handling.

* src/process.c: Add FIXME comment describing how we could avoid the
self-pipe on modern Unix-like systems.

3 years agoMark both ends of self-pipe a nonblocking.
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.

3 years agoFix failed autorevert test on emba
Michael Albinus [Sat, 23 Jan 2021 15:59:07 +0000 (16:59 +0100)]
Fix failed autorevert test on emba

* test/lisp/autorevert-tests.el (auto-revert-test05-global-notify):
Check, whether buffer is alive.

3 years ago* test/infra/gitlab-ci.yml (.job-template): Check also for test/lib-src/*.el.
Michael Albinus [Sat, 23 Jan 2021 11:13:03 +0000 (12:13 +0100)]
* test/infra/gitlab-ci.yml (.job-template): Check also for test/lib-src/*.el.

3 years agoClean up the recently added self-pipe mechanism for WINDOWSNT
Eli Zaretskii [Sat, 23 Jan 2021 10:51:57 +0000 (12:51 +0200)]
Clean up the recently added self-pipe mechanism for WINDOWSNT

* src/process.c (child_signal_init, child_signal_read)
(child_signal_notify): #ifdef away on WINDOWSNT.

3 years ago; xref-revert-buffer: Drop the (goto-char) at the end
Dmitry Gutov [Sat, 23 Jan 2021 00:58:53 +0000 (02:58 +0200)]
; xref-revert-buffer: Drop the (goto-char) at the end

3 years agoErase the buffer only after fetching the new contents
Dmitry Gutov [Sat, 23 Jan 2021 00:53:12 +0000 (02:53 +0200)]
Erase the buffer only after fetching the new contents

* lisp/progmodes/xref.el (xref-revert-buffer):
Erase the buffer only after fetching the new contents (bug#46042).

3 years ago* lisp/simple.el (newline-and-indent): Disable `electric-indent-mode`
Stefan Monnier [Fri, 22 Jan 2021 21:56:57 +0000 (16:56 -0500)]
* lisp/simple.el (newline-and-indent): Disable `electric-indent-mode`

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.

3 years agoMention undo-amalgamate-change-group in the lispref manual
Lars Ingebrigtsen [Fri, 22 Jan 2021 20:07:35 +0000 (21:07 +0100)]
Mention undo-amalgamate-change-group in the lispref manual

* doc/lispref/text.texi (Atomic Changes): Mention
undo-amalgamate-change-group (bug#42303).

3 years agoWork around __has_attribute bug in clang 3.4
Paul Eggert [Fri, 22 Jan 2021 19:47:22 +0000 (11:47 -0800)]
Work around __has_attribute bug in clang 3.4

* src/conf_post.h (HAS_ATTRIBUTE):
* src/emacs-module.h.in (EMACS_ATTRIBUTE_NONNULL):
Port to clang 3.4 and earlier.

3 years agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Fri, 22 Jan 2021 19:45:38 +0000 (11:45 -0800)]
Update from Gnulib by running admin/merge-gnulib

3 years agoPrepare for update from Gnulib
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.

3 years agoFix up previous mh-speed.el ignored variable change
Lars Ingebrigtsen [Fri, 22 Jan 2021 18:22:07 +0000 (19:22 +0100)]
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.

3 years agoAdd more isearch-related bindings to ns-win.el
Keith David Bershatsky [Fri, 22 Jan 2021 18:18:41 +0000 (19:18 +0100)]
Add more isearch-related bindings to ns-win.el

* lisp/term/ns-win.el (minibuffer-local-isearch-map): Add more
bindings to mirror bindings in isearch.el (bug#15667).

3 years agoMake nnml handle invalid non-ASCII headers more consistently
Lars Ingebrigtsen [Fri, 22 Jan 2021 18:07:52 +0000 (19:07 +0100)]
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.

3 years agoUse RemoteCommand option for Tramp's sshx and scpx methods
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.

3 years agoCalc: use big brackets around function arguments
Mattias Engdegård [Fri, 22 Jan 2021 14:47:48 +0000 (15:47 +0100)]
Calc: use big brackets around function arguments

* lisp/calc/calccomp.el (math-compose-expr): Use big brackets around
arguments in Big mode, so that expressions like sin(a/b) look a bit
better.

3 years agoFix last change for DOS_NT systems
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.

3 years agoEnable TTY mouse-face support when built without GPM support
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.

3 years ago* lisp/textmodes/remember.el (remember-text-format-function): Fix type.
Glenn Morris [Fri, 22 Jan 2021 08:52:12 +0000 (08:52 +0000)]
* lisp/textmodes/remember.el (remember-text-format-function): Fix type.

3 years ago* test/infra/gitlab-ci.yml: Copy newer files to image to build less often.
Ted Zlatanov [Thu, 21 Jan 2021 19:34:03 +0000 (19:34 +0000)]
* test/infra/gitlab-ci.yml: Copy newer files to image to build less often.

3 years agoFix spurious "Lexical argument shadows the dynamic variable" due to inlining
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.

* test/lisp/emacs-lisp/bytecomp-tests.el: Add matching test.

3 years ago* lisp/net/webjump.el: Add Maintainer: emacs-devel.
Stefan Kangas [Thu, 21 Jan 2021 17:52:48 +0000 (18:52 +0100)]
* lisp/net/webjump.el: Add Maintainer: emacs-devel.

Ref: https://lists.gnu.org/r/emacs-devel/2021-01/msg01019.html

3 years agoDon't have type-break-mode signal errors on corrupted files
Lars Ingebrigtsen [Thu, 21 Jan 2021 17:10:16 +0000 (18:10 +0100)]
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.

3 years agoFix message.el build warning from previous change
Lars Ingebrigtsen [Thu, 21 Jan 2021 16:10:02 +0000 (17:10 +0100)]
Fix message.el build warning from previous change

* lisp/gnus/message.el (subr-x): Fix build warning from previous
commit.

3 years ago* test/infra/gitlab-ci.yml: Revert to always building.
Ted Zlatanov [Thu, 21 Jan 2021 16:02:28 +0000 (16:02 +0000)]
* test/infra/gitlab-ci.yml: Revert to always building.

3 years agoAdd dired support for compressing .pax files
Lars Ingebrigtsen [Thu, 21 Jan 2021 16:08:28 +0000 (17:08 +0100)]
Add dired support for compressing .pax files

* lisp/dired-aux.el (dired-compress-files-alist): Add support for
compressing .pax files (bug#40135).

3 years agoTweak previous message-forward-included-mime-headers change
Lars Ingebrigtsen [Thu, 21 Jan 2021 15:48:01 +0000 (16:48 +0100)]
Tweak previous message-forward-included-mime-headers change

* lisp/gnus/message.el (message-forward-included-mime-headers):
Should probably not include Content-Transfer-Encoding, because we
will reencode anyway.

3 years agoMake Message respect header removal instructions more
Lars Ingebrigtsen [Thu, 21 Jan 2021 15:44:53 +0000 (16:44 +0100)]
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.

3 years agoA better fix for 'kill-visual-line'
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)

3 years agoFix thinko in previous footnote.el change
Lars Ingebrigtsen [Thu, 21 Jan 2021 11:45:24 +0000 (12:45 +0100)]
Fix thinko in previous footnote.el change

* lisp/mail/footnote.el (footnote--regenerate-alist): Don't error
out when there's no footnotes.

3 years agoUse `lexical-binding` in all the cal-*.el files
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`.

3 years agoUse `calendar-read-sexp` instead of the now obsolete `calendar-read`
Stefan Monnier [Thu, 21 Jan 2021 04:14:25 +0000 (23:14 -0500)]
Use `calendar-read-sexp` instead of the now obsolete `calendar-read`

* lisp/calendar/diary-lib.el (diary-insert-cyclic-entry):
* lisp/calendar/cal-persia.el (calendar-persian-read-date):
* lisp/calendar/cal-move.el (calendar-goto-day-of-year):
* lisp/calendar/cal-mayan.el (calendar-mayan-read-haab-date)
(calendar-mayan-read-tzolkin-date):
* lisp/calendar/cal-julian.el (calendar-julian-goto-date)
(calendar-astro-goto-day-number):
* lisp/calendar/cal-iso.el (calendar-iso-read-date):
* lisp/calendar/cal-islam.el (calendar-islamic-read-date):
* lisp/calendar/cal-hebrew.el (calendar-hebrew-read-date)
(calendar-hebrew-list-yahrzeits):
* lisp/calendar/cal-french.el (calendar-french-goto-date):
* lisp/calendar/cal-coptic.el (calendar-coptic-read-date):
* lisp/calendar/cal-china.el (calendar-chinese-goto-date):
* lisp/calendar/cal-bahai.el (calendar-bahai-read-date):
* lisp/calendar/holidays.el (list-holidays): Use `calendar-read-sexp`.

3 years ago* lisp/calendar/cal-french.el (calendar-french-accents-p): Obsolete function
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.

3 years ago* lisp/calendar/calendar.el (calendar-read-sexp): New function
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).

3 years ago* lisp/emacs-lisp/bytecomp.el (byte-compile--declare-var): Fix warning
Stefan Monnier [Thu, 21 Jan 2021 01:17:11 +0000 (20:17 -0500)]
* lisp/emacs-lisp/bytecomp.el (byte-compile--declare-var): Fix warning

Make sure the "declared after first use" is under the control of
the `lexical` option.

3 years agoFix recent remember-diary-extract-entries change
Lars Ingebrigtsen [Wed, 20 Jan 2021 22:30:53 +0000 (23:30 +0100)]
Fix recent remember-diary-extract-entries change

* lisp/textmodes/remember.el (remember-diary-extract-entries): Use
`remember-diary-file' over `diary-file'.

3 years agocheckdoc-spellcheck-documentation-flag doc string improvement
Lars Ingebrigtsen [Wed, 20 Jan 2021 21:15:38 +0000 (22:15 +0100)]
checkdoc-spellcheck-documentation-flag doc string improvement

* lisp/emacs-lisp/checkdoc.el
(checkdoc-spellcheck-documentation-flag): Mention
`ispell-kill-ispell' (bug#6221).

3 years agoRevert "Always send Lisp words to checkdoc-ispell-init"
Lars Ingebrigtsen [Wed, 20 Jan 2021 21:11:38 +0000 (22:11 +0100)]
Revert "Always send Lisp words to checkdoc-ispell-init"

This reverts commit 93141d581330d94e7eec9f114def2bec15f87866.

This would make checkdoc words be used in other flyspell
buffers.

3 years agoAlways send Lisp words to checkdoc-ispell-init
Lars Ingebrigtsen [Wed, 20 Jan 2021 20:46:30 +0000 (21:46 +0100)]
Always send Lisp words to checkdoc-ispell-init

* 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.

3 years agoMove the ‘declare’ form before the interactive spec in 10 functions.
Juri Linkov [Wed, 20 Jan 2021 19:19:23 +0000 (21:19 +0200)]
Move the ‘declare’ form before the interactive spec in 10 functions.

* lisp/emacs-lisp/package.el (package-menu-hide-package):
* lisp/font-lock.el (font-lock-debug-fontify):
* lisp/image.el (image-jpeg-p):
* lisp/mail/flow-fill.el (fill-flowed-test):
* lisp/mh-e/mh-speed.el (mh-speed-toggle, mh-speed-view):
* lisp/progmodes/project.el (project-async-shell-command)
(project-shell-command, project-compile):
* lisp/progmodes/sh-script.el (sh-assignment):
Fix special forms to follow in this order: docstring, declare, interactive.

3 years ago* lisp/emacs-lisp/subr-x.el (named-let): New macro
Stefan Monnier [Wed, 20 Jan 2021 19:12:50 +0000 (14:12 -0500)]
* lisp/emacs-lisp/subr-x.el (named-let): New macro

3 years ago* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Add 2 new opts
Stefan Monnier [Wed, 20 Jan 2021 19:08:35 +0000 (14:08 -0500)]
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Add 2 new opts

This introduces two new optimizations.  They're designed for code like

    (while
        (let (...)
          (if ... (progn blabla t) (progn blabla nil)))
      ...)

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.

3 years ago* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Move some opts.
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).

3 years ago* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Re-indent
Stefan Monnier [Wed, 20 Jan 2021 18:54:11 +0000 (13:54 -0500)]
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Re-indent

3 years agoFix footnote-mode problem when reopening an old file
Lars Ingebrigtsen [Wed, 20 Jan 2021 18:42:21 +0000 (19:42 +0100)]
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.

3 years agocua-toggle-global-mark doc string clarification
Lars Ingebrigtsen [Wed, 20 Jan 2021 17:52:17 +0000 (18:52 +0100)]
cua-toggle-global-mark doc string clarification

* lisp/emulation/cua-gmrk.el (cua-toggle-global-mark): Clarify
that also inserted characters are affected (bug#8083).

3 years agoFix environment handling in tramp-handle-make-process
Michael Albinus [Wed, 20 Jan 2021 17:51:52 +0000 (18:51 +0100)]
Fix environment handling in tramp-handle-make-process

* lisp/net/tramp.el (tramp-test-message): Add `tramp-suppress-trace' property.
(tramp-handle-make-process): Handle also 'tramp-remote-process-environment'.

3 years agoRespect remember-save-after-remembering on remember-diary-extract-entries
Gabriel do Nascimento Ribeiro [Wed, 20 Jan 2021 16:54:43 +0000 (17:54 +0100)]
Respect remember-save-after-remembering on remember-diary-extract-entries

* lisp/textmodes/remember.el (remember-diary-extract-entries):
Save automatically if `remember-save-after-remembering' is non-nil
(bug#45811).

3 years agoAdd option remember-text-format-function
Gabriel do Nascimento Ribeiro [Wed, 20 Jan 2021 16:53:04 +0000 (17:53 +0100)]
Add option remember-text-format-function

* lisp/textmodes/remember.el (remember-text-format-function): New
variable (bug#45809).
(remember-append-to-file): Use it.

3 years agoAdd option remember-diary-regexp
Gabriel do Nascimento Ribeiro [Wed, 20 Jan 2021 16:45:08 +0000 (17:45 +0100)]
Add option remember-diary-regexp

* lisp/textmodes/remember.el (remember-diary-extract-entries): Use
it (bug#45808).
(remember-diary-regexp): New variable.

3 years agoTweak tty-find-type to allow TERM=screen.xterm
Lars Ingebrigtsen [Wed, 20 Jan 2021 16:25:40 +0000 (17:25 +0100)]
Tweak tty-find-type to allow TERM=screen.xterm

* lisp/faces.el (tty-find-type): Allow TERM=screen.xterm to find
term/screen.el (bug#45824).

3 years agoMake symbol-at-point return nil if there's no symbols in the buffer
Lars Ingebrigtsen [Wed, 20 Jan 2021 15:58:09 +0000 (16:58 +0100)]
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.

3 years agoAdd tests for symbol-at-point (bug#14234)
Lars Ingebrigtsen [Wed, 20 Jan 2021 15:47:39 +0000 (16:47 +0100)]
Add tests for symbol-at-point (bug#14234)

3 years agoDon't let `maybe_quit` prevent resetting `consing_until_gc` (bug#43389)
Stefan Monnier [Wed, 20 Jan 2021 14:52:07 +0000 (09:52 -0500)]
Don't let `maybe_quit` prevent resetting `consing_until_gc` (bug#43389)

* src/alloc.c (garbage_collect): Postpone `unblock_input` a bit.
* src/window.c (window_parameter): Avoid `maybe_quit`.

3 years agoSort Ibuffer filename/process column as displayed
Fabrice Bauzac [Mon, 18 Jan 2021 22:02:21 +0000 (23:02 +0100)]
Sort Ibuffer filename/process column as displayed

* lisp/ibuf-ext.el (ibuffer-do-sort-by-filename/process): Use the
same function for sorting and for displaying the
filename/process (Bug#45800).

Copyright-paperwork-exempt: yes

3 years agoRevert "Make `symbol-at-point' work in buffers with no symbols"
Lars Ingebrigtsen [Wed, 20 Jan 2021 04:44:16 +0000 (05:44 +0100)]
Revert "Make `symbol-at-point' work in buffers with no symbols"

This reverts commit 40a5df81434ce02fba01779256b50976fb74da4f.

This fails when a point is after a symbol, and there's
nothing else in the buffer.

3 years agoDon't add Content-Type when ceasing an rmail edit
Lars Ingebrigtsen [Wed, 20 Jan 2021 04:08:56 +0000 (05:08 +0100)]
Don't add Content-Type when ceasing an rmail edit

* lisp/mail/rmailedit.el (rmail-cease-edit): Take an optional
parameter to avoid altering the message (bug#13327).
(rmail-abort-edit): Use it.

3 years agoMake `symbol-at-point' work in buffers with no symbols
Lars Ingebrigtsen [Wed, 20 Jan 2021 03:44:18 +0000 (04:44 +0100)]
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.

3 years agoFix up example in the Modifying Menus node in the lispref manual
Lars Ingebrigtsen [Wed, 20 Jan 2021 03:17:41 +0000 (04:17 +0100)]
Fix up example in the Modifying Menus node in the lispref manual

* doc/lispref/keymaps.texi (Modifying Menus): Make the second
example more regular (bug#14257).

3 years agoMention that the mouse will switch on transient-mark-mode in manual
Lars Ingebrigtsen [Wed, 20 Jan 2021 02:54:18 +0000 (03:54 +0100)]
Mention that the mouse will switch on transient-mark-mode in manual

* doc/lispref/markers.texi (The Mark): Mention that the mouse will
enable the `(only)' transient mark mode (bug#14945).

3 years agoMake sh-mode use `auto-mode-interpreter-regexp'
Lars Ingebrigtsen [Wed, 20 Jan 2021 02:25:46 +0000 (03:25 +0100)]
Make sh-mode use `auto-mode-interpreter-regexp'

* lisp/progmodes/sh-script.el (sh-mode): Use
`auto-mode-interpreter-regexp' instead of open-coding the value
(bug#17158).

3 years agotest/lisp/replace-tests.el: Add nested match group test
Nick Drozd [Wed, 20 Jan 2021 01:46:17 +0000 (02:46 +0100)]
test/lisp/replace-tests.el: Add nested match group test

* test/lisp/replace-tests.el (replace-regexp-bug45973): Add test
(bug#45973).