Commit graph

43027 commits

Author SHA1 Message Date
Robert Pluim
175ebb0104 Don't crash if we can't find a monitor model name
This can happen when running emacs over a forwarded X11 connection.

* src/pgtkfns.c (pgtk_get_monitor_scale_factor): Return 0 if we're
passed a NULL model name.
2021-02-11 17:00:03 +01:00
Yuuki Harano
ef76e64427 Support getting a image from clipboard
* src/pgtkselect.c (Fpgtk_get_selection_internal): Reimplement
referring selection_data_to_lisp_data in xselect.c
(syms_of_pgtkselect): Add symbols.
2021-02-11 19:30:01 +09:00
Yuuki Harano
ed2205a288 Remove unused arg as xmenu.c
* src/pgtkmenu.c (Fx_menu_bar_open_internal): Remove unused arg.
(pgtk_activate_menubar): Remove unused arg.
(set_frame_menubar): Remove unused arg.
(initialize_frame_menubar): Remove unused arg.
2021-02-06 19:19:03 +09:00
Yuuki Harano
afcd13783e Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-02-06 19:11:51 +09:00
Misha Gusarov
7646793acd Make reading GNOME settings optional.
* src/pgtkterm.c (pgtk_term_init): Make reading GNOME settings optional.
(pgtk_text_scaling_factor): New function to read text scaling factor.

Copyright-paperwork-exempt: yes
2021-02-06 18:54:27 +09:00
Eli Zaretskii
b84b8dff70 Fix copying text properties in 'format'
* src/editfns.c (styled_format): Fix accounting for text
properties that come from the format string.  (Bug#46317)

* test/src/editfns-tests.el (format-properties): Add new tests for
bug#46317.
2021-02-06 11:54:08 +02:00
Eli Zaretskii
a6f23c226e ; * src/xdisp.c (Fwindow_text_pixel_size): Fix comment. 2021-02-05 22:04:15 +02:00
Eli Zaretskii
07ead60a82 ; * src/xdisp.c (Fwindow_text_pixel_size): Another minor fix. 2021-02-05 14:27:46 +02:00
Eli Zaretskii
764db69dd0 Fix last change in 'window-text-pixel-size'
* src/xdisp.c (Fwindow_text_pixel_size): Fix last change: preserve
the original Y coordinate after start_display, instead of zeroing
it out.  Reported by martin rudalics <rudalics@gmx.at>.
2021-02-05 14:24:01 +02:00
Eli Zaretskii
a2d7f3f171 Avoid overwriting minibuffer prompt by keystrokes echo
* src/lread.c (Fread_char, Fread_event, Fread_char_exclusive):
Call cancel_echoing to make sure the prompt is not obscured by
keystrokes echo.  (Bug#46243)
2021-02-04 19:35:07 +02:00
Eli Zaretskii
914cb7a1d6 Fix 'window-text-pixel-size' for short spans of text
* src/xdisp.c (Fwindow_text_pixel_size): Support the use case
where FROM and TO belong to the same screen line.  Reported by
Yuan Fu <casouri@gmail.com>.
2021-02-04 18:00:29 +02:00
Glenn Morris
7e86357b42 Merge from origin/emacs-27
9c75434173 Fix build failure on macOS 10.7 (bug#46036)
ca44ea18ef Improve documentation of auto-resize-tool/tab-bars
2021-02-03 08:11:08 -08:00
Lars Ingebrigtsen
56804edc83 Fix up invalid_syntax error signalling
* src/lread.c (invalid_syntax_lisp): Instead of putting the
line/column in a string, signal an error containing the numbers as
data.  This allows for easier post-processing and is how other
similar errors (like (forward-sexp 1)) do it.
2021-02-02 09:26:02 +01:00
Lars Ingebrigtsen
e38e7b7bc1 Make syntax errors say the line/column they appear at
* src/lisp.h: Add count_lines prototype.
* src/lread.c (invalid_syntax_lisp): New function (bug#36970).
(invalid_syntax): Extend function to take a readcharfun parameter.
(read_emacs_mule_char, character_name_to_code): Pass in.
(read_escape, invalid_radix_integer, read1): Ditto.

* src/xdisp.c (count_lines): Add a more succinct shim over
display_count_lines.
2021-02-01 17:04:17 +01:00
Stefan Kangas
d987ca6f22 Remove another variable obsolete since Emacs 23.2
* src/keymap.c (syms_of_keymap, Fdefine_key):
* lisp/subr.el (define-key-rebound-commands): Remove variable obsolete
since Emacs 23.2.
2021-02-01 12:29:10 +01:00
Stefan Kangas
f215332c8b Add cross-references to defvar-local
* src/data.c (Fmake_variable_buffer_local):
* src/eval.c (Fdefvar): Add cross-references to 'defvar-local'.
2021-02-01 12:29:09 +01:00
Alan Mackenzie
427d4b3c69 Minimise the time Vminibuffer_list is in an inconsistent state (src/minibuf.c)
src/minibuf.c (get_minibuffer): Move the XSETCAR which writes the new
minibuffer into Vminibuffer_list to immediately after the MB's creation, so
that the list is in a consistent state before calling fundamental-mode or
minibuffer-inactive-mode.
2021-01-31 17:24:23 +00:00
Lars Ingebrigtsen
5cf9b915fa execute-kbd-macro doc string clarification
* src/macros.c (Fexecute_kbd_macro): Mention that the buffer is
(potentially) changed (bug#37396).
2021-01-31 08:46:02 +01:00
Alan Third
9c75434173 Fix build failure on macOS 10.7 (bug#46036)
* src/nsfns.m (ns_set_represented_filename): Define the NSNumber in a
more compatible manner.
2021-01-30 22:14:22 +00:00
Alan Mackenzie
636ef445af With minibuffer-follows-selected-frame `hybrid', preserve recursive Mbuffers
...when enable-recursive-minibuffers is non-nil, and several minibuffers are
activated from different frames.  Also set the major mode of a reused active
minibuffer to `fundamental-mode' - up till now it's been
minibuffer-inactive-mode.

* src/minibuf.c (read_minibuf): with the indicated settings of variables,
"stack up" all containing minibuffers on the mini-window of the current
frame.  Delete another, now superfluous such stacking up.
(set_minibuffer_mode): New function.
(get_minibuffer): Call the above new function (twice), in place of inline
code, ensuring active minibuffers are never left in minibuffer-inactive-mode.
2021-01-30 21:16:35 +00:00
Eli Zaretskii
419a33eb1d Fix NS build broken by a recent change
* src/nsmenu.m (set_frame_menubar, Fns_reset_menu): Adapt to
recent changes in set_frame_menubar.  (Bug#45759)
2021-01-30 21:13:53 +02:00
Yuuki Harano
ae18c8ec4f Support child frame border width
* src/pgtkfns.c (x_set_child_frame_border_width): Port code for X.
(pgtk_frame_parm_handlers): Add hook.
(Fx_create_frame): Get default parameter.
* src/pgtkterm.c (x_draw_stretch_glyph_string): Re-port code for X.
(pgtk_clear_under_internal_border): Re-port code for X.
2021-01-31 00:49:56 +09:00
Stefan Kangas
3555657585 Remove unused argument from set_frame_menubar (Bug#45759)
* src/w32menu.c (set_frame_menubar):
* src/xmenu.c (set_frame_menubar): Remove unused argument.
All callers updated.
2021-01-30 15:59:13 +01:00
Yuuki Harano
50c76b844b Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-01-30 23:37:19 +09:00
Yichao Yu
563a0d94c3 Add support for setting cursor location using Gtk IM Context
The existing XIC implementation doesn't work when using Gtk IM Context.
Instead, `gtk_im_context_set_cursor_location` should be used
to update the cursor information for the input method.

* src/pgtkim.c (pgtk_im_set_cursor_location): New function to tell gtk
cursor location.
* src/pgtkterm.c (pgtk_draw_window_cursor): Remove invalid code and
add new code to call the function.
* src/pgtkterm.h: Add the function declaration.
2021-01-30 23:20:08 +09:00
Eli Zaretskii
ca44ea18ef Improve documentation of auto-resize-tool/tab-bars
* src/xdisp.c (syms_of_xdisp) <auto-resize-tool-bars>
<auto-resize-tab-bars>: Doc fix.  (Bug#46178)
2021-01-30 16:15:00 +02:00
Mattias Engdegård
7415c66d8b ; * src/process.c (child_signal_read): Don't report EAGAIN as error 2021-01-29 22:28:41 +01:00
Eli Zaretskii
75eb2d0e85 Support 'operating-system-release' on MS-Windows
* src/w32fns.c (w32_version_string) [WINDOWSNT]: New function.
* src/w32common.h (w32_version_string) [WINDOWSNT]: Add prototype.
* src/editfns.c (init_editfns) [WINDOWSNT]: Produce a non-nil
string with the OS version.
2021-01-29 13:52:31 +02:00
Eli Zaretskii
ae2e2b6acd Improve doc string of 'operating-system-release'
* src/editfns.c (syms_of_editfns) <operating-system-release>: Doc
fix.  (Bug#39940)
2021-01-29 09:45:13 +02:00
Lars Ingebrigtsen
3f92d00932 operating-system-release doc string improvement
* src/editfns.c (syms_of_editfns): Be more precise about what
`operating-system-release' is (bug#39940).
2021-01-29 07:22:14 +01:00
Stefan Monnier
592a230832 * src/fns.c (hash_string): Fix bug#46111
Use `memcpy` instead of an unaligned memory access.  On x86 at least,
GCC turns this `memcpy` into a single `mov`, so it's about as fast.
2021-01-28 12:27:27 -05:00
Glenn Morris
0ca75f1956 Merge from origin/emacs-27
3f610177ad Avoid sending systemd shutdown notifications if non-daemon
009df5cb3c * src/cmds.c (Fforward_line): Doc fix.  (Bug#46027)
ee1c54ebc0 Improve documentation of sendmail.el defcustom's
2021-01-27 07:55:11 -08:00
Eli Zaretskii
ff03411269 Fix display of stretches of whitespace in the display margins
* src/xdisp.c (produce_stretch_glyph): Truncate the stretch glyph
due to line wrap only when drawing in the text area.
* src/xterm.c (x_draw_stretch_glyph_string):
* src/w32term.c (w32_draw_stretch_glyph_string): Fix the
adjustment of the stretch X and width so that stretch glyphs could
be drawn in the left margin.  Reported by Paul W. Rankin
<pwr@bydasein.com>.
2021-01-27 17:52:51 +02:00
Eli Zaretskii
3131a98911 Fix typos and punctuation
* src/w32fns.c:
* src/frame.h:
* doc/lispref/frames.texi (Frame Layout):
* etc/NEWS: Fix typos and punctuation in recent changes.
2021-01-26 18:24:53 +02:00
Martin Rudalics
3c314f3dd2 Fix typo in last change of FRAME_INTERNAL_BORDER_WIDTH
* src/frame.h (FRAME_INTERNAL_BORDER_WIDTH): Fix typo in last
change.
2021-01-26 10:59:59 +01:00
Alexander Miller
ff7b1a133b Add distinct controls for child frames' borders (Bug#45620)
The background of the 'child-frame-border' face instead of the
'internal-border' face now controls the color of child frames'
borders.

The 'child-frame-border-width' frame parameter is now used for the
width of child frames' borders instead of internal-border-width',
though we still fall back on using the latter if the former is not
set.

* doc/lispref/frames.texi (Frame Layout): Mention
'child-frame-border' and 'child-frame-border-width'.
(Layout Parameters): Mention 'child-frame-border-width'.
* etc/NEWS: Mention new face 'child-frame-border' and frame
parameter 'child-frame-border-width'.
* lisp/faces.el (child-frame-border): New face.
* src/dispextern.h (enum face_id): Add CHILD_FRAME_BORDER_FACE_ID.
* src/frame.c (Fframe_child_frame_border_width): New function.
(gui_report_frame_params): Add entry for Qchild_frame_border_width.
* src/frame.h (struct frame): New slot child_frame_border_width.
(FRAME_CHILD_FRAME_BORDER_WIDTH): New inlined function.
* src/nsfns.m (ns_set_child_frame_border_width): New function.
(Fx_create_frame): Handle Qchild_frame_border_width parameter.
(ns_frame_parm_handlers): Add ns_set_child_frame_border_width.
* src/nsterm.m (ns_clear_under_internal_border): Handle
CHILD_FRAME_BORDER_FACE_ID.
* src/w32fns.c (w32_clear_under_internal_border): Handle
CHILD_FRAME_BORDER_FACE_ID.
(w32_set_internal_border_width): New function.
(Fx_create_frame): Handle Qchild_frame_border_width parameter.
(w32_frame_parm_handlers): Add w32_set_child_frame_border_width.
* src/xfaces.c (lookup_basic_face, realize_basic_faces): Handle
CHILD_FRAME_BORDER_FACE_ID.
* src/xfns.c (x_set_child_frame_border_width): New function.
(Fx_create_frame): Handle Qchild_frame_border_width parameter.
(x_frame_parm_handlers): Add x_set_child_frame_border_width.
* src/xterm.c (x_clear_under_internal_border)
(x_after_update_window_line): Handle CHILD_FRAME_BORDER_FACE_ID.
2021-01-26 10:36:52 +01:00
Eli Zaretskii
d860ca98cc ; * src/process.c (child_signal_read): Remove FIXME comment. 2021-01-23 21:04:13 +02:00
Philipp Stephani
17fec60370 Avoid a few compilation warnings in Objective-C code.
* src/nsfns.m (Fns_frame_restack): Remove unused variable 'flag'.

* src/nsmenu.m (ns_update_menubar): Remove unused variable 'pool'.

* src/nsterm.m (focus_view, hide_bell): Define conditionally.
(ns_update_end): Define variable 'view' conditionally.
(ns_redraw_scroll_bars): Don't define unused function.
(copyRect): Don't perform arithmetic on 'void' pointers.
(nswindow_orderedIndex_sort): Make static.
2021-01-23 19:08:52 +01:00
Philipp Stephani
59e9ec7244 Add a FIXME comment to improve the SIGCHLD race condition handling.
* src/process.c: Add FIXME comment describing how we could avoid the
self-pipe on modern Unix-like systems.
2021-01-23 18:39:20 +01:00
Philipp Stephani
aeff424c55 Mark both ends of self-pipe a nonblocking.
While no deadlocks caused by the blocking write end have been reported
yet, marking both ends nonblocking is consistent and also recommended
in the GNU/Linux manpage of 'select'.

* src/process.c (child_signal_init): Mark write end of self-pipe as
nonblocking.
2021-01-23 17:26:49 +01:00
Yuuki Harano
e9608601e5 Add scale factor in display-monitor-attributes-list.
* lisp/frame.el (display-monitor-attributes-list): Add the comment.
* src/frame.c (make_monitor_attribute_list): Include the scale factor value.
(syms_of_frame): Declare intern'ed scale-factor.
* src/frame.h (struct MonitorInfo): Add scale_factor member.
* src/pgtkfns.c (Fpgtk_display_monitor_attributes_list): Set the value.
2021-01-24 00:47:50 +09:00
Eli Zaretskii
8d8e1dfd05 Clean up the recently added self-pipe mechanism for WINDOWSNT
* src/process.c (child_signal_init, child_signal_read)
(child_signal_notify): #ifdef away on WINDOWSNT.
2021-01-23 12:51:57 +02:00
Paul Eggert
b99ec5d5b1 Work around __has_attribute bug in clang 3.4
* src/conf_post.h (HAS_ATTRIBUTE):
* src/emacs-module.h.in (EMACS_ATTRIBUTE_NONNULL):
Port to clang 3.4 and earlier.
2021-01-22 12:02:56 -08:00
Eli Zaretskii
3f610177ad Avoid sending systemd shutdown notifications if non-daemon
* src/emacs.c (Fkill_emacs): Send the shutdown notification only
in daemon mode.  (Bug#46022)
2021-01-22 14:30:22 +02:00
Eli Zaretskii
561197e519 Fix last change for DOS_NT systems
* src/term.c (tty_draw_row_with_mouse_face)
(tty_write_glyphs_with_face): Don't define on MSDOS and WINDOWSNT,
as those have their own implementations of that.
2021-01-22 14:16:51 +02:00
João Távora
463300d431 Enable TTY mouse-face support when built without GPM support
* src/term.c (tty_write_glyphs_with_face): Move definition out of
ifdef block.
* src/xdisp.c (draw_row_with_mouse_face): Now called
unconditionally on all platforms.
2021-01-22 14:05:21 +02:00
Eli Zaretskii
009df5cb3c * src/cmds.c (Fforward_line): Doc fix. (Bug#46027) 2021-01-22 10:10:21 +02:00
Yuuki Harano
f7fa39fbda Make imagemagick images less blurry.
* src/image.c: New macro to specify non-scaled mode.
(image_set_transform): Don't skip even if imagemagick.
(imagemagick_load_image): Don't calculate desired size.
2021-01-21 00:57:10 +09:00
Stefan Monnier
82c228a017 Don't let maybe_quit prevent resetting consing_until_gc (bug#43389)
* src/alloc.c (garbage_collect): Postpone `unblock_input` a bit.
* src/window.c (window_parameter): Avoid `maybe_quit`.

cherry picked from commit 420661af07
2021-01-20 10:36:46 -05:00
Stefan Monnier
420661af07 Don't let maybe_quit prevent resetting consing_until_gc (bug#43389)
* src/alloc.c (garbage_collect): Postpone `unblock_input` a bit.
* src/window.c (window_parameter): Avoid `maybe_quit`.
2021-01-20 09:52:07 -05:00