1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 03:40:56 -08:00
Commit graph

44040 commits

Author SHA1 Message Date
Eli Zaretskii
ee812f2a98 Yet another place inside redisplay_window to prevent quitting
* src/xdisp.c (handle_single_display_spec): Inhibit quitting
around the call to lookup_image.  (Bug#44448)
2021-08-18 16:14:29 +03:00
Eli Zaretskii
bf4f7388b6 Fix abort when turning on Hebrew or Arabic input methods
* src/xdisp.c (face_before_or_after_it_pos): Add the missing
initialization of the bidi scan direction.  (Bug#50107)
2021-08-18 16:01:57 +03:00
Eli Zaretskii
130d47bdcc Another fix for quitting while displaying non-selected windows
* src/xdisp.c (handle_face_prop, extend_face_to_end_of_line):
Inhibit quitting around the call to face_at_pos, to prevent
leaking wrong value of point when the user quits while we
redisplay a non-selected window.  (Bug#44448)
2021-08-17 21:29:58 +03:00
Eli Zaretskii
5f47d17d33 Fix TTY display performance degradation due to many markers
* src/coding.c (encode_coding_object): Don't assume that
src_object == dst_object means src_object is the current buffer.
Add the missing commentary that explains the arguments.
(Bug#49127)
2021-08-17 15:31:53 +03:00
Eli Zaretskii
6898ae6f8c Plug another hole for longjmp-ing from 'redisplay_window'
* src/fringe.c (update_window_fringes): Inhibit quitting, so as
not to longjmp out of redisplay_window.  (Bug#44448)
2021-08-16 22:06:26 +03:00
Lars Ingebrigtsen
5d7b1d5fc7 Make overlays-in treat zero-length overlays at point-max consistently
* doc/lispref/display.texi (Finding Overlays): Adjust documentation.

* src/buffer.c (overlays_in): Treat the end of the buffer and the
end of the narrowed-to buffer the same (bug#19422).
(Foverlays_in): Adjust doc string.
2021-08-16 15:40:43 +02:00
Lars Ingebrigtsen
55772baee1 Make Emacs compile with musl instead of glibc
* src/alloc.c: musl doesn't have malloc_info (bug#50058).
2021-08-15 13:25:23 +02:00
Eli Zaretskii
36964b2358 ; * src/xdisp.c (display_mode_lines): Fix comment. 2021-08-15 14:18:17 +03:00
Eli Zaretskii
fdf148cab4 Fix unwarranted point movement after C-g
When the same buffer is displayed in more than one window,
redisplay temporarily moves point to the window-point when it
works on non-selected windows.  If we allow C-g to quit out of
redisplay_window in this situation, point will appear to have
moved to the window-point of that non-selected window, which is
unwarranted.  These changes prevent quitting in strategic places,
so that we never quit out of redisplay_window.
* src/xdisp.c (run_window_scroll_functions):
Prevent quitting while running window-scroll-functions, so that we
don't quit out of redisplay_window with temporarily moved point.
(redisplay_window): While redisplaying the mode line, prevent
quitting, to avoid exiting while point is temporarily moved.
(decode_mode_spec): Use safe_call1 instead of call1, to trap any
errors instead of letting them throw out of redisplay.  (Bug#44448)
2021-08-15 14:11:23 +03:00
Eli Zaretskii
9c5dc3cbe0 * src/w32.c (_sys_read_ahead): Pacify a silly compiler warning. 2021-08-14 20:38:05 +03:00
Eli Zaretskii
482049e542 Fix 'random' on MS-Windows when integers are wider than 30 bits
* src/w32.c (random): Provide more random bits for MS-Windows
builds with EMACS_INT that is wider than 32 bits.  (Bug#32605)
2021-08-14 17:39:38 +03:00
Lars Ingebrigtsen
65dd00667f Fix problem where an error would change standard-output
* src/keyboard.c (cmd_error): Don't set
standard-output/standard-input (bug#30529).  Instead bind them
temporarily while handling the error.
2021-08-13 13:19:39 +02:00
Lars Ingebrigtsen
81fd380dea Allow using XLFD font names with dashes in the family name
* src/font.c (font_parse_xlfd_1): Rename from font_parse_xlfd to
allow calling twice from a wrapper (bug#35816).
(font_parse_xlfd): Wrapper function -- first try to parse in the
normal way, and then try to guess that the hyphenated bits are in
the family name.
2021-08-11 22:07:13 +02:00
Alan Third
c7855c8ca3 * src/nsterm.m (max_used_fringe_bitmap): Remove unused variable. 2021-08-08 22:23:34 +01:00
Lars Ingebrigtsen
8ce7a697ca Allow building on MacOS with MacPorts and libgccjit
* configure.ac: Check for the "port" command (MacPorts).
Add the required lib/include directories for nativecomp.

* src/Makefile.in (LIBGCCJIT_CFLAGS, LIBGCCJIT_LIBS): Split into
two parts to allow including -L/-I for MacPorts.
(LIBES): Adjust.
(EMACS_CFLAGS): Ditto.
2021-08-07 11:56:44 +02:00
Eli Zaretskii
4d6511a284 Fix automatic hscrolling when line numbers are displayed
* src/xdisp.c (hscroll_window_tree): When line numbers are
displayed, account for the the line-number space when calculating
the desired X coordinate on the left.  (Bug#49891)
2021-08-06 10:51:45 +03:00
Eli Zaretskii
c327d61ec8 Improve wording of recently changed documentation
* src/minibuf.c (syms_of_minibuf):
* lisp/minibuffer.el (minibuffer-restore-windows):
* lisp/progmodes/etags.el (etags-xref-prefer-current-file):
Improve wording of doc strings.

* etc/NEWS: Improve wording and format of recently added entries.
2021-08-06 10:22:22 +03:00
Juri Linkov
18d7562e91 Add function minibuffer-restore-windows (bug#45072)
* lisp/minibuffer.el (minibuffer-restore-windows): New function
that removes the completions buffer.  Add it to minibuffer-exit-hook.
* src/minibuf.c (read-minibuffer-restore-windows): Mention
minibuffer-restore-windows.
2021-08-06 02:36:22 +03:00
martin rudalics
51583a0f9f Add new user option 'read-minibuffer-restore-windows'
* doc/lispref/minibuf.texi (Text from Minibuffer): Document it
(bug#45072).

* lisp/cus-start.el (standard): Add.

* src/minibuf.c (syms_of_minibuf): New variable
'read-minibuffer-restore-windows'.
2021-08-04 08:48:18 +02:00
Lars Ingebrigtsen
f6c5a801ef Adjust how `replace-match' runs modification hooks
* src/editfns.c (Fsubst_char_in_region)
(Ftranslate_region_internal):
* src/cmds.c (internal_self_insert): Update callers.
* src/insdel.c (replace_range): Allow inhibiting
signal_after_change/update_compositions.
* src/lisp.h: Update.

* src/search.c (Freplace_match): Run the modification hooks at the
end instead of before adjusting point (bug#42424).
2021-07-31 17:44:43 +02:00
Alan Third
12c5ca4d82 Fix some macOS problems
* src/nsmenu.m (update_frame_tool_bar): Make sure the toolbar isn't
displayed when it's not supposed to be.
* src/nsterm.m ([EmacsView layoutSublayersOfLayer:]): Reinstate code
intended to prevent a crash when running redisplay.
2021-07-31 11:13:05 +01:00
Alan Third
5a48c99696 Move parent frame setting code into EmacsWindow
* src/nsterm.m (ns_make_frame_visible):
(ns_set_parent_frame):
([EmacsWindow initWithEmacsFrame:fullscreen:screen:]):  Use new method.
([EmacsWindow setParentChildRelationships]): New method.
2021-07-31 11:13:05 +01:00
Alan Third
0b5cf48509 Move NS port toolbar handling to the window
* src/nsmenu.m (free_frame_tool_bar):
(update_frame_tool_bar): Remove wait_for_tool_bar and get the toolbar
from the window.
* src/nsterm.h (EmacsView): Remove toolbar and wait_for_tool_bar.
* src/nsterm.m (ns_update_begin):
([EmacsView windowDidEnterFullScreen]):
([EmacsView windowDidExitFullScreen]): Get the toolbar from the
window, not the view.
([EmacsView dealloc]): Remove toolbar from view.
([EmacsView createToolbar:]): Move method to EmacsWindow.
([EmacsView initFrameFromEmacs:]): Don't create toolbar here any more.
([EmacsView toolbar]): Remove method.
([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Create toolbar here.
([EmacsWindow createToolbar:]): Moved from EmacsView.
([EmacsWindow dealloc]): Make sure we clean up the toolbar after
closing the window.
2021-07-31 11:13:05 +01:00
Alan Third
1ba02d85a9 Fix macOS live resize drawing
* src/nsterm.m ([EmacsView layout]):
([EmacsView layoutSublayersOfLayer:]): Rename layout to
layoutSublayersOfLayer.
2021-07-31 11:13:05 +01:00
Alan Third
960f3fc589 Change NS port resize detection
* src/nsterm.m ([EmacsView windowDidResize:]): Remove function, it's
not performing a useful function any more.
([EmacsView viewDidResize]):
([EmacsView resizeWithOldSuperviewSize:]): Replace viewDidResize with
resizeWithOldSuperviewSize.
([EmacsView initFrameFromEmacs:]): Remove the view resize notification
as we don't need it any more.
2021-07-31 11:13:05 +01:00
Alan Third
1535c81f77 Tidy up NS port OS window handling
* src/nsterm.h (EmacsWindow): Move above EmacsView definition and add
new method definitions.
(EmacsView): Remove redundant bwidth variable, and change NSWindow to
EmacsWindow.
(EmacsFSWindow): Delete definition.
* src/nsterm.m (ns_set_undecorated): Rewrite to work in GNUstep using
the new OS window creating methods.
([EmacsView initFrameFromEmacs:]): Move all NSWindow related code to
new init method in EmacsWindow, and use said method.
([EmacsView toggleFullScreen:]): Use EmacsWindow instead of NSWindow.
([EmacsWindow initWithEmacsFrame:]):
([EmacsWindow initWithEmacsFrame:fullscreen:screen:]):
([EmacsWindow borderWidth]): New methods.
(EmacsFSWindow): Remove implementation.
2021-07-31 11:13:05 +01:00
Alan Third
a4d2c88cde Simplify macOS drawing code
Convert EmacsSurface into a CALayer subclass so we can use the
built-in relationships.  Also simplify the macOS versioning code.
This will result in more warnings on older versions of macOS but makes
reading the code easier.

* configure.ac: Add QuartzCore framework.
* src/nsterm.h (NS_DRAW_TO_BUFFER): Remove define and all references.
(EmacsSurface, EmacsLayer): Rename EmacsSurface to EmacsLayer and
modify the definition to fit the new function.
* src/nsterm.m (ns_update_begin):
(ns_update_end):
(ns_focus):
(ns_unfocus): Use the new overridden lockFocus and unlockFocus and
simplify the frame management.
([EmacsView dealloc]):
([EmacsView viewDidResize:]):Don't explicitly release surfaces.
([EmacsView initFrameFromEmacs:]): Move the layer code to after the
NSWindow has been created as creating the layer now relies on some of
it's properties.
([EmacsView makeBackingLayer]): New function.
([EmacsView lockFocus]):
([EmacsView focusOnDrawingBuffer]): Rename to lockFocus.
([EmacsView unlockFocus]):
([EmacsView unfocusDrawingBuffer]): Rename to unlockFocus.
([EmacsView windowDidChangeBackingProperties]): Don't explicitly
release surfaces but reset EmacsLayer properties.
([EmacsView layout]):
([EmacsView viewWillDraw]): Rename to layout.
([EmacsView wantsUpdateLayer]): Remove function and change all callers
to [EmacsView wantsLayer].
(EmacsSurface, EmacsLayer): Rename to EmacsLayer.
([EmacsSurface getSize]):
([EmacsSurface initWithSize:ColorSpace:Scale:]): Remove methods.
([EmacsSurface initWithColorSpace:]):
([EmacsLayer checkDimensions]):
([EmacsLayer releaseSurfaces]):
([EmacsLayer display]): New functions.
* src/nsterm.m ([EmacsLayer dealloc]): Use releaseSurfaces.
([EmacsSurface getContext]): Automatically detect frame property
changes and clear the cache if required.  Use built-in CALayer
properties where available.
([EmacsLayer copyContentsTo:]): Use [CALayer contents] as source.
2021-07-31 11:13:05 +01:00
Eli Zaretskii
0992335d12 * src/fontset.c (check_fontset_name): A better fix for bug#49782. 2021-07-31 09:28:36 +03:00
Eli Zaretskii
d9bc7dbefd * src/fontset.c (check_fontset_name): Fix last change. 2021-07-30 21:51:59 +03:00
Eli Zaretskii
1da5b2c60b Avoid segfault when set-fontset-font is called from non-GUI frames
* src/fontset.c (check_fontset_name): Avoid crashes if this is
called from a non-GUI frame.  (Bug#49782)
2021-07-30 21:17:58 +03:00
Alan Third
d2d3fc3929 Convert fringe bitmaps to vectors on NS port
Unfortunately *step doesn't support masks for bitmap images so
changing the colors of fringe bitmaps is awkward.  We can work around
this by converting the bitmap into an NSBezierPath and drawing it in
the required color.

* src/nsterm.m (ns_define_fringe_bitmap):
(ns_destroy_fringe_bitmap): New functions
(ns_draw_fringe_bitmap): Display the NSBezierPath.
* src/nsimage.m
([EmacsImage initFromXBM:width:height:fg:bg:reverseBytes:]): Remove
variable that's there to allow us to easily modify the XBM colors.
([EmacsImage setXBMColor:]): Remove method.
2021-07-26 23:12:31 +01:00
Alan Third
9ce3fdc461 Fix NS inset rectangle corners
* src/nsterm.m (ns_draw_relief): Use a path to draw the mitered
corners instead of rectangles.
2021-07-26 23:12:25 +01:00
Alan Third
49bbed0dfd Simplify NS sizing and positioning code
* src/nsterm.m (ns_set_offset): Unify the two branches into one, most
of the code is the same.
(ns_set_window_size): Use the provided tools to calculate the window
size instead of doing it ourselves.
2021-07-26 23:12:12 +01:00
Alan Third
0b54632013 * src/nsterm.m (ns_set_frame_alpha): Enable alpha on GNUstep. 2021-07-26 23:12:04 +01:00
Alan Third
246803f26f Fix image crash on macOS (bug#49688)
* src/nsimage.m ([EmacsImage allocInitFromFile:]): Use isValid to
check whether the image is valid instead of generating a tiff.
2021-07-26 21:04:05 +01:00
Eli Zaretskii
41a55a330f Fix compilation of xftfont.c with old fontconfig
* src/xftfont.c (FC_LCD_FILTER): Define if undefined, for older
versions of fontconfig.  This was mistakenly deleted 2 years ago.
(Bug#49722)
2021-07-25 15:50:46 +03:00
Lars Ingebrigtsen
f04f8126f0 Rename directory-append to file-name-concat
* src/fileio.c (Ffile_name_concat):
* lisp/files.el (move-file-to-trash):
* lisp/emacs-lisp/shortdoc.el (file-name):
* doc/lispref/files.texi (Directory Names): Rename
`directory-append' to `file-name-concat'.
2021-07-25 08:54:20 +02:00
Lars Ingebrigtsen
aa9cba6587 Allow empty elements in directory-append
* doc/lispref/files.texi (Directory Names): Document it.
* src/fileio.c (Fdirectory_append): Allow empty elements.
2021-07-25 08:00:50 +02:00
Eli Zaretskii
e3155440dc ; * src/fileio.c (Fdirectory_append): Doc fix. 2021-07-24 20:18:28 +03:00
Lars Ingebrigtsen
42d4537ed2 Really convert to multibyte in Fdirectory_append
* src/fileio.c (Fdirectory_append): Fix check for whether we need
to convert to multibyte.
(Fdirectory_append):
2021-07-24 18:53:43 +02:00
Lars Ingebrigtsen
4b1367ee97 Fix Fdirectory_append check for whether strings have to be converted
* src/coding.c (string_ascii_p): Make it non-static.

* src/fileio.c (Fdirectory_append): Fix check for whether we need
to convert to multibyte.

* src/fns.c (string_ascii_p): Remove copy.

* src/lisp.h: Declare string_ascii_p.
2021-07-24 18:35:14 +02:00
Lars Ingebrigtsen
6becc97433 Tweak Fdirectory_append slightly
* src/fileio.c (Fdirectory_append): Make the xfree condition more
robust.
2021-07-24 18:09:14 +02:00
Lars Ingebrigtsen
28bf38743d Tweak Fdirectory_append for efficiency
* src/fileio.c (Fdirectory_append): Make slightly more efficient.
2021-07-24 17:28:10 +02:00
Lars Ingebrigtsen
b4543dfa9e Extend directory-append to take an arbitrary number of components
* doc/lispref/files.texi (Directory Names): Document it.
* lisp/emacs-lisp/shortdoc.el (file-name): Add new example.

* src/fileio.c (Fdirectory_append): Change the function to take an
arbitrary number of components.
2021-07-24 17:22:43 +02:00
Lars Ingebrigtsen
5431a58e86 Add new function `directory-append'
* doc/lispref/files.texi (Directory Names): Document it, and
remove the concat-based file concatenation description.
* lisp/emacs-lisp/shortdoc.el (file-name): Add.  And add more
expand-file-name examples.

* src/fileio.c (Fdirectory_append): New function.
2021-07-24 13:30:58 +02:00
Lars Ingebrigtsen
d3163a3b8f Make supersession warnings work again
* src/filelock.c (lock_file): Fix thinko in lock_file in 2ad34bcea4
(bug#49701).
2021-07-23 11:49:22 +02:00
Eli Zaretskii
662f91a795 Fix display of line/wrap-prefix when there's a display property at BOL
* src/xdisp.c (get_line_prefix_it_property): New function.
(handle_line_prefix): Call 'get_line_prefix_it_property' instead
of 'get_it_property', to examine also the property of the buffer
text underlying the display or overlay string.  (Bug#49695)
2021-07-22 21:23:48 +03:00
Logan Perkins
903ecd7bea Make input of multi-key inputs in different emacsclients more logical
* src/keyboard.c (read_key_sequence): Don't continue the input of
multi-key commands in one emacsclient in another (bug#39687).
2021-07-21 17:56:20 +02:00
Stefan Monnier
0576b81ca7 * src/eval.c (signal_quit_p): Fix the usual int/Lisp_Object mixup 2021-07-21 11:12:25 -04:00
Lars Ingebrigtsen
da4b3973de Make C-g' after M-x' not give a backtrace unless required
* src/eval.c (signal_quit_p): New function.
(maybe_call_debugger): React to all `quit' signals (bug#49675).

* src/keyboard.c (cmd_error_internal, menu_item_eval_property_1):
Ditto.
2021-07-21 16:53:54 +02:00