/[emacs]/emacs/lisp/progmodes/sh-script.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/sh-script.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.104 by rms, Sun Nov 11 20:07:46 2001 UTC revision 1.105 by rms, Sun Nov 18 06:50:58 2001 UTC
# Line 1660  region, clear header." Line 1660  region, clear header."
1660    (eq -1 (% (save-excursion (skip-chars-backward "\\\\")) 2)))    (eq -1 (% (save-excursion (skip-chars-backward "\\\\")) 2)))
1661    
1662  ;; Indentation stuff.  ;; Indentation stuff.
 (defun sh-must-be-shell-mode ()  
   "Signal an error if not in Shell-script mode."  
   (unless (derived-mode-p 'sh-mode)  
     (error "This buffer is not in Shell-script mode")))  
   
1663  (defun sh-must-support-indent ()  (defun sh-must-support-indent ()
1664    "*Signal an error if the shell type for this buffer is not supported.    "*Signal an error if the shell type for this buffer is not supported.
1665  Also, the buffer must be in Shell-script mode."  Also, the buffer must be in Shell-script mode."
   (sh-must-be-shell-mode)  
1666    (unless sh-indent-supported-here    (unless sh-indent-supported-here
1667      (error "This buffer's shell does not support indentation through Emacs")))      (error "This buffer's shell does not support indentation through Emacs")))
1668    
# Line 1680  variable `sh-make-vars-local' has been s Line 1674  variable `sh-make-vars-local' has been s
1674  To revert all these variables to the global values, use  To revert all these variables to the global values, use
1675  command `sh-reset-indent-vars-to-global-values'."  command `sh-reset-indent-vars-to-global-values'."
1676    (interactive)    (interactive)
   (sh-must-be-shell-mode)  
1677    (mapcar 'make-local-variable sh-var-list)    (mapcar 'make-local-variable sh-var-list)
1678    (message "Indentation variable are now local."))    (message "Indentation variable are now local."))
1679    
# Line 1688  command `sh-reset-indent-vars-to-global- Line 1681  command `sh-reset-indent-vars-to-global-
1681    "Reset local indentation variables to the global values.    "Reset local indentation variables to the global values.
1682  Then, if variable `sh-make-vars-local' is non-nil, make them local."  Then, if variable `sh-make-vars-local' is non-nil, make them local."
1683    (interactive)    (interactive)
   (sh-must-be-shell-mode)  
1684    (mapcar 'kill-local-variable sh-var-list)    (mapcar 'kill-local-variable sh-var-list)
1685    (if sh-make-vars-local    (if sh-make-vars-local
1686        (mapcar 'make-local-variable sh-var-list)))        (mapcar 'make-local-variable sh-var-list)))
# Line 2147  If INFO is supplied it is used, else it Line 2139  If INFO is supplied it is used, else it
2139    "Back to end of previous non-comment non-empty line.    "Back to end of previous non-comment non-empty line.
2140  Go to beginning of logical line unless END is non-nil, in which case  Go to beginning of logical line unless END is non-nil, in which case
2141  we go to the end of the previous line and do not check for continuations."  we go to the end of the previous line and do not check for continuations."
   (sh-must-be-shell-mode)  
2142    (save-excursion    (save-excursion
2143      (beginning-of-line)      (beginning-of-line)
2144      (forward-comment (- (point-max)))      (forward-comment (- (point-max)))
# Line 2478  If INFO is supplied it is used, else it Line 2469  If INFO is supplied it is used, else it
2469  (defun sh-indent-line ()  (defun sh-indent-line ()
2470    "Indent the current line."    "Indent the current line."
2471    (interactive)    (interactive)
   (sh-must-be-shell-mode)  
2472    (let ((indent (sh-calculate-indent)) shift-amt beg end    (let ((indent (sh-calculate-indent)) shift-amt beg end
2473          (pos (- (point-max) (point))))          (pos (- (point-max) (point))))
2474      (when indent      (when indent

Legend:
Removed from v.1.104  
changed lines
  Added in v.1.105

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26