all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 43324@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#43324: Auto-indenting csh/tcsh shell scripts [emacs-28]
Date: Mon, 6 Jun 2022 12:44:35 -0400	[thread overview]
Message-ID: <CAFyQvY2qM_rvi2RBNebZzadj+RZxNJ3_qFMzKQR88reTET+RQg@mail.gmail.com> (raw)
In-Reply-To: <875yldsqzm.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]

On Mon, Jun 6, 2022 at 12:20 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
> Does this mean that indentation doesn't work for tcsh in
> shell-script-mode?  I had a brief look at a tcsh script and did some
> indentation, and it seemed to work OK for me.
>
> What are the bits that are missing?

Hi Lars,

Thank you for following up on this. tcsh script indentation is still
broken on the 28.1 release for me.

Here's a GIF recording (attached with this email) showing me opening a
tcsh script in emacs -Q and attempting to auto-indent the whole buffer
and also a region. Both mess up the whole indentation.


Example script:

=====
#!/bin/tcsh -f
# Time-stamp: <2015-05-22 10:30:53 kmodi>

# This script splits the pane depending on the current panes height and width
# The result is to not result in too narrow or too wide panes after split

set pane_height=`tmux display -p -F '#{pane_height}'`
set pane_width=`tmux display -p -F '#{pane_width}'`
# echo "Pane Height = $pane_height"
# echo "Pane Width  = $pane_width"

# for the small Dell monitor when the terminal is full screen
# Small Dell monitor resolution = 1600 x 1200
#  width in chars = 174, height in chars = 59
# Normalize the pane height and width (resolution/char)
set height_factor = `expr 1200 / 59`
set width_factor  = `expr 1600 / 174`
set pane_height_norm = `expr $pane_height \* $height_factor`
set pane_width_norm  = `expr $pane_width  \* $width_factor`
# echo "Pane Height factor = $height_factor"
# echo "Pane Width factor  = $width_factor"
# echo "Pane Height normalized = $pane_height_norm"
# echo "Pane Width  normalized = $pane_width_norm"

if ( $pane_width_norm > $pane_height_norm ) then
   tmux split-window -h "$*" # splits current pane vertically
else
   tmux split-window -v "$*" # splits current pane horizontally
endif
=====

[-- Attachment #2: tcsh_auto_indentation.gif --]
[-- Type: image/gif, Size: 23779 bytes --]

  reply	other threads:[~2022-06-06 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11  3:25 bug#43324: Auto-indenting csh/tcsh shell scripts [emacs-28] Kaushal Modi
2022-06-06 16:20 ` Lars Ingebrigtsen
2022-06-06 16:44   ` Kaushal Modi [this message]
2022-06-06 16:58     ` Kaushal Modi
2022-06-07  9:20     ` Lars Ingebrigtsen
2022-06-06 17:03   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY2qM_rvi2RBNebZzadj+RZxNJ3_qFMzKQR88reTET+RQg@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=43324@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.