Paul Eggert [Sun, 17 Apr 2022 17:41:17 +0000 (10:41 -0700)]
Don’t assume openat
Use openat only on platforms with O_PATH.
This ports to OS X 10.9 and earlier.
Problem reported by Keith David Bershatsky in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg00805.html
* lib-src/emacsclient.c (local_sockname): Use open, not openat.
* src/sysdep.c (sys_openat): New static function,
which uses openat only if O_PATH is defined.
(emacs_openat): Use it instead of openat.
(emacs_openat_noquit): Remove.
(emacs_open_noquit): Reimplement as per the old emacs_openat_noquit,
but use plain 'open'.
Paul Eggert [Sun, 17 Apr 2022 08:06:46 +0000 (01:06 -0700)]
Fix GC bug in filelock.c
Fix a bug where if GC occurred at the wrong moment when locking a
file, the lock file’s name was trashed so file locking did not work.
This bug was introduced in Emacs 28.1. The bug sometimes caused
filelock-tests-detect-external-change test failures on Fedora 35
x86-64 in an en_US.utf8 locale.
* src/filelock.c (lock_file_1, current_lock_owner, lock_if_free)
(lock_file, unlock_file, Ffile_locked_p):
Use Lisp_Object, not char *, for string, so that GC doesn’t trash
string contents.
(make_lock_file_name): Return the encoded name, not the original.
All callers changed.
This adds back macOS-specific code replaced earlier (bug#48548),
specifically to fix build errors on macOS 10.7.5. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2022-04/msg00779.html .
* src/sysdep.c (HAVE_RUSAGE_INFO_CURRENT, HAVE_PROC_PIDINFO): New.
(system_process_attributes): Use alternative code or exclude features
when building on older macOS versions.
Eli Zaretskii [Fri, 15 Apr 2022 20:03:15 +0000 (23:03 +0300)]
Improve discoverability of 'insert-directory-program'
* lisp/files.el (insert-directory-program): Mention 'dired' in the
doc string.
* lisp/dired.el (dired): Mention 'insert-directory-program' in the
doc string. (Bug#54962)
Eli Zaretskii [Fri, 15 Apr 2022 09:03:36 +0000 (12:03 +0300)]
Fix cursor motion under truncate-lines with Flymake fringe indicator
* src/indent.c (Fvertical_motion): Don't consider fringe bitmaps
as "images" for the purpose of vertical-motion logic dealing with
overshooting buffer positions. (Bug#54946)
Make all vc-*-responsible-p functions return a string
* lisp/vc/vc-sccs.el (vc-sccs-responsible-p):
* lisp/vc/vc-rcs.el (vc-rcs-responsible-p):
* lisp/vc/vc-dav.el (vc-dav-responsible-p):
* lisp/vc/vc-cvs.el (vc-cvs-responsible-p): Return a file name
instead of t when we get a match (which is what
vc-backend-for-registration expects) (bug#51800).
Eli Zaretskii [Tue, 12 Apr 2022 14:05:15 +0000 (17:05 +0300)]
Fix 'window-text-pixel-width' when starting from display property
* src/xdisp.c (Fwindow_text_pixel_size): Handle the case where
there's a display property at START, and move_it_to overshoots.
Do not merge to master. (Bug#54862)
Eli Zaretskii [Mon, 11 Apr 2022 11:31:04 +0000 (14:31 +0300)]
Fix default-directory of buffers visiting files in renamed directories
* lisp/dired-aux.el (dired-rename-file): Take note of whether FILE
is a directory before it is renamed, which makes it impossible to
determine if it was a directory.
(dired-rename-subdir, dired-rename-subdir-1): Revert to using
dired-in-this-tree-p instead of file-in-directory-p, for the
benefit of files that were renamed/removed, because
file-in-directory-p returns nil in those cases. (Bug#54838)
* msdos/sed1v2.inp (MAKE_PDUMPER_FINGERPRINT): Fix indentation, so
that Make won't consider this line a command.
($(etc)/DOC): Chdir back to ../src, since "make-docfile -d" leaves
us in a wrong directory.
* msdos/sedlibmk.inp (GL_GNULIB_GETRANDOM, GL_GNULIB_MEMMEM)
(GL_GNULIB_SIGDESCR_NP): Define to 1, to get the prototypes from
Gnulib headers.
Eli Zaretskii [Fri, 8 Apr 2022 18:11:16 +0000 (21:11 +0300)]
Update and fix instructions and scripts for updating the Web pages
* admin/admin.el (manual-html-fix-index-2): Support Texinfo 6.8
and later by not converting TOC menus into tables. (Bug#49719)
* admin/upload-manuals (New directory): Invoke "cvs add" in
$webdir, to pick up the correct CVSROOT.
* admin/make-tarball.txt: Update the section about the Emacs Web
pages.
* etc/refcards/Makefile (pl-refcard.dvi): If mex.fmt cannot be
found, invoke 'mex' instead of 'tex'.
Eli Zaretskii [Fri, 8 Apr 2022 06:48:15 +0000 (09:48 +0300)]
Clarify "idleness" in the ELisp manual
* doc/lispref/os.texi (Idle Timers): Clarify that waiting for
input with timeout doesn't make Emacs idle. Suggested by Ignacio
<ignaciocasso@hotmail.com>. (Bug#54371)
Jürgen Hötzel [Fri, 4 Mar 2022 09:08:14 +0000 (10:08 +0100)]
Use correct signal oldset in posix_spawn implementation
posix_spawn was restoring the wrong signal set, which still had
SIGCHLD and SIGINT masked, causing problems with child processes that
spawned child processes. (Bug#54667)
See the thread ending at
https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00067.html
for more details.
Felix Dietrich [Thu, 7 Apr 2022 10:04:22 +0000 (12:04 +0200)]
Fix error in tramp-archive-autoload-file-name-handler
* lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-handler):
Always call `tramp-autoload-file-name'. Otherwise, when
`tramp-archive-enabled’ is nil and
`tramp-archive-autoload-file-name-handler’ is in the
`file-name-handler-alist’ results in an error “Invalid handler in
`file-name-handler-alist” once Emacs calls
`tramp-archive-autoload-file-name-handler’ with a handler that
does not expect nil. Always returning nil is also false in
general.
* lisp/net/tramp-adb.el (tramp-adb-tolerate-tilde):
* lisp/net/tramp-sshfs.el (tramp-sshfs-tolerate-tilde):
New defuns. Advice `shell-mode' with them.
* lisp/net/tramp.el (tramp-register-autoload-file-name-handlers):
* lisp/net/tramp-archive.el (tramp-register-archive-file-name-handler):
Check, whether the real file name handler is already registered.
rules. (Bug#54542)
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Use `tramp-handle-file-notify-add-watch',
`tramp-handle-file-notify-rm-watch' and
`tramp-handle-file-notify-valid-p'.
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Use `tramp-handle-insert-file-contents'.
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection):
* lisp/net/lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection):
* tramp-sudoedit.el (tramp-sudoedit-maybe-open-connection): Do not
set "lock-pid" connection-property.
(tramp-sudoedit-handle-delete-file): Use "rm -f".
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-executable-p):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-executable-p):
Check also for setuid/setgid bit.
(tramp-gvfs-handle-expand-file-name):
Respect `tramp-tolerate-tilde'.
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Do not modify disk space information when
`dired--insert-disk-space' is available. (Bug#54512)
* lisp/net/tramp-sh.el (tramp-maybe-open-connection): Extend suppression
(tramp-get-remote-dev-tty): New defun.
(tramp-sh-handle-make-process): Use it.
* lisp/net/tramp-sshfs.el (tramp-methods) <sshfs>:
Add "-t -t" to `tramp-login-args'.
Add "-o dir_cache=no" to `tramp-mount-args'. (Bug#54126)
Add "-o transform_symlinks" to `tramp-mount-args'.
(tramp-sshfs-file-name-handler-alist):
Use `tramp-sshfs-handle-file-writable-p'.
(tramp-sshfs-handle-file-writable-p): New defun. (Bug#54130)
(tramp-sshfs-handle-write-region): Set file modification time.
(Bug#54016)
(tramp-sshfs-file-name-handler-alist):
Use `tramp-sshfs-handle-set-file-times'.
(tramp-sshfs-handle-set-file-times): New defun.
* test/lisp/net/tramp-tests.el (tramp--test-expensive-test-p):
Rename from `tramp--test-expensive-test'. Make it a defun. Adapt
all callees.
(tramp-test07-file-exists-p, tramp-test14-delete-directory)
(tramp-test18-file-attributes, tramp-test20-file-modes)
(tramp-test28-process-file, tramp-test29-start-file-process)
(tramp-test30-make-process, tramp-test32-shell-command)
(tramp-test33-environment-variables, tramp--test-check-files)
(tramp--test-special-characters, tramp-test46-unload): Adapt tests.
(tramp-test39-detect-external-change): New test.
(tramp-test29-start-file-process)
(tramp--test--deftest-direct-async-process)
(tramp-test30-make-process, tramp-test31-interrupt-process)
(tramp-test34-explicit-shell-file-name)
(tramp-test44-asynchronous-requests):
Add :tramp-asynchronous-processes tag.
(tramp--test-asynchronous-processes-p): New defun.
(tramp--test-hpux-p, tramp--test-macos-p): Protect against errors.
Tassilo Horn [Wed, 30 Mar 2022 17:49:01 +0000 (19:49 +0200)]
dired: implement feature from 7b50ed553f differently
* lisp/dired.el (dired-buffers-for-dir): Restore to emacs-27 version.
(dired-buffers-for-dir-or-subdir): New function.
(dired-clean-up-after-deletion): Use dired-buffers-for-dir-or-subdir
instead dired-buffers-for-dir.
Eli Zaretskii [Thu, 24 Mar 2022 15:22:43 +0000 (17:22 +0200)]
Clarify the description of "selected tags table"
* doc/emacs/maintaining.texi (Select Tags Table): Clarify the
distinction between the "selected tags table" and the "current
list of tags tables". (Bug#54543)
Eli Zaretskii [Sat, 19 Mar 2022 07:19:53 +0000 (09:19 +0200)]
Fix region highlight in non-selected windows
* src/xdisp.c (prepare_menu_bars): Include in the windows passed
to pre-redisplay-functions windows whose point was moved from the
last recorded position. (Bug#54450)
Eli Zaretskii [Sat, 12 Mar 2022 08:28:45 +0000 (03:28 -0500)]
; Fix data structures in authors.el
* admin/authors.el (authors-aliases, authors-renamed-files-alist):
Update and correct the databases.
(authors-renamed-files-alist): Add commentary explaining how to
add entries for renamed/moved files.
(authors-canonical-file-name): Clarify the semantics of the
arguments.
Eli Zaretskii [Thu, 10 Mar 2022 18:26:13 +0000 (20:26 +0200)]
Fix regression in 'custom-prompt-customize-unsaved-options'
* lisp/cus-edit.el (custom-prompt-customize-unsaved-options):
Don't depend on the value returned by 'customize-unsaved'. Fix
the doc string. Patch by Sebastian Miele <iota@whxvd.name>.
(Bug#54329)
Restore documented Emacs 27.2 behaviour of browse-url-of-dired-file
* lisp/net/browse-url.el (browse-url-of-dired-file): Restore the
documented behaviour -- open a web browser instead of passing to
the various handlers.
Eli Zaretskii [Thu, 3 Mar 2022 18:31:33 +0000 (20:31 +0200)]
Avoid crashes when fringe bitmaps are defined in daemon mode
* src/dispextern.h (gui_define_fringe_bitmap): Add prototype.
(max_used_fringe_bitmap): Add declaration.
* src/fringe.c (gui_define_fringe_bitmap): New function.
* src/w32term.c (w32_draw_fringe_bitmap):
* src/xterm.c (x_draw_fringe_bitmap) [USE_CAIRO]: Call
'gui_define_fringe_bitmap' if the terminal-specific bitmap data is
not available when a fringe bitmap is about to be drawn. Don't
try to draw a bitmap that is not known to fringe.c. (Bug#54183)
Eli Zaretskii [Thu, 3 Mar 2022 13:53:04 +0000 (15:53 +0200)]
One more fix of the BPA implementation
* src/bidi.c (bidi_find_bracket_pairs): Disable BPA optimization
when there are no strong directional characters inside the
bracketed pair. (Bug#54219)
Eli Zaretskii [Thu, 3 Mar 2022 12:46:20 +0000 (14:46 +0200)]
Fix handling of brackets in BPA
* src/bidi.c (bidi_resolve_brackets): Fix implementation of UBA's
N0 rule when there are no strong directional characters inside the
bracketed pair. (Bug#54219)
Eli Zaretskii [Sat, 26 Feb 2022 07:41:05 +0000 (09:41 +0200)]
Document better how to reset attributes of faces for new frames
* doc/lispref/display.texi (Attribute Functions):
* lisp/faces.el (set-face-attribute): Explain how to reset an
attribute's value for future frames. (Bug#54156)
Philipp Stephani [Tue, 22 Feb 2022 20:39:32 +0000 (21:39 +0100)]
Fix indexing of module functions that return enumeration types.
Return types that consist of more than one word need to be enclosed in
braces, see Info node `(texinfo) Typed Functions'. Otherwise they are
indexed incorrectly.
Eli Zaretskii [Mon, 21 Feb 2022 20:12:57 +0000 (22:12 +0200)]
Fix 'display-line-numbers-mode' in hide-show buffers
* src/xdisp.c (redisplay_internal): Disable redisplay
optimizations that consider just the current line, when
'display-line-numbers-mode' is turned on in the buffer.
(Bug#54091)
Eli Zaretskii [Fri, 18 Feb 2022 07:47:44 +0000 (09:47 +0200)]
Improve documentation of filling and justification commands
* doc/lispref/text.texi (Filling):
* lisp/textmodes/fill.el (fill-region-as-paragraph)
(default-justification, set-justification, justify-current-line):
Clarify "canonicalization" of spaces and the meaning of
justification styles. (Bug#54047)
(set-justification-left, set-justification-right)
(set-justification-full): Improve wording of doc strings.