Harald Jörg [Mon, 23 Aug 2021 14:26:45 +0000 (16:26 +0200)]
; cperl-mode: bugfix / rework fontification of here-docs
* lisp/progmodes/cperl-mode.el (cperl-mode): Use
`cperl-font-lock-syntactic-face-function'.
(cperl-commentify): Add a docstring, eliminate unused formal
parameter `noface'.
(cperl-is-here-doc-p): New function to detect whether "<<" starts
a here-document, factored out from `cperl-find-pods-heres'.
(cperl-here-doc-functions): New variable: List of functions which
allow here-documents as parameters, for use in
`cperl-is-here-doc-p'.
(cperl-process-here-doc): New function, factored out from
`cperl-find-pods-heres'. Fixed to keep correct fontification
after non-interactive (elisp) changes (Bug#14343, Bug#28962).
(cperl-find-pods-heres): Extend the doc-string to describe all
parameters. Don't remove text properties in recursive calls on
the same line. Call `cperl-process-here-doc' when appropriate.
(cperl-font-lock-syntactic-face-function): New function to
highlight c-style comments as here-documents (adapted from
perl-mode.el).
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-identify-heredoc): New test for the new function
`cperl-is-here-doc-p'.
(cperl-test-identify-no-heredoc): New test for the new function
`cperl-is-here-doc-p', testing constructs which start with "<<"
but are no here-documents.
(cperl-test-here-doc-missing-end): New test to verify correct
detection of a missing here-document delimiter.
(cperl-test-bug-14343): New test to verify that inserting text
into a here-document with elisp does not break fontification.
* doc/lispref/frames.texi (Finding All Frames): Clarify what it
means to "consider".
* src/frame.c (Fnext_frame): Rewrite doc string to say what the
parameters actually mean (bug#13339).
Add new variable 'kill-buffer/delete-auto-save-files'
* doc/emacs/files.texi (Auto Save Files): Document it.
* lisp/cus-start.el (standard): Add customize form.
* lisp/files.el (delete-auto-save-files): Move definition to C
(since it's used in the C layer).
* src/buffer.c (Fkill_buffer): Use the new variable (and remove
the old code that apparently didn't trigger for
kill-buffer/delete-auto-save-files.
(syms_of_buffer): Add new variable
kill-buffer-delete-auto-save-files and move definition of
delete-auto-save-files here (bug#21612).
Juri Linkov [Mon, 23 Aug 2021 07:33:36 +0000 (10:33 +0300)]
* lisp/mouse.el (context-menu-toolbar): New function.
(context-menu-functions): Add context-menu-toolbar to choice.
(context-menu-region): Bind "Paste" to mouse-yank-at-click
instead of mouse-yank-primary.
https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00735.html
* src/syntax.c (parse-partial-sexp): Also handle markers as
arguments (bug#49944). Tweak error message to follow conventions in
"(elisp) Signaling Errors".
* src/nsmenu.m (update_frame_tool_bar): Get label text and pass it to ...
([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]):
... this that sets label for NSToolbarItem.
* src/nsterm.h
([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]):
Add labelText argument.
Michael Albinus [Sun, 22 Aug 2021 12:50:19 +0000 (14:50 +0200)]
Some adaptions for Tramp's security key detection.
* lisp/net/tramp.el (tramp-security-key-timeout-regexp): New defcustom.
(tramp-action-show-and-confirm-message): Don't use timeout, check
for the timeout message of the ssh command.
Eli Zaretskii [Sun, 22 Aug 2021 08:32:26 +0000 (11:32 +0300)]
Improve documentation of 'set-keyboard-coding-system'
* doc/lispref/nonascii.texi (Terminal I/O Encoding):
* doc/emacs/mule.texi (Terminal Coding):
* lisp/international/mule.el (set-keyboard-coding-system):
Document that 'set-keyboard-coding-system' has no effect on modern
MS-Windows systems. (Bug#15289)
Stephen Gildea [Sat, 21 Aug 2021 21:37:54 +0000 (14:37 -0700)]
; MH-E doc: SourceForge repo is no longer current
* doc/misc/mh-e.texi, lisp/mh-e/mh-e.el: Update references to
SourceForge with current URLs and a note that MH-E development
no longer occurs in that repository.
* test/lisp/files-tests.el (files-tests-buffer-offer-save)
(files-tests-save-buffers-kill-emacs--asks-to-save-buffers):
`read-event' is called with arguments.
Clarify cl-defstruct doc string and manual entry somewhat
* doc/misc/cl.texi (Structures): Rename the slot "name" in the
examples to "first-name", since we're talking about the names of
slots a lot here, and having a slot with the name "name" makes the
examples somewhat confusing.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Clarify certain
things about slots (bug#14278).
Alan Third [Sat, 21 Aug 2021 12:09:37 +0000 (13:09 +0100)]
Fix display bug on macOS (bug#50112)
* src/nsterm.m ([EmacsLayer initWithColorSpace:]): Use the colorspace
setter.
([EmacsLayer setColorSpace:]): Sometimes we seem to get null
colorspaces, so set a default in this case.
([EmacsLayer getContext]): Check whether there's been a surface or
graphics context allocation failure and log it.
The new entry appears next to "Find Definition" and like it only
appears when the context menu was invoked on an identifier.
* lisp/progmodes/prog-mode.el (prog-context-menu): New menu entry.
* lisp/progmodes/xref.el (xref-find-references-at-mouse): New
function, analogous to `xref-find-definitions-at-mouse`.
Indicate progress while searching for references in xref
* lisp/progmodes/xref.el (xref-backend-references): Add messages to
show the user that something is happening instead of silently freezing
during the frequently long synchronous searches for references.
Re-type the :location slot in `xref-match-item` to `xref-location`
* lisp/progmodes/xref.el (xref-match-item): Change type for
:location from `xref-file-location`, which was likely a mistake,
to `xref-location`. This allows `xref-make-match` to take
arguments of any subtype of `xref-location` (bug#50067).
Add xref operations to context menu unconditionally
* lisp/progmodes/prog-mode.el (prog-context-menu):
Add xref operations to the context menu even if xref hasn't been
loaded yet; the functions involved are autoloaded (bug#50067).
Eli Zaretskii [Sat, 21 Aug 2021 08:49:56 +0000 (11:49 +0300)]
Improve documentation of context menus
* doc/lispref/modes.texi (Major Mode Conventions): Add conventions
of setting menu-bar menus and context menus for a major mode.
* doc/emacs/frames.texi (Menu Mouse Clicks): Fix description of
context menu functionality.
Dmitry Gutov [Sat, 21 Aug 2021 02:26:12 +0000 (05:26 +0300)]
Speed up project--read-project-buffer in remote buffers
* lisp/progmodes/project.el (project-buffers): New generic function.
(project--read-project-buffer): Use it here (bug#49264).
(project--buffers-to-kill): And here.
(project-buffers): Specialized implementation for vc-project.
Alan Mackenzie [Fri, 20 Aug 2021 21:12:37 +0000 (21:12 +0000)]
Fix c-tentative-buffer-changes to be nestable in c-save-buffer-state
* lisp/progmodes/cc-defs.el (c-tentative-buffer-changes)
(c-tnt-chng-record-state, c-tnt-chng-cleanup): Enhance such that a
buffer-undo-list of t is handled specially, so that a nil isn't consed onto
it. Thus garbage collection can't later remove the (nil . t) from the end of
the buffer-undo-list, causing an infinite loop.
Allow preserving symlinks with file-precious-flag set
* doc/lispref/files.texi (Saving Buffers): Document it.
* lisp/files.el (file-preserve-symlinks-on-save): New user option
(bug#18125).
(basic-save-buffer-2): Use it.
* lisp/simple.el (execute-extended-command): Move finding the
short command to the timer command, too (bug#50042). This further
ensures that post-command-hook is run faster.
Remove even more waiting from execute-extended-command
* lisp/simple.el (execute-extended-command): Remove all the
waiting from the command and do it all with timers (bug#50042).
This ensures that post-command-hook is run immediately also when
the command has messaged something.
The Mac platform convention is to use control-left-click for context
menus (as a synonym to right-click).
* lisp/mouse.el (context-menu--old-bindings): Remove.
(context-menu--saved-bindings)
(context-menu--bind-mouse, context-menu--reset-bindings): New.
(context-menu-mode): Use new functions, with C-mouse-1 as extra
binding on NS.
Fix xref {prev,next}-error target buffer match highlighting extent
* lisp/progmodes/xref.el (xref--next-error-function):
Bind `xref--current-item` during the call to `xref--show-location` so
that `xref-pulse-momentarily` finds the match extent.
João Távora [Thu, 19 Aug 2021 22:54:51 +0000 (23:54 +0100)]
Make icomplete-forward-completions O(1) when icomplete-scroll is t
In particular, this makes the recently added
icomplete-vertical-goto-last (bug#49005) be O(n) instead of O(n^2).
That used to be almost unbearably slow for large n.
* lisp/icomplete.el (icomplete-forward-completions): don't call last
unless needed.
* lisp/calendar/appt.el (appt-check): Add space at the end
(bug#18164) -- all `global-mode-string' elements should have it
there to get an even space distribution.
Peter Münster [Wed, 18 Aug 2021 09:21:51 +0000 (11:21 +0200)]
Add support for history of image tags and completion in the minibuffer
* lisp/image-dired.el (image-dired-tag-history): New variable holding the
tag history.
(image-dired-tag-files, image-dired-tag-thumbnail, image-dired-delete-tag)
(image-dired-tag-thumbnail-remove): Use it for the user input.
Peter Münster [Tue, 17 Aug 2021 23:37:43 +0000 (01:37 +0200)]
New placement of newline characters in image-dired-db-file
It's more usual to have the newline at the end of the line, instead of the
beginning. This change avoids missing newline at the end of the file, an
empty line at the start and eventually a lot of empty lines when
`require-final-newline' is not nil.
* lisp/image-dired.el (image-dired-write-tags): Insert newline at the end
of the line, instead of the beginning.
(image-dired-remove-tag): Do not delete empty line at end of buffer.