]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoLift restriction for finding theme summary line
Mauro Aranda [Wed, 19 May 2021 12:57:46 +0000 (09:57 -0300)]
Lift restriction for finding theme summary line

* lisp/cus-theme.el (custom-theme-summary): Don't limit the file to
having the deftheme form as the very first form, rather look for the
deftheme form explicitly.

3 years agoFix recently introduced misbehavior of `quit-restore-window' (Bug#48493)
Martin Rudalics [Wed, 19 May 2021 07:17:37 +0000 (09:17 +0200)]
Fix recently introduced misbehavior of `quit-restore-window' (Bug#48493)

* lisp/window.el (quit-restore-window): Unconditionally call
`switch-to-prev-buffer' (Bug#48493).

3 years ago* lisp/progmodes/js.el (js--make-framework-matcher): Use a closure
Stefan Monnier [Wed, 19 May 2021 00:30:08 +0000 (20:30 -0400)]
* lisp/progmodes/js.el (js--make-framework-matcher): Use a closure

3 years ago* lisp/progmodes/gud.el (gud-tooltip-tips): Use proper closures
Stefan Monnier [Wed, 19 May 2021 00:21:51 +0000 (20:21 -0400)]
* lisp/progmodes/gud.el (gud-tooltip-tips): Use proper closures

Also prefer #' to quote function names.

(jdb): Fix $ => \'.

3 years ago* lisp/org/org-timer.el (org-timer--run-countdown-timer): Use closures
Stefan Monnier [Tue, 18 May 2021 23:54:38 +0000 (19:54 -0400)]
* lisp/org/org-timer.el (org-timer--run-countdown-timer): Use closures

3 years ago* lisp/org/org-mouse.el: Make use of lexical scoping
Stefan Monnier [Tue, 18 May 2021 23:51:26 +0000 (19:51 -0400)]
* lisp/org/org-mouse.el: Make use of lexical scoping

(org-mouse-todo-menu): Simplify by eta-reduction.
(org-mouse-popup-global-menu): Remove redundant `eval`.
(org-mouse-keyword-menu, org-mouse-keyword-replace-menu)
(org-mouse-tag-menu, org-mouse-match-closure): Use proper closures.

3 years ago* lisp/org/org-colview.el (org-columns-map): Use proper closures
Stefan Monnier [Tue, 18 May 2021 23:36:54 +0000 (19:36 -0400)]
* lisp/org/org-colview.el (org-columns-map): Use proper closures

Also prefer #' to quote function names.

(org-columns-map): Use derived-mode-p.

3 years ago* lisp/org/org-clock.el (org-clock-get-table-data): Use proper closures
Stefan Monnier [Tue, 18 May 2021 23:32:35 +0000 (19:32 -0400)]
* lisp/org/org-clock.el (org-clock-get-table-data): Use proper closures

Also, prefer #' to quote function names

3 years ago* lisp/net/sieve-manage.el (sieve-sasl-auth): Use proper closures
Stefan Monnier [Tue, 18 May 2021 23:23:54 +0000 (19:23 -0400)]
* lisp/net/sieve-manage.el (sieve-sasl-auth): Use proper closures

3 years ago* lisp/net/shr.el (shr-image-displayer): Use proper closures
Stefan Monnier [Tue, 18 May 2021 23:15:04 +0000 (19:15 -0400)]
* lisp/net/shr.el (shr-image-displayer): Use proper closures

3 years ago* lisp/net/imap.el (imap-mailbox-close): Use proper closures
Stefan Monnier [Tue, 18 May 2021 23:12:11 +0000 (19:12 -0400)]
* lisp/net/imap.el (imap-mailbox-close): Use proper closures

Also, remove redundant `:group` args, and prefer #' to quote function names

3 years ago* lisp/net/eudc.el (eudc-menu): Use proper closures
Stefan Monnier [Tue, 18 May 2021 23:06:54 +0000 (19:06 -0400)]
* lisp/net/eudc.el (eudc-menu): Use proper closures

3 years ago* lisp/net/browse-url.el: Avoid `(lambda ..)
Stefan Monnier [Tue, 18 May 2021 23:05:29 +0000 (19:05 -0400)]
* lisp/net/browse-url.el: Avoid `(lambda ..)

(browse-url-netscape, browse-url-mozilla, browse-url-galeon)
(browse-url-epiphany, browse-url-elinks): Use proper closures.

3 years ago* lisp/misearch.el (multi-isearch-push-state): Use proper closures
Stefan Monnier [Tue, 18 May 2021 23:03:06 +0000 (19:03 -0400)]
* lisp/misearch.el (multi-isearch-push-state): Use proper closures

3 years ago* lisp/menu-bar.el: Avoid `(lambda
Stefan Monnier [Tue, 18 May 2021 23:01:49 +0000 (19:01 -0400)]
* lisp/menu-bar.el: Avoid `(lambda

(menu-bar-buffer-vector, menu-bar-update-buffers): Use proper closures.

3 years ago* lisp/info.el (Info-isearch-push-state): Use proper closures
Stefan Monnier [Tue, 18 May 2021 22:13:28 +0000 (18:13 -0400)]
* lisp/info.el (Info-isearch-push-state): Use proper closures

3 years ago* lisp/imenu.el (imenu--create-keymap): Use proper closures
Stefan Monnier [Tue, 18 May 2021 22:11:08 +0000 (18:11 -0400)]
* lisp/imenu.el (imenu--create-keymap): Use proper closures

3 years ago* lisp/find-dired.el (find-dired): Use a proper closure
Stefan Monnier [Tue, 18 May 2021 22:06:15 +0000 (18:06 -0400)]
* lisp/find-dired.el (find-dired): Use a proper closure

3 years ago* lisp/facemenu.el (facemenu-add-new-face): Use `:documentation`
Stefan Monnier [Tue, 18 May 2021 22:05:05 +0000 (18:05 -0400)]
* lisp/facemenu.el (facemenu-add-new-face): Use `:documentation`

3 years ago* lisp/eshell/em-pred.el: Take advantage of lexical scoping
Stefan Monnier [Tue, 18 May 2021 21:53:23 +0000 (17:53 -0400)]
* lisp/eshell/em-pred.el: Take advantage of lexical scoping

Also remove redundant `:group` arguments.

(eshell-parse-modifiers): Make sure we pass a function value.
(eshell-parse-arg-modifier, eshell-parse-modifiers)
(eshell-add-pred-func, eshell-pred-user-or-group)
(eshell-pred-file-time, eshell-pred-file-type, eshell-pred-file-mode)
(eshell-pred-file-links, eshell-pred-file-size)
(eshell-pred-substitute, eshell-include-members, eshell-join-members)
(eshell-split-members): Use proper closures.

3 years ago* doc/emacs/basic.texi (Repeating): Document repeat-exit-timeout (bug#48472).
Juri Linkov [Tue, 18 May 2021 21:15:30 +0000 (00:15 +0300)]
* doc/emacs/basic.texi (Repeating): Document repeat-exit-timeout (bug#48472).

3 years ago* lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Use a closure
Stefan Monnier [Tue, 18 May 2021 21:13:37 +0000 (17:13 -0400)]
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Use a closure

3 years ago* lisp/repeat.el (repeat-exit-timeout): New defcustom (bug#48472).
Juri Linkov [Tue, 18 May 2021 21:02:42 +0000 (00:02 +0300)]
* lisp/repeat.el (repeat-exit-timeout): New defcustom (bug#48472).

(repeat-exit-timer): New variable.
(repeat-post-hook): Run idle timer with an "exit function"
returned from set-transient-map.
Suggested by Gustavo Barros <gusbrs.2016@gmail.com>.

(repeat-echo-message): Remove own previous message when input arg is nil.

* lisp/window.el (display-buffer-override-next-command): Return exitfun.

3 years ago* lisp/calendar/cal-menu.el (cal-menu-holidays-menu): Use a proper closure
Stefan Monnier [Tue, 18 May 2021 20:58:54 +0000 (16:58 -0400)]
* lisp/calendar/cal-menu.el (cal-menu-holidays-menu): Use a proper closure

3 years ago* lisp/emacs-lisp/lisp-mode.el (lisp-outline-level): Fix imprecise numbers.
Juri Linkov [Tue, 18 May 2021 20:35:57 +0000 (23:35 +0300)]
* lisp/emacs-lisp/lisp-mode.el (lisp-outline-level): Fix imprecise numbers.

(lisp-outline-level): Return right levels starting from 1 instead of 5.
Suggested by Howard Melman <hmelman@gmail.com> in bug#46878.

3 years ago* lisp/simple.el (read-from-kill-ring): Add new arg PROMPT (bug#48478).
Juri Linkov [Tue, 18 May 2021 20:23:50 +0000 (23:23 +0300)]
* lisp/simple.el (read-from-kill-ring): Add new arg PROMPT (bug#48478).

* lisp/simple.el (yank-pop, yank-from-kill-ring):
* lisp/isearch.el (isearch-yank-from-kill-ring):
Use arg PROMPT in the call read-from-kill-ring.

3 years agoRecreate symptom of Bug#42701.
Philipp Stephani [Tue, 18 May 2021 16:43:11 +0000 (18:43 +0200)]
Recreate symptom of Bug#42701.

The fix to Bug#48489 (commit 9676d41b8301b84e07717e633059a3f2b5c4c9d8)
has masked the symptom of Bug#42701 for 'if-let'.  Create a helper
macro that still exemplifies the bug.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests--duplicate-symbol-backtrack): New helper macro.
(edebug-tests-duplicate-symbol-backtrack): Use it instead of 'if-let'.

3 years agoFix some regressions introduced by the previous dired-aux change
Lars Ingebrigtsen [Tue, 18 May 2021 15:49:05 +0000 (17:49 +0200)]
Fix some regressions introduced by the previous dired-aux change

* lisp/dired-aux.el (dired-compress-file): Check that the file
we're compressing exists.  Also work outside the current directory.

3 years agoLook for ElDoc buffer in all visible frames
Basil L. Contovounesios [Tue, 18 May 2021 15:28:42 +0000 (16:28 +0100)]
Look for ElDoc buffer in all visible frames

* lisp/emacs-lisp/eldoc.el (eldoc--echo-area-prefer-doc-buffer-p):
Look for a window displaying the ElDoc documentation buffer in all
visible frames, as promised by the user option
eldoc-echo-area-prefer-doc-buffer (bug#48278).

3 years agoFix problem with focusing in `C-o' in ibuffer in some circumstances
Miha Rihtaršič [Tue, 18 May 2021 15:08:58 +0000 (17:08 +0200)]
Fix problem with focusing in `C-o' in ibuffer in some circumstances

* lisp/ibuffer.el (ibuffer-visit-buffer-other-window-noselect):
Use display-buffer instead of pop-to-buffer and selecting the old
window.  `pop-to-buffer' focuses the new frame, but
`select-window' usually fails to focus the original frame.  This
simple patch fixes that (bug#48218).

3 years agoFix `custom-delayed-init-variables' problem when re-dumping emacs
Gong Qijian [Tue, 18 May 2021 14:35:48 +0000 (16:35 +0200)]
Fix `custom-delayed-init-variables' problem when re-dumping emacs

* lisp/startup.el (command-line): Don't bug out on redumping Emacs
(bug#48492).

Copyright-paperwork-exempt: yes

3 years ago* lisp/kmacro.el: Fix test cases broken by last change
Stefan Monnier [Tue, 18 May 2021 14:37:57 +0000 (10:37 -0400)]
* lisp/kmacro.el: Fix test cases broken by last change

(kmacro-lambda-form): Remove unused args `counter` and `format`.
Arrange to be able to extract `mac` from the function.
(kmacro-extract-lambda): Use this new extraction instead of digging
into the guts of a function's code.

3 years agoFix the length= shortdoc example
Alexandr Vityazev [Tue, 18 May 2021 13:36:25 +0000 (15:36 +0200)]
Fix the length= shortdoc example

* lisp/emacs-lisp/shortdoc.el (list): Fix the length= example
(bug#48495).

Copyright-paperwork-exempt: yes

3 years agoRevert "* lisp/bookmark.el: make bookmark-fontify nil default value"
Eli Zaretskii [Tue, 18 May 2021 12:00:04 +0000 (15:00 +0300)]
Revert "* lisp/bookmark.el: make bookmark-fontify nil default value"

This reverts commit ed8c3303f945fbd2c16ece0e87d041c75ae05ff9.

3 years agoFix pcase 'rx' patterns with a single named submatch (bug#48477)
Mattias Engdegård [Tue, 18 May 2021 10:03:11 +0000 (12:03 +0200)]
Fix pcase 'rx' patterns with a single named submatch (bug#48477)

pcase 'rx' patterns with a single named submatch, like

  (rx (let x "a"))

would always succeed because of an over-optimistic transformation.
Patterns with 0 or more than 1 named submatches were not affected.

Reported by Philipp Stephani.

* lisp/emacs-lisp/rx.el (rx--pcase-macroexpander):
Special case for a single named submatch.
* test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add tests.

3 years ago* lisp/bookmark.el: make bookmark-fontify nil default value
Paul W. Rankin [Tue, 18 May 2021 06:10:51 +0000 (16:10 +1000)]
* lisp/bookmark.el: make bookmark-fontify nil default value

3 years ago* lisp/emacs-lisp/subr-x.el (if-let): Swap &or branches (Bug#48489)
Philipp Stephani [Tue, 18 May 2021 07:25:54 +0000 (09:25 +0200)]
* lisp/emacs-lisp/subr-x.el (if-let): Swap &or branches (Bug#48489)

3 years ago* lisp/kmacro.el: Avoid the dynbound dialect of ELisp
Stefan Monnier [Tue, 18 May 2021 02:16:42 +0000 (22:16 -0400)]
* lisp/kmacro.el: Avoid the dynbound dialect of ELisp

(kmacro-call-macro, kmacro-lambda-form): Use proper closures.
(kmacro-keymap): Prefer #' top quote function names.

3 years agoVisually truncate excessively long lines in Xref
Dmitry Gutov [Tue, 18 May 2021 00:33:29 +0000 (03:33 +0300)]
Visually truncate excessively long lines in Xref

* lisp/progmodes/xref.el (xref-truncation-width): New option.
(xref--apply-truncation): New function.
(xref--insert-xrefs): Use it (bug#46859).

3 years agoFix the etags test suite
Eli Zaretskii [Mon, 17 May 2021 16:39:45 +0000 (19:39 +0300)]
Fix the etags test suite

* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6:
* test/manual/etags/CTAGS.good: Adjust to addition test.rs.

3 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Mon, 17 May 2021 16:34:53 +0000 (19:34 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

3 years ago; * admin/notes/years: Mention that etags test files need to be updated.
Eli Zaretskii [Mon, 17 May 2021 16:33:40 +0000 (19:33 +0300)]
; * admin/notes/years: Mention that etags test files need to be updated.

3 years agoAdd an etags test for Rust (bug#46055)
Lars Ingebrigtsen [Mon, 17 May 2021 16:25:08 +0000 (18:25 +0200)]
Add an etags test for Rust (bug#46055)

3 years agoUpdate the etags/ctags test files
Eli Zaretskii [Mon, 17 May 2021 16:06:56 +0000 (19:06 +0300)]
Update the etags/ctags test files

* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6:
* test/manual/etags/CTAGS.good: Adjust to current codebase.

3 years agoAllow specifying the default archive types to compress to in Dired
Sun Lin [Mon, 17 May 2021 16:03:55 +0000 (18:03 +0200)]
Allow specifying the default archive types to compress to in Dired

* lisp/dired-aux.el (dired-compress-file-default-suffix):
(dired-compress-directory-default-suffix): New user options
(bug#47119).
(dired-compress-file-alist): New variable.

* lisp/dired-aux.el (dired-compress-file): Use them.
(dired-compress-file-suffixes): Remove the directory item.

3 years agoAdd support for Rust in etags
Pierre-Antoine Rouby [Mon, 17 May 2021 15:14:12 +0000 (17:14 +0200)]
Add support for Rust in etags

* lib-src/etags.c (Rust_functions): New function to make tags for rust
files.
(Rust_help, Rust_suffixes): New constant.
* doc/emacs/maintaining.texi (Tag Syntax): Add Rust item.
* doc/man/etags.1: Add Rust (bug#46055).

3 years agoAvoid crashes in condition-case
Eli Zaretskii [Mon, 17 May 2021 15:10:49 +0000 (18:10 +0300)]
Avoid crashes in condition-case

* src/eval.c (internal_lisp_condition_case): Don't take XCAR
without making sure the value is a cons cell.  (Bug#48479)

3 years agoMention *-nov-is-evil in the Extra Headers Gnus manual section
Lars Ingebrigtsen [Mon, 17 May 2021 14:29:56 +0000 (16:29 +0200)]
Mention *-nov-is-evil in the Extra Headers Gnus manual section

* doc/misc/gnus.texi (To From Newsgroups): Mention nov-is-evil.

3 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Mon, 17 May 2021 12:19:46 +0000 (15:19 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

3 years agoImprove documentation of new behavior of 'M-y'
Eli Zaretskii [Mon, 17 May 2021 12:17:57 +0000 (15:17 +0300)]
Improve documentation of new behavior of 'M-y'

* lisp/minibuffer.el (minibuffer-local-map): Switch the order of
'\r' and '\n' bindings.
* lisp/simple.el (yank-pop, read-from-kill-ring)
(yank-from-kill-ring): Doc fixes.

* doc/emacs/search.texi (Isearch Yank):
* doc/emacs/killing.texi (Yanking): Improve the description of the
new functionality of 'M-y'.
* doc/lispref/text.texi (Yank Commands): Remove inaccurate
description of 'M-y' in Isearch.

* etc/NEWS: Improve the wording of 'M-y' entry.

3 years agoAdd a unit test to reproduce Bug#48471.
Philipp Stephani [Mon, 17 May 2021 08:43:54 +0000 (10:43 +0200)]
Add a unit test to reproduce Bug#48471.

* test/lisp/progmodes/project-tests.el (project-tests--trivial)
(project-root, project-ignores): New test project type.
(project-ignores): New unit test.

3 years agoFix a few Edebug specifications where code is wrapped in lambdas.
Philipp Stephani [Mon, 17 May 2021 08:00:36 +0000 (10:00 +0200)]
Fix a few Edebug specifications where code is wrapped in lambdas.

As the Info node `(elisp) Specification List' explains, it is not
correct to use `body' or t for a piece of code that the macro wraps in
a `lambda' form.  These should use `def-body' instead.

* lisp/info-xref.el (info-xref-with-file):
* lisp/subr.el (subr--with-wrapper-hook-no-warnings, track-mouse)
(combine-change-calls, with-eval-after-load):
* lisp/emacs-lisp/bytecomp.el (displaying-byte-compile-warnings):
* lisp/emacs-lisp/cl-macs.el (cl-do-symbols, cl-progv):
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer):
* lisp/emacs-lisp/gv.el (gv-letplace):
* lisp/emacs-lisp/nadvice.el (define-advice):
* lisp/emacs-lisp/thunk.el (thunk-delay):
* lisp/vc/vc-dispatcher.el (vc-run-delayed): Use 'def-body' instead of
t or 'body' where applicable.

* lisp/emacs-lisp/package.el (package--with-response-buffer): Remove
evaluation of the body altogether.  I have no idea how to write it
correctly in this case.

3 years agoAdd a 'silent option for native-comp-async-report-warnings-errors
Eric Abrahamsen [Sat, 15 May 2021 16:36:05 +0000 (09:36 -0700)]
Add a 'silent option for native-comp-async-report-warnings-errors

* lisp/emacs-lisp/comp.el (native-comp-async-report-warnings-errors):
Set to 'silent to log warnings, but not pop up the *Warnings* buffer.
* lisp/emacs-lisp/comp.el (comp-accept-and-process-async-output):
Check value.

3 years agoUse condition-case-unless-debug in nnselect-run
Eric Abrahamsen [Sun, 16 May 2021 17:20:43 +0000 (10:20 -0700)]
Use condition-case-unless-debug in nnselect-run

* lisp/gnus/nnselect.el (nnselect-run): This is confusing for users,
make it more yielding to common debugging strategies.

3 years agoFix function signature for gnus-search-indexed-parse-output
Eric Abrahamsen [Sun, 16 May 2021 17:19:41 +0000 (10:19 -0700)]
Fix function signature for gnus-search-indexed-parse-output

* lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Generic
function arg list didn't match the method arglist, which made for
confusing function help.

3 years agomouse-wheel-progressive-speed doc string clarification
Lars Ingebrigtsen [Sun, 16 May 2021 15:59:54 +0000 (17:59 +0200)]
mouse-wheel-progressive-speed doc string clarification

* lisp/mwheel.el (mouse-wheel-progressive-speed): Doc string
improvement (bug#45322).

3 years agoprepend newline in sqli buffer
Ingo Lohmar [Sun, 16 May 2021 14:32:10 +0000 (16:32 +0200)]
prepend newline in sqli buffer

(sql-remove-continuation-prompt, sql-send-string): Move newline
insertion.

Previously, the preoutput filter `sql-remove-continuation-prompt'
inserted a leading newline in the interactive SQL buffer if it decided
that is has to remove continuation prompts and that it had found all
it was looking for.

1) This filter function was a doubtful place to do that (arguably, its
   name does not suggest any action like this).
2) The behavior worked inconsistently, eg, when sending a single-line
   "SELECT" statement, because it only ran when the filter function
   needed to remove any prompts (for example, not when sending a
   region without newlines).

   This can lead to misaligned table headers, which explains why
   emacswiki and stackoverflow both present several fixes to this
   behavior.

3 years agoAdd bug-reference-mode-force-auto-setup
Tassilo Horn [Sun, 16 May 2021 14:19:57 +0000 (16:19 +0200)]
Add bug-reference-mode-force-auto-setup

* lisp/progmodes/bug-reference.el
(bug-reference-try-setup-from-rmail): Match the Rmail mbox filename
against GROUP-REGEXP in bug-reference-setup-from-mail-alist.
(bug-reference-mode-force-auto-setup): New function which forces
auto-setup even if bug-reference-bug-regexp and
bug-reference-url-format are already set.

3 years agoAdd more completion tests
Dario Gjorgjevski [Sun, 16 May 2021 13:50:41 +0000 (15:50 +0200)]
Add more completion tests

* test/lisp/minibuffer-tests.el (completion--pcm-score)
(completion--pcm-first-difference-pos): New helpers.
(completion-pcm-test-1, completion-pcm-test-2)
(completion-pcm-test-3, completion-pcm-test-4)
(completion-pcm-test-5, completion-pcm-test-6)
(completion-substring-test-1, completion-substring-test-2)
(completion-substring-test-3, completion-substring-test-4)
(completion-flex-test-1, completion-flex-test-2)
(completion-flex-test-3): New tests (bug#42149)

3 years agoImprove some quotation quoting in the Emacs manual
Sebastian Urban [Sun, 16 May 2021 13:29:39 +0000 (15:29 +0200)]
Improve some quotation quoting in the Emacs manual

* doc/emacs/text.texi (Quotation Marks, Quotation Marks):
* doc/emacs/display.texi (Text Display): Fix some issues when
quoting quote marks and the like (bug#35885).

* doc/emacs/emacs.texi: Switch on double-sided printing headings.

Copyright-paperwork-exempt: yes

3 years agoRemove unreliable test for match data clobbering
Noam Postavsky [Sun, 16 May 2021 13:19:57 +0000 (15:19 +0200)]
Remove unreliable test for match data clobbering

* src/search.c (Freplace_match): Don't test for change in search_regs
start and end, this is unreliable if change hooks modify text earlier
in the buffer (bug#35264).

3 years agoOptimize calls to 'eql', 'memql' and similar for fixnums.
Philipp Stephani [Thu, 6 May 2021 17:13:00 +0000 (19:13 +0200)]
Optimize calls to 'eql', 'memql' and similar for fixnums.

It's good practice to compare integers using 'eql' because two bignum
objects representing the same integer might not be 'eq'.  However,
'eql' is slower and doesn't have its own byte code.  Therefore,
replace it with 'eq' if one argument is guaranteed to be a fixnum on
all platforms.

* lisp/emacs-lisp/byte-opt.el (byte-optimize--fixnump): New helper
function.
(byte-optimize-equal, byte-optimize-member, byte-optimize-assoc): Use
it to optimize 'eql' etc. to 'eq' if it will always compare fixnums.

3 years agoFix handling of stderr buffer in Tramp's make-process (Bug#47861)
Michael Albinus [Sun, 16 May 2021 10:08:09 +0000 (12:08 +0200)]
Fix handling of stderr buffer in Tramp's make-process (Bug#47861)

* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Reimplement stderr buffer handling.  (Bug#47861)
(tramp-maybe-open-connection): Improve traces.

* test/lisp/net/tramp-tests.el (tramp-test30-make-process):
Rework for stderr buffer.

3 years agoBug reference auto-setup for Rmail
Tassilo Horn [Sun, 16 May 2021 07:21:48 +0000 (09:21 +0200)]
Bug reference auto-setup for Rmail

* lisp/progmodes/bug-reference.el
(bug-reference-try-setup-from-rmail): New function setting up
`bug-reference-mode' from the current Rmail message.

3 years agoUpdate CSS completion tests
Dmitry Gutov [Sat, 15 May 2021 20:46:30 +0000 (23:46 +0300)]
Update CSS completion tests

* test/lisp/textmodes/css-mode-tests.el (css-test-complete-pseudo-class)
(css-test-complete-pseudo-element): Update the tests for recent changes.

3 years agoRefactor bug-reference setup functions into a defvar
Tassilo Horn [Sat, 15 May 2021 19:19:55 +0000 (21:19 +0200)]
Refactor bug-reference setup functions into a defvar

* lisp/progmodes/bug-reference.el
(bug-reference-auto-setup-functions): New defvar so that other
packages can add their own auto-setup functions to it.
* lisp/progmodes/bug-reference.el (bug-reference--run-auto-setup): Use
the new variable instead of hard-coding the 4 functions we've had
already.

3 years agoFix segfaults when byte-compiling with native-compilation
Eli Zaretskii [Sat, 15 May 2021 17:44:40 +0000 (20:44 +0300)]
Fix segfaults when byte-compiling with native-compilation

* src/emacs.c (main): Call 'set_initial_minibuffer_mode' before
entering recursive-exit.
* src/minibuf.c (init_minibuf_once_for_pdumper): Don't call
'set_minibuffer_mode' here...
(set_initial_minibuffer_mode): ... set it in this new function.
(Bug#48446)
* src/lisp.h: Add prototype for 'set_initial_minibuffer_mode'.

3 years agoMiscellaneous corrections to src/minibuf.c for bug #48337
Alan Mackenzie [Sat, 15 May 2021 11:49:49 +0000 (11:49 +0000)]
Miscellaneous corrections to src/minibuf.c for bug #48337

* src/minibuf.c (read_minibuf): Call get_minibuffer before incrementing
minibuf_level, in case a hook function calls Factive_minibuffer_window.
(init_minibuf_once_for_pdumper): Create  *Minibuf-0* here (moved from
init_minibuf_once), and set its mode, so that clicking in the mini-window
immediately after start up works (thanks, Eli Z.).

3 years agoFix launching net-utils on MS-Windows
Eli Zaretskii [Sat, 15 May 2021 09:38:01 +0000 (12:38 +0300)]
Fix launching net-utils on MS-Windows

* lisp/net/net-utils.el (net-utils-run-simple): Bind
coding-system-for-read around the code which starts the process.
(Bug#48375)

3 years agoFix `quit-restore-window' when all previous buffers got killed (Bug#48367)
pillule [Sat, 15 May 2021 08:47:07 +0000 (10:47 +0200)]
Fix `quit-restore-window' when all previous buffers got killed (Bug#48367)

* lisp/window.el (quit-restore-window): Simplify calculation of
WINDOW's previous buffer.  Avoid that killing WINDOW's previous
buffers results in a state where `quit-window' has no more
effect, by simply deleting WINDOW in that case (Bug#48367).

Copyright-paperwork-exempt: yes

3 years agoMairix: use 'mairix-search-options' as documented
Daniel Semyonov [Sat, 1 May 2021 14:03:07 +0000 (17:03 +0300)]
Mairix: use 'mairix-search-options' as documented

* lisp/net/mairix.el (mairix-call-mairix): Append
'mairix-search-options' to the arguments passed to mairix.

Copyright-paperwork-exempt: yes

3 years agoMairix: autoload main interactive functions
Daniel Semyonov [Sat, 1 May 2021 14:01:22 +0000 (17:01 +0300)]
Mairix: autoload main interactive functions

* lisp/net/mairix.el (mairix-search, mairix-use-saved-search)
(mairix-edit-saved-searches-customize, mairix-search-from-this-article)
(mairix-search-thread-this-article, mairix-widget-search-based-on-article)
(mairix-edit-saved-searches, mairix-widget-search, mairix-update-database):
Add magic autoload comment.

Copyright-paperwork-exempt: yes

3 years agoImprove doc string of 'log-edit-generate-changelog-from-diff'
Eli Zaretskii [Sat, 15 May 2021 08:06:41 +0000 (11:06 +0300)]
Improve doc string of 'log-edit-generate-changelog-from-diff'

* lisp/vc/log-edit.el (log-edit-generate-changelog-from-diff):
Improve the doc string.  (Bug#48269)

3 years agoHave X builds handle VisibilityNotify events (Bug#48268, Bug#48413)
Martin Rudalics [Sat, 15 May 2021 07:20:50 +0000 (09:20 +0200)]
Have X builds handle VisibilityNotify events (Bug#48268, Bug#48413)

* src/xterm.c (handle_one_xevent): Handle VisibilityNotify
events (Bug#48268, Bug#48413).

3 years agoAdd :company-kind support to nxml-mode completion
Dmitry Gutov [Sat, 15 May 2021 01:18:42 +0000 (04:18 +0300)]
Add :company-kind support to nxml-mode completion

* lisp/nxml/rng-nxml.el (rng-complete-tag)
(rng-complete-attribute-name, rng-complete-attribute-value):
Support :company-kind.

3 years agoAdd :company-kind support to sh-mode completion
Dmitry Gutov [Sat, 15 May 2021 00:44:16 +0000 (03:44 +0300)]
Add :company-kind support to sh-mode completion

* lisp/progmodes/sh-script.el (sh--completion-keywords):
New variable.
(sh--cmd-completion-table): Extracted from here.
(sh-completion-at-point-function): Add :company-kind.

3 years agoInclude colons in the completion strings
Dmitry Gutov [Sat, 15 May 2021 00:17:17 +0000 (03:17 +0300)]
Include colons in the completion strings

* lisp/textmodes/css-mode.el
(css--complete-pseudo-element-or-class):
Include colons in the completion strings. That's simply the nicer
behavior (e.g. someone typing : will see pseudo-elements in
completions as well), and by the standards, the colons are part of
their names anyway (of pseudo-elements and classes).

3 years agoAdd :company-kind support to css-mode completion
Dmitry Gutov [Fri, 14 May 2021 23:47:05 +0000 (02:47 +0300)]
Add :company-kind support to css-mode completion

* lisp/textmodes/css-mode.el (css--complete-pseudo-element-or-class)
(css--complete-property-value, css-completion-at-point)
(css--complete-at-rule): Add :company-kind properties, to annotate
completions with kinds returned in each case.

3 years agoMake the M-x obsoletion check more robust
Lars Ingebrigtsen [Fri, 14 May 2021 16:50:24 +0000 (18:50 +0200)]
Make the M-x obsoletion check more robust

* lisp/simple.el (read-extended-command): Make the obsoletion
check more robust.

3 years agoVarious detailed fixes to minibuf.c, etc., to fix bug #48337
Alan Mackenzie [Fri, 14 May 2021 15:52:21 +0000 (15:52 +0000)]
Various detailed fixes to minibuf.c, etc., to fix bug #48337

Also fix some unsafe coding.

* lisp/window.el (push-window-buffer-onto-prev): New function, extracted from
(record-window-buffer): Refactor by extracting the above, and removing the now
redundant parameter DO-MINIBUF.

* src/minibuf.c (zip_minibuffer_stacks, read_minibuf): Replace calls to
get_minibuffer (0) by nth_minibuffer (0).  Replace calls to
Qrecord_window_buffer by calls to Qpush_window_buffer_onto_prev.
(Factive_minibuffer_window, read_minibuf_unwind): Call abort_emacs should an
"impossible" null value be returned by nth_minibuffer.
(read_minibuf): Move the get_minibuffer_call to just after the incrementation
of minibuf_level as a precaution against a missing buffer in
Vminibuffer_list.
(nth_minibuffer): Replace XCAR by Fcar, to allow (car nil) to work.
(init_minibuf_once): Create the inactive buffer  *Minibuf-0*.
(syms_of_minibuf): New DEFSYM, Qpush_window_buffer_onto_prev.

* src/window.c (restore_window_configuration): Replace some XCARs and XCDRs
by Fcar_safe and Fcdr_safe.

3 years ago; * doc/misc/calc.texi (Date Arithmetic): Fix order in @menu.
Eli Zaretskii [Thu, 13 May 2021 16:58:30 +0000 (19:58 +0300)]
; * doc/misc/calc.texi (Date Arithmetic): Fix order in @menu.

3 years ago* doc/misc/calc.texi: Remove most hand-written node pointers.
Glenn Morris [Thu, 13 May 2021 16:26:47 +0000 (09:26 -0700)]
* doc/misc/calc.texi: Remove most hand-written node pointers.

The complex, conditional node layout makes this one of the very
few cases that can't be done entirely automatically.

3 years agoRemove more hand-written node pointers in doc/misc
Glenn Morris [Thu, 13 May 2021 16:08:40 +0000 (09:08 -0700)]
Remove more hand-written node pointers in doc/misc

* doc/misc/ede.texi, doc/misc/mh-e.texi, doc/misc/reftex.texi:
* doc/misc/todo-mode.texi: Remove hand-written node pointers.

3 years ago* doc/misc/epa.texi: Remove hand-written node pointers.
Glenn Morris [Thu, 13 May 2021 15:20:49 +0000 (08:20 -0700)]
* doc/misc/epa.texi: Remove hand-written node pointers.

3 years agoMerge from origin/emacs-27
Glenn Morris [Thu, 13 May 2021 15:11:03 +0000 (08:11 -0700)]
Merge from origin/emacs-27

bcd92b5708 (origin/emacs-27) Improve documentation of Hexl mode
c233f4eccd ; * etc/NEWS: Fix decoded-time-set-defaults typo.
4c3abb3dd1 Fix compilation errors with latest w32 API headers
127f1f330b Improve doc strings in log-edit.el
e36183ff46 ; * etc/TODO (etc/DOC): Update the todo entries.

# Conflicts:
# etc/NEWS

3 years ago* doc/misc/epa.texi: Fix @nodes in previous change.
Glenn Morris [Thu, 13 May 2021 15:07:57 +0000 (08:07 -0700)]
* doc/misc/epa.texi: Fix @nodes in previous change.

3 years agoImprove Tramp traces
Michael Albinus [Thu, 13 May 2021 14:46:17 +0000 (16:46 +0200)]
Improve Tramp traces

* lisp/net/tramp-cmds.el (tramp-list-tramp-buffers):
List also trace buffers.

* lisp/net/tramp.el (tramp-buffer-name):
Add `tramp-suppress-trace' property.
(tramp-get-debug-file-name): Fix docstring.
(tramp-trace-buffer-name): New defun.
(tramp-trace-functions): New defvar.
(tramp-debug-message): Obey also `tramp-trace-functions'.

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Handle trace buffer accordingly.

3 years agoProcess sentinels need to work under X and commandline
dickmao [Thu, 13 May 2021 13:21:53 +0000 (15:21 +0200)]
Process sentinels need to work under X and commandline

* src/process.c (add_non_keyboard_read_fd): Make this a public function.
(add_process_read_fd): Fold old, static add_non_keyboard_read_fd guts
into here.
* src/xsmfns.c (ice_conn_watch_CB): Call add_non_keyboard_read_fd
(bug#43834).

3 years agoFix vertical cursor motion across tall text or small images
Eli Zaretskii [Thu, 13 May 2021 13:12:10 +0000 (16:12 +0300)]
Fix vertical cursor motion across tall text or small images

'line-move-partial' should in general leave it to the display
engine to scroll or recenter the window due to vertical motion of
the cursor.  The only purpose of this function is to produce
vscroll suitable for scrolling across large (relatively to the
window's height) images, where moving by display lines is not
appropriate.

* src/xdisp.c (Fdisplay__line_is_continued_p): New primitive.

* lisp/simple.el (line-move-partial): Call
'display--line-is-continued-p' to decide whether to leave it to
redisplay to scroll the window as appropriate.  (Bug#48170)

3 years agoFix bug#48349 in file-name-non-special
Michael Albinus [Thu, 13 May 2021 11:57:46 +0000 (13:57 +0200)]
Fix bug#48349 in file-name-non-special

* lisp/files.el (file-name-non-special): Use Tramp file name
handler only in case of `copy-file', 'rename-file' and
`copy-directory'.  (Bug#48349)

3 years agoDocument `package-quickstart' in the user manual
Stefan Kangas [Thu, 13 May 2021 11:45:04 +0000 (13:45 +0200)]
Document `package-quickstart' in the user manual

* doc/emacs/package.texi (Package Installation): Document
`package-quickstart' (bug#44748).

3 years agoMake searching for files faster under Windows
Nicolás Bértolo [Thu, 13 May 2021 11:30:29 +0000 (13:30 +0200)]
Make searching for files faster under Windows

* src/lread.c (openp): Use faccessat to check that a file exists
before opening it on Windows (bug#41646).  This speeds up
searching for files.

3 years agoDon't consider obsolete commands for completion in some cases
Stefan Kangas [Thu, 13 May 2021 10:17:53 +0000 (12:17 +0200)]
Don't consider obsolete commands for completion in some cases

* lisp/simple.el (read-extended-command): Exclude obsolete commands
that are either lacking a 'current-name' or were obsoleted in a
previous major version (bug#43300).

(There's been some back and forth here.  Obsolete commands used to be
treated normally for completion, and then they were removed.  Then
they were put back again, but annotated with what they were
obsoleting.  There was some pushback on this change, so this latest
changes is a compromise between the last two states.)

3 years agoUse an explicit line width of 1 on hollow cursors under X
Radon Rosborough [Thu, 13 May 2021 09:40:59 +0000 (11:40 +0200)]
Use an explicit line width of 1 on hollow cursors under X

* src/xterm.c (x_draw_hollow_cursor): Specify a line width of
1 explicitly to avoid problems on some X implementations (bug#42452).

3 years ago; * src/image.c (xpm_format, xpm_valid_color_symbols_p): Fix last change.
Eli Zaretskii [Thu, 13 May 2021 09:33:08 +0000 (12:33 +0300)]
; * src/image.c (xpm_format, xpm_valid_color_symbols_p): Fix last change.

3 years ago* src/image.c (xpm_image_p): Avoid another compiler warning.
Eli Zaretskii [Thu, 13 May 2021 09:23:19 +0000 (12:23 +0300)]
* src/image.c (xpm_image_p): Avoid another compiler warning.

3 years ago* src/image.c: Avoid compiler warnings in Cairo builds without XPM.
Eli Zaretskii [Thu, 13 May 2021 09:17:44 +0000 (12:17 +0300)]
* src/image.c: Avoid compiler warnings in Cairo builds without XPM.

3 years agoFix evaluation order for hack-local-variables
Tom Gillespie [Wed, 12 May 2021 21:31:23 +0000 (23:31 +0200)]
Fix evaluation order for hack-local-variables

* lisp/files.el (hack-local-variables): Fix the ordering which
local variables are evaluated by `hack-local-variables' so that
prop-line local variables are evaluated first. There is a hidden
nreverse lurking in `hack-local-variables-apply' which means that
the prop line variables must come second in order to be evaluated
before the end of file variables.

3 years agoDon't mark interactive commands as internal functions
Philip K [Wed, 12 May 2021 18:00:15 +0000 (20:00 +0200)]
Don't mark interactive commands as internal functions

* lisp/epa-ks.el (epa-ks-search-mode-map): Rename commands from
"--" to "-" throughout.

3 years ago; Rearrange EasyPG entry in etc/NEWS
Michael Albinus [Wed, 12 May 2021 17:50:01 +0000 (19:50 +0200)]
; Rearrange EasyPG entry in etc/NEWS