1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 23:31:55 -08:00
Commit graph

42015 commits

Author SHA1 Message Date
Dmitry Gutov
08486f4cae Speed up 'resize-mode' child frames a little
* src/gtkutil.c (xg_frame_set_char_size): Skip resizing if the
target dimensions are unchanged for child frames with
'resize-mode' resize policy as well.
2020-04-08 13:52:40 +03:00
Martin Rudalics
c49d379f17 Fix some problems with moving and resizing child frames
(1) Provide new option 'x-gtk-resize-child-frames' which allows
to either hide a child frame during resizing or asks GTK to
resize it "immediately".  This is needed because desktops like
GNOME shell otherwise won't allow resizing child frames at all.
(2) Do not try to synchronize the position of a child frame
after moving it.  Needed because the present implementation
introduces a 0.5 secs delay which makes dragging child frames
virtually impossible with Lucid and Motif toolkits on desktops
like GNOME shell that use invisible outer frame borders.

For further information see the thread starting with
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00343.html

* src/frame.c (syms_of_frame): New symbol Qxg_frame_set_char_size_4.
* src/gtkutil.c (xg_frame_set_char_size): Hide child frame
during resizing when 'x-gtk-resize-child-frames' equals 'hide'.
* src/xfns.c (x_set_parent_frame, Fx_create_frame): Set
gtk_container_resize_mode to GTK_RESIZE_IMMEDIATE for child
frames when'x-gtk-resize-child-frames' equals 'resize-mode'.
(Fx_gtk_debug): New function to toggle interactive GTK debugging
from within Emacs.
(syms_of_xfns): New symbols Qhide and Qresize_mode.
(x-gtk-resize-child-frames): New option that allows to resize
child frames on desktops like GNOME shell (with the mutter WM)
that otherwise refuse to resize them.
* src/xterm.c (x_set_offset): Don't x_sync_with_move for child
frames, it makes moving child frames virtually impossible with
the Lucid and Motif toolkits.
2020-04-06 09:22:36 +02:00
Philipp Stephani
452d776a5d Fix small bug in copy_string_contents.
* src/emacs-module.c (module_copy_string_contents): Fix incorrect
variable use.  In this branch 'lisp_str_utf8' is always nil, so it
makes little sense to add it as error data.
2020-04-03 21:49:59 +02:00
Martin Rudalics
d4f51d0a2e Don't draw GTK's internal border and tab bar on top of each other
* src/xterm.c (x_clear_under_internal_border): For GTK builds
have 'margin' count in the height of the tab bar to avoid that
tab bar and internal border are drawn on top of each other.
2020-04-03 10:31:35 +02:00
Eli Zaretskii
38731d504e ; * src/buffer.c (syms_of_buffer) <inhibit-read-only>: Doc fix. 2020-04-03 09:58:20 +03:00
Eli Zaretskii
f3ccfb1926 ; * src/decompress.c: Fix comment style. 2020-03-29 19:14:13 +03:00
Eli Zaretskii
1af03e7e92 ; * src/xfaces.c (syms_of_xfaces): Fix wording and typo. 2020-03-29 16:14:34 +03:00
Noam Postavsky
ee47e00f4e Don't suggest setting face-remapping-alist to a literal (Bug#39812)
* src/xfaces.c (syms_of_xfaces) <face-remapping-alist>: Use copy-tree
in the costring example code, and note why.
2020-03-28 21:22:49 -04:00
Noam Postavsky
8944310d7c Don't signal during backtrace unrewind (Bug#40088)
backtrace_eval_unrewind is used to temporarily reverse
let-bindings (it's called with a positive argument to reverse
bindings, and then a negative argument to re-apply them) by
backtrace--locals and backtrace-eval.  For the SPECPDL_LET_DEFAULT and
SPECPDL_LET_LOCAL cases (which occur for let-bindings on buffer-local
variables), the code calls Fdefault_value and Fbuffer_local_value on
the symbol.

For symbols which are unbound at top-level, the first (with positive
argument) call to backtrace_eval_unrewind will set the symbol's value
to unbound (putting the current value in the specpdl's "old value"
slot).  On the second (with negative argument) call,
backtrace_eval_unrewind attempts to retrieve the symbol's value with
Fdefault_value or Fbuffer_local_value, but that raises a void-variable
signal.  This interrupts the restoration of the let-bindings, so any
other variables more recent on the stack will now have the wrong
value.

* src/data.c (default_value): Make non-static.
* src/lisp.h: Declare it.
* src/eval.c (backtrace_eval_unrewind): Replace the calls to
Fdefault_value and Fbuffer_local_value with default_value and
buffer_local_value, respectively.  The latter do exactly the same as
the former, except if the symbol's value is Qunbound they just return
it instead of signaling void-variable.
2020-03-22 23:06:31 -04:00
Robert Pluim
bed04c502c Use correct registry name for windows-1251 charset
* src/ftfont.c (fc_charset_table): The registry to use to lookup
windows-1251 charset is microsoft-cp1251, not windows-1251.
(Bug#40097)
2020-03-19 09:21:52 +01:00
Robert Pluim
5747a59a88 Recalculate default font when switching font backend
This is an updated version of the patch by Dmitry Antipov
<dmantipov@yandex.ru> in
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23386#43>.

Fixes Bug#23386

* src/dispextern.h (struct redisplay_interface): New member
default_font_parameter.
* src/xterm.h: Add prototype for x_default_font_parameter.
* src/xterm.c (x_redisplay_interface): Initialize
default_font_parameter member.
* src/xfns.c (x_default_font_parameter): Make non-static.
* src/w32term.h: Add prototype for w32_default_font_parameter
* src/w32fns.c (w32_default_font_parameter): Make non-static.
* src/w32term.c (w32_redisplay_interface): Initialize
default_font_parameter member.
* src/nsterm.m (ns_redisplay_interface): Add dummy
ns_default_font_parameter (there is currently only one possible font
backend on macOS).  Initialize default_font_parameter member.
* src/frame.c (gui_set_font_backend): Recalculate default font using
RIF default_font_parameter to avoid crash when changing font backend.
2020-03-17 16:58:09 +01:00
Eli Zaretskii
8d28c98ae0 Fix display of Big5 characters when using Fontconfig
* src/ftfont.c (fc_charset_table): Fix the value of the big-5
representative codepoint.  Reported by Brian Schack
<bschack-cocoa@usa.net>.  (Bug#40057)

* src/macfont.m (cf_charset_table): Adjust the comment.
2020-03-14 10:31:01 +02:00
Paul Eggert
4537976afd Port .gdbinit to clang with -gdwarf-4
* src/.gdbinit (xgetsym): Port to clang with -gdwarf-4, which
doesn’t output the type of lispsym anywhere other than emacs.o
(Bug#39962).
2020-03-09 12:25:56 -07:00
Paul Eggert
cf223dc928 ; * src/timefns.c: Fix typo in previous change. 2020-03-08 16:49:32 -07:00
Paul Eggert
20d3d3a950 * src/timefns.c: Add comments. 2020-03-08 16:44:49 -07:00
Paul Eggert
0a3682a566 * src/timefns.c: Add comments. 2020-03-08 00:16:49 -08:00
Eli Zaretskii
33b31dc314 Attempt to avoid rare segfaults in show_mouse_face
* src/xdisp.c (show_mouse_face): Don't display the active region
if called on a frame different from the one recorded in HLINFO.
(Bug#37671)
2020-03-06 09:48:10 +02:00
Eli Zaretskii
88c6db9196 Avoid crashes when a fontset has strange entries
* src/fontset.c (reorder_font_vector): Skip nil entries in the
loop that assigns scores to rfont_def's.
(fontset_compare_rfontdef): Cope with nil.  This has the effect of
moving any nil entries to the end of the font-group, and avoids
crashing if an element other than the last in the font-group is
nil.  (Bug#39892)
2020-03-05 17:57:21 +02:00
Andreas Schwab
add0610ec9 Fix implicit declaration of getenv and atol
* src/gtkutil.c: Include <stdlib.h>.
2020-03-03 19:42:17 +01:00
Eli Zaretskii
a4e4510ccd Fix handling MS-Windows keyboard input above the BMP
* src/w32term.c (w32_read_socket): If we get a WM_UNICHAR message
with a surrogate codepoint, assemble the corresponding character
code above the BMP from its UTF-16 encoding, communicated in two
consecutive WM_UNICHAR messages.
2020-03-03 18:40:28 +02:00
Robert Pluim
fe1a447d52 Don't attempt to cache glyph metrics for FONT_INVALID_CODE
This was causing massive slowdown in redisplay when eg #xfe0f
(VARIATION SELECTOR-16) was present, as the cache ended up very large,
unused, and being recreated on every call to font_fill_lglyph_metrics
(Bug#39133).

* src/composite.c (fill_gstring_body): Hoist FONT_OBJECT_P check out
of loop.  Calculate glyph code and check for FONT_INVALID_CODE before
calling font_fill_lglyph_metrics.  Pass glyph code to it.

* src/font.c (font_fill_lglyph_metrics): Add code parameter, move
glyph code calculation up the call stack into fill_gstring_body.

* src/font.h: Adjust font_fill_lglyph_metrics prototype.
2020-03-02 09:59:34 +01:00
Paul Eggert
5cca73dd82 * src/timefns.c (time_arith): Omit incorrect comment. 2020-02-28 12:59:16 -08:00
Robert Pluim
999d75c0c1 Range-check width passed to define-fringe-bitmap
This prevents a crash when attempting to create a zero-width bitmap.

* src/fringe.c (Fdefine_fringe_bitmap): Check value of width,
signal an error if outside documented range (Bug#39662).
2020-02-26 19:18:54 +01:00
Noam Postavsky
af519a6348 Define libgnutls-version properly
* src/gnutls.c (syms_of_gnutls) <libgnutls-version>: Define with
DEFVAR_LISP and add docstring, so that this variable will accessible by
help facilities.
2020-02-25 20:12:57 -05:00
Paul Eggert
62afbc513a Fix bug when visiting euc-jp-encoded directories
Problem reported by Ken Sasaki (Bug#39672).
* src/fileio.c (Ffile_directory_p):
Encode filename before giving it to file_directory_p.
This fixes a typo introduced in
2019-09-18T02:18:14Z!eggert@cs.ucla.edu.
2020-02-19 17:22:27 -08:00
YAMAMOTO Mitsuharu
888ffd960c Fix unexec failure on macOS 10.15.4
* src/unexmacosx.c (unexec_regions_merge): Align region start addresses to
page boundaries and then merge regions.
2020-02-16 09:50:26 +09:00
Philipp Stephani
75a9eee8b8 ; * src/editfns.c (Fbuffer_size): Tiny clarification. 2020-02-13 22:43:03 +01:00
Alan Mackenzie
d1e8ce8bb6 Make after-change-functions called from call-process get the correct BEG
This fixes bug #39585.

* src/callproc.c (call_process): Supply the correct CHARPOS to
signal_after_change (twice).
2020-02-13 19:00:36 +00:00
Alan Third
89d0c4451f Revert "Fix display of working text on NS (Bug#23412, Bug#1453)"
This reverts commit ba042176d8.

Do not merge to master (bug#38851)
2020-02-11 17:27:11 +00:00
Eli Zaretskii
06c302d425 Fix set-fontset-font with ADD arg non-nil
* src/fontset.c (fontset_add): Fix off-by-one error at TO.
(Bug#39482)
2020-02-09 19:18:38 +02:00
Alan Mackenzie
530067463b Correct "different than" to "different from" where appropriate
(doc/emacs/screen.texi)
(doc/lispintro/emacs-lisp-intro.texi)
(doc/misc/calc.texi)
(doc/misc/gnus.texi)
(doc/misc/sc.texi)
(lisp/align.el)
(lisp/allout-widgets.el)
(lisp/allout.el)
(lisp/emacs-lisp/gv.el)
(lisp/font-lock.el)
(lisp/gnus/mm-util.el)
(lisp/mail/feedmail.el)
(lisp/mail/sendmail.el)
(lisp/mail/supercite.el)
(lisp/org/org-attach.el)
(lisp/progmodes/cc-langs.el)
(lisp/progmodes/idlw-shell.el)
(lisp/ps-print.el)
(lisp/simple.el)
(src/cmds.c)
(src/editfns.c)
(src/frame.h)
(src/regex-emacs.c)
(src/xfaces.c): Replace "different than" by "different from".
2020-02-09 14:33:14 +00:00
Robert Pluim
831508422e Cater for 3-argument version of pthread_setname_np
Fixes Bug#39363.

* configure.ac: Add check for 3-argument version of
pthread_setname_np.
* src/systhread.c (sys_thread_set_name)
[HAVE_PTHREAD_SETNAME_NP_3ARG]: Call pthread_setname_np with
3 arguments.
2020-02-03 16:40:25 +01:00
Federico Tedin
2e66013dcf Ensure minibuffer input is added to history in read_minibuf
* src/minibuf.c (read_minibuf): Parse input string after saving
the string to the history list instead of before, in case parsing
signals an error or is interrupted by C-g.  (Bug#39291)
2020-01-31 11:17:41 +02:00
Paul Eggert
c31c31e57f ; Spelling and URL fixes 2020-01-27 11:30:46 -08:00
Mattias Engdegård
c8fcabf245 Correct regexp for flags in `format' doc string
* src/editfns.c (Fformat): Use the correct regexp for describing the
flags in a %-sequence (place the hyphen last).
2020-01-26 10:05:53 -08:00
Alan Third
0bed550e21 Remove EmacsOpenPanel and EmacsSavePanel (bug#38031) 2020-01-24 09:55:55 +00:00
Alan Mackenzie
224e8d1464 Make call_process call signal_after_change. This fixes bug #38691.
Now, functions such as call-proess-region invoke after-change-functions
correctly.

* src/callproc.c (call_process): Call prepare_to_modify_buffer in a single
place, no longer delegating the task to insert_1_both, etc.  Call
signal_after_change in each of two code branches, such that
before-change-functions and after-change-functions are always called in
balanced pairs.
2020-01-22 19:50:30 +00:00
Eli Zaretskii
196c42b8bf Fix a few typos
* etc/NEWS: Fix a typo.

* src/xdisp.c (try_window_reusing_current_matrix, try_window_id):
* src/dispnew.c (scrolling_window): Fix typos in comments.
2020-01-22 19:17:32 +02:00
Eli Zaretskii
4aec94da37 Avoid leaving artifacts when the system caret is used on w32
* src/xdisp.c (try_window_reusing_current_matrix, try_window_id):
* src/dispnew.c (scrolling_window) [HAVE_NTGUI]: If
w32-use-visible-system-caret is non-nil, disallow scrolling the
display are in scroll_run_hook.  This avoids copying traces of the
caret, about which Emacs knows nothing, and thus considers those
pixels show the default background.  (Bug#39188)
(gui_update_window_end): Block input only around part of the code,
as we did before this code was extracted from backend-specific
implementations.

* src/w32term.c (w32_update_window_begin, w32_update_window_end):
Only hide/show the caret when redisplaying the window where the
caret is shown.
2020-01-21 18:23:32 +02:00
Pip Cet
2eb834ead4 Clear output data pointer on NS
* src/nsterm.m (ns_free_frame_resources): Clear the output data
pointer to prevent attempting to reuse freed resources (Bug#38748).
2020-01-20 17:27:43 +01:00
Simen Heggestøyl
4df0c1c6c4 ; * src/lread.c (force_new_style_backquotes): Fix reference. 2020-01-17 14:53:13 +01:00
YAMAMOTO Mitsuharu
0e936f18f8 Fix build failure with --with-cairo --without-png
* src/image.c: Don't enable PNG section only by USE_CAIRO.
2020-01-15 17:10:30 +09:00
Juri Linkov
d47b157969 Handle tab-bar clicks on a GPM-capable console.
* src/term.c (handle_one_term_event): Call tty_handle_tab_bar_click.

* src/xdisp.c (tty_handle_tab_bar_click): Force reset of up_modifier bit
from the event modifiers.

* lisp/tab-line.el (tab-line-tab-current): No need to use inverse-video
on console/xterm because the selected tab already uses inverse-video.
2020-01-13 01:23:12 +02:00
Väinö Järvelä
5841240295 Use NSNumber instead of BOOL (bug#39047)
* src/nsfns.m (ns_set_represented_filename): Use correct type.

Copyright-paperwork-exempt: yes
2020-01-09 20:04:27 +00:00
Eli Zaretskii
1fe596d89f Fix another compilation problem in a build without threads
* src/systhread.c (sys_thread_set_name) [!THREADS_ENABLED]: Add
a trivial implementation.
2020-01-08 22:00:36 +02:00
Eli Zaretskii
50dc615095 Fix build without threads
* src/systhread.c (sys_thread_create) [!THREADS_ENABLED]: Update
the function's signature to match prototype.  Reported by Glenn
Morris <rgm@gnu.org>.  (Bug#38632)
2020-01-08 20:53:00 +02:00
Mattias Engdegård
73fd8a4b53 Fix BSD and macOS builds w.r.t. pthread_setname_np (bug#38632)
pthread_setname_np takes only a single argument on BSD and macOS,
and affects the current thread only.

* configure.ac: Add check for single-argument pthread_setname_np
* src/systhread.c (sys_thread_set_name): New (w32 and pthread versions).
(sys_thread_create): Remove name argument and name-setting.
(w32_beginthread_wrapper): Remove name-setting.
* src/systhread.h (sys_thread_create, sys_thread_set_name):
Update prototypes.
* src/thread.c (run_thread): Call sys_thread_set_name.
(Fmake_thread): Adapt call to sys_thread_create.
* src/thread.h (struct thread_state): Adjust comment.
2020-01-07 17:57:31 +01:00
Robert Pluim
f54b24304d Scale top-left coordinates in display-monitor-attributes-list
When using multiple monitors, and HiDPI, the top-left coordinates of
the monitors need to be adjusted, not just the width and height
(Bug#31223).

* xfns.c (Fx_display_monitor_attributes_list): Scale top-left
coordinates.
2020-01-07 17:26:21 +01:00
YAMAMOTO Mitsuharu
c01f55f126 Fix rendering bug due to unsynchronized cairo surface size (Bug#38497)
* src/xterm.c (handle_one_xevent) <ConfigureNotify> [USE_CAIRO && !USE_GTK]:
Call x_cr_update_surface_desired_size for a related frame as a fallback.
2020-01-07 12:42:19 +09:00
YAMAMOTO Mitsuharu
075f21c0e3 Avoid crash by access to cleared img->pixmap->data/img->mask->data (Bug#38774)
* src/image.c (prepare_image_for_display) [USE_CAIRO]: Call IMAGE_BACKGROUND
and IMAGE_BACKGROUND_TRANSPARENT.
2020-01-07 12:32:42 +09:00