[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108706: Miscellaneous minor clean
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108706: Miscellaneous minor cleanups and simplifications. |
Date: |
Fri, 02 Nov 2012 02:01:41 -0000 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 108706
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sat 2012-06-23 11:38:23 -0400
message:
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.
modified:
lisp/ChangeLog
lisp/emacs-lisp/eieio.el
lisp/emacs-lisp/macroexp.el
lisp/emacs-lisp/smie.el
lisp/emacs-lisp/syntax.el
lisp/help-fns.el
lisp/menu-bar.el
lisp/vc/pcvs.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-06-23 13:32:29 +0000
+++ b/lisp/ChangeLog 2012-06-23 15:38:23 +0000
@@ -1,3 +1,14 @@
+2012-06-23 Stefan Monnier <address@hidden>
+
+ * help-fns.el (describe-variable): Don't croak when doc is not found.
+ * vc/pcvs.el (cvs-retrieve-revision): Avoid toggle-read-only.
+ * menu-bar.el (menu-bar-line-wrapping-menu): Purecopy a tiny bit more.
+ * emacs-lisp/syntax.el (syntax-ppss): Simplify with new `if' place.
+ * emacs-lisp/smie.el (smie-next-sexp): CSE.
+ * emacs-lisp/macroexp.el (macroexp-let2): Fix edebug spec and avoid
+ ((lambda ..) ..).
+ * emacs-lisp/eieio.el (eieio-oref, slot-value): Use simpler defsetf.
+
2012-06-23 Chong Yidong <address@hidden>
* info.el (Info-mouse-follow-link): Accept symbol values of
=== modified file 'lisp/emacs-lisp/eieio.el'
--- a/lisp/emacs-lisp/eieio.el 2012-06-12 05:47:14 +0000
+++ b/lisp/emacs-lisp/eieio.el 2012-06-23 15:38:23 +0000
@@ -2543,10 +2543,12 @@
;;; Here are some CLOS items that need the CL package
;;
-(defsetf slot-value (obj slot) (store) (list 'eieio-oset obj slot store))
-(defsetf eieio-oref (obj slot) (store) (list 'eieio-oset obj slot store))
+(defsetf eieio-oref eieio-oset)
+;; FIXME: Not needed for Emacs>=24.2 since setf follows function aliases.
+(defsetf slot-value eieio-oset)
;; The below setf method was written by Arnd Kohrs <address@hidden>
+;; FIXME: Not needed for Emacs>=24.2 since setf expands macros.
(define-setf-method oref (obj slot)
(with-no-warnings
(require 'cl)
=== modified file 'lisp/emacs-lisp/macroexp.el'
--- a/lisp/emacs-lisp/macroexp.el 2012-06-22 13:42:38 +0000
+++ b/lisp/emacs-lisp/macroexp.el 2012-06-23 15:38:23 +0000
@@ -269,11 +269,11 @@
symbol which EXPS can find in VAR.
TEST should be the name of a predicate on EXP checking whether the `let' can
be skipped; if nil, as is usual, `macroexp-const-p' is used."
- (declare (indent 3) (debug (sexp form sexp body)))
+ (declare (indent 3) (debug (sexp sexp form body)))
(let ((bodysym (make-symbol "body"))
(expsym (make-symbol "exp")))
`(let* ((,expsym ,exp)
- (,var (if (,(or test #'macroexp-const-p) ,expsym)
+ (,var (if (funcall #',(or test #'macroexp-const-p) ,expsym)
,expsym (make-symbol "x")))
(,bodysym ,(macroexp-progn exps)))
(if (eq ,var ,expsym) ,bodysym
=== modified file 'lisp/emacs-lisp/smie.el'
--- a/lisp/emacs-lisp/smie.el 2012-06-22 13:42:38 +0000
+++ b/lisp/emacs-lisp/smie.el 2012-06-23 15:38:23 +0000
@@ -708,13 +708,12 @@
(when (zerop (length token))
(condition-case err
(progn (goto-char pos) (funcall next-sexp 1) nil)
- (scan-error (throw 'return
- (list t (cl-caddr err)
- (buffer-substring-no-properties
- (cl-caddr err)
- (+ (cl-caddr err)
- (if (< (point) (cl-caddr err))
- -1 1)))))))
+ (scan-error
+ (let ((pos (nth 2 err)))
+ (throw 'return
+ (list t pos
+ (buffer-substring-no-properties
+ pos (+ pos (if (< (point) pos) -1 1))))))))
(if (eq pos (point))
;; We did not move, so let's abort the loop.
(throw 'return (list t (point))))))
=== modified file 'lisp/emacs-lisp/syntax.el'
--- a/lisp/emacs-lisp/syntax.el 2012-06-22 13:42:38 +0000
+++ b/lisp/emacs-lisp/syntax.el 2012-06-23 15:38:23 +0000
@@ -511,10 +511,8 @@
(setq ppss (parse-partial-sexp
pt-min (setq pt-min (/ (+ pt-min pos) 2))
nil nil ppss))
- (let ((pair (cons pt-min ppss)))
- (if cache-pred
- (push pair (cdr cache-pred))
- (push pair syntax-ppss-cache))))
+ (push (cons pt-min ppss)
+ (if cache-pred (cdr cache-pred) syntax-ppss-cache)))
;; Compute the actual return value.
(setq ppss (parse-partial-sexp pt-min pos nil nil ppss))
=== modified file 'lisp/help-fns.el'
--- a/lisp/help-fns.el 2012-06-11 20:35:00 +0000
+++ b/lisp/help-fns.el 2012-06-23 15:38:23 +0000
@@ -806,8 +806,12 @@
(obsolete (get variable 'byte-obsolete-variable))
(use (car obsolete))
(safe-var (get variable 'safe-local-variable))
- (doc (or (documentation-property variable
'variable-documentation)
- (documentation-property alias
'variable-documentation)))
+ (doc (condition-case err
+ (or (documentation-property
+ variable 'variable-documentation)
+ (documentation-property
+ alias 'variable-documentation))
+ (error (format "Doc not found: %S" err))))
(extra-line nil))
;; Add a note for variables that have been make-var-buffer-local.
(when (and (local-variable-if-set-p variable)
=== modified file 'lisp/menu-bar.el'
--- a/lisp/menu-bar.el 2012-05-22 03:31:34 +0000
+++ b/lisp/menu-bar.el 2012-06-23 15:38:23 +0000
@@ -1126,11 +1126,12 @@
(define-key menu [word-wrap]
`(menu-item
,(purecopy "Word Wrap (Visual Line mode)")
- (lambda ()
- (interactive)
- (unless visual-line-mode
- (visual-line-mode 1))
- (message ,(purecopy "Visual-Line mode enabled")))
+ ,(purecopy
+ (lambda ()
+ (interactive)
+ (unless visual-line-mode
+ (visual-line-mode 1))
+ (message "Visual-Line mode enabled")))
:help ,(purecopy "Wrap long lines at word boundaries")
:button (:radio . (and (null truncate-lines)
(not (truncated-partial-width-window-p))
=== modified file 'lisp/vc/pcvs.el'
--- a/lisp/vc/pcvs.el 2012-04-16 23:57:09 +0000
+++ b/lisp/vc/pcvs.el 2012-06-23 15:38:23 +0000
@@ -1758,7 +1758,7 @@
(set-buffer-modified-p nil)
(let ((buffer-file-name (expand-file-name file)))
(after-find-file))
- (toggle-read-only 1)
+ (setq buffer-read-only t)
(message "Retrieving revision %s... Done" rev)
(current-buffer))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108706: Miscellaneous minor cleanups and simplifications.,
Stefan Monnier <=