1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-19 10:22:27 +00:00
Commit Graph

148927 Commits

Author SHA1 Message Date
Lars Ingebrigtsen
7ec5a9593d Document the syntax-multilne text property
* doc/lispref/modes.texi (Multiline Font Lock): Document the
syntax-multiline text property (bug#20436).
2021-07-13 21:29:13 +02:00
Juri Linkov
35a8861619 Support Isearch filter predicates with empty search hits (bug#49534)
* lisp/isearch.el (isearch-search): Move (= (match-beginning 0) (match-end 0))
and (bobp)/(eobp) outside the call to isearch-filter-predicate.
Use forward-char 1/-1 on empty matches only when going to retry search.
(isearch-lazy-highlight-search):  Remove (= (point) bound),
but leave (= (match-beginning 0) (match-end 0)) since empty matches
make no sense in lazy-highlighting.
2021-07-13 22:25:05 +03:00
Lars Ingebrigtsen
b68e7a64ae Make 'tex-validate-buffer' work again
* lisp/textmodes/tex-mode.el (tex-validate-buffer): The *Occur*
buffer is read-only, so inhibit that before inserting things into
it (bug#19326).
2021-07-13 20:13:26 +02:00
Michael Albinus
1e96b97e3c Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2021-07-13 19:50:30 +02:00
Michael Albinus
cce84822f7 Add remote-file-name-inhibit-locks
* doc/emacs/files.texi (Interlocking):
* doc/lispref/files.texi (File Locks):
* doc/misc/tramp.texi (Auto-save File Lock and Backup):
Add remote-file-name-inhibit-locks.

* etc/NEWS: New user option 'remote-file-name-inhibit-locks'.

* lisp/files.el (remote-file-name-inhibit-locks): New defcustom.

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

* lisp/net/tramp.el (tramp-allow-unsafe-temporary-files): Fix docstring.
(tramp-handle-make-lock-file-name): New defun.

* test/lisp/net/tramp-tests.el (tramp-test39-lock-file): Extend test.
2021-07-13 19:50:05 +02:00
Lars Ingebrigtsen
5afe27624f Add new user option to avoid piling on Dired buffers
* doc/emacs/dired.texi (Dired Visiting): Document it.

* lisp/dired.el (dired-kill-when-opening-new-dired-buffer): New
user option (bug#20598).
(dired-up-directory, dired-find-file): Use it.
(dired--find-possibly-alternative-file): New convenience command
to respect the user option.
2021-07-13 19:49:50 +02:00
Mattias Engdegård
7a803ecd3d Block TLS handshake until TCP connection established
If a TLS handshake is attempted before the completion of an
asynchronous TCP connection has been ascertained, our local state will
not be set up correctly for further progress and the sentinel "open"
event will never be sent.  This can occur if sufficient time passes
after the initiation of an async TCP connection so that by the time
`wait_reading_process_output` is called, the connection has already
been established on the TCP level.

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

* src/process.c (wait_reading_process_output): Gate the TLS handshake
by the NON_BLOCKING_CONNECT_FD flag.  The flag will be cleared as soon
as the TCP socket is found to be writable.
* test/src/process-tests.el (process-async-https-with-delay):
New test.
2021-07-13 19:07:41 +02:00
Ken Brown
a41f585bf1 Fix portability issue with make-serial-process
* src/sysdep.c (struct speed_struct): New struct.
(speeds): New static array of struct speed_struct.
(convert_speed): New static function to convert a numerical baud
rate (e.g., 9600) to a Bnnn constant defined in termios.h (e.g.,
B9600).
(serial_configure): Use convert_speed to make the call to cfsetspeed
compliant with its advertised API.  (Bug#49524)
2021-07-13 09:02:45 -04:00
Basil L. Contovounesios
d672d576ff ; * doc/lispref/intro.texi (Caveats): Fix paren. 2021-07-12 15:03:18 +01:00
Michael Albinus
bfd159539f Fix a problem with tramp-*-process-file
* lisp/net/tramp-adb.el (tramp-adb-handle-process-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-process-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-process-file):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file):
Use `(expand-file-name default-directory)'.
2021-07-12 15:49:50 +02:00
Paul Eggert
a79c578f3d Port test module to glibc 2.33
* test/Makefile.in (REPLACE_FREE, FREE_SOURCE_0, FREE_SOURCE_1):
New macros.
($(test_module)): Improve accuracy of test as to whether free.c
should be compiled; glibc 2.33 does not need it compiled and the
compilation breaks if you try, if you build with
--enable-gcc-warnings.
2021-07-12 00:12:21 -07:00
Paul Eggert
c22cf4d02f Pacify gcc 11.1.1 -Wclobbered
* src/eval.c (Fprogn, internal_lisp_condition_case):
Add CACHEABLE to work around more instances of -Wclobbered bug.
2021-07-12 00:12:21 -07:00
Paul Eggert
1a0fe2a518 Pacify gcc 11.1.1 -Wanalyzer-possible-null-dereference
* oldXMenu/Create.c (XMenuCreate):
* oldXMenu/Internal.c (_XMRecomputePane, _XMRecomputeSelection):
* oldXMenu/XMakeAssoc.c (XMakeAssoc):
* test/src/emacs-module-resources/mod-test.c (Fmod_test_userptr_make):
Don’t assume that malloc and calloc succeed.
2021-07-12 00:12:21 -07:00
Paul Eggert
2337869fbf Pacify gcc 11.1.1 -Wanalyzer-null-argument
* lib-src/etags.c (regexp): Omit member force_explicit_name,
since it’s always true.  All uses removed.  This lets us
remove calls to strlen (name) where GCC isn’t smart enough
to deduce that name must be nonnull.
* lib-src/movemail.c (main): Fix bug that could cause
link (tempname, NULL) to be called.
* src/emacs.c (argmatch): Break check into two ‘if’s,
since GCC doesn’t seem to be smart enough to check the single ‘if’.
* src/gtkutil.c (xg_update_menu_item): Fix bug where strcmp
could be given a NULL arg.
* src/xfont.c (xfont_list_family): Use nonnull value for dummy
initial value.
2021-07-12 00:12:20 -07:00
Paul Eggert
da2f772fe5 Pacify gcc -Woverflow more nicely
* src/alloc.c (mark_maybe_pointer): Simplify pacification
of gcc -Woverflow (unknown GCC version).
2021-07-12 00:12:20 -07:00
Juri Linkov
352baac72f * lisp/textmodes/enriched.el: Require 'facemenu' (bug#49466) 2021-07-12 02:45:51 +03:00
Eric Abrahamsen
e25c1b5cd3 Further tweaks to gnus-search-query-expand-key
* lisp/gnus/gnus-search.el (gnus-search-query-expand-key): It's
possible that KEY could be partially completed (ie no longer string=
to COMP), but not all the way. Use a more accurate test. Add
docstring.
2021-07-11 09:05:04 -07:00
Michael Albinus
ad6ad1646d Use `auto-save-file-name-p' in tramp-*-write-region
* lisp/net/tramp.el (tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-write-region):
Use `auto-save-file-name-p'.
2021-07-11 17:41:33 +02:00
Eli Zaretskii
56c9ecc78a Fix compilation of the --with-wide-int configuration
* src/alloc.c (mark_maybe_pointer): Fix a recent change for
WIDE_EMACS_INT builds.  (Bug#49261)
2021-07-11 18:22:51 +03:00
Basil L. Contovounesios
46f9949e1f ; Fix misspellings of 'occurrence' in docs. 2021-07-11 11:55:31 +01:00
Eli Zaretskii
5b9daab3a7 ; * doc/lispref/text.texi (Substitution): Fix a recent change. 2021-07-11 13:15:34 +03:00
Paul Eggert
3b29afa680 Pacify GCC 11.1.1 20210531 (Red Hat 11.1.1-3)
* src/image.c (xpm_load_image):
* src/xfns.c (x_icon):
Rework to pacify gcc -Wmaybe-uninitialized.
2021-07-11 01:30:12 -07:00
Paul Eggert
f6472cc8e2 Make pdumper-marking pickier
Prevent some false-positives in conservative GC marking.
This doesn’t fix any correctness bugs; it’s merely to
reclaim some memory instead of keeping it unnecessarily.
* src/alloc.c (mark_maybe_pointer): New arg SYMBOL_ONLY.
All callers changed.  Check that the pointer’s tag, if any,
matches the pdumper-reported type.
2021-07-11 01:30:11 -07:00
Paul Eggert
2f7afef5ff Fix pdumper-related GC bug
* src/alloc.c (mark_maybe_pointer): Also mark pointers
to pdumper objects, even when the pointers are tagged.
Add a FIXME saying why this isn’t enough.
2021-07-11 01:30:11 -07:00
Eric Abrahamsen
d93ff9459f Rewrite gnus-search-query-expand-key
* lisp/gnus/gnus-search.el (gnus-search-query-expand-key): There was a
misunderstanding about how completion-all-completion works (if the
test string can't be completed, the whole table is returned). Simplify
to use try-completion.
* test/lisp/gnus/gnus-search-tests.el (gnus-s-expand-keyword): Ensure
that an unknown/uncompletable keyword is returned unmolested.
2021-07-10 20:22:35 -07:00
Eric Abrahamsen
e7f6bb38dd Rework gnus-search-indexed-parse-output
* lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Be more
careful about matching filesystem paths to Gnus group names; make
absolutely sure that we only return valid article numbers.
2021-07-10 20:22:34 -07:00
Matthew White
0897ade8f9 * src/buffer.c (kill-buffer): Fix a typo.
* src/buffer.c (Fkill_buffer): Fix typo in comment.
2021-07-11 00:49:12 +02:00
Filipp Gunbin
b7a495f8d0 doc/lispref/text.texi (Substitution): Add subst-char-in-string
* doc/lispref/text.texi (Substitution): Document
subst-char-in-string (bug#49420).
2021-07-10 19:00:01 +02:00
Lars Ingebrigtsen
da7dbfdf68 Make package-menu-filter-by-status work as documented
* lisp/emacs-lisp/package.el (package-menu-filter-by-status): Work
as documented (bug#49474).
2021-07-10 18:53:28 +02:00
Ken Brown
3fa711c11d Skip a process test on Cygwin to avoid hang
* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-network-process): Skip
test on Cygwin to avoid hang due to connect/accept handshake.
(Bug#49496)
2021-07-09 16:37:52 -04:00
Stefan Monnier
b423848b5e * lisp/facemenu.el: Preload the C-mouse-2 menu binding 2021-07-09 15:53:38 -04:00
Michael Albinus
9ce6541ac9 Further cleanup for file locks
* doc/misc/tramp.texi (Top, Configuration): Adapt node name for
file locks.
(Auto-save File Lock and Backup): Rename node name and section
title.  Add file-lock to @cindex.  Describe file locks.

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

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

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

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

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

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

* test/lisp/net/tramp-tests.el (create-lockfiles): Don't set it
globally.
(tramp-test39-lock-file): Check also for `set-visited-file-name'.
2021-07-09 18:14:19 +02:00
Eli Zaretskii
2870a72d0d Partially restore the lost C-mouse-2 drop-down menu
This allows to pop up the Text Properties menu once facemenu is
loaded.  It still doesn't allow C-mouse-2 clicks without manually
loading facemenu; FIXME.
* lisp/facemenu.el (global-map) <C-down-mouse-2>: Add back the
removed binding.  (Bug#49466)
2021-07-09 14:37:49 +03:00
Stefan Monnier
c73bc89e66 * lisp/outline.el (outline-mode-cycle-map): Don't bind tab.
Since it would take precedence over bindings for TAB in higher
precedence maps.
2021-07-08 23:00:03 -04:00
Michael Albinus
4bfdf8c78e * doc/lispref/files.texi (Magic File Names): Add make-lock-file-name. 2021-07-08 21:14:28 +02:00
Michael Albinus
a6a92e3ac5 Code cleanup wrt file locks
* lisp/files.el (make-lock-file-name): Fix docstring.

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

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

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

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

* src/lisp.h (unlock_file): Remove.
2021-07-08 21:13:40 +02:00
Juri Linkov
274e71f5cc Don't turn mouse-1 into mouse-2 when clicking on the tab-line (bug#49247)
* lisp/tab-line.el (tab-line-tab-name-format-default): For 'tab-line-tab-map'
add the property 'follow-link' with the value 'ignore'.
2021-07-08 20:51:15 +03:00
pillule
57354bc64b Use display-buffer with re-builder (bug#49069)
* lisp/emacs-lisp/re-builder.el (re-builder): Uses 'display-buffer'
with 'display-buffer-in-direction' to display the reb-buffer.  This
allow user-customizations and using it on not splitables windows.
Add a dedication to its window so killing this buffer quit the window.
2021-07-08 20:39:39 +03:00
Lars Ingebrigtsen
8ab0c04c2c Make desktop-kill more robust
* lisp/desktop.el (desktop-kill): Allow exiting Emacs even if we
can't delete the desktop file (bug#20762).
2021-07-08 16:33:28 +02:00
Lars Ingebrigtsen
cd1313b7f1 Allow inhibiting inserting #! in sh-set-shell
* lisp/progmodes/sh-script.el (sh-set-shell): Allow inhibiting
inserting the #! line (bug#20959).
2021-07-08 16:23:29 +02:00
Lars Ingebrigtsen
57eb0db9dc Avoid making backup files in ediff when `make-backup-files' is nil
* lisp/vc/ediff-util.el (ediff-arrange-autosave-in-merge-jobs):
Don't make backup files when `make-backup-files' is nil (bug#21599).
2021-07-08 15:46:38 +02:00
Lars Ingebrigtsen
de5ae0c964 Make ido-mode override ffap-file-finder
* lisp/ffap.el: Autoload so that we can override in ido (bug#21980).

* lisp/ido.el (ido-everywhere): Override ffap-file-finder.
2021-07-08 15:25:34 +02:00
Michael Albinus
6d580b00e4 Some further adaptions wrt Tramp file name locks
* lisp/files.el (files--transform-file-name): Rename from
`auto-save--transform-file-name'.  Wrap with `save-match-data'.
(make-auto-save-file-name): Use it.
(make-lock-file-name): Use it.  Call file name handler.

* lisp/net/tramp.el (tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
Suppress file lock for temporary file.

* lisp/net/tramp-compat.el (tramp-compat-make-lock-file-name):
New defalias.

* lisp/net/tramp.el (tramp-get-lock-file)
(tramp-handle-lock-file, tramp-handle-unlock-file): Use it.
(tramp-make-lock-name): Remove.

* test/lisp/filenotify-tests.el (file-notify-test03-events-remote):
Tag it :unstable temporarily.
2021-07-08 07:48:40 +02:00
Lars Ingebrigtsen
7d6d14023a Exclude term-mode from hi-lock global modes
* lisp/hi-lock.el (hi-lock-exclude-modes): Exclude term-mode so
that `C-x' works in terminal buffers (bug#22620).
2021-07-08 03:23:46 +02:00
Lars Ingebrigtsen
a45906ac1a Fix font-lock of Makefile variables at the start of lines
* lisp/progmodes/make-mode.el (makefile-var-use-regex): Match
variables at the beginning of lines correctly (bug#23266).  Change
suggested by Anders Lindgren <andlind@gmail.com>.
2021-07-08 02:57:46 +02:00
N. Jackson
1ffc97a211 Mention what happens with timers when the computer is asleep
* doc/lispref/os.texi (Timers): Explain what happens if the
computer is a asleep when the timer is scheduled (bug#23929).
2021-07-08 02:43:20 +02:00
Lars Ingebrigtsen
e762864b9d Make make_lock_file_name more robust
* src/filelock.c (make_lock_file_name): Protect against the
make-lock-file-name not being defined.
(lock_file, unlock_file_body, Ffile_locked_p): Return early if not
defined.
2021-07-07 22:15:47 +02:00
Eli Zaretskii
fadfc55db1 * lisp/faces.el: Fix a typo. 2021-07-07 23:10:52 +03:00
Eli Zaretskii
9034dd0531 Fix last change
* lisp/faces.el (tty-menu-enabled-face, tty-menu-disabled-face):
Define for monochrome displays.
2021-07-07 22:53:28 +03:00
Lars Ingebrigtsen
2ad34bcea4 Add new user option lock-file-name-transforms
* doc/emacs/files.texi (Interlocking): Mention
lock-file-name-transforms.

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

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

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

* src/filelock.c: Remove MAKE_LOCK_NAME and fill_in_lock_file_name.
(make_lock_file_name): New utility function that calls out to Lisp
to heed `lock-file-name-transforms'.
(lock_file): Use it.  Also remove likely buggy call to
dostounix_filename.
(unlock_file_body, Ffile_locked_p): Also use make_lock_file_name.
2021-07-07 21:39:20 +02:00