diff options
| author | Eli Zaretskii | 2023-04-22 04:56:57 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2023-04-22 04:56:57 -0400 |
| commit | 2f013c46f7116d53468de78c00903c87d100bbd9 (patch) | |
| tree | 8a7a09256c1d15f277f4a439062c637fa8189074 | |
| parent | e6ca5834a6eab91023e9f968b65683d0a74db1e7 (diff) | |
| parent | 44145bf07e296efe28a29f03edcb685c84afe69a (diff) | |
| download | emacs-2f013c46f7116d53468de78c00903c87d100bbd9.tar.gz emacs-2f013c46f7116d53468de78c00903c87d100bbd9.zip | |
Merge from origin/emacs-29
44145bf07e2 Add indentation style setting for c-ts-mode in .dir-local...
e7db6c59cc6 ; * .dir-locals.el (c-ts-mode): Add settings.
d041f01b02f ; Minor fix in Emacs Lisp Intro manual
| -rw-r--r-- | .dir-locals.el | 3 | ||||
| -rw-r--r-- | doc/lispintro/emacs-lisp-intro.texi | 9 | ||||
| -rw-r--r-- | lisp/progmodes/c-ts-mode.el | 5 |
3 files changed, 13 insertions, 4 deletions
diff --git a/.dir-locals.el b/.dir-locals.el index fc89dff87f2..0bcded4b5d1 100644 --- a/.dir-locals.el +++ b/.dir-locals.el | |||
| @@ -21,6 +21,9 @@ | |||
| 21 | (electric-quote-comment . nil) | 21 | (electric-quote-comment . nil) |
| 22 | (electric-quote-string . nil) | 22 | (electric-quote-string . nil) |
| 23 | (mode . bug-reference-prog))) | 23 | (mode . bug-reference-prog))) |
| 24 | (c-ts-mode . ((c-ts-mode-indent-style . gnu) | ||
| 25 | (indent-tabs-mode . t) | ||
| 26 | (mode . bug-reference-prog))) | ||
| 24 | (log-edit-mode . ((log-edit-font-lock-gnu-style . t) | 27 | (log-edit-mode . ((log-edit-font-lock-gnu-style . t) |
| 25 | (log-edit-setup-add-author . t) | 28 | (log-edit-setup-add-author . t) |
| 26 | (vc-git-log-edit-summary-target-len . 50))) | 29 | (vc-git-log-edit-summary-target-len . 50))) |
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index a2b82d25633..6447ff74bc9 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi | |||
| @@ -6604,10 +6604,11 @@ works. You will probably need to use @kbd{C-h f} | |||
| 6604 | (@code{describe-function}). The newer version uses a conditional to | 6604 | (@code{describe-function}). The newer version uses a conditional to |
| 6605 | determine whether the buffer has been narrowed. | 6605 | determine whether the buffer has been narrowed. |
| 6606 | 6606 | ||
| 6607 | (Also, it uses @code{line-number-at-pos}, which among other simple | 6607 | Also, the modern version of @code{what-line} uses |
| 6608 | expressions, such as @code{(goto-char (point-min))}, moves point to | 6608 | @code{line-number-at-pos}, which among other simple expressions, such |
| 6609 | the beginning of the current line with @code{(forward-line 0)} rather | 6609 | as @code{(goto-char (point-min))}, moves point to the beginning of the |
| 6610 | than @code{beginning-of-line}.) | 6610 | current line with @code{(forward-line 0)} rather than |
| 6611 | @code{beginning-of-line}.) | ||
| 6611 | 6612 | ||
| 6612 | The @code{what-line} function as shown here has a documentation line | 6613 | The @code{what-line} function as shown here has a documentation line |
| 6613 | and is interactive, as you would expect. The next two lines use the | 6614 | and is interactive, as you would expect. The next two lines use the |
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 2309aa00fc9..bbc7979667c 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el | |||
| @@ -136,6 +136,10 @@ symbol." | |||
| 136 | (loop (append res (list buffer)) (cdr buffers)) | 136 | (loop (append res (list buffer)) (cdr buffers)) |
| 137 | (loop res (cdr buffers)))))))) | 137 | (loop res (cdr buffers)))))))) |
| 138 | 138 | ||
| 139 | (defun c-ts-indent-style-safep (style) | ||
| 140 | "Non-nil if STYLE's value is safe for file-local variables." | ||
| 141 | (and (symbolp style) (not (functionp style)))) | ||
| 142 | |||
| 139 | (defcustom c-ts-mode-indent-style 'gnu | 143 | (defcustom c-ts-mode-indent-style 'gnu |
| 140 | "Style used for indentation. | 144 | "Style used for indentation. |
| 141 | 145 | ||
| @@ -150,6 +154,7 @@ follows the form of `treesit-simple-indent-rules'." | |||
| 150 | (symbol :tag "BSD" bsd) | 154 | (symbol :tag "BSD" bsd) |
| 151 | (function :tag "A function for user customized style" ignore)) | 155 | (function :tag "A function for user customized style" ignore)) |
| 152 | :set #'c-ts-mode--indent-style-setter | 156 | :set #'c-ts-mode--indent-style-setter |
| 157 | :safe 'c-ts-indent-style-safep | ||
| 153 | :group 'c) | 158 | :group 'c) |
| 154 | 159 | ||
| 155 | (defun c-ts-mode--get-indent-style (mode) | 160 | (defun c-ts-mode--get-indent-style (mode) |