Commits

Anonymous committed a16fcbd

Fix sh-mode function: derive from a real mode

Comments (0)

Files changed (2)

+2007-02-06  Didier Verna  <didier@xemacs.org>
+
+	* sh-script.el (sh-mode): Derive from a real mode
+	(fundamental-mode), not from nil.
+
 2005-10-18  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.21 released.
 2005-10-12  Jérôme Marant  <jmarant@free.fr>
 
 	* sh-script.el: Sync with GNU Emacs 21.4
-        Update FSF's address in GPL notices.
+	Update FSF's address in GPL notices.
 	(sh-mode-map): Move menu-related code to sh-mode-menu.
 	(sh-mode-menu): New menu definition.
 	(sh-mode): Install menu.
 2002-03-02  Jeff Miller <jmiller@cablespeed.com>
 
 	* executable.el:  missing autoload cookie.
-    
+
 2000-07-11  Jose Romildo Malaquias <romildo@urano.iceb.ufop.br>
 
 	* sh-script.el: Synch with FSF 20.7.
 1999-05-31  Andy Piper  <andyp@parallax.co.uk>
 
 	* sh-script.el (sh-set-shell): don't include the extension in
- 	sh-shell name.  This is almost never the right thing and breaks
- 	font-lock.
+	sh-shell name.  This is almost never the right thing and breaks
+	font-lock.
 
 1998-05-12  Andy Piper  <andyp@parallax.co.uk>
 
 	problems.
 
 	* Makefile: Created.
-
 ;;   syntactically distinguishing those from `'' strings.
 
 ;;		Indentation
-;;	 	===========
+;;		===========
 ;; Indentation for rc and es modes is very limited, but for Bourne shells
 ;; and its derivatives it is quite customizable.
 ;;
 ;; By changing this one variable you can increase or decrease how much
 ;; indentation there is.  Valid symbols:
 ;;
-;; 	+   Indent right by sh-basic-offset
-;; 	-   Indent left  by sh-basic-offset
-;; 	++  Indent right twice sh-basic-offset
-;; 	--  Indent left  twice sh-basic-offset
-;; 	*   Indent right half sh-basic-offset
-;; 	/   Indent left  half sh-basic-offset.
+;;	+   Indent right by sh-basic-offset
+;;	-   Indent left  by sh-basic-offset
+;;	++  Indent right twice sh-basic-offset
+;;	--  Indent left  twice sh-basic-offset
+;;	*   Indent right half sh-basic-offset
+;;	/   Indent left  half sh-basic-offset.
 ;;
 ;; There are 4 commands to help set the indentation variables:
 ;;
 ;;    `sh-learn-buffer-indent' on a small region of the buffer should
 ;;    suffice.
 ;;
-;; 	Saving indentation values
-;; 	-------------------------
+;;	Saving indentation values
+;;	-------------------------
 ;; After you've learned the values in a buffer, how to you remember
 ;; them?   Originally I had hoped that `sh-learn-buffer-indent'
 ;; would make this unnecessary;  simply learn the values when you visit
 ;; to reload them in another buffer or at another point in time.
 ;;
 ;; Use `sh-name-style' to give a name to the indentation settings of
-;; 	the current buffer.
+;;	the current buffer.
 ;; Use `sh-load-style' to load indentation settings for the current
-;; 	buffer from a specific style.
+;;	buffer from a specific style.
 ;; Use `sh-save-styles-to-buffer' to write all the styles to a buffer
-;; 	in lisp code.  You can then store it in a file and later use
-;; 	`load-file' to load it.
+;;	in lisp code.  You can then store it in a file and later use
+;;	`load-file' to load it.
 ;;
-;; 	Indentation variables - buffer local or global?
-;; 	----------------------------------------------
+;;	Indentation variables - buffer local or global?
+;;	----------------------------------------------
 ;; I think that often having them buffer-local makes sense,
 ;; especially if one is using `sh-learn-buffer-indent'.  However, if
 ;; a user sets values using customization, these changes won't appear
 ;;
 ;; This may be awkward, but the intent is to cover all cases.
 ;;
-;; 	Awkward things, pitfalls
-;; 	------------------------
+;;	Awkward things, pitfalls
+;;	------------------------
 ;; Indentation for a sh script is complicated for a number of reasons:
 ;;
 ;; 1. You can't format by simply looking at symbols, you need to look
 ;;    status.  This is for cases where the buffer started read-only buffer
 ;;    but the user issued `toggle-read-only'.
 ;;
-;; 	Bugs
-;; 	----
+;;	Bugs
+;;	----
 ;; - Indenting many lines is slow.  It currently does each line
 ;;   independently, rather than saving state information.
 ;;
 	       (ksh . pdksh)))
 	 ;; for the time being
 	 '((ksh . ksh88)
-           (bash2 . bash)
+	   (bash2 . bash)
 	   (sh5 . sh)))
   "*Alist for transforming shell names to what they really are.
 Use this where the name of the executable doesn't correspond to the type of
 (put 'sh-mode 'mode-class 'special)
 
 ;;;###autoload
-(define-derived-mode sh-mode nil "Shell-script"
+(define-derived-mode sh-mode fundamental-mode "Shell-script"
   "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.
 	  (skip-chars-forward " \t")
 	  (setq this-kw (sh-get-kw)))
 
-        ;; Handle "this" keyword:  first word on the line we're
+	;; Handle "this" keyword:  first word on the line we're
 	;; calculating indentation info for.
 	(if this-kw
 	    (if (setq val (sh-check-rule 1 this-kw))
 ;;       (goto-char (point-max))
 ;;       (insert "(setq\n")
 ;;       (while p
-;; 	(insert (format "  %s %s \n"
-;; 			(nth 0 (car p)) (nth 1 (car p))))
-;; 	(setq p (cdr p)))
+;;	(insert (format "  %s %s \n"
+;;			(nth 0 (car p)) (nth 1 (car p))))
+;;	(setq p (cdr p)))
 ;;       (insert ")\n")
 ;;       )))
 ;;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.