From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Douglas Lewan Newsgroups: gmane.emacs.help Subject: Re: Turning off sh-electric-here-document-mode? Date: Wed, 13 May 2020 10:00:26 -0400 Message-ID: <9543d2b3-4b7a-ef7e-78db-46d36900d82f@gmail.com> References: <24a35cbe-f315-d95b-218b-6849d69954b1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="109883"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: help-gnu-emacs To: Philipp Stephani Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 13 16:01:01 2020 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 1jYrwS-000SQQ-US for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 13 May 2020 16:01:00 +0200 Original-Received: from localhost ([::1]:46984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYrwR-0008SV-Vb for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 13 May 2020 10:00:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYrw0-0008RY-Es for help-gnu-emacs@gnu.org; Wed, 13 May 2020 10:00:32 -0400 Original-Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:38093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYrvz-0002YI-CS for help-gnu-emacs@gnu.org; Wed, 13 May 2020 10:00:32 -0400 Original-Received: by mail-qk1-x72e.google.com with SMTP id f189so11702312qkd.5 for ; Wed, 13 May 2020 07:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=uhsARFyDAzpB+m0WbY8KdDE6YOdxx2y+mG7ljHh9D+U=; b=rd8SSSlt3n4ffLryESzuqibl8kGgMNggcMUvl7z+bC0vK7LyJIvT1N3Cntfu0fhk9I Hs7qnV6wqAhcY8tMV3O+gAliLyUXgm6hlbNEXAyxk0m0XA0Tb87s4A0BQzbo2wA2QoqK CUFpNHjdbqfU9DSr0W7CKz/1mxmddG2oKeQr+Jx1Tpz6fUlcrsGZ/OdnHuMQIkYOs5fo LQCIYD2Kq2NWXqz6IjCqYY+VYISA9MAcgwy12aVLfBjizLQBZ+XQQtzKnbx/juBscx7I zs5kqDETnIIcKbAyId09o8znyLDK/rgvHIKcqwEsIdSappF4q6D/RAbBsAlO3igN34mj DZug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=uhsARFyDAzpB+m0WbY8KdDE6YOdxx2y+mG7ljHh9D+U=; b=DGNJyV5Zg9Uyll80BqeCtjmAMEvqJGt2K9M911YWcfeBnu8JqpaZ5Q6URdTicKXWoZ nzcwks4+MCeI/LIJh1utfj7EejiLvcmh3mLtG44CiupaZcN+pYvViJVpBcf0Wx/q35Lp CaIcfaVMMs6q2UvDLqYGXd4W4r0P7/V8oDQyCS9IPRGgpTatQ/8KK1yZa/PYgtQtWyiF MRLqqh6rxJFbE/J9og0HXVOu4xoueRzeUhifdZkEs0WWeAw53D5zvZl6iSm+Fy3GapF7 o5l5HxQheq2uncvZ56Brj30VQbdZik/qhDW0eqn46is/DD8RSIpma9wzsKYBsABBJhzR RcFA== X-Gm-Message-State: AGi0PuaxiYKETJD8Nqb/9BGGU1GM9/hGCjwS/cTdmGJXhL9rlgtPK3m3 RAItOMOq06nHUr0q8bPVxjBWroU= X-Google-Smtp-Source: APiQypJNbDx6YE0iiwNbHAYN8offREvKVG6Bnpnmw2ouiMP62WMzS3hhkg3MKyhGU2sORsVMrhjepA== X-Received: by 2002:a37:b303:: with SMTP id c3mr25291572qkf.397.1589378429740; Wed, 13 May 2020 07:00:29 -0700 (PDT) Original-Received: from [192.168.43.104] ([172.58.236.2]) by smtp.gmail.com with ESMTPSA id b129sm12135839qkc.58.2020.05.13.07.00.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2020 07:00:28 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=d.lewan2000@gmail.com; helo=mail-qk1-x72e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.help:123083 Archived-At: On 5/13/20 7:22 AM, Philipp Stephani wrote: > Am Mi., 13. Mai 2020 um 02:51 Uhr schrieb Douglas Lewan : >> OK. I'm sure I'm missing something obvious here. >> >> I want to turn off sh-electric-here-document-mode, but all the obvious >> things seem to fail. I've put every one of the following in my .emacs, >> but I still get here-documents in shell-script-mode. >> >> (sh-electric-here-document-mode nil) >> >> (sh-electric-here-document-mode 0) >> >> (sh-electric-here-document-mode -1) >> >> (sh-electric-here-document-mode) >> >> How do I do this? Thanks in advance. >> > > It's a local mode, so all of those will only enable it in whatever > buffer is current while evaluating your ~/.emacs (probably the scratch > buffer). You need to customize sh-mode-hook instead. Indeed, that's where I started. My current .emacs contains the following code: (add-hook 'sh-mode-hook (lambda ()       (setq sh-electric-here-document-mode nil))) Here's the documentation for the variable sh-electric-here-document-mode: sh-electric-here-document-mode is a variable defined in `sh-script.el'. Its value is nil Local in buffer aaa.sh; global value is the same.   Automatically becomes buffer-local when set. Documentation: Non-nil if Sh-Electric-Here-Document mode is enabled. Use the command `sh-electric-here-document-mode' to change this variable. It's that last line that led me to try the code samples I originally posted. However, looking at its source, it's just setting sh-mode-hook, which is essentially what Philipp Stephani suggested. I should have mentioned this in the original post: emacs version 24.5. (I know I'm a bit out of date. Has this changed?) -- ,Doug d.lewan2000@gmail.com (908) 720 7908 "Lie and deny." It's very popular these days.