Now on revision 109965. ------------------------------------------------------------ revno: 109965 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-09-10 11:25:10 +0800 message: * fns.c (Fdelq, Fdelete): Doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-10 01:17:23 +0000 +++ src/ChangeLog 2012-09-10 03:25:10 +0000 @@ -1,3 +1,7 @@ +2012-09-10 Chong Yidong + + * fns.c (Fdelq, Fdelete): Doc fix. + 2012-09-10 Paul Eggert * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL) === modified file 'src/fns.c' --- src/fns.c 2012-09-05 07:18:46 +0000 +++ src/fns.c 2012-09-10 03:25:10 +0000 @@ -1527,11 +1527,14 @@ } DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0, - doc: /* Delete by side effect any occurrences of ELT as a member of LIST. -The modified LIST is returned. Comparison is done with `eq'. -If the first member of LIST is ELT, there is no way to remove it by side effect; -therefore, write `(setq foo (delq element foo))' -to be sure of changing the value of `foo'. */) + doc: /* Delete members of LIST which are `eq' to ELT, and return the result. +More precisely, this function skips any members `eq' to ELT at the +front of LIST, then removes members `eq' to ELT from the remaining +sublist by modifying its list structure, then returns the resulting +list. + +Write `(setq foo (delq element foo))' to be sure of correctly changing +the value of a list `foo'. */) (register Lisp_Object elt, Lisp_Object list) { register Lisp_Object tail, prev; @@ -1559,13 +1562,19 @@ } DEFUN ("delete", Fdelete, Sdelete, 2, 2, 0, - doc: /* Delete by side effect any occurrences of ELT as a member of SEQ. -SEQ must be a list, a vector, or a string. -The modified SEQ is returned. Comparison is done with `equal'. -If SEQ is not a list, or the first member of SEQ is ELT, deleting it -is not a side effect; it is simply using a different sequence. -Therefore, write `(setq foo (delete element foo))' -to be sure of changing the value of `foo'. */) + doc: /* Delete members of SEQ which are `equal' to ELT, and return the result. +SEQ must be a sequence (i.e. a list, a vector, or a string). +The return value is a sequence of the same type. + +If SEQ is a list, this behaves like `delq', except that it compares +with `equal' instead of `eq'. In particular, it may remove elements +by altering the list structure. + +If SEQ is not a list, deletion is never performed destructively; +instead this function creates and returns a new vector or string. + +Write `(setq foo (delete element foo))' to be sure of correctly +changing the value of a sequence `foo'. */) (Lisp_Object elt, Lisp_Object seq) { if (VECTORP (seq)) ------------------------------------------------------------ revno: 109964 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-09 18:17:23 -0700 message: Parenthesize macro bodies. * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL) (XSETFLOAT, XSETMISC): Parenthesize. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-09 21:24:04 +0000 +++ src/ChangeLog 2012-09-10 01:17:23 +0000 @@ -1,3 +1,8 @@ +2012-09-10 Paul Eggert + + * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL) + (XSETFLOAT, XSETMISC): Parenthesize macro bodies. + 2012-09-09 Stefan Monnier * lisp.h (make_lisp_ptr): New macro to replace XSET. === modified file 'src/lisp.h' --- src/lisp.h 2012-09-09 21:24:04 +0000 +++ src/lisp.h 2012-09-10 01:17:23 +0000 @@ -554,16 +554,16 @@ /* Construct a Lisp_Object from a value or address. */ -#define XSETINT(a, b) (a) = make_number (b) -#define XSETCONS(a, b) (a) = make_lisp_ptr (b, Lisp_Cons) -#define XSETVECTOR(a, b) (a) = make_lisp_ptr (b, Lisp_Vectorlike) -#define XSETSTRING(a, b) (a) = make_lisp_ptr (b, Lisp_String) -#define XSETSYMBOL(a, b) (a) = make_lisp_ptr (b, Lisp_Symbol) -#define XSETFLOAT(a, b) (a) = make_lisp_ptr (b, Lisp_Float) +#define XSETINT(a, b) ((a) = make_number (b)) +#define XSETCONS(a, b) ((a) = make_lisp_ptr (b, Lisp_Cons)) +#define XSETVECTOR(a, b) ((a) = make_lisp_ptr (b, Lisp_Vectorlike)) +#define XSETSTRING(a, b) ((a) = make_lisp_ptr (b, Lisp_String)) +#define XSETSYMBOL(a, b) ((a) = make_lisp_ptr (b, Lisp_Symbol)) +#define XSETFLOAT(a, b) ((a) = make_lisp_ptr (b, Lisp_Float)) /* Misc types. */ -#define XSETMISC(a, b) (a) = make_lisp_ptr (b, Lisp_Misc) +#define XSETMISC(a, b) ((a) = make_lisp_ptr (b, Lisp_Misc)) #define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker) /* Pseudovector types. */ ------------------------------------------------------------ revno: 109963 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-09-09 21:16:13 -0400 message: New emacs-lisp-byte-code-mode; misc minor changes. * lisp/emacs-lisp/lisp-mode.el (emacs-list-byte-code-comment-re): New var. (emacs-lisp-byte-code-comment) (emacs-lisp-byte-code-syntax-propertize, emacs-lisp-byte-code-mode): New functions. (eval-sexp-add-defvars): Don't skip defvars in column >0. (eval-defun-2): Remove bogus interactive spec. (lisp-indent-line): Remove redundant whole-exp code, now done in indent-according-to-mode. (save-match-data): Remove redundant indent data. * lisp/emacs-lisp/benchmark.el (benchmark-run, benchmark-run-compiled): Use `declare'. * lisp/gnus/qp.el (quoted-printable-decode-region): Inline+CSE+strength-reduction. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-09 22:15:24 +0000 +++ lisp/ChangeLog 2012-09-10 01:16:13 +0000 @@ -1,3 +1,18 @@ +2012-09-10 Stefan Monnier + + * emacs-lisp/lisp-mode.el (emacs-list-byte-code-comment-re): New var. + (emacs-lisp-byte-code-comment) + (emacs-lisp-byte-code-syntax-propertize, emacs-lisp-byte-code-mode): + New functions. + (eval-sexp-add-defvars): Don't skip defvars in column >0. + (eval-defun-2): Remove bogus interactive spec. + (lisp-indent-line): Remove redundant whole-exp code, now done in + indent-according-to-mode. + (save-match-data): Remove redundant indent data. + + * emacs-lisp/benchmark.el (benchmark-run, benchmark-run-compiled): + Use `declare'. + 2012-09-09 Juri Linkov * replace.el (replace-regexp-lax-whitespace): New defcustom. === modified file 'lisp/emacs-lisp/benchmark.el' --- lisp/emacs-lisp/benchmark.el 2012-01-19 07:21:25 +0000 +++ lisp/emacs-lisp/benchmark.el 2012-09-10 01:16:13 +0000 @@ -53,6 +53,7 @@ Return a list of the total elapsed time for execution, the number of garbage collections that ran, and the time taken by garbage collection. See also `benchmark-run-compiled'." + (declare (indent 1) (debug t)) (unless (natnump repetitions) (setq forms (cons repetitions forms) repetitions 1)) @@ -69,8 +70,6 @@ `(benchmark-elapse ,@forms)) (- gcs-done ,gcs) (- gc-elapsed ,gc))))) -(put 'benchmark-run 'edebug-form-spec t) -(put 'benchmark-run 'lisp-indent-function 2) ;;;###autoload (defmacro benchmark-run-compiled (&optional repetitions &rest forms) @@ -78,6 +77,7 @@ This is like `benchmark-run', but what is timed is a funcall of the byte code obtained by wrapping FORMS in a `lambda' and compiling the result. The overhead of the `lambda's is accounted for." + (declare (indent 1) (debug t)) (unless (natnump repetitions) (setq forms (cons repetitions forms) repetitions 1)) @@ -96,8 +96,6 @@ (funcall ,lambda-code)))) `(benchmark-elapse (funcall ,code))) (- gcs-done ,gcs) (- gc-elapsed ,gc))))) -(put 'benchmark-run-compiled 'edebug-form-spec t) -(put 'benchmark-run-compiled 'lisp-indent-function 2) ;;;###autoload (defun benchmark (repetitions form) === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2012-09-07 08:58:31 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2012-09-10 01:16:13 +0000 @@ -260,7 +260,7 @@ ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "9f9bae5b8ccaf325bd59ba9be2b27c44") +;;;;;; "cl-macs" "cl-macs.el" "6d0676869af66e5b5a671f95ee069461") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2012-09-06 15:35:08 +0000 +++ lisp/emacs-lisp/cl-macs.el 2012-09-10 01:16:13 +0000 @@ -1463,8 +1463,15 @@ cl--loop-accum-var)))) (defun cl--loop-build-ands (clauses) + "Return various representations of (and . CLAUSES). +CLAUSES is a list of Elisp expressions, where clauses of the form +\(progn E1 E2 E3 .. t) are the focus of particular optimizations. +The return value has shape (COND BODY COMBO) +such that COMBO is equivalent to (and . CLAUSES)." (let ((ands nil) (body nil)) + ;; Look through `clauses', trying to optimize (progn ,@A t) (progn ,@B) ,@C + ;; into (progn ,@A ,@B) ,@C. (while clauses (if (and (eq (car-safe (car clauses)) 'progn) (eq (car (last (car clauses))) t)) @@ -1475,6 +1482,7 @@ (cl-cdadr clauses) (list (cadr clauses)))) (cddr clauses))) + ;; A final (progn ,@A t) is moved outside of the `and'. (setq body (cdr (butlast (pop clauses))))) (push (pop clauses) ands))) (setq ands (or (nreverse ands) (list t))) === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2012-08-08 18:56:01 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2012-09-10 01:16:13 +0000 @@ -431,6 +431,61 @@ (add-hook 'completion-at-point-functions 'lisp-completion-at-point nil 'local)) +;;; Emacs Lisp Byte-Code mode + +(eval-and-compile + (defconst emacs-list-byte-code-comment-re + (concat "\\(#\\)@\\([0-9]+\\) " + ;; Make sure it's a docstring and not a lazy-loaded byte-code. + "\\(?:[^(]\\|([^\"]\\)"))) + +(defun emacs-lisp-byte-code-comment (end &optional _point) + "Try to syntactically mark the #@NNN ....^_ docstrings in byte-code files." + (let ((ppss (syntax-ppss))) + (when (and (nth 4 ppss) + (eq (char-after (nth 8 ppss)) ?#)) + (let* ((n (save-excursion + (goto-char (nth 8 ppss)) + (when (looking-at emacs-list-byte-code-comment-re) + (string-to-number (match-string 2))))) + ;; `maxdiff' tries to make sure the loop below terminates. + (maxdiff n)) + (when n + (let* ((bchar (match-end 2)) + (b (position-bytes bchar))) + (goto-char (+ b n)) + (while (let ((diff (- (position-bytes (point)) b n))) + (unless (zerop diff) + (when (> diff maxdiff) (setq diff maxdiff)) + (forward-char (- diff)) + (setq maxdiff (if (> diff 0) diff + (max (1- maxdiff) 1))) + t)))) + (if (<= (point) end) + (put-text-property (1- (point)) (point) + 'syntax-table + (string-to-syntax "> b")) + (goto-char end))))))) + +(defun emacs-lisp-byte-code-syntax-propertize (start end) + (emacs-lisp-byte-code-comment end (point)) + (funcall + (syntax-propertize-rules + (emacs-list-byte-code-comment-re + (1 (prog1 "< b" (emacs-lisp-byte-code-comment end (point)))))) + start end)) + +(add-to-list 'auto-mode-alist '("\\.elc\\'" . emacs-lisp-byte-code-mode)) +(define-derived-mode emacs-lisp-byte-code-mode emacs-lisp-mode + "Elisp-Byte-Code" + "Major mode for *.elc files." + ;; TODO: Add way to disassemble byte-code under point. + (setq-local open-paren-in-column-0-is-defun-start nil) + (setq-local syntax-propertize-function + #'emacs-lisp-byte-code-syntax-propertize)) + +;;; Generic Lisp mode. + (defvar lisp-mode-map (let ((map (make-sparse-keymap)) (menu-map (make-sparse-keymap "Lisp"))) @@ -730,10 +785,12 @@ (let ((vars ())) (goto-char (point-min)) (while (re-search-forward - "^(def\\(?:var\\|const\\|custom\\)[ \t\n]+\\([^; '()\n\t]+\\)" + "(def\\(?:var\\|const\\|custom\\)[ \t\n]+\\([^; '()\n\t]+\\)" pos t) (let ((var (intern (match-string 1)))) - (unless (special-variable-p var) + (and (not (special-variable-p var)) + (save-excursion + (zerop (car (syntax-ppss (match-beginning 0))))) (push var vars)))) `(progn ,@(mapcar (lambda (v) `(defvar ,v)) vars) ,exp))))) @@ -820,7 +877,6 @@ With argument, insert value in current buffer after the defun. Return the result of evaluation." - (interactive "P") ;; FIXME: the print-length/level bindings should only be applied while ;; printing, not while evaluating. (let ((debug-on-error eval-expression-debug-on-error) @@ -925,6 +981,7 @@ (if (or (null indent) (looking-at "\\s<\\s<\\s<")) ;; Don't alter indentation of a ;;; comment line ;; or a line that starts in a string. + ;; FIXME: inconsistency: comment-indent moves ;;; to column 0. (goto-char (- (point-max) pos)) (if (and (looking-at "\\s<") (not (looking-at "\\s<\\s<"))) ;; Single-semicolon comment lines should be indented @@ -939,18 +996,7 @@ ;; If initial point was within line's indentation, ;; position after the indentation. Else stay at same point in text. (if (> (- (point-max) pos) (point)) - (goto-char (- (point-max) pos))) - ;; If desired, shift remaining lines of expression the same amount. - (and whole-exp (not (zerop shift-amt)) - (save-excursion - (goto-char beg) - (forward-sexp 1) - (setq end (point)) - (goto-char beg) - (forward-line 1) - (setq beg (point)) - (> end beg)) - (indent-code-rigidly beg end shift-amt))))) + (goto-char (- (point-max) pos)))))) (defvar calculate-lisp-indent-last-sexp) @@ -1230,7 +1276,6 @@ (put 'prog2 'lisp-indent-function 2) (put 'save-excursion 'lisp-indent-function 0) (put 'save-restriction 'lisp-indent-function 0) -(put 'save-match-data 'lisp-indent-function 0) (put 'save-current-buffer 'lisp-indent-function 0) (put 'let 'lisp-indent-function 1) (put 'let* 'lisp-indent-function 1) === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-09-07 04:07:00 +0000 +++ lisp/gnus/ChangeLog 2012-09-10 01:16:13 +0000 @@ -1,3 +1,7 @@ +2012-09-10 Stefan Monnier + + * qp.el (quoted-printable-decode-region): Inline+CSE+strength-reduction. + 2012-09-07 Chong Yidong * gnus-util.el === modified file 'lisp/gnus/qp.el' --- lisp/gnus/qp.el 2012-09-06 01:45:33 +0000 +++ lisp/gnus/qp.el 2012-09-10 01:16:13 +0000 @@ -53,14 +53,7 @@ ;; or both of which are lowercase letters in "abcdef", is ;; formally illegal. A robust implementation might choose to ;; recognize them as the corresponding uppercase letters.'' - (let ((case-fold-search t) - (decode-hex #'(lambda (n1 n2) - (+ (* (if (<= n1 ?9) (- n1 ?0) - (if (<= n1 ?F) (+ (- n1 ?A) 10) - (+ (- n1 ?a) 10))) 16) - (if (<= n2 ?9) (- n2 ?0) - (if (<= n2 ?F) (+ (- n2 ?A) 10) - (+ (- n2 ?a) 10))))))) + (let ((case-fold-search t)) (narrow-to-region from to) ;; Do this in case we're called from Gnus, say, in a buffer ;; which already contains non-ASCII characters which would @@ -78,8 +71,15 @@ (let* ((n (/ (- (match-end 0) (point)) 3)) (str (make-string n 0))) (dotimes (i n) - (aset str i (funcall decode-hex (char-after (1+ (point))) - (char-after (+ 2 (point))))) + (let ((n1 (char-after (1+ (point)))) + (n2 (char-after (+ 2 (point))))) + (aset str i + (+ (* 16 (- n1 (if (<= n1 ?9) ?0 + (if (<= n1 ?F) (- ?A 10) + (- ?a 10))))) + (- n2 (if (<= n2 ?9) ?0 + (if (<= n2 ?F) (- ?A 10) + (- ?a 10))))))) (forward-char 3)) (delete-region (match-beginning 0) (match-end 0)) (insert str))) ------------------------------------------------------------ revno: 109962 fixes bug: http://debbugs.gnu.org/12376 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-09 18:03:27 -0700 message: Improve robustness of 'make bootstrap'. Run autogen.sh after bootstrap-clean, to avoid bzr pull issues. * INSTALL, README: Document autogen.sh. * Makefile.in (Makefile): Mark it as precious, since it's updated atomically. (MAKE_CONFIG_STATUS): New macro. (config.status, bootstrap): Use it. This causes 'make bootstrap' to run config.status with the --recheck option, which is more appropriate for a bootstrap. (bootstrap): Run autogen.sh right after cleaning. Don't worry about failures due to missing tools. * autogen.sh: Exit with status 101 when failing due to missing tools. * make-dist: Distribute autogen.sh. diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-09 16:06:33 +0000 +++ ChangeLog 2012-09-10 01:03:27 +0000 @@ -1,3 +1,19 @@ +2012-09-10 Paul Eggert + + Improve robustness of 'make bootstrap' (Bug#12376). + Run autogen.sh after bootstrap-clean, to avoid bzr pull issues. + * INSTALL, README: Document autogen.sh. + * Makefile.in (Makefile): Mark it as precious, since it's updated + atomically. + (MAKE_CONFIG_STATUS): New macro. + (config.status, bootstrap): Use it. This causes 'make bootstrap' + to run config.status with the --recheck option, which is more + appropriate for a bootstrap. + (bootstrap): Run autogen.sh right after cleaning. Don't worry + about failures due to missing tools. + * autogen.sh: Exit with status 101 when failing due to missing tools. + * make-dist: Distribute autogen.sh. + 2012-09-09 Paul Eggert Assume C89 or later for math functions (Bug#12381). === modified file 'INSTALL' --- INSTALL 2012-08-08 16:17:15 +0000 +++ INSTALL 2012-09-10 01:03:27 +0000 @@ -695,9 +695,9 @@ corresponding `Makefile.in' files. This isn't so hard, just a matter of editing in appropriate substitutions for the @...@ constructs. -The `configure' script is built from `configure.ac' by the `autoconf' -program. You need at least the version of autoconf specified in the -AC_PREREQ(...) command to rebuild `configure' from `configure.ac'. +The `configure' script is built from `configure.ac' by the +`autogen.sh' script, which checks that `autoconf' and other build +tools are sufficiently up to date and then runs the build tools. BUILDING GNU EMACS BY HAND === modified file 'Makefile.in' --- Makefile.in 2012-08-22 06:55:44 +0000 +++ Makefile.in 2012-09-10 01:03:27 +0000 @@ -360,15 +360,17 @@ $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) ./config.status -# Don't erase config.status if make is interrupted while refreshing it. -.PRECIOUS: config.status +# Don't erase these files if make is interrupted while refreshing them. +.PRECIOUS: Makefile config.status -config.status: ${srcdir}/configure ${srcdir}/lisp/version.el +MAKE_CONFIG_STATUS = \ if [ -x ./config.status ]; then \ ./config.status --recheck; \ else \ ./configure $(CONFIGURE_FLAGS); \ fi +config.status: ${srcdir}/configure ${srcdir}/lisp/version.el + $(MAKE_CONFIG_STATUS) AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 @@ -383,6 +385,10 @@ $(srcdir)/lib/gnulib.mk $(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS) cd $(srcdir) && automake --gnu -a -c lib/Makefile + +# Regenerate files that this makefile would have made, if this makefile +# had been built by Automake. The name 'am--refresh' is for +# compatibility with subsidiary Automake-generated makefiles. am--refresh: $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/src/config.in .PHONY: am--refresh @@ -776,8 +782,6 @@ (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean) [ ! -f config.log ] || mv -f config.log config.log~ ${top_bootclean} -## configure; make bootstrap replaces the real config.log from configure -## with the truncated one from config.status. The former is more useful. ### `maintainer-clean' ### Delete everything from the current directory that can be @@ -883,14 +887,14 @@ .PHONY: bootstrap -## configure; make bootstrap replaces the real config.log from configure -## with the truncated one from config.status. The former is more useful. +# Bootstrapping does the following: +# * Remove files to start from a clean slate. +# * Run autogen.sh, but don't worry about exit status 101 (missing tools). +# * Build Makefile, to build the build procedure itself. +# * Do the actual build. bootstrap: bootstrap-clean FRC - if [ -x ./config.status ]; then \ - ./config.status; \ - else \ - ./configure $(CONFIGURE_FLAGS); \ - fi + cd $(srcdir) && { ./autogen.sh || test $$? -eq 101; } + $(MAKE_CONFIG_STATUS) $(MAKE) $(MFLAGS) info all .PHONY: check-declare === modified file 'README' --- README 2012-08-28 16:01:59 +0000 +++ README 2012-09-10 01:03:27 +0000 @@ -41,9 +41,14 @@ construct the `configure' script. Since Emacs has some configuration requirements that autoconf can't meet directly, and for historical reasons, `configure.ac' uses an unholy marriage of custom-baked -configuration code and autoconf macros. If you want to rebuild -`configure' from `configure.ac', you will need to install a recent -version of autoconf and GNU m4. +configuration code and autoconf macros. + +The shell script `autogen.sh' generates 'configure' and other files by +running the GNU build tools autoconf and automake, which in turn use +GNU m4 and Perl. If you want to use it, you will need to install +recent versions of these build tools. This should be needed only if +you edit files like `configure.ac' that specify Emacs's autobuild +procedure. The file `Makefile.in' is a template used by `configure' to create `Makefile'. === modified file 'autogen.sh' --- autogen.sh 2012-08-07 01:03:44 +0000 +++ autogen.sh 2012-09-10 01:03:27 +0000 @@ -201,7 +201,7 @@ Please report any problems with this script to bug-gnu-emacs@gnu.org . EOF - exit 1 + exit 101 # Exit status 101 means tools were missing. fi echo "Your system has the required tools, running autoreconf..." === modified file 'make-dist' --- make-dist 2012-08-02 06:21:48 +0000 +++ make-dist 2012-09-10 01:03:27 +0000 @@ -273,7 +273,7 @@ ### README while the rest of the tar file is still unpacking. Whoopee. echo "Making links to top-level files" ln INSTALL README BUGS ${tempdir} -ln ChangeLog Makefile.in configure configure.ac ${tempdir} +ln ChangeLog Makefile.in autogen.sh configure configure.ac ${tempdir} ln config.bat make-dist .dir-locals.el ${tempdir} ln aclocal.m4 ${tempdir} ------------------------------------------------------------ revno: 109961 fixes bug: http://debbugs.gnu.org/10885 committer: Juri Linkov branch nick: trunk timestamp: Mon 2012-09-10 01:15:24 +0300 message: * lisp/replace.el (replace-regexp-lax-whitespace): New defcustom. (replace-lax-whitespace, query-replace-regexp) (query-replace-regexp-eval, replace-regexp): Doc fix. (perform-replace, replace-highlight): Let-bind isearch-lax-whitespace to replace-lax-whitespace and isearch-regexp-lax-whitespace to replace-regexp-lax-whitespace. * lisp/isearch.el (isearch-query-replace): Let-bind replace-lax-whitespace to isearch-lax-whitespace and replace-regexp-lax-whitespace to isearch-regexp-lax-whitespace. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-09 21:11:14 +0000 +++ lisp/ChangeLog 2012-09-09 22:15:24 +0000 @@ -1,3 +1,17 @@ +2012-09-09 Juri Linkov + + * replace.el (replace-regexp-lax-whitespace): New defcustom. + (replace-lax-whitespace, query-replace-regexp) + (query-replace-regexp-eval, replace-regexp): Doc fix. + (perform-replace, replace-highlight): Let-bind + isearch-lax-whitespace to replace-lax-whitespace and + isearch-regexp-lax-whitespace to replace-regexp-lax-whitespace. + + * isearch.el (isearch-query-replace): Let-bind + replace-lax-whitespace to isearch-lax-whitespace and + replace-regexp-lax-whitespace to + isearch-regexp-lax-whitespace. (Bug#10885) + 2012-09-09 Stefan Monnier * eshell/em-unix.el (eshell/sudo): Explicitly drop return value. === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-09-06 08:49:40 +0000 +++ lisp/isearch.el 2012-09-09 22:15:24 +0000 @@ -1581,10 +1581,9 @@ ;; `isearch-no-upper-case-p' in `perform-replace' (search-upper-case nil) (replace-lax-whitespace - (and search-whitespace-regexp - (if isearch-regexp - isearch-regexp-lax-whitespace - isearch-lax-whitespace))) + isearch-lax-whitespace) + (replace-regexp-lax-whitespace + isearch-regexp-lax-whitespace) ;; Set `isearch-recursive-edit' to nil to prevent calling ;; `exit-recursive-edit' in `isearch-done' that terminates ;; the execution of this command when it is non-nil. === modified file 'lisp/replace.el' --- lisp/replace.el 2012-09-09 06:43:47 +0000 +++ lisp/replace.el 2012-09-09 22:15:24 +0000 @@ -35,7 +35,15 @@ (defcustom replace-lax-whitespace nil "Non-nil means `query-replace' matches a sequence of whitespace chars. -When you enter a space or spaces in the strings or regexps to be replaced, +When you enter a space or spaces in the strings to be replaced, +it will match any sequence matched by the regexp `search-whitespace-regexp'." + :type 'boolean + :group 'matching + :version "24.3") + +(defcustom replace-regexp-lax-whitespace nil + "Non-nil means `query-replace-regexp' matches a sequence of whitespace chars. +When you enter a space or spaces in the regexps to be replaced, it will match any sequence matched by the regexp `search-whitespace-regexp'." :type 'boolean :group 'matching @@ -282,7 +290,7 @@ all caps, or capitalized, then its replacement is upcased or capitalized.) -If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp +If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. @@ -362,7 +370,7 @@ Preserves case in each replacement if `case-replace' and `case-fold-search' are non-nil and REGEXP has no uppercase letters. -If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp +If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. @@ -499,7 +507,7 @@ Preserve case in each match if `case-replace' and `case-fold-search' are non-nil and REGEXP has no uppercase letters. -If `replace-lax-whitespace' is non-nil, a space or spaces in the regexp +If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. @@ -1803,9 +1811,9 @@ (let ((isearch-regexp regexp-flag) (isearch-word delimited-flag) (isearch-lax-whitespace - (and replace-lax-whitespace (not regexp-flag))) + replace-lax-whitespace) (isearch-regexp-lax-whitespace - (and replace-lax-whitespace regexp-flag)) + replace-regexp-lax-whitespace) (isearch-case-fold-search case-fold-search) (isearch-forward t)) (isearch-search-fun)))) @@ -2160,9 +2168,9 @@ (isearch-regexp regexp-flag) (isearch-word delimited-flag) (isearch-lax-whitespace - (and replace-lax-whitespace (not regexp-flag))) + replace-lax-whitespace) (isearch-regexp-lax-whitespace - (and replace-lax-whitespace regexp-flag)) + replace-regexp-lax-whitespace) (isearch-case-fold-search case-fold-search) (isearch-forward t) (isearch-error nil)) ------------------------------------------------------------ revno: 109960 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-09-09 17:24:04 -0400 message: * src/lisp.h (make_lisp_ptr): New macro to replace XSET. (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC): Use it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-09 20:10:36 +0000 +++ src/ChangeLog 2012-09-09 21:24:04 +0000 @@ -1,3 +1,9 @@ +2012-09-09 Stefan Monnier + + * lisp.h (make_lisp_ptr): New macro to replace XSET. + (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC): + Use it. + 2012-09-09 Eli Zaretskii * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the === modified file 'src/lisp.h' --- src/lisp.h 2012-09-09 16:06:33 +0000 +++ src/lisp.h 2012-09-09 21:24:04 +0000 @@ -325,7 +325,7 @@ typedef EMACS_INT Lisp_Object; #define XLI(o) (o) #define XIL(i) (i) -#define LISP_MAKE_RVALUE(o) (0+(o)) +#define LISP_MAKE_RVALUE(o) (0 + (o)) #define LISP_INITIALLY_ZERO 0 enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 0 }; #endif /* CHECK_LISP_OBJECT_TYPE */ @@ -417,9 +417,9 @@ #define XINT(a) (XLI (a) >> INTTYPEBITS) #define XUINT(a) ((EMACS_UINT) XLI (a) >> INTTYPEBITS) #define make_number(N) XIL ((EMACS_INT) (N) << INTTYPEBITS) -#define XSET(var, type, ptr) \ +#define make_lisp_ptr(ptr, type) \ (eassert (XTYPE (XIL ((intptr_t) (ptr))) == 0), /* Check alignment. */ \ - (var) = XIL ((type) | (intptr_t) (ptr))) + XIL ((type) | (intptr_t) (ptr))) #define XPNTR(a) ((intptr_t) (XLI (a) & ~TYPEMASK)) #define XUNTAG(a, type) ((intptr_t) (XLI (a) - (type))) @@ -444,13 +444,13 @@ #define XUINT(a) ((EMACS_UINT) (XLI (a) & INTMASK)) #define make_number(N) XIL ((EMACS_INT) (N) & INTMASK) -#define XSET(var, type, ptr) \ - ((var) = XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ - + ((intptr_t) (ptr) & VALMASK))) +#define make_lisp_ptr(ptr, type) \ + (XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ + + ((intptr_t) (ptr) & VALMASK))) #if DATA_SEG_BITS /* DATA_SEG_BITS forces extra bits to be or'd in with any pointers - which were stored in a Lisp_Object */ + which were stored in a Lisp_Object. */ #define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS)) #else #define XPNTR(a) ((uintptr_t) (XLI (a) & VALMASK)) @@ -555,15 +555,15 @@ /* Construct a Lisp_Object from a value or address. */ #define XSETINT(a, b) (a) = make_number (b) -#define XSETCONS(a, b) XSET (a, Lisp_Cons, b) -#define XSETVECTOR(a, b) XSET (a, Lisp_Vectorlike, b) -#define XSETSTRING(a, b) XSET (a, Lisp_String, b) -#define XSETSYMBOL(a, b) XSET (a, Lisp_Symbol, b) -#define XSETFLOAT(a, b) XSET (a, Lisp_Float, b) +#define XSETCONS(a, b) (a) = make_lisp_ptr (b, Lisp_Cons) +#define XSETVECTOR(a, b) (a) = make_lisp_ptr (b, Lisp_Vectorlike) +#define XSETSTRING(a, b) (a) = make_lisp_ptr (b, Lisp_String) +#define XSETSYMBOL(a, b) (a) = make_lisp_ptr (b, Lisp_Symbol) +#define XSETFLOAT(a, b) (a) = make_lisp_ptr (b, Lisp_Float) /* Misc types. */ -#define XSETMISC(a, b) XSET (a, Lisp_Misc, b) +#define XSETMISC(a, b) (a) = make_lisp_ptr (b, Lisp_Misc) #define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker) /* Pseudovector types. */ @@ -1619,7 +1619,7 @@ int mouse_face_image_state; } Mouse_HLInfo; -/* Data type checking */ +/* Data type checking. */ #define NILP(x) EQ (x, Qnil) @@ -1992,7 +1992,7 @@ { Lisp_Object symbol, old_value; specbinding_func func; - Lisp_Object unused; /* Dividing by 16 is faster than by 12 */ + Lisp_Object unused; /* Dividing by 16 is faster than by 12. */ }; extern struct specbinding *specpdl; @@ -2571,10 +2571,10 @@ EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST; -/* Defined in frame.c */ +/* Defined in frame.c. */ extern Lisp_Object Qframep; -/* Defined in data.c */ +/* Defined in data.c. */ extern Lisp_Object indirect_function (Lisp_Object); extern Lisp_Object find_symbol_value (Lisp_Object); @@ -2621,7 +2621,7 @@ extern void syms_of_cmds (void); extern void keys_of_cmds (void); -/* Defined in coding.c */ +/* Defined in coding.c. */ extern Lisp_Object Qcharset; extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, ptrdiff_t, bool, bool, Lisp_Object); @@ -2629,7 +2629,7 @@ extern void init_coding_once (void); extern void syms_of_coding (void); -/* Defined in character.c */ +/* Defined in character.c. */ EXFUN (Fmax_char, 0) ATTRIBUTE_CONST; extern ptrdiff_t chars_in_text (const unsigned char *, ptrdiff_t); extern ptrdiff_t multibyte_chars_in_text (const unsigned char *, ptrdiff_t); @@ -2637,21 +2637,21 @@ extern int multibyte_char_to_unibyte_safe (int) ATTRIBUTE_CONST; extern void syms_of_character (void); -/* Defined in charset.c */ +/* Defined in charset.c. */ extern void init_charset (void); extern void init_charset_once (void); extern void syms_of_charset (void); /* Structure forward declarations. */ struct charset; -/* Defined in composite.c */ +/* Defined in composite.c. */ extern void syms_of_composite (void); -/* Defined in syntax.c */ +/* Defined in syntax.c. */ extern void init_syntax_once (void); extern void syms_of_syntax (void); -/* Defined in fns.c */ +/* Defined in fns.c. */ extern Lisp_Object QCrehash_size, QCrehash_threshold; enum { NEXT_ALMOST_PRIME_LIMIT = 11 }; EXFUN (Fidentity, 1) ATTRIBUTE_CONST; @@ -2685,12 +2685,12 @@ extern Lisp_Object string_make_unibyte (Lisp_Object); extern void syms_of_fns (void); -/* Defined in floatfns.c */ +/* Defined in floatfns.c. */ extern double extract_float (Lisp_Object); extern void syms_of_floatfns (void); extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y); -/* Defined in fringe.c */ +/* Defined in fringe.c. */ extern void syms_of_fringe (void); extern void init_fringe (void); #ifdef HAVE_WINDOW_SYSTEM @@ -2698,13 +2698,13 @@ extern void init_fringe_once (void); #endif /* HAVE_WINDOW_SYSTEM */ -/* Defined in image.c */ +/* Defined in image.c. */ extern Lisp_Object QCascent, QCmargin, QCrelief; extern Lisp_Object QCconversion; extern int x_bitmap_mask (struct frame *, ptrdiff_t); extern void syms_of_image (void); -/* Defined in insdel.c */ +/* Defined in insdel.c. */ extern Lisp_Object Qinhibit_modification_hooks; extern void move_gap (ptrdiff_t); extern void move_gap_both (ptrdiff_t, ptrdiff_t); @@ -2750,7 +2750,7 @@ const char *, ptrdiff_t, ptrdiff_t, bool); extern void syms_of_insdel (void); -/* Defined in dispnew.c */ +/* Defined in dispnew.c. */ #if (defined PROFILING \ && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)) _Noreturn void __executable_start (void); @@ -2761,7 +2761,7 @@ extern void init_display (void); extern void syms_of_display (void); -/* Defined in xdisp.c */ +/* Defined in xdisp.c. */ extern Lisp_Object Qinhibit_point_motion_hooks; extern Lisp_Object Qinhibit_redisplay, Qdisplay; extern Lisp_Object Qmenu_bar_update_hook; @@ -2812,13 +2812,13 @@ extern int pos_visible_p (struct window *, ptrdiff_t, int *, int *, int *, int *, int *, int *); -/* Defined in xsettings.c */ +/* Defined in xsettings.c. */ extern void syms_of_xsettings (void); /* Defined in vm-limit.c. */ extern void memory_warnings (void *, void (*warnfun) (const char *)); -/* Defined in alloc.c */ +/* Defined in alloc.c. */ extern void check_pure_size (void); extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); extern void reset_malloc_hooks (void); @@ -2921,7 +2921,7 @@ #endif #ifdef REL_ALLOC -/* Defined in ralloc.c */ +/* Defined in ralloc.c. */ extern void *r_alloc (void **, size_t); extern void r_alloc_free (void **); extern void *r_re_alloc (void **, size_t); @@ -2929,7 +2929,7 @@ extern void r_alloc_inhibit_buffer_relocation (int); #endif -/* Defined in chartab.c */ +/* Defined in chartab.c. */ extern Lisp_Object copy_char_table (Lisp_Object); extern Lisp_Object char_table_ref (Lisp_Object, int); extern Lisp_Object char_table_ref_and_range (Lisp_Object, int, @@ -2947,7 +2947,7 @@ extern Lisp_Object uniprop_table (Lisp_Object); extern void syms_of_chartab (void); -/* Defined in print.c */ +/* Defined in print.c. */ extern Lisp_Object Vprin1_to_string_buffer; extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE; extern Lisp_Object Qstandard_output; @@ -2964,7 +2964,7 @@ extern int float_to_string (char *, double); extern void syms_of_print (void); -/* Defined in doprnt.c */ +/* Defined in doprnt.c. */ extern ptrdiff_t doprnt (char *, ptrdiff_t, const char *, const char *, va_list); extern ptrdiff_t esprintf (char *, char const *, ...) @@ -3130,7 +3130,7 @@ extern Lisp_Object build_marker (struct buffer *, ptrdiff_t, ptrdiff_t); extern void syms_of_marker (void); -/* Defined in fileio.c */ +/* Defined in fileio.c. */ extern Lisp_Object Qfile_error; extern Lisp_Object Qfile_exists_p; @@ -3138,7 +3138,7 @@ extern Lisp_Object Qinsert_file_contents; extern Lisp_Object Qfile_name_history; extern Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object); -EXFUN (Fread_file_name, 6); /* not a normal DEFUN */ +EXFUN (Fread_file_name, 6); /* Not a normal DEFUN. */ extern Lisp_Object close_file_unwind (Lisp_Object); extern Lisp_Object restore_point_unwind (Lisp_Object); extern _Noreturn void report_file_error (const char *, Lisp_Object); @@ -3147,7 +3147,7 @@ extern Lisp_Object make_temp_name (Lisp_Object, bool); extern Lisp_Object Qdelete_file; -/* Defined in search.c */ +/* Defined in search.c. */ extern void shrink_regexp_cache (void); extern void restore_search_regs (void); extern void record_unwind_save_match_data (void); @@ -3322,14 +3322,14 @@ extern void set_initial_environment (void); extern void syms_of_callproc (void); -/* Defined in doc.c */ +/* Defined in doc.c. */ extern Lisp_Object Qfunction_documentation; extern Lisp_Object read_doc_string (Lisp_Object); extern Lisp_Object get_doc_string (Lisp_Object, bool, bool); extern void syms_of_doc (void); extern int read_bytecode_char (bool); -/* Defined in bytecode.c */ +/* Defined in bytecode.c. */ extern Lisp_Object Qbytecode; extern void syms_of_bytecode (void); extern struct byte_stack *byte_stack_list; @@ -3340,12 +3340,12 @@ extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, ptrdiff_t, Lisp_Object *); -/* Defined in macros.c */ +/* Defined in macros.c. */ extern Lisp_Object Qexecute_kbd_macro; extern void init_macros (void); extern void syms_of_macros (void); -/* Defined in undo.c */ +/* Defined in undo.c. */ extern Lisp_Object Qapply; extern Lisp_Object Qinhibit_read_only; extern void truncate_undo_list (struct buffer *); @@ -3358,7 +3358,7 @@ Lisp_Object, Lisp_Object, Lisp_Object); extern void syms_of_undo (void); -/* Defined in textprop.c */ +/* Defined in textprop.c. */ extern Lisp_Object Qfont, Qmouse_face; extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks; extern Lisp_Object Qfront_sticky, Qrear_nonsticky; @@ -3366,19 +3366,19 @@ extern void report_interval_modification (Lisp_Object, Lisp_Object); -/* Defined in menu.c */ +/* Defined in menu.c. */ extern void syms_of_menu (void); -/* Defined in xmenu.c */ +/* Defined in xmenu.c. */ extern void syms_of_xmenu (void); -/* Defined in termchar.h */ +/* Defined in termchar.h. */ struct tty_display_info; -/* Defined in termhooks.h */ +/* Defined in termhooks.h. */ struct terminal; -/* Defined in sysdep.c */ +/* Defined in sysdep.c. */ #ifndef HAVE_GET_CURRENT_DIR_NAME extern char *get_current_dir_name (void); #endif @@ -3415,45 +3415,45 @@ extern void unlock_buffer (struct buffer *); extern void syms_of_filelock (void); -/* Defined in sound.c */ +/* Defined in sound.c. */ extern void syms_of_sound (void); -/* Defined in category.c */ +/* Defined in category.c. */ extern void init_category_once (void); extern Lisp_Object char_category_set (int); extern void syms_of_category (void); -/* Defined in ccl.c */ +/* Defined in ccl.c. */ extern void syms_of_ccl (void); -/* Defined in dired.c */ +/* Defined in dired.c. */ extern void syms_of_dired (void); extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, bool, Lisp_Object); -/* Defined in term.c */ +/* Defined in term.c. */ extern int *char_ins_del_vector; extern void syms_of_term (void); extern _Noreturn void fatal (const char *msgid, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); -/* Defined in terminal.c */ +/* Defined in terminal.c. */ extern void syms_of_terminal (void); -/* Defined in font.c */ +/* Defined in font.c. */ extern void syms_of_font (void); extern void init_font (void); #ifdef HAVE_WINDOW_SYSTEM -/* Defined in fontset.c */ +/* Defined in fontset.c. */ extern void syms_of_fontset (void); -/* Defined in xfns.c, w32fns.c, or macfns.c */ +/* Defined in xfns.c, w32fns.c, or macfns.c. */ extern Lisp_Object Qfont_param; #endif -/* Defined in xfaces.c */ +/* Defined in xfaces.c. */ extern Lisp_Object Qdefault, Qtool_bar, Qfringe; extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor; extern Lisp_Object Qmode_line_inactive; @@ -3469,26 +3469,26 @@ extern void syms_of_xfaces (void); #ifdef HAVE_X_WINDOWS -/* Defined in xfns.c */ +/* Defined in xfns.c. */ extern void syms_of_xfns (void); -/* Defined in xsmfns.c */ +/* Defined in xsmfns.c. */ extern void syms_of_xsmfns (void); -/* Defined in xselect.c */ +/* Defined in xselect.c. */ extern void syms_of_xselect (void); -/* Defined in xterm.c */ +/* Defined in xterm.c. */ extern void syms_of_xterm (void); #endif /* HAVE_X_WINDOWS */ #ifdef HAVE_WINDOW_SYSTEM -/* Defined in xterm.c, nsterm.m, w32term.c */ +/* Defined in xterm.c, nsterm.m, w32term.c. */ extern char *x_get_keysym_name (int); #endif /* HAVE_WINDOW_SYSTEM */ #ifdef HAVE_LIBXML2 -/* Defined in xml.c */ +/* Defined in xml.c. */ extern void syms_of_xml (void); extern void xml_cleanup_parser (void); #endif @@ -3499,12 +3499,12 @@ #endif #ifdef HAVE_DBUS -/* Defined in dbusbind.c */ +/* Defined in dbusbind.c. */ void syms_of_dbusbind (void); #endif #ifdef DOS_NT -/* Defined in msdos.c, w32.c */ +/* Defined in msdos.c, w32.c. */ extern char *emacs_root_dir (void); #endif /* DOS_NT */ @@ -3512,7 +3512,7 @@ Used during startup to detect startup of dumped Emacs. */ extern bool initialized; -extern int immediate_quit; /* Nonzero means ^G can quit instantly */ +extern int immediate_quit; /* Nonzero means ^G can quit instantly. */ extern void *xmalloc (size_t); extern void *xzalloc (size_t); @@ -3545,7 +3545,7 @@ /* SAFE_ALLOCA normally allocates memory on the stack, but if size is larger than MAX_ALLOCA, use xmalloc to avoid overflowing the stack. */ -enum MAX_ALLOCA { MAX_ALLOCA = 16*1024 }; +enum MAX_ALLOCA { MAX_ALLOCA = 16 * 1024 }; extern Lisp_Object safe_alloca_unwind (Lisp_Object); extern void *record_xmalloc (size_t); ------------------------------------------------------------ revno: 109959 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2012-09-09 17:11:14 -0400 message: * lisp/eshell/em-unix.el (eshell/sudo): Explicitly drop return value. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-09 11:03:37 +0000 +++ lisp/ChangeLog 2012-09-09 21:11:14 +0000 @@ -1,9 +1,13 @@ +2012-09-09 Stefan Monnier + + * eshell/em-unix.el (eshell/sudo): Explicitly drop return value. + 2012-09-09 Alan Mackenzie - * progmodes/cc-engine.el (c-state-cache-init): Initialise - c-state-semi-nonlit-pos-cache\(-limit\)? properly. - (c-record-parse-state-state): record - c-state-semi-nonlit-pos-cache\(-limit\)?. + * progmodes/cc-engine.el (c-state-cache-init): + Initialise c-state-semi-nonlit-pos-cache\(-limit\)? properly. + (c-record-parse-state-state): + Record c-state-semi-nonlit-pos-cache\(-limit\)?. 2012-09-09 Andreas Schwab === modified file 'lisp/eshell/em-unix.el' --- lisp/eshell/em-unix.el 2012-09-02 09:57:19 +0000 +++ lisp/eshell/em-unix.el 2012-09-09 21:11:14 +0000 @@ -1111,7 +1111,7 @@ (substring prefix 0 -1) user host dir) (format "/sudo:%s@%s:%s" user host dir)))) ;; Ensure, that Tramp has connected to that construct already. - (file-exists-p default-directory) + (ignore (file-exists-p default-directory)) (eshell-named-command (car orig-args) (cdr orig-args)))))))) (put 'eshell/sudo 'eshell-no-numeric-conversions t) === modified file 'src/buffer.c' --- src/buffer.c 2012-09-06 09:15:44 +0000 +++ src/buffer.c 2012-09-09 21:11:14 +0000 @@ -44,7 +44,7 @@ #include "keymap.h" #include "frame.h" -struct buffer *current_buffer; /* the current buffer */ +struct buffer *current_buffer; /* The current buffer. */ /* First buffer in chain of all buffers (in reverse order of creation). Threaded through ->header.next.buffer. */ @@ -74,12 +74,12 @@ and the corresponding slot in buffer_defaults is not used. If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is - zero, that is a bug */ + zero, that is a bug. */ struct buffer buffer_local_flags; /* This structure holds the names of symbols whose values may be - buffer-local. It is indexed and accessed in the same way as the above. */ + buffer-local. It is indexed and accessed in the same way as the above. */ struct buffer alignas (GCALIGNMENT) buffer_local_symbols; @@ -108,7 +108,7 @@ static void swap_out_buffer_local_variables (struct buffer *b); static void reset_buffer_local_variables (struct buffer *, bool); -/* Alist of all buffer names vs the buffers. */ +/* Alist of all buffer names vs the buffers. */ /* This used to be a variable, but is no longer, to prevent lossage due to user rplac'ing this alist or its elements. */ Lisp_Object Vbuffer_alist; @@ -127,7 +127,7 @@ static Lisp_Object Qprotected_field; -static Lisp_Object QSFundamental; /* A string "Fundamental" */ +static Lisp_Object QSFundamental; /* A string "Fundamental". */ static Lisp_Object Qkill_buffer_hook; static Lisp_Object Qbuffer_list_update_hook; ------------------------------------------------------------ revno: 109958 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-09-09 23:10:36 +0300 message: Avoid leaving traces of cursor when entering linum-mode. src/fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the left fringe if the window has a left margin. This avoids leaving traces of the cursor because its leftmost pixel is not drawn over. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-09 17:59:50 +0000 +++ src/ChangeLog 2012-09-09 20:10:36 +0000 @@ -1,5 +1,9 @@ 2012-09-09 Eli Zaretskii + * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the + left fringe if the window has a left margin. This avoids leaving + traces of the cursor because its leftmost pixel is not drawn over. + * dispnew.c (update_window_line): When the left margin area of a screen line is updated, set the redraw_fringe_bitmaps_p flag of that screen line. (Bug#12277) === modified file 'src/fringe.c' --- src/fringe.c 2012-08-07 07:33:18 +0000 +++ src/fringe.c 2012-09-09 20:10:36 +0000 @@ -659,7 +659,14 @@ { /* If W has a vertical border to its left, don't draw over it. */ wd -= ((!WINDOW_LEFTMOST_P (w) - && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) + && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w) + /* But don't reduce the fringe width if the window + has a left margin, because that means we are not + in danger of drawing over the vertical border, + and OTOH leaving out that one pixel leaves behind + traces of the cursor, if it was in column zero + before drawing non-empty margin area. */ + && NILP (w->left_margin_cols)) ? 1 : 0); p.bx = x - wd; p.nx = wd; ------------------------------------------------------------ revno: 109957 fixes bug: http://debbugs.gnu.org/12277 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-09-09 20:59:50 +0300 message: Fix bug #12277 with incomplete redisplay of the vertical border between windows. src/dispnew.c (update_window_line): When the left margin area of a screen line is updated, set the redraw_fringe_bitmaps_p flag of that screen line. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-09 16:06:33 +0000 +++ src/ChangeLog 2012-09-09 17:59:50 +0000 @@ -1,3 +1,9 @@ +2012-09-09 Eli Zaretskii + + * dispnew.c (update_window_line): When the left margin area of a + screen line is updated, set the redraw_fringe_bitmaps_p flag of + that screen line. (Bug#12277) + 2012-09-09 Paul Eggert Assume C89 or later for math functions (Bug#12381). === modified file 'src/dispnew.c' --- src/dispnew.c 2012-09-07 01:27:44 +0000 +++ src/dispnew.c 2012-09-09 17:59:50 +0000 @@ -3951,6 +3951,11 @@ { changed_p = 1; update_marginal_area (w, LEFT_MARGIN_AREA, vpos); + /* Setting this flag will ensure the vertical border, if + any, between this window and the one on its left will be + redrawn. This is necessary because updating the left + margin area can potentially draw over the border. */ + current_row->redraw_fringe_bitmaps_p = 1; } /* Update the display of the text area. */ ------------------------------------------------------------ revno: 109956 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-09-09 09:06:33 -0700 message: Assume C89 or later for math functions. This simplifies the code, and makes it a bit smaller and faster, and (most important) makes it easier to clean up signal handling since we can stop worring about floating-point exceptions in library code. That was a problem before C89, but the problem went away many years ago on all practical Emacs targets. * configure.ac (frexp, fmod): Remove checks for these functions, as we now assume them. (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC, NO_MATHERR) (HAVE_EXCEPTION): Remove; no longer needed. * admin/CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN) (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove. * src/data.c, src/image.c, src/lread.c, src/print.c: Don't include ; no longer needed. * src/data.c, src/floatfns.c (IEEE_FLOATING_POINT): Don't worry that it might be autoconfigured, as that never happens. * src/data.c (fmod): * src/doprnt.c (DBL_MAX_10_EXP): * src/print.c (DBL_DIG): Remove. C89 or later always defines these. * src/floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN) (in_float, float_error_arg, float_error_arg2, float_error_fn_name) (arith_error, domain_error, domain_error2): Remove all this pre-C89 cruft. Do not include as that's no longer needed -- we simply return what C returns. All uses removed. (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with the wrapped code. (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2): Remove. All uses expanded, as these macros are no longer used more than once and are now more trouble than they're worth. (Ftan): Use tan, not sin / cos. (Flogb): Assume C89 frexp. (fmod_float): Assume C89 fmod. (matherr) [HAVE_MATHERR]: Remove; no longer needed. (init_floatfns): Remove. All uses removed. diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-07 08:46:44 +0000 +++ ChangeLog 2012-09-09 16:06:33 +0000 @@ -1,3 +1,12 @@ +2012-09-09 Paul Eggert + + Assume C89 or later for math functions (Bug#12381). + * configure.ac (frexp, fmod): Remove checks for these functions, + as we now assume them. + (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC, NO_MATHERR) + (HAVE_EXCEPTION): + Remove; no longer needed. + 2012-09-07 Paul Eggert More signal-handler cleanup (Bug#12327). === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-09-04 17:34:54 +0000 +++ admin/CPP-DEFINES 2012-09-09 16:06:33 +0000 @@ -107,7 +107,6 @@ EMACS_CONFIG_OPTIONS EMACS_INT EMACS_UINT -FLOAT_CHECK_DOMAIN GC_MARK_SECONDARY_STACK GC_MARK_STACK GC_SETJMP_WORKS @@ -158,12 +157,10 @@ HAVE_ENVIRON_DECL HAVE_EUIDACCESS HAVE_FCNTL_H -HAVE_FMOD HAVE_FORK HAVE_FPATHCONF HAVE_FREEIFADDRS HAVE_FREETYPE -HAVE_FREXP HAVE_FSEEKO HAVE_FSYNC HAVE_FUTIMENS @@ -217,7 +214,6 @@ HAVE_IMAGEMAGICK HAVE_INET_SOCKETS HAVE_INTTYPES_H -HAVE_INVERSE_HYPERBOLIC HAVE_JPEG HAVE_KERBEROSIV_DES_H HAVE_KERBEROSIV_KRB_H @@ -429,7 +425,6 @@ MAXPATHLEN NLIST_STRUCT NO_EDITRES -NO_MATHERR NO_TERMIO NSIG NSIG_MINIMUM === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-09-04 17:34:54 +0000 +++ admin/ChangeLog 2012-09-09 16:06:33 +0000 @@ -1,3 +1,9 @@ +2012-09-09 Paul Eggert + + Assume C89 or later for math functions (Bug#12381). + * CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN) + (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove. + 2012-09-04 Paul Eggert Simplify redefinition of 'abort' (Bug#12316). === modified file 'configure.ac' --- configure.ac 2012-09-07 08:46:44 +0000 +++ configure.ac 2012-09-09 16:06:33 +0000 @@ -1302,17 +1302,6 @@ [Define to 1 if `speed_t' is declared by .]) fi -AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception, -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;]])], - emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no)) -HAVE_EXCEPTION=$emacs_cv_struct_exception -dnl Define on Darwin so emacs symbols will not conflict with those -dnl in the System framework. Otherwise -prebind will not work. -if test $emacs_cv_struct_exception != yes || test $opsys = darwin; then - AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.]) -fi - AC_CHECK_HEADERS_ONCE(sys/socket.h) AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT #if HAVE_SYS_SOCKET_H @@ -2781,7 +2770,7 @@ AC_CHECK_FUNCS(gethostname \ closedir getrusage get_current_dir_name \ -lrand48 logb frexp fmod cbrt setsid \ +lrand48 logb cbrt setsid \ fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ __fpending strsignal setitimer \ @@ -3211,12 +3200,6 @@ so that Emacs can tell instantly when you try to modify a file that someone else has modified in his/her Emacs.]) -AH_TEMPLATE(FLOAT_CHECK_DOMAIN, [Define if the float library doesn't - handle errors by either setting errno, or signaling SIGFPE.]) - -AH_TEMPLATE(HAVE_INVERSE_HYPERBOLIC, [Define if you have the functions - acosh, asinh, and atanh.]) - dnl Everybody supports this, except MS. dnl Seems like the kind of thing we should be testing for, though. ## Note: PTYs are broken on darwin <6. Use at your own risk. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-08 20:16:39 +0000 +++ src/ChangeLog 2012-09-09 16:06:33 +0000 @@ -1,3 +1,35 @@ +2012-09-09 Paul Eggert + + Assume C89 or later for math functions (Bug#12381). + This simplifies the code, and makes it a bit smaller and faster, + and (most important) makes it easier to clean up signal handling + since we can stop worring about floating-point exceptions in + library code. That was a problem before C89, but the problem + went away many years ago on all practical Emacs targets. + * data.c, image.c, lread.c, print.c: + Don't include ; no longer needed. + * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it + might be autoconfigured, as that never happens. + * data.c (fmod): + * doprnt.c (DBL_MAX_10_EXP): + * print.c (DBL_DIG): + Remove. C89 or later always defines these. + * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN) + (in_float, float_error_arg, float_error_arg2, float_error_fn_name) + (arith_error, domain_error, domain_error2): + Remove all this pre-C89 cruft. Do not include as that's + no longer needed -- we simply return what C returns. All uses removed. + (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with + the wrapped code. + (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2): + Remove. All uses expanded, as these macros are no longer used + more than once and are now more trouble than they're worth. + (Ftan): Use tan, not sin / cos. + (Flogb): Assume C89 frexp. + (fmod_float): Assume C89 fmod. + (matherr) [HAVE_MATHERR]: Remove; no longer needed. + (init_floatfns): Remove. All uses removed. + 2012-09-08 Jan Djärv * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back === modified file 'src/data.c' --- src/data.c 2012-09-07 14:15:59 +0000 +++ src/data.c 2012-09-09 16:06:33 +0000 @@ -36,17 +36,12 @@ #include "keymap.h" #include -/* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */ -#ifndef IEEE_FLOATING_POINT #if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ && FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128) #define IEEE_FLOATING_POINT 1 #else #define IEEE_FLOATING_POINT 0 #endif -#endif - -#include Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; static Lisp_Object Qsubr; @@ -2737,28 +2732,6 @@ return val; } -#ifndef HAVE_FMOD -double -fmod (double f1, double f2) -{ - double r = f1; - - if (f2 < 0.0) - f2 = -f2; - - /* If the magnitude of the result exceeds that of the divisor, or - the sign of the result does not agree with that of the dividend, - iterate with the reduced value. This does not yield a - particularly accurate result, but at least it will be in the - range promised by fmod. */ - do - r -= f2 * floor (r / f2); - while (f2 <= (r < 0 ? -r : r) || ((r < 0) != (f1 < 0) && ! isnan (r))); - - return r; -} -#endif /* ! HAVE_FMOD */ - DEFUN ("mod", Fmod, Smod, 2, 2, 0, doc: /* Return X modulo Y. The result falls between zero (inclusive) and Y (exclusive). === modified file 'src/doprnt.c' --- src/doprnt.c 2012-08-16 21:58:44 +0000 +++ src/doprnt.c 2012-09-09 16:06:33 +0000 @@ -114,10 +114,6 @@ another macro. */ #include "character.h" -#ifndef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 308 /* IEEE double */ -#endif - /* Generate output from a format-spec FORMAT, terminated at position FORMAT_END. (*FORMAT_END is not part of the format, but must exist and be readable.) === modified file 'src/emacs.c' --- src/emacs.c 2012-09-07 08:55:03 +0000 +++ src/emacs.c 2012-09-09 16:06:33 +0000 @@ -1587,7 +1587,6 @@ init_fringe (); #endif /* HAVE_WINDOW_SYSTEM */ init_macros (); - init_floatfns (); init_window (); init_font (); === modified file 'src/floatfns.c' --- src/floatfns.c 2012-09-08 19:57:32 +0000 +++ src/floatfns.c 2012-09-09 16:06:33 +0000 @@ -22,26 +22,9 @@ along with GNU Emacs. If not, see . */ -/* ANSI C requires only these float functions: +/* C89 requires only these math.h functions: acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, fmod, frexp, ldexp, log, log10, modf, pow, sin, sinh, sqrt, tan, tanh. - - Define HAVE_INVERSE_HYPERBOLIC if you have acosh, asinh, and atanh. - Define HAVE_CBRT if you have cbrt. - Define HAVE_RINT if you have a working rint. - If you don't define these, then the appropriate routines will be simulated. - - Define HAVE_MATHERR if on a system supporting the SysV matherr callback. - (This should happen automatically.) - - Define FLOAT_CHECK_ERRNO if the float library routines set errno. - This has no effect if HAVE_MATHERR is defined. - - Define FLOAT_CHECK_DOMAIN if the float library doesn't handle errors by - either setting errno, or signaling SIGFPE. Otherwise, domain and - range checking will happen before calling the float routines. This has - no effect if HAVE_MATHERR is defined (since matherr will be called when - a domain error occurs.) */ #include @@ -50,15 +33,12 @@ #include "syssignal.h" #include -/* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */ -#ifndef IEEE_FLOATING_POINT #if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ && FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128) #define IEEE_FLOATING_POINT 1 #else #define IEEE_FLOATING_POINT 0 #endif -#endif #include @@ -67,120 +47,6 @@ extern double logb (double); #endif /* not HPUX and HAVE_LOGB and no logb macro */ -#if defined (DOMAIN) && defined (SING) && defined (OVERFLOW) - /* If those are defined, then this is probably a `matherr' machine. */ -# ifndef HAVE_MATHERR -# define HAVE_MATHERR -# endif -#endif - -#ifdef NO_MATHERR -#undef HAVE_MATHERR -#endif - -#ifdef HAVE_MATHERR -# ifdef FLOAT_CHECK_ERRNO -# undef FLOAT_CHECK_ERRNO -# endif -# ifdef FLOAT_CHECK_DOMAIN -# undef FLOAT_CHECK_DOMAIN -# endif -#endif - -#ifndef NO_FLOAT_CHECK_ERRNO -#define FLOAT_CHECK_ERRNO -#endif - -#ifdef FLOAT_CHECK_ERRNO -# include -#endif - -/* True while executing in floating point. - This tells float_error what to do. */ - -static bool in_float; - -/* If an argument is out of range for a mathematical function, - here is the actual argument value to use in the error message. - These variables are used only across the floating point library call - so there is no need to staticpro them. */ - -static Lisp_Object float_error_arg, float_error_arg2; - -static const char *float_error_fn_name; - -/* Evaluate the floating point expression D, recording NUM - as the original argument for error messages. - D is normally an assignment expression. - Handle errors which may result in signals or may set errno. - - Note that float_error may be declared to return void, so you can't - just cast the zero after the colon to (void) to make the types - check properly. */ - -#ifdef FLOAT_CHECK_ERRNO -#define IN_FLOAT(d, name, num) \ - do { \ - float_error_arg = num; \ - float_error_fn_name = name; \ - in_float = 1; errno = 0; (d); in_float = 0; \ - switch (errno) { \ - case 0: break; \ - case EDOM: domain_error (float_error_fn_name, float_error_arg); \ - case ERANGE: range_error (float_error_fn_name, float_error_arg); \ - default: arith_error (float_error_fn_name, float_error_arg); \ - } \ - } while (0) -#define IN_FLOAT2(d, name, num, num2) \ - do { \ - float_error_arg = num; \ - float_error_arg2 = num2; \ - float_error_fn_name = name; \ - in_float = 1; errno = 0; (d); in_float = 0; \ - switch (errno) { \ - case 0: break; \ - case EDOM: domain_error (float_error_fn_name, float_error_arg); \ - case ERANGE: range_error (float_error_fn_name, float_error_arg); \ - default: arith_error (float_error_fn_name, float_error_arg); \ - } \ - } while (0) -#else -#define IN_FLOAT(d, name, num) (in_float = 1, (d), in_float = 0) -#define IN_FLOAT2(d, name, num, num2) (in_float = 1, (d), in_float = 0) -#endif - -/* Convert float to Lisp_Int if it fits, else signal a range error - using the given arguments. */ -#define FLOAT_TO_INT(x, i, name, num) \ - do \ - { \ - if (FIXNUM_OVERFLOW_P (x)) \ - range_error (name, num); \ - XSETINT (i, (EMACS_INT)(x)); \ - } \ - while (0) -#define FLOAT_TO_INT2(x, i, name, num1, num2) \ - do \ - { \ - if (FIXNUM_OVERFLOW_P (x)) \ - range_error2 (name, num1, num2); \ - XSETINT (i, (EMACS_INT)(x)); \ - } \ - while (0) - -#define arith_error(op,arg) \ - xsignal2 (Qarith_error, build_string ((op)), (arg)) -#define range_error(op,arg) \ - xsignal2 (Qrange_error, build_string ((op)), (arg)) -#define range_error2(op,a1,a2) \ - xsignal3 (Qrange_error, build_string ((op)), (a1), (a2)) -#define domain_error(op,arg) \ - xsignal2 (Qdomain_error, build_string ((op)), (arg)) -#ifdef FLOAT_CHECK_DOMAIN -#define domain_error2(op,a1,a2) \ - xsignal3 (Qdomain_error, build_string ((op)), (a1), (a2)) -#endif - /* Extract a Lisp number as a `double', or signal an error. */ double @@ -197,27 +63,19 @@ DEFUN ("acos", Facos, Sacos, 1, 1, 0, doc: /* Return the inverse cosine of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d > 1.0 || d < -1.0) - domain_error ("acos", arg); -#endif - IN_FLOAT (d = acos (d), "acos", arg); + d = acos (d); return make_float (d); } DEFUN ("asin", Fasin, Sasin, 1, 1, 0, doc: /* Return the inverse sine of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d > 1.0 || d < -1.0) - domain_error ("asin", arg); -#endif - IN_FLOAT (d = asin (d), "asin", arg); + d = asin (d); return make_float (d); } @@ -227,50 +85,44 @@ If two arguments Y and X are given, return the inverse tangent of Y divided by X, i.e. the angle in radians between the vector (X, Y) and the x-axis. */) - (register Lisp_Object y, Lisp_Object x) + (Lisp_Object y, Lisp_Object x) { double d = extract_float (y); if (NILP (x)) - IN_FLOAT (d = atan (d), "atan", y); + d = atan (d); else { double d2 = extract_float (x); - - IN_FLOAT2 (d = atan2 (d, d2), "atan", y, x); + d = atan2 (d, d2); } return make_float (d); } DEFUN ("cos", Fcos, Scos, 1, 1, 0, doc: /* Return the cosine of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = cos (d), "cos", arg); + d = cos (d); return make_float (d); } DEFUN ("sin", Fsin, Ssin, 1, 1, 0, doc: /* Return the sine of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = sin (d), "sin", arg); + d = sin (d); return make_float (d); } DEFUN ("tan", Ftan, Stan, 1, 1, 0, doc: /* Return the tangent of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - double c = cos (d); - if (c == 0.0) - domain_error ("tan", arg); -#endif - IN_FLOAT (d = tan (d), "tan", arg); + d = tan (d); return make_float (d); } @@ -341,61 +193,61 @@ DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0, doc: /* Return the bessel function j0 of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = j0 (d), "bessel-j0", arg); + d = j0 (d); return make_float (d); } DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0, doc: /* Return the bessel function j1 of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = j1 (d), "bessel-j1", arg); + d = j1 (d); return make_float (d); } DEFUN ("bessel-jn", Fbessel_jn, Sbessel_jn, 2, 2, 0, doc: /* Return the order N bessel function output jn of ARG. The first arg (the order) is truncated to an integer. */) - (register Lisp_Object n, Lisp_Object arg) + (Lisp_Object n, Lisp_Object arg) { int i1 = extract_float (n); double f2 = extract_float (arg); - IN_FLOAT (f2 = jn (i1, f2), "bessel-jn", n); + f2 = jn (i1, f2); return make_float (f2); } DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0, doc: /* Return the bessel function y0 of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = y0 (d), "bessel-y0", arg); + d = y0 (d); return make_float (d); } DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0, doc: /* Return the bessel function y1 of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = y1 (d), "bessel-y0", arg); + d = y1 (d); return make_float (d); } DEFUN ("bessel-yn", Fbessel_yn, Sbessel_yn, 2, 2, 0, doc: /* Return the order N bessel function output yn of ARG. The first arg (the order) is truncated to an integer. */) - (register Lisp_Object n, Lisp_Object arg) + (Lisp_Object n, Lisp_Object arg) { int i1 = extract_float (n); double f2 = extract_float (arg); - IN_FLOAT (f2 = yn (i1, f2), "bessel-yn", n); + f2 = yn (i1, f2); return make_float (f2); } @@ -405,43 +257,43 @@ DEFUN ("erf", Ferf, Serf, 1, 1, 0, doc: /* Return the mathematical error function of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = erf (d), "erf", arg); + d = erf (d); return make_float (d); } DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0, doc: /* Return the complementary error function of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = erfc (d), "erfc", arg); + d = erfc (d); return make_float (d); } DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0, doc: /* Return the log gamma of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = lgamma (d), "log-gamma", arg); + d = lgamma (d); return make_float (d); } DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0, doc: /* Return the cube root of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); #ifdef HAVE_CBRT - IN_FLOAT (d = cbrt (d), "cube-root", arg); + d = cbrt (d); #else if (d >= 0.0) - IN_FLOAT (d = pow (d, 1.0/3.0), "cube-root", arg); + d = pow (d, 1.0/3.0); else - IN_FLOAT (d = -pow (-d, 1.0/3.0), "cube-root", arg); + d = -pow (-d, 1.0/3.0); #endif return make_float (d); } @@ -450,23 +302,16 @@ DEFUN ("exp", Fexp, Sexp, 1, 1, 0, doc: /* Return the exponential base e of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d > 709.7827) /* Assume IEEE doubles here */ - range_error ("exp", arg); - else if (d < -709.0) - return make_float (0.0); - else -#endif - IN_FLOAT (d = exp (d), "exp", arg); + d = exp (d); return make_float (d); } DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0, doc: /* Return the exponential ARG1 ** ARG2. */) - (register Lisp_Object arg1, Lisp_Object arg2) + (Lisp_Object arg1, Lisp_Object arg2) { double f1, f2, f3; @@ -495,72 +340,46 @@ } f1 = FLOATP (arg1) ? XFLOAT_DATA (arg1) : XINT (arg1); f2 = FLOATP (arg2) ? XFLOAT_DATA (arg2) : XINT (arg2); - /* Really should check for overflow, too */ - if (f1 == 0.0 && f2 == 0.0) - f1 = 1.0; -#ifdef FLOAT_CHECK_DOMAIN - else if ((f1 == 0.0 && f2 < 0.0) || (f1 < 0 && f2 != floor (f2))) - domain_error2 ("expt", arg1, arg2); -#endif - IN_FLOAT2 (f3 = pow (f1, f2), "expt", arg1, arg2); - /* Check for overflow in the result. */ - if (f1 != 0.0 && f3 == 0.0) - range_error ("expt", arg1); + f3 = pow (f1, f2); return make_float (f3); } DEFUN ("log", Flog, Slog, 1, 2, 0, doc: /* Return the natural logarithm of ARG. If the optional argument BASE is given, return log ARG using that base. */) - (register Lisp_Object arg, Lisp_Object base) + (Lisp_Object arg, Lisp_Object base) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d <= 0.0) - domain_error2 ("log", arg, base); -#endif if (NILP (base)) - IN_FLOAT (d = log (d), "log", arg); + d = log (d); else { double b = extract_float (base); -#ifdef FLOAT_CHECK_DOMAIN - if (b <= 0.0 || b == 1.0) - domain_error2 ("log", arg, base); -#endif if (b == 10.0) - IN_FLOAT2 (d = log10 (d), "log", arg, base); + d = log10 (d); else - IN_FLOAT2 (d = log (d) / log (b), "log", arg, base); + d = log (d) / log (b); } return make_float (d); } DEFUN ("log10", Flog10, Slog10, 1, 1, 0, doc: /* Return the logarithm base 10 of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d <= 0.0) - domain_error ("log10", arg); -#endif - IN_FLOAT (d = log10 (d), "log10", arg); + d = log10 (d); return make_float (d); } DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0, doc: /* Return the square root of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d < 0.0) - domain_error ("sqrt", arg); -#endif - IN_FLOAT (d = sqrt (d), "sqrt", arg); + d = sqrt (d); return make_float (d); } @@ -568,83 +387,55 @@ DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0, doc: /* Return the inverse hyperbolic cosine of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d < 1.0) - domain_error ("acosh", arg); -#endif -#ifdef HAVE_INVERSE_HYPERBOLIC - IN_FLOAT (d = acosh (d), "acosh", arg); -#else - IN_FLOAT (d = log (d + sqrt (d*d - 1.0)), "acosh", arg); -#endif + d = acosh (d); return make_float (d); } DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0, doc: /* Return the inverse hyperbolic sine of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef HAVE_INVERSE_HYPERBOLIC - IN_FLOAT (d = asinh (d), "asinh", arg); -#else - IN_FLOAT (d = log (d + sqrt (d*d + 1.0)), "asinh", arg); -#endif + d = asinh (d); return make_float (d); } DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0, doc: /* Return the inverse hyperbolic tangent of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d >= 1.0 || d <= -1.0) - domain_error ("atanh", arg); -#endif -#ifdef HAVE_INVERSE_HYPERBOLIC - IN_FLOAT (d = atanh (d), "atanh", arg); -#else - IN_FLOAT (d = 0.5 * log ((1.0 + d) / (1.0 - d)), "atanh", arg); -#endif + d = atanh (d); return make_float (d); } DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0, doc: /* Return the hyperbolic cosine of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d > 710.0 || d < -710.0) - range_error ("cosh", arg); -#endif - IN_FLOAT (d = cosh (d), "cosh", arg); + d = cosh (d); return make_float (d); } DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0, doc: /* Return the hyperbolic sine of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); -#ifdef FLOAT_CHECK_DOMAIN - if (d > 710.0 || d < -710.0) - range_error ("sinh", arg); -#endif - IN_FLOAT (d = sinh (d), "sinh", arg); + d = sinh (d); return make_float (d); } DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0, doc: /* Return the hyperbolic tangent of ARG. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = tanh (d), "tanh", arg); + d = tanh (d); return make_float (d); } #endif @@ -689,33 +480,11 @@ else { #ifdef HAVE_LOGB - IN_FLOAT (value = logb (f), "logb", arg); + value = logb (f); #else -#ifdef HAVE_FREXP int ivalue; - IN_FLOAT (frexp (f, &ivalue), "logb", arg); + frexp (f, &ivalue); value = ivalue - 1; -#else - int i; - double d; - if (f < 0.0) - f = -f; - value = -1; - while (f < 0.5) - { - for (i = 1, d = 0.5; d * d >= f; i += i) - d *= d; - f /= d; - value -= i; - } - while (f >= 1.0) - { - for (i = 1, d = 2.0; d * d <= f; i += i) - d *= d; - f /= d; - value += i; - } -#endif #endif } XSETINT (val, value); @@ -748,8 +517,10 @@ if (! IEEE_FLOATING_POINT && f2 == 0) xsignal0 (Qarith_error); - IN_FLOAT2 (f1 = (*double_round) (f1 / f2), name, arg, divisor); - FLOAT_TO_INT2 (f1, arg, name, arg, divisor); + f1 = (*double_round) (f1 / f2); + if (FIXNUM_OVERFLOW_P (f1)) + xsignal3 (Qrange_error, build_string (name), arg, divisor); + arg = make_number (f1); return arg; } @@ -765,10 +536,10 @@ if (FLOATP (arg)) { - double d; - - IN_FLOAT (d = (*double_round) (XFLOAT_DATA (arg)), name, arg); - FLOAT_TO_INT (d, arg, name, arg); + double d = (*double_round) (XFLOAT_DATA (arg)); + if (FIXNUM_OVERFLOW_P (d)) + xsignal2 (Qrange_error, build_string (name), arg); + arg = make_number (d); } return arg; @@ -885,97 +656,57 @@ f1 = FLOATP (x) ? XFLOAT_DATA (x) : XINT (x); f2 = FLOATP (y) ? XFLOAT_DATA (y) : XINT (y); - if (! IEEE_FLOATING_POINT && f2 == 0) - xsignal0 (Qarith_error); + f1 = fmod (f1, f2); /* If the "remainder" comes out with the wrong sign, fix it. */ - IN_FLOAT2 ((f1 = fmod (f1, f2), - f1 = (f2 < 0 ? f1 > 0 : f1 < 0) ? f1 + f2 : f1), - "mod", x, y); + if (f2 < 0 ? 0 < f1 : f1 < 0) + f1 += f2; + return make_float (f1); } -/* It's not clear these are worth adding. */ - DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0, doc: /* Return the smallest integer no less than ARG, as a float. \(Round toward +inf.\) */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = ceil (d), "fceiling", arg); + d = ceil (d); return make_float (d); } DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0, doc: /* Return the largest integer no greater than ARG, as a float. \(Round towards -inf.\) */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = floor (d), "ffloor", arg); + d = floor (d); return make_float (d); } DEFUN ("fround", Ffround, Sfround, 1, 1, 0, doc: /* Return the nearest integer to ARG, as a float. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); - IN_FLOAT (d = emacs_rint (d), "fround", arg); + d = emacs_rint (d); return make_float (d); } DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0, doc: /* Truncate a floating point number to an integral float value. Rounds the value toward zero. */) - (register Lisp_Object arg) + (Lisp_Object arg) { double d = extract_float (arg); if (d >= 0.0) - IN_FLOAT (d = floor (d), "ftruncate", arg); + d = floor (d); else - IN_FLOAT (d = ceil (d), "ftruncate", arg); + d = ceil (d); return make_float (d); } -#ifdef HAVE_MATHERR -int -matherr (struct exception *x) -{ - Lisp_Object args; - const char *name = x->name; - - if (! in_float) - /* Not called from emacs-lisp float routines; do the default thing. */ - return 0; - if (!strcmp (x->name, "pow")) - name = "expt"; - - args - = Fcons (build_string (name), - Fcons (make_float (x->arg1), - ((!strcmp (name, "log") || !strcmp (name, "pow")) - ? Fcons (make_float (x->arg2), Qnil) - : Qnil))); - switch (x->type) - { - case DOMAIN: xsignal (Qdomain_error, args); break; - case SING: xsignal (Qsingularity_error, args); break; - case OVERFLOW: xsignal (Qoverflow_error, args); break; - case UNDERFLOW: xsignal (Qunderflow_error, args); break; - default: xsignal (Qarith_error, args); break; - } - return (1); /* don't set errno or print a message */ -} -#endif /* HAVE_MATHERR */ - -void -init_floatfns (void) -{ - in_float = 0; -} - void syms_of_floatfns (void) { === modified file 'src/image.c' --- src/image.c 2012-09-04 17:34:54 +0000 +++ src/image.c 2012-09-09 16:06:33 +0000 @@ -19,7 +19,6 @@ #include #include -#include #include #ifdef HAVE_PNG === modified file 'src/lisp.h' --- src/lisp.h 2012-09-07 08:46:44 +0000 +++ src/lisp.h 2012-09-09 16:06:33 +0000 @@ -2687,7 +2687,6 @@ /* Defined in floatfns.c */ extern double extract_float (Lisp_Object); -extern void init_floatfns (void); extern void syms_of_floatfns (void); extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y); === modified file 'src/lread.c' --- src/lread.c 2012-09-04 17:40:25 +0000 +++ src/lread.c 2012-09-09 16:06:33 +0000 @@ -50,7 +50,6 @@ #endif #include -#include #ifdef HAVE_SETLOCALE #include === modified file 'src/print.c' --- src/print.c 2012-09-04 17:34:54 +0000 +++ src/print.c 2012-09-09 16:06:33 +0000 @@ -45,15 +45,9 @@ static Lisp_Object Qfloat_output_format; -#include #include #include -/* Default to values appropriate for IEEE floating point. */ -#ifndef DBL_DIG -#define DBL_DIG 15 -#endif - /* Avoid actual stack overflow in print. */ static ptrdiff_t print_depth; ------------------------------------------------------------ revno: 109955 committer: Alan Mackenzie branch nick: trunk timestamp: Sun 2012-09-09 11:03:37 +0000 message: Correct the handling of two c-state-cache state variables. cc-engine.el (c-state-cache-init): Initialise c-state-semi-nonlit-pos-cache\(-limit\)? properly. (c-record-parse-state-state): record c-state-semi-nonlit-pos-cache\(-limit\)?. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-09 08:10:56 +0000 +++ lisp/ChangeLog 2012-09-09 11:03:37 +0000 @@ -1,3 +1,10 @@ +2012-09-09 Alan Mackenzie + + * progmodes/cc-engine.el (c-state-cache-init): Initialise + c-state-semi-nonlit-pos-cache\(-limit\)? properly. + (c-record-parse-state-state): record + c-state-semi-nonlit-pos-cache\(-limit\)?. + 2012-09-09 Andreas Schwab * register.el (register-separator): Rename from === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2012-09-08 20:00:13 +0000 +++ lisp/progmodes/cc-engine.el 2012-09-09 11:03:37 +0000 @@ -3091,6 +3091,8 @@ c-state-cache-good-pos 1 c-state-nonlit-pos-cache nil c-state-nonlit-pos-cache-limit 1 + c-state-semi-nonlit-pos-cache nil + c-state-semi-nonlit-pos-cache-limit 1 c-state-brace-pair-desert nil c-state-point-min 1 c-state-point-min-lit-type nil @@ -3350,6 +3352,8 @@ c-state-cache-good-pos c-state-nonlit-pos-cache c-state-nonlit-pos-cache-limit + c-state-semi-nonlit-pos-cache + c-state-semi-nonlit-pos-cache-limit c-state-brace-pair-desert c-state-point-min c-state-point-min-lit-type ------------------------------------------------------------ revno: 109954 committer: Jan D. branch nick: trunk timestamp: Sun 2012-09-09 10:44:22 +0200 message: Remove debug prints diff: === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-08 20:16:39 +0000 +++ src/nsterm.m 2012-09-09 08:44:22 +0000 @@ -650,7 +650,6 @@ struct frame *f = XFRAME (WINDOW_FRAME (w)); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); NSTRACE (ns_update_window_begin); - fprintf(stderr, "%s\n", __func__); updated_window = w; set_output_cursor (&w->cursor); @@ -683,7 +682,6 @@ { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); - fprintf(stderr, "%s\n", __func__); /* note: this fn is nearly identical in all terms */ if (!w->pseudo_window_p) { @@ -1267,7 +1265,6 @@ wr.origin.y += FRAME_PIXEL_HEIGHT (f) - pixelheight; [view setRows: rows andColumns: cols]; - fprintf(stderr, "%s %d %d\n", __func__, cols, (int)wr.origin.x); [window setFrame: wr display: YES]; /*fprintf (stderr, "\tx_set_window_size %d, %d\t%d, %d\n", cols, rows, pixelwidth, pixelheight); */ @@ -1285,7 +1282,6 @@ - NS_SCROLL_BAR_WIDTH (f), 0) : NSMakePoint (0, 0); [view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)]; - fprintf(stderr, "%s origin %d\n", __func__, (int)origin.x); [view setBoundsOrigin: origin]; } @@ -5398,7 +5394,6 @@ change_frame_size (emacsframe, rows, cols, 0, 0, 1); SET_FRAME_GARBAGED (emacsframe); cancel_mouse_face (emacsframe); - fprintf(stderr, "%s %d %d\n", __func__, cols, neww); [view setFrame: NSMakeRect (0, 0, neww, newh)]; } } @@ -6217,15 +6212,6 @@ if (nr_screens == 1) { NSRect r = [super constrainFrameRect:frameRect toScreen:screen]; - fprintf(stderr, "%s %d/%d %d/%d => %d/%d %d/%d\n", __func__, - (int)frameRect.origin.x, - (int)frameRect.origin.y, - (int)frameRect.size.width, - (int)frameRect.size.height, - (int)r.origin.x, - (int)r.origin.y, - (int)r.size.width, - (int)r.size.height); return r; } ------------------------------------------------------------ revno: 109953 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2012-09-09 10:10:56 +0200 message: * lisp/register.el (register-separator): Rename from separator-register. All uses changed. Doc fix. (register): Fix version. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-09 06:43:47 +0000 +++ etc/NEWS 2012-09-09 08:10:56 +0000 @@ -188,10 +188,11 @@ +++ ** `C-x r +' is now overloaded to invoke `append-to-register. + +++ -** New option `separator-register'. Separator register stores -separator text for use with M-x append-to-register and M-x -prepend-to-register. See manual for details. +** New option `register-separator' specifies the register containing +the text to put between collected texts for use with M-x +append-to-register and M-x prepend-to-register. ** Search changes === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-09 06:43:47 +0000 +++ lisp/ChangeLog 2012-09-09 08:10:56 +0000 @@ -1,3 +1,9 @@ +2012-09-09 Andreas Schwab + + * register.el (register-separator): Rename from + separator-register. All uses changed. Doc fix. + (register): Fix version. + 2012-09-09 Chong Yidong * replace.el (query-replace-map): Bind four new symbols for === modified file 'lisp/register.el' --- lisp/register.el 2012-09-08 20:09:06 +0000 +++ lisp/register.el 2012-09-09 08:10:56 +0000 @@ -79,10 +79,10 @@ (defgroup register nil "Register commands." :group 'convenience - :version "24.2.50") + :version "24.3") -(defcustom separator-register nil - "Use contents of this register to separate collected text. +(defcustom register-separator nil + "Register containing the text to put between collected texts, or nil if none. When collecting text with `append-to-register' (resp. `prepend-to-register') contents of @@ -377,7 +377,7 @@ (interactive "cAppend to register: \nr\nP") (let ((reg (get-register register)) (text (filter-buffer-substring start end)) - (separator (and separator-register (get-register separator-register)))) + (separator (and register-separator (get-register register-separator)))) (set-register register (cond ((not reg) text) ((stringp reg) (concat reg separator text)) @@ -395,7 +395,7 @@ (interactive "cPrepend to register: \nr\nP") (let ((reg (get-register register)) (text (filter-buffer-substring start end)) - (separator (and separator-register (get-register separator-register)))) + (separator (and register-separator (get-register register-separator)))) (set-register register (cond ((not reg) text) ((stringp reg) (concat text separator reg)) ------------------------------------------------------------ revno: 109952 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-09-09 15:50:45 +0800 message: Clarify descriptions of delq and delete in Lisp manual. * doc/lispref/lists.texi (Sets And Lists): Explain that the return value for delete should be used, like for delq. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-09 06:43:47 +0000 +++ doc/lispref/ChangeLog 2012-09-09 07:50:45 +0000 @@ -1,5 +1,8 @@ 2012-09-09 Chong Yidong + * lists.texi (Sets And Lists): Explain that the return value for + delete should be used, like for delq. + * minibuf.texi (Yes-or-No Queries): Document recentering and scrolling in y-or-n-p. Remove gratuitous example. === modified file 'doc/lispref/lists.texi' --- doc/lispref/lists.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/lists.texi 2012-09-09 07:50:45 +0000 @@ -1293,14 +1293,19 @@ @defun delq object list @cindex deleting list elements This function destructively removes all elements @code{eq} to -@var{object} from @var{list}. The letter @samp{q} in @code{delq} says -that it uses @code{eq} to compare @var{object} against the elements of -the list, like @code{memq} and @code{remq}. +@var{object} from @var{list}, and returns the resulting list. The +letter @samp{q} in @code{delq} says that it uses @code{eq} to compare +@var{object} against the elements of the list, like @code{memq} and +@code{remq}. + +Typically, when you invoke @code{delq}, you should use the return +value by assigning it to the variable which held the original list. +The reason for this is explained below. @end defun -When @code{delq} deletes elements from the front of the list, it does so -simply by advancing down the list and returning a sublist that starts -after those elements: +The @code{delq} function deletes elements from the front of the list +by simply advancing down the list, and returning a sublist that starts +after those elements. For example: @example @group @@ -1308,6 +1313,7 @@ @end group @end example +@noindent When an element to be deleted appears in the middle of the list, removing it involves changing the @sc{cdr}s (@pxref{Setcdr}). @@ -1432,12 +1438,15 @@ @end defun @defun delete object sequence -If @code{sequence} is a list, this function destructively removes all -elements @code{equal} to @var{object} from @var{sequence}. For lists, -@code{delete} is to @code{delq} as @code{member} is to @code{memq}: it -uses @code{equal} to compare elements with @var{object}, like -@code{member}; when it finds an element that matches, it cuts the -element out just as @code{delq} would. +This function removes all elements @code{equal} to @var{object} from +@var{sequence}, and returns the resulting sequence. + +If @var{sequence} is a list, @code{delete} is to @code{delq} as +@code{member} is to @code{memq}: it uses @code{equal} to compare +elements with @var{object}, like @code{member}; when it finds an +element that matches, it cuts the element out just as @code{delq} +would. As with @code{delq}, you should typically use the return value +by assigning it to the variable which held the original list. If @code{sequence} is a vector or string, @code{delete} returns a copy of @code{sequence} with all elements @code{equal} to @code{object} ------------------------------------------------------------ revno: 109951 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-09-09 15:09:03 +0800 message: * minibuf.texi: Fix last change. diff: === modified file 'doc/lispref/minibuf.texi' --- doc/lispref/minibuf.texi 2012-09-09 06:43:47 +0000 +++ doc/lispref/minibuf.texi 2012-09-09 07:09:03 +0000 @@ -1896,7 +1896,6 @@ @kbd{C-v}, @kbd{M-v}, @kbd{C-M-v} and @kbd{C-M-S-v} in @code{query-replace-map}), this function performs the specified window recentering or scrolling operation, and poses the question again. -@end smallexample @noindent We show successive lines of echo area messages, but only one actually ------------------------------------------------------------ revno: 109950 fixes bug: http://debbugs.gnu.org/8948 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-09-09 14:43:47 +0800 message: Allow scrolling in y-or-n-p. * lisp/replace.el (query-replace-map): Bind four new symbols for requesting window scrolling. * lisp/subr.el (y-or-n-p): Handle the window-scrolling bindings in query-replace-map. * lisp/custom.el (custom-theme-load-confirm): Use y-or-n-p. * lisp/window.el (scroll-other-window-down): Make the arg optional. * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't bind scrolling keys since they are now in query-replace-map. * doc/lispref/minibuf.texi (Yes-or-No Queries): Document recentering and scrolling in y-or-n-p. Remove gratuitous example. * doc/lispref/searching.texi (Search and Replace): Document window scrolling entries in query-replace-map. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-08 14:23:01 +0000 +++ doc/lispref/ChangeLog 2012-09-09 06:43:47 +0000 @@ -1,3 +1,11 @@ +2012-09-09 Chong Yidong + + * minibuf.texi (Yes-or-No Queries): Document recentering and + scrolling in y-or-n-p. Remove gratuitous example. + + * searching.texi (Search and Replace): Document window scrolling + entries in query-replace-map. + 2012-09-08 Chong Yidong * syntax.texi (Syntax Table Internals): Define "raw syntax === modified file 'doc/lispref/minibuf.texi' --- doc/lispref/minibuf.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/minibuf.texi 2012-09-09 06:43:47 +0000 @@ -1888,46 +1888,14 @@ cursor moves to the echo area while the question is being asked. The answers and their meanings, even @samp{y} and @samp{n}, are not -hardwired. The keymap @code{query-replace-map} specifies them. -@xref{Search and Replace}. - -In the following example, the user first types @kbd{q}, which is -invalid. At the next prompt the user types @kbd{y}. - -@c Need an interactive example, because otherwise the return value -@c obscures the display of the valid answer. -@smallexample -@group -(defun ask () - (interactive) - (y-or-n-p "Do you need a lift? ")) - -;; @r{After evaluation of the preceding definition, @kbd{M-x ask}} -;; @r{causes the following prompt to appear in the echo area:} -@end group - -@group ----------- Echo area ---------- -Do you need a lift? (y or n) ----------- Echo area ---------- -@end group - -;; @r{If the user then types @kbd{q}, the following appears:} - -@group ----------- Echo area ---------- -Please answer y or n. Do you need a lift? (y or n) ----------- Echo area ---------- -@end group - -;; @r{When the user types a valid answer,} -;; @r{it is displayed after the question:} - -@group ----------- Echo area ---------- -Do you need a lift? (y or n) y ----------- Echo area ---------- -@end group +hardwired, and are specified by the keymap @code{query-replace-map} +(@pxref{Search and Replace}). In particular, if the user enters the +special responses @code{recenter}, @code{scroll-up}, +@code{scroll-down}, @code{scroll-other-window}, or +@code{scroll-other-window-down} (respectively bound to @kbd{C-l}, +@kbd{C-v}, @kbd{M-v}, @kbd{C-M-v} and @kbd{C-M-S-v} in +@code{query-replace-map}), this function performs the specified window +recentering or scrolling operation, and poses the question again. @end smallexample @noindent === modified file 'doc/lispref/searching.texi' --- doc/lispref/searching.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/searching.texi 2012-09-09 06:43:47 +0000 @@ -1796,7 +1796,13 @@ it. @item recenter -Redisplay and center the window, then ask the same question again. +@itemx scroll-up +@itemx scroll-down +@itemx scroll-other-window +@itemx scroll-other-window-down +Perform the specified window scroll operation, then ask the same +question again. Only @code{y-or-n-p} and related functions use this +answer. @item quit Perform a quit right away. Only @code{y-or-n-p} and related functions === modified file 'etc/NEWS' --- etc/NEWS 2012-09-08 20:09:06 +0000 +++ etc/NEWS 2012-09-09 06:43:47 +0000 @@ -78,6 +78,10 @@ * Changes in Emacs 24.3 +** You can now scroll the selected window in most y-or-n prompts. +Typing C-v or M-v at a prompt scrolls forward or backward +respectively, without leaving the y-or-n prompt. + ** Help changes *** `C-h f' (describe-function) can now perform autoloading. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-09 05:50:43 +0000 +++ lisp/ChangeLog 2012-09-09 06:43:47 +0000 @@ -1,5 +1,20 @@ 2012-09-09 Chong Yidong + * replace.el (query-replace-map): Bind four new symbols for + requesting window scrolling. + + * subr.el (y-or-n-p): Handle the window-scrolling bindings in + query-replace-map (Bug#8948). + + * custom.el (custom-theme-load-confirm): Use y-or-n-p. + + * emacs-lisp/map-ynp.el (map-y-or-n-p): Don't bind scrolling keys + since they are now in query-replace-map. + + * window.el (scroll-other-window-down): Make the arg optional. + +2012-09-09 Chong Yidong + * files.el (hack-local-variables-confirm): Use quit-window to kill the *Local Variables* buffer. === modified file 'lisp/custom.el' --- lisp/custom.el 2012-08-15 16:29:11 +0000 +++ lisp/custom.el 2012-09-09 06:43:47 +0000 @@ -1223,38 +1223,19 @@ "Query the user about loading a Custom theme that may not be safe. The theme should be in the current buffer. If the user agrees, query also about adding HASH to `custom-safe-themes'." - (if noninteractive - nil - (let ((exit-chars '(?y ?n ?\s)) - window prompt char) - (save-window-excursion - (rename-buffer "*Custom Theme*" t) - (emacs-lisp-mode) - (setq window (display-buffer (current-buffer))) - (setq prompt - (format "Loading a theme can run Lisp code. Really load?%s" - (if (and window - (< (line-number-at-pos (point-max)) - (window-body-height))) - " (y or n) " - (push ?\C-v exit-chars) - "\nType y or n, or C-v to scroll: "))) - (goto-char (point-min)) - (while (null char) - (setq char (read-char-choice prompt exit-chars)) - (when (eq char ?\C-v) - (if window - (with-selected-window window - (condition-case nil - (scroll-up) - (error (goto-char (point-min)))))) - (setq char nil))) - (when (memq char '(?\s ?y)) - ;; Offer to save to `custom-safe-themes'. - (and (or custom-file user-init-file) - (y-or-n-p "Treat this theme as safe in future sessions? ") - (customize-push-and-save 'custom-safe-themes (list hash))) - t))))) + (unless noninteractive + (save-window-excursion + (rename-buffer "*Custom Theme*" t) + (emacs-lisp-mode) + (setq window (pop-to-buffer (current-buffer))) + (goto-char (point-min)) + (prog1 (when (y-or-n-p "Loading a theme can run Lisp code. Really load? ") + ;; Offer to save to `custom-safe-themes'. + (and (or custom-file user-init-file) + (y-or-n-p "Treat this theme as safe in future sessions? ") + (customize-push-and-save 'custom-safe-themes (list hash))) + t) + (quit-window))))) (defun custom-theme-name-valid-p (name) "Return t if NAME is a valid name for a Custom theme, nil otherwise. === modified file 'lisp/emacs-lisp/map-ynp.el' --- lisp/emacs-lisp/map-ynp.el 2012-07-18 11:44:13 +0000 +++ lisp/emacs-lisp/map-ynp.el 2012-09-09 06:43:47 +0000 @@ -123,16 +123,6 @@ map (let ((map (make-sparse-keymap))) (set-keymap-parent map query-replace-map) - (define-key map [?\C-\M-v] 'scroll-other-window) - (define-key map [M-next] 'scroll-other-window) - (define-key map [?\C-\M-\S-v] 'scroll-other-window-down) - (define-key map [M-prior] 'scroll-other-window-down) - ;; The above are rather inconvenient, so maybe we should - ;; provide the non-other keys for the other-scroll as well. - ;; (define-key map [?\C-v] 'scroll-other-window) - ;; (define-key map [next] 'scroll-other-window) - ;; (define-key map [?\M-v] 'scroll-other-window-down) - ;; (define-key map [prior] 'scroll-other-window-down) (dolist (elt action-alist) (define-key map (vector (car elt)) (vector (nth 1 elt)))) map))) === modified file 'lisp/replace.el' --- lisp/replace.el 2012-09-06 08:49:40 +0000 +++ lisp/replace.el 2012-09-09 06:43:47 +0000 @@ -1617,14 +1617,28 @@ (define-key map "?" 'help) (define-key map "\C-g" 'quit) (define-key map "\C-]" 'quit) - (define-key map "\e" 'exit-prefix) + (define-key map "\C-v" 'scroll-up) + (define-key map "\M-v" 'scroll-down) + (define-key map [next] 'scroll-up) + (define-key map [prior] 'scroll-down) + (define-key map [?\C-\M-v] 'scroll-other-window) + (define-key map [M-next] 'scroll-other-window) + (define-key map [?\C-\M-\S-v] 'scroll-other-window-down) + (define-key map [M-prior] 'scroll-other-window-down) + ;; Binding ESC would prohibit the M-v binding. Instead, callers + ;; should check for ESC specially. + ;; (define-key map "\e" 'exit-prefix) (define-key map [escape] 'exit-prefix) map) - "Keymap that defines the responses to questions in `query-replace'. + "Keymap of responses to questions posed by commands like `query-replace'. The \"bindings\" in this map are not commands; they are answers. The valid answers include `act', `skip', `act-and-show', -`exit', `act-and-exit', `edit', `edit-replacement', `delete-and-edit', -`recenter', `automatic', `backup', `exit-prefix', `quit', and `help'.") +`act-and-exit', `exit', `exit-prefix', `recenter', `scroll-up', +`scroll-down', `scroll-other-window', `scroll-other-window-down', +`edit', `edit-replacement', `delete-and-edit', `automatic', +`backup', `quit', and `help'. + +This keymap is used by `y-or-n-p' as well as `query-replace'.") (defvar multi-query-replace-map (let ((map (make-sparse-keymap))) === modified file 'lisp/subr.el' --- lisp/subr.el 2012-09-08 14:30:09 +0000 +++ lisp/subr.el 2012-09-09 06:43:47 +0000 @@ -2319,11 +2319,19 @@ PROMPT is the string to display to ask the question. It should end in a space; `y-or-n-p' adds \"(y or n) \" to it. -No confirmation of the answer is requested; a single character is enough. -Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses -the bindings in `query-replace-map'; see the documentation of that variable -for more information. In this case, the useful bindings are `act', `skip', -`recenter', and `quit'.\) +No confirmation of the answer is requested; a single character is +enough. SPC also means yes, and DEL means no. + +To be precise, this function translates user input into responses +by consulting the bindings in `query-replace-map'; see the +documentation of that variable for more information. In this +case, the useful bindings are `act', `skip', `recenter', +`scroll-up', `scroll-down', and `quit'. +An `act' response means yes, and a `skip' response means no. +A `quit' response means to invoke `keyboard-quit'. +If the user enters `recenter', `scroll-up', or `scroll-down' +responses, perform the requested window recentering or scrolling +and ask again. Under a windowing system a dialog box will be used if `last-nonmenu-event' is nil and `use-dialog-box' is non-nil." @@ -2355,21 +2363,33 @@ "" " ") "(y or n) ")) (while - (let* ((key + (let* ((scroll-actions '(recenter scroll-up scroll-down + scroll-other-window scroll-other-window-down)) + (key (let ((cursor-in-echo-area t)) (when minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) - (read-key (propertize (if (eq answer 'recenter) + (read-key (propertize (if (memq answer scroll-actions) prompt (concat "Please answer y or n. " prompt)) 'face 'minibuffer-prompt))))) (setq answer (lookup-key query-replace-map (vector key) t)) (cond - ((memq answer '(skip act)) nil) - ((eq answer 'recenter) (recenter) t) - ((memq answer '(exit-prefix quit)) (signal 'quit nil) t) - (t t))) + ((memq answer '(skip act)) nil) + ((eq answer 'recenter) + (recenter) t) + ((eq answer 'scroll-up) + (ignore-errors (scroll-up-command)) t) + ((eq answer 'scroll-down) + (ignore-errors (scroll-down-command)) t) + ((eq answer 'scroll-other-window) + (ignore-errors (scroll-other-window)) t) + ((eq answer 'scroll-other-window-down) + (ignore-errors (scroll-other-window-down)) t) + ((or (memq answer '(exit-prefix quit)) (eq key ?\e)) + (signal 'quit nil) t) + (t t))) (ding) (discard-input)))) (let ((ret (eq answer 'act))) === modified file 'lisp/window.el' --- lisp/window.el 2012-09-08 13:28:11 +0000 +++ lisp/window.el 2012-09-09 06:43:47 +0000 @@ -6301,7 +6301,7 @@ (put 'scroll-down-line 'scroll-command t) -(defun scroll-other-window-down (lines) +(defun scroll-other-window-down (&optional lines) "Scroll the \"other window\" down. For more details, see the documentation for `scroll-other-window'." (interactive "P")