Dmitry Gutov [Tue, 29 Oct 2024 02:27:00 +0000 (04:27 +0200)]
project--completing-read-strict: Move some common processing here
* lisp/progmodes/project.el (project--completing-read-strict):
Add new optional argument, COMMON-PARENT-DIRECTORY. Move the
absolute->relative processing of MB-DEFAULT and the contents of
HIST here.
(project--read-file-cpd-relative): From here. So that
'project--read-file-absolute' can also benefit from those
conversions.
(project--read-file-absolute): Pass the new argument.
(project-read-file-name-function): Update value tags.
Dmitry Gutov [Tue, 29 Oct 2024 01:48:03 +0000 (03:48 +0200)]
project--read-file-cpd-relative: Move out the 'included-cpd' logic
* lisp/progmodes/project.el (project-find-dir):
Use 'project-files-relative-names'. Include "./" here rather than
(project--read-file-cpd-relative): ...doing it here.
Sean Whitton [Tue, 29 Oct 2024 01:40:02 +0000 (09:40 +0800)]
Fix window selection after log-edit-show-diff
* lisp/vc/vc.el (vc-diff-patch-string): Use display-buffer, not
pop-to-buffer, for consistency with log-edit-diff-fileset.
(vc-modify-change-comment): Use save-selected-window around
vc-diff-internal to avoid leaving the *vc-diff* window selected,
for consistency with log-edit-diff-fileset.
Alan Mackenzie [Mon, 28 Oct 2024 16:35:27 +0000 (16:35 +0000)]
Call PF correctly from pcase--edebug-match-pat-args
Also correct a doc string and insert commentary. This fixes
bug#74052.
* lisp/emacs-lisp/edebug.el
(edebug--match-&-spec-op <&interpose>): Correct and complete
the doc string, which now says MUST call exactly once, and
documents the return values of FUN, PF and
edebug--match-&-spec-op. Also remove an unneeded `(...)
construct.
* lisp/emacs-lisp/pcase.el (pcase--edebug-match-pat-args): Call
PF also for the main cases handled.
Sean Whitton [Mon, 28 Oct 2024 13:46:06 +0000 (21:46 +0800)]
Fix C-c C-d and C-c C-w during log-view-modify-change-comment
* lisp/vc/vc-dispatcher.el (log-edit-diff-fileset)
(log-edit-diff-patch): Declare.
(vc-log-edit, vc-start-logentry): New optional argument
DIFF-FUNCTION to specify log-edit-diff-function in the generated
Log Edit buffer.
* lisp/vc/vc.el (vc-modify-change-comment): Pass the new
DIFF-FUNCTION argument to vc-start-logentry.
Jim Porter [Mon, 28 Oct 2024 04:13:56 +0000 (21:13 -0700)]
Fix definitions of Eshell "xtra" functions
* lisp/eshell/em-xtra.el (eshell-parse-command): Remove unnecessary
autoload.
(eshell/substitute): Pass the correct number of arguments to
'cl-substitute'.
(eshell/count, eshell/union, eshell/mismatch, eshell/intersection)
(eshell/set-difference, eshell/set-exclusive-or): Use named arguments
for the required arguments (bug#73738).
Paul Eggert [Mon, 28 Oct 2024 00:21:23 +0000 (17:21 -0700)]
Work around GDB bug 32313 when debugging Emacs internals
Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2024-10/msg00653.html
* src/eval.c (backtrace_function_body): Rename from
backtrace_function, and make it static.
(GDB_FUNCPTR): New macro.
(backtrace_function): New function pointer, for GDB only.
* doc/misc/modus-themes.org
(Differences between loading and enabling)
(Option for which themes to toggle)
(Option for which themes to rotate, DIY Palette override presets)
(DIY Add padding to the mode line)
(DIY Remap face with local value): Fix typos.
(DIY Add support for solaire-mode): Fix some symbols.
(Full support for packages or face groups)
(Indirectly covered packages): Add newly supported packages.
(DIY Add support for combobulate):,
(DIY Add support for engrave-faces, DIY Add support for howm)
(DIY Add support for meow-mode): Document how to style those
packages.
(Acknowledgements): Update names of people who have in one way
or another contributed to the project.
* etc/themes/modus-operandi-deuteranopia-theme.el:
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-operandi-tinted-theme.el:
* etc/themes/modus-operandi-tritanopia-theme.el:
* etc/themes/modus-vivendi-deuteranopia-theme.el:
* etc/themes/modus-vivendi-theme.el:
* etc/themes/modus-vivendi-tinted-theme.el:
* etc/themes/modus-vivendi-tritanopia-theme.el:
* etc/themes/modus-themes.el: Make refinements to supported
faces, add support for more faces, and tweak palette entries.
Eli Zaretskii [Sun, 27 Oct 2024 11:16:36 +0000 (13:16 +0200)]
Update the documentation of void functions
* doc/lispref/functions.texi (Function Cells):
* src/data.c (Ffboundp, Ffmakunbound, Fsymbol_function): Update
documentation to the changes of how void functions are represented
since Emacs 24.5. (Bug#73886)
Sean Whitton [Sun, 27 Oct 2024 06:11:50 +0000 (14:11 +0800)]
vc-git-resolve-conflicts: Extend unstage-maybe to similar operations
* lisp/vc/vc-git.el (vc-git-resolve-when-done): When
vc-git-resolve-conflicts is unstage-maybe, don't clear the
staging area during a rebase, am, revert or cherry-pick.
(vc-git-resolve-conflicts): Update docstring in light of changes
to vc-git-resolve-when-done.
(vc-git--cmds-in-progress): Detect reverts and cherry-pick
operations in progress.
Jim Porter [Mon, 21 Oct 2024 04:37:55 +0000 (21:37 -0700)]
Fix Eshell incompatibility with "[" command when eshell-pred is disabled
* lisp/eshell/em-pred.el (eshell-pred-initialize): Ensure that
'eshell-parse-arg-modifier' is called before 'eshell-parse-glob-chars'.
* lisp/eshell/em-glob.el (eshell-glob-initialize): Use a number for hook
depth to be clearer.
(eshell-parse-glob-chars): Simplify; since eshell-pred's hook now runs
first, the extra code is no longer necessary.
* test/lisp/eshell/em-glob-tests.el
(em-glob-test/test-command-without-pred): New test.
Earl Hyatt [Sun, 13 Oct 2024 00:28:25 +0000 (20:28 -0400)]
Add delete-selection-local-mode.
* lisp/delsel.el (delete-selection-local-mode): Add local version of
'delete-selection-mode'. The local mode sets the value of the variable
'delete-selection-mode' to maintain compatibility with packages and
features that consider the existing mode.
Alan Mackenzie [Fri, 25 Oct 2024 20:35:32 +0000 (20:35 +0000)]
CC Mode: correct handling of properties on #include <...>
In C, Pike, and IDL Modes, deleting and reinserting such a <
could create havoc with the category/syntax-table properties on
the < and >. Also the contents of <...> should only get paren
properties when the #include is present and correct.
* lisp/progmodes/cc-fonts.el (c-cpp-matchers): Replace the
c-make-font-lock-search-function which put properties on the
<...> with a simple matcher.
* lisp/progmodes/cc-langs.el
(c-get-state-before-change-functions)
(c-before-font-lock-functions): Add respectively
c-before-change-include-<> and c-after-change-include-<> in the
C, Pike and IDL entries of these variables.
* lisp/progmodes/cc-mode.el (c-before-change-include-<>)
(c-after-change-include-<>): New functions.
Cecilio Pardo [Wed, 9 Oct 2024 09:40:28 +0000 (11:40 +0200)]
Implement drawing text with DirectWrite on MS-Windows.
This adds support for color fonts.
* configure.ac: Add src/w32drite to W32_OBJ.
* src/w32dwrite.c: New file.
(w32-initialize-direct-write): New function, initialize the
DirectWrite library if it is available, and required global
variables.
(w32_use_direct_write): New function, check if DirectWrite
is available and activated by the user.
(w32_dwrite_encode_char): New function, replacement for HarfBuzz's
'encode_char'.
(w32_dwrite_text_extents): New function, replacement for w32font
text_extents.
(w32_dwrite_draw): New function, replacement for w32font draw.
(w32_dwrite_free_cached_face): New function, used in the font
deletion process to also delete DirectWrite data.
(verify_hr): New function, verify COM method results.
(release_com): New function, release a COM object.
(w32-dwrite-available): New function, returns true if DirectWrite
is available.
(w32-dwrite-reinit): New function, reinitialize DirectWrite,
optionally setting some rendering parameters.
* src/w32font.c (w32font_text_extents): If DirectWrite is enabled,
call 'w32_dwrite_text_extents'.
(w32font_draw): If DirectWrite is enabled, call 'w32_dwrite_draw'.
* src/w32uniscribe.c: (w32hb_encode_char): If DirectWrite is enabled,
call 'w32_dwrite_encode_char'.
(syms_of_w32uniscribe_for_pdumper): Initialize DirectWrite.
(uniscribe_close): Free DirectWrite data for the font.
vc-clone: Make interactive; call vc-guess-url-backend
* lisp/vc/vc.el (vc-clone): Make interactive. Call
vc-guess-url-backend. Always return DIRECTORY if it names a
directory. New optional argument OPEN-DIR.
(vc--remotes-history): New defvar.
* etc/NEWS: Announce these changes.
Move package-vc-heuristic-alist and related to vc.el
* lisp/emacs-lisp/package-vc.el (package-vc--backend-type)
(package-vc-heuristic-alist, package-vc--guess-backend): Rename
to vc-cloneable-backends-custom-type, vc-clone-heuristic-alist
and vc-guess-url-backend respectively, and move to
lisp/vc/vc.el. Make package-vc-heuristic-alist an obsolete
alias.
(package-vc--clone, package-vc--read-package-name)
(package-vc-install, package-vc-checkout): Use
vc-guess-url-backend.
* lisp/vc/vc.el (vc-cloneable-backends-custom-type)
(vc-clone-heuristic-alist, vc-guess-url-backend): New defconst,
defcustom and defun, respectively: renamed and moved here from
lisp/emacs-lisp/package-vc.el.
Sean Whitton [Thu, 24 Oct 2024 09:19:41 +0000 (17:19 +0800)]
; Drop two outdated calls to 'require'
* lisp/emacs-lisp/backtrace.el (require):
* lisp/wid-edit.el (require): Don't require subr-x. if-let,
when-let and friends have all been in subr.el for a while.
Sean Whitton [Thu, 24 Oct 2024 03:26:27 +0000 (11:26 +0800)]
vc-allow-rewriting-published-history: Use nil->ask->t
* lisp/vc/vc.el (vc-allow-rewriting-published-history): Use
increasingly permissive values nil->ask->t rather than
nil->t->no-ask. Recommend `ask' or nil.
* lisp/vc/vc-git.el (vc-git--assert-allowed-rewrite): Update
accordingly.
Alan Coopersmith [Wed, 23 Oct 2024 13:41:08 +0000 (15:41 +0200)]
configure.ac: Fix FIONREAD check with gcc-14 on Solaris
Before this fix, it would fail to build with gcc-14 with the error:
conftest.c: In function 'main':
conftest.c:265:11: error: implicit declaration of function 'ioctl'
[-Wimplicit-function-declaration]
265 | int foo = ioctl (0, FIONREAD, &foo);
| ^~~~~
Solaris documents ioctl() as being defined in <unistd.h>.
* configure.ac: Fix FIONREAD check with gcc-14 on Solaris.
Ref:
https://lists.gnu.org/r/emacs-devel/2024-10/msg00195.html
Sean Whitton [Wed, 23 Oct 2024 02:49:22 +0000 (10:49 +0800)]
vc-git-modify-change-comment: Check for other autosquashing
* lisp/vc/vc-git.el (vc-git-modify-change-comment): Check that a
rebase with --autosquash won't make any other changes and give
the user a chance to abort.
Jim Porter [Tue, 22 Oct 2024 16:43:00 +0000 (09:43 -0700)]
Fix error when splicing Eshell globs and a glob expands to itself
This could happen when 'eshell-extended-glob' determines that a "glob"
is not really a glob. This mainly happens for remote file names with a
"~" in them, like "/ssh:remote:~/file.txt".
* lisp/eshell/em-glob.el (eshell-extended-glob): Return a list when
'eshell-glob-splice-results' is non-nil.
* test/lisp/eshell/em-glob-tests.el
(em-glob-test/expand/splice-results)
em-glob-test/expand/no-splice-results): Extend tests.
Vincenzo Pupillo [Thu, 10 Oct 2024 14:06:37 +0000 (16:06 +0200)]
Fix 'php-ts-mode': better indentation and font locking
Incomplete compound_statement or colon_block (statement-group
without a closing brace or closing keyword) that are not inside
a function or method are not recognized as such by tree-sitter-php.
A new function 'php-ts-mode--open-statement-group-heuristic'
handles this case. Font locking of magic methods and better
support for alternative control structure syntax.
Support for latest grammar version.
* lisp/progmodes/php-ts-mode.el
(php-ts-mode--language-source-alist): Updated grammar version.
(php-ts-mode--possibly-braceless-keyword-re): Regular expression
for braceless keyword.
(php-ts-mode--open-statement-group-heuristic): New function.
(php-ts-mode--parent-html-bol): Use the new function and doc fix.
(php-ts-mode--parent-html-heuristic): Use the new function and doc
fix.
(php-ts-mode--indent-styles): Use the new function and add
'colon_block' support.
(php-ts-mode--class-magic-methods): New predefined magic methods
list.
(php-ts-mode--test-namespace-name-as-prefix-p): Doc fix.
(php-ts-mode--test-namespace-aliasing-clause-p): Fix the test and
doc.
(php-ts-mode--test-namespace-use-group-clause-p): Doc fix.
(php-ts-mode--test-visibility-modifier-operation-clause-p): New
function for the new asymmetric property visibility feature of
PHP 8.4.
(php-ts-mode--font-lock-settings): Font lock for class magic methods
and alternative syntax. Better font lock for 'instanceof'. Use
'font-lock-function-call-face' for scoped and member call expression.
(bug#73779)