Rather than let minibuffer-force-complete set up cycling and then undoing it,
better tell it directly not to setup cycling. Also be a bit more careful
to remove the transient map.
Additionally to bug#34077 and bug#34116, this also relates to bug#25644.
* lisp/minibuffer.el (completion--flush-all-sorted-completions):
Also take down the transient cycling map if applicable.
(minibuffer-force-complete): New arg dont-cycle.
Set completion-cycling to the actual function that takes down the
transient map rather than just t.
(minibuffer-force-complete-and-exit):
* lisp/icomplete.el (icomplete-force-complete): Use new dont-cycle arg.
Cycling after forcing a completion with C-M-i in icomplete can be
confusing, as it leaves rotated prospects in the minibuffer. In C-x
C-f, for example it is very difficult to understand if the prospects
refer to subdirectories of the directory being completed to, which
happens naturally when the completion is unique; or if they are a
cycled version of prospects that match the new completion pattern, in
case the completion happens to still match other items.
To resolve this confusion, never cycle with C-M-i in icomplete:
non-ambiguous cycling can be achieved with C-. and C-,
The former behaviour can still be restored with:
(define-key icomplete-minibuffer-map (kbd "C-M-i") 'minibuffer-force-complete)
* lisp/icomplete.el (icomplete-force-complete): New command.
(icomplete-minibuffer-map): Bind C-M-i to icomplete-force-complete.
* src/pdumper.c (emacs_ptr_at): Renamed from emacs_ptr, to
avoid compilation errors with GCC 4.7. Reported by Martin
Rudalics <rudalics@gmx.at>. All callers changed.
(package-activate-all): Use it so we only initialize the local part of
package.el (this reduces the impact of bug#24467 and speeds up startup).
(package-installed-p): Use it so it works even if package is not
fully initialized.
(package-delete): Use it so we only initialize the local part of
package.el.
This aims to solve problems with indentation. Previously in, say, a
js-mode buffer with electric-layout-rules set to
(?\{ before after)
(?\} before)
would produce an intended:
function ()
{
<indented point>
}
The initial state
function () {
Would go immediately to the following by e-p-m
function () {}
Only then would e-l-m be applied to } first, and then again to {.
This makes lines indent in the wrong order, which can be a problem in
some modes.
The way we fix this is by reversing the order of e-p-m and e-l-m in
the post-self-insert-hook (and also fixing a number of details that
this uncovered). In the end this changes the sequence from
function () {
By way of e-l-m becomes:
function () <newline>
{
<newline>
The e-p-m inserts the pair
function () <newline>
{
<newline>}
And then e-l-m kicks in for the pair again, yielding the desired result
function () <newline>
{
<indented point>
}
* lisp/elec-pair.el (electric-pair--insert): Bind
electric-layout-no-duplicate-newlines.
(electric-pair-inhibit-if-helps-balance)
(electric-pair-skip-if-helps-balance): Use insert-before-markers,
playing nice with save-excurion.
(electric-pair-post-self-insert-function): Go to correct position
before checking electric-pair-inhibit-predicate and
electric-pair-skip-self predicate.
(electric-pair-post-self-insert-function): Increase priority to
50.
* lisp/electric.el (electric-indent-post-self-insert-function):
Delete trailing space in reindented line only if line was
really reindented. Rewrite comment.
(electric-layout-allow-duplicate-newlines): New variable.
(electric-layout-post-self-insert-function-1): Rewrite comments.
Honours electric-layout-allow-duplicate-newlines. Don't reindent
previous line because racecar.
* test/lisp/electric-tests.el: New test.
(plainer-c-mode): Move up.
(electric-modes-int-main-allman-style)
(electric-layout-int-main-kernel-style): Simplify
electric-layout-rules.
(electric-layout-for-c-style-du-jour): New helper.
(electric-layout-plainer-c-mode-use-c-style): New test.
The behaviour previously observed in cc-mode-based-modes (and every
other major-mode) when electric-pair-mode or electric-layout-mode is
turned on may no longer be observed: this because CC-mode goes around
the generic implementation of electric-pair-mode.
An alternative is to bind every delimiter key like '{', '}', etc to
'self-insert-command, like most major modes already do, at the cost of
losing c-auto-newline functionality (which was incompatible anyway
before the recent changes of bug#33794).
* test/lisp/electric-tests.el
(electric-pair-test-for): No longer set it.
(define-electric-pair-test): Use js-mode instead of c++ mode,
which broke recently.
(whitespace-chomping-2): Add failing C++ test explicitly.
(electric-layout-int-main-kernel-style): Use plainer-c-mode.
(electric-layout-int-main-allman-style): Deleted.
(electric-modes-int-main-allman-style): Renamed from
electric-layout-int-main-allman-style.
* lisp/progmodes/cc-cmds.el (c-electric-lt-gt): Actuate electric-pair-mode if
a < or > is typed in a context where this is meaningful (#include, or
template).
(c-electric-paren): Allow electric-pair-mode activity in a comment or string.
* lisp/progmodes/cc-defs.el (c-make-keywords-re): Fix a bug where lists of
source symbols could get overwritten when parameter adorn is set to
'appendable.
* list/progmodes/cc-langs.el (c-cpp-include-key): New lang const and var.
* test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name):
Bind `tramp-default-method'.
(tramp--test-file-attributes-equal-p): New defsubst.
(tramp-test19-directory-files-and-attributes): Use it.
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.2-pre".
* lisp/net/tramp.el: Bump version to 2.4.2-pre.
(tramp-set-file-uid-gid): Respect setgid bit of the upper directory.
(tramp-default-file-modes, tramp-handle-insert-file-contents)
(tramp-mode-string-to-int, tramp-make-tramp-temp-file):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy)
(tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly)
(tramp-sh-handle-write-region): Use octal constants.
* src/w32term.c (x_draw_image_foreground): Scale the image if
the requested dimensions are different from the bitmap
dimensions.
* src/image.c (Fimage_scaling_p): Return t when HAVE_NTGUI.
(x_set_image_size) [HAVE_NTGUI]: Record the scaled dimensions
in the image struct.
* src/dispextern.h (HAVE_NATIVE_SCALING): Define when
HAVE_NTGUI as well.
* etc/NEWS: Update the announcement of native image scaling.
* src/pdumper.c (Fpdumper_stats): Improve formatting and
wording of the doc string. Decode the pdump file name and
expand-file-name it.
* doc/lispref/internals.texi (Building Emacs): Document
'pdumper-stats'.
* lisp/progmodes/project.el (project-ignores): Don't append the
default ignores list, just use vc-directory-exclusion-list.
(project--dir-ignores): Use the default ignores if the dir is
outside of the current project.
(project-files): Use project--dir-ignores to support external
roots better.
An element of electric-layout-rules is either a function or a pair
(CHAR . WHERE), and WHERE can't be a function anymore.
* lisp/electric.el (electric-layout-post-self-insert-function-1):
Remove leftover line.
* src/image.c (x_create_x_image_and_pixmap):
The Picture type is an integer, not a pointer.
Come to think of it, Picture is really XID, and as
far as I can tell, all-bits-one is the invalid XID,
not all-bits-zero. However that is a bigger issue;
for now, this patch just unbreaks the build.
* src/pdumper.c (Fdump_emacs_portable): Improve the doc string
and the error messages.
* doc/lispref/internals.texi (Building Emacs): Document
portable dumping and the 'dump-emacs-portable' function.
b6d78a0 (origin/emacs-26) Fix a typo in ELisp manual
c9f6f86 Prevent redrawing if frame is garbaged
00ba226 Attempt to fix hangs on MS-Windows due to C-g
b26d637 Fix Calc graph output on MS-Windows
03818b0 Fix a minor mistake in ELisp manual
6ac5985 ; Fix some trivial doc typos
21b9026 * etc/tutorials/TUTORIAL: Fix typo (bug#34049)
d223727 Fix UI of Buffer-menu
0f71655 Reinitialize ispell-really-enchant when changing the speller
9845044 Speed up loading css-mode
* src/w32heap.c (report_temacs_memory_usage): Condition on
!CANNOT_DUMP, in addition to ENABLE_CHECKING.
(init_heap): Accept an argument, which tells us what heap
allocation method to use.
(DUMPED_HEAP_SIZE) [CANNOT_DUMP]: Define to a small value, as
we don't use dumped_data[] in this case.
* src/w32heap.h (init_heap): Adjust prototype.
<using_dynamic_heap>: Remove declaration.
* src/emacs.c (main) [WINDOWSNT]: Determine heap allocation
method based on whether we are in temacs and whether unexec
will be used to dump Emacs. Pass the heap allocation method
to init_heap, which is now called after parsing the
--temacs=METHOD option.
* src/unexw32.c (unexec): Don't fiddle with using_dynamic_heap.
<using_dynamic_heap>: Remove definition.
* src/w32proc.c (malloc_before_init, realloc_before_init)
(free_before_init): New functions, to catch memory allocation
before heap allocation method is set up.
* doc/lispref/nonascii.texi (Converting Representations): Fix
inconsistency between @defun and the argument description of
'byte-to-string'. (Bug#34119)
* lisp/progmodes/project.el (project--files-in-directory):
New function.
(project-files, project-find-regexp): Use it.
(project--dir-ignores): New function.
(project--find-regexp-in): Remove.
(project--process-file-region): New function.
(project--find-regexp-in-files): New function.
(project-find-regexp, project-or-external-find-regexp): Use it, and
project-files as well.
* lisp/progmodes/project.el (project-files): Move the actual
command building and invocation here.
(project-file-completion-table): Delegate to 'project-files'.