diff options
| author | Pierre Courtieu | 2004-03-10 15:33:10 +0000 |
|---|---|---|
| committer | Pierre Courtieu | 2004-03-10 15:33:10 +0000 |
| commit | 27096c83e1bd7bf0e2a445f7dedbd224694bba1c (patch) | |
| tree | 4e74620ff73a6b9735a127a22339cc734e8c3da3 /generic | |
| parent | 1492a2e4757dac1c5ccb3b385c033bf48093cbd3 (diff) | |
dealing with compile warning for new "hole" code (end hopefully).
Diffstat (limited to 'generic')
| -rw-r--r-- | generic/holes.el | 34 | ||||
| -rw-r--r-- | generic/span-extent.el | 2 | ||||
| -rw-r--r-- | generic/span-overlay.el | 2 |
3 files changed, 8 insertions, 30 deletions
diff --git a/generic/holes.el b/generic/holes.el index 524b070a..5b05a418 100644 --- a/generic/holes.el +++ b/generic/holes.el @@ -765,12 +765,13 @@ is), which is annoying. ;c must be a string of length 1 (defun count-char-in-string (c str) - (setq cpt 0) - (while (not (string-equal s "")) - (if (string-equal (substring s 0 1) c) (setq cpt (+ cpt 1))) - (setq s (substring s 1)) + (let ((cpt 0) (s str)) + (while (not (string-equal s "")) + (if (string-equal (substring s 0 1) c) (setq cpt (+ cpt 1))) + (setq s (substring s 1)) + ) + cpt ) - cpt ) (defun count-chars-in-last-expand () @@ -800,29 +801,6 @@ end of last abbrev expansion. " (count-char-in-string empty-hole-string (abbrev-expansion last-abbrev-text)) ) -(defun count-chars-in-last-expand () - (length (abbrev-expansion last-abbrev-text)) - ) - -(defun count-newlines-in-last-expand () - (count-char-in-string "\n" (abbrev-expansion last-abbrev-text)) - ) - -(defun indent-last-expand () - "Indents last abbrev expansion. Must be called when the point is at -end of last abbrev expansion. " - (setq n (count-newlines-in-last-expand)) - (save-excursion - (previous-line n) - (while (>= n 0) - (indent-according-to-mode) - (next-line 1) - (setq n (- n 1)) - ) - ) - ) - - (defun replace-string-by-holes (start end str) "make occurrence of str holes between start and end. sets the diff --git a/generic/span-extent.el b/generic/span-extent.el index 0271c193..a2a3a2c9 100644 --- a/generic/span-extent.el +++ b/generic/span-extent.el @@ -100,7 +100,7 @@ A span is before PT if it covers the character before PT." (defalias 'span-object 'extent-object) (defalias 'span-string 'extent-string) -;Pierre: new untility functions for "holes" +;Pierre: new utility functions for "holes" (defsubst make-detached-span () "Return the buffer owning span." (make-extent nil nil) diff --git a/generic/span-overlay.el b/generic/span-overlay.el index e22c38a4..535f8a85 100644 --- a/generic/span-overlay.el +++ b/generic/span-overlay.el @@ -315,7 +315,7 @@ Behaviour is still worse than before." (buffer-substring (overlay-start span) (overlay-end span)))) -;Pierre: new untility functions for "holes" +;Pierre: new utility functions for "holes" (defun set-span-properties (span plist) "Set SPAN's properties, plist is a plist." (let ((pl plist)) |
