summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-03-17 05:17:24 -0600
committerTom Tromey <tromey@redhat.com>2013-03-17 05:17:24 -0600
commit6bd488cd8d05aa3983ca55f70ee384732d8c0085 (patch)
tree5645fc7b882638d6c0eb3f61fd55bde1a63fc190 /lisp/emacs-lisp
parent71f91792e3013b397996905224f387da5cc539a9 (diff)
parent9c44569ea2a18099307e0571d523d8637000a153 (diff)
downloademacs-6bd488cd8d05aa3983ca55f70ee384732d8c0085.tar.gz
emacs-6bd488cd8d05aa3983ca55f70ee384732d8c0085.tar.bz2
emacs-6bd488cd8d05aa3983ca55f70ee384732d8c0085.zip
merge from trunk
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-run.el7
-rw-r--r--lisp/emacs-lisp/crm.el3
-rw-r--r--lisp/emacs-lisp/smie.el53
3 files changed, 34 insertions, 29 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 48bcefaee1a..8f0999b2f80 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -79,7 +79,8 @@ The return value of this function is not used."
(list 'quote f) (list 'quote arglist) (list 'quote when))))
(list 'obsolete
#'(lambda (f _args new-name when)
- `(make-obsolete ',f ',new-name ,when)))
+ (list 'make-obsolete
+ (list 'quote f) (list 'quote new-name) (list 'quote when))))
(list 'compiler-macro
#'(lambda (f args compiler-function)
;; FIXME: Make it possible to just reuse `args'.
@@ -378,7 +379,7 @@ obsolete."
(defmacro dont-compile (&rest body)
"Like `progn', but the body always runs interpreted (not compiled).
If you think you need this, you're probably making a mistake somewhere."
- (declare (debug t) (indent 0))
+ (declare (debug t) (indent 0) (obsolete nil "24.4"))
(list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))
@@ -402,9 +403,9 @@ In interpreted code, this is entirely equivalent to `progn'."
;; macroexpansion.
(list 'quote (eval (cons 'progn body) lexical-binding)))
-(put 'with-no-warnings 'lisp-indent-function 0)
(defun with-no-warnings (&rest body)
"Like `progn', but prevents compiler warnings in the body."
+ (declare (indent 0))
;; The implementation for the interpreter is basically trivial.
(car (last body)))
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index f88cb0ef9bb..e1e1847dd59 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -287,7 +287,8 @@ INHERIT-INPUT-METHOD."
prompt initial-input map
nil hist def inherit-input-method)))
(and def (string-equal input "") (setq input def))
- (split-string input crm-separator)))
+ ;; Ignore empty strings in the list of return values.
+ (split-string input crm-separator t)))
(remove-hook 'choose-completion-string-functions
'crm--choose-completion-string)))
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)