1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-15 17:00:26 +00:00
Commit Graph

148898 Commits

Author SHA1 Message Date
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
Eli Zaretskii
6d594848e0 Fix tty menus on monochrome displays
* lisp/faces.el (tty-menu-selected-face): Make sure the selected
menu item stands out even without colors.
2021-07-07 22:36:27 +03:00
Michael Albinus
d35868bec9 Implement file locks for remote files (Bug#49261)
* doc/lispref/files.texi (Magic File Names): Add file-locked-p,
lock-file and unlock-file.

* etc/NEWS: Tramp supports file locks now.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-adb-handle-write-region): Handle LOCKNAME.

* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.

* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-crypt-handle-file-locked-p, tramp-crypt-handle-lock-file)
(tramp-crypt-handle-unlock-file): New defun.

* lisp/net/tramp-fuse.el (tramp-fuse-mounted-p): Simplify.
(tramp-fuse-unmount): New defun.

* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-gvfs-maybe-open-connection): Set "lock-pid" connection property.

* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-rclone-maybe-open-connection): Set "lock-pid" connection property.

* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-sh-handle-write-region): Handle LOCKNAME.

* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-smb-handle-copy-directory): Use `sleep-for'.
(tramp-smb-handle-write-region): Handle LOCKNAME.

* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-sshfs-handle-write-region): Handle LOCKNAME.
(tramp-sshfs-maybe-open-connection): Set "lock-pid" connection property.

* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-sudoedit-maybe-open-connection):
Set "lock-pid" connection property.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Add `file-locked-p', `lock-file' and `unlock-file'.
(tramp-make-lock-name, tramp-get-lock-file, tramp-get-lock-pid)
(tramp-handle-file-locked-p, tramp-handle-lock-file)
(tramp-handle-unlock-file): New defuns.
(tramp-lock-file-contents-regexp): New regexp.
(tramp-handle-write-region): Handle LOCKNAME.

* src/filelock.c (lock_file, unlock_file_body, Ffile_locked_p):
Call handler if exists.
(Flock_file, Funlock_file): New defuns.
(Qlock_file, Qunlock_file, Qfile_locked_p): Declare symbols.
(Slock_file, Sunlock_file): Declare subroutines.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test40-make-nearby-temp-file)
(tramp-archive-test43-file-system-info): Rename.

* test/lisp/net/tramp-tests.el (top): Set `create-lockfiles' to nil.
(tramp--test-fuse-p): New defun.
(tramp-test14-delete-directory): Use it.
(tramp-test39-lock-file): New test.
(tramp-test40-make-nearby-temp-file)
(tramp-test41-special-characters)
(tramp-test41-special-characters-with-stat)
(tramp-test41-special-characters-with-perl)
(tramp-test41-special-characters-with-ls, tramp-test42-utf8)
(tramp-test42-utf8-with-stat, tramp-test42-utf8-with-perl)
(tramp-test42-utf8-with-ls, tramp-test43-file-system-info)
(tramp-test44-asynchronous-requests, tramp-test45-auto-load)
(tramp-test45-delay-load, tramp-test45-recursive-load)
(tramp-test45-remote-load-path, tramp-test46-unload): Rename.
(tramp--test-special-characters, tramp--test-utf8)
(tramp--test-asynchronous-requests-timeout): Modify docstring.
2021-07-07 18:36:53 +02:00
Glenn Morris
90c89e8bde Merge from origin/emacs-27
fbf1cb2bf2 (origin/emacs-27) Fix overfull hbox in Emacs manual
fda60094a2 Minor copyedits of Emacs manual

# Conflicts:
#	doc/emacs/display.texi
2021-07-07 08:04:03 -07:00
Lars Ingebrigtsen
e7cdbc1d1d Make previous empty-body warning disabling more robust
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
`byte-compile-warning-enabled-p' may not be defined here.
2021-07-06 22:01:55 +02:00
Basil L. Contovounesios
044742bfe8 Avoid invalid regexp in wide docstring check
* lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p):
Avoid constructing an invalid regexp during byte-compilation by
limiting the number of columns to the current RE_DUP_MAX of 65535.
This protects against pathological values of fill-column, for
example (bug#49426).
2021-07-06 18:56:15 +01:00
Juri Linkov
4db28a9dc8 * lisp/repeat.el (describe-repeat-maps): Rename from `describe-repeat'.
Fix text strings (bug#49265).
2021-07-06 20:53:09 +03:00
Lars Ingebrigtsen
855fd92120 Make `M-x clipboard-yank' work reliably
* lisp/menu-bar.el (clipboard-yank): Make the command work
consistently (bug#27442).

* lisp/select.el (gui-selection-value): Try to explain why the
logic is the way it is.
2021-07-06 19:25:41 +02:00
Lars Ingebrigtsen
abe5eb9add Explain what ( . c) means to the Emacs Lisp reader
* doc/lispref/objects.texi (Dotted Pair Notation): Explain what
( . c) means to the Lisp reader (bug#24875).
2021-07-06 19:13:58 +02:00
Eli Zaretskii
10753bc688 Fix right-margin display on TTY frames
* src/dispnew.c (prepare_desired_row, adjust_glyph_matrix): Adjust
the glyph pointer of the right-margin area for all windows but the
rightmost ones on TTY frames, to account for the border glyph.
(Bug#48257)
2021-07-06 20:11:51 +03:00
Lars Ingebrigtsen
69f1bd38f0 Warn when wrapping index matches with ,' after i' in Info
* lisp/info.el (Info--current-index-alternative): New internal
variable.
(Info-warn-on-index-alternatives-wrap): New user option (bug#24282).
(Info-index-next): Use the new user option.
2021-07-06 18:56:51 +02:00
Protesilaos Stavrou
1431fd91b4 Add faces for shr heading elements (bug#49433)
* etc/NEWS: Document new faces.
* lisp/net/shr.el (shr-h1, shr-h2, shr-h3, shr-h4, shr-h5, shr-h6):
Define new faces.
(shr-tag-h1): Remove inclusion of 'variable-pitch' face.  Fix
bug#49433 by applying a new face directly.
(shr-tag-h2, shr-tag-h3, shr-tag-h4, shr-tag-h5, shr-tag-h6): Apply
new faces.
2021-07-06 17:06:17 +02:00
Lars Ingebrigtsen
d8bd7d015e Make gnus-gcc-externalize-attachments work again
* lisp/gnus/gnus-msg.el (gnus-inews-do-gcc): Allow externalizing
parts again by defeating the cache (bug#49436).
2021-07-06 17:04:28 +02:00
Lars Ingebrigtsen
43fba076c9 Allow inhibiting warnings about unused variables and empty bodies
* lisp/emacs-lisp/cconv.el (cconv--warn-unused-msg): Allow
inhibiting warnings about unbound variables (bug#26486).

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Allow
inhibiting warnings about empty bodies.
2021-07-06 16:43:49 +02:00
Lars Ingebrigtsen
748bf7b93e Allow using `mm-inline-message' from other mail clients than Gnus
* lisp/gnus/mm-view.el (mm-inline-message-prepare-function): New
variable (bug#49380).
(mm-inline-message): Use it to separate out the Gnus-specific code.
* lisp/gnus/gnus-art.el (gnus-mime-display-single): ... which has
been moved here.
2021-07-06 16:34:24 +02:00
Eli Zaretskii
fbf1cb2bf2 Fix overfull hbox in Emacs manual
* doc/emacs/display.texi (Displaying Boundaries): Fix overfull
hbox.
2021-07-06 15:25:51 +03:00
Eli Zaretskii
fda60094a2 Minor copyedits of Emacs manual
* doc/emacs/book-spine.texi: Fix the author attribution.
(Bug#49405)
* doc/emacs/back.texi: Update text.
2021-07-06 14:57:19 +03:00
Dmitry Gutov
6ec3cf1ccb (xref--insert-xrefs): Fix printing of line numbers
* lisp/progmodes/xref.el (xref--insert-xrefs):
Fix printing of line numbers when we have multiple files with
(e.g.) single match on the same line.
2021-07-06 01:56:18 +03:00
Philipp Stephani
f2896fdb6a ; * test/lisp/subr-tests.el (subr-tests-add-hook-depth): Fix a typo. 2021-07-05 20:34:55 +02:00
Stephen Leake
c03ad2b19e * lisp/progmodes/bug-reference.el: Refer to info manual node 2021-07-05 10:04:56 -07:00
Lars Ingebrigtsen
68276f6d30 Support reverting in Customize buffers
* lisp/cus-edit.el (custom--revert-buffer): New function (bug#26871).
(Custom-mode): Set up reversion.
(custom--invocation-options): New variable.
(custom-buffer-create-internal): Set it.
2021-07-05 16:56:07 +02:00
Lars Ingebrigtsen
a111978de8 Count zero-length matches in `count-matches' correctly
* lisp/replace.el (how-many): Count zero-length matches correctly
(bug#27359).
2021-07-05 16:30:43 +02:00
Lars Ingebrigtsen
26b9564bd5 Propagate :safe properties when autoloading defcustoms
* lisp/emacs-lisp/autoload.el (make-autoload): Propagate the :safe
property to the loaddefs file (bug#28104).
2021-07-05 15:55:38 +02:00
Lars Ingebrigtsen
62fbeed9a9 Make `bookmark--unfontify' more robust
* lisp/bookmark.el (bookmark--unfontify): Don't bug out if there's
no fontification recorded (bug#49341).
2021-07-05 15:09:45 +02:00
Lars Ingebrigtsen
82c6327555 `image-save' doc string clarification
* lisp/image.el (image-save): Clarify what's being saved
(bug#49347).
2021-07-05 14:50:02 +02:00
Michael Albinus
579b0c006e Don't use LOCKNAME for temp files in Tramp (Bug#49406)
* 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):
Don't use LOCKNAME for temp file.  (Bug#49406)

* test/lisp/shadowfile-tests.el (password-cache-expiry):
Set `shadow-debug' also on emba.
2021-07-05 12:09:28 +02:00
Martin Rudalics
f7dcad9275 Show hand cursor when dragging frame (Bug#49247)
* src/xdisp.c (note_mode_line_or_margin_highlight): Show hand
cursor when dragging frame with mode, tab or header line.
(syms_of_xdisp): Define Qdrag_with_mode_line,
Qdrag_with_header_line and Qdrag_with_tab_line.
2021-07-05 10:53:39 +02:00
Michael Albinus
ddf6226350 Fix newly introduced error in tramp-tests.el (Bug#49406)
* test/lisp/net/tramp-tests.el (tramp--test-check-files):
Filter out empty strings.  (Bug#49406)
2021-07-05 10:24:31 +02:00
Lars Ingebrigtsen
ed15f3954c Ignore .dir-locals-2.el files more
* lisp/emacs-lisp/shadow.el (load-path-shadows-find):
* lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Ignore
.dir-locals-2.el, too (bug#23257).
2021-07-04 16:23:46 +02:00
Jim Porter
2f2afa0b31 Ensure 'call-process' interprets INFILE as a local path
* src/callproc.c (get_current_directory): Rename from
'encode_current_directory' and add boolean ENCODE flag.
(Fcall_process): Interpret INFILE relative to the working directory
from which PROGRAM is run, not 'default-directory'.
(call_process): Use 'get_current_directory'.
* src/process.c (Fmake_process): Use 'get_current_directory'.
* src/process.h (get_current_directory): Rename decl from
'encode_current_directory'.
* src/sysdep.c (sys_subshell): Use 'get_current_directory' (bug#49283).
2021-07-04 15:32:03 +02:00