fix(emacs): use looking-at instead of char-after

This commit is contained in:
Soonho Kong 2014-09-09 13:22:07 -07:00
parent 85bd112a37
commit 70dcc2e122
3 changed files with 5 additions and 8 deletions

View file

@ -640,11 +640,10 @@ Take out \"BEGININFO\" and \"ENDINFO\" and Use \"ACK\" as a delim."
(let* ((file-name (buffer-file-name))
(line-number (line-number-at-pos))
(column-number (current-column))
(cur-char (char-after (point)))
(cmd (cond ((and cur-char (char-equal cur-char ?\())
(cmd (cond ((looking-at "(")
(lean-cmd-info line-number column-number))
;; TODO(soonhok): give information on '('
;; ((char-equal cur-char ?\))
;; ((looking-at ")")
;; (let ((begin-pos (lean-get-begin-paren-pos)))
;; (lean-cmd-info (car begin-pos) (cdr begin-pos))))
(t (lean-cmd-info line-number)))))

View file

@ -446,10 +446,8 @@ If it's not the same with file-name (default: buffer-file-name), send VISIT cmd.
(defun lean-server-get-info-record-at-pos (body)
(let* ((file-name (buffer-file-name))
(column (current-column))
(cur-char (char-after (point))))
(when (and cur-char
(--any? (char-equal cur-char it) '(?\s ?\t ?\, ?\) ?\} ?\]))
(column (current-column)))
(when (and (looking-at (or white "," ")" "}" "]"))
(> column 1))
(setq column (1- column)))
(lean-info-record-parse body file-name column)))

View file

@ -23,7 +23,7 @@
(replace-regexp-in-string "?M_[0-9]+" "_" (lean-info-synth-body-str synth))))
(when (search " " synth-str)
(setq synth-str (concat "(" synth-str ")")))
(when (char-equal (char-after (point)) ?_)
(when (looking-at "_")
(delete-forward-char 1)
(insert synth-str))))))