-
Notifications
You must be signed in to change notification settings - Fork 2
/
ChangeLog.android
7279 lines (5485 loc) · 258 KB
/
ChangeLog.android
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2023-08-07 Po Lu <[email protected]>
* nt/mingw-cfg.site: Remove additions for Gnulib printf.
* m4, lib: Update from Gnulib.
* msdos/sedlibmk.inp: Remove variables deleted as part of previous
change.
* admin/merge-gnulib (GNULIB_MODULES): Remove vasprintf and
printf-posix.
2023-08-06 Po Lu <[email protected]>
* java/org/gnu/emacs/EmacsService.java (readDirectoryEntry): Fix
potential NULL dereference.
* java/org/gnu/emacs/EmacsSafThread.java (openDocument1): If
initially opening with rwt, verify the file descriptor is really
writable; if not, resort to rw and truncating the file descriptor
by hand instead.
* src/androidvfs.c (NATIVE_NAME (ftruncate)): New function.
Truncate file descriptor and return whether that was successful.
* src/androidvfs.c (android_saf_tree_chmod): Repair file access
permissions allowed within FLAGS.
2023-08-05 Po Lu <[email protected]>
* doc/lispref/commands.texi (Touchscreen Events): Fix typo.
* lisp/subr.el (y-or-n-p): Don't call set-text-conversion-style
when not present.
2023-08-04 Po Lu <[email protected]>
* ChangeLog.android: New file.
2023-08-04 Po Lu <[email protected]>
* src/androidvfs.c (android_verify_jni_string): Move to
android.c.
* src/android.c (android_verify_jni_string): New function.
(android_build_string): Forgo encoding menu text if TEXT is a
multibyte string that's also a valid JNI string.
* src/android.h: Update prototypes.
* java/org/gnu/emacs/EmacsService.java (getDocumentTrees): Don't
encode some characters that need not be escaped within file
names.
2023-08-03 Po Lu <[email protected]>
* src/fileio.c (check_vfs_filename): Revert earlier change.
* src/android.h: Update prototypes.
* src/androidvfs.c (unix_vfs_ops, android_unix_chmod, afs_vfs_ops)
(android_afs_chmod, content_vfs_ops, android_content_chmod)
(authority_vfs_ops, android_authority_chmod, saf_root_vfs_ops)
(android_saf_root_chmod, saf_tree_vfs_ops, android_saf_tree_chmod)
(saf_file_vfs_ops, saf_new_vfs_ops, android_saf_new_chmod)
(root_vfs_ops): Add `chmod' to the list of functions implemented
by each vnode.
(android_fchmodat): New function.
* src/fileio.c (Fset_file_modes): Use `emacs_fchmodat'.
* src/lisp.h:
* src/sysdep.c (emacs_fchmodat): Delegate to android_fchmodat on
Android.
* java/org/gnu/emacs/EmacsSafThread.java (CacheToplevel)
(EmacsSafThread, DocIdEntry, getCache, pruneCache)
(cacheDirectoryFromCursor, run, documentIdFromName1)
(statDocument1, openDocumentDirectory1, openDocument1): Introduce
a file status cache and populate it with files within directories
as they are opened.
* java/org/gnu/emacs/EmacsService.java (createDocument)
(createDirectory, moveDocument): Invalidate the file status cache
wherever needed.
* src/fileio.c (check_vfs_filename):
(Fset_file_modes): Permit `set-file-modes' to silently fail
on asset and content files.
2023-08-02 Po Lu <[email protected]>
* doc/emacs/android.texi (Android, What is Android?)
(Android Startup, Android File System, Android Environment)
(Android Windowing, Android Fonts, Android Troubleshooting):
Improve section titles.
(Android Windowing): Describe the relation between keyboard
modifiers reported by Android and those in key events.
* java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp):
Clear META_SYM_ON and META_META_MASK when retrieving ASCII
characters.
* src/androidgui.h: Add ANDROID_META_MASK.
* src/androidterm.c (android_android_to_emacs_modifiers)
(android_emacs_to_android_modifiers): Transform META to Alt, and
vice versa.
2023-08-01 Po Lu <[email protected]>
* doc/emacs/android.texi (Android File System): Describe how to
access real files named /assets or /contents if so required.
* java/org/gnu/emacs/EmacsService.java (validAuthority):
* src/android.c (android_init_emacs_service):
* src/android.h: New function.
* src/androidvfs.c (android_saf_valid_authority_p): New
function. Wrap the Java function.
(android_saf_root_stat, android_saf_root_access): Don't return
success if no authority by vp->authority's name exists.
(android_saf_tree_from_name): Check validity of string data
before giving it to JNI.
* src/sfnt.c (CHECK_STACK_AVAILABLE): New macro.
(PUSH, PUSH_UNCHECKED): Always define to unchecked versions,
even if TEST.
(PUSH2_UNCHECKED): New macro.
(NPUSHB, NPUSHW, PUSHB, PUSHW): Check the number of remaining
stack elements once.
(stack_overflow_test_args): Expect zero stack arguments.
* src/android.c (ANDROID_THROW): Remove unused macro.
2023-07-31 Po Lu <[email protected]>
* src/sfnt.c (ISECT): Micro-optimize this instruction.
* src/sfntfont.c (sfnt_parse_style): Avoid GC safety problem.
(sfnt_parse_style): Fix misworded commentary.
* 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.
* 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.
2023-07-30 Po Lu <[email protected]>
* 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.
2023-07-29 Po Lu <[email protected]>
* 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.
* src/androidvfs.c: Improve commentary.
2023-07-29 Po Lu <[email protected]>
* 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'.
2023-07-29 Po Lu <[email protected]>
* src/androidvfs.c (android_saf_exception_check): Describe
exceptions earlier.
* java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry)
(getCacheEntry, CacheEntry, documentIdFromName1): Fix earlier
change.
* java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry)
(getCacheEntry, CacheEntry): Use `uptimeMillis' as the basis for
cache expiration.
* 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.
2023-07-28 Po Lu <[email protected]>
* java/org/gnu/emacs/EmacsSafThread.java (documentIdFromName1):
Fix query argument placeholder string.
* src/androidvfs.c (android_document_id_from_name): Don't return
0 if an SAF exception occurs.
* src/androidselect.c (Fandroid_get_clipboard): Don't return
data if clipboard is empty. Reported by Johan Widén
2023-07-28 Po Lu <[email protected]>
* 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.
2023-07-28 Po Lu <[email protected]>
* 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.
2023-07-27 Po Lu <[email protected]>
* 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.
* 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.
* 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.
* java/org/gnu/emacs/EmacsActivity.java (onActivityResult):
* src/androidvfs.c (android_renameat_noreplace, android_rename):
Free vdst using vdst->ops, not vp->ops.
2023-07-27 Po Lu <[email protected]>
* 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)
(androqid_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.
2023-07-23 Po Lu <[email protected]>
* 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.
2023-07-22 Po Lu <[email protected]>
* lisp/touch-screen.el (touch-screen-drag): If
touch-screen-word-select, also keep the initial word within the
region while scrolling.
* 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.
* doc/lispref/commands.texi (Key Sequence Input): Describe which
events receive imaginary prefix keys.
* lisp/touch-screen.el (touch-screen-translate-touch): Consider
`vertical-line' a virtual function key.
(function-key-map): Translate events on vertical window borders.
* etc/NEWS: Announce `current-key-remap-sequence'.
* src/androidfns.c (Fx_create_frame): Default
Qvertical_scroll_bars to Qnil, but set scroll-bar-width and
scroll-bar-height.
2023-07-21 Po Lu <[email protected]>
* 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.
* 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.
* 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.
* 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.
2023-07-20 Po Lu <[email protected]>
* exec/trace.c (handle_readlinkat): Adjust commentary to match
behavior.
* src/android.c (android_get_keysym_name): NULL terminate
*NAME_RETURN.
* lisp/international/mule-cmds.el (set-coding-system-map): Don't
display `set-terminal-coding-system' on Android.
* lisp/cus-edit.el (custom-display): Add `android' display type.
* src/android.c (struct android_event_queue): Don't make
unnecessarily volatile.
* lisp/touch-screen.el (touch-screen-handle-touch): Don't restart
dragging if point is at ZV and the tap falls on a different row.
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu): New
field `title'.
(addSubmenu): New arg TITLE. Set that field.
(expandTo): Set MENU's header title if it's a context menu.
* src/androidmenu.c (android_init_emacs_context_menu): Adjust
signature of `createContextMenu'.
(android_menu_show): Use TITLE instead of pane titles if there's
only one pane.
* doc/emacs/dired.texi (Marks vs Flags): Document command bound
to `touchscreen-hold'.
* doc/lispref/commands.texi (Touchscreen Events): Describe
`touch-screen-inhibit-drag'.
* etc/NEWS: Improve description of changes to touch screen
support.
* lisp/dired-aux.el (dired-do-chxxx, dired-do-chmod)
(dired-do-print, dired-do-shell-command, dired-do-compress-to)
(dired-do-create-files, dired-do-rename, dired-do-isearch)
(dired-do-isearch-regexp, dired-do-search)
(dired-do-query-replace-regexp, dired-do-find-regexp)
(dired-vc-next-action): Disable ``click to select'' after
running this command.
* lisp/dired.el (dired-insert-set-properties): Attach
click-to-select keymap to file names if necessary.
(dired-mode-map): Bind `touchscreen-hold' to click to select
mode.
(dired-post-do-command): New function.
(dired-do-delete): Call it.
(dired-mark-for-click, dired-enable-click-to-select-mode): New
functions.
(dired-click-to-select-mode): New minor mode.
* lisp/touch-screen.el (touch-screen-current-tool): Fix doc
string.
(touch-screen-inhibit-drag): New function.
2023-07-19 Po Lu <[email protected]>
* src/sfnt.c (sfnt_infer_deltas): Improve commentary.
* lisp/touch-screen.el (touch-screen-handle-point-up): If what is
`restart-drag' (meaning that a drag has been restarted but the
touchpoint has not moved), translate the release into a regular
mouse click to deactivate the region.
* build-aux/makecounter.sh (curcount): Rename `counter' to
`emacs_shortlisp_counter'.
* doc/emacs/input.texi (Touchscreens): Document
`touch-screen-extend-selection'.
* doc/lispref/commands.texi (Touchscreen Events): Document
`touchscreen-restart-drag'.
* lisp/touch-screen.el (touch-screen-extend-selection): New user
option.
(touch-screen-restart-drag): New function.
(touch-screen-handle-point-update): Handle `restart-drag'
gestures.
(touch-screen-handle-touch): Check if the prerequisites for
extending a previous drag gesture are met, and generate such
events if so.
(touch-screen-translate-touch): Update doc string.
* src/Makefile.in (otherobj): Remove BUILD_COUNTER_OBJ.
($(lispsource)/international/charprop.el):
(%.elc): Don't depend on bootstrap-emacs if cross configuring for
Android.
(libemacs.so): Directly depend on and link with BUILD_COUNTER_OBJ.
* build-aux/makecounter.sh: New script.
* src/Makefile.in (abs_top_builddir): New variable.
(BUILD_COUNTER_OBJ): Define to build-counter.o
if compiling for Android.
(build-counter.c): New target. Generate this file using
makecounter.sh upon changes to lisp.mk or shortlisp.
(lisp.mk): Make and load relative to abs_top_builddir.
(emacs$(EXEEXT)): Adjust accordingly.
(mostlyclean): Remove build-counter.c.
2023-07-18 Po Lu <[email protected]>
* lisp/touch-screen.el (touch-screen-handle-point-update)
(touch-screen-handle-point-up): Fix typos.
* lisp/touch-screen.el (touch-screen-handle-point-update): Fix
typo.
* src/keyboard.c (make_lispy_event): Return nil if no menu item
is found.
* lisp/touch-screen.el (touch-screen-hold)
(touch-screen-handle-point-up): Don't select inactive minibuffer
windows.
(touch-screen-handle-point-update): Improve detection of left
and right edges.
* lisp/touch-screen.el (touch-screen-handle-touch): Fix treatment
of stray update events.
* src/frame.c (syms_of_frame): Default to nil if HAVE_ANDROID.
* src/keyboard.c (make_lispy_event): Fix botched merge.
* doc/lispref/commands.texi (Touchscreen Events): Describe
treatment of canceled touch sequences during touch event
translation.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): Update JNI
prototypes.
* java/org/gnu/emacs/EmacsWindow.java (motionEvent): Set
cancellation flag in events sent where appropriate.
* lisp/touch-screen.el (touch-screen-handle-point-update):
Improve treatment of horizontal scrolling near window edges.
(touch-screen-handle-touch): Don't handle point up if the touch
sequence has been canceled.
* src/android.c (sendTouchDown, sendTouchUp, sendTouchMove): New
argument `flags'.
* src/androidgui.h (enum android_touch_event_flags): New enum.
(struct android_touch_event): New field `flags'.
* src/androidterm.c (handle_one_android_event): Report
cancellation in TOUCHSCREEN_END_EVENTs.
* src/keyboard.c (make_lispy_event): Fix botched merge.
2023-07-17 Po Lu <[email protected]>
* doc/lispref/commands.texi (Touchscreen Events): Document meaning
of `mouse-1-menu-command'.
* lisp/mouse.el (minor-mode-menu-from-indicator): New arg EVENT.
Give it to popup-menu.
(mouse-minor-mode-menu): Use posn specified within EVENT.
* lisp/touch-screen.el (touch-screen-handle-touch): Fix
interactive translation. Treat commands labeled
`mouse-1-menu-command' like ordinary keymaps.
* doc/lispref/commands.texi (Touchscreen Events): Document
changes to simple translation.
* lisp/touch-screen.el (touch-screen-handle-point-up): Generate
`down-mouse-1' if the current gesture is `mouse-1-menu'.
(touch-screen-handle-touch): If binding is a keymap, set state to
`mouse-1-menu' and wait for point to be released before generating
down-mouse-1.
* lisp/tab-bar.el (tab-bar-map): Don't bind touch-screen-drag.
* lisp/touch-screen.el (touch-screen-drag): Extend the region
based on the position of the mark, not the position of point
relative to EVENT.
(touch-screen-translate-touch): Don't generate virtual function
keys for non-mouse events.
(function-key-map): Remove redundant definitions.
* src/keyboard.c (read_key_sequence): Don't generate *-bar prefix
keys for mock input (such as input from function key translation.)
* doc/emacs/input.texi (Touchscreens): Document the new feature
for people who have trouble dragging to word boundaries.
* lisp/touch-screen.el (touch-screen-word-select): New defcustom.
(touch-screen-word-select-bounds)
(touch-screen-word-select-initial-word): New variable
definitions.
(touch-screen-hold): If `touch-screen-word-select', select the
word around EVENT.
(touch-screen-drag): If `touch-screen-word-select', extend the
region to the next word boundary if the character under point
constitutes a word.
(touch-screen-handle-point-update, touch-screen-handle-touch)
(touch-screen-translate-touch): Fix doc strings and fill
comments.
2023-07-16 Po Lu <[email protected]>
* java/org/gnu/emacs/EmacsService.java (displayToast):
* src/android.c (android_init_emacs_service): Remove unused
function.
* lisp/touch-screen.el (touch-screen-handle-point-up): Correctly
compute posn point.
(touch-screen-translate-touch): Update doc string.
(function-key-map): Define touch screen translation functions
within the internal border.
* doc/lispref/commands.texi (Touchscreen Events): Improve
documentation.
* lisp/tab-bar.el (tab-bar-map): Bind `[tab-bar
touchscreen-hold]'.
* lisp/touch-screen.el (touch-screen-hold, touch-screen-drag):
New functions.
(touch-screen-handle-timeout): Generate a `touchscreen-hold'
event instead.
(touch-screen-handle-point-update): Generate a
`touchscreen-drag' event upon dragging.
(touch-screen-translate-touch): Cancel touch screen timer upon
exit.
* src/keyboard.c (access_keymap_keyremap): Take unsigned int
start and end instead.
* doc/emacs/emacs.texi (Top):
* doc/emacs/input.texi (Other Input Devices): Correctly
capitalize subsection name.
(Touchscreens): Document additional translation.
* doc/lispref/commands.texi (Touchscreen Events): Document that
`touchscreen-end' events now have prefix keys. Also, describe
mouse emulation and `touchscreen-scroll' events.
* doc/lispref/keymaps.texi (Translation Keymaps): Document
`current-key-remap-sequence'.
* lisp/touch-screen.el (touch-screen-translate-prompt): New
function.
(touch-screen-scroll): New command. Bind to `touchscreen-scroll'.
(touch-screen-handle-point-update, touch-screen-handle-point-up)
(touch-screen-handle-touch): Refactor to actually translate touch
screen event sequences, as opposed to looking up commands and
executing them.
(touch-screen-translate-touch): New function. Bind in
function-key-map to all touch screen events.
(touch-screen-drag-mode-line-1, touch-screen-drag-mode-line)
(touch-screen-tap-header-line): Remove special commands for
dragging the mode line and clicking on the header line.
* lisp/wid-edit.el (widget-button-click): Adjust accordingly.
* src/keyboard.c (access_keymap_keyremap): Bind
`current-key-remap-sequence' to the key sequence being remapped.
(keyremap_step): Give fkey->start and fkey->end to
access_keymap_keyremap.
(head_table): Add imaginary prefix to touchscreen-end events as
well.
(syms_of_keyboard): New variable Vcurrent_key_remap_sequence.
2023-07-15 Po Lu <[email protected]>
* doc/emacs/android.texi (Android): Add new node to menu.
(Android Environment): Add footnote pointing to new node.
(Android Software): New node.
* doc/emacs/emacs.texi (Top): Add new node to menu.
* java/AndroidManifest.xml.in (manifest): Fix location of
sharedUserId property.
* java/INSTALL: Improve documentation of shared user ID
support.
2023-07-14 Po Lu <[email protected]>
* configure.ac (ANDROID_SHARED_USER_NAME): New variable.
Substitute it.
* java/AndroidManifest.xml.in: Set `sharedUserLabel' if a shared
user ID is enabled.
* java/res/values/strings.xml (shared_user_name): New string
resource.
* src/android.c (android_blit_copy): Don't check for overflow
where not required.
* java/org/gnu/emacs/EmacsInputConnection.java
(getSurroundingText): Don't print debug information if DEBUG_IC is
off.
* lisp/calc/calc.el (calc): Fix typo.
2023-07-13 Po Lu <[email protected]>
* etc/NEWS: Announce the new tool bar.
* etc/images/last-page.xpm:
* etc/images/last-page.pbm: New images. Mirrored from
next-page.xpm.
* lisp/doc-view.el (doc-view-menu): Use `doc-view-new-search'
instead of an anonymous function.
(doc-view-tool-bar-map): New keymap.
(doc-view-search): Update the tool bar after initiating a search.
(doc-view-new-search): New command.
(doc-view-mode): Set the tool bar map appropriately.
Restore hardware acceleration, as a small degree of tearing is
preferable towards large slowdowns on some specific devices. The
slight tearing remains, but a workaround for the GPU texture
remaining partially updated has been introduced.
* java/AndroidManifest.xml.in:
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog): Don't
change hardware acceleration state.
* java/org/gnu/emacs/EmacsNative.java (notifyPixelsChanged): New
function.
* java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView):
New field `bitmapChanged'.
(copyToFrontBuffer): Signal that the bitmap has changed.
(onDraw): If the bitmap has changed, increment the generation ID.
* src/android.c (JNICALL): Implement new function.
2023-07-13 Po Lu <[email protected]>
Disable hardware acceleration on Android. It serves no purpose
and causes tearing. Uploading the bitmap to the GPU takes about
as long as it does to incrementally update the surface in
software.
* java/AndroidManifest.xml.in: Disable hardware acceleration.
* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): Make
lastClosedMenu static.
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog): Enable
hardware acceleration within alert dialogs.
* java/org/gnu/emacs/EmacsSurfaceView.java (onDraw): Describe
why hardware acceleration is disabled.
* java/org/gnu/emacs/EmacsWindow.java (run): Remove redundant
call.
2023-07-12 Po Lu <[email protected]>
* src/android.c (android_run_select_thread): Fix typo.
* src/android.c (android_run_select_thread): Correctly return the
set of ready read and write descriptors on __ANDROID_API__ < 16
systems.
(android_select): Clear the set of ready file descriptors if
events from the event queue are present despite pselect failing.
* src/androidterm.c (android_android_to_emacs_modifiers)
(android_emacs_to_android_modifiers): Fix statement precedence
bugs.
* src/doc.c (doc_close): Remove unused macro.
* java/org/gnu/emacs/EmacsWindow.java (whatButtonWasIt): Handle
back and forward buttons along with styluses.
* src/doc.c (close_file_unwind_android_fd): New function.
(get_doc_string, Fsnarf_documentation): Don't create a temporary
fd if it can be avoided.
2023-07-11 Po Lu <[email protected]>
* .gitignore: Ignore cross/etc/DOC.
* configure.ac: Make the directory `cross/etc'.
* cross/Makefile.in (CLEAN_SUBDIRS): Clean files inside `etc' as
well.
* java/Makefile.in (install_temp): Copy cross/etc/DOC to the
package if it is available.
* src/Makefile.in (SOME_MACHINE_OBJECTS): Add androidselect.c,
sfntfont-android.c and sfntfont.c.
(libemacs.so): Depend on $(etc)/DOC.
* src/sfnt.c (sfnt_fill_span): Correctly clip span to raster
width, ensuring that the last pixel is filled.