diff options
| author | Stefan Monnier | 2003-01-18 20:42:47 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-01-18 20:42:47 +0000 |
| commit | 017708e9dd7509011f5df38409c489240a773eea (patch) | |
| tree | 11f5b32f46098bf9be6d3705d4720510d934fb09 | |
| parent | 5cc679abf39af50a947ff77542122aa9112bd1d4 (diff) | |
| download | emacs-017708e9dd7509011f5df38409c489240a773eea.tar.gz emacs-017708e9dd7509011f5df38409c489240a773eea.zip | |
(sh-indent-line): Use indent-line-to.
(sh-non-closing-paren): New const.
(sh-case, sh-while-getopts): Use it to make props non-sticky.
(sh-add-completer): Use test-completion.
| -rw-r--r-- | lisp/ChangeLog | 84 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 39 |
2 files changed, 69 insertions, 54 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0c4a5902409..caa1b8d5dfd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2003-01-18 Stefan Monnier <monnier@cs.yale.edu> | ||
| 2 | |||
| 3 | * progmodes/sh-script.el (sh-indent-line): Use indent-line-to. | ||
| 4 | (sh-non-closing-paren): New const. | ||
| 5 | (sh-case, sh-while-getopts): Use it to make props non-sticky. | ||
| 6 | (sh-add-completer): Use test-completion. | ||
| 7 | |||
| 1 | 2003-01-18 Vasily Korytov <deskpot@myrealbox.com> (tiny change) | 8 | 2003-01-18 Vasily Korytov <deskpot@myrealbox.com> (tiny change) |
| 2 | 9 | ||
| 3 | * progmodes/cperl-mode.el: Don't make faces depend on window-system. | 10 | * progmodes/cperl-mode.el: Don't make faces depend on window-system. |
| @@ -6,10 +13,14 @@ | |||
| 6 | 13 | ||
| 7 | * cus-edit.el (customize-changed-options): Undo last doc change. | 14 | * cus-edit.el (customize-changed-options): Undo last doc change. |
| 8 | 15 | ||
| 16 | 2003-01-17 Stefan Monnier <monnier@cs.yale.edu> | ||
| 17 | |||
| 18 | * skeleton.el (skeleton-internal-list, skeleton-internal-1): | ||
| 19 | Don't treat \n specially in sub-skeletons. | ||
| 20 | |||
| 9 | 2003-01-17 Dave Love <fx@gnu.org> | 21 | 2003-01-17 Dave Love <fx@gnu.org> |
| 10 | 22 | ||
| 11 | * international/ucs-tables.el: Redo 8859-6 change in the right | 23 | * international/ucs-tables.el: Redo 8859-6 change in the right place. |
| 12 | place. | ||
| 13 | 24 | ||
| 14 | 2003-01-17 Kenichi Handa <handa@m17n.org> | 25 | 2003-01-17 Kenichi Handa <handa@m17n.org> |
| 15 | 26 | ||
| @@ -25,6 +36,11 @@ | |||
| 25 | 36 | ||
| 26 | * term/mac-win.el: Require fontset and call setup-default-fontset. | 37 | * term/mac-win.el: Require fontset and call setup-default-fontset. |
| 27 | 38 | ||
| 39 | 2003-01-16 Stefan Monnier <monnier@cs.yale.edu> | ||
| 40 | |||
| 41 | * textmodes/fill.el (fill-region-as-paragraph): Only erase `hard' | ||
| 42 | property until end-of-paragraph. | ||
| 43 | |||
| 28 | 2003-01-16 Kenichi Handa <handa@m17n.org> | 44 | 2003-01-16 Kenichi Handa <handa@m17n.org> |
| 29 | 45 | ||
| 30 | * international/ucs-tables.el: Undo the last change. | 46 | * international/ucs-tables.el: Undo the last change. |
| @@ -44,8 +60,8 @@ | |||
| 44 | 60 | ||
| 45 | 2003-01-15 John Wiegley <johnw@gnu.org> | 61 | 2003-01-15 John Wiegley <johnw@gnu.org> |
| 46 | 62 | ||
| 47 | * eshell/em-hist.el (eshell-save-history-on-exit): Renamed | 63 | * eshell/em-hist.el (eshell-save-history-on-exit): |
| 48 | `eshell-ask-to-save-history' to `eshell-save-history-on-exit', | 64 | Rename `eshell-ask-to-save-history' to `eshell-save-history-on-exit', |
| 49 | because the former name is somewhat unrelated to the variables' | 65 | because the former name is somewhat unrelated to the variables' |
| 50 | possible values. | 66 | possible values. |
| 51 | 67 | ||
| @@ -55,8 +71,7 @@ | |||
| 55 | 71 | ||
| 56 | * calc/*: Ditto. | 72 | * calc/*: Ditto. |
| 57 | 73 | ||
| 58 | * calc/calc.el (calc-bug-address): Change address to | 74 | * calc/calc.el (calc-bug-address): Change address to deego@gnufans.org. |
| 59 | deego@gnufans.org | ||
| 60 | 75 | ||
| 61 | 2003-01-15 Andrew Innes <andrewi@gnu.org> | 76 | 2003-01-15 Andrew Innes <andrewi@gnu.org> |
| 62 | 77 | ||
| @@ -79,10 +94,17 @@ | |||
| 79 | 2003-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> (tiny change) | 94 | 2003-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> (tiny change) |
| 80 | 95 | ||
| 81 | * international/mule.el (optimize-char-coding-system-table): | 96 | * international/mule.el (optimize-char-coding-system-table): |
| 82 | Optimize it. | 97 | Optimize it. |
| 83 | 98 | ||
| 84 | * term/mac-win.el: Setup the fontset "fontset-mac" correctly. | 99 | * term/mac-win.el: Setup the fontset "fontset-mac" correctly. |
| 85 | 100 | ||
| 101 | 2003-01-14 Stefan Monnier <monnier@cs.yale.edu> | ||
| 102 | |||
| 103 | * pcvs-info.el (cvs-fileinfo-from-entries): Deal with Solaris' | ||
| 104 | occasional use of "05" rather than " 5" for day-of-month. | ||
| 105 | |||
| 106 | * log-view.el (log-view-message-re): The rev might be locked. | ||
| 107 | |||
| 86 | 2003-01-14 Nick Roberts <nick@nick.uklinux.net> | 108 | 2003-01-14 Nick Roberts <nick@nick.uklinux.net> |
| 87 | 109 | ||
| 88 | * gdb-ui.el: Improve commentary. | 110 | * gdb-ui.el: Improve commentary. |
| @@ -134,11 +156,11 @@ | |||
| 134 | 2003-01-14 Kim F. Storm <storm@cua.dk> | 156 | 2003-01-14 Kim F. Storm <storm@cua.dk> |
| 135 | 157 | ||
| 136 | * ido.el: Doc fixes. | 158 | * ido.el: Doc fixes. |
| 137 | (ido-max-file-prompt-width): Renamed from ido-max-prompt-path. | 159 | (ido-max-file-prompt-width): Rename from ido-max-prompt-path. |
| 138 | (ido-rewrite-file-prompt-functions): Renamed from | 160 | (ido-rewrite-file-prompt-functions): Rename from |
| 139 | ido-make-file-prompt-hook. Directory name is now in dynamic | 161 | ido-make-file-prompt-hook. Directory name is now in dynamic |
| 140 | variable `dirname' (instead of `path'). | 162 | variable `dirname' (instead of `path'). |
| 141 | (ido-rewrite-file-prompt-rules): Renamed from | 163 | (ido-rewrite-file-prompt-rules): Rename from |
| 142 | ido-rewrite-prompt-path-rules. | 164 | ido-rewrite-prompt-path-rules. |
| 143 | (ido-make-prompt): Directory name now in `dirname' var. | 165 | (ido-make-prompt): Directory name now in `dirname' var. |
| 144 | (ido-complete): Fix error message. | 166 | (ido-complete): Fix error message. |
| @@ -151,8 +173,8 @@ | |||
| 151 | 173 | ||
| 152 | 2003-01-13 Dave Love <fx@gnu.org> | 174 | 2003-01-13 Dave Love <fx@gnu.org> |
| 153 | 175 | ||
| 154 | * international/utf-16.el (mule-utf-16-be, mule-utf-16-le): Remove | 176 | * international/utf-16.el (mule-utf-16-be, mule-utf-16-le): |
| 155 | pre-write-conversion. | 177 | Remove pre-write-conversion. |
| 156 | 178 | ||
| 157 | 2003-01-13 Kim F. Storm <storm@cua.dk> | 179 | 2003-01-13 Kim F. Storm <storm@cua.dk> |
| 158 | 180 | ||
| @@ -168,8 +190,8 @@ | |||
| 168 | * ruler-mode.el (ruler-mode-comment-column-char) | 190 | * ruler-mode.el (ruler-mode-comment-column-char) |
| 169 | (ruler-mode-goal-column-char, ruler-mode-set-goal-column-ding-flag) | 191 | (ruler-mode-goal-column-char, ruler-mode-set-goal-column-ding-flag) |
| 170 | (ruler-mode-mouse-current-grab-object): New variables. | 192 | (ruler-mode-mouse-current-grab-object): New variables. |
| 171 | (ruler-mode-comment-column-face, ruler-mode-goal-column-face): New | 193 | (ruler-mode-comment-column-face, ruler-mode-goal-column-face): |
| 172 | faces. | 194 | New faces. |
| 173 | (ruler-mode-mouse-set-fill-column): Removed. | 195 | (ruler-mode-mouse-set-fill-column): Removed. |
| 174 | (ruler-mode-mouse-grab-any-column) | 196 | (ruler-mode-mouse-grab-any-column) |
| 175 | (ruler-mode-mouse-drag-any-column-iteration) | 197 | (ruler-mode-mouse-drag-any-column-iteration) |
| @@ -177,17 +199,17 @@ | |||
| 177 | (ruler-mode-map): [header-line down-mouse-2] Bound to | 199 | (ruler-mode-map): [header-line down-mouse-2] Bound to |
| 178 | `ruler-mode-mouse-grab-any-column' instead of | 200 | `ruler-mode-mouse-grab-any-column' instead of |
| 179 | `ruler-mode-mouse-set-fill-column'. | 201 | `ruler-mode-mouse-set-fill-column'. |
| 180 | (ruler-mode-ruler-help-echo): Updated its value. | 202 | (ruler-mode-ruler-help-echo): Update its value. |
| 181 | (ruler-mode-ruler-help-echo-when-goal-column): New help string used when | 203 | (ruler-mode-ruler-help-echo-when-goal-column): New help string used |
| 182 | goal-column is already set. | 204 | when goal-column is already set. |
| 183 | (ruler-mode-ruler-help-echo-tab): Renamed to... | 205 | (ruler-mode-ruler-help-echo-tab): Rename to... |
| 184 | (ruler-mode-ruler-help-echo-when-tab-stops): New. | 206 | (ruler-mode-ruler-help-echo-when-tab-stops): New. |
| 185 | (ruler-mode-fill-column-help-echo, ruler-mode-comment-column-help-echo) | 207 | (ruler-mode-fill-column-help-echo, ruler-mode-comment-column-help-echo) |
| 186 | (ruler-mode-goal-column-help-echo): New help strings. | 208 | (ruler-mode-goal-column-help-echo): New help strings. |
| 187 | (ruler-mode-ruler): Use `ruler-mode-ruler-help-echo-when-goal-column' | 209 | (ruler-mode-ruler): Use `ruler-mode-ruler-help-echo-when-goal-column' |
| 188 | instead of `ruler-mode-ruler-help-echo' if `goal-column' is set. Show | 210 | instead of `ruler-mode-ruler-help-echo' if `goal-column' is set. |
| 189 | `comment-column' and `goal-column'. Echo the different help string for | 211 | Show `comment-column' and `goal-column'. Echo the different help |
| 190 | each *-column characters on the ruler. | 212 | string for each *-column characters on the ruler. |
| 191 | 213 | ||
| 192 | 2003-01-13 Richard M. Stallman <rms@gnu.org> | 214 | 2003-01-13 Richard M. Stallman <rms@gnu.org> |
| 193 | 215 | ||
| @@ -284,7 +306,7 @@ | |||
| 284 | 306 | ||
| 285 | 2003-01-09 John Wiegley <johnw@gnu.org> | 307 | 2003-01-09 John Wiegley <johnw@gnu.org> |
| 286 | 308 | ||
| 287 | * pcomplete.el (pcomplete-termination-string): Added a variable | 309 | * pcomplete.el (pcomplete-termination-string): Add a variable |
| 288 | for modifying the string which is inserted after a completion or | 310 | for modifying the string which is inserted after a completion or |
| 289 | expansion using pcomplete. | 311 | expansion using pcomplete. |
| 290 | 312 | ||
| @@ -382,7 +404,7 @@ | |||
| 382 | 404 | ||
| 383 | 2003-01-05 Richard M. Stallman <rms@gnu.org> | 405 | 2003-01-05 Richard M. Stallman <rms@gnu.org> |
| 384 | 406 | ||
| 385 | * obsolete/uncompress.el: Display message that this package is obsolete. | 407 | * obsolete/uncompress.el: Display message that this pkg is obsolete. |
| 386 | 408 | ||
| 387 | * isearch.el (isearch-repeat): Error if try to repeat search and | 409 | * isearch.el (isearch-repeat): Error if try to repeat search and |
| 388 | there was no previous search. | 410 | there was no previous search. |
| @@ -565,11 +587,9 @@ | |||
| 565 | use $(lisp). | 587 | use $(lisp). |
| 566 | (compile-calc): Fix command substitution. | 588 | (compile-calc): Fix command substitution. |
| 567 | * cus-dep.el (generated-custom-dependencies-file): New variable. | 589 | * cus-dep.el (generated-custom-dependencies-file): New variable. |
| 568 | (custom-make-dependencies): Use it instead of hardcoding | 590 | (custom-make-dependencies): Use it instead of hardcoding cus-load.el. |
| 569 | cus-load.el. | ||
| 570 | * finder.el (generated-finder-keywords-file): New variable. | 591 | * finder.el (generated-finder-keywords-file): New variable. |
| 571 | (finder-compile-keywords): Use it instead of hardcoding | 592 | (finder-compile-keywords): Use it instead of hardcoding finder-inf.el. |
| 572 | finder-inf.el. | ||
| 573 | 593 | ||
| 574 | 2002-12-28 Richard M. Stallman <rms@gnu.org> | 594 | 2002-12-28 Richard M. Stallman <rms@gnu.org> |
| 575 | 595 | ||
| @@ -588,9 +608,9 @@ | |||
| 588 | 608 | ||
| 589 | 2002-12-28 Andreas Schwab <schwab@suse.de> | 609 | 2002-12-28 Andreas Schwab <schwab@suse.de> |
| 590 | 610 | ||
| 591 | * progmodes/make-mode.el (makefile-font-lock-keywords): Highlight | 611 | * progmodes/make-mode.el (makefile-font-lock-keywords): |
| 592 | automatic variable references enclosed in parens and optionally | 612 | Highlight automatic variable references enclosed in parens and |
| 593 | suffixed by F or D. | 613 | optionally suffixed by F or D. |
| 594 | 614 | ||
| 595 | 2002-12-27 Miles Bader <miles@gnu.org> | 615 | 2002-12-27 Miles Bader <miles@gnu.org> |
| 596 | 616 | ||
| @@ -886,7 +906,7 @@ | |||
| 886 | 906 | ||
| 887 | 2002-12-16 Kim F. Storm <storm@cua.dk> | 907 | 2002-12-16 Kim F. Storm <storm@cua.dk> |
| 888 | 908 | ||
| 889 | * ido.el (ido-read-file-name): Removed debug message. | 909 | * ido.el (ido-read-file-name): Remove debug message. |
| 890 | 910 | ||
| 891 | 2002-12-16 Daniel Pfeiffer <occitan@esperanto.org> | 911 | 2002-12-16 Daniel Pfeiffer <occitan@esperanto.org> |
| 892 | 912 | ||
| @@ -933,7 +953,7 @@ | |||
| 933 | 2002-12-15 Dave Love <fx@gnu.org> | 953 | 2002-12-15 Dave Love <fx@gnu.org> |
| 934 | 954 | ||
| 935 | * international/mule-cmds.el (standard-keyboard-coding-systems): | 955 | * international/mule-cmds.el (standard-keyboard-coding-systems): |
| 936 | Deleted. | 956 | Delete. |
| 937 | (set-locale-environment): Don't use it. | 957 | (set-locale-environment): Don't use it. |
| 938 | 958 | ||
| 939 | * international/utf-8.el (ucs-mule-cjk-to-unicode) | 959 | * international/utf-8.el (ucs-mule-cjk-to-unicode) |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 283fe09cea2..9dadd66be9b 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -195,6 +195,7 @@ | |||
| 195 | 195 | ||
| 196 | (eval-when-compile | 196 | (eval-when-compile |
| 197 | (require 'skeleton) | 197 | (require 'skeleton) |
| 198 | (require 'cl) | ||
| 198 | (require 'comint)) | 199 | (require 'comint)) |
| 199 | (require 'executable) | 200 | (require 'executable) |
| 200 | 201 | ||
| @@ -2485,16 +2486,12 @@ If INFO is supplied it is used, else it is calculated from current line." | |||
| 2485 | (defun sh-indent-line () | 2486 | (defun sh-indent-line () |
| 2486 | "Indent the current line." | 2487 | "Indent the current line." |
| 2487 | (interactive) | 2488 | (interactive) |
| 2488 | (let ((indent (sh-calculate-indent)) shift-amt beg end | 2489 | (let ((indent (sh-calculate-indent)) |
| 2489 | (pos (- (point-max) (point)))) | 2490 | (pos (- (point-max) (point)))) |
| 2490 | (when indent | 2491 | (when indent |
| 2491 | (beginning-of-line) | 2492 | (beginning-of-line) |
| 2492 | (setq beg (point)) | ||
| 2493 | (skip-chars-forward " \t") | 2493 | (skip-chars-forward " \t") |
| 2494 | (setq shift-amt (- indent (current-column))) | 2494 | (indent-line-to indent) |
| 2495 | (unless (zerop shift-amt) | ||
| 2496 | (delete-region beg (point)) | ||
| 2497 | (indent-to indent)) | ||
| 2498 | ;; If initial point was within line's indentation, | 2495 | ;; If initial point was within line's indentation, |
| 2499 | ;; position after the indentation. Else stay at same point in text. | 2496 | ;; position after the indentation. Else stay at same point in text. |
| 2500 | (if (> (- (point-max) pos) (point)) | 2497 | (if (> (- (point-max) pos) (point)) |
| @@ -3079,6 +3076,11 @@ This is always added to the end of the buffer." | |||
| 3079 | ;; You are welcome to add the syntax or even completely new statements as | 3076 | ;; You are welcome to add the syntax or even completely new statements as |
| 3080 | ;; appropriate for your favorite shell. | 3077 | ;; appropriate for your favorite shell. |
| 3081 | 3078 | ||
| 3079 | (defconst sh-non-closing-paren | ||
| 3080 | ;; If we leave it rear-sticky, calling `newline' ends up inserting a \n | ||
| 3081 | ;; that inherits this property, which then confuses the indentation. | ||
| 3082 | (propertize ")" 'syntax-table sh-st-punc 'rear-nonsticky t)) | ||
| 3083 | |||
| 3082 | (define-skeleton sh-case | 3084 | (define-skeleton sh-case |
| 3083 | "Insert a case/switch statement. See `sh-feature'." | 3085 | "Insert a case/switch statement. See `sh-feature'." |
| 3084 | (csh "expression: " | 3086 | (csh "expression: " |
| @@ -3108,16 +3110,11 @@ This is always added to the end of the buffer." | |||
| 3108 | ?\} > \n) | 3110 | ?\} > \n) |
| 3109 | (sh "expression: " | 3111 | (sh "expression: " |
| 3110 | > "case " str " in" \n | 3112 | > "case " str " in" \n |
| 3111 | > (read-string "pattern: ") | 3113 | ( "pattern, %s: " |
| 3112 | (propertize ")" 'syntax-table sh-st-punc) | 3114 | > str sh-non-closing-paren \n |
| 3113 | \n | ||
| 3114 | > _ \n | ||
| 3115 | ";;" \n | ||
| 3116 | ( "other pattern, %s: " | ||
| 3117 | > str (propertize ")" 'syntax-table sh-st-punc) \n | ||
| 3118 | > _ \n | 3115 | > _ \n |
| 3119 | ";;" \n) | 3116 | ";;" \n) |
| 3120 | > "*" (propertize ")" 'syntax-table sh-st-punc) \n | 3117 | > "*" sh-non-closing-paren \n |
| 3121 | > _ \n | 3118 | > _ \n |
| 3122 | resume: | 3119 | resume: |
| 3123 | "esac" > \n)) | 3120 | "esac" > \n)) |
| @@ -3220,12 +3217,10 @@ t means to return a list of all possible completions of STRING. | |||
| 3220 | (cons name name))) | 3217 | (cons name name))) |
| 3221 | process-environment) | 3218 | process-environment) |
| 3222 | sh-shell-variables)))) | 3219 | sh-shell-variables)))) |
| 3223 | (cond ((null code) | 3220 | (case code |
| 3224 | (try-completion string sh-shell-variables predicate)) | 3221 | (nil (try-completion string sh-shell-variables predicate)) |
| 3225 | ((eq code t) | 3222 | (lambda (test-completion string sh-shell-variables predicate)) |
| 3226 | (all-completions string sh-shell-variables predicate)) | 3223 | (t (all-completions string sh-shell-variables predicate))))) |
| 3227 | ((eq code 'lambda) | ||
| 3228 | (assoc string sh-shell-variables))))) | ||
| 3229 | 3224 | ||
| 3230 | (defun sh-add (var delta) | 3225 | (defun sh-add (var delta) |
| 3231 | "Insert an addition of VAR and prefix DELTA for Bourne (type) shell." | 3226 | "Insert an addition of VAR and prefix DELTA for Bourne (type) shell." |
| @@ -3452,10 +3447,10 @@ option followed by a colon `:' if the option accepts an argument." | |||
| 3452 | v2 "\"$OPTARG\"") | 3447 | v2 "\"$OPTARG\"") |
| 3453 | (setq v1 (cdr v1) | 3448 | (setq v1 (cdr v1) |
| 3454 | v2 nil))) | 3449 | v2 nil))) |
| 3455 | > str "|+" str (propertize ")" 'syntax-table sh-st-punc) \n | 3450 | > str "|+" str sh-non-closing-paren \n |
| 3456 | > _ v2 \n | 3451 | > _ v2 \n |
| 3457 | > ";;" \n) | 3452 | > ";;" \n) |
| 3458 | > "*" (propertize ")" 'syntax-table sh-st-punc) \n | 3453 | > "*" sh-non-closing-paren \n |
| 3459 | > "echo" " \"usage: " "`basename $0`" | 3454 | > "echo" " \"usage: " "`basename $0`" |
| 3460 | " [+-" '(setq v1 (point)) str | 3455 | " [+-" '(setq v1 (point)) str |
| 3461 | '(save-excursion | 3456 | '(save-excursion |