diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 23 | ||||
-rw-r--r-- | lisp/emacs-lisp/smie.el | 53 | ||||
-rw-r--r-- | lisp/progmodes/scheme.el | 3 | ||||
-rw-r--r-- | lisp/thingatpt.el | 2 |
4 files changed, 54 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2c729e3d5b7..6ac3515c480 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,21 @@ +2013-03-16 Leo Liu <sdl.web@gmail.com> + + * progmodes/scheme.el: Add indentation and font-locking for λ. + (Bug#13975) + +2013-03-16 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/smie.el (smie-auto-fill): Don't inf-loop if there's no + token before point (bug#13942). + +2013-03-16 Leo Liu <sdl.web@gmail.com> + + * thingatpt.el (end-of-sexp): Fix bug#13952. Use syntax-after. + +2013-03-16 Glenn Morris <rgm@gnu.org> + + * Version 24.3 released. + 2013-03-16 Eli Zaretskii <eliz@gnu.org> * startup.el (command-line-normalize-file-name): Fix handling of @@ -571,6 +589,11 @@ Let-bind `isearch-other-end' to `start', `isearch-forward' to t and `isearch-error' to nil. +2013-03-16 Fabián Ezequiel Gallina <fgallina@cuca> + + * progmodes/python.el (python-info-current-defun): + Enhance match-data cluttering prevention. + 2013-02-22 Michael Albinus <michael.albinus@gmx.de> * net/tramp.el (tramp-tramp-file-p): Fix docstring. diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index eb3fa8f3b09..18cc0e811ce 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -1631,31 +1631,34 @@ to which that point should be aligned, if we were to reindent it.") (defun smie-auto-fill () (let ((fc (current-fill-column))) (while (and fc (> (current-column) fc)) - (cond - ((not (or (nth 8 (save-excursion - (syntax-ppss (line-beginning-position)))) - (nth 8 (syntax-ppss)))) - (save-excursion - (beginning-of-line) - (smie-indent-forward-token) - (let ((bsf (point)) - (gain 0) - curcol) - (while (<= (setq curcol (current-column)) fc) - ;; FIXME? `smie-indent-calculate' can (and often will) - ;; return a result that actually depends on the presence/absence - ;; of a newline, so the gain computed here may not be accurate, - ;; but in practice it seems to works well enough. - (let* ((newcol (smie-indent-calculate)) - (newgain (- curcol newcol))) - (when (> newgain gain) - (setq gain newgain) - (setq bsf (point)))) - (smie-indent-forward-token)) - (when (> gain 0) - (goto-char bsf) - (newline-and-indent))))) - (t (do-auto-fill)))))) + (or (unless (or (nth 8 (save-excursion + (syntax-ppss (line-beginning-position)))) + (nth 8 (syntax-ppss))) + (save-excursion + (let ((end (point)) + (bsf (progn (beginning-of-line) + (smie-indent-forward-token) + (point))) + (gain 0) + curcol) + (while (and (<= (point) end) + (<= (setq curcol (current-column)) fc)) + ;; FIXME? `smie-indent-calculate' can (and often will) + ;; return a result that actually depends on the + ;; presence/absence of a newline, so the gain computed here + ;; may not be accurate, but in practice it seems to works + ;; well enough. + (let* ((newcol (smie-indent-calculate)) + (newgain (- curcol newcol))) + (when (> newgain gain) + (setq gain newgain) + (setq bsf (point)))) + (smie-indent-forward-token)) + (when (> gain 0) + (goto-char bsf) + (newline-and-indent) + 'done)))) + (do-auto-fill))))) (defun smie-setup (grammar rules-function &rest keywords) diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index aae5526ea82..fab20102097 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -310,7 +310,7 @@ See `run-hooks'." "(" (regexp-opt '("begin" "call-with-current-continuation" "call/cc" "call-with-input-file" "call-with-output-file" "case" "cond" - "do" "else" "for-each" "if" "lambda" + "do" "else" "for-each" "if" "lambda" "λ" "let" "let*" "let-syntax" "letrec" "letrec-syntax" ;; SRFI 11 usage comes up often enough. "let-values" "let*-values" @@ -410,6 +410,7 @@ that variable's value is a string." (put 'make 'scheme-indent-function 1) (put 'style 'scheme-indent-function 1) (put 'root 'scheme-indent-function 1) +(put 'λ 'scheme-indent-function 1) (defvar dsssl-font-lock-keywords (eval-when-compile diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 9526cb76e74..259cd772b12 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -182,7 +182,7 @@ The bounds of THING are determined by `bounds-of-thing-at-point'." (defun end-of-sexp () "Move point to the end of the current sexp. \[This is an internal function.]" - (let ((char-syntax (char-syntax (char-after)))) + (let ((char-syntax (syntax-after (point)))) (if (or (eq char-syntax ?\)) (and (eq char-syntax ?\") (in-string-p))) (forward-char 1) |