commit c833892140fbf4be45161bf85d4c1253c5503949 (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Thu Apr 18 23:39:30 2024 -0400 (eglot--signal-textDocument/didChange): Fix tests The tests call `eglot--signal-textDocument/didChange` eagerly, which means in the case where we use `track-changes` that they call it before the tracker's signal has been called. So make sure we fetch pending changes even if we haven't yet been notified of them, and make sure `eglot--versioned-identifier` is incremented even when the signal is not called. * lisp/progmodes/eglot.el (eglot--track-changes-fetch) (eglot--after-change): Increment `eglot--versioned-identifier` here... (eglot--track-changes-signal): ...instead of here. (eglot--signal-textDocument/didChange): Try and fetch changes even if the tracker's signal wasn't called yet. * test/lisp/progmodes/eglot-tests.el (eglot-tests--get): New function. (eglot-tests--lsp-abiding-column-1): Use it. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 90a607075d3..d8eb1f1ee83 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2625,6 +2625,7 @@ buffer." (defun eglot--after-change (beg end pre-change-length) "Hook onto `after-change-functions'. Records BEG, END and PRE-CHANGE-LENGTH locally." + (cl-incf eglot--versioned-identifier) (pcase (car-safe eglot--recent-changes) (`(,lsp-beg ,lsp-end (,b-beg . ,b-beg-marker) @@ -2658,6 +2659,7 @@ Records BEG, END and PRE-CHANGE-LENGTH locally." (if (eq eglot--recent-changes :pending) (setq eglot--recent-changes nil)) (track-changes-fetch id (lambda (beg end before) + (cl-incf eglot--versioned-identifier) (cond ((eq eglot--recent-changes :emacs-messup) nil) ((eq before 'error) (setf eglot--recent-changes :emacs-messup)) @@ -2668,7 +2670,6 @@ Records BEG, END and PRE-CHANGE-LENGTH locally." eglot--recent-changes)))))) (defun eglot--track-changes-signal (id &optional distance) - (cl-incf eglot--versioned-identifier) (cond (distance ;; When distance is <100, we may as well coalesce the changes. @@ -2789,9 +2790,9 @@ When called interactively, use the currently active server" (defun eglot--signal-textDocument/didChange () "Send textDocument/didChange to server." + (when eglot--track-changes + (eglot--track-changes-fetch eglot--track-changes)) (when eglot--recent-changes - (when eglot--track-changes - (eglot--track-changes-fetch eglot--track-changes)) (let* ((server (eglot--current-server-or-lose)) (sync-capability (eglot-server-capable :textDocumentSync)) (sync-kind (if (numberp sync-capability) sync-capability diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index 4725885038e..e501e24f5d2 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -821,6 +821,12 @@ int main() { (should (looking-back "\"foo.bar\": \"")) (should (looking-at "fb\"$")))))) +(defun eglot-tests--get (object path) + (dolist (op path) + (setq object (if (natnump op) (aref object op) + (plist-get object op)))) + object) + (defun eglot-tests--lsp-abiding-column-1 () (eglot--with-fixture '(("project" . @@ -837,7 +843,11 @@ int main() { (insert "p ") (eglot--signal-textDocument/didChange) (eglot--wait-for (c-notifs 2) (&key params &allow-other-keys) - (should (equal 71 (cadddr (cadadr (aref (cadddr params) 0)))))) + (message "PARAMS=%S" params) + (should (equal 71 (eglot-tests--get + params + '(:contentChanges 0 + :range :start :character))))) (beginning-of-line) (should (eq eglot-move-to-linepos-function #'eglot-move-to-utf-16-linepos)) (funcall eglot-move-to-linepos-function 71) commit a3f6d92714c31ccb87f56b13ee2606c05493c87d Author: Juri Linkov Date: Thu Apr 18 20:28:16 2024 +0300 Drag tabs to reorder buffers on the tab line. * lisp/tab-line.el (tab-line-mouse-move-tab): New command bound to [tab-line drag-mouse-1]. diff --git a/etc/NEWS b/etc/NEWS index 78a1307b6a4..8ad1e78ca60 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -384,7 +384,8 @@ tabs function, is like the previous 'tab-line-tabs-window-buffers' where both of them show only buffers that were previously displayed in the window. But the difference is that the new function always keeps the original order of buffers on the tab line, even after switching between -these buffers. +these buffers. You can drag the tabs and release at a new position +to manually reorder the buffers on the tab line. --- *** New user option 'tab-line-tabs-buffer-group-function'. diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 2eb97012262..84dd20a6307 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -959,6 +959,31 @@ is possible when `tab-line-switch-cycling' is non-nil." (let ((switch-to-buffer-obey-display-actions nil)) (switch-to-buffer buffer)))))))) +(defun tab-line-mouse-move-tab (event) + "Move a tab to a different position on the tab line. +This command should be bound to a drag event. It moves the tab +at the mouse-down event to the position at mouse-up event. +It can be used only when `tab-line-tabs-function' is +customized to `tab-line-tabs-fixed-window-buffers'." + (interactive "e") + (when (eq tab-line-tabs-function #'tab-line-tabs-fixed-window-buffers) + (let* ((posnp1 (tab-line-event-start event)) + (posnp2 (event-end event)) + (string1 (car (posn-string posnp1))) + (string2 (car (posn-string posnp2))) + (buffer1 (when string1 (tab-line--get-tab-property 'tab string1))) + (buffer2 (when string2 (tab-line--get-tab-property 'tab string2))) + (window1 (posn-window posnp1)) + (window2 (posn-window posnp2)) + (buffers (window-parameter window1 'tab-line-buffers)) + (pos2 (when buffer2 (seq-position buffers buffer2)))) + (when (and (eq window1 window2) buffer1 pos2) + (setq buffers (delq buffer1 buffers)) + (cl-pushnew buffer1 (nthcdr pos2 buffers)) + (set-window-parameter window1 'tab-line-buffers buffers) + (set-window-parameter window1 'tab-line-cache nil) + (with-selected-window window1 (force-mode-line-update)))))) + (defcustom tab-line-close-tab-function 'bury-buffer "What to do upon closing a tab on the tab line. @@ -1120,6 +1145,7 @@ of `tab-line-exclude', are exempt from `tab-line-mode'." (global-set-key [tab-line down-mouse-3] 'tab-line-context-menu) +(global-set-key [tab-line drag-mouse-1] 'tab-line-mouse-move-tab) (global-set-key [tab-line mouse-4] 'tab-line-hscroll-left) (global-set-key [tab-line mouse-5] 'tab-line-hscroll-right) commit 3228c1222c99e672ca0cd7599c07ea1db852aa1a Author: João Távora Date: Thu Apr 18 08:03:10 2024 -0500 Better way to fix bug#70036 Cache a new eglot--cached-tdi var per buffer, which contains value to return from eglot--TextDocumentIdentifier. This avoids frequent expensive recomputation of a value that requires potentially many 'file-truename' calls. This technique is used in a number of other cases already, like eglot--recent-changes or eglot--versioned-identifier. * lisp/progmodes/eglot.el (eglot--cached-tdi): New variable. (eglot--TextDocumentIdentifier): Tweak. (eglot--signal-textDocument/didOpen): Clear eglot--cached-tdi. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 00f69b2ca83..90a607075d3 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2518,12 +2518,17 @@ THINGS are either registrations or unregisterations (sic)." (t (setq success :json-false))) `(:success ,success))) +(defvar-local eglot--cached-tdi nil + "A cached LSP TextDocumentIdentifier URI string.") + (defun eglot--TextDocumentIdentifier () "Compute TextDocumentIdentifier object for current buffer." - `(:uri ,(eglot-path-to-uri (or buffer-file-name - (ignore-errors - (buffer-file-name - (buffer-base-buffer))))))) + `(:uri ,(or eglot--cached-tdi + (setq eglot--cached-tdi + (eglot-path-to-uri (or buffer-file-name + (ignore-errors + (buffer-file-name + (buffer-base-buffer))))))))) (defvar-local eglot--versioned-identifier 0) @@ -2816,7 +2821,9 @@ When called interactively, use the currently active server" (defun eglot--signal-textDocument/didOpen () "Send textDocument/didOpen to server." - (setq eglot--recent-changes nil eglot--versioned-identifier 0) + (setq eglot--recent-changes nil + eglot--versioned-identifier 0 + eglot--cached-tdi nil) (jsonrpc-notify (eglot--current-server-or-lose) :textDocument/didOpen `(:textDocument ,(eglot--TextDocumentItem)))) commit 306feb7d967ecea9c916dd6e25b2e84a3f1c714e Author: João Távora Date: Thu Apr 18 03:55:17 2024 -0500 Revert "Don't use file-truepath in Eglot (bug#70036)" This reverts commit 08c80c45ddea17df87fc768a39dff353ccc13d3b. It introduces bugs when a project contains symlinked files. The server will be informed of duplicate documents which are really the same and it frequently has no means to deduplicate such information. This leads to bugs such as excessive textDocument/references to a function. * lisp/progmodes/eglot.el (eglot-lsp-server): Revert change. (eglot-uri-to-path): Revert change. (eglot--on-shutdown): Revert change. (eglot--managed-mode): Revert change. (eglot-handle-notification textDocument/publishDiagnostics): Revert change. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 2ea3ecc76cf..00f69b2ca83 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1058,8 +1058,8 @@ ACTION is an LSP object of either `CodeAction' or `Command' type." :documentation "Map (DIR -> (WATCH ID1 ID2...)) for `didChangeWatchedFiles'." :initform (make-hash-table :test #'equal) :accessor eglot--file-watches) (managed-buffers - :documentation "Map (PATH -> BUFFER) for buffers managed by server." - :initform (make-hash-table :test #'equal) + :initform nil + :documentation "List of buffers managed by server." :accessor eglot--managed-buffers) (saved-initargs :documentation "Saved initargs for reconnection purposes." @@ -1090,12 +1090,12 @@ ACTION is an LSP object of either `CodeAction' or `Command' type." (defun eglot-path-to-uri (path) "Convert PATH, a file name, to LSP URI string and return it." - (let ((expanded-path (expand-file-name path))) + (let ((truepath (file-truename path))) (if (and (url-type (url-generic-parse-url path)) ;; It might be MS Windows path which includes a drive ;; letter that looks like a URL scheme (bug#59338) (not (and (eq system-type 'windows-nt) - (file-name-absolute-p expanded-path)))) + (file-name-absolute-p truepath)))) ;; Path is already a URI, so forward it to the LSP server ;; untouched. The server should be able to handle it, since ;; it provided this URI to clients in the first place. @@ -1103,11 +1103,11 @@ ACTION is an LSP object of either `CodeAction' or `Command' type." (concat "file://" ;; Add a leading "/" for local MS Windows-style paths. (if (and (eq system-type 'windows-nt) - (not (file-remote-p expanded-path))) + (not (file-remote-p truepath))) "/") (url-hexify-string ;; Again watch out for trampy paths. - (directory-file-name (file-local-name expanded-path)) + (directory-file-name (file-local-name truepath)) eglot--uri-path-allowed-chars))))) (defun eglot-range-region (range &optional markers) @@ -1192,7 +1192,7 @@ PRESERVE-BUFFERS as in `eglot-shutdown', which see." (defun eglot--on-shutdown (server) "Called by jsonrpc.el when SERVER is already dead." ;; Turn off `eglot--managed-mode' where appropriate. - (dolist (buffer (map-values (eglot--managed-buffers server))) + (dolist (buffer (eglot--managed-buffers server)) (let (;; Avoid duplicate shutdowns (github#389) (eglot-autoshutdown nil)) (eglot--when-live-buffer buffer (eglot--managed-mode-off)))) @@ -2025,11 +2025,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.") (add-hook 'eldoc-documentation-functions #'eglot-signature-eldoc-function nil t) (eldoc-mode 1)) - - (let ((buffer (current-buffer))) - (puthash (expand-file-name (buffer-file-name buffer)) - buffer - (eglot--managed-buffers (eglot-current-server))))) + (cl-pushnew (current-buffer) (eglot--managed-buffers (eglot-current-server)))) (t (when eglot--track-changes (track-changes-unregister eglot--track-changes) @@ -2060,10 +2056,10 @@ Use `eglot-managed-p' to determine if current buffer is managed.") (let ((server eglot--cached-server)) (setq eglot--cached-server nil) (when server - (remhash (expand-file-name (buffer-file-name (current-buffer))) - (eglot--managed-buffers server)) + (setf (eglot--managed-buffers server) + (delq (current-buffer) (eglot--managed-buffers server))) (when (and eglot-autoshutdown - (null (map-values (eglot--managed-buffers server)))) + (null (eglot--managed-buffers server))) (eglot-shutdown server))))))) (defun eglot--managed-mode-off () @@ -2386,7 +2382,7 @@ still unanswered LSP requests to the server\n"))) (remhash token (eglot--progress-reporters server)))))))))) (cl-defmethod eglot-handle-notification - (server (_method (eql textDocument/publishDiagnostics)) &key uri diagnostics + (_server (_method (eql textDocument/publishDiagnostics)) &key uri diagnostics &allow-other-keys) ; FIXME: doesn't respect `eglot-strict-mode' "Handle notification publishDiagnostics." (cl-flet ((eglot--diag-type (sev) @@ -2397,7 +2393,7 @@ still unanswered LSP requests to the server\n"))) (mess (source code message) (concat source (and code (format " [%s]" code)) ": " message))) (if-let* ((path (expand-file-name (eglot-uri-to-path uri))) - (buffer (gethash path (eglot--managed-buffers server)))) + (buffer (find-buffer-visiting path))) (with-current-buffer buffer (cl-loop initially @@ -2908,7 +2904,7 @@ may be called multiple times (respecting the protocol of Try to visit the target file for a richer summary line." (pcase-let* ((file (eglot-uri-to-path uri)) - (visiting (or (gethash file (eglot--managed-buffers (eglot-current-server))) + (visiting (or (find-buffer-visiting file) (gethash uri eglot--temp-location-buffers))) (collect (lambda () (eglot--widening @@ -3608,14 +3604,13 @@ list ((FILENAME EDITS VERSION)...)." (with-current-buffer (get-buffer-create "*EGLOT proposed server changes*") (buffer-disable-undo (current-buffer)) (let ((inhibit-read-only t) - (target (current-buffer)) - (managed-buffers (eglot--managed-buffers (eglot-current-server)))) + (target (current-buffer))) (diff-mode) (erase-buffer) (pcase-dolist (`(,path ,edits ,_) prepared) (with-temp-buffer (let* ((diff (current-buffer)) - (existing-buf (gethash path (gethash path managed-buffers))) + (existing-buf (find-buffer-visiting path)) (existing-buf-label (prin1-to-string existing-buf))) (with-temp-buffer (if existing-buf @@ -3650,8 +3645,7 @@ edit proposed by the server." (eglot--dbind ((VersionedTextDocumentIdentifier) uri version) textDocument (list (eglot-uri-to-path uri) edits version))) - documentChanges)) - (managed-buffers (eglot--managed-buffers (eglot-current-server)))) + documentChanges))) (unless (and changes documentChanges) ;; We don't want double edits, and some servers send both ;; changes and documentChanges. This unless ensures that we @@ -3659,7 +3653,7 @@ edit proposed by the server." (cl-loop for (uri edits) on changes by #'cddr do (push (list (eglot-uri-to-path uri) edits) prepared))) (cl-flet ((notevery-visited-p () - (cl-notevery (lambda (p) (gethash p managed-buffers)) + (cl-notevery #'find-buffer-visiting (mapcar #'car prepared))) (accept-p () (y-or-n-p commit c308f5687060423938a0a72ab39505451f223e8a Author: Randy Taylor Date: Thu Apr 18 09:38:28 2024 -0400 ; Alphabetize go-ts-mode's treesit-font-lock-feature-list * lisp/progmodes/go-ts-mode.el (go-ts-mode): Rearrange features to keep alphabetical order. (Bug#70362) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index f2b586dfb43..aef224ab3fa 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -284,7 +284,7 @@ (setq-local treesit-font-lock-feature-list '(( comment definition) ( keyword string type) - ( constant escape-sequence label number builtin) + ( builtin constant escape-sequence label number) ( bracket delimiter error function operator property variable))) (treesit-major-mode-setup))) commit 94dec95317994f36f1355b972850d9565b61c433 Author: Stephen Berman Date: Thu Apr 18 15:35:49 2024 +0200 Don't error on tabbing to a widget at BOB (bug#69943) * lisp/wid-edit.el (widget-move): Don't move backward when at beginning of buffer, and keep point on widget's left side. * test/lisp/wid-edit-tests.el (widget-test-widget-move): Test that moving to a widget at beginning of buffer does not signal a beginning-of-buffer error. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index cb6d8ebc2c4..dc481d4d0a5 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1300,9 +1300,9 @@ nothing is shown in the echo area." (unless (eq new old) (setq arg (1+ arg)))))) (let ((new (widget-tabable-at))) - (while (eq (widget-tabable-at) new) + (while (and (eq (widget-tabable-at) new) (not (bobp))) (backward-char))) - (forward-char)) + (unless (bobp) (forward-char))) (unless suppress-echo (widget-echo-help (point))) (run-hooks 'widget-move-hook)) diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index 4b049478b29..d416eb99022 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -336,7 +336,13 @@ return nil, even with a non-nil bubblep argument." (widget-forward 2) (forward-char) (widget-backward 1) - (should (string= "Second" (widget-value (widget-at)))))) + (should (string= "Second" (widget-value (widget-at)))) + ;; Check that moving to a widget at beginning of buffer does not + ;; signal a beginning-of-buffer error (bug#69943). + (widget-backward 1) ; Should not signal beginning-of-buffer error. + (widget-forward 2) + (should (string= "Third" (widget-value (widget-at)))) + (widget-forward 1))) ; Should not signal beginning-of-buffer error. (ert-deftest widget-test-color-match () "Test that the :match function for the color widget works." commit 0a57dfcff8d0abcf4427cfbfd886264bb3b8eaab Author: Mattias Engdegård Date: Thu Apr 18 12:59:35 2024 +0200 Ensure that specbind arg is always bare symbol, and drop check * src/eval.c (FletX, Flet, internal_lisp_condition_case) (funcall_lambda): Ensure that the first argument to `specbind` is a bare symbol in the few cases where this isn't statically guaranteed. (specbind): Drop the symbol argument type check on the fast path. diff --git a/src/eval.c b/src/eval.c index 7f7a70b15ae..c5b8a375af4 100644 --- a/src/eval.c +++ b/src/eval.c @@ -948,8 +948,9 @@ usage: (let* VARLIST BODY...) */) val = eval_sub (Fcar (XCDR (elt))); } - if (!NILP (lexenv) && SYMBOLP (var) - && !XSYMBOL (var)->u.s.declared_special + var = maybe_remove_pos_from_symbol (var); + if (!NILP (lexenv) && BARE_SYMBOL_P (var) + && !XBARE_SYMBOL (var)->u.s.declared_special && NILP (Fmemq (var, Vinternal_interpreter_environment))) /* Lexically bind VAR by adding it to the interpreter's binding alist. */ @@ -1016,11 +1017,10 @@ usage: (let VARLIST BODY...) */) varlist = XCAR (args); for (argnum = 0; argnum < nvars && CONSP (varlist); argnum++) { - Lisp_Object var; - elt = XCAR (varlist); varlist = XCDR (varlist); - var = SYMBOLP (elt) ? elt : Fcar (elt); + Lisp_Object var = maybe_remove_pos_from_symbol (SYMBOLP (elt) ? elt + : Fcar (elt)); tem = temps[argnum]; if (!NILP (lexenv) && SYMBOLP (var) @@ -1416,6 +1416,7 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform, struct handler *oldhandlerlist = handlerlist; ptrdiff_t CACHEABLE clausenb = 0; + var = maybe_remove_pos_from_symbol (var); CHECK_SYMBOL (var); Lisp_Object success_handler = Qnil; @@ -3254,7 +3255,7 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, Lisp_Object *arg_vector) lexenv = Fcons (Fcons (next, arg), lexenv); else /* Dynamically bind NEXT. */ - specbind (next, arg); + specbind (maybe_remove_pos_from_symbol (next), arg); previous_rest = false; } } @@ -3466,10 +3467,8 @@ do_specbind (struct Lisp_Symbol *sym, union specbinding *bind, void specbind (Lisp_Object symbol, Lisp_Object value) { - struct Lisp_Symbol *sym; - - CHECK_SYMBOL (symbol); - sym = XSYMBOL (symbol); + /* The caller must ensure that the SYMBOL argument is a bare symbol. */ + struct Lisp_Symbol *sym = XBARE_SYMBOL (symbol); start: switch (sym->u.s.redirect) commit dba115d6bcbc955858526740254bd9a169830d7e Author: Mattias Engdegård Date: Thu Apr 18 12:26:10 2024 +0200 Drop unnecessary type check in varref and varset byte ops * src/bytecode.c (exec_byte_code): We can safely assume that the immediate argument to varref and varset is a bare symbol; the byte-compiler should guarantee that. diff --git a/src/bytecode.c b/src/bytecode.c index 8d7240b9966..de25069d94a 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -625,8 +625,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, varref: { Lisp_Object v1 = vectorp[op], v2; - if (!BARE_SYMBOL_P (v1) - || XBARE_SYMBOL (v1)->u.s.redirect != SYMBOL_PLAINVAL + if (XBARE_SYMBOL (v1)->u.s.redirect != SYMBOL_PLAINVAL || (v2 = XBARE_SYMBOL (v1)->u.s.val.value, BASE_EQ (v2, Qunbound))) v2 = Fsymbol_value (v1); @@ -700,8 +699,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, Lisp_Object val = POP; /* Inline the most common case. */ - if (BARE_SYMBOL_P (sym) - && !BASE_EQ (val, Qunbound) + if (!BASE_EQ (val, Qunbound) && XBARE_SYMBOL (sym)->u.s.redirect == SYMBOL_PLAINVAL && !XBARE_SYMBOL (sym)->u.s.trapped_write) SET_SYMBOL_VAL (XBARE_SYMBOL (sym), val); commit d29d4a1d7b07806291b95792a821f8937746a467 Author: Eli Zaretskii Date: Thu Apr 18 13:45:22 2024 +0300 ; * lisp/comint.el: Fix wording of last change. diff --git a/lisp/comint.el b/lisp/comint.el index bae89beb76b..e856038b0f7 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -3961,7 +3961,7 @@ REGEXP-GROUP is the regular expression group in REGEXP to use." ;;; OSC escape sequences (Operating System Commands) ;;============================================================================ ;; Adding `comint-osc-process-output' to -;; `comint-output-filter-functions' enables the interpreting of OSC +;; `comint-output-filter-functions' enables interpreting of OSC ;; escape sequences. See `ansi-osc-handlers' for a list of OSC ;; sequences which are interpreted by default and information on how to ;; handle new sequences. commit 11b1610c72a09950140cdf2284e9960af0f4a574 Author: Augusto Stoffel Date: Sun Apr 14 09:43:27 2024 +0200 Obsolete comint-osc symbols moved to ansi-osc.el * lisp/comint.el (comint-osc-handlers) (comint-osc-directory-tracker, comint-osc-hyperlink-handler) (comint-osc-hyperlink, comint-osc-hyperlink-map): Mark as obsolete. (Bug#70375) diff --git a/lisp/comint.el b/lisp/comint.el index a8fe095e99c..bae89beb76b 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -3961,18 +3961,22 @@ REGEXP-GROUP is the regular expression group in REGEXP to use." ;;; OSC escape sequences (Operating System Commands) ;;============================================================================ ;; Adding `comint-osc-process-output' to -;; `comint-output-filter-functions' enables the interpretation of OSC -;; escape sequences. By default, OSC 7 and 8 (for current directory -;; and hyperlinks respectively) are acted upon. Adding more entries -;; to `comint-osc-handlers' allows a customized treatment of further -;; sequences. +;; `comint-output-filter-functions' enables the interpreting of OSC +;; escape sequences. See `ansi-osc-handlers' for a list of OSC +;; sequences which are interpreted by default and information on how to +;; handle new sequences. ;; Aliases defined for reverse compatibility -(defvaralias 'comint-osc-handlers 'ansi-osc-handlers) -(defalias 'comint-osc-directory-tracker 'ansi-osc-directory-tracker) -(defalias 'comint-osc-hyperlink-handler 'ansi-osc-hyperlink-handler) -(defalias 'comint-osc-hyperlink 'ansi-osc-hyperlink) -(defvaralias 'comint-osc-hyperlink-map 'ansi-osc-hyperlink-map) +(define-obsolete-variable-alias + 'comint-osc-handlers 'ansi-osc-handlers "30.1") +(define-obsolete-function-alias + 'comint-osc-directory-tracker 'ansi-osc-directory-tracker "30.1") +(define-obsolete-function-alias + 'comint-osc-hyperlink-handler 'ansi-osc-hyperlink-handler "30.1") +(define-obsolete-function-alias + 'comint-osc-hyperlink 'ansi-osc-hyperlink "30.1") +(define-obsolete-variable-alias + 'comint-osc-hyperlink-map 'ansi-osc-hyperlink-map "30.1") (defun comint-osc-process-output (_) "Interpret OSC escape sequences in comint output. @@ -3985,7 +3989,7 @@ sequences of the forms Specifically, every occurrence of such escape sequences is removed from the buffer. Then, if `command' is a key of the -`comint-osc-handlers' alist, the corresponding value, which +`ansi-osc-handlers' alist, the corresponding value, which should be a function, is called with `command' and `text' as arguments, with point where the escape sequence was located." (let ((start (1- comint-last-output-start)) commit f66820d8771ca857fb4edd7300823a2cea6120be Author: Siddharth Sharma Date: Fri Apr 12 18:11:58 2024 +0200 Add YANG LSP support to Eglot * lisp/progmodes/eglot.el (eglot-server-programs): Add 'yang-language-server' and 'json-ts-mode'. (Bug#70364) Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index c395efd9f55..2ea3ecc76cf 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -242,7 +242,7 @@ automatically)." '("pylsp" "pyls" ("basedpyright-langserver" "--stdio") ("pyright-langserver" "--stdio") "jedi-language-server" "ruff-lsp"))) - ((js-json-mode json-mode json-ts-mode) + ((js-json-mode json-mode json-ts-mode jsonc-mode) . ,(eglot-alternatives '(("vscode-json-language-server" "--stdio") ("vscode-json-languageserver" "--stdio") ("json-languageserver" "--stdio")))) @@ -302,6 +302,7 @@ automatically)." (futhark-mode . ("futhark" "lsp")) ((lua-mode lua-ts-mode) . ,(eglot-alternatives '("lua-language-server" "lua-lsp"))) + (yang-mode . ("yang-language-server")) (zig-mode . ("zls")) ((css-mode css-ts-mode) . ,(eglot-alternatives '(("vscode-css-language-server" "--stdio") commit c7bcda4ac54f31ae2724cdc3b3c884c37b667b22 Author: Eli Zaretskii Date: Thu Apr 18 13:30:20 2024 +0300 ; Minor change in last commit * lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Rearrange features to keep alphabetical order. (Bug#70362) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 83e15301854..f2b586dfb43 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -135,6 +135,16 @@ :feature 'comment '((comment) @font-lock-comment-face) + :language 'go + :feature 'builtin + `((call_expression + function: ((identifier) @font-lock-builtin-face + (:match ,(rx-to-string + `(seq bol + (or ,@go-ts-mode--builtin-functions) + eol)) + @font-lock-builtin-face)))) + :language 'go :feature 'constant `([(false) (nil) (true)] @font-lock-constant-face @@ -172,16 +182,6 @@ (var_spec name: (identifier) @font-lock-variable-name-face ("," name: (identifier) @font-lock-variable-name-face)*)) - :language 'go - :feature 'builtin - `((call_expression - function: ((identifier) @font-lock-builtin-face - (:match ,(rx-to-string - `(seq bol - (or ,@go-ts-mode--builtin-functions) - eol)) - @font-lock-builtin-face)))) - :language 'go :feature 'function '((call_expression commit 9055dad65d722850eaec049acbce15829638fd61 Author: Noah Peart Date: Fri Apr 12 22:38:28 2024 -0700 Add font-locking for Go built-in functions in go-ts-mode * lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Add font-locking for Go built-in functions to 'go-ts-mode'. (Bug#70362) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index b82bc2364dc..83e15301854 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -108,6 +108,11 @@ ">>" "%=" ">>=" "--" "!" "..." "&^" "&^=" "~") "Go operators for tree-sitter font-locking.") +(defvar go-ts-mode--builtin-functions + '("append" "cap" "clear" "close" "complex" "copy" "delete" "imag" "len" "make" + "max" "min" "new" "panic" "print" "println" "real" "recover") + "Go built-in functions for tree-sitter font-locking.") + (defun go-ts-mode--iota-query-supported-p () "Return t if the iota query is supported by the tree-sitter-go grammar." (ignore-errors @@ -167,6 +172,16 @@ (var_spec name: (identifier) @font-lock-variable-name-face ("," name: (identifier) @font-lock-variable-name-face)*)) + :language 'go + :feature 'builtin + `((call_expression + function: ((identifier) @font-lock-builtin-face + (:match ,(rx-to-string + `(seq bol + (or ,@go-ts-mode--builtin-functions) + eol)) + @font-lock-builtin-face)))) + :language 'go :feature 'function '((call_expression @@ -269,7 +284,7 @@ (setq-local treesit-font-lock-feature-list '(( comment definition) ( keyword string type) - ( constant escape-sequence label number) + ( constant escape-sequence label number builtin) ( bracket delimiter error function operator property variable))) (treesit-major-mode-setup))) commit f6c20ed5d5c22ce95df752f482df03209c7c8c42 Author: Eli Zaretskii Date: Thu Apr 18 13:08:23 2024 +0300 ; Fix last change * lisp/url/url-util.el (url-build-query-string): Move to after the definition of 'url-query-key-value-allowed-chars'. diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index f063efe18a6..4d2609cbb95 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -242,46 +242,6 @@ Will not do anything if `url-show-status' is nil." (setq retval (cons (list key val) retval))))) retval)) -;;;###autoload -(defun url-build-query-string (query &optional semicolons keep-empty) - "Build a query-string. - -Given a QUERY in the form: - ((key1 val1) - (key2 val2) - (key3 val1 val2) - (key4) - (key5 \"\")) - -\(This is the same format as produced by `url-parse-query-string') - -This will return a string -\"key1=val1&key2=val2&key3=val1&key3=val2&key4&key5\". Keys may -be strings or symbols; if they are symbols, the symbol name will -be used. - -When SEMICOLONS is given, the separator will be \";\". - -When KEEP-EMPTY is given, empty values will show as \"key=\" -instead of just \"key\" as in the example above." - (mapconcat - (lambda (key-vals) - (let ((escaped - (mapcar (lambda (sym) - (url-hexify-string (format "%s" sym) url-query-key-value-allowed-chars)) - key-vals))) - (mapconcat (lambda (val) - (let ((vprint (format "%s" val)) - (eprint (format "%s" (car escaped)))) - (concat eprint - (if (or keep-empty - (and val (not (zerop (length vprint))))) - "=" - "") - vprint))) - (or (cdr escaped) '("")) (if semicolons ";" "&")))) - query (if semicolons ";" "&"))) - (defun url-unhex (x) (if (> x ?9) (if (>= x ?a) @@ -449,6 +409,47 @@ should return it unchanged." (url-hexify-string frag url-query-allowed-chars))) (url-recreate-url obj))) +;;;###autoload +(defun url-build-query-string (query &optional semicolons keep-empty) + "Build a query-string. + +Given a QUERY in the form: + ((key1 val1) + (key2 val2) + (key3 val1 val2) + (key4) + (key5 \"\")) + +\(This is the same format as produced by `url-parse-query-string') + +This will return a string +\"key1=val1&key2=val2&key3=val1&key3=val2&key4&key5\". Keys may +be strings or symbols; if they are symbols, the symbol name will +be used. + +When SEMICOLONS is given, the separator will be \";\". + +When KEEP-EMPTY is given, empty values will show as \"key=\" +instead of just \"key\" as in the example above." + (mapconcat + (lambda (key-vals) + (let ((escaped + (mapcar (lambda (sym) + (url-hexify-string (format "%s" sym) + url-query-key-value-allowed-chars)) + key-vals))) + (mapconcat (lambda (val) + (let ((vprint (format "%s" val)) + (eprint (format "%s" (car escaped)))) + (concat eprint + (if (or keep-empty + (and val (not (zerop (length vprint))))) + "=" + "") + vprint))) + (or (cdr escaped) '("")) (if semicolons ";" "&")))) + query (if semicolons ";" "&"))) + ;;;###autoload (defun url-file-extension (fname &optional x) "Return the filename extension of FNAME. commit 40629706b1ff1a2a596420dd2ac388b7e5fc656c Author: Dagfinn Ilmari Mannsåker Date: Tue Apr 9 15:02:45 2024 +0100 Avoid unnecessary escaping in 'url-build-query-string' * lisp/url/url-util.el (url-query-key-value-allowed-chars): New defconst. (url-build-query-string): Use it to escape only those characters that need it in keys and values. * test/lisp/url/url-util-tests.el (url-util-tests): Add new test cases. (Bug#70312) diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 5f45b98c7a5..f063efe18a6 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -268,7 +268,8 @@ instead of just \"key\" as in the example above." (lambda (key-vals) (let ((escaped (mapcar (lambda (sym) - (url-hexify-string (format "%s" sym))) key-vals))) + (url-hexify-string (format "%s" sym) url-query-key-value-allowed-chars)) + key-vals))) (mapconcat (lambda (val) (let ((vprint (format "%s" val)) (eprint (format "%s" (car escaped)))) @@ -410,6 +411,15 @@ These characters are specified in RFC 3986, Appendix A.") "Allowed-character byte mask for the query segment of a URI. These characters are specified in RFC 3986, Appendix A.") +(defconst url-query-key-value-allowed-chars + (let ((vec (copy-sequence url-query-allowed-chars))) + (aset vec ?= nil) + (aset vec ?& nil) + (aset vec ?\; nil) + vec) + "Allowed-charcter byte mask for keys and values in the query segment of a URI. +url-query-allowed-chars minus '=', '&', and ';'.") + ;;;###autoload (defun url-encode-url (url) "Return a properly URI-encoded version of URL. diff --git a/test/lisp/url/url-util-tests.el b/test/lisp/url/url-util-tests.el index 133aa0ffd88..c6246d69a2a 100644 --- a/test/lisp/url/url-util-tests.el +++ b/test/lisp/url/url-util-tests.el @@ -32,7 +32,11 @@ ("key1=val1;key2=val2;key3=val1;key3=val2;key4;key5" ((key1 "val1") (key2 val2) (key3 val1 val2) ("key4") (key5 "")) t) ("key1=val1;key2=val2;key3=val1;key3=val2;key4=;key5=" - ((key1 val1) (key2 val2) ("key3" val1 val2) (key4) (key5 "")) t t))) + ((key1 val1) (key2 val2) ("key3" val1 val2) (key4) (key5 "")) t t) + ("key1=val/slash;key2=val%3Bsemi;key3=val%26amp;key4=val%3Deq" + ((key1 "val/slash") (key2 "val;semi") (key3 "val&") (key4 "val=eq")) t) + ("key%3Deq=val1;key%3Bsemi=val2;key%26amp=val3" + (("key=eq" val1) ("key;semi" val2) ("key&" val3)) t))) test) (while tests (setq test (car tests) commit 3c4f6c78b4b2ae0b1efadf5e664fa180e663037e Author: Elias G. B. Perez Date: Sat Apr 6 13:57:30 2024 -0600 Flymake support for indicating errors in margin Add optional support for display flymake error in margin, this allow displaying error indicators in both graphical and terminal frames. * doc/misc/flymake.texi (Customizable variables) (Flymake error types): Document new margin indicator. * etc/NEWS: Announce the new Flymake user option for margin indicators. * lisp/progmodes/flymake.el (flymake-indicator-type) (flymake-margin-indicators-string, flymake-autoresize-margins) (flymake-margin-indicator-position): New user options. (flymake--original-margin-width): Add buffer-local variable for store original buffer margin width. (flymake-error, flymake-warning, flymake-note): Use new margin value. (flymake--indicator-overlay-spec): Rework and Rename from flymake--fringe-overlay-spec. (flymake--resize-margins): Add new function for resize margin width. (flymake--highlight-line, flymake-mode): Rework. diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 84a74a9d6ab..7019f4b2ca0 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -309,6 +309,12 @@ reported. A custom face for highlighting regions for which a note has been reported. +@item flymake-indicator-type +The indicator type which Flymake should use to indicate lines with +errors or warnings. +Depending on your preference, this can either use @code{fringes} or +@code{margins} for indicating errors. + @item flymake-error-bitmap A bitmap used in the fringe to mark lines for which an error has been reported. @@ -320,6 +326,18 @@ been reported. @item flymake-fringe-indicator-position Which fringe (if any) should show the warning/error bitmaps. +@item flymake-margin-indicators-string +Specifies the string and face to use for the margin indicators, for +each error type. + +@item flymake-margin-indicator-position +Which margin (if any) should show the warning/error strings. + +@item flymake-autoresize-margins +If non-@code{nil}, Flymake will resize the margins when +@code{flymake-mode} is turned on or off. +Only relevant if @code{flymake-indicator-type} is set to @code{margins}. + @item flymake-wrap-around If non-@code{nil}, moving to errors with @code{flymake-goto-next-error} and @code{flymake-goto-prev-error} wraps around buffer boundaries. @@ -387,6 +405,14 @@ the syntax of @code{flymake-error-bitmap} (@pxref{Customizable variables}). It is overridden by any @code{before-string} overlay property. +@item +@cindex margin of diagnostic +@code{flymake-margin-string}, a string displayed in the margin +according to @code{flymake-margin-indicator-position}. +The value actually follows the syntax of @code{flymake-margin-indicators-string} +(@pxref{Customizable variables}). It is overridden by any +@code{before-string} overlay property. + @item @code{flymake-overlay-control}, an alist ((@var{OVPROP} . @var{VALUE}) @var{...}) of further properties used to affect the appearance of diff --git a/etc/NEWS b/etc/NEWS index 7a4e1281639..78a1307b6a4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1248,6 +1248,28 @@ in a clean environment. ** Flymake ++++ +*** New user option 'flymake-indicator-type'. +This user option controls which error indicator type Flymake should use +in current buffer. Depending on your preference, this can either use +fringes or margins for indicating errors. + ++++ +*** New user option 'flymake-margin-indicators-string'. +It controls, for each error type, the string and its face to display as +the margin indicator. + ++++ +*** New user option 'flymake-autoresize-margins'. +If non-nil, Flymake will resize the margins when 'flymake-mode' is +turned on or off. +Only relevant if `flymake-indicator-type` is set to `margins`. + ++++ +*** New user option 'flymake-margin-indicator-position'. +It controls which margin (left or right) is used for margin +indicators. + +++ *** New user option 'flymake-show-diagnostics-at-end-of-line'. When non-nil, Flymake shows summarized descriptions of diagnostics at diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index f2750a026ce..22a139d3045 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -180,6 +180,59 @@ See `flymake-error-bitmap' and `flymake-warning-bitmap'." (const right-fringe) (const :tag "No fringe indicators" nil))) +(defcustom flymake-indicator-type (if (display-graphic-p) + 'fringes + 'margins) + "Indicate which indicator type to use for display errors. + +The value can be nil (don't indicate errors but just highlight them), +fringes (use fringes) or margins (use margins) + +Difference between fringes and margin is that fringes support diplaying +bitmaps on graphical displays and margins display text in a blank area +from current buffer that works in both graphical and text displays. + +See Info node `Fringes' and Info node `(elisp)Display Margins'." + :version "30.1" + :type '(choice (const :tag "Use Fringes" fringes) + (const :tag "Use Margins "margins) + (const :tag "No indicators" nil))) + +(defcustom flymake-margin-indicators-string + '((error "!!" compilation-error) + (warning "!" compilation-warning) + (note "!" compilation-info)) + "Strings used for margins indicators. +The value of each list may be a list of 3 elements where specifies the +error type, the string to use and its face, +or a list of 2 elements specifying only the error type and +the corresponding string. + +The option `flymake-margin-indicator-position' controls how and where +this is used." + :version "30.1" + :type '(repeat :tag "Error types lists" + (list :tag "String and face for error types" + (symbol :tag "Error type") + (string :tag "String") + (face :tag "Face")))) + +(defcustom flymake-autoresize-margins t + "If non-nil, automatically resize margin-width calling flymake--resize-margins. + +Only relevant if `flymake-indicator-type' is set to margins." + :version "30.1" + :type 'boolean) + +(defcustom flymake-margin-indicator-position 'left-margin + "The position to put Flymake margin indicator. +The value can be nil (do not use indicators), `left-margin' or `right-margin'. +See `flymake-margin-indicators-string'." + :version "30.1" + :type '(choice (const left-margin) + (const right-margin) + (const :tag "No margin indicators" nil))) + (make-obsolete-variable 'flymake-start-syntax-check-on-newline "can check on newline in post-self-insert-hook" "27.1") @@ -258,6 +311,11 @@ If set to nil, don't suppress any zero counters." (defvar-local flymake-check-start-time nil "Time at which syntax check was started.") +(defvar-local flymake--original-margin-width nil + "Store original margin width. +Used by `flymake--resize-margins' for restoring original margin width +when flymake is turned off.") + (defun flymake--log-1 (level sublog msg &rest args) "Do actual work for `flymake-log'." (let (;; never popup the log buffer @@ -630,6 +688,7 @@ Node `(Flymake)Flymake error types'" (put 'flymake-error 'face 'flymake-error) (put 'flymake-error 'flymake-bitmap 'flymake-error-bitmap) +(put 'flymake-error 'flymake-margin-string (alist-get 'error flymake-margin-indicators-string)) (put 'flymake-error 'severity (warning-numeric-level :error)) (put 'flymake-error 'mode-line-face 'flymake-error-echo) (put 'flymake-error 'echo-face 'flymake-error-echo) @@ -638,6 +697,7 @@ Node `(Flymake)Flymake error types'" (put 'flymake-warning 'face 'flymake-warning) (put 'flymake-warning 'flymake-bitmap 'flymake-warning-bitmap) +(put 'flymake-warning 'flymake-margin-string (alist-get 'warning flymake-margin-indicators-string)) (put 'flymake-warning 'severity (warning-numeric-level :warning)) (put 'flymake-warning 'mode-line-face 'flymake-warning-echo) (put 'flymake-warning 'echo-face 'flymake-warning-echo) @@ -646,6 +706,7 @@ Node `(Flymake)Flymake error types'" (put 'flymake-note 'face 'flymake-note) (put 'flymake-note 'flymake-bitmap 'flymake-note-bitmap) +(put 'flymake-note 'flymake-margin-string (alist-get 'note flymake-margin-indicators-string)) (put 'flymake-note 'severity (warning-numeric-level :debug)) (put 'flymake-note 'mode-line-face 'flymake-note-echo) (put 'flymake-note 'echo-face 'flymake-note-echo) @@ -682,19 +743,53 @@ associated `flymake-category' return DEFAULT." (flymake--lookup-type-property type 'severity (warning-numeric-level :error))) -(defun flymake--fringe-overlay-spec (bitmap &optional recursed) - (if (and (symbolp bitmap) - (boundp bitmap) - (not recursed)) - (flymake--fringe-overlay-spec - (symbol-value bitmap) t) - (and flymake-fringe-indicator-position - bitmap - (propertize "!" 'display - (cons flymake-fringe-indicator-position - (if (listp bitmap) - bitmap - (list bitmap))))))) +(defun flymake--indicator-overlay-spec (indicator) + "Return INDICATOR as propertized string to use in error indicators." + (let* ((value (if (symbolp indicator) + (symbol-value indicator) + indicator)) + (indicator-car (if (listp value) + (car value) + value)) + (indicator-cdr (if (listp value) + (cdr value)))) + (cond + ((symbolp indicator-car) + (propertize "!" 'display + (cons flymake-fringe-indicator-position + (if (listp value) + value + (list value))))) + ((stringp indicator-car) + (propertize "!" + 'display + `((margin ,flymake-margin-indicator-position) + ,(propertize + indicator-car + 'face + `(:inherit (,indicator-cdr + default))))))))) + +(defun flymake--resize-margins (&optional orig-width) + "Resize current window margins according to `flymake-margin-indicator-position'. +Return to original margin width if ORIG-WIDTH is non-nil." + (when (and (eq flymake-indicator-type 'margins) + flymake-autoresize-margins) + (cond + ((and orig-width flymake--original-margin-width) + (if (eq flymake-margin-indicator-position 'left-margin) + (setq-local left-margin-width flymake--original-margin-width) + (setq-local right-margin-width flymake--original-margin-width))) + (t + (if (eq flymake-margin-indicator-position 'left-margin) + (setq-local flymake--original-margin-width left-margin-width + left-margin-width 2) + (setq-local flymake--original-margin-width right-margin-width + right-margin-width 2)))) + ;; Apply margin to all windows avalaibles + (mapc (lambda (x) + (set-window-buffer x (window-buffer x))) + (get-buffer-window-list nil nil 'visible)))) (defun flymake--equal-diagnostic-p (a b) "Tell if A and B are equivalent `flymake--diag' objects." @@ -840,10 +935,13 @@ Return nil or the overlay created." type prop value))))) (default-maybe 'face 'flymake-error) (default-maybe 'before-string - (flymake--fringe-overlay-spec + (flymake--indicator-overlay-spec (flymake--lookup-type-property type - 'flymake-bitmap + (cond ((eq flymake-indicator-type 'fringes) + 'flymake-bitmap) + ((eq flymake-indicator-type 'margins) + 'flymake-margin-string)) (alist-get 'bitmap (alist-get type ; backward compat flymake-diagnostic-types-alist))))) ;; (default-maybe 'after-string @@ -1285,6 +1383,9 @@ special *Flymake log* buffer." :group 'flymake :lighter (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t) (add-hook 'eldoc-documentation-functions 'flymake-eldoc-function t t) + ;; AutoResize margins. + (flymake--resize-margins) + ;; If Flymake happened to be already ON, we must cleanup ;; existing diagnostic overlays, lest we forget them by blindly ;; reinitializing `flymake--state' in the next line. @@ -1333,6 +1434,9 @@ special *Flymake log* buffer." :group 'flymake :lighter ;;+(remove-hook 'find-file-hook (function flymake-find-file-hook) t) (remove-hook 'eldoc-documentation-functions 'flymake-eldoc-function t) + ;; return margin to original size + (flymake--resize-margins t) + (when flymake-timer (cancel-timer flymake-timer) (setq flymake-timer nil)) commit bb9d81d5144ae497809c416eef91d126f8ac5df5 Author: Eli Zaretskii Date: Thu Apr 18 11:53:26 2024 +0300 Fix sending input to SQL when point is not at EOB * lisp/progmodes/sql.el (sql-send-string): Move point to EOB before sending input to the SQL process. Suggested by Gary Hollis . (Bug#69420) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 604f04a3d57..5273ba2bee1 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -3721,6 +3721,8 @@ prompts (`sql-output-newline-count' is positive). In this case: (save-excursion ;; Set product context (with-current-buffer sql-buffer + ;; Make sure point is at EOB before sending input to SQL. + (goto-char (point-max)) (when sql-debug-send (message ">>SQL> %S" s)) (insert "\n") commit b993c1b2752dcfe8bf6c17e58430a90b3dda5952 Author: Eli Zaretskii Date: Thu Apr 18 11:45:47 2024 +0300 ; * etc/NEWS: Reindent and refill recently added entries. diff --git a/etc/NEWS b/etc/NEWS index 2f90a3067f7..7a4e1281639 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -351,51 +351,50 @@ points after switching back to that tab. --- *** New user option 'tab-bar-select-restore-windows'. -It defines what to do with windows whose buffer was killed -since the tab was last selected. By default it displays -a placeholder buffer that provides information about the name -of the killed buffer that was displayed in that window. +It defines what to do with windows whose buffer was killed since the tab +was last selected. By default it displays a placeholder buffer that +provides information about the name of the killed buffer that was +displayed in that window. --- *** New user option 'tab-bar-tab-name-format-functions'. -It can be used to add, remove and reorder functions that change -the appearance of every tab on the tab bar. +It can be used to add, remove and reorder functions that change the +appearance of every tab on the tab bar. --- *** New hook 'tab-bar-tab-post-select-functions'. --- *** New keymap 'tab-bar-mode-map'. -By default it contains a keybinding 'C-TAB' to switch tabs, -but only when 'C-TAB' is not bound globally. You can unbind it -if it conflicts with 'C-TAB' in other modes. +By default it contains a keybinding 'C-TAB' to switch tabs, but only +when 'C-TAB' is not bound globally. You can unbind it if it conflicts +with 'C-TAB' in other modes. --- *** New keymap 'tab-line-mode-map'. -By default it contains keybindings for switching tabs: -'C-x ', 'C-x ', 'C-x C-', 'C-x C-'. -You can unbind them if you want to use these keys for the -commands 'previous-buffer' and 'next-buffer'. +By default it contains keybindings for switching tabs: 'C-x ', +'C-x ', 'C-x C-', 'C-x C-'. You can unbind them if +you want to use these keys for the commands 'previous-buffer' and +'next-buffer'. --- *** Default list of tabs is changed to support a fixed order. -This means that the new default tabs function -'tab-line-tabs-fixed-window-buffers' is like the previous -'tab-line-tabs-window-buffers' where both of them show -only buffers that were previously displayed in the window. -But the difference is that the new function always keeps -the original order of buffers on the tab line, even after -switching between these buffers. +This means that 'tab-line-tabs-fixed-window-buffers', the new default +tabs function, is like the previous 'tab-line-tabs-window-buffers' where +both of them show only buffers that were previously displayed in the +window. But the difference is that the new function always keeps the +original order of buffers on the tab line, even after switching between +these buffers. --- *** New user option 'tab-line-tabs-buffer-group-function'. -It provides two choices to group tab buffers by major mode -and by project name. +It provides two choices to group tab buffers by major mode and by +project name. --- -*** Now buffers on group tabs are sorted alphabetically. -This will keep the fixed order of tabs, even after -switching between them. +*** Buffers on group tabs are now sorted alphabetically. +This will keep the fixed order of tabs, even after switching between +them. +++ ** New optional argument for modifying directory-local variables.