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.
* 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.
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.
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.
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.
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.
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.
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)
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'.
* 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.
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.
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.
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)
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)
* 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)
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.
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)
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)
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.
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.
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.
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.
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.
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'.
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)
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)
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)
* doc/misc/tramp.texi (Frequently Asked Questions): Do not
document tramp-mode any longer. Describe inhibit-remote-files and
without-remote-files instead.
* etc/NEWS: Add inhibit-remote-files and without-remote-files.
Fix typos.
* lisp/net/tramp.el (inhibit-remote-files): New defun.
(without-remote-files): New defmacro.
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test49-without-remote-files):
* test/lisp/net/tramp-tests.el (tramp-test49-without-remote-files):
New tests.
(tramp-test50-unload): Rename.
Po Lu [Sat, 22 Jul 2023 06:06:08 +0000 (14:06 +0800)]
Fix window box computation for menu bar windows
* src/window.h (WINDOW_MENU_BAR_P): Check for external menu bars
using HAVE_WINDOW_SYSTEM && HAVE_EXT_MENU_BAR instead of hard
coding X without Xt or GTK.
Po Lu [Fri, 21 Jul 2023 13:23:35 +0000 (21:23 +0800)]
Improve touch screen and text conversion behavior of many commands
* doc/lispref/commands.texi (Key Sequence Input): Document new
argument to `read-key-sequence' etc.
* lisp/help-macro.el (make-help-screen):
* lisp/subr.el (read-key, read-char-choice-with-read-key):
Disable text conversion and display the OSK before reading a key
sequence.
* lisp/touch-screen.el (touch-screen-window-selection-changed):
Only cancel the minibuffer OSK timer.
(touch-screen-handle-point-up): Update comment accordingly.
* src/keyboard.c (command_loop_1, read_menu_command)
(read_key_sequence, read_key_sequence_vs, Fread_key_sequence)
(Fread_key_sequence_vector): New arg DISABLE_TEXT_CONVERSION.
All callers changed.
Eli Zaretskii [Fri, 21 Jul 2023 12:19:02 +0000 (15:19 +0300)]
Fix Proced display header alignment under 'text-scale-adjust'
* lisp/proced.el (proced-mode): Force the header-line to scale
according to 'text-scale-adjust'.
(proced-header-line): Use width of the header-line's face's
characters as align-to units, not the width of the frame's
default face's font. (Bug#64752)
* src/xdisp.c (calc_pixel_width_or_height): Use font's
average_width or space_width, not max_width, as the correct
measure of the font's width. This is consistent with the rest of
the display engine.
Po Lu [Fri, 21 Jul 2023 07:20:45 +0000 (15:20 +0800)]
Correctly translate touchscreen-up events outside a frame
* lisp/touch-screen.el (touch-screen-translate-touch): Check if
a prefix is specified separately from prefix being non-nil.
Accept `nil' as an imaginary prefix key.
(function-key-map): Register translation functions on the tab
bar, tab lines and internal border.
Po Lu [Fri, 21 Jul 2023 06:22:54 +0000 (14:22 +0800)]
Improve touch screen scrolling support
* lisp/touch-screen.el (touch-screen-preview-select): Avoid
unnecessary redisplays.
(touch-screen-drag): Scroll at window margins using window
scrolling functions instead of relying on redisplay to recenter
the window around point.
Po Lu [Fri, 21 Jul 2023 04:23:08 +0000 (12:23 +0800)]
Update Android port
* doc/emacs/input.texi (Touchscreens): Document
`touch-screen-preview-select'.
* doc/lispref/commands.texi (Touchscreen Events): Fix typo in
the descriptions of two touch screen events.
* lisp/dired.el (dired-insert-set-properties): Adjust for
changes to file end computation.
* lisp/minibuffer.el (clear-minibuffer-message): Don't clear
minibuffer message if dragging.
* lisp/touch-screen.el (touch-screen-current-tool): Fix doc
string.
(touch-screen-preview-select): New function.
(touch-screen-drag): Call it if point changes.
Stephen Berman [Thu, 20 Jul 2023 19:51:24 +0000 (21:51 +0200)]
Fix last change to wid-edit.el
* lisp/wid-edit.el (widget-choose): Test for stringp instead of
char-or-string-p, since substitute-command-keys should only apply
to choice values that are strings. (Bug#64046, Message #37)
Alan Mackenzie [Thu, 20 Jul 2023 19:33:42 +0000 (19:33 +0000)]
CC Mode (some languages): handle string lines ending in \\
In C, C++, Objective C, and Pike modes, regard \\ in a string
at EOL as a backslash followed by an escaped newline. In the
other languages, this remains regarded as an escaped backslash
followed by an invalid string terminator.
* lisp/progmodes/cc-defs.el (c-is-escaped, c-will-be-escaped):
Amend to observe the changed notion of escaped newlines.
* lisp/progmodes/cc-langs.el (c-string-escaped-newlines):
Unused, removed.
(c-escaped-newline-takes-precedence): New lang const and var.
(c-string-innards-re-alist): Amend, using the above new lang
var.
Morgan Smith [Tue, 11 Jul 2023 18:08:24 +0000 (14:08 -0400)]
docview: imenu: check return value of 'mutool'
While 'mutool' supports many filetypes, 'mutool show' only
supports PDF files. This would lead to cryptic imenu errors
when opening other
file types (like EPUB) since we would parse the error output.
During my testing this caused 'imenu--index-alist' to have a
value of '(nil).
* lisp/doc-view.el (doc-view--pdf-outline): Error when 'mutool'
returns an error. Use 'call-process' to get the return value and
remove the call to 'shell-quote-argument' as 'call-process'
doesn't want any escapes.
(doc-view-mode): Handle possible error from 'doc-view-imenu-setup'.
(doc-view-imenu-enabled): Remove superfluous (and ... t).
(doc-view-imenu-setup): Remove check for mutool already ensured by
'doc-view-imenu-enabled' being non-nil.
(Bug#64516)
* lisp/progmodes/python.el (python-interpreter): Mention
new variable in documentation.
(python-interpreter-args): New custom variable.
(python-shell-interpreter, python-shell-interpreter-args)
(python-shell-interpreter-interactive-arg): Improve
documentation.
(python--list-imports, python--do-isort)
(python-fix-imports): Make process use customisable
arguments.
Preserve comments when redrawing a widget (Bug#64649)
* lisp/cus-edit.el (custom-comment-preserve): New function.
(custom-redraw): Use it.
(custom-comment-create): Make sure :comment-shown is set to
t if the comment widget gets created.
(custom-face-value-create, custom-variable-value-create):
Recreate the custom-comment widget with the preserved value,
if any.
Pass original spec just after creating the face-widget
* lisp/cus-edit.el (custom-face-get-current-spec-unfiltered):
New function, extracted from custom-face-get-current-spec.
(custom-face-get-current-spec): Use it.
(custom-face-state-set): Take an optional argument, to decide
if we should check against a filtered or unfiltered spec.
(custom-face-value-create): Use the new optional argument.
(Bug#64347)