]> git.eshelyaron.com Git - emacs.git/log
emacs.git
16 months agoUpdate Android port
Po Lu [Mon, 31 Jul 2023 12:33:27 +0000 (20:33 +0800)]
Update Android port

* src/sfnt.c (ISECT): Micro-optimize this instruction.
* src/sfntfont.c (sfnt_parse_style): Avoid GC safety problem.

16 months ago; Update Android port
Po Lu [Mon, 31 Jul 2023 09:59:26 +0000 (17:59 +0800)]
; Update Android port

* src/sfntfont.c (sfnt_parse_style): Fix misworded commentary.

16 months agoInitialize Android API level earlier
Po Lu [Mon, 31 Jul 2023 06:18:12 +0000 (14:18 +0800)]
Initialize Android API level earlier

* java/org/gnu/emacs/EmacsNative.java (EmacsNative):
* java/org/gnu/emacs/EmacsNoninteractive.java (main):
* java/org/gnu/emacs/EmacsService.java (run):
* java/org/gnu/emacs/EmacsThread.java (run):
* src/android.c (initEmacs, setEmacsParams): Set
`android_api_level' within setEmacsParams, not in initEmacs.
* src/androidvfs.c: Pacify compiler warnings.

16 months agoImplement cross-directory SAF rename operations
Po Lu [Mon, 31 Jul 2023 02:50:12 +0000 (10:50 +0800)]
Implement cross-directory SAF rename operations

* java/org/gnu/emacs/EmacsService.java (renameDocument): Don't
catch UnsupportedOperationException; handle ENOSYS in
android_saf_rename_document instead.
(moveDocument): New function.
* lisp/subr.el (y-or-n-p): Always change the text conversion
style.
* src/android.c (android_init_emacs_service)
(android_exception_check_4): New function.
* src/android.h: Update Java function table.
* src/androidvfs.c (android_saf_rename_document): Handle ENOSYS
here by setting errno to EXDEV.
(android_saf_move_document): New function.
(android_document_id_from_name): Take const `dir_name'.
(android_saf_tree_rename): Use delete-move-rename to implement
cross-directory renames.

16 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Mon, 31 Jul 2023 00:42:03 +0000 (08:42 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

16 months agoAvoid face attribute warnings in themes
Mattias Engdegård [Sun, 30 Jul 2023 16:42:13 +0000 (18:42 +0200)]
Avoid face attribute warnings in themes

* etc/themes/deeper-blue-theme.el (class):
* etc/themes/leuven-dark-theme.el (class):
* etc/themes/leuven-theme.el (class):
* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/whiteboard-theme.el (class):
Use `unspecified` instead of `nil` as attribute for :background and
:foreground to silence HANDLE_INVALID_NIL_VALUE warning.

16 months agoFix rx wrong-code bug: ranges starting with ^
Mattias Engdegård [Sun, 30 Jul 2023 13:30:38 +0000 (15:30 +0200)]
Fix rx wrong-code bug: ranges starting with ^

(rx (in (?^ . ?a))) was incorrectly translated to "[^-a]".
Change it so that we get "[_-a^]" instead.

* lisp/emacs-lisp/rx.el (rx--generate-alt): Split ranges starting with
`^` occurring first in a non-negated character alternative.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add and adapt tests.

16 months ago; Fixh last change
Michael Albinus [Sun, 30 Jul 2023 14:53:37 +0000 (16:53 +0200)]
; Fixh last change

* lisp/net/tramp-message.el (tramp-file-name-host-port)
(tramp-file-name-user-domain): Declare.
(tramp-message): Remove declare form.  Add `tramp-suppress-trace'
function property.

* lisp/net/tramp.el (tramp-file-name-user-domain)
(tramp-file-name-host-port): Remove ;;;###tramp-autoload cookie.
(tramp-file-name-unify, tramp-dissect-file-name)
(tramp-ensure-dissected-file-name): Remove declare form.  Add
`tramp-suppress-trace' function property.

16 months agoAllow default values in 'map-let' and the pcase 'map' form
Earl Hyatt [Fri, 21 Jul 2023 01:44:41 +0000 (21:44 -0400)]
Allow default values in 'map-let' and the pcase 'map' form

* lisp/emacs-lisp/map.el (map-let, map)
(map--make-pcase-bindings): Add a third argument for specifying a
default value, like in 'map-elt'. (Bug#49407)

* lisp/emacs-lisp/map.el (map--make-pcase-bindings): Clarify that keys
that aren't found aren't ignored, they actually get the value
nil (unless the new default value is given).  The overall pattern can
still fail to match if the sub-pattern for the unfound key doesn't
match nil.

* test/lisp/emacs-lisp/map-tests.el (test-map-let-default)
(test-map-plist-pcase-default, test-map-pcase-matches): Add tests,
including for the above item.

16 months agoFinish Tramp reorganization
Michael Albinus [Sun, 30 Jul 2023 13:10:48 +0000 (15:10 +0200)]
Finish Tramp reorganization

* lisp/net/tramp-compat.el (subr-x): Don't require.
(top): Use `function-put' but `put'.

* lisp/net/tramp-gvfs.el (tramp-dbus-function): Add declare form.

* lisp/net/tramp-message.el (tramp-byte-run--set-suppress-trace):
New function.  Add it to `defun-declarations-alist'.
(tramp-setup-debug-buffer, tramp-debug-buffer-name)
(tramp-get-debug-buffer, tramp-get-debug-file-name)
(tramp-trace-buffer-name, tramp-debug-message, tramp-message):
Add declare form.
(tramp-debug-buffer-name): Use `tramp-string-empty-or-nil-p'.
(tramp-test-message): New defun.

* lisp/net/tramp.el (top): Use `function-put' but `put'.
(tramp-file-name-user-domain, tramp-file-name-host-port)
(tramp-file-name-port-or-default, tramp-file-name-unify)
(tramp-dissect-file-name, tramp-ensure-dissected-file-name)
(tramp-dissect-hop-name, tramp-make-tramp-file-name)
(tramp-signal-hook-function, tramp-post-process-creation)
(tramp-read-passwd, tramp-read-passwd-without-cache)
(tramp-clear-passwd): Add declare form.
(tramp-string-empty-or-nil-p): Add ;;;###tramp-autoload cookie.
(tramp-test-message): Move to tramp-message.el.

16 months agoPartially implement rename operations on SAF files
Po Lu [Sun, 30 Jul 2023 05:39:27 +0000 (13:39 +0800)]
Partially implement rename operations on SAF files

* java/org/gnu/emacs/EmacsSafThread.java
(postInvalidateCacheDir):
* java/org/gnu/emacs/EmacsService.java (renameDocument): New
functions.
* src/android.c (android_init_emacs_service):
* src/android.h (struct android_emacs_service): Link to new JNI
function.
* src/androidvfs.c (android_saf_rename_document): New function.
(android_saf_tree_rename): Implement in terms of that function
if possible.

16 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sun, 30 Jul 2023 00:15:26 +0000 (08:15 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

16 months ago; * lisp/format.el (format-alist): Update URL in comment.
Ulrich Müller [Sat, 29 Jul 2023 15:20:06 +0000 (17:20 +0200)]
; * lisp/format.el (format-alist): Update URL in comment.

16 months ago; Fix conversions in format.el (bug#64928)
Ulrich Müller [Sat, 29 Jul 2023 09:37:45 +0000 (11:37 +0200)]
; Fix conversions in format.el (bug#64928)

* lisp/format.el (format-alist): Fix duden and de646 conversions.

16 months agoCorrect directory permissions reported for VFS files
Po Lu [Sat, 29 Jul 2023 12:53:21 +0000 (20:53 +0800)]
Correct directory permissions reported for VFS files

* java/org/gnu/emacs/EmacsSafThread.java (statDocument1):
* src/androidvfs.c (android_afs_stat, android_content_stat)
(android_saf_root_stat): Report search permissions for files.

16 months ago; * lisp/jsonrpc.el (jsonrpc-error): Fix typo.
Michael Albinus [Sat, 29 Jul 2023 11:23:19 +0000 (13:23 +0200)]
; * lisp/jsonrpc.el (jsonrpc-error): Fix typo.

16 months agoReorganize Tramp's messages
Michael Albinus [Sat, 29 Jul 2023 11:11:01 +0000 (13:11 +0200)]
Reorganize Tramp's messages

* doc/misc/tramp.texi (Traces and Profiles): Use proper buffer
names.  Add tramp-debug-command-messages.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler):
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler):
Set `tramp-debug-message-fnh-function'.

* lisp/net/tramp.el (tramp-file-name-handler):
* lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection):
* lisp/net/tramp-crypt.el (tramp-crypt-maybe-open-connection):
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
* lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-maybe-open-connection):
Wrap code `with-tramp-debug-message'.

* lisp/net/tramp-message.el: New file.

* lisp/net/tramp.el (tramp-message): Require.
(tramp-verbose, tramp-debug-to-file, tramp-debug-buffer-name)
(tramp-debug-outline-regexp, tramp-debug-font-lock-keywords)
(tramp-debug-outline-level)
(tramp-debug-buffer-command-completion-p)
(tramp-setup-debug-buffer, tramp-get-debug-buffer)
(tramp-get-debug-file-name, tramp-trace-buffer-name)
(tramp-trace-functions, tramp-debug-message, tramp-message)
(tramp-backtrace, tramp-error, tramp-error-show-message-timeout)
(tramp-error-with-buffer, tramp-user-error)
(tramp-with-demoted-errors): Move to tramp-message.el.
(tramp-current-connection, tramp-file-name-user-domain)
(tramp-file-name-host-port): Add ;;;###tramp-autoload cookie.
(tramp-inhibit-progress-reporter): Move down.
(tramp-post-process-creation): Write debug message only when there
is a command.

* lisp/net/trampver.el (tramp-repository-branch)
(tramp-repository-version): Add ;;;###tramp-autoload cookie.

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Don't bind `trace-buffer'.

16 months agoJsonrpc: fix error code in jsonrpc-error function (bug#64888)
João Távora [Sat, 29 Jul 2023 10:15:14 +0000 (11:15 +0100)]
Jsonrpc: fix error code in jsonrpc-error function (bug#64888)

* lisp/jsonrpc.el (jsonrpc-error): Fix error code.

16 months agoJsonrpc: fix default value of success-fn (bug#64919)
João Távora [Sat, 29 Jul 2023 10:08:51 +0000 (11:08 +0100)]
Jsonrpc: fix default value of success-fn (bug#64919)

* lisp/jsonrpc.el (jsonrpc--async-request-1): Fix default value of
success-fn.

16 months ago; Update Android port
Po Lu [Sat, 29 Jul 2023 10:00:09 +0000 (18:00 +0800)]
; Update Android port

* src/androidvfs.c: Improve commentary.

16 months agoUpdate Android port
Po Lu [Sat, 29 Jul 2023 07:57:44 +0000 (15:57 +0800)]
Update Android port

* java/org/gnu/emacs/EmacsSafThread.java (postInvalidateCache):
New argument cacheName.  Remove that file from the cache.
(accessDocument1): Consult the storage cache as well.
* java/org/gnu/emacs/EmacsService.java (deleteDocument): New
argument NAME.

* src/android.c (android_init_emacs_service): Add new argument.
* src/androidvfs.c (android_saf_delete_document)
(android_saf_tree_rmdir, android_saf_file_unlink): Pass name of
file being deleted to `deleteDocument'.

16 months ago; Update Android port
Po Lu [Sat, 29 Jul 2023 04:50:06 +0000 (12:50 +0800)]
; Update Android port

* src/androidvfs.c (android_saf_exception_check): Describe
exceptions earlier.

16 months agoUpdate Android port
Po Lu [Sat, 29 Jul 2023 04:49:36 +0000 (12:49 +0800)]
Update Android port

* java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry):
(getCacheEntry):
(CacheEntry):
(documentIdFromName1): Fix earlier change.

16 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sat, 29 Jul 2023 03:29:42 +0000 (11:29 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

16 months agoUpdate Android port
Po Lu [Sat, 29 Jul 2023 03:29:25 +0000 (11:29 +0800)]
Update Android port

* java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry)
(getCacheEntry, CacheEntry): Use `uptimeMillis' as the basis for
cache expiration.

16 months agoUpdate Android port
Po Lu [Sat, 29 Jul 2023 03:24:07 +0000 (11:24 +0800)]
Update Android port

* java/org/gnu/emacs/EmacsSafThread.java (EmacsSafThread, getCache)
(pruneCache1, pruneCache, cacheChild, cacheDirectoryFromCursor)
(documentIdFromName1, openDocumentDirectory1): Implement the
cache referred to by the commentary.
* java/org/gnu/emacs/EmacsService.java (deleteDocument):
Invalidate the cache upon document removal.
* src/androidvfs.c (android_saf_exception_check)
(android_document_id_from_name): Correctly preserve or set errno
in error cases.

16 months agoSimplify multi-frame behavior in erc-bufbar-mode
F. Jason Park [Mon, 24 Jul 2023 06:09:42 +0000 (23:09 -0700)]
Simplify multi-frame behavior in erc-bufbar-mode

* lisp/erc/erc-status-sidebar.el (erc-status-sidebar-singular,
erc-status-sidebar--singular-p): Replace option new in ERC 5.6 with
the latter, an internal flag.
(erc-status-sidebar-get-window): Use new name for option turned
ordinary variable `erc-status-sidebar--singular-p'.
(erc-status-sidebar-close): Add comment.
(erc-status-sidebar--open): New function containing the old body of
`erc-status-sidebar-open'.
(erc-bufbar-mode, erc-bufbar-enable, erc-bufbar-disable): Update
variable names.  Close sidebar window on all frames when disabling,
and don't set mode variable to nil when enabling.  These may have made
some practical sense but were illogical.  For example, it's confusing
to leave `erc-status-sidebar--open' in `erc--setup-buffer-hook' while
reporting the mode as being disabled.
(erc-status-sidebar-open): Move to slightly later in same file, after
defining `erc-bufbar-mode'.  When `erc-bufbar-mode' is active, always
create a sidebar if needed, even when another frame is already
displaying one.
(erc-status-toggle-sidebar): When `erc-bufbar-mode' is disabled,
revert to pre-5.6 behavior.  When the module is enabled, adopt new
behavior of ensuring the current frame shows a sidebar, even if
another frame already has one.
(erc-status-sidebar-refresh): Save and restore `window-start' in all
windows showing a sidebar buffer after refreshing.  Update option and
variable names.
(erc-status-sidebar-refresh-triggers): Add doc string, noting that the
variable is set locally when the option
`erc-status-sidebar-highlight-active-buffer' is non-nil.
(erc-status-sidebar--highlight-refresh-triggers): New variable
containing additional triggers enabled when the option
`erc-status-highlight-active-buffer' is non-nil.
(erc-status-sidebar--refresh-unless-input): New function to run
`erc-status-sidebar-refresh' unless input is pending or the selected
window's buffer is a minibuffer.
(erc-status-sidebar--post-refresh): Call `erc-status-sidebar-refresh'
wrapper `erc-status-sidebar--refresh-unless-input' instead.
(erc-status-sidebar-set-window-preserve-size): Update var name to
`erc-status-sidebar--singular-p'.
(erc-status-sidebar-mode): Run `erc-status-sidebar--post-refresh' on
`window-selection-change-functions' globally when highlighting active
buffers.  (bug#63595)

16 months ago; Add example buffer-display option to ERC's manual
F. Jason Park [Sun, 23 Jul 2023 12:05:13 +0000 (05:05 -0700)]
; Add example buffer-display option to ERC's manual

* doc/misc/erc.texi: Add customization for `erc-interactive-display'
to Sample Configuration section.
* etc/ERC-NEWS: Improve various entries, like those for
`keep-place-indicator', `fill-wrap', `bufbar', etc.

16 months agoFix CTCP ACTION regression in erc-fill-wrap
F. Jason Park [Sat, 22 Jul 2023 21:07:38 +0000 (14:07 -0700)]
Fix CTCP ACTION regression in erc-fill-wrap

* lisp/erc/erc-fill.el (erc-fill--wrap-continued-message-p): Return
nil when current message is a CTCP ACTION.  This fixes a regression
introduced by 63d8b2a59a4 "Make erc-fill-wrap work with left-sided
stamps".
* test/lisp/erc/erc-fill-tests.el: (erc-fill-wrap--merge-action):
New test.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: New
test data file.  (Bug#60936)

16 months ago; Avoid recent tar-mode.el constant mutation
Basil L. Contovounesios [Fri, 28 Jul 2023 16:35:20 +0000 (18:35 +0200)]
; Avoid recent tar-mode.el constant mutation

* lisp/tar-mode.el (tar-attr-vector): Initialize with fresh vector
to avoid constant vector mutation (bug#64686).
(tar-parse-pax-extended-header): Use fillarray.

17 months agoAvoid spurious whitespace in the modeline of emacsclient frames
Ulrich Müller [Fri, 28 Jul 2023 10:21:42 +0000 (12:21 +0200)]
Avoid spurious whitespace in the modeline of emacsclient frames

* lisp/bindings.el (mode-line-client): Compute 'help-echotext
property in advance.  (Bug#58183)

17 months agoMake shell command status code checks more robust
Tassilo Horn [Fri, 28 Jul 2023 10:26:49 +0000 (12:26 +0200)]
Make shell command status code checks more robust

* lisp/doc-view.el (doc-view-ghostscript-program)
(doc-view--revert-buffer, doc-view--pdf-outline): Compare
'shell-command' / 'call-process' return values with 'eql' instead of
'=' to cater for the situation where the process received a signal.

17 months agoClarify docs about regexp syntax-dependent character classes
Mattias Engdegård [Fri, 28 Jul 2023 09:14:01 +0000 (11:14 +0200)]
Clarify docs about regexp syntax-dependent character classes

* doc/lispref/searching.texi (Char Classes, Rx Constructs)
(Regexp Problems): Note that character classes don't take syntax
properties into account.

17 months agoMake uniquify-tests work with out-of-tree builds and clean up
Mattias Engdegård [Fri, 28 Jul 2023 09:12:09 +0000 (11:12 +0200)]
Make uniquify-tests work with out-of-tree builds and clean up

* test/lisp/uniquify-tests.el (uniquify-project-transform):
Set an explicit default-directory.
* test/lisp/uniquify-tests.el (uniquify-dirs): Remove temporary
directory after test.

17 months agoFix SAF query
Po Lu [Fri, 28 Jul 2023 08:43:40 +0000 (16:43 +0800)]
Fix SAF query

* java/org/gnu/emacs/EmacsSafThread.java (documentIdFromName1):
Fix query argument placeholder string.

17 months agoUpdate Android port
Po Lu [Fri, 28 Jul 2023 07:45:35 +0000 (15:45 +0800)]
Update Android port

* src/androidvfs.c (android_document_id_from_name): Don't return
0 if an SAF exception occurs.

17 months agoAvoid crashes when the primary clip is empty
Po Lu [Fri, 28 Jul 2023 07:24:47 +0000 (15:24 +0800)]
Avoid crashes when the primary clip is empty

* src/androidselect.c (Fandroid_get_clipboard): Don't return
data if clipboard is empty.  Reported by Johan Widén
<j.e.widen@gmail.com>.

17 months agoAllow quitting from Android content provider operations
Po Lu [Fri, 28 Jul 2023 07:19:37 +0000 (15:19 +0800)]
Allow quitting from Android content provider operations

* doc/emacs/android.texi (Android Document Providers): Say that
quitting is now possible.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
functions `safSyncAndReadInput', `safync' and `safPostRequest'.
* java/org/gnu/emacs/EmacsSafThread.java: New file.  Move
cancel-able SAF operations here.
* java/org/gnu/emacs/EmacsService.java (EmacsService): Allow
quitting from most SAF operations.
* src/androidvfs.c (android_saf_exception_check): Return EINTR
if OperationCanceledException is received.
(android_saf_stat, android_saf_access)
(android_document_id_from_name, android_saf_tree_opendir_1)
(android_saf_file_open): Don't allow reentrant calls from async
input handlers.
(NATIVE_NAME): Implement new synchronization primitives for JNI.
(android_vfs_init): Initialize new class.

* src/dired.c (open_directory): Handle EINTR from opendir.
* src/sysdep.c: Describe which operations may return EINTR on
Android.

17 months agoFix image-dired-utils-tests after 83b6a8a5147 (bug#61394)
Manuel Giraud [Thu, 27 Jul 2023 21:26:30 +0000 (23:26 +0200)]
Fix image-dired-utils-tests after 83b6a8a5147 (bug#61394)

17 months agoFix userlock.el and filelock-tests in some rare cases
Eli Zaretskii [Fri, 28 Jul 2023 06:31:25 +0000 (09:31 +0300)]
Fix userlock.el and filelock-tests in some rare cases

* lisp/userlock.el (userlock--check-content-unchanged): Don't
assume 'file-truename' of FILENAME is always non-nil.  It could be
nil if we are called from a temporary buffer where some Lisp
program has forcibly set 'buffer-file-name'.  (Bug#64821)

* test/src/filelock-tests.el (filelock-tests--fixture): Set
'buffer-file-name' to the true name of the temporary file.
Patch by Mattias Engdegård <mattias.engdegard@gmail.com>.
(filelock-tests-detect-external-change): Quote the file names
passed to shell commands.

17 months ago; Make doc-viev-imenu-enabled default value a boolean again
Tassilo Horn [Fri, 28 Jul 2023 05:07:45 +0000 (07:07 +0200)]
; Make doc-viev-imenu-enabled default value a boolean again

17 months agoUpdate Android port
Po Lu [Fri, 28 Jul 2023 04:21:47 +0000 (12:21 +0800)]
Update Android port

* java/org/gnu/emacs/EmacsDirectoryEntry.java
(EmacsDirectoryEntry): Make class final.
* java/org/gnu/emacs/EmacsService.java (accessDocument)
(openDocumentDirectory, openDocument, createDocument): Throw
access and IO error exceptions instead of catching them.
(createDirectory, deleteDocument): New functions.
* src/android.c (android_init_emacs_service): Add new functions.
* src/android.h (struct android_emacs_service): Likewise.
* src/androidvfs.c (android_saf_exception_check): New function.
Translate between Java exceptions and errno values.
(android_saf_stat, android_saf_access, android_saf_delete_document)
(struct android_saf_tree_vnode, android_document_id_from_name)
(android_saf_tree_name, android_saf_tree_rmdir)
(android_saf_tree_opendir_1, android_saf_tree_opendir)
(android_saf_file_open, android_saf_file_unlink)
(android_saf_new_open, android_saf_new_mkdir): Implement missing
VFS operations and derive errno values from the type of any
exceptions thrown.
(android_vfs_init): Initialize exception classes.
(android_mkdir, android_fstat): Remove trailing whitespace.

17 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Fri, 28 Jul 2023 00:22:01 +0000 (08:22 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

17 months ago; * lisp/tar-mode.el (tar-header-block-tokenize): Fix logic (bug#64686).
Eli Zaretskii [Thu, 27 Jul 2023 16:09:33 +0000 (19:09 +0300)]
; * lisp/tar-mode.el (tar-header-block-tokenize): Fix logic (bug#64686).

17 months agoFix function help for advised aliases (bug#64797)
Mattias Engdegård [Thu, 27 Jul 2023 14:13:54 +0000 (16:13 +0200)]
Fix function help for advised aliases (bug#64797)

* lisp/help-fns.el (help-fns--analyze-function):
For aliases, use the base function name if at the end of the chain.
This fixes a regression introduced in d30fde6b0cc.

Reported by Michael Heerdegen.

17 months ago* lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Extend
Mattias Engdegård [Thu, 27 Jul 2023 07:55:43 +0000 (09:55 +0200)]
* lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Extend

Add skip-chars-forward, skip-chars-backward, skip-syntax-forward,
skip-syntax-backward, current-column, current-indentation,
char-syntax, syntax-class-to-char, parse-partial-sexp, goto-char,
forward-line, next-window, previous-window, minibuffer-window,
selected-frame, selected-window, standard-case-table,
standard-syntax-table, syntax-table, frame-first-window,
frame-root-window and frame-selected-window as always-true functions.

17 months agoBetter compilation of char-before, backward-char and backward-word
Mattias Engdegård [Thu, 27 Jul 2023 09:51:26 +0000 (11:51 +0200)]
Better compilation of char-before, backward-char and backward-word

Implement char-before, backward-char and backward-word as compiler
macros instead of byte-compile handlers so that the source-level
optimiser gets to simplify the result.  In particular, this removes
some branches.

* lisp/emacs-lisp/bytecomp.el (byte-compile-char-before)
(byte-compile-backward-char, byte-compile-backward-word): Remove.
(bytecomp--char-before, bytecomp--backward-char)
(bytecomp--backward-word): New.

17 months agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Thu, 27 Jul 2023 14:52:38 +0000 (16:52 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

17 months agonotifications: Allow to use Icon Naming Specification for app-icon
Andrew Tropin [Thu, 27 Jul 2023 14:43:17 +0000 (16:43 +0200)]
notifications: Allow to use Icon Naming Specification for app-icon

* doc/lispref/os.texi (Desktop Notifications): Extend meaning of
:app-icon.

* etc/NEWS: Allow to use Icon Naming Specification for app-icon in
notifications-notify.

* lisp/notifications.el (notifications-notify): Allow to use Icon
Naming Specification for app-icon.

17 months agoNew option 'image-dired-thumb-naming' (bug#61394)
Manuel Giraud [Sat, 25 Feb 2023 18:27:07 +0000 (19:27 +0100)]
New option 'image-dired-thumb-naming' (bug#61394)

* lisp/image/image-dired.el (image-dired-thumb-naming): New user
option to control thumbnail name.

* lisp/image/image-dired-util.el (image-dired-thumb-name): Update
to use new user option and compute contents SHA-1 if needed.
(image-dired-contents-sha1): New function to compute the SHA-1 of the
first 4KiB of a file.

17 months agoUpdate Android port
Po Lu [Thu, 27 Jul 2023 13:59:58 +0000 (21:59 +0800)]
Update Android port

* doc/emacs/android.texi (Android Document Providers): Improve
wording of paragraph clarifying limits on subprocesses.
* java/org/gnu/emacs/EmacsService.java (getDocumentTrees): Use
Java standard US-ASCII coding standard instead of the
undocumented ``ASCII'' alias.
(decodeFileName): Remove unused function.
(documentIdFromName):
* src/android.c (android_init_emacs_service): Take a String for
NAME instead of a byte array.
* src/androidvfs.c (android_verify_jni_string): New function.
(android_document_id_from_name): Verify that STRING is a valid
Modified UTF-8 string.

17 months agoUpdate Android port
Po Lu [Thu, 27 Jul 2023 13:12:29 +0000 (21:12 +0800)]
Update Android port

* src/androidvfs.c (android_afs_initial):
(android_content_get_directory_name):
(android_saf_tree_name):
(android_saf_tree_from_name):
(android_vfs_init): Silence compiler warnings.

17 months agoUpdate Android port
Po Lu [Thu, 27 Jul 2023 12:56:43 +0000 (20:56 +0800)]
Update Android port

* src/android.c (android_run_in_emacs_thread): Behave more
robustly if SIGIO arrives too late Emacs for Emacs to check for
signals, but too early to preempt a long running syscall.

17 months agoAvoid crashes due to invalid 'mode-line-format'
Eli Zaretskii [Thu, 27 Jul 2023 12:34:38 +0000 (15:34 +0300)]
Avoid crashes due to invalid 'mode-line-format'

* src/xdisp.c (display_mode_element, redisplay_window_error):
Don't take XCAR of what can be Qnil.  (Bug#64893)

17 months agoAvoid crashes in some edge cases
Po Lu [Thu, 27 Jul 2023 12:32:16 +0000 (20:32 +0800)]
Avoid crashes in some edge cases

* java/org/gnu/emacs/EmacsActivity.java (onActivityResult):
Avoid crashes in some edge cases.

17 months agoFix problem with null-device in Tramp
Michael Albinus [Thu, 27 Jul 2023 11:36:48 +0000 (13:36 +0200)]
Fix problem with null-device in Tramp

* lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name):
`null-device' could be nil.  Reported by Richard Copley
<rcopley@gmail.com>.

17 months agoAvoid dereference of a freed vnode's operations table
Po Lu [Thu, 27 Jul 2023 10:17:12 +0000 (18:17 +0800)]
Avoid dereference of a freed vnode's operations table

* src/androidvfs.c (android_renameat_noreplace):
(android_rename): Free vdst using vdst->ops, not vp->ops.

17 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Thu, 27 Jul 2023 09:14:58 +0000 (17:14 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

17 months agoUpdate Android port
Po Lu [Thu, 27 Jul 2023 09:13:39 +0000 (17:13 +0800)]
Update Android port

* configure.ac (ANDROID_STUBIFY): Add androidvfs.o when building
libemacs.so.
* doc/emacs/android.texi (Android): Add `Android Document Providers'.
(Android Startup): Update the location of the content identifier
directory.
(Android File System): Describe access to document provider
directories.
(Android Document Providers): New node.
* doc/emacs/emacs.texi (Top): Update the menu for the Android
appendix.
* java/Makefile.in (filename, install_temp/assets/build_info): Make
directory-tree depend on build_info.
* java/org/gnu/emacs/EmacsActivity.java (onActivityResult): New
function.  When a document tree is accepted, persist access to it.
* java/org/gnu/emacs/EmacsDirectoryEntry.java (EmacsDirectoryEntry):
New struct.
* java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy): Use
EmacsService.buildContentName.
* java/org/gnu/emacs/EmacsService.java (getEmacsView, openContentUri)
(checkContentUri): Remove excessive debug logging.
(buildContentName, getDocumentAuthorities, requestDirectoryAccess)
(getDocumentTrees, decodeFileName, documentIdFromName, getTreeUri)
(statDocument, accessDocument, openDocumentDirectory, readDirectoryEntry)
(openDocument, createDocument): New functions.

* lib-src/asset-directory-tool.c: Improve commentary by illustrating
the difference between directory and ordinary files.

* src/android.c (ANDROID_THROW, enum android_fd_table_entry_flags)
(struct android_emacs_service, android_extract_long)
(android_scan_directory_tree, android_is_directory)
(android_get_asset_name, android_url_encode, android_content_name_p)
(android_get_content_name, android_check_content_access, android_fstat)
(android_fstatat, android_file_access_p, android_hack_asset_fd_fallback)
(android_detect_ashmem, android_hack_asset_fd, android_close_on_exec)
(android_open, android_close, android_fclose, android_create_lib_link)
(android_faccessat, struct android_dir, android_opendir, android_dirfd)
(android_readdir, android_closedir, android_lookup_asset_directory_fd)
(android_exception_check_3, android_get_current_api_level)
(android_open_asset, android_close_asset, android_asset_read_quit)
(android_asset_read, android_asset_lseek, android_asset_fstat): Move
content and asset related functions to androidvfs.c.
(android_init_emacs_service): Obtain handles for new JNI functions.
(initEmacsParams): Initialize the VFS layer.
(android_request_directory_access): New function.
(android_display_toast): Remove unused function.

* src/android.h (android_get_current_api_level): Assume that
this function never returns less than __ANDROID_API__.
(struct android_emacs_service): Move `struct
android_emacs_service' here.

* src/androidfns.c (Fandroid_request_directory_access): New
interactive function.
(syms_of_androidfns): Register new subr.

* src/androidvfs.c (struct android_vdir, struct android_vops)
(struct android_vnode, struct android_special_vnode)
(enum android_vnode_type, struct android_cursor_class)
(struct emacs_directory_entry_class)
(struct android_parcel_file_descriptor_class)
(android_init_cursor_class, android_init_entry_class)
(android_init_fd_class, android_vfs_canonicalize_name)
(struct android_unix_vnode, struct android_unix_vdir, unix_vfs_ops)
(android_unix_name, android_unix_vnode, android_unix_open)
(android_unix_close, android_unix_unlink, android_unix_symlink)
(android_unix_rmdir, android_unix_rename, android_unix_stat)
(android_unix_access, android_unix_mkdir, android_unix_readdir)
(android_unix_closedir, android_unix_dirfd, android_unix_opendir)
(android_extract_long, android_scan_directory_tree)
(android_is_directory, android_init_assets)
(android_hack_asset_fd_fallback, android_detect_ashmem)
(android_hack_asset_fd, struct android_afs_vnode)
(struct android_afs_vdir, struct android_afs_open_fd, afs_vfs_ops)
(android_afs_name, android_afs_initial, android_close_on_exec)
(android_afs_open, android_afs_close, android_afs_unlink)
(android_afs_symlink, android_afs_rmdir, android_afs_rename)
(android_afs_stat, android_afs_access, android_afs_mkdir)
(android_afs_readdir, android_afs_closedir, android_afs_dirfd)
(android_afs_opendir, android_afs_get_directory_name)
(struct android_content_vdir, content_vfs_ops)
(content_directory_contents, android_content_name)
(android_content_open, android_content_close)
(android_content_unlink, android_content_symlink)
(android_content_rmdir, android_content_rename)
(android_content_stat, android_content_access)
(android_content_mkdir, android_content_readdir)
(android_content_closedir, android_content_dirfd)
(android_content_opendir, android_content_get_directory_name)
(android_content_initial, android_get_content_name)
(android_check_content_access, struct android_authority_vnode)
(authority_vfs_ops, android_authority_name, android_authority_open)
(android_authority_close, android_authority_unlink)
(android_authority_symlink, android_authority_rmdir)
(android_authority_rename, android_authority_stat)
(android_authority_access, android_authority_mkdir)
(android_authority_opendir, android_authority_initial)
(struct android_saf_root_vnode, struct android_saf_root_vdir)
(saf_root_vfs_ops, android_saf_root_name, android_saf_root_open)
(android_saf_root_close, android_saf_root_unlink)
(android_saf_root_symlink, android_saf_root_rmdir)
(android_saf_root_rename, android_saf_root_stat)
(android_saf_root_access, android_saf_root_mkdir)
(android_saf_root_readdir, android_saf_root_closedir)
(android_saf_root_dirfd, android_saf_root_opendir)
(android_saf_root_initial, android_saf_root_get_directory)
(android_saf_stat, android_saf_access)
(struct android_saf_tree_vnode, struct android_saf_tree_vdir)
(saf_tree_vfs_ops, android_document_id_from_name)
(android_saf_tree_name, android_saf_tree_open)
(android_saf_tree_close, android_saf_tree_unlink)
(android_saf_tree_symlink, android_saf_tree_rmdir)
(android_saf_tree_rename, android_saf_tree_stat)
(android_saf_tree_access, android_saf_tree_mkdir)
(android_saf_tree_opendir_1, android_saf_tree_readdir)
(android_saf_tree_closedir, android_saf_tree_dirfd)
(android_saf_tree_opendir, android_saf_tree_from_name)
(android_saf_tree_get_directory, android_saf_file_vnode)
(saf_file_vfs_ops, android_saf_file_name, android_saf_file_open)
(android_saf_file_unlink, android_saf_file_rmdir)
(android_saf_file_opendir, android_close_parcel_fd)
(android_saf_new_vnode, android_saf_new_name, android_saf_new_open)
(android_saf_new_unlink, android_saf_new_symlink)
(android_saf_new_rmdir, android_saf_new_rename)
(android_saf_new_stat, android_saf_new_access)
(android_saf_new_mkdir, android_saf_new_opendir, root_vfs_ops)
(special_vnodes, android_root_name, android_name_file)
(android_vfs_init, android_open, android_unlink, android_symlink)
(android_rmdir, android_mkdir, android_renameat_noreplace)
(android_rename, android_fstat, android_fstatat_1, android_fstatat)
(android_faccessat, android_fdopen, android_close, android_fclose)
(android_open_asset, android_close_asset, android_asset_read_quit)
(android_asset_read, android_asset_lseek, android_asset_fstat)
(android_opendir, android_dirfd, android_readdir)
(android_closedir): Move file system emulation routines here.
Introduce a new ``VFS'' layer for translating between
Emacs-specific file names and the various disparate interfaces
for accessing files on Android.

* src/callproc.c (delete_temp_file):
* src/charset.c (load_charset_map_from_file):
* src/dired.c:
* src/emacs.c (Fkill_emacs):
* src/fileio.c (check_mutable_filename, Fcopy_file)
(Fmake_directory_internal, Fdelete_directory_internal)
(Fdelete_file, Frename_file, Fadd_name_to_file)
(Fmake_symbolic_link, file_accessible_directory_p, Fset_file_modes)
(Fset_file_times, write_region):
* src/filelock.c (get_boot_time, rename_lock_file)
(create_lock_file, current_lock_owner, unlock_file):
* src/image.c (slurp_file, png_load_body, jpeg_load_body):
* src/keyboard.c (Fopen_dribble_file):
* src/lisp.h:
* src/lread.c (Fload):
* src/process.c (handle_child_signal):
* src/sysdep.c (init_standard_fds, emacs_fopen, emacs_fdopen)
(emacs_unlink, emacs_symlink, emacs_rmdir, emacs_mkdir)
(emacs_renameat_noreplace, emacs_rename):
* src/term.c (Fresume_tty, init_tty): Use and add new wrappers
for fopen, fdopen, unlink, symlink, rmdir, mkdir,
renameat_norepalce and rename.

17 months agoSupport Posix-standard pax extended header in tar files
Eli Zaretskii [Thu, 27 Jul 2023 08:36:00 +0000 (11:36 +0300)]
Support Posix-standard pax extended header in tar files

* lisp/tar-mode.el (pax-extended-attribute-record-regexp)
(tar-attr-vector): New variables.
(pax-gid-index, pax-gname-index, pax-linkpath-index)
(pax-mtime-index, pax-path-index, pax-size-index, pax-uid-index)
(pax-uname-index): New constants.
(pax-header-gid, pax-header-gname, pax-header-linkpath)
(pax-header-mtime, pax-header-path, pax-header-size)
(pax-header-uid, pax-header-uname): New accessors to pax header.
(pax-decode-string, tar-parse-pax-extended-header): New functions.
(tar-header-block-tokenize): Recognize and handle Posix-standard
pax extended header, and use its attributes instead of those in
the standard tar header.  (Bug#64686)

17 months agoFix Tramp error on macOS
Michael Albinus [Thu, 27 Jul 2023 07:30:41 +0000 (09:30 +0200)]
Fix Tramp error on macOS

* lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options):
Don't use an absolute ControlPath on macOS.  (Bug#64880)

17 months agoFix image-dired-util-tests on MS-Windows
Eli Zaretskii [Thu, 27 Jul 2023 07:28:43 +0000 (10:28 +0300)]
Fix image-dired-util-tests on MS-Windows

* test/lisp/image/image-dired-util-tests.el
(image-dired-thumb-name/image-dired)
(image-dired-thumb-name/per-directory): Make these tests work on
MS-Windows, where a file name such as "/foo/bar" gets added the
drive letter when passed through 'expand-file-name'.

17 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Thu, 27 Jul 2023 07:01:25 +0000 (10:01 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

17 months ago; Better documentation of HOME on MS-Windows
Eli Zaretskii [Thu, 27 Jul 2023 06:51:39 +0000 (09:51 +0300)]
; Better documentation of HOME on MS-Windows

* doc/emacs/custom.texi (Find Init): Add footnote about HOME on
MS-Windows.  (Bug#64871)

17 months ago; Better documentation of HOME on MS-Windows
Eli Zaretskii [Thu, 27 Jul 2023 06:51:39 +0000 (09:51 +0300)]
; Better documentation of HOME on MS-Windows

* doc/emacs/custom.texi (Find Init): Add footnote about HOME on
MS-Windows.  (Bug#64871)

17 months ago; Clarify documentation of 'server-after-make-frame-hook'
Eli Zaretskii [Thu, 27 Jul 2023 06:37:03 +0000 (09:37 +0300)]
; Clarify documentation of 'server-after-make-frame-hook'

* doc/lispref/frames.texi (Creating Frames):
* lisp/server.el (server-after-make-frame-hook): Clarify
documentation of 'server-after-make-frame-hook'.  (Bug#64873)

17 months agoFix broken byte-compilation of unary comparisons
Mattias Engdegård [Wed, 26 Jul 2023 16:39:36 +0000 (18:39 +0200)]
Fix broken byte-compilation of unary comparisons

* lisp/emacs-lisp/byte-opt.el (byte-opt--nary-comparison):
Fix a typo causing miscompilation of code such as (OP X),
where OP is <, >, <=, >= or =.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--test-cases): Add test case.

Reported by Richard Copley.

17 months ago* lisp/emacs-lisp/byte-opt.el (pure-fns): Add `max-char`
Mattias Engdegård [Tue, 25 Jul 2023 10:52:29 +0000 (12:52 +0200)]
* lisp/emacs-lisp/byte-opt.el (pure-fns): Add `max-char`

17 months agoProvide backtrace for byte-ops aref and aset
Mattias Engdegård [Tue, 25 Jul 2023 10:16:30 +0000 (12:16 +0200)]
Provide backtrace for byte-ops aref and aset

Produce synthetic backtrace entries for `aref` and `aset` byte-ops
when the index is non-fixnum, or is out of range for vector or record
arguments (bug#64613).

* src/bytecode.c (exec_byte_code): Detect type and range errors
in-line for aref and aset.
* src/data.c (syms_of_data): Declare symbols Qaref and Qaset.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--byte-op-error-cases): Add test cases.

17 months ago; bytecode backtrace test clean-up
Mattias Engdegård [Tue, 25 Jul 2023 10:15:00 +0000 (12:15 +0200)]
; bytecode backtrace test clean-up

17 months ago; Documentation followup to last change
Eli Zaretskii [Wed, 26 Jul 2023 15:11:49 +0000 (18:11 +0300)]
; Documentation followup to last change

* lisp/progmodes/project.el (project-uniquify-dirname-transform):
* lisp/uniquify.el (uniquify-dirname-transform): Doc fixes.

* etc/NEWS: Announce the change.

17 months agoSupport transforming the dirname used by uniquify
Spencer Baugh [Mon, 10 Jul 2023 02:21:03 +0000 (22:21 -0400)]
Support transforming the dirname used by uniquify

By transforming the buffer's directory name, we can add
additional information to use during uniquifying.  A basic
one: uniquifying buffer names based on the project name.
* lisp/progmodes/project.el (project-uniquify-dirname-transform): Add.
* lisp/uniquify.el (uniquify-dirname-transform-default)
(uniquify-dirname-transform): Add.  (Bug#62621)
(uniquify-rationalize-file-buffer-names, uniquify-buffer-file-name):
Use 'uniquify-dirname-transform'.
* test/lisp/uniquify-tests.el (uniquify-home)
(uniquify-project-transform): Add tests.

17 months agoFix "M-x man RET [ RET"
Eli Zaretskii [Wed, 26 Jul 2023 14:30:21 +0000 (17:30 +0300)]
Fix "M-x man RET [ RET"

* lisp/man.el (Man-completion-table): Quote special characters
before passing them to the shell.
(Man-name-regexp): Allow '@' and '[' in man-page names.  (Bug#64795)

17 months agoAdd 'define-error' to font lock keywords for emacs-lisp-mode
Neal Sidhwaney [Sun, 23 Jul 2023 23:25:51 +0000 (19:25 -0400)]
Add 'define-error' to font lock keywords for emacs-lisp-mode

* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): Add 'define-error'.
(Bug#64824)

* test/lisp/emacs-lisp/lisp-mode-tests.el
(test-font-lock-keywords): New test.

Copyright-paperwork-exempt: yes

17 months agolisp-mode.el: Add defvar-keymap to lisp-imenu-generic-expression
Brian Leung [Mon, 24 Jul 2023 11:32:19 +0000 (04:32 -0700)]
lisp-mode.el: Add defvar-keymap to lisp-imenu-generic-expression

* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
Add defvar-keymap.  We do not ignore (defvar-keymap FOO)
constructs in imenu as we do with (defvar FOO) since the former
constructs are generally not vacuous whereas the latter ones
often are.  (Bug#64831)

17 months agoFix unstable Proced refine tests
Laurence Warne [Sat, 22 Jul 2023 19:47:21 +0000 (20:47 +0100)]
Fix unstable Proced refine tests

* test/lisp/proced-tests.el (proced-refine-test)
(proced-refine-with-update-test): Also check if the parent
process id of each process matches the process id refined
on before failing, since the refiner for process id returns
the children of a process in addition to the process itself.
(Bug#64800)

17 months agoFix build --with-sound on NetBSD and OpenBSD
Valtteri Vuorikoski [Sat, 22 Jul 2023 17:08:42 +0000 (20:08 +0300)]
Fix build --with-sound on NetBSD and OpenBSD

* configure.ac: Use ossaudio by default on *BSD systems.
(Bug#64698)

* etc/NEWS: Announce the change.

17 months agocperl-mode.el: Bring cperl-short-docs up to Perl 5.38.
Harald Jörg [Wed, 26 Jul 2023 07:55:34 +0000 (09:55 +0200)]
cperl-mode.el: Bring cperl-short-docs up to Perl 5.38.

* lisp/progmodes/cperl-mode.el (imenu-max-items): declare the
variable to silence an elint warning.
(cperl-short-docs): Reorder function description to match Perl's
perlfunc documentation.  Add missing shortdocs from perlfunc.
Delete entries for operators which don't exist any more (EQ, NE
and friends).  Shorten docstring lines to 80 chars or less.

17 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Wed, 26 Jul 2023 00:08:11 +0000 (08:08 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

17 months agoAvoid crashes under 'which-key-mode'
Eli Zaretskii [Tue, 25 Jul 2023 17:38:01 +0000 (20:38 +0300)]
Avoid crashes under 'which-key-mode'

* src/keyboard.c (Fthis_single_command_keys): Don't allow calls to
Fvector with negative first argument.  (Bug#64857)

17 months agoDon't suggest to revert buffer from non-existing file
Eli Zaretskii [Tue, 25 Jul 2023 14:51:58 +0000 (17:51 +0300)]
Don't suggest to revert buffer from non-existing file

* lisp/files-x.el (modify-file-local-variable-message): Suggest to
revert from the buffer's file only if that file exists; otherwise
suggest 'normal-mode'.  (Bug#64844)

17 months ago; Minor documentation fixes
Eli Zaretskii [Tue, 25 Jul 2023 13:49:18 +0000 (16:49 +0300)]
; Minor documentation fixes

* src/character.c (Fstring_width): Doc fix.

* doc/emacs/trouble.texi (Understanding Bug Reporting): Fix typo
(bug#64854).

17 months agoDon't signal error when locking a file from non file-visiting buffer
Eli Zaretskii [Mon, 24 Jul 2023 15:08:40 +0000 (18:08 +0300)]
Don't signal error when locking a file from non file-visiting buffer

* lisp/userlock.el (userlock--check-content-unchanged): Support
the case where a file is locked before being written to from a
non file-visiting buffer.  (Bug#64821)

17 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Mon, 24 Jul 2023 00:09:36 +0000 (08:09 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

17 months ago; * src/xdisp.c (mark_window_display_accurate_1): Avoid more aborts.
Eli Zaretskii [Sun, 23 Jul 2023 18:49:18 +0000 (14:49 -0400)]
; * src/xdisp.c (mark_window_display_accurate_1): Avoid more aborts.

17 months agoFix rare aborts in CHECK_WINDOW_END
Eli Zaretskii [Sun, 23 Jul 2023 17:44:40 +0000 (13:44 -0400)]
Fix rare aborts in CHECK_WINDOW_END

Those aborts happen because a window's window_end_vpos value
is inconsistent with the current matrix's number of rows, which
happens after resizing the mini-window.
* src/xdisp.c (mark_window_display_accurate_1): Don't validate the
window_end_valid flag if window_end_vpos is inconsistent with the
current_matrix's number of rows.  This happens, e.g., when
Edebug wants to show a value in the mini-window that causes it to
resize, as the window above the mini-window was usually already
redisplayed, and we think its display is accurate.

17 months ago; * src/pdumper.c (dump_overlay): Update hash.
Basil L. Contovounesios [Sun, 23 Jul 2023 07:39:17 +0000 (08:39 +0100)]
; * src/pdumper.c (dump_overlay): Update hash.

This follows commit 7ac947f34c745c61f8acc1fe2452a2c720d57a0d
of 2023-07-13 "; * src/lisp.h (struct Lisp_Overlay): Update
commentary (bug#64580)."

17 months agoFix Proced Start column alignment for different locales
Laurence Warne [Sat, 22 Jul 2023 13:35:15 +0000 (14:35 +0100)]
Fix Proced Start column alignment for different locales

* lisp/proced.el (proced-grammar-alist): Change the justify
value of the start attribute to 'left' instead of a fixed
value of 6.  (Bug#64752)
(proced-format-start): Adjust the doc string.

17 months agoFacilitate locating the app library directory
Po Lu [Sun, 23 Jul 2023 01:52:19 +0000 (09:52 +0800)]
Facilitate locating the app library directory

* doc/emacs/android.texi (Android File System): Document where
the app library directory can probably be found.
* src/android.c (android_create_lib_link): New function.  Try to
symlink `lib' in the directory holding the files directory to
the app library directory.
(setEmacsParams): Call that function if Emacs is being
initialized from an application context.

17 months agoMerge remote-tracking branch 'origin/master' into feature/android
Po Lu [Sun, 23 Jul 2023 00:53:22 +0000 (08:53 +0800)]
Merge remote-tracking branch 'origin/master' into feature/android

17 months ago* src/eval.c (get_backtrace): Don't skip the top frame
Stefan Monnier [Sat, 22 Jul 2023 21:20:51 +0000 (17:20 -0400)]
* src/eval.c (get_backtrace): Don't skip the top frame

`profiler.el` was reporting incomplete backtraces.
I had a suspicion there was something off, but it became obvious
when I saw that `set-buffer-multibyte` did not appear in the
`profiler-report` output when opening a large compressed tarball,
even though I knew it to be a large contributor (which `elp-results`
confirmed).

I have no idea why this `backtrace_next` was there, sadly, but now
`profiler-report` gives me results that make a lot more sense.

17 months agoFix regexp character class syntax property ghost matching bug
Mattias Engdegård [Sat, 22 Jul 2023 15:26:11 +0000 (17:26 +0200)]
Fix regexp character class syntax property ghost matching bug

The syntax-table-dependent regexp character classes [:space:],
[:word:] and [:punct:] always use the buffer-local syntax table for
performance reasons.  Fix a bug that could cause ghost (mis)matches
from use of lingering state by constructs that do use syntax
properties, such as `\sX`.

* src/regex-emacs.c (BUFFER_SYNTAX): New macro.
(ISPUNCT, ISSPACE, ISWORD): Use BUFFER_SYNTAX instead of SYNTAX.
(regex_compile): Delete syntax table setup code that is no longer
needed.
* test/src/regex-emacs-tests.el (regex-emacs-syntax-properties):
New regression test.

17 months ago; Fix documentation of last change.
Eli Zaretskii [Sat, 22 Jul 2023 15:50:26 +0000 (18:50 +0300)]
; Fix documentation of last change.

* src/xdisp.c (syms_of_xdisp):
* src/dispnew.c (syms_of_display):
* doc/lispref/commands.texi (Accessing Mouse): Fix documentation
of last change.

17 months ago* etc/NEWS: Announce the new option 'mouse-prefer-closest-glyph'.
Moritz Maxeiner [Sat, 22 Jul 2023 14:55:07 +0000 (16:55 +0200)]
* etc/NEWS: Announce the new option 'mouse-prefer-closest-glyph'.

17 months agoImplement new option 'mouse-prefer-closest-glyph'
Moritz Maxeiner [Sat, 22 Jul 2023 14:55:07 +0000 (16:55 +0200)]
Implement new option 'mouse-prefer-closest-glyph'

* src/dispnew.c (mouse_prefer_closest_glyph): New global
variable.
(buffer_posn_from_coords):
* src/xdisp.c (remember_mouse_glyph): Respect
'mouse_prefer_closest_glyph'.
(mouse_fine_grained_tracking): Update documentation to
include 'mouse_prefer_closest_glyph' effects.

* doc/lispref/commands.texi (Accessing Mouse): Update
documentation to say what the new option does when enabled.
* lisp/cus-start.el (standard): New user option
'mouse-prefer-closest-glyph'.

17 months agoImprove ERC's internal invisibility API
F. Jason Park [Sat, 15 Jul 2023 04:08:31 +0000 (21:08 -0700)]
Improve ERC's internal invisibility API

* etc/ERC-NEWS: Mention that line endings have moved from the end to
the beginning of hidden messages.
* lisp/erc/erc-fill.el (erc-fill--wrap-ensure-dependencies): Warn when
users have `erc-legacy-invisible-bounds-p' enabled, and force it to
its default value of nil in the current buffer.
(erc-fill-wrap-mode, erc-fill-wrap-enable): Move business involving
compat variable for enabling legacy hidden-message behavior to helper.
* lisp/erc/erc-match.el (erc-match--hide-fools-offset-bounds): Move
internal variable from to main library file and rename to
`erc-legacy-invisible-bounds-p'.  Also make obsolete and flip
semantics so a non-nil value enables the traditional behavior.
(erc-match--hide-message): Move to main library file and rename to
`erc--hide-message'.  Add a property-value parameter instead of
hard-coding to `erc-match'.  Also, condition behavior on renamed
compatibility flag `erc-legacy-invisible-bounds-p'.
(erc-hide-fools): Call `erc--hide-message' with own value for
`invisible' property specifically for fools.  That is, use
`match-fools' rather than `erc-match' or `erc-match-fools' to save
room when visually inspecting.  This retains the module name as a
prefix to hopefully minimize collisions with invisibility spec members
owned by non-ERC minor modes.  The `timestamp' spec member owned by
erc-stamp likewise lacks a namespace prefix, but its feature/group
affiliation is self-evident.
(erc-match--modify-invisibility-spec): Use toggle command
non-interactively for adding and removing invisibility spec member.
(erc-match-toggle-hidden-fools): Add explicit override argument and
defer to general helper for actually modifying spec.
(erc-match--toggle-hidden): New helper for toggling invisibility
spec.
* lisp/erc/erc.el (erc--merge-prop): If new value is a list, prepend
onto existing.  Add note about possible space optimization.
(erc-legacy-invisible-bounds-p): New obsolete compat variable to
enable traditional pre-5.6 invisibility interval on hidden messages.
Replaces `erc-match--hide-fools-offset-bounds-p' but has an inverted
meaning.  The new default value of nil means invisibility covers a
shifted interval consisting of the message body plus the line ending
immediately preceding it.
(erc--hide-message): New function, formerly `erc-match--hide-message'
from erc-match.el introduced in ERC 5.6.
* test/lisp/erc/erc-scenarios-match.el:
(erc-scenarios-match--invisible-stamp): Fix comment and use API
function in interactive convenience setup.
(erc-scenarios-match--find-bol): New test helper.
(erc-scenarios-match--find-eol): Fix bug affecting interactive use.
(erc-scenarios-match--stamp-left-fools-invisible,
erc-scenarios-match--stamp-right-fools-invisible,
erc-scenarios-match--stamp-right-invisible-fill-wrap,
erc-scenarios-match--stamp-both-invisible-fill-static): Update
`invisible' property from `erc-match' to `match-fools'.
(erc-scenarios-match--stamp-right-fools-invisible,
erc-scenarios-match--stamp-both-invisible-fill-static): Move test
body to function of same name for use in multiple cases.
(erc-scenarios-match--stamp-right-fools-invisible--nooffset,
erc-scenarios-match--stamp-both-invisible-fill-static--nooffset): New
test variants asserting proper hiding with old pre-5.6 invisibility
interval.
* test/lisp/erc/erc-tests.el (erc-tests--equal-including-properties):
Relocate macro higher in same file.
(erc--merge-prop): New test.  (Bug#64301)

17 months agoMake erc-fill-wrap work with left-sided stamps
F. Jason Park [Fri, 14 Jul 2023 13:12:30 +0000 (06:12 -0700)]
Make erc-fill-wrap work with left-sided stamps

* etc/ERC-NEWS: Remove all mention of option `erc-timestamp-align-to'
supporting a value of `margin', which has been abandoned.  Do mention
leading white space before stamps now having stamp-related properties.
* lisp/erc/erc-backend.el (erc--reveal-prompt, erc--conceal-prompt):
New generic functions with default implementations factored out from
`erc--unhide-prompt' and `erc--hide-prompt'.
(erc--prompt-hidden-p): New internal predicate function.
(erc--unhide-prompt): Defer to `erc--reveal-prompt', and set
`erc-prompt' text property to t.
(erc--hide-prompt): Defer to `erc--conceal-prompt', and set
`erc-prompt' text property to `hidden'.
* lisp/erc/erc-compat.el (erc-compat--29-browse-url-irc): Don't
use `function-equal'.
* lisp/erc/erc-fill.el (erc-fill-wrap-margin-width,
erc-fill-wrap-margin-side): New options to control side and initial
width of `fill-wrap' margin.
(erc-fill--wrap-beginning-of-line): Fix bug involving non-string
valued `display' props.
(erc-fill-wrap-toggle-truncate-lines): New command to re-enable
`visual-line-mode' when toggling off `truncate-lines'.
(erc-fill-wrap-mode-map): Remap `toggle-truncate-lines' to
`erc-fill-wrap-toggle-truncate-lines'.
(erc-fill-wrap-mode, erc-fill-wrap-enable, erc-fill-wrap-disable):
Update doc string, persist a few local vars, and conditionally set
`erc-stamp--margin-left-p'.  When deactivating, disable
`visual-line-mode' first.
(erc-fill--wrap-continued-message-p): Use `erc-speaker' instead of
heuristics when comparing nicks between consecutive messages.
(erc-fill-wrap-nudge): Update doc string and account for left-sided
stamps.
(erc-timestamp-offset): Add comment regarding conditional guard based
on function-valued option.
* lisp/erc/erc-stamp.el (erc-timestamp-use-align-to): Remove value
variant `margin', which was originally intended to be new in ERC 5.6.
This functionality was all but useless without the internal minor mode
`erc-stamp--display-margin-mode' active.
(erc-stamp-right-margin-width): Remove unused option new in 5.6.
(erc-stamp--display-margin-force): Remove unused function.
(erc-stamp--margin-width, erc-stamp--margin-left-p): New internal
variables.
(erc-stamp--init-margins-on-connect): New function for initializing
mode-managed margin after connecting.
(erc-stamp--adjust-right-margin, erc-stamp--adjust-margin): Rename
function to latter and accommodate left-hand stamps.
(erc-stamp--inherited-props): Move definition higher up in same file.
(erc-stamp--display-margin-mode): Update function name, and adjust
setup and teardown to accommodate left-handed stamps.  Don't add
advice around `erc-insert-timestamp-function'.
(erc-stamp--last-prompt, erc-stamp--display-prompt-in-left-margin):
New function and helper var to convert a normal inserted prompt so
that it appears in the left margin.
(erc-stamp--refresh-left-margin-prompt): Helper for other modules to
quickly refresh prompt outside of insert hooks.
(erc--reveal-prompt, erc--conceal-prompt): New implementations for
when `erc-stamp--display-margin-mode' is active.
(erc-insert-timestamp-left): Convert to generic function and provide
implementation for `erc-stamp--display-margin-mode'.
(erc-stamp--omit-properties-on-folded-lines): New variable, an escape
hatch for propertizing white space before right-side stamps folded
over onto another line.
(erc-insert-timestamp-right): Don't expect `erc-timestamp-align-to' to
ever be the symbol `margin'.  Move handling for that case to one
contingent on the internal minor mode `erc-stamp--display-margin-mode'
being active.  Add text properties preceding stamps that occupy a line
by their lonesome.  See related news entry for rationale.  This is
arguably a breaking change.
* lisp/erc/erc.el (erc--refresh-prompt-hook): New hook variable for
modules to adjust prompt properties whenever it's refreshed.
(erc--refresh-prompt): Fix bug in which user-defined prompt functions
failed to hide when quitting in server buffers.  Run new hook
`erc--refresh-prompt-hook'.
(erc-display-prompt): Add comment noting that the text property
`erc-prompt' now actually matters: it's t while a session is running
and `hidden' when disconnected.
* test/lisp/erc/erc-fill-tests.el (erc-fill--left-hand-stamps): New
test.
* test/lisp/erc/erc-stamp-tests.el
(erc-stamp-tests--use-align-to--nil,
erc-stamp-tests--use-align-to--t): New functions forged from old test
bodies to allow optionally asserting pre-5.6 behavior regarding
leading white space on right-hand stamps that exist on their own line.
(erc-timestamp-use-align-to--nil, erc-timestamp-use-align-to--t):
Parameterize with compatibility flag.
(erc-timestamp-use-align-to--margin,
erc-stamp--display-margin-mode--right): Rename test to latter.
* test/lisp/erc/erc-tests.el (erc-hide-prompt): Add some assertions
for new possible value of `erc-prompt' text property.
* test/lisp/erc/resources/fill/snapshots/stamps-left-01.eld: New test
data file.  (Bug#60936)

17 months agoDon't always toggle a choice when prompting
Mauro Aranda [Sun, 16 Jul 2023 12:22:11 +0000 (09:22 -0300)]
Don't always toggle a choice when prompting

* lisp/wid-edit.el (widget-choice-prompt-value): Respect the value
of widget-choice-toggle.  (Bug#60712)

17 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 22 Jul 2023 12:56:50 +0000 (15:56 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

17 months agoAvoid prompting when creating a restricted-sexp widget
Mauro Aranda [Sun, 16 Jul 2023 22:46:54 +0000 (19:46 -0300)]
Avoid prompting when creating a restricted-sexp widget

* lisp/wid-edit.el (restricted-sexp): Turn value into a
string before reading.
(widget-field-value-create): Guard against value being nil,
so the field can be created even if the widget has a bad
default value.  (Bug#59937)