From: Eli Zaretskii <eliz@gnu.org>
To: Meow King <mr.meowking@anche.no>
Cc: 72223@debbugs.gnu.org
Subject: bug#72223: 31.0.50; c-ts-mode-indent-style custom function should accept a `mode`(c/c++) parameter
Date: Sun, 21 Jul 2024 11:46:36 +0300 [thread overview]
Message-ID: <86a5ibcetv.fsf@gnu.org> (raw)
In-Reply-To: <87ed7otatf.fsf@anche.no> (bug-gnu-emacs@gnu.org)
> Date: Sat, 20 Jul 2024 22:10:06 +0800
> From: Meow King via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
>
> Currently, the `c-ts-mode--get-indent-style` function:
> ```
> (defun c-ts-mode--get-indent-style (mode)
> "Helper function to set indentation style.
> MODE is either `c' or `cpp'."
> (let ((style
> (if (functionp c-ts-mode-indent-style)
> (funcall c-ts-mode-indent-style)
> (alist-get c-ts-mode-indent-style (c-ts-mode--indent-styles mode)))))
> `((,mode ,@style))))
> ```
> We can use `c-ts-mode-indent-style` to customize our indentation.
> However, the function doesn't accept a `mode` parameter, without which
> we cannot determine the current customizing indentation style of what
> language (c/c++).
Isn't the mode available as the value of major-mode?
next prev parent reply other threads:[~2024-07-21 8:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-20 14:10 bug#72223: 31.0.50; c-ts-mode-indent-style custom function should accept a `mode`(c/c++) parameter Meow King via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-21 8:46 ` Eli Zaretskii [this message]
[not found] ` <87h6cjm7ic.fsf@anche.no>
2024-07-21 9:35 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86a5ibcetv.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=72223@debbugs.gnu.org \
--cc=mr.meowking@anche.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).