1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Merge from origin/emacs-30

f69f54c454 Improve font-locking and indentation in 'php-ts-mode'
27aacbd172 Fix some 'lua-ts-mode' options (Bug#74235)
a0613372a7 ; Update the xwidgets-on-NS text due to fixing bug#60703
d592832504 Improve comment indenting in 'lua-ts-mode'
6bc44ccf28 Update 'xref-num-matches-found' when reverting *xref* buffer
8afcfed825 * lisp/files.el (require-with-check): Fix last fix (bug#7...
3496234c8e lisp/files.el (require-with-check): Fix bug#74091.
90c97d3fac Fix handling of permanent-local variables in 'kill-all-lo...
c96e576090 Precise password cache in Tramp
3954e8d9bb Fix picture-mode with full-width characters
7dabfe9465 Fix movement to the left in picture-mode

# Conflicts:
#	lisp/net/tramp.el
This commit is contained in:
Michael Albinus 2024-11-14 16:51:20 +01:00
commit 3e86231b54
9 changed files with 152 additions and 77 deletions

View File

@ -2245,14 +2245,18 @@ like this:
@value{tramp} can cache passwords as entered and reuse when needed for
the same user or host name independent of the access method.
@vindex password-cache-expiry
@code{password-cache-expiry} sets the duration (in seconds) the
passwords are remembered. Passwords are never saved permanently nor
can they extend beyond the lifetime of the current Emacs session. Set
@code{password-cache-expiry} to @code{nil} to disable expiration.
@vindex auth-source-cache-expiry
@code{auth-source-cache-expiry}@footnote{It overrides
@code{password-cache-expiry}.} sets the duration (in seconds) the
passwords are remembered. Set @code{auth-source-cache-expiry} to
@code{nil} to disable expiration.
@vindex password-cache
Set @code{password-cache} to @code{nil} to disable password caching.
Cached passwords are never saved permanently nor can they extend
beyond the lifetime of the current Emacs session unless you confirm
this interactively.
@vindex auth-source-do-cache
Set @code{auth-source-do-cache} to @code{nil} to disable password caching.
@node Connection caching

View File

@ -955,13 +955,13 @@ This sections contains features found in other official Emacs ports.
Emacs 25 has support for xwidgets, a system to include WebKit widgets
into an Emacs buffer.
They work on NS, but not very well. For example, trying to display a
xwidget in the "killed" state will make Emacs crash. This is because
the NS code has not been updated to keep with recent changes to the
X11 and GTK code.
They work on NS, but not very well. This is because the NS code has
not been updated to keep with recent changes to the X11 and GTK code.
Many features such as xwidget-webkit-edit-mode do not work correctly
on NS either.
Many features do not work correctly on NS, such as:
- xwidget-webkit-edit-mode
- xwidget-webkit-isearch-mode
- xwidget-webkit-browse-history.
**** Respect 'frame-inhibit-implied-resize'
When the variable 'frame-inhibit-implied-resize' is non-nil, frames

View File

@ -1274,12 +1274,12 @@ NOERROR is equal to `reload'), or otherwise emit a warning."
(res (require feature filename (if (eq noerror 'reload) nil noerror))))
;; If the `feature' was not yet provided, `require' just loaded the right
;; file, so we're done.
(when (eq lh load-history)
(when (and res (eq lh load-history))
;; If `require' did nothing, we need to make sure that was warranted.
(let* ((fn (locate-file (or filename (symbol-name feature))
load-path (get-load-suffixes) nil
)) ;; load-prefer-newer
;; We used to look for `fn' in `load-history' with `assoc'
;; We used to look for `fn' in `load-history' with `assoc'
;; which works in most cases, but in some cases (e.g. when
;; `load-prefer-newer' is set) `locate-file' can return a
;; different file than the file that `require' would load,

View File

@ -72,7 +72,7 @@
(defcustom lua-ts-luacheck-program "luacheck"
"Location of the Luacheck program."
:type '(choice (const :tag "None" nil) string)
:type 'file
:version "30.1")
(defcustom lua-ts-inferior-buffer "*Lua*"
@ -83,7 +83,7 @@
(defcustom lua-ts-inferior-program "lua"
"Program to run in the inferior Lua process."
:type '(choice (const :tag "None" nil) string)
:type 'file
:version "30.1")
(defcustom lua-ts-inferior-options '("-i")
@ -289,7 +289,8 @@ values of OVERRIDE."
(defvar lua-ts--simple-indent-rules
`((lua
((or (node-is "comment")
((or (and (node-is "comment") (parent-is "chunk"))
lua-ts--multi-line-comment-start
(parent-is "comment_content")
(parent-is "string_content")
(node-is "]]"))
@ -473,9 +474,10 @@ values of OVERRIDE."
(= 1 (length (cadr sparse-tree)))))
(defun lua-ts--comment-first-sibling-matcher (node &rest _)
"Matches if NODE if it's previous sibling is a comment."
"Matches NODE if its previous sibling is a comment."
(let ((sibling (treesit-node-prev-sibling node)))
(equal "comment" (treesit-node-type sibling))))
(and (= 0 (treesit-node-index sibling t))
(equal "comment" (treesit-node-type sibling)))))
(defun lua-ts--top-level-function-call-matcher (node &rest _)
"Matches if NODE is within a top-level function call."
@ -508,6 +510,15 @@ values of OVERRIDE."
(line-beginning-position))
(point))))
(defun lua-ts--multi-line-comment-start (node &rest _)
"Matches if NODE is the beginning of a multi-line comment."
(and node
(equal "comment" (treesit-node-type node))
(save-excursion
(goto-char (treesit-node-start node))
(forward-char 2) ; Skip the -- part.
(looking-at "\\[\\["))))
(defvar lua-ts--syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?+ "." table)
@ -632,47 +643,49 @@ Calls REPORT-FN directly."
(defun lua-ts-inferior-lua ()
"Run a Lua interpreter in an inferior process."
(interactive)
(unless (comint-check-proc lua-ts-inferior-buffer)
(apply #'make-comint-in-buffer
(string-replace "*" "" lua-ts-inferior-buffer)
lua-ts-inferior-buffer
lua-ts-inferior-program
lua-ts-inferior-startfile
lua-ts-inferior-options)
(when lua-ts-inferior-history
(if (not lua-ts-inferior-program)
(user-error "You must set `lua-ts-inferior-program' to use this command")
(unless (comint-check-proc lua-ts-inferior-buffer)
(apply #'make-comint-in-buffer
(string-replace "*" "" lua-ts-inferior-buffer)
lua-ts-inferior-buffer
lua-ts-inferior-program
lua-ts-inferior-startfile
lua-ts-inferior-options)
(when lua-ts-inferior-history
(set-process-sentinel (get-buffer-process lua-ts-inferior-buffer)
'lua-ts-inferior--write-history))
(with-current-buffer lua-ts-inferior-buffer
(setq-local comint-input-ignoredups t
comint-input-ring-file-name lua-ts-inferior-history
comint-prompt-read-only t
comint-prompt-regexp (rx-to-string `(: bol
,lua-ts-inferior-prompt
(1+ space))))
(comint-read-input-ring t)
(add-hook 'comint-preoutput-filter-functions
(lambda (string)
(if (equal string (concat lua-ts-inferior-prompt-continue " "))
string
(concat
;; Filter out the extra prompt characters that
;; accumulate in the output when sending regions
;; to the inferior process.
(replace-regexp-in-string (rx-to-string
`(: bol
(* ,lua-ts-inferior-prompt
(? ,lua-ts-inferior-prompt)
(1+ space))
(group (* nonl))))
"\\1" string)
;; Re-add the prompt for the next line.
lua-ts-inferior-prompt " ")))
nil t)))
(select-window (display-buffer lua-ts-inferior-buffer
'((display-buffer-reuse-window
display-buffer-pop-up-window)
(reusable-frames . t))))
(get-buffer-process (current-buffer)))
(with-current-buffer lua-ts-inferior-buffer
(setq-local comint-input-ignoredups t
comint-input-ring-file-name lua-ts-inferior-history
comint-prompt-read-only t
comint-prompt-regexp (rx-to-string `(: bol
,lua-ts-inferior-prompt
(1+ space))))
(comint-read-input-ring t)
(add-hook 'comint-preoutput-filter-functions
(lambda (string)
(if (equal string (concat lua-ts-inferior-prompt-continue " "))
string
(concat
;; Filter out the extra prompt characters that
;; accumulate in the output when sending regions
;; to the inferior process.
(replace-regexp-in-string
(rx-to-string `(: bol
(* ,lua-ts-inferior-prompt
(? ,lua-ts-inferior-prompt)
(1+ space))
(group (* nonl))))
"\\1" string)
;; Re-add the prompt for the next line.
lua-ts-inferior-prompt " ")))
nil t)))
(select-window (display-buffer lua-ts-inferior-buffer
'((display-buffer-reuse-window
display-buffer-pop-up-window)
(reusable-frames . t))))
(get-buffer-process (current-buffer))))
(defun lua-ts-send-buffer ()
"Send current buffer to the inferior Lua process."

View File

@ -84,7 +84,7 @@
;;; Install treesitter language parsers
(defvar php-ts-mode--language-source-alist
'((php . ("https://github.com/tree-sitter/tree-sitter-php" "v0.23.4" "php/src"))
'((php . ("https://github.com/tree-sitter/tree-sitter-php" "v0.23.5" "php/src"))
(phpdoc . ("https://github.com/claytonrcarter/tree-sitter-phpdoc"))
(html . ("https://github.com/tree-sitter/tree-sitter-html" "v0.23.0"))
(javascript . ("https://github.com/tree-sitter/tree-sitter-javascript" "v0.23.0"))
@ -640,6 +640,7 @@ characters of the current line."
((query "(class_interface_clause (qualified_name) @indent)")
parent-bol php-ts-mode-indent-offset)
((parent-is "class_declaration") parent-bol 0)
((parent-is "namespace_use_declaration") parent-bol php-ts-mode-indent-offset)
((parent-is "namespace_use_group") parent-bol php-ts-mode-indent-offset)
((parent-is "function_definition") parent-bol 0)
((parent-is "member_call_expression") first-sibling php-ts-mode-indent-offset)
@ -781,7 +782,7 @@ characters of the current line."
'("--" "**=" "*=" "/=" "%=" "+=" "-=" ".=" "<<=" ">>=" "&=" "^="
"|=" "??" "??=" "||" "&&" "|" "^" "&" "==" "!=" "<>" "===" "!=="
"<" ">" "<=" ">=" "<=>" "<<" ">>" "+" "-" "." "*" "**" "/" "%"
"->" "?->")
"->" "?->" "...")
"PHP operators for tree-sitter font-locking.")
(defconst php-ts-mode--predefined-constant
@ -993,7 +994,7 @@ characters of the current line."
(member_call_expression
name: (_) @font-lock-function-call-face)
(nullsafe_member_call_expression
name: (_) @font-lock-constant-face))
name: (_) @font-lock-function-call-face))
:language 'php
:feature 'argument
@ -1266,8 +1267,14 @@ less common PHP-style # comment. SOFT works the same as in
(line-end-position)
t nil))
(let ((offset (- (match-beginning 0) (line-beginning-position)))
(comment-prefix (match-string 0)))
(if soft (insert-and-inherit ?\n) (newline 1))
(comment-prefix (match-string 0))
(insert-line-break
(lambda ()
(delete-horizontal-space)
(if soft
(insert-and-inherit ?\n)
(newline 1)))))
(funcall insert-line-break)
(delete-region (line-beginning-position) (point))
(insert
(make-string offset ?\s)

View File

@ -1139,6 +1139,7 @@ XREF-ALIST is of the form ((GROUP . (XREF ...)) ...), where
GROUP is a string for decoration purposes and XREF is an
`xref-item' object."
(require 'compile) ; For the compilation faces.
(setq xref-num-matches-found 0)
(cl-loop for (group . xrefs) in xref-alist
for max-line = (cl-loop for xref in xrefs
maximize (xref-location-line
@ -1158,6 +1159,7 @@ GROUP is a string for decoration purposes and XREF is an
(xref--insert-propertized '(face xref-file-header xref-group t)
group "\n")
(dolist (xref xrefs)
(cl-incf xref-num-matches-found)
(pcase-let (((cl-struct xref-item summary location) xref))
(let* ((line (xref-location-line location))
(prefix
@ -1247,7 +1249,6 @@ Return an alist of the form ((GROUP . (XREF ...)) ...)."
(xref--ensure-default-directory dd (current-buffer))
(xref--xref-buffer-mode)
(xref--show-common-initialize xref-alist fetcher alist)
(setq xref-num-matches-found (length xrefs))
(setq mode-line-process (list xref-mode-line-matches))
(pop-to-buffer (current-buffer))
(setq buf (current-buffer)))

View File

@ -257,16 +257,23 @@ Use \"\\[command-apropos] picture-movement\" to see commands which control motio
(> width 1)
(< (abs picture-horizontal-step) 2))
(* picture-horizontal-step 2)
picture-horizontal-step)))
picture-horizontal-step))
actual-col)
(while (> arg 0)
(setq arg (1- arg))
(if (/= picture-desired-column (current-column))
(move-to-column picture-desired-column t))
(let ((col (+ picture-desired-column width)))
(setq actual-col (move-to-column picture-desired-column t))
(setq actual-col picture-desired-column))
(let ((col (+ actual-col width)))
(or (eolp)
(let ((pos (point)))
(move-to-column col t)
(let ((old-width (string-width (buffer-substring pos (point)))))
(let ((pos (point))
(col0 (current-column))
col1)
(setq col1 (move-to-column col t))
;; We count columns, not width, because move-to-column
;; could insert TABs, which width depends on horizontal
;; position.
(let ((old-width (- (max col0 col1) (min col0 col1))))
(delete-region pos (point))
(when (> old-width width)
(insert-char ? (- old-width width))

View File

@ -111,7 +111,7 @@ static int last_per_buffer_idx;
static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay,
bool after, Lisp_Object arg1,
Lisp_Object arg2, Lisp_Object arg3);
static void reset_buffer_local_variables (struct buffer *, bool);
static void reset_buffer_local_variables (struct buffer *, int);
/* Alist of all buffer names vs the buffers. This used to be
a Lisp-visible variable, but is no longer, to prevent lossage
@ -1110,10 +1110,11 @@ reset_buffer (register struct buffer *b)
Instead, use Fkill_all_local_variables.
If PERMANENT_TOO, reset permanent buffer-local variables.
If not, preserve those. */
If not, preserve those. PERMANENT_TOO = 2 means ignore
the permanent-local property of non-builtin variables. */
static void
reset_buffer_local_variables (struct buffer *b, bool permanent_too)
reset_buffer_local_variables (struct buffer *b, int permanent_too)
{
int offset, i;
@ -1139,7 +1140,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too)
bset_invisibility_spec (b, Qt);
/* Reset all (or most) per-buffer variables to their defaults. */
if (permanent_too)
if (permanent_too == 1)
bset_local_var_alist (b, Qnil);
else
{
@ -1168,7 +1169,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too)
swap_in_global_binding (XSYMBOL (sym));
}
if (!NILP (prop))
if (!NILP (prop) && !permanent_too)
{
/* If permanent-local, keep it. */
last = tmp;
@ -3006,7 +3007,7 @@ the normal hook `change-major-mode-hook'. */)
/* Actually eliminate all local bindings of this buffer. */
reset_buffer_local_variables (current_buffer, !NILP (kill_permanent));
reset_buffer_local_variables (current_buffer, !NILP (kill_permanent) ? 2 : 0);
/* Force mode-line redisplay. Useful here because all major mode
commands call this function. */

View File

@ -360,6 +360,10 @@ multi-line
]]
return true
end
--[[
Long comment.
]]
=-=
--[[
Multi-line
@ -373,6 +377,44 @@ multi-line
]]
return true
end
--[[
Long comment.
]]
=-=-=
Name: Comment Indent
=-=
local fn1 = function (a, b)
-- comment
return a + b
end
local tb1 = {
first = 1,
-- comment
second = 2,
}
local tb9 = { one = 1,
-- comment
two = 2 }
=-=
local fn1 = function (a, b)
-- comment
return a + b
end
local tb1 = {
first = 1,
-- comment
second = 2,
}
local tb9 = { one = 1,
-- comment
two = 2 }
=-=-=
Name: Argument Indent