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)
Sebastián Monía [Wed, 9 Oct 2024 03:26:42 +0000 (23:26 -0400)]
Add customization to let EWW guess content-type if needed
* lisp/net/eww.el (eww-guess-content-type-functions): New user option.
(eww--guess-content-type, eww--html-if-doctype): New functions.
(eww-render): Call 'eww--guess-content-type' (bug#73133).
Stephen Berman [Mon, 21 Oct 2024 10:50:53 +0000 (12:50 +0200)]
Let 'tex-view' show PDFs made without a DVI (bug#73854)
* lisp/textmodes/tex-mode.el (tex-print-file): Update doc string
to mention 'tex-compile'.
(tex-compile-commands): Add entries for 'evince' and 'mupdf'.
(tex-compile): Set 'tex-print-file'.
Sebastián Monía [Mon, 14 Oct 2024 01:00:03 +0000 (21:00 -0400)]
Use vtable in eww-list-buffers and add function eww-buffer-list
* lisp/net/eww.el (eww-buffer-list): New function.
(eww-list-buffers): Move logic to...
(eww--list-buffers-display-table, eww--list-buffers-get-data):
... these, and use 'vtable'.
(eww-buffer-select, eww-buffer-show, eww-buffer-kill)
(eww-buffers-mode-map): Use 'vtable-current-object'.
(eww-buffers-mode): Set 'revert-buffer-function'
Lin Sun [Sun, 20 Oct 2024 08:05:19 +0000 (10:05 +0200)]
Enhance the auto-revert to avoid revert a buffer in short time
* lisp/autorevert.el (auto-revert--last-time): New defvar.
(auto-revert-handler, auto-revert-notify-handler): Use it.
* test/lisp/autorevert-tests.el (with-auto-revert-test): Set
`auto-revert--lockout-interval' correctly.
john muhl [Sun, 29 Sep 2024 00:11:03 +0000 (19:11 -0500)]
Add ability to crossfade between songs in 'mpc'
* lisp/mpc.el (mpc-cmd-crossfade):
(mpc-toggle-crossfade): New function.
(mpc-crossfade-time): New option.
(mpc-mode-menu): Add menu item to toggle crossfade. (Bug#73891)
Jim Porter [Sat, 19 Oct 2024 18:52:42 +0000 (11:52 -0700)]
Lazily convert numeric strings to Lisp numbers in Eshell
This should reduce the number of issues with Eshell converting strings
to numbers too aggressively and losing information (e.g. "001" -> 1)
while still allowing almost all of the beneficial uses, like summing a
list of numeric strings with '+'.
* lisp/eshell/esh-util.el (eshell--do-mark-numeric-string): New
function.
(eshell-convert-to-number): Make obsolete in favor of...
(eshell-mark-numeric-string): ... this. Update callers.
* lisp/eshell/esh-arg.el (eshell--numberlike-p): New function...
(eshell-concat-1): ... use it.
* test/lisp/eshell/esh-util-tests.el: Reimplement type conversion tests
to use 'eshell-convertible-to-number-p' instead.
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/interp-var-splice-concat, esh-var-test/interp-concat-cmd)
(esh-var-test/interp-convert-var-split-indices)
(esh-var-test/interp-convert-quoted-var-split-indices)
(esh-var-test/interp-convert-cmd-multiline)
(esh-var-test/interp-convert-cmd-split-indices): Adjust tests to check
the new behavior.
* doc/misc/eshell.texi (Type Conversion): New section.
(Expansion): Clarify concatenation behavior.
Álvaro Ramírez [Wed, 2 Oct 2024 10:36:57 +0000 (11:36 +0100)]
Hide default-directory absolute file name in dired-hide-details-mode
* lisp/dired.el (dired-hide-details-hide-absolute-location):
New user option.
(dired-insert-directory, dired-build-subdir-alist): Use it to
hide absolute file name of the directory.
(dired-hide-details-mode): Update doc string.
* test/lisp/dired-tests.el
(dired-test-hide-absolute-location-enabled)
(dired-test-hide-absolute-location-disabled): New tests
Morgan Willcock [Sat, 5 Oct 2024 17:33:51 +0000 (18:33 +0100)]
Rewrite Speedbar expansion for all descendants (bug#73533)
Rewrite 'speedbar-expand-line-descendants' to avoid getting into
an infinite loop by reaching max-lisp-eval-depth. The new
method avoids querying and displaying information for every
movement, instead using a single message to indicate that
expansion is in progress, and so is significantly faster. The
narrowing per item introduced by the fix for bug#35014 is
removed because it prevented expanded descendant items when the
top-level item was already expanded.
* lisp/speedbar.el (speedbar--get-line-indent-level): New
function to return the indentation level of the current line.
(speedbar-expand-line-descendants): Use simpler line motion and
no recursion. Output messages indicating when expansion is in
progress and when it is completed. Fix expansion of descendants
where the top-level item was already expanded.