From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: flyspell-prog-mode, flyspell-mode and different dictionary Date: Tue, 23 Jul 2024 14:41:10 +0300 Message-ID: <865xsw9vzd.fsf@gnu.org> References: <87cyn4s7y2.fsf@k-7.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16688"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 23 13:41:56 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sWDty-0004AY-OM for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 23 Jul 2024 13:41:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWDtS-0002lY-MT; Tue, 23 Jul 2024 07:41:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWDtJ-0002a9-1K for help-gnu-emacs@gnu.org; Tue, 23 Jul 2024 07:41:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWDtI-00047o-P8 for help-gnu-emacs@gnu.org; Tue, 23 Jul 2024 07:41:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ZVu0Wxw9llIr3lWxrtmOdM/7DvDh8p2Bu3KSVIymyY0=; b=grAq703hhnRYyFKUiZs/ j722LroBZoYLEsaP8u7O85fgloJUW7ji5B/ZcwxwFeJJf2YaSojdS60BmG6g6tvlLIOf2TkLthbVr G5cDDprcOyfgcaddqXOvAnxdyBEnJ1zc+I8QwGlfney9nGyoNL/szTI+X1AQHWAaU3SfYUhRZTOR8 WzkpnQtBqn3sTWFWz6U/9Qu9xfOQ6t1k/mLwZiBufoPalqCwbnQiU7v3ptYW/JgCsqDA1ThrsOA0s LRy3+pV6N5gpLgQLfX1/3PpO8S7qIXcRQd/M63OSQKSRtv0QYlIVXH2d0byVTiQPOBL3YTnULqwGr EFa5hO0wfkPDdA==; In-Reply-To: <87cyn4s7y2.fsf@k-7.ch> (message from =?utf-8?Q?S=C3=A9bastie?= =?utf-8?Q?n?= Gendre on Tue, 23 Jul 2024 12:45:25 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147312 Archived-At: > From: Sébastien Gendre > Date: Tue, 23 Jul 2024 12:45:25 +0200 > > Or is the only solution is to attach a lambda function, to prog-mode-hook, > that will call flyspell-prog-mode and ispell-change-dictionary like > this: > > (add-hook 'prog-mode-hook > '(lambda () > (flyspell-prog-mode t) > (ispell-change-dictionary "english"))) I don't know if this is the _only_ solution, but it is certainly a valid solution. (Of course, the hook doesn't have to be a lambda-function, it could be a named function.)