LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-09-2016, 09:53 AM   #1
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
Question Emacs users about Slackware 14.2


Hi,

I've upgraded recenty to -current (14.2), and as an avid emacs user, I found out that auto-indentation have changed since emacs from 14.1 and older.

I noticed that while BASH scripting. Example, something like:
Code:
[[ <sometest> ]] \
    && echo yes \
    || echo no
Is now auto-indented as:
Code:
[[ <sometest> ]] \
    && echo yes \
        || echo no
It's not a real big deal, but it creates inconsistencies with the existing code base.

I tried a quick google investigation about that topic but couldn't find any "emacs specific" article about this default change.

Does any of you, using emacs encountered that too ? And did you try to 'rollback' to the previous style ? (And succeeded ).

Just asking before eventually going into deeper (and boring) investigations.

Thanks,

Garry.

Last edited by NoStressHQ; 02-09-2016 at 09:55 AM. Reason: Fixed a couple of mistakes...
 
Old 02-09-2016, 07:49 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Ctrl-h m will bring up documentation on Shell-script mode. Notice the entry for Ctrl-c >
Code:
Shell-script mode defined in `sh-script.el':
Major mode for editing shell scripts.
This mode works for many shells, since they all have roughly the same syntax,
as far as commands, arguments, variables, pipes, comments etc. are concerned.
Unless the file's magic number indicates the shell, your usual shell is
assumed.  Since filenames rarely give a clue, they are not further analyzed.

This mode adapts to the variations between shells (see `sh-set-shell') by
means of an inheritance based feature lookup (see `sh-feature').  This
mechanism applies to all variables (including skeletons) that pertain to
shell-specific features.

The default style of this mode is that of Rosenblatt's Korn shell book.
The syntax of the statements varies with the shell being used.  The
following commands are available, based on the current shell's syntax:

C-c C-c	 case statement
C-c C-f	 for loop
C-c (	 function definition
C-c TAB	 if statement
C-c C-l	 indexed loop from 1 to n
C-c C-o	 while getopts loop
C-c C-r	 repeat loop
C-c C-s	 select loop
C-c C-u	 until loop
C-c C-w	 while loop

For sh and rc shells indentation commands are:
C-c ?	Show the variable controlling this line's indentation.
C-c =	Set then variable controlling this line's indentation.
C-c <	Change the indentation variable so this line
would indent to the way it currently is.
C-c >  Set the indentation variables so the
buffer indents as it currently is indented.


DEL	 Delete backward one position, even if it was a tab.
M-e	 Go to end of successive commands.
M-a	 Go to beginning of successive commands.
C-c :	 Set this buffer's shell, and maybe its magic number.
C-M-x	 Have optional header and region be executed in a subshell.

`sh-electric-here-document-mode' controls whether insertion of two
unquoted < insert a here document.

If you generally program a shell different from your login shell you can
set `sh-shell-file' accordingly.  If your shell's file name doesn't correctly
indicate what shell it is use `sh-alias-alist' to translate.

If your shell gives error messages with line numbers, you can use C-c C-x
with your script for an edit-interpret-debug cycle.

In addition to any hooks its parent mode `prog-mode' might have run,
this mode runs the hook `sh-mode-hook', as the final step
during initialization.
 
4 members found this post helpful.
Old 02-10-2016, 04:02 AM   #3
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Original Poster
Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by Richard Cranium View Post
Ctrl-h m will bring up documentation on Shell-script mode. Notice the entry for Ctrl-c >
Thanks, I'll look at this.

Cheers

Garry.
 
Old 02-10-2016, 06:17 PM   #4
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by NoStressHQ View Post
I've upgraded recently to -current (14.2), and as an avid emacs user, I found out that auto-indentation have changed since emacs from 14.1 and older.
Perhaps it's a setting in your init file? Does the problem exist when you start emacs without your custom settings?

Code:
emacs -nw -q --no-site-file
 
Old 02-11-2016, 02:14 AM   #5
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Original Poster
Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by gezley View Post
Perhaps it's a setting in your init file? Does the problem exist when you start emacs without your custom settings?

Code:
emacs -nw -q --no-site-file
I don't tweak emacs at all, I'm in the Slackware "way": vanilla (almost) everything...

I tend to work on many workstations, even on other people ones, so I don't rely on "personal customisations", or keep that to the minimal...

Unless... Unless here where it seems I'll have to tweak the indentation .

Edit: sorry maybe you were talking about the "emacs system wide init". I'll check that.
 
Old 02-11-2016, 07:05 AM   #6
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
There were various code changes in the sh-script elisp file.
 
Old 02-11-2016, 08:28 AM   #7
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Original Poster
Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by Richard Cranium View Post
There were various code changes in the sh-script elisp file.
I thought about diffing the two packages version (between 14.1 and current) but didn't yet took the time to do it. It's not a blocking problem for now so I was just asking if a "quick info" was available, eventually I might just dig into the package diff...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get emacs -nw when I call emacs from a terminal but GUI emacs elsewhere? Blackened Justice Linux - Newbie 4 09-08-2011 07:57 AM
C-right in emacs 21.4.1 (slackware 10.2) bramadams Slackware 1 12-16-2005 01:37 PM
emacs users?? alaios Linux - Software 11 08-19-2005 04:55 AM
I can't decide.... EMACS users beware... Squall General 1 03-29-2004 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration