1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-06 20:49:33 +00:00

44079 Commits

Author SHA1 Message Date
Lars Ingebrigtsen
514398c665 Add inhibit-buffer-hooks to `make-indirect-buffer'
* doc/lispref/buffers.texi (Indirect Buffers): Document it (bug#49160).

* src/buffer.c (Fmake_indirect_buffer): Allow controlling whether
to inhibit buffer hooks.
2021-07-19 18:23:11 +02:00
dickmao
95e31a1a32 Make make-indirect-buffer inherit inhibit-buffer-hook from base buffer
* src/buffer.c (Fmake_indirect_buffer):
Match base buffer's inhibit-buffer-hooks.
* test/src/buffer-tests.el (buffer-tests-inhibit-buffer-hooks-indirect):
Add a test (bug#49160).
2021-07-19 18:23:11 +02:00
Lars Ingebrigtsen
3094c12c45 Fix documentation of mouse-leave-buffer-hook
* doc/lispref/hooks.texi (Standard Hooks): Ditto.

* src/callint.c (syms_of_callint): Document the actual usage of
`mouse-leave-buffer-hook' (bug#2932).
2021-07-19 16:41:54 +02:00
Lars Ingebrigtsen
48dfaa734b Clarify event-convert-list doc string
* src/keyboard.c (Fevent_convert_list): Clarify that the base type
returned isn't always the same (bug#7631).
2021-07-18 18:18:03 +02:00
Eli Zaretskii
595eddd848 Fix display of mode-line with bidi formatting controls
* src/xdisp.c (face_before_or_after_it_pos): Reimplement the bidi
iteration to find the character after the current in visual order.
(Bug#49562)
2021-07-18 17:27:23 +03:00
Glenn Morris
45cdc89986 Merge from origin/emacs-27
7ac411ae2c (origin/emacs-27) ; * src/data.c (Fcar, Fcdr): Doc fix.
0d9e1826f7 One more minor update of the Emacs manual for 19th printing
92616d30e0 ; Fix let-alist Texinfo markup
c13acf8e34 ; * doc/emacs/mule.texi (International Chars): Mention 'de...
2021-07-16 07:51:35 -07:00
Lars Ingebrigtsen
0848af9f66 Improve the `window-end' doc string
* src/window.c (Fwindow_end): Be more explicit about what the
position is (bug#13429).
2021-07-15 11:22:52 +02:00
Lars Ingebrigtsen
d4217b38d7 Clarify overriding-local-map doc string
* src/keyboard.c (syms_of_keyboard): Clarify
`overriding-local-map' vs. text properties/overlays (bug#16312).
2021-07-15 07:17:53 +02:00
Paul Eggert
0afbde4e68 Pacify gcc -Woverflow more clearly
* src/alloc.c (mark_maybe_pointer): Make it clearer that ANDing
with UINTPTR_MAX is intended.  Omit a now-unnecessary cast.
2021-07-14 17:20:19 -05:00
Eli Zaretskii
7ac411ae2c ; * src/data.c (Fcar, Fcdr): Doc fix. 2021-07-14 18:54:11 +03:00
Eli Zaretskii
8168a792ca Fix deprecation warnings from libtiff
* src/image.c (UINT32) [TIFFLIB_VERSION >= 20210416]: Define to
use stdint.h type for recent libtiff versions.  Reported by Andy
Moreton <andrewjmoreton@gmail.com>.
2021-07-14 15:27:19 +03:00
Mattias Engdegård
7a803ecd3d Block TLS handshake until TCP connection established
If a TLS handshake is attempted before the completion of an
asynchronous TCP connection has been ascertained, our local state will
not be set up correctly for further progress and the sentinel "open"
event will never be sent.  This can occur if sufficient time passes
after the initiation of an async TCP connection so that by the time
`wait_reading_process_output` is called, the connection has already
been established on the TCP level.

This somewhat timing-sensitive bug has plagued HTTPS connections on
some platforms, notably macOS, for a long time (bug#49449).

* src/process.c (wait_reading_process_output): Gate the TLS handshake
by the NON_BLOCKING_CONNECT_FD flag.  The flag will be cleared as soon
as the TCP socket is found to be writable.
* test/src/process-tests.el (process-async-https-with-delay):
New test.
2021-07-13 19:07:41 +02:00
Ken Brown
a41f585bf1 Fix portability issue with make-serial-process
* src/sysdep.c (struct speed_struct): New struct.
(speeds): New static array of struct speed_struct.
(convert_speed): New static function to convert a numerical baud
rate (e.g., 9600) to a Bnnn constant defined in termios.h (e.g.,
B9600).
(serial_configure): Use convert_speed to make the call to cfsetspeed
compliant with its advertised API.  (Bug#49524)
2021-07-13 09:02:45 -04:00
Paul Eggert
c22cf4d02f Pacify gcc 11.1.1 -Wclobbered
* src/eval.c (Fprogn, internal_lisp_condition_case):
Add CACHEABLE to work around more instances of -Wclobbered bug.
2021-07-12 00:12:21 -07:00
Paul Eggert
2337869fbf Pacify gcc 11.1.1 -Wanalyzer-null-argument
* lib-src/etags.c (regexp): Omit member force_explicit_name,
since it’s always true.  All uses removed.  This lets us
remove calls to strlen (name) where GCC isn’t smart enough
to deduce that name must be nonnull.
* lib-src/movemail.c (main): Fix bug that could cause
link (tempname, NULL) to be called.
* src/emacs.c (argmatch): Break check into two ‘if’s,
since GCC doesn’t seem to be smart enough to check the single ‘if’.
* src/gtkutil.c (xg_update_menu_item): Fix bug where strcmp
could be given a NULL arg.
* src/xfont.c (xfont_list_family): Use nonnull value for dummy
initial value.
2021-07-12 00:12:20 -07:00
Paul Eggert
da2f772fe5 Pacify gcc -Woverflow more nicely
* src/alloc.c (mark_maybe_pointer): Simplify pacification
of gcc -Woverflow (unknown GCC version).
2021-07-12 00:12:20 -07:00
Eli Zaretskii
56c9ecc78a Fix compilation of the --with-wide-int configuration
* src/alloc.c (mark_maybe_pointer): Fix a recent change for
WIDE_EMACS_INT builds.  (Bug#49261)
2021-07-11 18:22:51 +03:00
Paul Eggert
3b29afa680 Pacify GCC 11.1.1 20210531 (Red Hat 11.1.1-3)
* src/image.c (xpm_load_image):
* src/xfns.c (x_icon):
Rework to pacify gcc -Wmaybe-uninitialized.
2021-07-11 01:30:12 -07:00
Paul Eggert
f6472cc8e2 Make pdumper-marking pickier
Prevent some false-positives in conservative GC marking.
This doesn’t fix any correctness bugs; it’s merely to
reclaim some memory instead of keeping it unnecessarily.
* src/alloc.c (mark_maybe_pointer): New arg SYMBOL_ONLY.
All callers changed.  Check that the pointer’s tag, if any,
matches the pdumper-reported type.
2021-07-11 01:30:11 -07:00
Paul Eggert
2f7afef5ff Fix pdumper-related GC bug
* src/alloc.c (mark_maybe_pointer): Also mark pointers
to pdumper objects, even when the pointers are tagged.
Add a FIXME saying why this isn’t enough.
2021-07-11 01:30:11 -07:00
Matthew White
0897ade8f9 * src/buffer.c (kill-buffer): Fix a typo.
* src/buffer.c (Fkill_buffer): Fix typo in comment.
2021-07-11 00:49:12 +02:00
Michael Albinus
9ce6541ac9 Further cleanup for file locks
* doc/misc/tramp.texi (Top, Configuration): Adapt node name for
file locks.
(Auto-save File Lock and Backup): Rename node name and section
title.  Add file-lock to @cindex.  Describe file locks.

* lisp/dired.el (dired-trivial-filenames): Add lock files.
(dired-font-lock-keywords): Move files suffixed with
`completion-ignored-extensions' up.  Add lock files to these checks.

* lisp/net/tramp.el (tramp-get-lock-file, tramp-handle-unlock-file):
Use `when-let'
(tramp-lock-file-info-regexp): Rename from
`tramp-lock-file-contents-regexp'.
(tramp-handle-file-locked-p, tramp-handle-lock-file): Adapt callees.
(tramp-handle-lock-file): Set file modes of lockname.

* src/buffer.c (Frestore_buffer_modified_p):
* src/fileio.c (write_region):
* src/insdel.c (prepare_to_modify_buffer_1): Call Flock_file.

* src/filelock.c (Qmake_lock_file_name): Declare symbol.
(make_lock_file_name): Use it.  Don't check Fboundp, it doesn't
work for interned symbols.
(lock_file): Return a Lisp_Object.  Don't check create_lockfiles.
Remove MSDOS version of the function.
(Flock_file): Check create_lockfiles.
(Flock_buffer): Call Flock_file.

* src/lisp.h (lock_file): Remove.

* test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo)
(shadow-test09-shadow-copy-files): Let-bind `create-lockfiles'.

* test/lisp/net/tramp-tests.el (create-lockfiles): Don't set it
globally.
(tramp-test39-lock-file): Check also for `set-visited-file-name'.
2021-07-09 18:14:19 +02:00
Michael Albinus
a6a92e3ac5 Code cleanup wrt file locks
* lisp/files.el (make-lock-file-name): Fix docstring.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add `make-lock-file-name'.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Add `make-lock-file-name'.
(tramp-handle-unlock-file): Call `userlock--handle-unlock-error'
in case of error.

* src/buffer.c (Frestore_buffer_modified_p):
* src/editfns.c (Freplace_buffer_contents):
* src/fileio.c (Finsert_file_contents, write_region): Call Funlock_file.

* src/filelock.c (unlock_file): Rename from unlock_file_body.
Remove the other declarations of unlock_file.  Move file name
handler check to ...
(Funlock_file): ... here.  Adapt argument numbers.  Call
unlock_file wrapped by internal_condition_case.
(Flock_file): Adapt argument numbers.
(unlock_all_files, Funlock_buffer, unlock_buffer): Call Funlock_file.

* src/lisp.h (unlock_file): Remove.
2021-07-08 21:13:40 +02:00
Lars Ingebrigtsen
e762864b9d Make make_lock_file_name more robust
* src/filelock.c (make_lock_file_name): Protect against the
make-lock-file-name not being defined.
(lock_file, unlock_file_body, Ffile_locked_p): Return early if not
defined.
2021-07-07 22:15:47 +02:00
Lars Ingebrigtsen
2ad34bcea4 Add new user option lock-file-name-transforms
* doc/emacs/files.texi (Interlocking): Mention
lock-file-name-transforms.

* doc/lispref/files.texi (File Locks): Document
lock-file-name-transforms.

* doc/misc/efaq.texi (Not writing files to the current directory):
Mention all the three variables needed to not having Emacs writing
files to the current directory in one place.

* lisp/files.el (lock-file-name-transforms): New user option (bug#49261).
(make-auto-save-file-name): Factor out the main logic...
(auto-save--transform-file-name): ... to this new function.
(make-lock-file-name): New function that also calls the
factored-out function.

* src/filelock.c: Remove MAKE_LOCK_NAME and fill_in_lock_file_name.
(make_lock_file_name): New utility function that calls out to Lisp
to heed `lock-file-name-transforms'.
(lock_file): Use it.  Also remove likely buggy call to
dostounix_filename.
(unlock_file_body, Ffile_locked_p): Also use make_lock_file_name.
2021-07-07 21:39:20 +02:00
Michael Albinus
d35868bec9 Implement file locks for remote files (Bug#49261)
* doc/lispref/files.texi (Magic File Names): Add file-locked-p,
lock-file and unlock-file.

* etc/NEWS: Tramp supports file locks now.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-adb-handle-write-region): Handle LOCKNAME.

* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-crypt-handle-file-locked-p, tramp-crypt-handle-lock-file)
(tramp-crypt-handle-unlock-file): New defun.

* lisp/net/tramp-fuse.el (tramp-fuse-mounted-p): Simplify.
(tramp-fuse-unmount): New defun.

* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-gvfs-maybe-open-connection): Set "lock-pid" connection property.

* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-rclone-maybe-open-connection): Set "lock-pid" connection property.

* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-sh-handle-write-region): Handle LOCKNAME.

* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-smb-handle-copy-directory): Use `sleep-for'.
(tramp-smb-handle-write-region): Handle LOCKNAME.

* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-sshfs-handle-write-region): Handle LOCKNAME.
(tramp-sshfs-maybe-open-connection): Set "lock-pid" connection property.

* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-sudoedit-maybe-open-connection):
Set "lock-pid" connection property.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-make-lock-name, tramp-get-lock-file, tramp-get-lock-pid)
(tramp-handle-file-locked-p, tramp-handle-lock-file)
(tramp-handle-unlock-file): New defuns.
(tramp-lock-file-contents-regexp): New regexp.
(tramp-handle-write-region): Handle LOCKNAME.

* src/filelock.c (lock_file, unlock_file_body, Ffile_locked_p):
Call handler if exists.
(Flock_file, Funlock_file): New defuns.
(Qlock_file, Qunlock_file, Qfile_locked_p): Declare symbols.
(Slock_file, Sunlock_file): Declare subroutines.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test40-make-nearby-temp-file)
(tramp-archive-test43-file-system-info): Rename.

* test/lisp/net/tramp-tests.el (top): Set `create-lockfiles' to nil.
(tramp--test-fuse-p): New defun.
(tramp-test14-delete-directory): Use it.
(tramp-test39-lock-file): New test.
(tramp-test40-make-nearby-temp-file)
(tramp-test41-special-characters)
(tramp-test41-special-characters-with-stat)
(tramp-test41-special-characters-with-perl)
(tramp-test41-special-characters-with-ls, tramp-test42-utf8)
(tramp-test42-utf8-with-stat, tramp-test42-utf8-with-perl)
(tramp-test42-utf8-with-ls, tramp-test43-file-system-info)
(tramp-test44-asynchronous-requests, tramp-test45-auto-load)
(tramp-test45-delay-load, tramp-test45-recursive-load)
(tramp-test45-remote-load-path, tramp-test46-unload): Rename.
(tramp--test-special-characters, tramp--test-utf8)
(tramp--test-asynchronous-requests-timeout): Modify docstring.
2021-07-07 18:36:53 +02:00
Eli Zaretskii
10753bc688 Fix right-margin display on TTY frames
* src/dispnew.c (prepare_desired_row, adjust_glyph_matrix): Adjust
the glyph pointer of the right-margin area for all windows but the
rightmost ones on TTY frames, to account for the border glyph.
(Bug#48257)
2021-07-06 20:11:51 +03:00
Martin Rudalics
f7dcad9275 Show hand cursor when dragging frame (Bug#49247)
* src/xdisp.c (note_mode_line_or_margin_highlight): Show hand
cursor when dragging frame with mode, tab or header line.
(syms_of_xdisp): Define Qdrag_with_mode_line,
Qdrag_with_header_line and Qdrag_with_tab_line.
2021-07-05 10:53:39 +02:00
Jim Porter
2f2afa0b31 Ensure 'call-process' interprets INFILE as a local path
* src/callproc.c (get_current_directory): Rename from
'encode_current_directory' and add boolean ENCODE flag.
(Fcall_process): Interpret INFILE relative to the working directory
from which PROGRAM is run, not 'default-directory'.
(call_process): Use 'get_current_directory'.
* src/process.c (Fmake_process): Use 'get_current_directory'.
* src/process.h (get_current_directory): Rename decl from
'encode_current_directory'.
* src/sysdep.c (sys_subshell): Use 'get_current_directory' (bug#49283).
2021-07-04 15:32:03 +02:00
Alan Third
28fcdb5219 Fix crash in GNUstep font coverage check
* src/nsfont.m (ns_charset_covers): Check coverage more accurately and
don't automatically assume the buffer is 8192 bytes long.
2021-07-04 11:36:32 +01:00
Alan Third
0382aa1148 Remove unused variables
* src/nsterm.m ([EmacsView keyDown:]): Remove ns_fake_keydown as
there's no code that ever sets it to YES.
2021-07-04 11:36:24 +01:00
Alan Third
604133ee62 Fix thread memory management under NS
* src/thread.c (run_thread): Allocate an autorelease pool so that any
autoreleased Objective C objects are correctly released.
2021-07-04 11:36:17 +01:00
Alan Third
1b88404acc Fix NS self contained eln location (bug#49271)
* Makefile.in:
* configure.ac: Change eln file install location to
Contents/Frameworks.
* src/comp.c (hash_native_abi): Replace dots with underscores in the
eln install location as the macOS code-signing tool won't sign the
files if the parent directories have dots.
2021-07-01 20:41:58 +01:00
Alan Third
1dba0ca278 Fix NS port built with gcc
* src/nsterm.m (ns_relocate): The NSArray shorthand notation doesn't
work in GCC.
2021-06-29 22:18:33 +01:00
Martin Rudalics
6b4043833c In read_minibuf_unwind don't try to select dead window (Bug#49248)
* src/minibuf.c (read_minibuf_unwind): Don't try to select dead
window (Bug#49248).
2021-06-29 09:21:22 +02:00
Eli Zaretskii
a0f0609394 ; * src/lread.c (load_path_default): Remove unused variable. 2021-06-26 12:46:39 +03:00
Alan Third
5dd2d50f3d Fix NS native compilation builds
* Makefile.in (ns_applibexecdir):
(ns_applibdir):
(ns_appdir): New variables.
(.PHONY): Include new rule.
(epaths-force-ns-self-contained): Remove the app bundle directory from
all paths.
* configure.ac (NS_SELF_CONTAINED): Set the default site-lisp
directory instead of hard-coding it in the ObjC code, and use the new
epaths generating make rule.
* src/callproc.c (init_callproc_1):
(init_callproc): Remove all the NS specific code as the special cases
are now handled by decode_env_path.
* src/emacs.c (load_pdump):
(decode_env_path): Use ns_relocate to find the correct directory after
relocation.
* src/lread.c (load_path_default): Remove all the NS specific code as
the special cases are now handled by decode_env_path.
* src/nsterm.h: Update function definitions.
* src/nsterm.m (ns_etc_directory):
(ns_exec_path):
(ns_load_path): Remove functions that are no longer needed.
(ns_relocate): New function to calculate paths within the NS app
bundle.
* nextstep/Makefile.in (ns_applibexecdir): New variable, and update
anything relying on the libexec location.
2021-06-26 10:34:59 +01:00
Eli Zaretskii
6e0bff0296 Fix race conditions between Lisp threads in GTK builds
* src/xgselect.c (release_select_lock, acquire_select_lock)
[GCC >= 4.7.0]: Use '__atomic' builtins to prevent races between
threads in accessing 'threads_holding_glib_lock'.  Reported by
<dick.r.chiang@gmail.com>.  (Bug#36609)
2021-06-25 16:52:48 +03:00
Alan Third
434c059d83 Fix GNUstep menu update crashes
* src/nsmenu.m (ns_update_menubar): close the submenus before modifying them.
([EmacsMenu close]): Make sure to close all submenus.
2021-06-20 16:53:37 +01:00
Alan Third
0bd9e78256 Fix GNUstep build warnings
* src/nsterm.h ([EmacsWindow orderedIndex]):
* src/nsterm.m ([EmacsWindow orderedIndex]): Implement orderedIndex
for use under GNUstep.
* src/nsmenu.m (free_frame_menubar):
(ns_update_menubar):
([EmacsMenu addSubmenuWithTitle:]):
([EmacsMenu addItemWithWidgetValue:attributes:]): Cast return values
to correct types.
([EmacsMenu fillWithWidgetValue:]): Move variable definition inside
relevant #ifdef block.
([EmacsMenu menuWillOpen:]):
([EmacsMenu menuDidClose:]):
([EmacsMenu confinementRectForMenu:onScreen:]):
([EmacsMenu menu:willHighlightItem:]): New functions to silence build
warnings.
* src/nsfont.m (nsfont_open): Remove pointless fabs call.
2021-06-20 16:53:37 +01:00
dickmao
234bf1b636 De-obfuscate gnutls_handshake loop
* src/gnutls.c (gnutls_try_handshake): Rewrite the handshake loop
for greater clarity (bug#49055).
2021-06-19 15:19:04 +02:00
Mattias Engdegård
b9f339e8f8 ; * src/comp.c (ADD_IMPORTED): Fix broken macro. 2021-06-18 15:02:58 +02:00
Mattias Engdegård
7c22aa36cd Eliminate some GCC warnings
* src/doprnt.c (exprintf, evxprintf):
* src/lisp.h (exprintf, evxprintf): Don't use a pointer-to-const type
for the `nonheapbuf` argument: although it is never dereferenced, GCC
will warn when passing a pointer to uninitialised memory otherwise.
* src/fns.c (sort_vector_copy, realize_face, realize_gui_face)
(realize_tty_face): Use the same signatures in the prototypes as in
the actual function definitions.
2021-06-16 18:05:41 +02:00
Mattias Engdegård
706e186581 * src/xdisp.c (gui_draw_bottom_divider): Fix misleading indentation. 2021-06-16 11:37:00 +02:00
Pip Cet
d9698faa34 Prepare pdumper dump file in memory, write it in one go (Bug#46881)
* src/pdumper.c (struct dump_context): Add buf, buf_size, max_offset fields.
(dump_grow_buffer): New function.
(dump_write): Use memcpy, not an actual emacs_write.
(dump_seek): Keep track of maximum seen offset. Don't actually seek.
(Fdump_emacs_portable): Write out the file contents when done.
2021-06-16 09:44:32 +02:00
Lars Ingebrigtsen
81fd5603ce Add a new function syntax-class-to-char
* doc/lispref/syntax.texi (Syntax Table Internals): Document it.
* src/syntax.c (Fsyntax_class_to_char): New function (bug#37452).
2021-06-15 17:01:57 +02:00
Eli Zaretskii
bad87a162c ; * src/fileio.c (Fsubstitute_in_file_name): Doc fix. 2021-06-13 15:52:17 +03:00
Lars Ingebrigtsen
c4fcf2fc6f Fsubstitute_in_file_name doc string clarification
* src/fileio.c (Fsubstitute_in_file_name): Mention that undefined
variables aren't replaced (as opposed to what happens in a shell
substitution) (bug#40949).
2021-06-13 14:14:32 +02:00
Matt Beshara
57950515ec Add ability to bring only the selected frame to the front (bug#48865)
Causes ‘ns-hide-emacs’ to layer the selected frame in front of every other
application’s windows, and give that frame keyboard focus, when called with
'activate-front.

* src/nsfns.m (Fns_hide_emacs): Allow activating only selected frame.
2021-06-12 10:10:51 +01:00
Martin Rudalics
b3dd0ce75b Provide new option `delete-window-set-selected' (Bug#47300)
When `delete-window' deletes its frame's selected window, this new
option allows to choose another window as replacement.

* lisp/window.el (get-lru-window, get-mru-window)
(get-largest-window): New optional argument NO-OTHER.
(window-at-pos): New function.
(delete-window-set-selected): New option.
(delete-window): Handle `delete-window-set-selected'.
* src/window.c (Fdelete_window_internal): Set the selected
window of WINDOW's frame to the first window on that frame and
let `delete-window' choose a more suitable window instead.
* doc/lispref/windows.texi (Deleting Windows): Describe new
option `delete-window-set-selected'.
(Cyclic Window Ordering): Describe new NO-OTHER argument for
`get-lru-window', `get-mru-window' and `get-largest-window'.
* etc/NEWS: Mention `delete-window-set-selected' and the NO-OTHER
argument.
2021-06-10 09:14:21 +02:00