Skip to content

Commit

Permalink
Start of completion code
Browse files Browse the repository at this point in the history
  • Loading branch information
Espen Wiborg committed Mar 3, 2009
1 parent 283e9e8 commit 8d430e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/lisp/malabar-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -925,4 +925,9 @@ in the list")
(newline insert-lines)
(forward-line back-lines)))))

(defun malabar--expression-at-point ()
(let* ((point (point))
(pseudo-statement-start (progn (c-syntactic-skip-backward "^;,=" nil t) (point))))
(buffer-substring-no-properties pseudo-statement-start point)))

(provide 'malabar-mode)
10 changes: 10 additions & 0 deletions src/main/lisp/malabar-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@

(defun string-ends-with (string end)
(string= (substring string (- (length string) (length end))) end))

(defun string-trim (string)
(when (string-match "\\`[\r\n\t ]+" string)
(setq string (replace-match "" t t string)))
(when (string-match "[\r\n\t ]+\\'" string)
(setq string (replace-match "" t t string)))
string)

(defun string-delete-whitespace (string)
(replace-regexp-in-string "[\r\n\t ]+" "" string t t))

(defvar malabar--caches nil)

Expand Down

0 comments on commit 8d430e9

Please sign in to comment.