Changeset 4079 for trunk/lisp/progmodes/idlwave.el
- Timestamp:
- 05/13/06 11:31:18 (3 years ago)
- Files:
-
- trunk/lisp/progmodes/idlwave.el (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/progmodes/idlwave.el
r4058 r4079 1209 1209 ;; fontification. Slow, use it only in fancy fontification. 1210 1210 (keyword-parameters 1211 '("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\ \(\n[ \t]*;.*\\)*\n[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)"1212 ( 5font-lock-reference-face)))1211 '("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\([ \t]*\\(;.*\\)?\n\\)*[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)" 1212 (6 font-lock-reference-face))) 1213 1213 1214 1214 ;; System variables start with a bang. … … 1916 1916 (set (make-local-variable 'comment-start-skip) ";+[ \t]*") 1917 1917 (set (make-local-variable 'comment-start) ";") 1918 (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions 1918 1919 (set (make-local-variable 'require-final-newline) t) 1919 1920 (set (make-local-variable 'abbrev-all-caps) t) … … 1948 1949 ;; on the `idlwave-mode' symbol. 1949 1950 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults) 1951 (set (make-local-variable 'font-lock-mark-block-function) 1952 'idlwave-mark-subprogram) 1953 (set (make-local-variable 'font-lock-fontify-region-function) 1954 'idlwave-font-lock-fontify-region) 1950 1955 1951 1956 ;; Imenu setup … … 1956 1961 (set (make-local-variable 'imenu-prev-index-position-function) 1957 1962 'idlwave-prev-index-position) 1963 1964 ;; HideShow setup 1965 (add-to-list 'hs-special-modes-alist 1966 (list 'idlwave-mode 1967 idlwave-begin-block-reg 1968 idlwave-end-block-reg 1969 ";" 1970 'idlwave-forward-block nil)) 1971 1958 1972 1959 1973 ;; Make a local post-command-hook and add our hook to it … … 2001 2015 (setq idlwave-setup-done t))) 2002 2016 2017 (defun idlwave-font-lock-fontify-region (beg end &optional verbose) 2018 "Fontify continuation lines correctly." 2019 (let (pos) 2020 (save-excursion 2021 (goto-char beg) 2022 (forward-line -1) 2023 (when (setq pos (idlwave-is-continuation-line)) 2024 (goto-char pos) 2025 (idlwave-beginning-of-statement) 2026 (setq beg (point))))) 2027 (font-lock-default-fontify-region beg end verbose)) 2028 2003 2029 ;; 2004 2030 ;; Code Formatting ---------------------------------------------------- 2005 2031 ;; 2006 2007 (defun idlwave-push-mark (&rest rest)2008 "Push mark for compatibility with Emacs 18/19."2009 (if (fboundp 'iconify-frame)2010 (apply 'push-mark rest)2011 (push-mark)))2012 2032 2013 2033 (defun idlwave-hard-tab () … … 2404 2424 (let ((end (point))) 2405 2425 (idlwave-beginning-of-statement) 2406 ( idlwave-push-mark end nil t)))2426 (push-mark end nil t))) 2407 2427 2408 2428 (defun idlwave-mark-block () … … 2415 2435 (idlwave-backward-block) 2416 2436 (idlwave-beginning-of-statement) 2417 ( idlwave-push-mark end nil t)))2437 (push-mark end nil t))) 2418 2438 2419 2439 … … 2426 2446 (let ((beg (point))) 2427 2447 (idlwave-forward-block) 2428 ( idlwave-push-mark beg nil t))2448 (push-mark beg nil t)) 2429 2449 (exchange-point-and-mark)) 2430 2450 … … 2447 2467 (backward-word 1)) 2448 2468 2449 (defun idlwave-forward-block ( )2469 (defun idlwave-forward-block (&optional arg) 2450 2470 "Move across next nested block." 2451 2471 (interactive) 2452 (if (idlwave-down-block 1) 2453 (idlwave-block-jump-out 1 'nomark))) 2472 (let ((arg (or arg 1))) 2473 (if (idlwave-down-block arg) 2474 (idlwave-block-jump-out arg 'nomark)))) 2454 2475 2455 2476 (defun idlwave-backward-block () … … 2497 2518 (progn 2498 2519 (forward-line 1) 2499 ( idlwave-push-mark beg nil t)2520 (push-mark beg nil t) 2500 2521 (message "Could not find end of doc library header."))) 2501 2522 (message "Could not find doc library header start.") 2502 2523 (goto-char here))))) 2503 2504 2524 2505 2525 (defun idlwave-current-routine () … … 3195 3215 Blank or comment-only lines following regular continuation lines (with 3196 3216 `$') count as continuations too." 3197 (save-excursion 3198 (or 3199 (idlwave-look-at "\\<\\$") 3200 (catch 'loop 3201 (while (and (looking-at "^[ \t]*\\(;.*\\)?$") 3202 (eq (forward-line -1) 0)) 3203 (if (idlwave-look-at "\\<\\$") (throw 'loop t))))))) 3217 (let (p) 3218 (save-excursion 3219 (or 3220 (idlwave-look-at "\\<\\$") 3221 (catch 'loop 3222 (while (and (looking-at "^[ \t]*\\(;.*\\)?$") 3223 (eq (forward-line -1) 0)) 3224 (if (setq p (idlwave-look-at "\\<\\$")) (throw 'loop p)))))))) 3204 3225 3205 3226 (defun idlwave-is-comment-line ()
