Allow :filter t in make-process to work as with set-process-filter
* src/process.c (create_process):
(create_pty):
(Fmake_pipe_process):
(Fmake_serial_process): Don't add the read_fd if the filter is t
(which means that we don't accept output from the filter).
* lisp/vc/pcvs-defs.el (cvs-mode-diff-map):
* lisp/vc/pcvs.el (pcvs-defs):
(cvs-mode-diff-map): Move maps to pcvs (because the commands are
defined in pcvs.el and #' gives us checking) and transform from
easy-mmode-defmap to define-keymap.
* doc/lispref/keymaps.texi (Key Sequences):
(Changing Key Bindings): Document the various key syntaxes.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-define-key)
(byte-optimize-define-keymap)
(byte-optimize-define-keymap--define): New functions to check and
expand ["..."] syntax at compile time.
Po Lu [Thu, 14 Oct 2021 10:38:26 +0000 (18:38 +0800)]
Fix minor issues with text display when cursor is in mouse face
* src/xdisp.c (get_cursor_offset_for_mouse_face): Don't calculate
offsets for the glyph the cursor is on, and move some logic to
get_glyph_pixel_width_delta_for_mouse_face.
(fill_composite_glyph_string)
(fill_gstring_glyph_string)
(fill_glyphless_glyph_string)
(fill_glyph_string)
(fill_image_glyph_string)
(fill_xwidget_glyph_string)
(fill_stretch_glyph_string): Set s->face to mouse face whenever
appropriate.
(get_glyph_pixel_width_delta_for_mouse_face): New function.
(set_glyph_string_background_width): Update background width and
s->width to take into account differing :box properties of the mouse
face, when producing strings for the cursor.
(erase_phys_cursor): Redraw mouse face when erasing a cursor on top of
the mouse face.
* src/xterm.c (x_set_mouse_face_gc): Stop setting s->face when under
mouse face because redisplay now does that for us.
* src/w32term.c (w32_set_mouse_face_gc): Likewise.
Glenn Morris [Sat, 16 Oct 2021 16:18:37 +0000 (09:18 -0700)]
Merge from origin/emacs-28
e8488808df Avoid aborts when a thread is signaled while "waiting for ... 21397cce51 Improve documentation string for 'compilation-error-regexp... 2971a6890f * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix t... e842d7f29a Fix removal of fringe indication of bookmarks b5a0eda978 Prefer "graphical displays" to "X terminals" in documentation 4ad0fc0dd0 Precise documentation of file-notify-add-watch f5b8df14c6 Fixes to account for windows' tab lines ced72b6e4c * Fix `native-compile-target-directory' effectiveness on t... 502788bc3d Add missing single quotes in the Emacs manual 1af45ad04e ; * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix... 12654b7423 * lisp/menu-bar.el (yank-menu-length): Fix docstring (bug#...
* test/infra/gitlab-ci.yml (variables): Set default value of
EMACS_TEST_TIMEOUT.
(.job-template): Propagate EMACS_TEST_TIMEOUT and EMACS_TEST_VERBOSE.
(test-all-inotify): Set specific EMACS_TEST_TIMEOUT.
Stefan Kangas [Wed, 13 Oct 2021 20:54:47 +0000 (22:54 +0200)]
Remove duplicate code in edmacro-parse-keys
* lisp/subr.el (kbd): Add argument NEED-VECTOR and make it suitable
for calling from 'edmacro-parse-keys'.
* lisp/edmacro.el (edmacro-parse-keys): Replace definition with a
call to 'kbd'.
This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-10/msg00909.html
Stefan Kangas [Tue, 12 Oct 2021 23:40:14 +0000 (01:40 +0200)]
Make kbd usable during bootstrap
* lisp/subr.el (kbd): Make 'kbd' usable during bootstrap by copying
the definition of 'read-kbd-macro' into it, and adjusting it to no
longer use CL-Lib functions.
This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-10/msg00909.html
* lisp/filenotify.el (file-notify-rm-all-watches): New defun.
* test/lisp/filenotify-tests.el (file-notify--test-cleanup):
Use `file-notify-rm-all-watches'.
(file-notify-test02-rm-watch): Test also `file-notify-rm-all-watches'.
Eli Zaretskii [Sat, 16 Oct 2021 11:47:32 +0000 (14:47 +0300)]
Avoid aborts when a thread is signaled while "waiting for input".
* src/process.c (kbd_is_ours): New function.
(wait_reading_process_output): Set 'waiting_for_input' only if the
current thread is monitoring the keyboard descriptor. See also
https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01180.html.
(Bug#51229)
Stefan Kangas [Fri, 15 Oct 2021 18:22:11 +0000 (20:22 +0200)]
Prefer "graphical displays" to "X terminals" in documentation
* doc/lispref/objects.texi (Ctl-Char Syntax): Fix incorrect remark;
some text terminals can generate ASCII control characters.
(Other Char Bits):
* lisp/bindings.el:
* lisp/gnus/gnus-undo.el (gnus-undo-mode-map): Say "graphical display"
and "GUI display" instead of "X terminal"; the latter term is
archaic. (Bug#51217)
Michael Albinus [Fri, 15 Oct 2021 14:29:11 +0000 (16:29 +0200)]
Precise documentation of file-notify-add-watch
* doc/lispref/os.texi (File Notifications):
* lisp/filenotify.el (file-notify-add-watch): Precise, that
watching a directory includes reports on file changes for some
backends. (Bug#51146)
* lisp/net/eww.el (eww-auto-rename-buffer, eww-buffer-name-length):
Add new user options.
(eww--rename-buffer): Introduce new function that performs the
renaming of buffers.
(eww--after-page-change): Add new wrapper function which calls
'eww-update-header-line-format' and 'eww--rename-buffer'.
(eww, eww-render, eww-tag-title, eww-readable, eww-restore-history):
Include eww--after-page-change.
Dmitry Gutov [Fri, 15 Oct 2021 12:02:23 +0000 (15:02 +0300)]
Special-case the "Permission denied" messages
* lisp/progmodes/project.el (project--files-in-directory):
Special-case the "Permission denied" messages, to make sure the
user sees the unreadable directory's name
(https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01015.html).
Martin Rudalics [Fri, 15 Oct 2021 08:28:15 +0000 (10:28 +0200)]
Simplify functions dealing with preserving the size of windows
* lisp/window.el (window--preservable-size): Remove function.
(window-preserve-size, window-preserved-size)
(window--preserve-size): Simplify. Use 'window-body-height'
etc. instead of 'window--preservable-size'.
Martin Rudalics [Fri, 15 Oct 2021 08:21:05 +0000 (10:21 +0200)]
Fixes to account for windows' tab lines
* doc/lispref/display.texi (Size of Displayed Text): Fix entry
on 'window-text-pixel-size'.
* lisp/window.el (window--dump-window): Dump tab-line-height and
scroll-bar-height too.
(window--min-size-1): Take 'window-tab-line-height' into account.
* src/xdisp.c (Fwindow_text_pixel_size): Fix doc-string of
'window-text-pixel-size'. Rename last argument to 'MODE-LINES'.
Glenn Morris [Thu, 14 Oct 2021 14:50:29 +0000 (07:50 -0700)]
Merge from origin/emacs-28
9ff6999a06 (origin/emacs-28) Accept process-filter t in Tramp cf95962092 ; * doc/lispref/processes.texi (Filter Functions): Fix las... 1ad4ad0c11 Document the t value for set-process-filter in the manual b014efa1e5 * doc/misc/tramp.texi (Frequently Asked Questions): Add re... b9b78b2631 Fix Help functions for clicks on tool bar and tab bar 74deafe921 ; * etc/DEBUG: Add a section about debugging native-compil... 8153f70b9c In make_lispy_position fix Bug#50993 in rudimentary fashion 0aa52e94f3 Mark vc-switch-backend as obsolete 568e479c59 Add missing parentheses in the Emacs manual 44ce50b0df Improve tooltip of mode-line-position again 9b1adf8b4f Use browse-url-button-regexp for rcirc-url-regexp 9ed53b022d * lisp/help.el (help--analyze-key): Avoid mouse-set-point ...
Michael Albinus [Thu, 14 Oct 2021 12:32:47 +0000 (14:32 +0200)]
Accept process-filter t in Tramp
* lisp/net/tramp.el (tramp-handle-make-process):
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Filter can be t.
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process): Test filter equal t.
Eli Zaretskii [Thu, 14 Oct 2021 08:57:07 +0000 (11:57 +0300)]
Fix display of cursor in mouse-highlighted face with ':box'
* src/xdisp.c (erase_phys_cursor, show_mouse_face): Adjust
phys_cursor.x as needed if the cursor is inside mouse-highlight.
(get_cursor_offset_for_mouse_face): New function.
* src/dispnew.c (gui_update_window_end): Set
'mouse_face_overwritten_p' if the cursor is in mouse-face, to
trigger more thorough redisplay of the cursor.
(Bug#50660)
Martin Rudalics [Thu, 14 Oct 2021 08:21:17 +0000 (10:21 +0200)]
In 'window--display-buffer' handle nil size values as intended (Bug#51062)
* lisp/window.el (window--display-buffer): Make sure
that (window-height . nil), (window-width . nil)
and (window-size . nil) action alist entries are processed
as intended.
Dmitry Gutov [Thu, 14 Oct 2021 00:43:42 +0000 (03:43 +0300)]
Add new argument INCLUDE-ALL to project-find-file
* lisp/progmodes/project.el (project-find-file):
Add new argument INCLUDE-ALL. Have 'C-u' make it non-nil.
(project-or-external-find-file): Ditto.
(project-find-file-in): Add new argument INCLUDE-ALL.
(https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00209.html)
Stefan Kangas [Tue, 12 Oct 2021 16:23:46 +0000 (18:23 +0200)]
Double the default value of kill-ring-max
* lisp/simple.el (kill-ring-max): Double the default to 120.
* lisp/menu-bar.el (yank-menu-length): Doc fix.
(yank-menu-max-items): New variable.
(menu-bar-update-yank-menu): Don't display more than
'yank-menu-max-items' in the yank menu.
* doc/emacs/custom.texi (Changing a Variable):
* doc/emacs/killing.texi (Kill Ring):
* doc/lispintro/emacs-lisp-intro.texi (kill-new function):
* doc/lispref/text.texi (Internals of Kill Ring): Doc fix to use
the new value.
Mark all def* functions that should indent as `defun'
* lisp/abbrev.el (define-abbrev):
(define-abbrev-table): Mark all functions that have names that
start with "def" that should indent according to the current
heuristics (bug#43329).
* lisp/autoinsert.el (define-auto-insert):
Paul Eggert [Wed, 13 Oct 2021 18:16:33 +0000 (11:16 -0700)]
Pacify GCC -Wanalyzer-possible-null-dereference
This fixes the only remaining GCC diagnostics when emacs-28 is
configured with --enable-gcc-warnings. It does so by adding
ATTRIBUTE_RETURNS_NONNULL so that GCC knows certain functions
return nonnull. It also arranges for three of those functions to
always return nonnull; I thought these functions already were
doing so, but apparently not, and it is conceivable (though I
haven’t checked this) that changing these functions to always
return nonnull even on non-GNU platforms may fix unlikely
portability bugs elsewhere in Emacs. I used GCC 11.2.1 20210728
(Red Hat 11.2.1-1) on x86-64 when checking the diagnostics.
* configure.ac: Invoke gl_EEMALLOC before gl_INIT, in case
the regex code doesn't invoke gl_EEMALLOC; needed for src/alloc.c’s
use of MALLOC_0_IS_NONNULL.
* src/alloc.c (xmalloc, xzalloc, xrealloc): Don’t worry about the
special case where SIZE == 0, since lmalloc and lrealloc now
return null only on allocation failure.
(lmalloc, lrealloc): Return null only on allocation failure,
instead of having special cases that treat malloc (0) and
realloc (X, 0) as successes even when they return null.
* src/lisp.h: Add ATTRIBUTE_RETURNS_NONNULL to a few functions
that always return nonnull pointers, so that gcc -fanalyzer
does not issue diagnostics like “alloc.c: In function
‘allocate_vector_block’: alloc.c:2985:15: warning: dereference of
possibly-NULL ‘block’ [CWE-690] [-Wanalyzer-possible-null-dereference]”
as per <https://cwe.mitre.org/data/definitions/690.html>.
Paul Eggert [Wed, 13 Oct 2021 18:19:12 +0000 (11:19 -0700)]
Merge from origin/emacs-28
efb1cd7fa9 ; * etc/charsets/README: Update the format documentation. cc796b7409 Tramp doc cleanup a338d46060 Make emacs-lisp-byte-compile-and-load load the .elc file a... 3eac7dc780 Fix point movement in image-dired 4e9452a399 Improve shortdoc for vector f223ac6ef9 Fix test bug when calloc returns null ebeaa54f19 Pacify GCC 11 -fanalyzer on x86-64 56d1f42f30 Improve handling of non-character events in input methods 3fbe6fd367 ; Fix mistakes in last doc rewording about shorthands
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types): Allow
inhibiting the `not-unused' warning (bug#31641). (There has been
some discussion about removing the `not-unused' warning, but it's
still in there, so making it possible to inhibit it seems like the
right thing to do.)
* lisp/emacs-lisp/cconv.el (cconv--analyze-use): Don't warn about
`not-unused'.
Fix problem with multiline fontification in interactive Python
* lisp/progmodes/python.el
(python-shell-font-lock-post-command-hook): When doing multi-line
(`C-c SPC') inputs, remove all the preceding lines when doing
fontification (bug#47657).
Peter Münster [Tue, 12 Oct 2021 12:31:58 +0000 (14:31 +0200)]
Fix point movement in image-dired
* lisp/image-dired.el (image-dired-thumb-file-marked-p): Don't
move point in associated dired buffer.
(image-dired-delete-marked): Revert "Fix deletion of associated image"
because it was wrong and introduced another problem (bug#51152).
* doc/lispref/display.texi (Temporary Displays): Explain how
to override the effect of 'temp-buffer-resize-mode' with a
suitable 'display-buffer' action alist entry.
* doc/lispref/windows.texi (Buffer Display Action Alists):
Mention that an 'inhibit-switch-frame' entry might not work
with every WM. Describe the 'window-size' entry. Describe
how automatic window resizing can be overridden.
* lisp/help.el (resize-temp-buffer-window-inhibit): New variable.
(resize-temp-buffer-window): Handle case where user overrides
automatic resizing.
* lisp/window.el (temp-buffer-window-show): Bind
'resize-temp-buffer-window-inhibit' to nil around
'display-buffer'. Do not raise frame automatically to avoid
defeating 'inhibit-switch-frame'.
(window--display-buffer): Set 'resize-temp-buffer-window-inhibit'
to t when the action alist contains a 'window-height',
'window-width' or 'window-size' entry. Use
'modify-frame-parameters' instead of 'set-frame-height' and
'set-frame-width' to avoid that the latter step on each others
toes.
(display-buffer): Fix 'inhibit-switch-frame' part in and add
'window-size' part to doc-string.