GNU bug report logs - #36317
[PATCH] Correct the name part of defun-prompt-regex in sh-script-mode

Previous Next

Package: emacs;

Reported by: Ola Nilsson <ola.nilsson <at> gmail.com>

Date: Thu, 20 Jun 2019 23:18:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Richard Stallman <rms <at> gnu.org>
To: Ola Nilsson <ola.nilsson <at> gmail.com>
Cc: 36317 <at> debbugs.gnu.org, ola.nilsson <at> gmail.com
Subject: bug#36317: [PATCH] Correct the name part of defun-prompt-regex in sh-script-mode
Date: Sat, 22 Jun 2019 00:13:01 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > POSIX.1-2017 defines that functions should have a name that
  > 'consisting solely of underscores, digits, and alphabetics from the
  > portable character set'.

Ok.

			      Make sure the name part of
  > defun-prompt-regexp starts with a letter and allows underscores.

It should try to recognize anything that POSIX says is valid.
However, rejecting something just because POSIX says it is invalid
is a non-goal.

If the names that POSIX does not like actually work in some shells,
that is an _extension_.  Maybe some users use that extension.  If they
do use it, Emacs should highlight their code right.

Maybe shells don't support such function names.  If so, maybe the
change not to highlight them is good -- maybe.  Highlighting erroneous
function names might be helpful for the user.  When person runs the
script, and gets an error, person will change the name.  Until then,
highlighting the name during editing might still be helpful.

The point is, do not leap straight from "POSIX says this is invalid"
to "Emacs should not recognize it."  That is not the right way to
think about questions like this.

In the GNU Project, we treat standards as guides, not authorities.  We
follow standards when and as that serves users; we do not "obey" them.

See the GNU Coding Standards, section Non-GNU Standards.


-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






This bug report was last modified 5 years and 329 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.