* 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.
* 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.
* 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).
Eli Zaretskii [Tue, 6 Jul 2021 17:11:51 +0000 (20:11 +0300)]
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)
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.
* 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.
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.
* 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.
Martin Rudalics [Mon, 5 Jul 2021 08:53:39 +0000 (10:53 +0200)]
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.
Jim Porter [Sun, 4 Jul 2021 13:32:03 +0000 (15:32 +0200)]
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).
Update IRC-related references to point to Libera.Chat
Per GNU and FSF's announcements [0, 1] of moving official IRC channels
to the Libera.Chat IRC network, as well as several Emacs-related
channels following suit [2], update IRC-related references to reflect
the migration.
Retain documentation string when customizing theme
* lisp/cus-theme.el (customize-create-theme): When editing an existing
theme, load its doc string into the description widget, instead of
replacing it with a date stamp (Bug#49274).
Don't have desktop-save-mode query on `M-x kill-emacs'
* lisp/desktop.el (noninteractive): Prompting functions should not
be added to `kill-emacs-hook' (bug#28943).
(desktop-kill): Return t so that it can be used from
`kill-emacs-query-functions'.
Peter Oliver [Wed, 9 Jun 2021 11:58:39 +0000 (12:58 +0100)]
Hide emacs-mail.desktop, emacsclient-mail.desktop from menus
These are intended for use as mailto: URL handlers, not for launching
directly, so we can reduce clutter by hiding them from a desktop
environment’s menus.
Peter Oliver [Wed, 9 Jun 2021 11:44:32 +0000 (12:44 +0100)]
Provide an emacsclient-mail.desktop
We provide both an emacs.desktop and an emacsclient.desktop, so for
consistency let’s do the same with mail.
* etc/emacs-mail.desktop: Extract suggestions for using emacsclient
from comments to create emacsclient-mail.desktop.
* etc/emacsclient-mail.desktop: Send mail using an existing Emacs
rather than starting a new one.
Iku Iwasa [Sun, 27 Jun 2021 15:36:00 +0000 (17:36 +0200)]
lisp/auth-source-pass.el: Support multiple hosts in search spec
* lisp/auth-source-pass.el (auth-source-pass-search): Accept a list of
strings for argument HOST.
(auth-source-pass--build-result): Rename argument HOST to HOSTS. Also
return value "host" from entry if it exists.
(auth-source-pass--find-match): Rename argument HOST to HOSTS. Iterate
over each host in HOSTS.
* test/lisp/auth-source-pass-tests.el: Add corresponding tests
Jim Porter [Thu, 1 Jul 2021 11:01:00 +0000 (13:01 +0200)]
Don't pass 'null-device' to 'call-process' in ispell
* lisp/textmodes/ispell.el (ispell-find-hunspell-dictionaries):
Replace 'null-device' with nil (bug#49283). This allows running a
local ispell process when editing a buffer editing a file via Tramp.
Martin Rudalics [Fri, 2 Jul 2021 08:55:42 +0000 (10:55 +0200)]
New frame parameter 'drag-with-tab-line' (Bug#49247)
The new frame parameter 'drag-with-tab-line' allows to move
frames by dragging their topmost windows' tab line with the
mouse thus achieving a behavior similar to that provided by
the 'drag-with-header-line' parameter.
* lisp/mouse.el (mouse-drag-tab-line): New function.
(mouse-drag-frame-resize, mouse-drag-frame-move)
([tab-line down-mouse-1]): Handle tab line dragging in various
keymaps.
* doc/lispref/frames.texi (Mouse Dragging Parameters): Describe
new parameter 'drag-with-tab-line'.
* etc/NEWS: Add entry for 'drag-with-tab-line'.
Alan Third [Wed, 30 Jun 2021 18:58:13 +0000 (19:58 +0100)]
Fix NS self contained eln location (bug#49271)
* Makefile.in:
* configure.ac: Change eln file install location to
Contents/Frameworks.
* src/comp.c (hash_native_abi): Replace dots with underscores in the
eln install location as the macOS code-signing tool won't sign the
files if the parent directories have dots.
Alan Third [Tue, 29 Jun 2021 21:02:43 +0000 (22:02 +0100)]
Fix NS native comp search path (bug#49270)
* configure.ac (NS_SELF_CONTAINED): We need to make lispdirrel the
same as lispdir when building a self contained app bundle as they're
both relative paths.
Eli Zaretskii [Thu, 1 Jul 2021 08:28:05 +0000 (11:28 +0300)]
Update doc/emacs/ for a new printing of the Emacs Manual book
* doc/emacs/book-spine.texi: New file: the printed book spine.
* doc/emacs/back.texi: New file: the backcover text for the
printed book.
* doc/emacs/emacs.texi: Update ISBN.
Jonas Bernoulli [Wed, 30 Jun 2021 20:17:01 +0000 (22:17 +0200)]
In files that use allout use it for all headings
* lisp/allout.el: Don't prefix regular comments with three
semicolons.
* lisp/icomplete.el: Use allout syntax for all headings.
* lisp/net/eudc.el: Use allout syntax for all headings.
Jonas Bernoulli [Sun, 14 Mar 2021 19:24:07 +0000 (20:24 +0100)]
Improve consistency of outline headings in dired libraries
* lisp/dired-aux.el: Improve consistency of outline headings.
* lisp/dired-x.el: Improve consistency of outline headings.
* lisp/dired.el: Improve consistency of outline headings.
- Use three semicolons at beginning of headings because that already
is the dominant number of semicolons for headings in these files.
- Prefix each heading with a ^L instead of randomly omitting it in
front of some.
- Always prefix the line with the ^L with a completely empty line.
- Begin headings with a capital letter.
- Do not update complete headings.
- Do not end headings with a period.
- Remove a handful of section end markers.
- Address further inconsistencies.
Jonas Bernoulli [Mon, 3 May 2021 21:22:47 +0000 (23:22 +0200)]
Add new function lm-maintainers (bug#48592)
* doc/lispref/tips.texi (Library Headers): Improve wording.
* lisp/emacs-lisp/lisp-mnt.el (lm-maintainers): New function.
(lm-maintainer): Make obsolete in favor of lm-maintainer.
(lm-verify): Use lm-maintainers.
(lm-report-bug): Use lm-maintainers.
Peter Oliver [Wed, 30 Jun 2021 13:11:21 +0000 (15:11 +0200)]
From .desktop files, reuse a frame or start a new Emacs as required
* doc/emacs/misc.texi: (Using Emacs as a Server) Explain
emacsclient.desktop.
* etc/NEWS: (Emacs Server): Explain emacsclient.desktop.
* emacs-mail.desktop, etc/emacsclient.desktop: Automatically try to
reuse an existing frame, open a new frame, or start a new Emacs
daemon. Add actions for specific behaviours (bug#49195).
Peter Oliver [Wed, 30 Jun 2021 13:01:46 +0000 (15:01 +0200)]
Revert more of a partially reverted emacsclient.desktop patch
* etc/emacsclient.desktop: Undo setting of StartupWMClass=Emacsd, since
this relies on a change to etc/emacs.service which was also undone. See
bug#37847 for more explanation (bug#49259).
Fix problem when creating an .authinfo entry with an existing machine name
* lisp/auth-source.el (auth-source-netrc-create): Don't return the
incorrect data if there's a matching host entry but the wrong user
name (bug#49289).
Reuben Thomas [Sun, 27 Jun 2021 21:08:40 +0000 (22:08 +0100)]
* lisp/textmodes/ispell.el: Fix finding dictionaries for Enchant.
(ispell-find-enchant-dictionaries):
I originally copied this code from the equivalent code for
Aspell. Unfortunately it was wrong for the case of Enchant: it should
find only dictionaries that Enchant knows about, and not merge in
`ispell-dictionary-base-alist' or add a default element, as these
are dealt with in `ispell-set-spellchecker-params'.
This caused a bug where the correct `-d' argument would not be added
to the invocation of enchant, leading to the process not being
correctly started.
Stefan Monnier [Sun, 27 Jun 2021 19:06:25 +0000 (15:06 -0400)]
* lisp/textmodes/flyspell.el: Fix bug#49104
(flyspell--prev-meta-tab-binding): Delete var.
(flyspell-prog-mode): Don't set it.
(flyspell-auto-correct-word): Lookup the "next" command dynamically.
Alan Mackenzie [Sun, 27 Jun 2021 12:59:18 +0000 (12:59 +0000)]
C++ Mode: Handle new keywords static_cast, etc., wrt angle brackets
* lisp/progmodes/cc-langs.el (c-<>-arglist-kwds): Add const_cast,
dynamic_cast, reinterpret_cast and static_cast into this lang const.
* lisp/progmodes/cc-engine.el (c-clear-<-pair-props, c-clear->-pair-props)
(c-clear-<-pair-props-if-match-after, c-clear->-pair-props-if-match-before)
(c-forward-<>-arglist-recur):
Invalidate caches with c-trunctate-lit-pos-cache.
(c-forward-<>-arglist-recur): If in a matching <...> expression, the < has a
syntax-table property, but the > not, remove that property.
Remove redundant args `collection` and `predicate` which were always
equal to `minibuffer-completion-table` and
`minibuffer-completion-predicate` anyway.