From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aDBaMLpJX2AYgAAAgWs5BA (envelope-from ) for ; Sat, 27 Mar 2021 16:05:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id tp0LK7pJX2BofwAAbx9fmQ (envelope-from ) for ; Sat, 27 Mar 2021 15:05:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4278C1E74C for ; Sat, 27 Mar 2021 16:05:30 +0100 (CET) Received: from localhost ([::1]:36676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQAVF-0006FY-6Q for larch@yhetil.org; Sat, 27 Mar 2021 11:05:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQAUp-0006FS-NA for emacs-orgmode@gnu.org; Sat, 27 Mar 2021 11:05:03 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:39634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQAUo-0004z7-7Z for emacs-orgmode@gnu.org; Sat, 27 Mar 2021 11:05:03 -0400 Received: by mail-ej1-x62f.google.com with SMTP id ce10so12787971ejb.6 for ; Sat, 27 Mar 2021 08:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:reply-to:message-id:date:mime-version; bh=t/3Txf8u51hVlT2+4UWGrXfb9Ty9W83d298ivSKU8Hk=; b=SnziDyrC55CGzQtq11MEgQeDwwype8/OH7QAn46FLFPr71RHNvaPoWyAh5BwETFAyN B0itvhVJyLSDViMQ+WzZBYHhY9ubPamtGVuxTGoAK/HTU+lbeveP+2bJCAESRBXD5jMB w8plYSoPE/GYESjdL/QKIbJL4Tygvkf3tubKMfhLg9vLtXk4QC0RuV54f1mbrsECnOc0 DBInVHzuzqQt5LaImyluh5Jc7DQ8/jK6saFr0GAIOoErAsDlZ4zUWJXpyX1VtW3WyhxG spY3bK2YDdUO1zOkhYp+Ded9ZJE8zRLMlD0rD14bLOdE9PkTSq3+jYMcjXn7NU3ssF0T up6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:reply-to:message-id :date:mime-version; bh=t/3Txf8u51hVlT2+4UWGrXfb9Ty9W83d298ivSKU8Hk=; b=HT/nSennycK8BRc2xxFYbHmFbRoTZM4oduuGWvRz6NRNIBlxznwnRo9YNUkFNTQBT8 VTV0vVP08KrkfcupArlzz4xvLmXN8CxuNTaxooYPZwG7iyjEb/0hWExFrnKUCREdYJZ3 H+kE4aIs0o83IaTamA0WABh7XYhkxOdUoBClPBdbEnSvroMcRFuJXkzOwj1rjeP6DdAd nGFTlFEjTteUMc4fC+PqFG/lhu+vXKsuQ0KW4EJXTJMzU1miNxgRhfZ/qiDLHTgW3ZOa pKk1MF148YTLTuzlAe+DGxGs9XKIEA1Pb2bVSc76hyLm/vxhg4MoQBY09/2mV+BOKkYt rMGQ== X-Gm-Message-State: AOAM533Z/3mKiHUiHCYo+eagddKkHpgG6caB6dKU+SJM/fnkl4W7McXd aZXt2qTVByF6EwSLS3H2iL3Cxz6iO6vVZQ== X-Google-Smtp-Source: ABdhPJy4/JfEKuU2vUx4X3AHzliq3h7Uesgqw3i3GVyOVWwy9bONgfBuI905AjQjPCEnmyKXOb4mPQ== X-Received: by 2002:a17:906:51c3:: with SMTP id v3mr20785849ejk.497.1616857500144; Sat, 27 Mar 2021 08:05:00 -0700 (PDT) Received: from huette ([5.146.118.192]) by smtp.gmail.com with ESMTPSA id ho19sm5213357ejc.57.2021.03.27.08.04.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Mar 2021 08:04:59 -0700 (PDT) User-agent: mu4e 1.4.15; emacs 27.2 From: Sebastian Miele To: emacs-orgmode@gnu.org Subject: Bug: ("bash" . sh) in default value of org-src-lang-modes Message-ID: <87eeg0tz6t.fsf@gmail.com> Date: Sat, 27 Mar 2021 16:04:58 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=sebastian.miele@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sebastian.miele@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616857530; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=t/3Txf8u51hVlT2+4UWGrXfb9Ty9W83d298ivSKU8Hk=; b=gkEB9kb43xwEmv9T7Anvpqw70Vcu8ZLXreAdk1FKSgSb8c+FPJnm3qCPiCBl/MhTL7mQ7a AoGtJzysCzlDz2IQIakYju6q+Pade4uQvo+liL8AHLMTELgSkf/EYee2TN951yr73eqGK/ nbNfeGOm+zAj2+8eeoA/Zu+HZLWqh47rPVkCpCSbYsS3yGYYDCgbuA9Yu0vX0XDvT4dp3E U7nEUzT6CeRZibimU4n2FTpeWRCDgURCOc4/YO6y26mB4jFGrPNDEw8lVAye2uPHEyGrIb CIEDtLnHCM9e63pQwVRYwpIoNkrD6OhsZlP5zWPtPIRWCpClCM6jqaqMEo7TyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616857530; a=rsa-sha256; cv=none; b=FqTQuvmCVpap+/Ulbjqhb5BX8MHzyLd5qSfHW+soC59GjZXjkuWYXyX6YAT2zib1VjQRyp HDOQd/ZnvtCU3EHfcj+iSjo05wzsV0qJW0RszTZX39Mmzv+gVoSuWFuyxsjQSQpVCWk25o E8kEoofNYkypYQwAOt/OUDUV00aYRauIwrrCDqiG7So9YBSrgM0ggHpCDUAxgaBDEScct1 GRUHdb397TkIdp6S/FGVvzu8jbl0Xfp/h5BU+rgtCbJ1yX2JCbIgOb/yMJrClz8WLn2Ifn 6ZjfsZMDtJjSCUyfUVh7azdb/E36KTAi20Jpl9e1bXv5vzR8bBzp09ayiDUwnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=SnziDyrC; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=SnziDyrC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 4278C1E74C X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: VUH+pTQR580n Hello! The default value of org-src-lang-modes contains ("bash" . sh), meaning that for bash src blocks sh-mode gets used. sh-mode supports many different languages (bash, zsh, dash, ...). Often, when opening a file for which sh-mode gets activated, there is enough information for sh-mode to determine the language that actually is used in the file, e.g., by a shebang, or by the suffix of the filename. However, that usually does not work with Org src blocks. When sh-mode has no clues, it in effect always uses the language determined by the SHELL environment variable (at least on POSIX-conformant systems). If that is not something like /bin/bash then sh-mode is not a bash mode. E.g., with SHELL=/bin/zsh opening an edit buffer for #+BEGIN_SRC bash #+END_SRC yields a buffer with the buffer-local variable sh-shell set to zsh instead of bash, i.e., sh-shell is a zsh mode. This can be fixed by defining something like (defun org-babel-bash-mode () (sh-mode) (sh-set-shell "bash")) and having ("bash" . org-babel-bash) in the default value of org-src-lang-mode. Best wishes Sebastian