Commit 31b58798 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

(idlwave): Finish `defgroup' description with period.

parent bdad2e31
;; idlwave.el --- IDL editing mode for GNU Emacs
;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005
;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005
;; Free Software Foundation
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
......@@ -72,7 +72,7 @@
;; of the documentation is available from the maintainers webpage (see
;; SOURCE).
;;
;;
;;
;; ACKNOWLEDGMENTS
;; ===============
;;
......@@ -122,7 +122,7 @@
;; up inserting the character that expanded the abbrev after moving
;; point backward, e.g., "\cl" expanded with a space becomes
;; "LONG( )" with point before the close paren. This is solved by
;; using a temporary function in `post-command-hook' - not pretty,
;; using a temporary function in `post-command-hook' - not pretty,
;; but it works.
;;
;; Tabs and spaces are treated equally as whitespace when filling a
......@@ -173,13 +173,13 @@
nil ;; We've got what we needed
;; We have the old or no custom-library, hack around it!
(defmacro defgroup (&rest args) nil)
(defmacro defcustom (var value doc &rest args)
(defmacro defcustom (var value doc &rest args)
`(defvar ,var ,value ,doc))))
(defgroup idlwave nil
"Major mode for editing IDL .pro files"
"Major mode for editing IDL .pro files."
:tag "IDLWAVE"
:link '(url-link :tag "Home Page"
:link '(url-link :tag "Home Page"
"http://idlwave.org")
:link '(emacs-commentary-link :tag "Commentary in idlw-shell.el"
"idlw-shell.el")
......@@ -293,8 +293,8 @@ extends to the end of the match for the regular expression."
(defcustom idlwave-auto-fill-split-string t
"*If non-nil then auto fill will split strings with the IDL `+' operator.
When the line end falls within a string, string concatenation with the
'+' operator will be used to distribute a long string over lines.
When the line end falls within a string, string concatenation with the
'+' operator will be used to distribute a long string over lines.
If nil and a string is split then a terminal beep and warning are issued.
This variable is ignored when `idlwave-fill-comment-line-only' is
......@@ -358,7 +358,7 @@ usually a good idea.."
Initializing the routine info can take long, in particular if a large
library catalog is involved. When Emacs is idle for more than the number
of seconds specified by this variable, it starts the initialization.
The process is split into five steps, in order to keep possible work
The process is split into five steps, in order to keep possible work
interruption as short as possible. If one of the steps finishes, and no
user input has arrived in the mean time, initialization proceeds immediately
to the next step.
......@@ -410,7 +410,7 @@ t All available
(const :tag "When saving a buffer" save-buffer)
(const :tag "After a buffer was killed" kill-buffer)
(const :tag "After a buffer was compiled successfully, update shell info" compile-buffer))))
(defcustom idlwave-rinfo-max-source-lines 5
"*Maximum number of source files displayed in the Routine Info window.
When an integer, it is the maximum number of source files displayed.
......@@ -443,7 +443,7 @@ value of `!DIR'. See also `idlwave-library-path'."
:group 'idlwave-routine-info
:type 'directory)
(defcustom idlwave-config-directory
(defcustom idlwave-config-directory
(convert-standard-filename "~/.idlwave")
"*Directory for configuration files and user-library catalog."
:group 'idlwave-routine-info
......@@ -458,7 +458,7 @@ value of `!DIR'. See also `idlwave-library-path'."
(defcustom idlwave-special-lib-alist nil
"Alist of regular expressions matching special library directories.
When listing routine source locations, IDLWAVE gives a short hint where
the file defining the routine is located. By default it lists `SystemLib'
the file defining the routine is located. By default it lists `SystemLib'
for routines in the system library `!DIR/lib' and `Library' for anything
else. This variable can define additional types. The car of each entry
is a regular expression matching the file name (they normally will match
......@@ -469,7 +469,7 @@ chars are allowed."
(cons regexp string)))
(defcustom idlwave-auto-write-paths t
"Write out path (!PATH) and system directory (!DIR) info automatically.
"Write out path (!PATH) and system directory (!DIR) info automatically.
Path info is needed to locate library catalog files. If non-nil,
whenever the path-list changes as a result of shell-query, etc., it is
written to file. Otherwise, the menu option \"Write Paths\" can be
......@@ -500,7 +500,7 @@ used to force a write."
This variable determines the case (UPPER/lower/Capitalized...) of
words inserted into the buffer by completion. The preferred case can
be specified separately for routine names, keywords, classes and
methods.
methods.
This alist should therefore have entries for `routine' (normal
functions and procedures, i.e. non-methods), `keyword', `class', and
`method'. Plausible values are
......@@ -587,7 +587,7 @@ certain methods this assumption is almost always true. The methods
for which to assume this can be set here."
:group 'idlwave-routine-info
:type '(repeat (regexp :tag "Match method:")))
(defcustom idlwave-completion-show-classes 1
"*Number of classes to show when completing object methods and keywords.
......@@ -652,7 +652,7 @@ should contain at least two elements: (method-default . VALUE) and
specify if the class should be found during method and keyword
completion, respectively.
The alist may have additional entries specifying exceptions from the
The alist may have additional entries specifying exceptions from the
keyword completion rule for specific methods, like INIT or
GETPROPERTY. In order to turn on class specification for the INIT
method, add an entry (\"INIT\" . t). The method name must be ALL-CAPS."
......@@ -676,7 +676,7 @@ particular object method call. This happens during the commands
value of the variable `idlwave-query-class'.
When you specify a class, this information can be stored as a text
property on the `->' arrow in the source code, so that during the same
property on the `->' arrow in the source code, so that during the same
editing session, IDLWAVE will not have to ask again. When this
variable is non-nil, IDLWAVE will store and reuse the class information.
The class stored can be checked and removed with `\\[idlwave-routine-info]'
......@@ -1056,7 +1056,7 @@ IDL process is made."
:group 'idlwave-misc
:type 'boolean)
(defcustom idlwave-default-font-lock-items
(defcustom idlwave-default-font-lock-items
'(pros-and-functions batch-files idlwave-idl-keywords label goto
common-blocks class-arrows)
"Items which should be fontified on the default fontification level 2.
......@@ -1118,25 +1118,25 @@ As a user, you should not set this to t.")
;;; and Carsten Dominik...
;; The following are the reserved words in IDL. Maybe we should
;; highlight some more stuff as well?
;; highlight some more stuff as well?
;; Procedure declarations. Fontify keyword plus procedure name.
(defvar idlwave-idl-keywords
;; To update this regexp, update the list of keywords and
;; To update this regexp, update the list of keywords and
;; evaluate the form.
;; (insert
;; (insert
;; (prin1-to-string
;; (concat
;; (concat
;; "\\<\\("
;; (regexp-opt
;; (regexp-opt
;; '("||" "&&" "and" "or" "xor" "not"
;; "eq" "ge" "gt" "le" "lt" "ne"
;; "eq" "ge" "gt" "le" "lt" "ne"
;; "for" "do" "endfor"
;; "if" "then" "endif" "else" "endelse"
;; "if" "then" "endif" "else" "endelse"
;; "case" "of" "endcase"
;; "switch" "break" "continue" "endswitch"
;; "begin" "end"
;; "repeat" "until" "endrep"
;; "while" "endwhile"
;; "while" "endwhile"
;; "goto" "return"
;; "inherits" "mod"
;; "compile_opt" "forward_function"
......@@ -1159,7 +1159,7 @@ As a user, you should not set this to t.")
(2 font-lock-reference-face nil t) ; block name
(font-lock-match-c++-style-declaration-item-and-skip-to-next
;; Start with point after block name and comma
(goto-char (match-end 0)) ; needed for XEmacs, could be nil
(goto-char (match-end 0)) ; needed for XEmacs, could be nil
nil
(1 font-lock-variable-name-face) ; variable names
)))
......@@ -1214,7 +1214,7 @@ As a user, you should not set this to t.")
;; All operators (not used because too noisy)
(all-operators
'("[-*^#+<>/]" (0 font-lock-keyword-face)))
;; Arrows with text property `idlwave-class'
(class-arrows
'(idlwave-match-class-arrows (0 idlwave-class-arrow-face))))
......@@ -1251,14 +1251,14 @@ As a user, you should not set this to t.")
(defvar idlwave-font-lock-defaults
'((idlwave-font-lock-keywords
idlwave-font-lock-keywords-1
idlwave-font-lock-keywords-1
idlwave-font-lock-keywords-2
idlwave-font-lock-keywords-3)
nil t
((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w"))
nil t
((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w"))
beginning-of-line))
(put 'idlwave-mode 'font-lock-defaults
(put 'idlwave-mode 'font-lock-defaults
idlwave-font-lock-defaults) ; XEmacs
(defconst idlwave-comment-line-start-skip "^[ \t]*;"
......@@ -1266,7 +1266,7 @@ As a user, you should not set this to t.")
That is the _beginning_ of a line containing a comment delimiter `;' preceded
only by whitespace.")
(defconst idlwave-begin-block-reg
(defconst idlwave-begin-block-reg
"\\<\\(pro\\|function\\|begin\\|case\\|switch\\)\\>"
"Regular expression to find the beginning of a block. The case does
not matter. The search skips matches in comments.")
......@@ -1343,17 +1343,17 @@ blocks starting with a BEGIN statement. The matches must have associations
'(goto . ("goto\\>" nil))
'(case . ("case\\>" nil))
'(switch . ("switch\\>" nil))
(cons 'call (list (concat "\\(" idlwave-variable "\\) *= *"
(cons 'call (list (concat "\\(" idlwave-variable "\\) *= *"
"\\(" idlwave-method-call "\\s *\\)?"
idlwave-identifier
"\\s *(") nil))
(cons 'call (list (concat
(cons 'call (list (concat
"\\(" idlwave-method-call "\\s *\\)?"
idlwave-identifier
idlwave-identifier
"\\( *\\($\\|\\$\\)\\|\\s *,\\)") nil))
(cons 'assign (list (concat
(cons 'assign (list (concat
"\\(" idlwave-variable "\\) *=") nil)))
"Associated list of statement matching regular expressions.
Each regular expression matches the start of an IDL statement. The
first element of each association is a symbol giving the statement
......@@ -1376,7 +1376,7 @@ the leftover unidentified statements containing an equal sign." )
;; Note that this is documented in the v18 manuals as being a string
;; of length one rather than a single character.
;; The code in this file accepts either format for compatibility.
(defvar idlwave-comment-indent-char ?\
(defvar idlwave-comment-indent-char ?\
"Character to be inserted for IDL comment indentation.
Normally a space.")
......@@ -1548,15 +1548,15 @@ Capitalize system variables - action only
(not (equal idlwave-shell-debug-modifiers '())))
;; Bind the debug commands also with the special modifiers.
(let ((shift (memq 'shift idlwave-shell-debug-modifiers))
(mods-noshift (delq 'shift
(mods-noshift (delq 'shift
(copy-sequence idlwave-shell-debug-modifiers))))
(define-key idlwave-mode-map
(define-key idlwave-mode-map
(vector (append mods-noshift (list (if shift ?C ?c))))
'idlwave-shell-save-and-run)
(define-key idlwave-mode-map
(define-key idlwave-mode-map
(vector (append mods-noshift (list (if shift ?B ?b))))
'idlwave-shell-break-here)
(define-key idlwave-mode-map
(define-key idlwave-mode-map
(vector (append mods-noshift (list (if shift ?E ?e))))
'idlwave-shell-run-region)))
(define-key idlwave-mode-map "\C-c\C-d\C-c" 'idlwave-shell-save-and-run)
......@@ -1593,7 +1593,7 @@ Capitalize system variables - action only
(define-key idlwave-mode-map "\M-\C-i" 'idlwave-complete)
(define-key idlwave-mode-map "\C-c\C-i" 'idlwave-update-routine-info)
(define-key idlwave-mode-map "\C-c=" 'idlwave-resolve)
(define-key idlwave-mode-map
(define-key idlwave-mode-map
(if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)])
'idlwave-mouse-context-help)
......@@ -1604,7 +1604,7 @@ Capitalize system variables - action only
; (lambda (char) 0)))
(idlwave-action-and-binding "<" '(idlwave-surround -1 -1))
;; Binding works for both > and ->, by changing the length of the token.
(idlwave-action-and-binding ">" '(idlwave-surround -1 -1 '(?-) 1
(idlwave-action-and-binding ">" '(idlwave-surround -1 -1 '(?-) 1
'idlwave-gtr-pad-hook))
(idlwave-action-and-binding "->" '(idlwave-surround -1 -1 nil 2) t)
(idlwave-action-and-binding "," '(idlwave-surround 0 -1))
......@@ -1638,7 +1638,7 @@ idlwave-mode-abbrev-table unless TABLE is non-nil."
(error (apply 'define-abbrev args)))))
(condition-case nil
(modify-syntax-entry (string-to-char idlwave-abbrev-start-char)
(modify-syntax-entry (string-to-char idlwave-abbrev-start-char)
"w" idlwave-mode-syntax-table)
(error nil))
......@@ -1762,7 +1762,7 @@ idlwave-mode-abbrev-table unless TABLE is non-nil."
(defvar imenu-extract-index-name-function)
(defvar imenu-prev-index-position-function)
;; defined later - so just make the compiler hush
(defvar idlwave-mode-menu)
(defvar idlwave-mode-menu)
(defvar idlwave-mode-debug-menu)
;;;###autoload
......@@ -1847,7 +1847,7 @@ The main features of this mode are
\\i IF statement template
\\elif IF-ELSE statement template
\\b BEGIN
For a full list, use \\[idlwave-list-abbrevs]. Some templates also
have direct keybindings - see the list of keybindings below.
......@@ -1889,26 +1889,26 @@ The main features of this mode are
(interactive)
(kill-all-local-variables)
(if idlwave-startup-message
(message "Emacs IDLWAVE mode version %s." idlwave-mode-version))
(setq idlwave-startup-message nil)
(setq local-abbrev-table idlwave-mode-abbrev-table)
(set-syntax-table idlwave-mode-syntax-table)
(set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action)
(make-local-variable idlwave-comment-indent-function)
(set idlwave-comment-indent-function 'idlwave-comment-hook)
(set (make-local-variable 'comment-start-skip) ";+[ \t]*")
(set (make-local-variable 'comment-start) ";")
(set (make-local-variable 'require-final-newline) mode-require-final-newline)
(set (make-local-variable 'abbrev-all-caps) t)
(set (make-local-variable 'indent-tabs-mode) nil)
(set (make-local-variable 'completion-ignore-case) t)
(use-local-map idlwave-mode-map)
(when (featurep 'easymenu)
......@@ -1918,11 +1918,11 @@ The main features of this mode are
(setq mode-name "IDLWAVE")
(setq major-mode 'idlwave-mode)
(setq abbrev-mode t)
(set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill)
(setq comment-end "")
(set (make-local-variable 'comment-multi-line) nil)
(set (make-local-variable 'paragraph-separate)
(set (make-local-variable 'paragraph-separate)
"[ \t\f]*$\\|[ \t]*;+[ \t]*$\\|;+[+=-_*]+$")
(set (make-local-variable 'paragraph-start) "[ \t\f]\\|[ \t]*;+[ \t]")
(set (make-local-variable 'paragraph-ignore-fill-prefix) nil)
......@@ -1931,7 +1931,7 @@ The main features of this mode are
;; Set tag table list to use IDLTAGS as file name.
(if (boundp 'tag-table-alist)
(add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS")))
;; Font-lock additions - originally Phil Williams, then Ulrik Dickow
;; Following line is for Emacs - XEmacs uses the corresponding property
;; on the `idlwave-mode' symbol.
......@@ -1967,18 +1967,18 @@ The main features of this mode are
(unless idlwave-setup-done
(if (not (file-directory-p idlwave-config-directory))
(make-directory idlwave-config-directory))
(setq idlwave-user-catalog-file (expand-file-name
idlwave-user-catalog-file
(setq idlwave-user-catalog-file (expand-file-name
idlwave-user-catalog-file
idlwave-config-directory)
idlwave-path-file (expand-file-name
idlwave-path-file
idlwave-path-file (expand-file-name
idlwave-path-file
idlwave-config-directory))
(idlwave-read-paths) ; we may need these early
(setq idlwave-setup-done t)))
;;
;; Code Formatting ----------------------------------------------------
;;
;;
(defun idlwave-push-mark (&rest rest)
"Push mark for compatibility with Emacs 18/19."
......@@ -2127,7 +2127,7 @@ Also checks if the correct end statement has been used."
(if (> end-pos eol-pos)
(setq end-pos pos))
(goto-char end-pos)
(setq end (buffer-substring
(setq end (buffer-substring
(progn
(skip-chars-backward "a-zA-Z")
(point))
......@@ -2149,7 +2149,7 @@ Also checks if the correct end statement has been used."
(sit-for 1))
(t
(beep)
(message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?"
(message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?"
end1 end)
(sit-for 1))))))))
;;(delete-char 1))
......@@ -2161,8 +2161,8 @@ Also checks if the correct end statement has been used."
((looking-at "pro\\|case\\|switch\\|function\\>")
(assoc (downcase (match-string 0)) idlwave-block-matches))
((looking-at "begin\\>")
(let ((limit (save-excursion
(idlwave-beginning-of-statement)
(let ((limit (save-excursion
(idlwave-beginning-of-statement)
(point))))
(cond
((re-search-backward ":[ \t]*\\=" limit t)
......@@ -2190,9 +2190,9 @@ Also checks if the correct end statement has been used."
(insert "end")
(idlwave-show-begin)))
(defun idlwave-gtr-pad-hook (char)
(defun idlwave-gtr-pad-hook (char)
"Let the > symbol expand around -> if present. The new token length
is returned."
is returned."
2)
(defun idlwave-surround (&optional before after escape-chars length ec-hook)
......@@ -2222,8 +2222,8 @@ return value."
(let* ((length (or length 1)) ; establish a default for LENGTH
(prev-char (char-after (- (point) (1+ length)))))
(when (or (not (memq prev-char escape-chars))
(and (fboundp ec-hook)
(setq length
(and (fboundp ec-hook)
(setq length
(save-excursion (funcall ec-hook prev-char)))))
(backward-char length)
(save-restriction
......@@ -2445,7 +2445,7 @@ Returns non-nil if successfull."
(let ((eos (save-excursion
(idlwave-block-jump-out -1 'nomark)
(point))))
(if (setq status (idlwave-find-key
(if (setq status (idlwave-find-key
idlwave-end-block-reg -1 'nomark eos))
(idlwave-beginning-of-statement)
(message "No nested block before beginning of containing block.")))
......@@ -2453,7 +2453,7 @@ Returns non-nil if successfull."
(let ((eos (save-excursion
(idlwave-block-jump-out 1 'nomark)
(point))))
(if (setq status (idlwave-find-key
(if (setq status (idlwave-find-key
idlwave-begin-block-reg 1 'nomark eos))
(idlwave-end-of-statement)
(message "No nested block before end of containing block."))))
......@@ -2467,7 +2467,7 @@ The marks are pushed."
(here (point)))
(goto-char (point-max))
(if (re-search-backward idlwave-doclib-start nil t)
(progn
(progn
(setq beg (progn (beginning-of-line) (point)))
(if (re-search-forward idlwave-doclib-end nil t)
(progn
......@@ -2501,7 +2501,7 @@ actual statement."
((eq major-mode 'idlwave-shell-mode)
(if (re-search-backward idlwave-shell-prompt-pattern nil t)
(goto-char (match-end 0))))
(t
(t
(if (save-excursion (forward-line -1) (idlwave-is-continuation-line))
(idlwave-previous-statement)
(beginning-of-line)))))
......@@ -2578,7 +2578,7 @@ If not in a statement just moves to end of line. Returns position."
(let ((save-point (point)))
(when (re-search-forward ".*&" lim t)
(goto-char (match-end 0))
(if (idlwave-quoted)
(if (idlwave-quoted)
(goto-char save-point)
(if (eq (char-after (- (point) 2)) ?&) (goto-char save-point))))
(point)))
......@@ -2595,7 +2595,7 @@ If there is no label point is not moved and nil is returned."
;; - not in parenthesis (like a[0:3])
;; - not followed by another ":" in explicit class, ala a->b::c
;; As many in this mode, this function is heuristic and not an exact
;; parser.
;; parser.
(let* ((start (point))
(eos (save-excursion (idlwave-end-of-statement) (point)))
(end (idlwave-find-key ":" 1 'nomark eos)))
......@@ -2672,7 +2672,7 @@ equal sign will be surrounded by BEFORE and AFTER blanks. If
`idlwave-pad-keyword' is t then keyword assignment is treated just
like assignment statements. When nil, spaces are removed for keyword
assignment. Any other value keeps the current space around the `='.
Limits in for loops are treated as keyword assignment.
Limits in for loops are treated as keyword assignment.
Starting with IDL 6.0, a number of op= assignments are available.
Since ambiguities of the form:
......@@ -2687,25 +2687,25 @@ operators, such as ##=, ^=, etc., will be pre-padded.
See `idlwave-surround'."
(if idlwave-surround-by-blank
(let
(let
((non-an-ops "\\(##\\|\\*\\|\\+\\|-\\|/\\|<\\|>\\|\\^\\)\\=")
(an-ops
(an-ops
"\\s-\\(AND\\|EQ\\|GE\\|GT\\|LE\\|LT\\|MOD\\|NE\\|OR\\|XOR\\)\\=")
(len 1))
(save-excursion
(save-excursion
(let ((case-fold-search t))
(backward-char)
(if (or
(if (or
(re-search-backward non-an-ops nil t)
;; Why doesn't ##? work for both?
(re-search-backward "\\(#\\)\\=" nil t))
(re-search-backward "\\(#\\)\\=" nil t))
(setq len (1+ (length (match-string 1))))
(when (re-search-backward an-ops nil t)
;(setq begin nil) ; won't modify begin
(setq len (1+ (length (match-string 1))))))))
(if (eq t idlwave-pad-keyword)
(if (eq t idlwave-pad-keyword)
;; Everything gets padded equally
(idlwave-surround before after nil len)
;; Treating keywords/for variables specially...
......@@ -2716,22 +2716,22 @@ See `idlwave-surround'."
(skip-chars-backward "= \t")
(nth 2 (idlwave-where)))))
(cond ((or (memq what '(function-keyword procedure-keyword))
(memq (caar st) '(for pdef)))
(cond
(memq (caar st) '(for pdef)))
(cond
((null idlwave-pad-keyword)
(idlwave-surround 0 0)
) ; remove space
(t))) ; leave any spaces alone
(t (idlwave-surround before after nil len))))))))
(defun idlwave-indent-and-action (&optional arg)
"Call `idlwave-indent-line' and do expand actions.
With prefix ARG non-nil, indent the entire sub-statement."
(interactive "p")
(save-excursion
(if (and idlwave-expand-generic-end
(re-search-backward "\\<\\(end\\)\\s-*\\="
(if (and idlwave-expand-generic-end
(re-search-backward "\\<\\(end\\)\\s-*\\="
(max 0 (- (point) 10)) t)
(looking-at "\\(end\\)\\([ \n\t]\\|\\'\\)"))
(progn (goto-char (match-end 1))
......@@ -2741,7 +2741,7 @@ With prefix ARG non-nil, indent the entire sub-statement."
(when (and (not arg) current-prefix-arg)
(setq arg current-prefix-arg)
(setq current-prefix-arg nil))
(if arg
(if arg
(idlwave-indent-statement)
(idlwave-indent-line t)))
......@@ -2874,7 +2874,7 @@ Inserts spaces before markers at point."
(save-excursion
(cond
;; Beginning of file
((prog1
((prog1
(idlwave-previous-statement)
(setq beg-prev-pos (point)))
0)
......@@ -2884,7 +2884,7 @@ Inserts spaces before markers at point."
idlwave-main-block-indent))
;; Begin block
((idlwave-look-at idlwave-begin-block-reg t)
(+ (idlwave-min-current-statement-indent)
(+ (idlwave-min-current-statement-indent)
idlwave-block-indent))
;; End Block
((idlwave-look-at idlwave-end-block-reg t)
......@@ -2895,7 +2895,7 @@ Inserts spaces before markers at point."
(idlwave-min-current-statement-indent)))
;; idlwave-end-offset
;; idlwave-block-indent))
;; Default to current indent
((idlwave-current-statement-indent))))))
;; adjust the indentation based on the current statement
......@@ -2911,7 +2911,7 @@ Inserts spaces before markers at point."
(defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp)
"Calculate the continuation indent inside a paren group.
Returns a cons-cell with (open . indent), where open is the
Returns a cons-cell with (open . indent), where open is the
location of the open paren"
(let ((open (nth 1 (parse-partial-sexp beg-reg end-reg))))
;; Found an innermost open paren.
......@@ -2952,24 +2952,24 @@ groupings, are treated separately."
(end-reg (progn (beginning-of-line) (point)))
(beg-last-statement (save-excursion (idlwave-previous-statement)
(point)))
(beg-reg (progn (idlwave-start-of-substatement 'pre)
(beg-reg (progn (idlwave-start-of-substatement 'pre)
(if (eq (line-beginning-position) end-reg)
(goto-char beg-last-statement)
(point))))
(basic-indent (+ (idlwave-min-current-statement-indent end-reg)
idlwave-continuation-indent))
fancy-nonparen-indent fancy-paren-indent)
(cond
(cond
;; Align then with its matching if, etc.
((let ((matchers '(("\\<if\\>" . "[ \t]*then")
("\\<\\(if\\|end\\(if\\)?\\)\\>" . "[ \t]*else")
("\\<\\(for\\|while\\)\\>" . "[ \t]*do")
("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" .
("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" .
"[ \t]*until")
("\\<case\\>" . "[ \t]*of")))
match cont-re)
(goto-char end-reg)
(and
(and
(setq cont-re
(catch 'exit
(while (setq match (car matchers))
......@@ -2978,7 +2978,7 @@ groupings, are treated separately."
(setq matchers (cdr matchers)))))
(idlwave-find-key cont-re -1 'nomark beg-last-statement)))
(if (looking-at "end") ;; that one's special
(- (idlwave-current-indent)
(- (idlwave-current-indent)
(+ idlwave-block-indent idlwave-end-offset))
(idlwave-current-indent)))
......@@ -3004,7 +3004,7 @@ groupings, are treated separately."
(let* ((end-reg end-reg)
(close-exp (progn
(goto-char end-reg)
(skip-chars-forward " \t")
(skip-chars-forward " \t")
(looking-at "\\s)")))
indent-cons)
(catch 'loop
......@@ -3038,12 +3038,12 @@ groupings, are treated separately."
(if (save-match-data (looking-at "[ \t$]*\\(;.*\\)?$"))
nil
(current-column)))
;; Continued assignment (with =):
((catch 'assign ;
(while (looking-at "[^=\n\r]*\\(=\\)[ \t]*")
(goto-char (match-end 0))
(if (null (idlwave-what-function beg-reg))
(if (null (idlwave-what-function beg-reg))
(throw 'assign t))))
(unless (or
(idlwave-in-quote)
......@@ -3105,7 +3105,7 @@ possibility of unbalanced blocks."
(let* ((here (point))
(case-fold-search t)
(limit (if (>= dir 0) (point-max) (point-min)))
(block-limit (if (>= dir 0)
(block-limit (if (>= dir 0)
idlwave-begin-block-reg
idlwave-end-block-reg))
found
......@@ -3116,7 +3116,7 @@ possibility of unbalanced blocks."
(idlwave-find-key
idlwave-begin-unit-reg dir t limit)
(end-of-line)
(idlwave-find-key
(idlwave-find-key
idlwave-end-unit-reg dir t limit)))
limit)))
(if (>= dir 0) (end-of-line)) ;Make sure we are in current block
......@@ -3141,7 +3141,7 @@ possibility of unbalanced blocks."
(or (null end-reg) (< (point) end-reg)))