]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoAllow commenting out white space lines in latex-mode
Lars Ingebrigtsen [Thu, 28 Jan 2021 06:09:18 +0000 (07:09 +0100)]
Allow commenting out white space lines in latex-mode

* lisp/newcomment.el (comment-region-default-1): Allow commenting
out whitespace-only regions (bug#41793).

* lisp/textmodes/tex-mode.el (latex--comment-region): Use it.
(latex-mode): Set a comment style shim.

3 years agoFix Gnus icalendar button navigation
Lars Ingebrigtsen [Thu, 28 Jan 2021 05:21:40 +0000 (06:21 +0100)]
Fix Gnus icalendar button navigation

* lisp/gnus/gnus-icalendar.el (gnus-icalendar-insert-button): Mark
buttons correctly for TAB navigation (bug#46135).

3 years agoperl-mode.el: Eliminate keywords which are not in Perl.
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.)

3 years agoAllow project/xref packages to be used in Emacs 26.1
João Távora [Thu, 28 Jan 2021 03:18:12 +0000 (04:18 +0100)]
Allow project/xref packages to be used in Emacs 26.1

* lisp/progmodes/project.el: Change Package-Requires to Emacs 26.1
(bug#44671).

* lisp/progmodes/xref.el: Ditto.

3 years ago* lisp/emacs-lisp/macroexp.el (macroexp-if): Fix typo
Stefan Monnier [Wed, 27 Jan 2021 23:53:58 +0000 (18:53 -0500)]
* lisp/emacs-lisp/macroexp.el (macroexp-if): Fix typo

3 years ago* lisp/emacs-lisp/pcase.el (pcase--split-pred): Handle `memq` pred.
Stefan Monnier [Wed, 27 Jan 2021 23:51:09 +0000 (18:51 -0500)]
* lisp/emacs-lisp/pcase.el (pcase--split-pred): Handle `memq` pred.

Improve handling of the `member` tests generated from (or 'a 'b 'c).
This will expand

    (pcase EXP ((and (or 1 2 3) (guard (FOO))) EXP1) (1 EXP2) (6 EXP3))

to

    (cond ((memql '(3 2 1) EXP)
           (cond ((FOO) EXP1) ((eql EXP 1) EXP2)))
          ((eql EXP 6) EXP3))

rather than to

    (cond ((memql '(3 2 1) EXP)
           (cond ((FOO) EXP1) ((eql EXP 1) EXP2) ((eql EXP 6) EXP3)))
          ((eql EXP 1) EXP2)
          ((eql EXP 6) EXP3))

3 years ago* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Perform β-reduction
Stefan Monnier [Wed, 27 Jan 2021 22:35:28 +0000 (17:35 -0500)]
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Perform β-reduction

Also, in `funcall` macroexpand the function before checking to see if
we can remove the `funcall`.

(macroexp-if): Trim trailing `nil` in the generated code while we're at it.

3 years ago* lisp/replace.el (query-replace-read-from-suggestions): New function.
Juri Linkov [Wed, 27 Jan 2021 18:33:13 +0000 (20:33 +0200)]
* lisp/replace.el (query-replace-read-from-suggestions): New function.

(query-replace-read-from): Use it instead of hard-coded '(car search-ring)'.
(read-regexp-suggestions): Add the active region (bug#41692).

3 years ago* admin/notes/unicode: titdic-cnv.el is now utf-8.
Paul Eggert [Wed, 27 Jan 2021 18:10:44 +0000 (10:10 -0800)]
* admin/notes/unicode: titdic-cnv.el is now utf-8.

3 years agoSupport multi-line prompt and contents in previous-line-or-history-element.
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.

3 years ago* lisp/international/titdic-cnv.el (tsang-quick-converter): Simplify
Stefan Monnier [Wed, 27 Jan 2021 17:35:19 +0000 (12:35 -0500)]
* lisp/international/titdic-cnv.el (tsang-quick-converter): Simplify

Merge branches which only differed in the `charset` property of the
strings they intended to return, since that info gets lost later
on anyway.

3 years ago* lisp/international/titdic-cnv.el: Revert to utf-8 encoding
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.

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

3 years ago; Merge from origin/emacs-27
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

3 years agoMerge from origin/emacs-27
Glenn Morris [Wed, 27 Jan 2021 15:55:11 +0000 (07:55 -0800)]
Merge from origin/emacs-27

3443a1c698 Fix last change

3 years ago; Merge from origin/emacs-27
Glenn Morris [Wed, 27 Jan 2021 15:55:11 +0000 (07:55 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

c8fa056a50 Mention undo-amalgamate-change-group in the lispref manual

3 years agoMerge from origin/emacs-27
Glenn Morris [Wed, 27 Jan 2021 15:55:11 +0000 (07:55 -0800)]
Merge from origin/emacs-27

3f610177ad Avoid sending systemd shutdown notifications if non-daemon
009df5cb3c * src/cmds.c (Fforward_line): Doc fix.  (Bug#46027)
ee1c54ebc0 Improve documentation of sendmail.el defcustom's

3 years ago; Merge from origin/emacs-27
Glenn Morris [Wed, 27 Jan 2021 15:55:11 +0000 (07:55 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

82c228a017 Don't let `maybe_quit` prevent resetting `consing_until_gc...

3 years agoMerge from origin/emacs-27
Glenn Morris [Wed, 27 Jan 2021 15:55:11 +0000 (07:55 -0800)]
Merge from origin/emacs-27

b58fd1eab9 ; * lisp/language/cham.el: Fix copy-paste mistake in comment.

3 years agoFix display of stretches of whitespace in the display margins
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>.

3 years agoSome Tramp fixes
Michael Albinus [Wed, 27 Jan 2021 15:30:49 +0000 (16:30 +0100)]
Some Tramp fixes

* doc/misc/tramp.texi (GVFS-based methods): Ban sftp RemoteCommand
option.

* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file): Avoid calling jka-compr when
writing the target file.

* lisp/net/tramp-sh.el (tramp-sh-handle-file-ownership-preserved-p):
Skip GROUP test on *BSD machines.

* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory-one-file):
Skip for tamp-crypt.el.
(tramp--test-sh-no-ls--dired-p): Ignore errors.

3 years ago* lisp/net/dbus.el (dbus-monitor-handler): Disable buffer undo.
Michael Albinus [Wed, 27 Jan 2021 15:30:08 +0000 (16:30 +0100)]
* lisp/net/dbus.el (dbus-monitor-handler): Disable buffer undo.

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)

(cherry picked from commit 49eb03d6c8a181fd46adbbcf1f0a976d0a9efa87)

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

(cherry picked from commit f9cc2d48246fe8370e9286866e6115ba8e2acf44)

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

(cherry picked from commit eded2a7ad7d456a417354a2797c18e9a578414d7)

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

(cherry picked from commit cc98d0bf5225c281f91152aa838c4cb093df52e9)

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

(cherry picked from commit 5821dee0949b2913c07970d6e4b8bb8e8a35f036)

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 agoFix last change
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)

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

(cherry picked from commit ba25a82855a2c03c25fec83f3056c166b692e94f)

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 agoAvoid sending systemd shutdown notifications if non-daemon
Eli Zaretskii [Fri, 22 Jan 2021 12:30:22 +0000 (14:30 +0200)]
Avoid sending systemd shutdown notifications if non-daemon

* src/emacs.c (Fkill_emacs): Send the shutdown notification only
in daemon mode.  (Bug#46022)

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* src/cmds.c (Fforward_line): Doc fix. (Bug#46027)
Eli Zaretskii [Fri, 22 Jan 2021 08:10:21 +0000 (10:10 +0200)]
* src/cmds.c (Fforward_line): Doc fix.  (Bug#46027)

3 years agoImprove documentation of sendmail.el defcustom's
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)

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.