* lisp/textmodes/ispell.el (ispell-look-p): Make obsolete.
(ispell-lookup-words): Look up the look command at run time
instead (bug#50852).
(ispell-have-new-look): Make obsolete.
(ispell-look-options): Adjust. Apparently the version of "look"
that had a "-r" (regexp interface) never took off -- it's not
present in GNU/Linux or Macos, at least, as far as we can tell.
Robert Pluim [Fri, 2 Sep 2022 09:15:43 +0000 (11:15 +0200)]
Use frame-monitor-attributes in gamegrid
* lisp/play/gamegrid.el (gamegrid-calculate-glyph-size): Use
`frame-monitor-attributes' to get the frame attributes directly
instead of iterating over `display-monitor-attributes-list'.
Po Lu [Fri, 2 Sep 2022 09:19:29 +0000 (17:19 +0800)]
Prevent crashes when embedding Emacs in a nonexistent parent
* src/xfns.c (x_window, Fx_create_frame): Handle X errors while
trying to reparent the frame onto an explicitly specified
parent.
* src/xterm.c (handle_one_xevent): Handle unparenting embedded
windows correctly. This only works if the embedder is aware of
the fixes extension and has put the window into the right save
set.
(x_embed_frame): New function.
* src/xterm.h (FRAME_X_EMBEDDED_P): Fix coding style.
Robert Pluim [Thu, 1 Sep 2022 16:10:58 +0000 (18:10 +0200)]
Make single char entry easier for `describe-char-fold-equivalences'
* lisp/char-fold.el (describe-char-fold-equivalences): Improve
docstring. Pass t for 'allow-single' arg in call to
`read-char-by-name' so that single characters can be entered directly.
Stefan Kangas [Thu, 1 Sep 2022 04:17:37 +0000 (06:17 +0200)]
Merge from origin/emacs-28
8807a4f532 Enable 256 colors in fbterm. bbc23ca8ab One more fix for find-file.el 0cbcaf5119 ; Yet another doc fix for 'ff-other-file-alist' (bug#57325) 2d9a391727 Recommend using fbterm in the Linux console. a5a92e577c ; * src/window.c (syms_of_window) <window-point-insertion-... 4d52fe6b96 * lisp/find-file.el (ff-other-file-alist): Doc fix. (Bug#... d111b5b651 * lisp/info.el (Info-mode): Support the Linux console better. cc945ec0ed ; Fix doc strings in latin1-disp.el 195fcc932e Improve the documentation of glyphless-character display 72ae02377e ; * lisp/jit-lock.el (jit-lock-chunk-size): Doc fix. 3fb69fad49 Fix documentation of 'glyphless-char-display'
Jim Porter [Wed, 31 Aug 2022 16:47:43 +0000 (09:47 -0700)]
Don't fail Eshell ERT tests when an internal signal gets raised
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/pipeline-connection-type/middle)
(esh-proc-test/pipeline-connection-type/last): Set 'debug-on-error' to
nil.
Alan Mackenzie [Wed, 31 Aug 2022 18:46:06 +0000 (18:46 +0000)]
C++ Mode: Fontify functions correctly with commas in template expressions
This fixes bug #57318.
Also apply an optimization which marks generic expressions as already
analyzed, thus avoiding repeating this analysis when not needed. This
optimization prevents the fix slowing down scrolling when the C++ source has
lots of template structures.
* lisp/progmodes/cc-engine.el (top-level) Near the beginning of the file, add
a comment describing the new text property c-<>-c-types-set.
(c-update-brace-stack): Bind c-restricted-<>-arglists to nil rather than t
around the call to c-forward-<>-arglist.
(c-forward-<>-arglist-recur): Allow the abbreviated analysis of a generic
expression also when the opening < is marked with a c-<>-c-types-set text
property. Set this property at the same time as the c-type properties are set
on the commas inside the template structure.
* lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Clear the
c-<>-c-types-set text property, along with c-type, from the region being
fontified.
Robert Pluim [Wed, 31 Aug 2022 16:08:49 +0000 (18:08 +0200)]
Fix describe-char-fold-equivalences for composed characters
* lisp/char-fold.el (describe-char-fold-equivalences): Map
`get-char-code-property' across all the component codepoints of the
equivalent character rather than just the first one.
Po Lu [Wed, 31 Aug 2022 02:17:20 +0000 (10:17 +0800)]
Gently nudge Xt into always setting size hints
* src/widget.c (update_wm_hints): Force a resource to change
every time this function is called. (bug#57475)
(EmacsFrameInitialize): Initialize new field.
* src/widgetprv.h (EmacsFramePart): New field `size_switch'.
* src/xterm.c (x_wm_set_size_hint): Don't change flags if flags
is 0.
Stefan Monnier [Tue, 30 Aug 2022 21:55:03 +0000 (17:55 -0400)]
t-mouse.el: Make sure we apply the setting to new terminals
* lisp/t-mouse.el (gpm-mouse-tty-setup): New function.
(gpm-mouse-mode): Use it as well as `tty-setup-hook`.
* lisp/term/linux.el (terminal-init-linux): Remove gpm-specific code,
not neded any more.
Eli Zaretskii [Tue, 30 Aug 2022 16:09:00 +0000 (19:09 +0300)]
One more fix for find-file.el
* lisp/find-file.el (ff-get-file-name): Use 'expand-file-name'
instead of 'concat', which doesn't DTRT with absolute file names.
(ff-other-file-alist): Yet another doc fix. (Bug#57325)
Po Lu [Tue, 30 Aug 2022 11:27:39 +0000 (19:27 +0800)]
Fix junk data being returned with incremental selection transfers
* src/xselect.c (receive_incremental_selection): New arg
REAL_BYTES_RET. Set it to the actual size instead of using the
size of the array after it was grown by xpalloc.
(x_get_window_property_as_lisp_data): Adjust call to
receive_incremental_selection.
Juri Linkov [Tue, 30 Aug 2022 07:28:34 +0000 (10:28 +0300)]
* lisp/char-fold.el (describe-char-fold-equivalences): New command.
(char-fold--no-regexp): New internal variable.
(char-fold--make-table): Use it to skip translation to regexp.
Suggested by Robert Pluim <rpluim@gmail.com>.
https://lists.gnu.org/archive/html/emacs-devel/2022-07/msg00864.html
Eli Zaretskii [Mon, 29 Aug 2022 13:52:07 +0000 (16:52 +0300)]
Fix point adjustment in recreated *Messages* buffers
* lisp/startup.el (normal-top-level): Move setting of
'window-point-insertion-type' from here...
* lisp/simple.el (messages-buffer-mode): ...to here. This is so
any *Messages* buffers we create instead of the original one, if
it's killed, will have the same type of the window-point marker.
(Bug#57466)
Po Lu [Mon, 29 Aug 2022 09:23:18 +0000 (17:23 +0800)]
Unify floating point handling when reading XI motion events
* src/xterm.c (handle_one_xevent): Always round values as
recommended, instead of just truncating them. Also fixes
weird "jitter" during drag-and-drop on some clients.
Juri Linkov [Sun, 28 Aug 2022 19:38:51 +0000 (22:38 +0300)]
'C-x v v' on a diff buffer commits it as a patch (bug#52349)
* lisp/vc/diff-mode.el (diff-vc-deduce-fileset): New function.
* lisp/vc/log-edit.el (log-edit-diff-patch): New function.
* lisp/vc/vc-dispatcher.el (vc-log-edit): Set log-edit-diff-function
to log-edit-diff-patch when vc-patch-string is non-nil.
(vc-start-logentry): New optional arg 'patch-string'.
Set buffer-local 'vc-patch-string' to 'patch-string'.
(vc-dispatcher-browsing): Add (derived-mode-p 'diff-mode).
* lisp/vc/vc-git.el (vc-git-checkin-patch): New function.
(vc-git-checkin): When vc-git-patch-string is non-nil,
use `git apply --cached` to add the patch to the index,
then commit the staged changes.
* lisp/vc/vc.el: New backend function 'checkin-patch'.
(vc-deduce-fileset-1): Call diff-vc-deduce-fileset in diff-mode.
(vc-next-action): For model 'patch' call vc-checkin with the
diff buffer string.
(vc-checkin): New optional arg 'patch-string'.
Call backend function 'checkin-patch' when 'patch-string' is non-nil.
Call vc-start-logentry with 'patch-string'.
(vc-diff-patch-string): New function.
Juri Linkov [Sun, 28 Aug 2022 19:13:45 +0000 (22:13 +0300)]
Revert parts of 3f076a8e44 that caused test failures
* lisp/simple.el (line-move-finish):
* lisp/window.el (scroll-command--goto-goal-column):
Revert back to using truncate-partial-width-windows instead of
truncated-partial-width-window-p. This change caused test failures
in lisp/ls-lisp-tests.log and lisp/emacs-lisp/edebug-tests.log.
Eli Zaretskii [Sun, 28 Aug 2022 05:40:25 +0000 (08:40 +0300)]
Improve the documentation of glyphless-character display
* lisp/international/characters.el (glyphless-char-display-control):
* src/xdisp.c (syms_of_xdisp) <glyphless-char-display>: Mention
the 'glyphless-char' face in the doc string.
* doc/lispref/display.texi (Glyphless Chars): Index
'glyphless-char' face.
Eli Zaretskii [Sat, 27 Aug 2022 10:13:48 +0000 (13:13 +0300)]
Fix antialias face attribute when text is scaled
This restores the code we had in realize_gui_face before commit bf0d3f7.
The problem described in bug#17973, which led to that commit, only
happens if one uses a specific (misc-fixed) font family, not for
the usual default fonts used by Emacs, and I'm not sure what's
described there is a bug at all. At least for the purposes of
text-scale-adjust, it makes no sense to ignore the
foundry/family/adstyle of the original font, because we _want_ the
same (or very similar) font, just of a different size.
And likely in other use cases: if the :font attribute of a face
specifies some font properties, we want to keep them all, not
arbitrarily to ignore some of them. And definitely catering to an
obscure use case such as the one cited in bug#17973 is NOT a good
reason to make such radical changes in face-realization behavior.
So I think backing out that part of commit bf0d3f7 is TRT, and if
we decide that this causes bug#17973 in too many situations we care
about, I'd rather find a kludge for that specific case than do that
for every face realization.
* src/xfaces.c (realize_gui_face): Preserve face attributes when
text is scaled. This reverts part of the changes installed in
commit bf0d3f7. (Bug#37473)
Po Lu [Sat, 27 Aug 2022 01:54:16 +0000 (09:54 +0800)]
Fix crash when handling "swallowed" generic events
* src/xmenu.c (x_menu_translate_generic_event, x_menu_show):
Pass through more events, correctly.
* src/xterm.c (handle_one_xevent): Don't abort if must_free_data
and xi_event is NULL; this is an Xlib bug.
Alan Mackenzie [Fri, 26 Aug 2022 15:51:21 +0000 (15:51 +0000)]
CC Mode: Fontify correctly a brace list element followed only by syntactic WS
This fixes a regression introduced in the fix for bug #56841 on 2022-08-24.
* lisp/progmodes/cc-engine (c-forward-declarator): Allow point to be at EOB
after the call to c-forward-name, rather than rejecting it as an invalid
declarator. Also reindent a section of this function.
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
Use `eval-when-compile'.
(tramp-adb-maybe-open-connection): Use file-property for "/". Use
`eval-when-compile'.
* lisp/net/tramp-cmds.el (mm-7bit-chars): Declare.
(tramp-reporter-dump-variable): Simplify point movement.
* lisp/net/tramp-gvfs.el (tramp-dbus-function): Fix typo.
(tramp-zeroconf-parse-device-names): Use `tramp-prefix-port-format'.
* lisp/net/tramp-sh.el (tramp-open-shell, tramp-find-shell):
Use `eval-when-compile'. Improve sanity check.
* lisp/net/tramp.el (tramp-prefix-format, tramp-prefix-regexp)
(tramp-method-regexp, tramp-postfix-method-format)
(tramp-postfix-method-regexp, tramp-prefix-ipv6-format)
(tramp-prefix-ipv6-regexp, tramp-postfix-ipv6-format)
(tramp-postfix-ipv6-regexp, tramp-postfix-host-format)
(tramp-postfix-host-regexp, tramp-remote-file-name-spec-regexp)
(tramp-file-name-structure, tramp-file-name-regexp)
(tramp-completion-method-regexp)
(tramp-completion-file-name-regexp): Declare.
(tramp-set-syntax): Set also `tramp-completion-method-regexp'.
(tramp-volume-letter-regexp, tramp-completion-method-regexp-alist):
New defconsts.
(tramp-build-completion-method-regexp): New defun.
(tramp-completion-method-regexp): New defvar.
(tramp-completion-file-name-regexp-default)
(tramp-completion-file-name-regexp-simplified)
(tramp-completion-file-name-regexp-separate)
(tramp-completion-file-name-regexp-alist): Remove.
(tramp-build-completion-file-name-regexp): Rwrite.
(tramp-make-tramp-file-name): Use `tramp-archive-method'.
(tramp-handle-file-directory-p): Ignore errors.
(tramp-handle-find-backup-file-name, tramp-handle-lock-file)
(tramp-handle-make-auto-save-file-name): Use `eval-when-compile'.
* test/lisp/net/tramp-archive-tests.el:
* test/lisp/net/tramp-tests.el: Use `rx' where possible.
(tramp-test01-file-name-syntax): Adapt test.
Make the *Ido COmpletions* buffer fit the window to the buffer
* lisp/ido.el (ido-completion-help): Display the ido completions
buffer pretty much the same way that the default *Completions*
buffer is displayed (bug#50671). This means that we're defaulting
to fit-window-to-buffer.
* lisp/play/gamegrid.el (gamegrid-make-glyph): Declare
image-scaling-factor as special before dynamically binding it, for
the sake of --without-x builds which do not preload lisp/image.el.
* test/lisp/xt-mouse-tests.el (with-xterm-mouse-mode): Replace
deprecated generalized variables frame-width and frame-height with
direct calls to set-frame-width and set-frame-height, respectively.
Po Lu [Fri, 26 Aug 2022 01:42:35 +0000 (09:42 +0800)]
Restore old code in x_sync_trigger_fence
* src/xterm.c (x_sync_trigger_fence): Restore old code, since that
makes it easier to adapt to more than 2 sync fences (which might be
necessary in the future, if we ever decide to do frame handling
asynchronously), and is much more recognizable for people coming from
other programs.