]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoImprovements to message-syntax-checks docs and options
Eric Abrahamsen [Sat, 13 Mar 2021 22:25:47 +0000 (14:25 -0800)]
Improvements to message-syntax-checks docs and options

* doc/misc/message.texi: Move the manual entry from the "News Headers"
section to the "Message Headers" section, as it is generally
applicable, not just to News.
* lisp/gnus/message.el (message-syntax-checks): Add an explicit alist
type specifying the valid options; point to the manual for more
information.

3 years ago* lisp/textmodes/two-column.el: Address FIXME
Stefan Monnier [Tue, 13 Apr 2021 13:59:23 +0000 (09:59 -0400)]
* lisp/textmodes/two-column.el: Address FIXME

(2C-associate-buffer): Move minibuffer interactive to the `interactive` spec.

3 years ago* lisp/textmodes/paragraphs.el (multiple-lines): Remove mistaken declaration
Stefan Monnier [Tue, 13 Apr 2021 13:47:46 +0000 (09:47 -0400)]
* lisp/textmodes/paragraphs.el (multiple-lines): Remove mistaken declaration

(forward-paragraph): Remove unused var `multiple-lines`.

3 years agoResurrect mouse-highlight of close buttons on tab-bar
Eli Zaretskii [Tue, 13 Apr 2021 13:40:42 +0000 (16:40 +0300)]
Resurrect mouse-highlight of close buttons on tab-bar

* src/w32term.c (w32_draw_image_relief): Support tab-bar drawing
with relief as xterm.c does.

* src/xdisp.c (handle_tab_bar_click): Access the mouse-highlight
info.  Call show_mouse_face to show the button in the pressed or
the released state, according to value of DOWN_P.
(note_tab_bar_highlight): Function added back.
(note_mouse_highlight): Call note_tab_bar_highlight when the mouse
pointer is in the tab-bar window.
(show_mouse_face): Return immediately if mouse_face_window is not
set up in HLINFO.  This avoids rare assertion violations.

3 years ago* lisp/comint.el: Add `font-lock-face` to `rear-nonsticky`
Stefan Monnier [Tue, 13 Apr 2021 02:49:48 +0000 (22:49 -0400)]
* lisp/comint.el: Add `font-lock-face` to `rear-nonsticky`

(comint--prompt-rear-nonsticky): New const.
(comint-send-input, comint-output-filter): Use it.

3 years agoDon't version-control generated file `grammat-wy.el`
Stefan Monnier [Tue, 13 Apr 2021 01:55:50 +0000 (21:55 -0400)]
Don't version-control generated file `grammat-wy.el`

This file is needed for CEDET's bootstrap, tho, so we now keep a copy of it
under version control in `gram-wy-boot.el`, very much like we do with
the `ldefs-boot.el` copy of `loaddefs.el`.

* lisp/cedet/semantic/grm-wy-boot.el: Rename from
`lisp/cedet/semantic/grammar-wy.el`.

* lisp/cedet/semantic/grammar.el: Load `grm-wy-boot.el` if
`grammar-wy.el` hasn't been generated yet.

* admin/update_autogen: Also refresh `grm-wy-boot.el`.

* admin/grammars/Makefile.in (WISENT): Add `grammar-wy.el` to the
generated files.

* .gitignore: Add `grammar-wy.el`.

3 years ago* lisp/minibuffer.el (completion-table-with-quoting): Fix bug#47678
Stefan Monnier [Mon, 12 Apr 2021 23:23:45 +0000 (19:23 -0400)]
* lisp/minibuffer.el (completion-table-with-quoting): Fix bug#47678

3 years ago* lisp/progmodes/verilog-mode.el (vl-memory): Add missing defvar.
Wilson Snyder [Mon, 12 Apr 2021 17:36:05 +0000 (13:36 -0400)]
* lisp/progmodes/verilog-mode.el (vl-memory): Add missing defvar.

3 years ago* lisp/emacs-lisp/smie.el: Fix URL. Remove redundant `:group` args
Stefan Monnier [Mon, 12 Apr 2021 17:01:06 +0000 (13:01 -0400)]
* lisp/emacs-lisp/smie.el: Fix URL.  Remove redundant `:group` args

(smie-indent-forward-token): Improve error message.
(smie--funcall): New function.
(smie-indent-calculate): Use it.

3 years ago* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Simplify
Stefan Monnier [Mon, 12 Apr 2021 16:55:52 +0000 (12:55 -0400)]
* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Simplify

3 years ago* lisp/emacs-lisp/float-sup.el (pi): Actually mark it as obsolete
Stefan Monnier [Mon, 12 Apr 2021 16:53:53 +0000 (12:53 -0400)]
* lisp/emacs-lisp/float-sup.el (pi): Actually mark it as obsolete

3 years ago* lisp/emacs-lisp/edebug.el (edebug--frame): Move docstring where it belongs
Stefan Monnier [Mon, 12 Apr 2021 16:51:28 +0000 (12:51 -0400)]
* lisp/emacs-lisp/edebug.el (edebug--frame): Move docstring where it belongs

3 years ago* lisp/vt-control.el: Avoid `called-interactively-p`
Stefan Monnier [Mon, 12 Apr 2021 16:49:36 +0000 (12:49 -0400)]
* lisp/vt-control.el: Avoid `called-interactively-p`

(vt-keypad-on, vt-keypad-off): Use the `tell` arg instead.
(vt-numlock): Add `tell` arg.

3 years ago* lisp/files.el (file-modes-number-to-symbolic): Add `filetype` arg.
Stefan Monnier [Mon, 12 Apr 2021 16:46:47 +0000 (12:46 -0400)]
* lisp/files.el (file-modes-number-to-symbolic): Add `filetype` arg.

* lisp/tar-mode.el (tar-header-block-summarize): Use it.
(tar-grind-file-mode): Declare obsolete.

3 years ago* lisp/frame.el (delete-other-frames): Add universal prefix `iconify` arg
Stefan Monnier [Mon, 12 Apr 2021 16:32:07 +0000 (12:32 -0400)]
* lisp/frame.el (delete-other-frames): Add universal prefix `iconify` arg

(frame--current-backround-mode): New function,
extracted from `frame-set-background-mode`.  Use `color-dark-p`.
(frame-set-background-mode): Use it.

3 years ago* lisp/repeat.el (repeat-mode-echo): New defcustom.
Juri Linkov [Mon, 12 Apr 2021 16:14:45 +0000 (19:14 +0300)]
* lisp/repeat.el (repeat-mode-echo): New defcustom.

(repeat-post-hook): Use it.
(repeat-mode-message): New function (bug#47566).
(repeat-post-hook): Use real-this-command instead of this-command
to handle e.g. rectangle-exchange-point-and-mark remapped to
exchange-point-and-mark (bug#47688).

3 years ago* lisp/dynamic-setting.el: Add missing footer
Stefan Monnier [Mon, 12 Apr 2021 15:54:10 +0000 (11:54 -0400)]
* lisp/dynamic-setting.el: Add missing footer

3 years ago* lisp/comint.el (comint-strip-ctrl-m): Avoid `called-interactively-p`
Stefan Monnier [Mon, 12 Apr 2021 15:53:25 +0000 (11:53 -0400)]
* lisp/comint.el (comint-strip-ctrl-m): Avoid `called-interactively-p`

3 years ago* lisp/strokes.el (strokes-mode): Fix typo in previous.
Glenn Morris [Mon, 12 Apr 2021 15:08:29 +0000 (08:08 -0700)]
* lisp/strokes.el (strokes-mode): Fix typo in previous.

3 years ago(define-minor-mode): Warn about use of pre-Emacs-21 style args
Stefan Monnier [Mon, 12 Apr 2021 15:08:19 +0000 (11:08 -0400)]
(define-minor-mode): Warn about use of pre-Emacs-21 style args

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
Use `advertised-calling-convention` to avoid promoting the old
style arguments.  Emit a wanring when old-style arguments are used.
Massage the docstring accordingly.
* doc/lispref/modes.texi (Defining Minor Modes): Document the keyword
arguments rather than the old-style positional arguments.

3 years ago* lisp/progmodes/vhdl-mode.el: Add note about XEmacs compatibility
Stefan Monnier [Mon, 12 Apr 2021 14:46:07 +0000 (10:46 -0400)]
* lisp/progmodes/vhdl-mode.el: Add note about XEmacs compatibility

3 years agoAdjust verilog-mode to changes in the completion framework
Lars Ingebrigtsen [Mon, 12 Apr 2021 09:45:33 +0000 (11:45 +0200)]
Adjust verilog-mode to changes in the completion framework

* lisp/progmodes/verilog-mode.el (verilog-func-completion): Don't
bug out on `C-M-i' (which expects no point movement) (bug#47652).
(verilog-declaration-end): There may be no semicolons; don't bug out.

3 years agoFix python-shell-switch-to-shell redisplay bug
Shitikanth Kashyap [Mon, 12 Apr 2021 08:43:42 +0000 (10:43 +0200)]
Fix python-shell-switch-to-shell redisplay bug

* lisp/progmodes/python.el (python-shell-switch-to-shell):
Redisplay the switched-to window faster (bug#47679).

Copyright-paperwork-exempt: yes

3 years agoAdd command in eww to toggle images
Ralph Schleicher [Mon, 12 Apr 2021 08:31:46 +0000 (10:31 +0200)]
Add command in eww to toggle images

* lisp/net/eww.el (eww-toggle-images): New function.
(eww-mode-map): Add key binding and menu entry.
* lisp/net/shr.el (shr-inhibit-images): Make it customizable.
* doc/misc/eww.texi (Basics): Document eww-toggle-images.
Fix index entries for shr-use-fonts and shr-use-colors.
(Advanced): Document shr-inhibit-images
(bug#47705).

3 years agoFix args-out-of-range error in epa-file-insert-file-contents
Junya Takahashi [Mon, 12 Apr 2021 08:14:11 +0000 (10:14 +0200)]
Fix args-out-of-range error in epa-file-insert-file-contents

* lisp/epa-file.el (epa-file-insert-file-contents): Don't bug out
on a region that's longer than the file (bug#47718).

Copyright-paperwork-exempt: yes

3 years ago* lib-src/seccomp-filter.c: Add missing headers.
Philipp Stephani [Mon, 12 Apr 2021 07:20:51 +0000 (09:20 +0200)]
* lib-src/seccomp-filter.c: Add missing headers.

3 years agoGenerate Seccomp filters only if we have the necessary constants.
Philipp Stephani [Mon, 12 Apr 2021 07:15:59 +0000 (09:15 +0200)]
Generate Seccomp filters only if we have the necessary constants.

If we're missing SECCOMP_SET_MODE_FILTER, the seccomp-filter build
fails.  Reuse the existing HAVE_SECCOMP configuration variable, which
checks for these macros.

* configure.ac (HAVE_SECCOMP): Substitute in Makefile.in.
* lib-src/Makefile.in (HAVE_SECCOMP): New variable.
(SECCOMP_FILTER): Define only if HAVE_SECCOMP.

3 years ago* lisp/**/*.el: Avoid positional args to `define-minor-mode`
Stefan Monnier [Mon, 12 Apr 2021 03:47:14 +0000 (23:47 -0400)]
* lisp/**/*.el: Avoid positional args to `define-minor-mode`

Back in Emacs-21.1, `define-minor-mode` grew keywords arguments to
replace its old positional arguments.  Let's make sure we don't use
the old-style any more.

* lisp/org/ox-beamer.el (org-beamer-mode-map): Move initialization
into declaration.
(org-beamer-mode):
* lisp/textmodes/tildify.el (tildify-mode):
* lisp/textmodes/sgml-mode.el (html-autoview-mode):
* lisp/textmodes/rst.el (rst-minor-mode):
* lisp/textmodes/remember.el (remember-notes-mode):
* lisp/textmodes/ispell.el (ispell-minor-mode):
* lisp/tar-mode.el (tar-subfile-mode):
* lisp/strokes.el (strokes-mode):
* lisp/so-long.el (so-long-minor-mode):
* lisp/shell.el (shell-dirtrack-mode):
* lisp/scroll-all.el (scroll-all-mode):
* lisp/ruler-mode.el (ruler-mode):
* lisp/rect.el (rectangle-mark-mode):
* lisp/progmodes/sh-script.el (sh-electric-here-document-mode):
* lisp/outline.el (outline-minor-mode):
* lisp/org/org.el (org-cdlatex-mode):
* lisp/org/org-table.el (org-table-header-line-mode)
(org-table-follow-field-mode, orgtbl-mode):
* lisp/org/org-src.el (org-src-mode):
* lisp/org/org-list.el (org-list-checkbox-radio-mode):
* lisp/org/org-indent.el (org-indent-mode):
* lisp/org/org-capture.el (org-capture-mode):
* lisp/obsolete/pc-select.el (pc-selection-mode):
* lisp/obsolete/iswitchb.el (iswitchb-mode):
* lisp/net/rcirc.el (rcirc-omit-mode, rcirc-multiline-minor-mode)
(rcirc-track-minor-mode):
* lisp/net/goto-addr.el (goto-address-mode, goto-address-prog-mode):
* lisp/image-mode.el (image-minor-mode):
* lisp/ibuf-ext.el (ibuffer-auto-mode):
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode):
* lisp/font-core.el (font-lock-mode):
* lisp/erc/erc.el (define-erc-module):
* lisp/erc/erc-track.el (erc-track-minor-mode):
* lisp/erc/erc-fill.el (erc-fill-mode):
* lisp/epa-mail.el (epa-mail-mode):
* lisp/emacs-lisp/checkdoc.el (checkdoc-minor-mode):
* lisp/dirtrack.el (dirtrack-mode, dirtrack-debug-mode):
* lisp/dired-aux.el (dired-isearch-filenames-mode):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-mode):
* lisp/cedet/semantic/decorate/mode.el (semantic-decoration-mode):
* lisp/autoarg.el (autoarg-mode, autoarg-kp-mode):
* lisp/vc/pcvs.el (cvs-minor-mode):
Avoid old-style positional args to `define-minor-mode`.

3 years ago* lisp/gnus/message.el: Give non-nil defaults for function vars
Stefan Monnier [Mon, 12 Apr 2021 02:55:18 +0000 (22:55 -0400)]
* lisp/gnus/message.el: Give non-nil defaults for function vars

Also prefer #' to quote functions.

(message-send-rename-function, message-reply-to-function)
(message-wide-reply-to-function, message-followup-to-function):
Use a non-nil default value so it can be used with `add-function`.
(message-do-send-housekeeping): Tweak accordingly.
(message-get-reply-headers): Simplify by η-reduction.

3 years ago* lisp/eshell/esh-util.el: Require `seq`
Stefan Monnier [Mon, 12 Apr 2021 02:46:48 +0000 (22:46 -0400)]
* lisp/eshell/esh-util.el: Require `seq`

Also remove redundant `:group` args and tweak comment

3 years ago* lisp/eshell/esh-proc.el (eshell-kill-process-function): Use `remove-hook`
Stefan Monnier [Mon, 12 Apr 2021 02:42:36 +0000 (22:42 -0400)]
* lisp/eshell/esh-proc.el (eshell-kill-process-function): Use `remove-hook`

Also remove redundant `:group` args

3 years ago* lisp/mail/rmailmm.el (rmail-mime): Simplify interactive spec
Stefan Monnier [Mon, 12 Apr 2021 02:38:34 +0000 (22:38 -0400)]
* lisp/mail/rmailmm.el (rmail-mime): Simplify interactive spec

3 years ago* lisp/progmodes/sql.el (sql-mode-ansi-font-lock-keywords): Fix declaration
Stefan Monnier [Mon, 12 Apr 2021 02:34:58 +0000 (22:34 -0400)]
* lisp/progmodes/sql.el (sql-mode-ansi-font-lock-keywords): Fix declaration

3 years ago* lisp/vc/log-edit.el (log-edit-diff-function): Give non-nil default
Stefan Monnier [Mon, 12 Apr 2021 02:27:25 +0000 (22:27 -0400)]
* lisp/vc/log-edit.el (log-edit-diff-function): Give non-nil default

(log-edit-show-diff): Simplify accordingly.

3 years ago* lisp/progmodes/bug-reference.el: Avoid old-style `define-minor-mode`
Stefan Monnier [Sun, 11 Apr 2021 22:02:34 +0000 (18:02 -0400)]
* lisp/progmodes/bug-reference.el: Avoid old-style `define-minor-mode`

(bug-reference-mode, bug-reference-prog-mode): Remove redundant args.

3 years ago* src/emacs.c (load_seccomp): Consistently check for nonzero result
Philipp Stephani [Mon, 14 Dec 2020 20:25:11 +0000 (21:25 +0100)]
* src/emacs.c (load_seccomp): Consistently check for nonzero result

3 years agoAdd a variant of the Seccomp filter file that allows 'execve'.
Philipp Stephani [Sun, 11 Apr 2021 17:47:36 +0000 (19:47 +0200)]
Add a variant of the Seccomp filter file that allows 'execve'.

This is useful when starting Emacs with a Seccomp filter enabled,
e.g. using 'bwrap'.

* lib-src/seccomp-filter.c (main): Generate new Seccomp files.

* lib-src/Makefile.in (all)
(seccomp-filter.bpf seccomp-filter.pfc seccomp-filter-exec.bpf
seccomp-filter-exec.pfc): Generate new Seccomp files.

* .gitignore: Ignore new Seccomp files.

* test/src/emacs-tests.el (emacs-tests/bwrap/allows-stdout): New unit
test.

3 years ago* lib-src/seccomp-filter.c (main): Also allow O_NOFOLLOW.
Philipp Stephani [Sun, 11 Apr 2021 19:14:09 +0000 (21:14 +0200)]
* lib-src/seccomp-filter.c (main): Also allow O_NOFOLLOW.

3 years agoDon't attempt to generate Seccomp filter file in Linux < 4.14.
Philipp Stephani [Sun, 11 Apr 2021 17:35:39 +0000 (19:35 +0200)]
Don't attempt to generate Seccomp filter file in Linux < 4.14.

Only Linux 4.14 and later contain the required support for
SECCOMP_RET_KILL_PROCESS.

* lib-src/Makefile.in (SECCOMP_FILTER): Define only if we run at least
Linux 4.14.

3 years agoSeccomp filter: allow reading the current time (Bug#47708).
Philipp Stephani [Sun, 11 Apr 2021 17:42:44 +0000 (19:42 +0200)]
Seccomp filter: allow reading the current time (Bug#47708).

* lib-src/seccomp-filter.c (main): Allow reading the current time.

3 years agoFix check for timer_getoverrun
Andreas Schwab [Sun, 11 Apr 2021 15:23:22 +0000 (17:23 +0200)]
Fix check for timer_getoverrun

* configure.ac (timer_getoverrun): Move check after gnulib checks
and use $LIB_TIMER_TIME during check.

3 years agoUse pkg-config to check for libseccomp.
Philipp Stephani [Sun, 11 Apr 2021 14:50:29 +0000 (16:50 +0200)]
Use pkg-config to check for libseccomp.

We need at list version 2.4.0 of libseccomp for seccomp-filter.c to
build cleanly.

* configure.ac: Use pkg-config to check for libseccomp.
* lib-src/Makefile.in (HAVE_LIBSECCOMP, LIBSECCOMP_LIBS)
(LIBSECCOMP_CFLAGS): New variables.
(SECCOMP_FILTER, seccomp-filter$(EXEEXT)): Use them.

3 years agoRemove SCMP_FLTATR_CTL_LOG attribute from Seccomp filter.
Philipp Stephani [Sun, 11 Apr 2021 14:41:44 +0000 (16:41 +0200)]
Remove SCMP_FLTATR_CTL_LOG attribute from Seccomp filter.

Whether or not we log failing syscalls isn't security-critical, and we
shouldn't care.

* lib-src/seccomp-filter.c (main): Remove log attribute.

3 years agoOnly attempt to generate seccomp filter files on x86-64 systems.
Philipp Stephani [Sun, 11 Apr 2021 14:22:54 +0000 (16:22 +0200)]
Only attempt to generate seccomp filter files on x86-64 systems.

The seccomp filters are always architecture-specific, and
seccomp-filter.c right now only supports x86-64.

* lib-src/Makefile.in (SECCOMP_FILTER): New variable.
(DONT_INSTALL, all, seccomp-filter$(EXEEXT)): Use it.

3 years ago; * etc/NEWS: Minor copyedits.
Eli Zaretskii [Sun, 11 Apr 2021 14:04:07 +0000 (17:04 +0300)]
; * etc/NEWS: Minor copyedits.

3 years ago* lib-src/seccomp-filter.c: Print trailing newline.
Philipp Stephani [Sun, 11 Apr 2021 14:02:05 +0000 (16:02 +0200)]
* lib-src/seccomp-filter.c: Print trailing newline.

3 years ago* doc/lispref/elisp.texi (Top): Add missing entry.
Stefan Kangas [Sun, 11 Apr 2021 12:14:42 +0000 (14:14 +0200)]
* doc/lispref/elisp.texi (Top): Add missing entry.

3 years agoFix calculator-string-to-number yet again (bug#47694)
Eli Barzilay [Sat, 10 Apr 2021 19:10:35 +0000 (15:10 -0400)]
Fix calculator-string-to-number yet again (bug#47694)

* lisp/calculator.el (calculator-string-to-number):
The last bugfix changed the code to just blindly replace ".e".  This
has some minor problems like making "-." parse as 0.0 instead of -0.0,
and ".1.e1" is parsed as 1 instead of 0.1.  Instead, replace the first
"." that is followed by a non-digit with ".0".  Since this has had
several problems over the years, add some tests too.  (Also, restore
the original if-indentation style.)

3 years agoFix typo in cconv
Mattias Engdegård [Sun, 11 Apr 2021 10:38:37 +0000 (12:38 +0200)]
Fix typo in cconv

* lisp/emacs-lisp/cconv.el (cconv-convert): Typo.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.

3 years agoAdd another check for the required header <linux/filter.h>.
Philipp Stephani [Sun, 11 Apr 2021 10:26:13 +0000 (12:26 +0200)]
Add another check for the required header <linux/filter.h>.

* configure.ac: Also check for <linux/filter.h>.
* src/emacs.c (SECCOMP_USABLE): Also check for <linux/filter.h>.

3 years agoAlso check for needed seccomp macros.
Philipp Stephani [Sun, 11 Apr 2021 10:00:35 +0000 (12:00 +0200)]
Also check for needed seccomp macros.

It looks like these are not available on some versions of GNU/Linux,
breaking the build.

* configure.ac: Also check for needed seccomp macros.
* src/emacs.c (SECCOMP_USABLE): New macro.
(usage_message, main, standard_args): Use it.

3 years agoFix handling of mouse clicks on tab-bar buttons
Eli Zaretskii [Sun, 11 Apr 2021 09:12:45 +0000 (12:12 +0300)]
Fix handling of mouse clicks on tab-bar buttons

* src/xdisp.c (note_mouse_highlight): Don't attempt to highlight
tab-bar buttons.
(note_tab_bar_highlight): Function deleted: it had no effect on
display of tab-bar buttons.
(tab_bar_item_info): Mention all arguments in the commentary.
(get_tab_bar_item): Don't pay attention to mouse-highlight
information; instead, compare the button's index with the one
recorded in f->last_tab_bar_item.
(handle_tab_bar_click): Don't attempt to show tab-bar buttons in
pressed or released state: that isn't supported.  Determine
whether to generate a tab-bar button click based on DOWN_P
argument, not on mouse-highlight, which has no effect on tab-bar
display.  (Bug#47581)

3 years ago; * lisp/net/shr.el (shr-insert-document): Fix last change.
Eli Zaretskii [Sun, 11 Apr 2021 06:35:09 +0000 (09:35 +0300)]
; * lisp/net/shr.el (shr-insert-document): Fix last change.

3 years ago* lisp/net/shr.el (shr-insert-document): Explain why bidi-display-reordering
Stefan Monnier [Sun, 11 Apr 2021 00:06:21 +0000 (20:06 -0400)]
* lisp/net/shr.el (shr-insert-document): Explain why bidi-display-reordering

3 years agoAdd new icomplete-vertical-mode
Gregory Heytings [Sat, 10 Apr 2021 10:47:45 +0000 (11:47 +0100)]
Add new icomplete-vertical-mode

Co-authored-by: João Távora <joaotavora@gmail.com>
* lisp/icomplete.el (icomplete-completions): Consider icomplete-vertical-mode.
(icomplete-vertical-mode-minibuffer-map): New map.
(icomplete--vertical-minibuffer-setup): New helper.
(icomplete-vertical-mode): New minor mode.

* doc/emacs/buffers.texi (Icomplete): Mention icomplete-vertical-mode.

* etc/NEWS: Mention icomplete-vertical-mode

3 years ago* lisp/misearch.el (multi-isearch-read-buffers): Fix last change
Stefan Monnier [Sat, 10 Apr 2021 22:07:37 +0000 (18:07 -0400)]
* lisp/misearch.el (multi-isearch-read-buffers): Fix last change

These are not buffers but buffer names.

3 years ago* src/emacs.c (read_full): Add a few assertions.
Philipp Stephani [Mon, 14 Dec 2020 20:25:11 +0000 (21:25 +0100)]
* src/emacs.c (read_full): Add a few assertions.

3 years ago* lisp/cus-dep.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 21:11:58 +0000 (17:11 -0400)]
* lisp/cus-dep.el: Use lexical-binding

3 years ago* lisp/misearch.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 21:07:58 +0000 (17:07 -0400)]
* lisp/misearch.el: Use lexical-binding

(multi-isearch-read-buffers, multi-isearch-read-files):
Replace `add-to-list` with `cl-pushnew` for use on a local variable.

3 years ago* src/emacs.c (load_seccomp): Add a useful assertion.
Philipp Stephani [Sat, 10 Apr 2021 19:21:08 +0000 (21:21 +0200)]
* src/emacs.c (load_seccomp): Add a useful assertion.

3 years ago* src/emacs.c (load_seccomp): Fix condition.
Philipp Stephani [Sat, 10 Apr 2021 19:19:50 +0000 (21:19 +0200)]
* src/emacs.c (load_seccomp): Fix condition.

3 years ago* lisp/ps-bdf.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 21:03:11 +0000 (17:03 -0400)]
* lisp/ps-bdf.el: Use lexical-binding

3 years ago* lisp/informat.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 21:01:01 +0000 (17:01 -0400)]
* lisp/informat.el: Use lexical-binding

3 years ago* lisp/loadup.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 20:58:11 +0000 (16:58 -0400)]
* lisp/loadup.el: Use lexical-binding

3 years ago* lisp/jka-compr.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 20:25:28 +0000 (16:25 -0400)]
* lisp/jka-compr.el: Use lexical-binding

Prefer #' to quote function names.

3 years ago* etc/NEWS: Extend paragraph about &define form and backtracking
Philipp Stephani [Sat, 10 Apr 2021 19:54:12 +0000 (21:54 +0200)]
* etc/NEWS: Extend paragraph about &define form and backtracking

3 years ago; Fix copyright years
Glenn Morris [Sat, 10 Apr 2021 19:24:09 +0000 (12:24 -0700)]
; Fix copyright years

3 years agoConvert CC Mode to lexical binding in Emacs
Alan Mackenzie [Sat, 10 Apr 2021 19:18:28 +0000 (19:18 +0000)]
Convert CC Mode to lexical binding in Emacs

lisp/progmodes/cc-align.el, lisp/progmodes/cc-awk.el,
lisp/progmodes/cc-bytecomp.el, lisp/progmodes/cc-cmds.el,
lisp/progmodes/cc-defs.el, lisp/progmodes/cc-engine.el,
lisp/progmodes/cc-fonts.el, lisp/progmodes/cc-guess.el,
lisp/progmodes/cc-langs.el, lisp/progmodes/cc-menus.el,
lisp/progmodes/cc-mode.el, lisp/progmodes/cc-styles.el,
lisp/progmodes/cc-subword.el, lisp/progmodes/cc-vars.el: Mark these files with
a `lexical-binding' setting in line 1.

lisp/progmodes/cc-align.el, lisp/progmodes/cc-engine.el,
lisp/progmodes/cc-vars.el (c-syntactic-context, c-syntactic-element): Declare
these as special variables.

lisp/progmodes/cc-bytecomp.el (cc-bytecomp-debug-msg): prefix the parameter
ARGS with a _, and remove an `ignore' call.

lisp/progmodes/cc-cmds.el (c-where-wrt-brace-construct): Remove `kluge-start',
an unused variable.
(c-while-widening-to-decl-block): Add an extra parameter, which suppresses
the generation of a setting of variable `where'.
(c-defun-name-and-limits): Remove variable `where' from the function and use
the new argument to the previous macro.

lisp/progmodes/cc-engine.el (c-cache-to-parse-ps-state): Remove two unneeded
variables, `last' and `intermediate'.

lisp/progmodes/cc-fonts.el (c-font-lock-c++-using): Remove unused variable.

lisp/progmodes/cc-langs.el (c-vsemi-status-unknown-p-fn): Replace the doc
string with the more precise one from stand-alone CC Mode.

lisp/progmodes/cc-styles.el (c-set-offset): Give the `ignored' parameter a
leading _.

3 years agoAdd a helper binary to create a basic Secure Computing filter.
Philipp Stephani [Thu, 17 Dec 2020 10:20:55 +0000 (11:20 +0100)]
Add a helper binary to create a basic Secure Computing filter.

The binary uses the 'seccomp' helper library.  The library isn't
needed to load the generated Secure Computing filter.

* configure.ac: Check for 'seccomp' header and library.

* lib-src/seccomp-filter.c: New helper binary to generate a generic
Secure Computing filter for GNU/Linux.

* lib-src/Makefile.in (DONT_INSTALL): Add 'seccomp-filter' helper
binary if possible.
(all): Add Secure Computing filter file if possible.
(seccomp-filter$(EXEEXT)): Compile helper binary.
(seccomp-filter.bpf seccomp-filter.pfc): Generate filter files.

* test/src/emacs-tests.el (emacs-tests/seccomp/allows-stdout)
(emacs-tests/seccomp/forbids-subprocess): New unit tests.

* test/Makefile.in (src/emacs-tests.log): Add dependency on the helper
binary.

3 years ago* src/emacs.c (load_seccomp): Fix condition.
Philipp Stephani [Sat, 10 Apr 2021 18:35:06 +0000 (20:35 +0200)]
* src/emacs.c (load_seccomp): Fix condition.

3 years agoRead file in a loop if necessary.
Philipp Stephani [Mon, 14 Dec 2020 20:25:11 +0000 (21:25 +0100)]
Read file in a loop if necessary.

This allows for short reads from 'emacs_read'.

* src/emacs.c (read_full): New helper function.
(load_seccomp): Use it.

3 years ago; * etc/NEWS: Fix the wording of a recently added entry.
Eli Zaretskii [Sat, 10 Apr 2021 18:17:09 +0000 (21:17 +0300)]
; * etc/NEWS: Fix the wording of a recently added entry.

3 years agoAdd support for --seccomp command-line option.
Philipp Stephani [Mon, 14 Dec 2020 20:25:11 +0000 (21:25 +0100)]
Add support for --seccomp command-line option.

When passing this option on GNU/Linux, Emacs installs a Secure
Computing kernel system call filter.  See Bug#45198.

* configure.ac: Check for seccomp header.

* src/emacs.c (usage_message): Document --seccomp option.
(emacs_seccomp): New wrapper for 'seccomp' syscall.
(load_seccomp, maybe_load_seccomp): New helper functions.
(main): Potentially load seccomp filters during startup.
(standard_args): Add --seccomp option.

* lisp/startup.el (command-line): Detect and ignore --seccomp option.

* test/src/emacs-tests.el (emacs-tests/seccomp/absent-file)
(emacs-tests/seccomp/empty-file)
(emacs-tests/seccomp/file-too-large)
(emacs-tests/seccomp/invalid-file-size): New unit tests.
(emacs-tests--with-temp-file): New helper macro.

* etc/NEWS: Document new --seccomp option.

3 years agoEdebug: Disable backtracking when hitting a &define keyword.
Philipp Stephani [Thu, 18 Mar 2021 11:40:08 +0000 (12:40 +0100)]
Edebug: Disable backtracking when hitting a &define keyword.

Edebug doesn't deal well with backtracking out of definitions, see
Bug#41988.  Rather than trying to support this rare situation (e.g. by
implementing a multipass parser), prevent it by adding an implicit
gate.

* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Disable
backtracking when hitting a &define keyword.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests-duplicate-&define): New unit test.
(edebug-tests--duplicate-&define): New helper macro.

* doc/lispref/edebug.texi (Backtracking): Mention &define in the list
of constructs that disable backtracking.

* etc/NEWS: Document new behavior.

3 years ago* lisp/gnus/nnagent.el: Fix spurious empty line at BOB
Stefan Monnier [Sat, 10 Apr 2021 16:19:16 +0000 (12:19 -0400)]
* lisp/gnus/nnagent.el: Fix spurious empty line at BOB

3 years ago* lisp/edmacro.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 16:18:22 +0000 (12:18 -0400)]
* lisp/edmacro.el: Use lexical-binding

(edmacro-finish-edit, edmacro-parse-keys): Use `match-string`.

3 years ago* lisp/files-x.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 16:08:36 +0000 (12:08 -0400)]
* lisp/files-x.el: Use lexical-binding

3 years ago* lisp/ps-mule.el: Use lexical-binding
Stefan Monnier [Sat, 10 Apr 2021 13:52:09 +0000 (09:52 -0400)]
* lisp/ps-mule.el: Use lexical-binding

(ps-mule-encode-header-string, ps-mule-begin-job): Use `pcase`.

3 years agoAutoload list-colors-display.
Gregory Heytings [Sat, 10 Apr 2021 12:35:06 +0000 (12:35 +0000)]
Autoload list-colors-display.

* lisp/facemenu.el (list-colors-display): Autoload, it is mentioned
in (info "(emacs)Colors for Faces"), and to be generally available.

3 years agoTramp: fix location of files on W32
Michael Albinus [Sat, 10 Apr 2021 12:46:58 +0000 (14:46 +0200)]
Tramp: fix location of files on W32

* lisp/net/tramp.el:
* lisp/net/tramp-sh.el: Use (eq system-type 'windows-nt) where appropriate.
(tramp-completion-function-alist-ssh): Fix location of files on W32.

3 years agoFurther fix of hostname completion on MS Windows
Jim Porter [Sat, 10 Apr 2021 11:16:13 +0000 (13:16 +0200)]
Further fix of hostname completion on MS Windows

* lisp/net/tramp.el (tramp-completion-file-name-regexp-simplified)
(tramp-completion-file-name-regexp-separate): Fix W32 hostname/method
completion for simplified and separate syntaxes (same as the previous change
to default syntax).

Copyright-paperwork-exempt: yes

3 years agoFail earlier if stale Flymake report functions called
João Távora [Sat, 10 Apr 2021 10:19:26 +0000 (11:19 +0100)]
Fail earlier if stale Flymake report functions called

If a Flymake backend calls a "stale" report function,
flymake--handle-report might be called for a backend function that is
no longer in the flymake--backend-state hash table.  This patch makes
that erroneous situation slightly more explicit.

* lisp/progmodes/flymake.el (flymake--handle-report): Improve
error reporting.

3 years agoDon't stop when before space or closing paren
Dmitry Gutov [Fri, 9 Apr 2021 22:51:39 +0000 (01:51 +0300)]
Don't stop when before space or closing paren

* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Don't stop when before space or closing paren (bug#47665).

3 years agoCC Mode: fix c-where-wrt-brace-construct to cope with class declarations
Alan Mackenzie [Fri, 9 Apr 2021 20:52:49 +0000 (20:52 +0000)]
CC Mode: fix c-where-wrt-brace-construct to cope with class declarations

Make the function correctly recognize a brace block preceded by an
introductory line without a parameter list.

* lisp/progmodes/cc-cmds.el (c-where-wrt-brace-contruct): Reintroduce the use
of c-beginning-of-decl-1, which was removed some weeks ago, in place of a
c-syntactic-skip-backward.  Reformulate the code generally.

3 years agoFix condition-case optimiser bug
Mattias Engdegård [Fri, 9 Apr 2021 16:59:09 +0000 (18:59 +0200)]
Fix condition-case optimiser bug

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't
perform incorrect optimisations when a condition-case variable shadows
another lexical variable.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
New test case.

3 years agoBetter compiler warning tests
Mattias Engdegård [Fri, 9 Apr 2021 16:49:16 +0000 (18:49 +0200)]
Better compiler warning tests

These changes allow all bytecomp-tests to be run interactively.

* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--with-warning-test)
(bytecomp--define-warning-file-test): Interpret any space in the
pattern as arbitrary whitespace to tolerate line breaks.
Don't abuse the expected-failure mechanism when checking
for the expected absense of a warning.
(bytecomp/*.el): Rewrite patterns to work with line breaks
in the middle.

3 years agoClean up bytecomp-tests.el
Mattias Engdegård [Fri, 9 Apr 2021 16:42:12 +0000 (18:42 +0200)]
Clean up bytecomp-tests.el

Now all test cases are run with both lexical and dynamic binding
where applicable, comparing interpreted against compiled results.
Previously, almost all tests were only run with dynamic binding
which was definitely not intended.

* test/lisp/emacs-lisp/bytecomp-tests.el
(byte-opt-testsuite-arith-data): Rename to bytecomp-tests--test-cases.
(bytecomp-check-1, bytecomp-explain-1, bytecomp-tests)
(bytecomp-lexbind-tests, bytecomp-lexbind-check-1)
(bytecomp-lexbind-explain-1): Remove.
(bytecomp-tests--eval-interpreted, bytecomp-tests--eval-compiled)
(bytecomp-tests-lexbind, bytecomp-tests-dynbind)
(bytecomp-tests--test-cases-lexbind-only): New.

3 years agoMake refer-every into obsolete alias for seq-every-p
Stefan Kangas [Fri, 9 Apr 2021 16:42:14 +0000 (18:42 +0200)]
Make refer-every into obsolete alias for seq-every-p

* lisp/textmodes/refer.el (refer-every): Make into obsolete
function alias for seq-every-p.  Update single caller.

3 years agoRemove redundant #' before lambda in ibuf-*.el
Stefan Kangas [Thu, 8 Apr 2021 22:14:12 +0000 (00:14 +0200)]
Remove redundant #' before lambda in ibuf-*.el

* lisp/ibuf-ext.el (ibuffer-included-in-filters-p)
(ibuffer-included-in-filter-p-1, ibuffer-do-kill-lines)
(ibuffer-jump-to-buffer, ibuffer-mark-on-buffer)
(ibuffer-mark-by-name-regexp, ibuffer-mark-by-mode-regexp)
(ibuffer-mark-by-content-regexp, ibuffer-mark-by-mode)
(ibuffer-mark-modified-buffers, ibuffer-mark-unsaved-buffers)
(ibuffer-mark-dissociated-buffers, ibuffer-mark-help-buffers)
(ibuffer-mark-compressed-file-buffers, ibuffer-mark-old-buffers)
(ibuffer-mark-special-buffers, ibuffer-mark-read-only-buffers)
(ibuffer-mark-dired-buffers, ibuffer-do-occur):
* lisp/ibuf-macs.el (ibuffer-save-marks, define-ibuffer-sorter)
(define-ibuffer-op): Remove redundant #' before lambda.

3 years agoDon't preserve window-line in tabulated-list-print
Stefan Kangas [Fri, 9 Apr 2021 16:25:08 +0000 (18:25 +0200)]
Don't preserve window-line in tabulated-list-print

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Don't
try to preserve window-line.  (Bug#42747)

3 years agoUse lexical-binding in winner.el
Stefan Kangas [Fri, 9 Apr 2021 14:16:42 +0000 (16:16 +0200)]
Use lexical-binding in winner.el

* lisp/winner.el: Use lexical-binding.  Remove redundant :group
args.
(winner-set, winner-mode-map): Quote function symbols as such.

3 years agoMerge branch 'vhdl-mode-lexbind' into trunk
Stefan Monnier [Fri, 9 Apr 2021 14:26:42 +0000 (10:26 -0400)]
Merge branch 'vhdl-mode-lexbind' into trunk

3 years agoUse lexical-binding in cmuscheme.el
Stefan Kangas [Fri, 9 Apr 2021 14:12:35 +0000 (16:12 +0200)]
Use lexical-binding in cmuscheme.el

* lisp/cmuscheme.el: Use lexical-binding.  Doc fixes.  Remove
redundant :group args.  Quote function symbols as such.

3 years ago* lisp/progmodes/cmacexp.el: Use lexical-binding.
Stefan Kangas [Fri, 9 Apr 2021 13:06:32 +0000 (15:06 +0200)]
* lisp/progmodes/cmacexp.el: Use lexical-binding.

3 years agoUse lexical-binding in foldout.el
Stefan Kangas [Fri, 9 Apr 2021 12:54:04 +0000 (14:54 +0200)]
Use lexical-binding in foldout.el

* lisp/foldout.el: Use lexical-binding.  Doc and formatting fixes.
Quote function symbols as such.

3 years agoUse lexical-binding in loadhist.el and add tests
Stefan Kangas [Fri, 9 Apr 2021 11:44:44 +0000 (13:44 +0200)]
Use lexical-binding in loadhist.el and add tests

* lisp/loadhist.el: Use lexical-binding.
* test/lisp/loadhist-tests.el: New file.

3 years agoSelf-TCO in `condition-case` error handlers
Mattias Engdegård [Thu, 8 Apr 2021 20:48:02 +0000 (22:48 +0200)]
Self-TCO in `condition-case` error handlers

* lisp/emacs-lisp/cl-macs.el (cl--self-tco): Recognise
`condition-case` handlers as being in the tail position.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels):
Extend test.

3 years agoFix hostname completion on MS Windows
Jim Porter [Fri, 9 Apr 2021 07:57:06 +0000 (09:57 +0200)]
Fix hostname completion on MS Windows

* lisp/net/tramp.el (tramp-completion-file-name-regexp-default):
Handle volume letter being added to paths for file name completion on W32
systems.  This fixes hostname (and method) autocomplete on W32.

Copyright-paperwork-exempt: yes

3 years ago* test/lisp/shadowfile-tests.el: Fix recent test failures
Stefan Monnier [Fri, 9 Apr 2021 02:55:04 +0000 (22:55 -0400)]
* test/lisp/shadowfile-tests.el: Fix recent test failures

(shadow--tests-cleanup): `shadow-hashtable` is now a hash table (duh!).

3 years ago* lisp/progmodes/vhdl-mode.el: Use lexical-binding
Stefan Monnier [Thu, 25 Mar 2021 02:59:52 +0000 (22:59 -0400)]
* lisp/progmodes/vhdl-mode.el: Use lexical-binding

Use #' to quote function names to get better compiler diagnostics.
Wrap some lines to avoid arguments "hidden" in positions that are easy
to misread.
Prefix unused arguments with a semi-colon to silence compiler warnings.
Fix a few comments that used ;;; even though they were not headings.

(vhdl-emacs-21): Delete variable.
Replace all uses with (not (featurep 'xemacs)) instead since `vhdl-mode`
has been incompatible with Emacs<21 for more than 10 years already.
(vhdl-prepare-search-1): Add Edebug declaration.
(vhdl-prepare-search-2): Add Edebug declaration and use
`with-syntax-table`.
(vhdl-visit-file): Add Edebug and indentation declaration.
Move the bulk of the code to a function for easier debugging.
(vhdl--visit-file): New function extracted from `vhdl-visit-file`.
Be careful not to modify syntax tables in unrelated buffers.
(vhdl-speedbar-refresh): Remove unused var `pos`.
(vhdl-backward-sexp): Remove unused var `last-forward`.
(vhdl-electric-tab, vhdl-minibuffer-tab, vhdl-line-expand):
Rename arg to avoid conflict with the `prefix-arg`
global variable.
(vhdl-align-region-1): Remove unused var `indent`.
(vhdl-character-to-event): Actually give a body to that poor function.
(vhdl-template-context): Remove unused vars `entity-exists` and `string`.
(vhdl-template-group): Remove unused var `start`.
(vhdl-template-argument-list): Remove unused var `start`.
(vhdl-port-paste-context-clause): Remove unused var `margin`.
(vhdl-port-paste-testbench): Remove unused var `source-buffer`.
(vhdl-hs-minor-mode): Declare function `hs-hide-all`.
(vhdl-get-hierarchy): Rename arguments `ent-alist`, `conf-alist`, and
`conf-key` and bind those dynamically scoped var via `let` instead
since arguments can't be dynamically scoped.
(vhdl-speedbar-insert-hierarchy, vhdl-compose-configuration-architecture):
Same thing with arguments `ent-alist` and `conf-alist`.
(vhdl-cache-version): Declare variable.
(speedbar-expand-line, speedbar-edit-line): Declare functions.
(vhdl-speedbar-update-current-unit): Declare before first use.
(vhdl-compose-new-component): Remove unused var `project`.
(lazy-lock-minimum-size): Declare variable.
(vhdl-submit-bug-report): Declare variable `reporter-prompt-for-summary-p`.