;;; dcl-mode.el --- major mode for editing DCL command files
-;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2011 Free Software Foundation, Inc.
;; Author: Odd Gripenstam <gripenstamol@decus.se>
;; Maintainer: Odd Gripenstam <gripenstamol@decus.se>
dcl-block-begin-regexp
dcl-block-end-regexp
Regexps that match command lines that begin and end, respectively,
- a block of commmand lines that will be given extra indentation.
+ a block of command lines that will be given extra indentation.
Command lines between THEN-ELSE-ENDIF are always indented; these variables
make it possible to define other places to indent.
Set to nil to disable this feature.
(defun dcl-end-of-command ()
"Move point to end of current command or next command if not on a command."
(interactive)
- (let ((type (dcl-get-line-type))
- (start (point)))
+ (let ((type (dcl-get-line-type)))
(if (or (eq type '$)
(eq type '-))
(progn
(setq done t) ; not a label-only line, exit the loop
(setq retval (point))))
;; We couldn't go further back, and we haven't found a command yet.
- ;; Return to the start positionn
+ ;; Return to the start position.
(goto-char start)
(setq done t)
(setq retval nil)))
(setq done t) ; not a label-only line, exit the loop
(setq retval (point)))))
;; We couldn't go further back, and we haven't found a command yet.
- ;; Return to the start positionn
+ ;; Return to the start position.
(goto-char start)
(setq done t)
(setq retval nil)))
;;;---------------------------------------------------------------------------
(defun dcl-calc-command-indent-multiple
- (indent-type cur-indent extra-indent last-point this-point)
+ (indent-type cur-indent extra-indent _last-point _this-point)
"Indent lines to a multiple of dcl-basic-offset.
Set dcl-calc-command-indent-function to this function to customize
;;;---------------------------------------------------------------------------
-(defun dcl-calc-cont-indent-relative (cur-indent extra-indent)
+(defun dcl-calc-cont-indent-relative (_cur-indent _extra-indent)
"Indent continuation lines to align with words on previous line.
Indent continuation lines to a position relative to preceding
;;;-------------------------------------------------------------------------
-(defun dcl-option-value-basic (option-assoc)
+(defun dcl-option-value-basic (_option-assoc)
"Guess a value for basic-offset."
(save-excursion
(dcl-beginning-of-command)
;;;-------------------------------------------------------------------------
-(defun dcl-option-value-offset (option-assoc)
+(defun dcl-option-value-offset (_option-assoc)
"Guess a value for an offset.
Find the column of the first non-blank character on the line.
Returns the column offset."
;;;-------------------------------------------------------------------------
-(defun dcl-option-value-margin-offset (option-assoc)
+(defun dcl-option-value-margin-offset (_option-assoc)
"Guess a value for margin offset.
Find the column of the first non-blank character on the line, not
counting labels.
;;;-------------------------------------------------------------------------
-(defun dcl-option-value-comment-line (option-assoc)
+(defun dcl-option-value-comment-line (_option-assoc)
"Guess a value for `dcl-comment-line-regexp'.
Must return a string."
;; Should we set comment-start and comment-start-skip as well?
(if (eolp) (error "Missing colon in local variables entry"))
(skip-chars-backward " \t")
(let* ((str (buffer-substring beg (point)))
- (found-var (read str))
- val)
+ (found-var (read str)))
;; Setting variable named "end" means end of list.
(if (string-equal (downcase str) "end")
(progn
;;;-------------------------------------------------------------------------
+(with-no-warnings
+ ;; Dynamically bound in `dcl-save-mode'.
+ (defvar mode))
+
(defun dcl-save-mode ()
"Save the current mode for this buffer.
Save the current mode in a `Local Variables:'
(interactive)
(let ((mode (prin1-to-string major-mode)))
(if (string-match "-mode$" mode)
- (let ((mode (intern (substring mode 0 (match-beginning 0)))))
+ (let ((mode (intern (substring mode 0 (match-beginning 0)))))
(dcl-save-option 'mode))
(message "Strange mode: %s" mode))))