aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-06-23 11:38:23 -0400
committerStefan Monnier2012-06-23 11:38:23 -0400
commitdc5d230cac26a7ad04afd63bfc8db7c3df529fba (patch)
treedbe754c92c664a8bce769174e97e5660380df0c4
parente8c1cabf0330c190594cb77942a5690afee9e926 (diff)
downloademacs-dc5d230cac26a7ad04afd63bfc8db7c3df529fba.tar.gz
emacs-dc5d230cac26a7ad04afd63bfc8db7c3df529fba.zip
Miscellaneous minor cleanups and simplifications.
* lisp/help-fns.el (describe-variable): Don't croak when doc is not found. * lisp/vc/pcvs.el (cvs-retrieve-revision): Avoid toggle-read-only. * lisp/menu-bar.el (menu-bar-line-wrapping-menu): Purecopy a tiny bit more. * lisp/emacs-lisp/syntax.el (syntax-ppss): Simplify with new `if' place. * lisp/emacs-lisp/smie.el (smie-next-sexp): CSE. * lisp/emacs-lisp/macroexp.el (macroexp-let2): Fix edebug spec and avoid ((lambda ..) ..). * lisp/emacs-lisp/eieio.el (eieio-oref, slot-value): Use simpler defsetf.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/emacs-lisp/eieio.el6
-rw-r--r--lisp/emacs-lisp/macroexp.el4
-rw-r--r--lisp/emacs-lisp/smie.el13
-rw-r--r--lisp/emacs-lisp/syntax.el6
-rw-r--r--lisp/help-fns.el8
-rw-r--r--lisp/menu-bar.el11
-rw-r--r--lisp/vc/pcvs.el2
8 files changed, 38 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 22e8c23c142..d157c36e36f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12012-06-23 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * help-fns.el (describe-variable): Don't croak when doc is not found.
4 * vc/pcvs.el (cvs-retrieve-revision): Avoid toggle-read-only.
5 * menu-bar.el (menu-bar-line-wrapping-menu): Purecopy a tiny bit more.
6 * emacs-lisp/syntax.el (syntax-ppss): Simplify with new `if' place.
7 * emacs-lisp/smie.el (smie-next-sexp): CSE.
8 * emacs-lisp/macroexp.el (macroexp-let2): Fix edebug spec and avoid
9 ((lambda ..) ..).
10 * emacs-lisp/eieio.el (eieio-oref, slot-value): Use simpler defsetf.
11
12012-06-23 Chong Yidong <cyd@gnu.org> 122012-06-23 Chong Yidong <cyd@gnu.org>
2 13
3 * info.el (Info-mouse-follow-link): Accept symbol values of 14 * info.el (Info-mouse-follow-link): Accept symbol values of
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 1efb74e7139..cfba4a84d13 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -2543,10 +2543,12 @@ This is usually a symbol that starts with `:'."
2543;;; Here are some CLOS items that need the CL package 2543;;; Here are some CLOS items that need the CL package
2544;; 2544;;
2545 2545
2546(defsetf slot-value (obj slot) (store) (list 'eieio-oset obj slot store)) 2546(defsetf eieio-oref eieio-oset)
2547(defsetf eieio-oref (obj slot) (store) (list 'eieio-oset obj slot store)) 2547;; FIXME: Not needed for Emacs>=24.2 since setf follows function aliases.
2548(defsetf slot-value eieio-oset)
2548 2549
2549;; The below setf method was written by Arnd Kohrs <kohrs@acm.org> 2550;; The below setf method was written by Arnd Kohrs <kohrs@acm.org>
2551;; FIXME: Not needed for Emacs>=24.2 since setf expands macros.
2550(define-setf-method oref (obj slot) 2552(define-setf-method oref (obj slot)
2551 (with-no-warnings 2553 (with-no-warnings
2552 (require 'cl) 2554 (require 'cl)
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 6275fd1cdf8..c6e1c0fea38 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -269,11 +269,11 @@ This is like `(let ((v ,EXP)) ,EXPS) except that `v' is a new generated
269symbol which EXPS can find in VAR. 269symbol which EXPS can find in VAR.
270TEST should be the name of a predicate on EXP checking whether the `let' can 270TEST should be the name of a predicate on EXP checking whether the `let' can
271be skipped; if nil, as is usual, `macroexp-const-p' is used." 271be skipped; if nil, as is usual, `macroexp-const-p' is used."
272 (declare (indent 3) (debug (sexp form sexp body))) 272 (declare (indent 3) (debug (sexp sexp form body)))
273 (let ((bodysym (make-symbol "body")) 273 (let ((bodysym (make-symbol "body"))
274 (expsym (make-symbol "exp"))) 274 (expsym (make-symbol "exp")))
275 `(let* ((,expsym ,exp) 275 `(let* ((,expsym ,exp)
276 (,var (if (,(or test #'macroexp-const-p) ,expsym) 276 (,var (if (funcall #',(or test #'macroexp-const-p) ,expsym)
277 ,expsym (make-symbol "x"))) 277 ,expsym (make-symbol "x")))
278 (,bodysym ,(macroexp-progn exps))) 278 (,bodysym ,(macroexp-progn exps)))
279 (if (eq ,var ,expsym) ,bodysym 279 (if (eq ,var ,expsym) ,bodysym
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index be3a9828491..9fa8a108236 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -708,13 +708,12 @@ Possible return values:
708 (when (zerop (length token)) 708 (when (zerop (length token))
709 (condition-case err 709 (condition-case err
710 (progn (goto-char pos) (funcall next-sexp 1) nil) 710 (progn (goto-char pos) (funcall next-sexp 1) nil)
711 (scan-error (throw 'return 711 (scan-error
712 (list t (cl-caddr err) 712 (let ((pos (nth 2 err)))
713 (buffer-substring-no-properties 713 (throw 'return
714 (cl-caddr err) 714 (list t pos
715 (+ (cl-caddr err) 715 (buffer-substring-no-properties
716 (if (< (point) (cl-caddr err)) 716 pos (+ pos (if (< (point) pos) -1 1))))))))
717 -1 1)))))))
718 (if (eq pos (point)) 717 (if (eq pos (point))
719 ;; We did not move, so let's abort the loop. 718 ;; We did not move, so let's abort the loop.
720 (throw 'return (list t (point)))))) 719 (throw 'return (list t (point))))))
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index 748f31464e0..c3d78b3444b 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -511,10 +511,8 @@ Point is at POS when this function returns."
511 (setq ppss (parse-partial-sexp 511 (setq ppss (parse-partial-sexp
512 pt-min (setq pt-min (/ (+ pt-min pos) 2)) 512 pt-min (setq pt-min (/ (+ pt-min pos) 2))
513 nil nil ppss)) 513 nil nil ppss))
514 (let ((pair (cons pt-min ppss))) 514 (push (cons pt-min ppss)
515 (if cache-pred 515 (if cache-pred (cdr cache-pred) syntax-ppss-cache)))
516 (push pair (cdr cache-pred))
517 (push pair syntax-ppss-cache))))
518 516
519 ;; Compute the actual return value. 517 ;; Compute the actual return value.
520 (setq ppss (parse-partial-sexp pt-min pos nil nil ppss)) 518 (setq ppss (parse-partial-sexp pt-min pos nil nil ppss))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 72b494f9800..555bdbb69ce 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -806,8 +806,12 @@ it is displayed along with the global value."
806 (obsolete (get variable 'byte-obsolete-variable)) 806 (obsolete (get variable 'byte-obsolete-variable))
807 (use (car obsolete)) 807 (use (car obsolete))
808 (safe-var (get variable 'safe-local-variable)) 808 (safe-var (get variable 'safe-local-variable))
809 (doc (or (documentation-property variable 'variable-documentation) 809 (doc (condition-case err
810 (documentation-property alias 'variable-documentation))) 810 (or (documentation-property
811 variable 'variable-documentation)
812 (documentation-property
813 alias 'variable-documentation))
814 (error (format "Doc not found: %S" err))))
811 (extra-line nil)) 815 (extra-line nil))
812 ;; Add a note for variables that have been make-var-buffer-local. 816 ;; Add a note for variables that have been make-var-buffer-local.
813 (when (and (local-variable-if-set-p variable) 817 (when (and (local-variable-if-set-p variable)
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index ec6a4621a4e..64b0a18e901 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1126,11 +1126,12 @@ mail status in mode line"))
1126 (define-key menu [word-wrap] 1126 (define-key menu [word-wrap]
1127 `(menu-item 1127 `(menu-item
1128 ,(purecopy "Word Wrap (Visual Line mode)") 1128 ,(purecopy "Word Wrap (Visual Line mode)")
1129 (lambda () 1129 ,(purecopy
1130 (interactive) 1130 (lambda ()
1131 (unless visual-line-mode 1131 (interactive)
1132 (visual-line-mode 1)) 1132 (unless visual-line-mode
1133 (message ,(purecopy "Visual-Line mode enabled"))) 1133 (visual-line-mode 1))
1134 (message "Visual-Line mode enabled")))
1134 :help ,(purecopy "Wrap long lines at word boundaries") 1135 :help ,(purecopy "Wrap long lines at word boundaries")
1135 :button (:radio . (and (null truncate-lines) 1136 :button (:radio . (and (null truncate-lines)
1136 (not (truncated-partial-width-window-p)) 1137 (not (truncated-partial-width-window-p))
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el
index 6aec24755b5..0508f45149a 100644
--- a/lisp/vc/pcvs.el
+++ b/lisp/vc/pcvs.el
@@ -1758,7 +1758,7 @@ Signal an error if there is no backup file."
1758 (set-buffer-modified-p nil) 1758 (set-buffer-modified-p nil)
1759 (let ((buffer-file-name (expand-file-name file))) 1759 (let ((buffer-file-name (expand-file-name file)))
1760 (after-find-file)) 1760 (after-find-file))
1761 (toggle-read-only 1) 1761 (setq buffer-read-only t)
1762 (message "Retrieving revision %s... Done" rev) 1762 (message "Retrieving revision %s... Done" rev)
1763 (current-buffer)))))) 1763 (current-buffer))))))
1764 1764