Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 104342. ------------------------------------------------------------ revno: 104342 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-05-24 00:03:44 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/Makefile.in' --- autogen/Makefile.in 2011-05-20 00:54:09 +0000 +++ autogen/Makefile.in 2011-05-24 04:03:44 +0000 @@ -508,6 +508,7 @@ OLDXMENU = @OLDXMENU@ OLDXMENU_DEPS = @OLDXMENU_DEPS@ OLDXMENU_TARGET = @OLDXMENU_TARGET@ +OPT_MAKEFILES_IN = @OPT_MAKEFILES_IN@ OTHER_FILES = @OTHER_FILES@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ === modified file 'autogen/configure' --- autogen/configure 2011-05-20 00:54:09 +0000 +++ autogen/configure 2011-05-24 04:03:44 +0000 @@ -603,6 +603,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +OPT_MAKEFILES_IN LIB_GCC LD_FIRSTFLAG LD_SWITCH_SYSTEM_TEMACS @@ -20908,7 +20909,16 @@ test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` -ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile test/automated/Makefile" +ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" + + +if test -f $srcdir/test/automated/Makefile.in; then + OPT_MAKEFILES_IN=test/automated/Makefile.in + ac_config_files="$ac_config_files test/automated/Makefile" + +else + OPT_MAKEFILES_IN= +fi ac_config_commands="$ac_config_commands mkdirs" ------------------------------------------------------------ revno: 104341 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-05-23 21:00:56 -0700 message: Restore test/ to its non-distributed state (bug#8107) * make-dist: Don't distribute test/. * configure.in (OPT_MAKEFILES_IN): New output variable. (AC_CONFIG_FILES): Conditionally include test/automated/Makefile. * Makefile.in (OPT_MAKEFILES_IN): New, set by configure. (SUBDIR_MAKEFILES_IN): Use $OPT_MAKEFILES_IN. (check): Give an explicit error if test/ is not present. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-24 03:40:14 +0000 +++ ChangeLog 2011-05-24 04:00:56 +0000 @@ -1,5 +1,12 @@ 2011-05-24 Glenn Morris + * make-dist: Don't distribute test/. (Bug#8107) + * configure.in (OPT_MAKEFILES_IN): New output variable. + (AC_CONFIG_FILES): Conditionally include test/automated/Makefile. + * Makefile.in (OPT_MAKEFILES_IN): New, set by configure. + (SUBDIR_MAKEFILES_IN): Use $OPT_MAKEFILES_IN. + (check): Give an explicit error if test/ is not present. + * Makefile.in (SUBDIR_MAKEFILES_IN): New variable. (SUBDIR_MAKEFILES): Derive from $SUBDIR_MAKEFILES_IN. (Makefile): Use $SUBDIR_MAKEFILES_IN. === modified file 'Makefile.in' --- Makefile.in 2011-05-24 03:40:14 +0000 +++ Makefile.in 2011-05-24 04:00:56 +0000 @@ -264,11 +264,14 @@ # checked out from a VCS. SUBDIR = lib lib-src src lisp +# test/automated/Makefile.in, if you have it (test/ is not in the release). +OPT_MAKEFILES_IN = @OPT_MAKEFILES_IN@ + # The subdir makefiles created by config.status. SUBDIR_MAKEFILES_IN = lib/Makefile.in lib-src/Makefile.in \ doc/emacs/Makefile.in doc/misc/Makefile.in doc/lispref/Makefile.in \ doc/lispintro/Makefile.in src/Makefile.in oldXMenu/Makefile.in \ - lwlib/Makefile.in leim/Makefile.in lisp/Makefile.in test/automated/Makefile.in + lwlib/Makefile.in leim/Makefile.in lisp/Makefile.in $(OPT_MAKEFILES_IN) SUBDIR_MAKEFILES = $(SUBDIR_MAKEFILES_IN:.in=) @@ -862,7 +865,10 @@ cd src; $(MAKE) tags check: - cd test/automated; $(MAKE) check + @if test ! -d test/automated; then \ + echo "You do not seem to have the test/ directory."; exit 1; \ + else true; fi + cd test/automated && $(MAKE) check dist: cd ${srcdir}; ./make-dist === modified file 'configure.in' --- configure.in 2011-05-20 00:41:03 +0000 +++ configure.in 2011-05-24 04:00:56 +0000 @@ -3715,7 +3715,16 @@ AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ doc/lispref/Makefile src/Makefile \ - lwlib/Makefile lisp/Makefile leim/Makefile test/automated/Makefile]) + lwlib/Makefile lisp/Makefile leim/Makefile]) + +dnl test/ is not present in release tarfiles. +if test -f $srcdir/test/automated/Makefile.in; then + OPT_MAKEFILES_IN=test/automated/Makefile.in + AC_CONFIG_FILES([test/automated/Makefile]) +else + OPT_MAKEFILES_IN= +fi +AC_SUBST(OPT_MAKEFILES_IN) dnl Make the necessary directories, if they don't exist. AC_CONFIG_COMMANDS([mkdirs], [ === modified file 'make-dist' --- make-dist 2011-03-31 04:24:03 +0000 +++ make-dist 2011-05-24 04:00:56 +0000 @@ -299,7 +299,6 @@ nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \ `find etc lisp -type d` \ doc doc/emacs doc/misc doc/man doc/lispref doc/lispintro \ - test test/automated test/cedet test/cedet/tests test/indent \ info m4 msdos \ nextstep nextstep/Cocoa nextstep/Cocoa/Emacs.base \ nextstep/Cocoa/Emacs.base/Contents \ @@ -485,26 +484,6 @@ ln ChangeLog* *.1 ../../${tempdir}/doc/man cd ../../${tempdir}/doc/man) -echo "Making links to \`test'" -(cd test - ln *.el ChangeLog README ../${tempdir}/test) - -echo "Making links to \`test/automated'" -(cd test/automated - ln *.el Makefile.in ../../${tempdir}/test/automated) - -echo "Making links to \`test/cedet'" -(cd test/cedet - ln *.el ../../${tempdir}/test/cedet) - -echo "Making links to \`test/cedet/tests'" -(cd test/cedet/tests - ln *.c *.[ch]pp *.el *.hh *.java *.make ../../../${tempdir}/test/cedet/tests) - -echo "Making links to \`test/indent'" -(cd test/indent - ln *.m *.mod *.prolog Makefile ../../${tempdir}/test/indent) - ### It would be nice if they could all be symlinks to top-level copy, but ### you're not supposed to have any symlinks in distribution tar files. echo "Making sure copying notices are all copies of \`COPYING'" ------------------------------------------------------------ revno: 104340 [merge] committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-05-23 20:54:18 -0700 message: Merge from emacs-23; up to r100585. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-24 03:38:35 +0000 +++ lisp/ChangeLog 2011-05-24 03:54:18 +0000 @@ -1,3 +1,19 @@ +2011-05-24 Kenichi Handa + + * mail/sendmail.el: Require `rfc2047'. + (mail-insert-from-field): Do not perform RFC2047 encoding. + (mail-encode-header): New function. + (sendmail-send-it): Set buffer-file-coding-system of the work + buffer to the return value of select-message-coding-system. Call + mail-encode-header. + + * mail/smtpmail.el (smtpmail-send-it): Call mail-encode-header. + +2011-05-24 Sean Neakums (tiny change) + + * mail/supercite.el (sc-default-cite-frame): Handle + sc-nested-citation-p when sc-cite-blank-lines-p is non-nil. + 2011-05-24 Glenn Morris * progmodes/python.el (brm-menu): Declare. === modified file 'lisp/mail/sendmail.el' --- lisp/mail/sendmail.el 2011-05-23 17:57:17 +0000 +++ lisp/mail/sendmail.el 2011-05-24 03:54:18 +0000 @@ -29,7 +29,7 @@ ;;; Code: (require 'mail-utils) -(autoload 'rfc2047-encode-string "rfc2047") +(require 'rfc2047) (defgroup sendmail nil "Mail sending commands for Emacs." @@ -945,12 +945,14 @@ See also the function `select-message-coding-system'.") (defun mail-insert-from-field () + "Insert the \"From:\" field of a mail header. +The style of the field is determined by the variable `mail-from-style'. +This function does not perform RFC2047 encoding." (let* ((login user-mail-address) (fullname (user-full-name)) (quote-fullname nil)) (if (string-match "[^\0-\177]" fullname) - (setq fullname (rfc2047-encode-string fullname) - quote-fullname t)) + (setq quote-fullname t)) (cond ((null mail-from-style) (insert "From: " login "\n")) ;; This is deprecated. @@ -1010,6 +1012,20 @@ (goto-char fullname-start)))) (insert ")\n"))))) +(defun mail-encode-header (beg end) + "Encode the mail header between BEG and END according to RFC2047. +Return non-nil if and only if some part of the header is encoded." + (save-restriction + (narrow-to-region beg end) + (let* ((selected (select-message-coding-system)) + (mm-coding-system-priorities + (if (and selected (coding-system-get selected :mime-charset)) + (cons selected mm-coding-system-priorities) + mm-coding-system-priorities)) + (tick (buffer-chars-modified-tick))) + (rfc2047-encode-message-header) + (= tick (buffer-chars-modified-tick))))) + ;; Normally you will not need to modify these options unless you are ;; using some non-genuine substitute for sendmail which does not ;; implement each and every option that the original supports. @@ -1050,6 +1066,7 @@ (unless multibyte (set-buffer-multibyte nil)) (insert-buffer-substring mailbuf) + (set-buffer-file-coding-system selected-coding) (goto-char (point-max)) ;; require one newline at the end. (or (= (preceding-char) ?\n) @@ -1155,6 +1172,8 @@ (if mail-interactive (with-current-buffer errbuf (erase-buffer)))) + ;; Encode the header according to RFC2047. + (mail-encode-header (point-min) delimline) (goto-char (point-min)) (if (let ((case-fold-search t)) (or resend-to-addresses === modified file 'lisp/mail/smtpmail.el' --- lisp/mail/smtpmail.el 2011-02-12 17:51:02 +0000 +++ lisp/mail/smtpmail.el 2011-05-24 03:54:18 +0000 @@ -361,6 +361,8 @@ (if mail-interactive (with-current-buffer errbuf (erase-buffer)))) + ;; Encode the header according to RFC2047. + (mail-encode-header (point-min) delimline) ;; (setq smtpmail-address-buffer (generate-new-buffer "*smtp-mail*")) (setq smtpmail-recipient-address-list === modified file 'lisp/mail/supercite.el' --- lisp/mail/supercite.el 2011-01-25 04:08:28 +0000 +++ lisp/mail/supercite.el 2011-05-24 03:54:18 +0000 @@ -184,7 +184,9 @@ ;; paragraph, unless sc-cite-blank-lines-p is non-nil, in which ;; case we treat blank lines just like any other line. ("^[ \t]*$" (if sc-cite-blank-lines-p - (sc-cite-line) + (if sc-nested-citation-p + (sc-add-citation-level) + (sc-cite-line)) (sc-fill-if-different ""))) ;; do nothing if looking at a reference tag. make sure that the ;; tag string isn't the empty string since this will match every ------------------------------------------------------------ revno: 104339 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-05-23 20:43:17 -0700 message: * lib-src/Makefile.in (update-game-score${EXEEXT}): Use a single rule. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-05-19 06:04:16 +0000 +++ lib-src/ChangeLog 2011-05-24 03:43:17 +0000 @@ -1,3 +1,7 @@ +2011-05-24 Glenn Morris + + * Makefile.in (update-game-score${EXEEXT}): Use a single rule. + 2011-05-19 Glenn Morris * makefile.w32-in (echolisp): Remove rule that is no longer needed. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2011-05-18 03:39:45 +0000 +++ lib-src/Makefile.in 2011-05-24 03:43:17 +0000 @@ -361,12 +361,8 @@ hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl -update-game-score${EXEEXT}: update-game-score.o - $(CC) ${LINK_CFLAGS} update-game-score.o \ - $(LOADLIBES) -o update-game-score - -update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h - $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \ - -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" +update-game-score${EXEEXT}: ${srcdir}/update-game-score.c ../src/config.h + $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ + ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score ## Makefile ends here. ------------------------------------------------------------ revno: 104338 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-05-23 20:40:14 -0700 message: Eliminate some duplication in top-level Makefile.in. * Makefile.in (SUBDIR_MAKEFILES_IN): New variable. (SUBDIR_MAKEFILES): Derive from $SUBDIR_MAKEFILES_IN. (Makefile): Use $SUBDIR_MAKEFILES_IN. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-23 21:53:22 +0000 +++ ChangeLog 2011-05-24 03:40:14 +0000 @@ -1,3 +1,9 @@ +2011-05-24 Glenn Morris + + * Makefile.in (SUBDIR_MAKEFILES_IN): New variable. + (SUBDIR_MAKEFILES): Derive from $SUBDIR_MAKEFILES_IN. + (Makefile): Use $SUBDIR_MAKEFILES_IN. + 2011-05-23 Paul Eggert * lib/verify.h: Merge from gnulib. === modified file 'Makefile.in' --- Makefile.in 2011-05-21 09:53:32 +0000 +++ Makefile.in 2011-05-24 03:40:14 +0000 @@ -265,7 +265,12 @@ SUBDIR = lib lib-src src lisp # The subdir makefiles created by config.status. -SUBDIR_MAKEFILES = lib/Makefile lib-src/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispref/Makefile doc/lispintro/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile lisp/Makefile test/automated/Makefile +SUBDIR_MAKEFILES_IN = lib/Makefile.in lib-src/Makefile.in \ + doc/emacs/Makefile.in doc/misc/Makefile.in doc/lispref/Makefile.in \ + doc/lispintro/Makefile.in src/Makefile.in oldXMenu/Makefile.in \ + lwlib/Makefile.in leim/Makefile.in lisp/Makefile.in test/automated/Makefile.in + +SUBDIR_MAKEFILES = $(SUBDIR_MAKEFILES_IN:.in=) # Subdirectories to install, and where they'll go. # lib-src's makefile knows how to install it, so we don't do that here. @@ -388,19 +393,7 @@ # conditions with parallel makes, so let's assume that the time stamp on # ./Makefile is representative of the time stamp on all the other Makefiles. Makefile: config.status $(srcdir)/src/config.in \ - $(srcdir)/Makefile.in \ - $(srcdir)/src/Makefile.in \ - $(srcdir)/lib/Makefile.in \ - $(srcdir)/lib-src/Makefile.in \ - $(srcdir)/doc/emacs/Makefile.in \ - $(srcdir)/doc/misc/Makefile.in \ - $(srcdir)/doc/lispref/Makefile.in \ - $(srcdir)/doc/lispintro/Makefile.in \ - $(srcdir)/oldXMenu/Makefile.in \ - $(srcdir)/lwlib/Makefile.in \ - $(srcdir)/leim/Makefile.in \ - $(srcdir)/lisp/Makefile.in \ - $(srcdir)/test/automated/Makefile.in + $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) ./config.status # Don't erase config.status if make is interrupted while refreshing it. ------------------------------------------------------------ revno: 104337 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-05-23 20:38:35 -0700 message: * lisp/progmodes/python.el (brm-menu): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-24 03:37:31 +0000 +++ lisp/ChangeLog 2011-05-24 03:38:35 +0000 @@ -1,5 +1,7 @@ 2011-05-24 Glenn Morris + * progmodes/python.el (brm-menu): Declare. + * emulation/viper.el (viper-set-hooks): Declare. * play/5x5.el (5x5-log-init, 5x5-log): Evaluate when compiling. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2011-05-23 17:57:17 +0000 +++ lisp/progmodes/python.el 2011-05-24 03:38:35 +0000 @@ -2361,6 +2361,7 @@ (autoload 'pymacs-load "pymacs" nil t) (autoload 'brm-init "bikemacs") +(defvar brm-menu) ;; I'm not sure how useful BRM really is, and it's certainly dangerous ;; the way it modifies files outside Emacs... Also note that the ------------------------------------------------------------ revno: 104336 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-05-23 20:37:31 -0700 message: * lisp/emulation/viper.el (viper-set-hooks): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-24 03:36:06 +0000 +++ lisp/ChangeLog 2011-05-24 03:37:31 +0000 @@ -1,5 +1,7 @@ 2011-05-24 Glenn Morris + * emulation/viper.el (viper-set-hooks): Declare. + * play/5x5.el (5x5-log-init, 5x5-log): Evaluate when compiling. (5x5-log-init, 5x5-log, 5x5-solver): Doc fixes. (math-map-vec, math-sub, math-mul, math-make-intv, math-reduce-vec) === modified file 'lisp/emulation/viper.el' --- lisp/emulation/viper.el 2011-05-23 17:57:17 +0000 +++ lisp/emulation/viper.el 2011-05-24 03:37:31 +0000 @@ -1,4 +1,4 @@ -;;; viper.el --- A full-featured Vi emulator for GNU Emacs and XEmacs, +;;; viper.el --- A full-featured Vi emulator for Emacs and XEmacs, ;; a VI Plan for Emacs Rescue, ;; and a venomous VI PERil. ;; Viper Is also a Package for Emacs Rebels. @@ -547,7 +547,7 @@ "Viper Is a Package for Emacs Rebels, a VI Plan for Emacs Rescue, and a venomous VI PERil. -Incidentally, Viper emulates Vi under GNU Emacs 20 and XEmacs 20. +Incidentally, Viper emulates Vi under Emacs/XEmacs 20. It supports all of what is good in Vi and Ex, while extending and improving upon much of it. @@ -850,6 +850,7 @@ ;; Zap bad bindings in flyspell-mouse-map, which prevent ESC from working ;; over misspelled words (due to the overlay keymaps) (defvar flyspell-mode-hook) + (defvar flyspell-mouse-map) (add-hook 'flyspell-mode-hook (lambda () (define-key flyspell-mouse-map viper-ESC-key nil))) ------------------------------------------------------------ revno: 104335 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-05-23 20:36:06 -0700 message: Small cleanup of recent 5x5.el changes. * lisp/play/5x5.el (5x5-log-init, 5x5-log): Evaluate when compiling. (5x5-log-init, 5x5-log, 5x5-solver): Doc fixes. (math-map-vec, math-sub, math-mul, math-make-intv, math-reduce-vec) (math-format-number, math-pow, calcFunc-arrange, calcFunc-cvec) (calcFunc-diag, calcFunc-trn, calcFunc-inv, calcFunc-mrow) (calcFunc-mcol, calcFunc-vconcat, calcFunc-index): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-24 02:45:50 +0000 +++ lisp/ChangeLog 2011-05-24 03:36:06 +0000 @@ -1,3 +1,12 @@ +2011-05-24 Glenn Morris + + * play/5x5.el (5x5-log-init, 5x5-log): Evaluate when compiling. + (5x5-log-init, 5x5-log, 5x5-solver): Doc fixes. + (math-map-vec, math-sub, math-mul, math-make-intv, math-reduce-vec) + (math-format-number, math-pow, calcFunc-arrange, calcFunc-cvec) + (calcFunc-diag, calcFunc-trn, calcFunc-inv, calcFunc-mrow) + (calcFunc-mcol, calcFunc-vconcat, calcFunc-index): Declare. + 2011-05-24 Stefan Monnier Add an :exit-function for completion-at-point. === modified file 'lisp/play/5x5.el' --- lisp/play/5x5.el 2011-05-23 14:46:41 +0000 +++ lisp/play/5x5.el 2011-05-24 03:36:06 +0000 @@ -490,6 +490,7 @@ (cdr x)))) (cdr grid-matrix)))) +(eval-and-compile (if nil; set to t to enable solver logging (progn (defvar 5x5-log-buffer nil) @@ -499,7 +500,7 @@ (setq 5x5-log-buffer (get-buffer-create "*5x5 LOG*")))) (defun 5x5-log (name value) - "Debug purpuse only. + "Debug purposes only. Log a matrix VALUE of (mod B 2) forms, only B is output and Scilab matrix notation is used. VALUE is returned so that it is @@ -516,19 +517,36 @@ (insert name ?= value-to-log ?\n)))) value)) (defmacro 5x5-log-init ()) - (defmacro 5x5-log (name value) value)) + (defmacro 5x5-log (name value) value))) + +(declare-function math-map-vec "calc-vec" (f a)) +(declare-function math-sub "calc" (a b)) +(declare-function math-mul "calc" (a b)) +(declare-function math-make-intv "calc-forms" (mask lo hi)) +(declare-function math-reduce-vec "calc-vec" (a b)) +(declare-function math-format-number "calc" (a &optional prec)) +(declare-function math-pow "calc-misc" (a b)) +(declare-function calcFunc-arrange "calc-vec" (vec cols)) +(declare-function calcFunc-cvec "calc-vec" (obj &rest dims)) +(declare-function calcFunc-diag "calc-vec" (a &optional n)) +(declare-function calcFunc-trn "calc-vec" (mat)) +(declare-function calcFunc-inv "calc-misc" (m)) +(declare-function calcFunc-mrow "calc-vec" (mat n)) +(declare-function calcFunc-mcol "calc-vec" (mat n)) +(declare-function calcFunc-vconcat "calc-vec" (a b)) +(declare-function calcFunc-index "calc-vec" (n &optional start incr)) (defun 5x5-solver (grid) "Return a list of solutions for GRID. Given some grid GRID, the returned a list of solution LIST is -sorted from least Hamming weight to geatest one. +sorted from least Hamming weight to greatest one. LIST = (SOLUTION-1 ... SOLUTION-N) Each solution SOLUTION-I is a cons cell (HW . G) where HW is the Hamming weight of the solution --- ie the number of strokes to -achieves it --- and G is the grid of positions to click in order +achieve it --- and G is the grid of positions to click in order to complete the 5x5. Solutions are sorted from least to greatest Hamming weight." ------------------------------------------------------------ revno: 104334 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-05-23 23:45:50 -0300 message: Add an :exit-function for completion-at-point. * lisp/minibuffer.el (completion--done): New fun. (completion--do-completion): Use it. New arg `expect-exact'. (minibuffer-complete, minibuffer-complete-word): Don't output message, since completion--do-completion does it for us now. (minibuffer-force-complete): Use completion--done and completion--replace. Handle sole-completion case with more care. (minibuffer-complete-and-exit): Use new `expect-exact' arg. (completion-extra-properties): New var. (completion-annotate-function): Make obsolete. (minibuffer-completion-help): Adjust accordingly. Use completion-list-insert-choice-function. (completion-at-point, completion-help-at-point): Bind completion-extra-properties. (completion-pcm-word-delimiters): Add | (for uniquify, for example). * lisp/simple.el (completion-list-insert-choice-function): New var. (completion-setup-function): Preserve it. (choose-completion): Pay attention to it, shuffle the code a bit. (choose-completion-string): New arg `insert-function'. * lisp/textmodes/bibtex.el: Convert to lexical binding. (bibtex-mode-map): Use completion-at-point. (bibtex-mode): Use define-derived-mode&completion-at-point-functions. (bibtex-completion-at-point-function): New fun, from bibtex-complete. (bibtex-complete): Define as obsolete alias. (bibtex-complete-internal): Remove. (bibtex-format-entry): Remove unused sub-group in regexp. * lisp/shell.el (shell--command-completion-data) (shell-environment-variable-completion): * lisp/pcomplete.el (pcomplete-completions-at-point): * lisp/comint.el (comint--complete-file-name-data): Use :exit-function instead of completion-table-with-terminator so it also works for choose-completion. diff: === modified file 'etc/NEWS' --- etc/NEWS 2011-05-18 03:39:45 +0000 +++ etc/NEWS 2011-05-24 02:45:50 +0000 @@ -68,9 +68,6 @@ * Changes in Emacs 24.1 -** Completion in a non-minibuffer now tries to detect the end of completion -and pops down the *Completions* buffer accordingly. - ** emacsclient changes *** New emacsclient argument --parent-id ID can be used to open a @@ -83,9 +80,18 @@ *** If emacsclient shuts down as a result of Emacs signalling an error, its exit status is 1. -** Completion can cycle, depending on completion-cycle-threshold. - -** `completing-read' can be customized using the new variable +** Completion +*** Many packages have been changed to use completion-at-point rather than +their own completion code. + +*** Completion in a non-minibuffer now tries to detect the end of completion +and pops down the *Completions* buffer accordingly. + +*** Completion can cycle, depending on completion-cycle-threshold. + +*** New completion style `substring'. + +*** `completing-read' can be customized using the new variable `completing-read-function'. ** auto-mode-case-fold is now enabled by default. @@ -833,6 +839,17 @@ * Lisp changes in Emacs 24.1 +** Completion +*** New variable completion-extra-properties used to specify extra properties +of the current completion: +- :annotate-function, same as the old completion-annotate-function. +- :exit-function, function to call after completion took place. + +*** Functions on completion-at-point-functions can return any of the properties +valid for completion-extra-properties. + +*** completion-annotate-function is obsolete. + ** `glyphless-char-display' can now distinguish between graphical and text terminal display, via a char-table entry that is a cons cell. @@ -909,8 +926,6 @@ ** buffer-substring-filters is obsoleted by filter-buffer-substring-functions. -** New completion style `substring'. - ** `facemenu-read-color' is now an alias for `read-color'. The command `read-color' now requires a match for a color name or RGB triplet, instead of signalling an error if the user provides a invalid === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-23 17:57:17 +0000 +++ lisp/ChangeLog 2011-05-24 02:45:50 +0000 @@ -1,3 +1,40 @@ +2011-05-24 Stefan Monnier + + Add an :exit-function for completion-at-point. + + * minibuffer.el (completion--done): New fun. + (completion--do-completion): Use it. New arg `expect-exact'. + (minibuffer-complete, minibuffer-complete-word): Don't output message, + since completion--do-completion does it for us now. + (minibuffer-force-complete): Use completion--done and + completion--replace. Handle sole-completion case with more care. + (minibuffer-complete-and-exit): Use new `expect-exact' arg. + (completion-extra-properties): New var. + (completion-annotate-function): Make obsolete. + (minibuffer-completion-help): Adjust accordingly. + Use completion-list-insert-choice-function. + (completion-at-point, completion-help-at-point): + Bind completion-extra-properties. + (completion-pcm-word-delimiters): Add | (for uniquify, for example). + * simple.el (completion-list-insert-choice-function): New var. + (completion-setup-function): Preserve it. + (choose-completion): Pay attention to it, shuffle the code a bit. + (choose-completion-string): New arg `insert-function'. + + * textmodes/bibtex.el: Convert to lexical binding. + (bibtex-mode-map): Use completion-at-point. + (bibtex-mode): Use define-derived-mode&completion-at-point-functions. + (bibtex-completion-at-point-function): New fun, from bibtex-complete. + (bibtex-complete): Define as obsolete alias. + (bibtex-complete-internal): Remove. + (bibtex-format-entry): Remove unused sub-group in regexp. + * shell.el (shell--command-completion-data) + (shell-environment-variable-completion): + * pcomplete.el (pcomplete-completions-at-point): + * comint.el (comint--complete-file-name-data): Use :exit-function + instead of completion-table-with-terminator so it also works for + choose-completion. + 2011-05-23 Stefan Monnier * .el: Don't quote lambda expressions with `quote'. === modified file 'lisp/comint.el' --- lisp/comint.el 2011-04-20 22:31:06 +0000 +++ lisp/comint.el 2011-05-24 02:45:50 +0000 @@ -3134,19 +3134,20 @@ #'comint--table-subvert #'completion-file-name-table (cdr prefixes) (car prefixes))))) - (list - filename-beg filename-end - (lambda (string pred action) - (let ((completion-ignore-case read-file-name-completion-ignore-case) - (completion-ignored-extensions comint-completion-fignore)) - (if (zerop (length filesuffix)) - (complete-with-action action table string pred) - ;; Add a space at the end of completion. Use a terminator-regexp - ;; that never matches since the terminator cannot appear - ;; within the completion field anyway. - (completion-table-with-terminator - (cons filesuffix "\\`a\\`") - table string pred action))))))) + (nconc + (list + filename-beg filename-end + (lambda (string pred action) + (let ((completion-ignore-case read-file-name-completion-ignore-case) + (completion-ignored-extensions comint-completion-fignore)) + (complete-with-action action table string pred)))) + (unless (zerop (length filesuffix)) + (list :exit-function + (lambda (_s finished) + (when (memq finished '(sole finished)) + (if (looking-at (regexp-quote filesuffix)) + (goto-char (match-end 0)) + (insert filesuffix))))))))) (defun comint-dynamic-complete-as-filename () "Dynamically complete at point as a filename. === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2011-05-04 01:19:32 +0000 +++ lisp/minibuffer.el 2011-05-24 02:45:50 +0000 @@ -58,12 +58,9 @@ ;;; Todo: +;; - for M-x, cycle-sort commands that have no key binding first. ;; - Make things like icomplete-mode or lightning-completion work with ;; completion-in-region-mode. -;; - completion-insert-complete-hook (called after inserting a complete -;; completion), typically used for "complete-abbrev" where it would expand -;; the abbrev. Tho we'd probably want to provide it from the -;; completion-table. ;; - extend `boundaries' to provide various other meta-data about the ;; output of `all-completions': ;; - preferred sorting order when displayed in *Completions*. @@ -74,10 +71,6 @@ ;; - indicate how to turn all-completion's output into ;; try-completion's output: e.g. completion-ignored-extensions. ;; maybe that could be merged with the "quote" operation above. -;; - completion hook to run when the completion is -;; selected/inserted (maybe this should be provided some other -;; way, e.g. as text-property, so `try-completion can also return it?) -;; both for when it's inserted via TAB or via choose-completion. ;; - indicate that `all-completions' doesn't do prefix-completion ;; but just returns some list that relates in some other way to ;; the provided string (as is the case in filecache.el), in which @@ -87,18 +80,6 @@ ;; \n into something else, add special boundaries between ;; completions). E.g. when completing from the kill-ring. -;; - make partial-completion-mode obsolete: -;; - (?) style completion for file names. -;; This can't be done identically just by tweaking completion, -;; because partial-completion-mode's behavior is to expand -;; to /usr/include/string.h only when exiting the minibuffer, at which -;; point the completion code is actually not involved normally. -;; Partial-completion-mode does it via a find-file-not-found-function. -;; - special code for C-x C-f <> to visit the file ref'd at point -;; via (require 'foo) or #include "foo". ffap seems like a better -;; place for this feature (supplemented with major-mode-provided -;; functions to find the file ref'd at point). - ;; - case-sensitivity currently confuses two issues: ;; - whether or not a particular completion table should be case-sensitive ;; (i.e. whether strings that differ only by case are semantically @@ -562,7 +543,8 @@ (if completion-show-inline-help (minibuffer-message msg))) -(defun completion--do-completion (&optional try-completion-function) +(defun completion--do-completion (&optional try-completion-function + expect-exact) "Do the completion and return a summary of what happened. M = completion was performed, the text was Modified. C = there were available Completions. @@ -576,7 +558,11 @@ 100 4 ??? impossible 101 5 ??? impossible 110 6 some completion happened - 111 7 completed to an exact completion" + 111 7 completed to an exact completion + +TRY-COMPLETION-FUNCTION is a function to use in place of `try-completion'. +EXPECT-EXACT, if non-nil, means that there is no need to tell the user +when the buffer's text is already an exact match." (let* ((beg (field-beginning)) (end (field-end)) (string (buffer-substring beg end)) @@ -595,7 +581,9 @@ (minibuffer--bitset nil nil nil)) ((eq t comp) (minibuffer-hide-completions) - (goto-char (field-end)) + (goto-char end) + (completion--done string 'finished + (unless expect-exact "Sole completion")) (minibuffer--bitset nil nil t)) ;Exact and unique match. (t ;; `completed' should be t if some completion was done, which doesn't @@ -619,12 +607,12 @@ ;; whether this is a unique completion or not, so try again using ;; the real case (this shouldn't recurse again, because the next ;; time try-completion will return either t or the exact string). - (completion--do-completion try-completion-function) + (completion--do-completion try-completion-function expect-exact) ;; It did find a match. Do we match some possibility exactly now? (let ((exact (test-completion completion - minibuffer-completion-table - minibuffer-completion-predicate)) + minibuffer-completion-table + minibuffer-completion-predicate)) (comps ;; Check to see if we want to do cycling. We do it ;; here, after having performed the normal completion, @@ -658,7 +646,13 @@ ;; We could also decide to refresh the completions, ;; if they're displayed (and assuming there are ;; completions left). - (minibuffer-hide-completions)) + (minibuffer-hide-completions) + (if exact + ;; If completion did not put point at end of field, + ;; it's a sign that completion is not finished. + (completion--done completion + (if (< comp-pos (length completion)) + 'exact 'unknown)))) ;; Show the completion table, if requested. ((not exact) (if (case completion-auto-help @@ -669,8 +663,12 @@ ;; If the last exact completion and this one were the same, it ;; means we've already given a "Complete, but not unique" message ;; and the user's hit TAB again, so now we give him help. - ((eq this-command last-command) - (if completion-auto-help (minibuffer-completion-help)))) + (t + (if (and (eq this-command last-command) completion-auto-help) + (minibuffer-completion-help)) + (completion--done completion 'exact + (unless expect-exact + "Complete, but not unique")))) (minibuffer--bitset completed t exact)))))))) @@ -705,10 +703,6 @@ t) (t (case (completion--do-completion) (#b000 nil) - (#b001 (completion--message "Sole completion") - t) - (#b011 (completion--message "Complete, but not unique") - t) (t t))))) (defun completion--flush-all-sorted-completions (&rest _ignore) @@ -742,10 +736,11 @@ ;; Prefer recently used completions. ;; FIXME: Additional sorting ideas: ;; - for M-x, prefer commands that have no key binding. - (let ((hist (symbol-value minibuffer-history-variable))) - (setq all (sort all (lambda (c1 c2) - (> (length (member c1 hist)) - (length (member c2 hist))))))) + (when (minibufferp) + (let ((hist (symbol-value minibuffer-history-variable))) + (setq all (sort all (lambda (c1 c2) + (> (length (member c1 hist)) + (length (member c2 hist)))))))) ;; Cache the result. This is not just for speed, but also so that ;; repeated calls to minibuffer-force-complete can cycle through ;; all possibilities. @@ -763,14 +758,21 @@ ;; ~/src/emacs/trunk/ and throws away lisp/minibuffer.el. (let* ((start (field-beginning)) (end (field-end)) - (all (completion-all-sorted-completions))) - (if (not (consp all)) + (all (completion-all-sorted-completions)) + (base (+ start (or (cdr (last all)) 0)))) + (cond + ((not (consp all)) (completion--message - (if all "No more completions" "No completions")) + (if all "No more completions" "No completions"))) + ((not (consp (cdr all))) + (let ((mod (equal (car all) (buffer-substring-no-properties base end)))) + (if mod (completion--replace base end (car all))) + (completion--done (buffer-substring-no-properties start (point)) + 'finished (unless mod "Sole completion")))) + (t (setq completion-cycling t) - (goto-char end) - (insert (car all)) - (delete-region (+ start (cdr (last all))) end) + (completion--replace base end (car all)) + (completion--done (buffer-substring-no-properties start (point)) 'sole) ;; If completing file names, (car all) may be a directory, so we'd now ;; have a new set of possible completions and might want to reset ;; completion-all-sorted-completions to nil, but we prefer not to, @@ -778,7 +780,7 @@ ;; through the previous possible completions. (let ((last (last all))) (setcdr last (cons (car all) (cdr last))) - (setq completion-all-sorted-completions (cdr all)))))) + (setq completion-all-sorted-completions (cdr all))))))) (defvar minibuffer-confirm-exit-commands '(minibuffer-complete minibuffer-complete-word PC-complete PC-complete-word) @@ -850,7 +852,7 @@ (t ;; Call do-completion, but ignore errors. (case (condition-case nil - (completion--do-completion) + (completion--do-completion nil 'expect-exact) (error 1)) ((#b001 #b011) (exit-minibuffer)) (#b111 (if (not minibuffer-completion-confirm) @@ -954,10 +956,6 @@ (interactive) (case (completion--do-completion 'completion--try-word-completion) (#b000 nil) - (#b001 (completion--message "Sole completion") - t) - (#b011 (completion--message "Complete, but not unique") - t) (t t))) (defface completions-annotations '((t :inherit italic)) @@ -1157,6 +1155,21 @@ (run-hooks 'completion-setup-hook))) nil) +(defvar completion-extra-properties nil + "Property list of extra properties of the current completion job. +These include: +`:annotation-function': Function to add annotations in the completions buffer. + The function takes a completion and should either return nil, or a string + that will be displayed next to the completion. The function can access the + completion data via `minibuffer-completion-table' and related variables. +`:exit-function': Function to run after completion is performed. + The function takes at least 2 parameters (STRING and STATUS) where STRING + is the text to which the field was completed and STATUS indicates what + kind of operation happened: if text is now complete it's `finished', if text + cannot be further completed but completion is not finished, it's `sole', if + text is a valid completion but may be further completed, it's `exact', and + other STATUSes may be added in the future.") + (defvar completion-annotate-function nil ;; Note: there's a lot of scope as for when to add annotations and @@ -1173,6 +1186,27 @@ will be displayed next to the completion. The function can access the completion table and predicates via `minibuffer-completion-table' and related variables.") +(make-obsolete-variable 'completion-annotate-function + 'completion-extra-properties "24.1") + +(defun completion--done (string &optional finished message) + (let* ((exit-fun (plist-get completion-extra-properties :exit-function)) + (pre-msg (and exit-fun (current-message)))) + (assert (memq finished '(exact sole finished unknown))) + ;; FIXME: exit-fun should receive `finished' as a parameter. + (when exit-fun + (when (eq finished 'unknown) + (setq finished + (if (eq (try-completion string + minibuffer-completion-table + minibuffer-completion-predicate) + t) + 'finished 'exact))) + (funcall exit-fun string finished)) + (when (and message + ;; Don't output any message if the exit-fun already did so. + (equal pre-msg (and exit-fun (current-message)))) + (completion--message message)))) (defun minibuffer-completion-help () "Display a list of possible completions of the current minibuffer contents." @@ -1187,44 +1221,77 @@ minibuffer-completion-predicate (- (point) (field-beginning))))) (message nil) - (if (and completions - (or (consp (cdr completions)) - (not (equal (car completions) string)))) - (let* ((last (last completions)) - (base-size (cdr last)) - ;; If the *Completions* buffer is shown in a new - ;; window, mark it as softly-dedicated, so bury-buffer in - ;; minibuffer-hide-completions will know whether to - ;; delete the window or not. - (display-buffer-mark-dedicated 'soft)) - (with-output-to-temp-buffer "*Completions*" - ;; Remove the base-size tail because `sort' requires a properly - ;; nil-terminated list. - (when last (setcdr last nil)) - (setq completions (sort completions 'string-lessp)) - (when completion-annotate-function - (setq completions - (mapcar (lambda (s) - (let ((ann - (funcall completion-annotate-function s))) - (if ann (list s ann) s))) - completions))) - (with-current-buffer standard-output - (set (make-local-variable 'completion-base-position) - (list (+ start base-size) - ;; FIXME: We should pay attention to completion - ;; boundaries here, but currently - ;; completion-all-completions does not give us the - ;; necessary information. - end))) - (display-completion-list completions))) - - ;; If there are no completions, or if the current input is already the - ;; only possible completion, then hide (previous&stale) completions. - (minibuffer-hide-completions) - (ding) - (minibuffer-message - (if completions "Sole completion" "No completions"))) + (if (or (null completions) + (and (not (consp (cdr completions))) + (equal (car completions) string))) + (progn + ;; If there are no completions, or if the current input is already + ;; the sole completion, then hide (previous&stale) completions. + (minibuffer-hide-completions) + (ding) + (minibuffer-message + (if completions "Sole completion" "No completions"))) + + (let* ((last (last completions)) + (base-size (cdr last)) + (prefix (unless (zerop base-size) (substring string 0 base-size))) + (global-af (or (plist-get completion-extra-properties + :annotation-function) + completion-annotate-function)) + ;; If the *Completions* buffer is shown in a new + ;; window, mark it as softly-dedicated, so bury-buffer in + ;; minibuffer-hide-completions will know whether to + ;; delete the window or not. + (display-buffer-mark-dedicated 'soft)) + (with-output-to-temp-buffer "*Completions*" + ;; Remove the base-size tail because `sort' requires a properly + ;; nil-terminated list. + (when last (setcdr last nil)) + (setq completions (sort completions 'string-lessp)) + (setq completions + (cond + (global-af + (mapcar (lambda (s) + (let ((ann (funcall global-af s))) + (if ann (list s ann) s))) + completions)) + (t completions))) + + (with-current-buffer standard-output + (set (make-local-variable 'completion-base-position) + (list (+ start base-size) + ;; FIXME: We should pay attention to completion + ;; boundaries here, but currently + ;; completion-all-completions does not give us the + ;; necessary information. + end)) + (set (make-local-variable 'completion-list-insert-choice-function) + (let ((ctable minibuffer-completion-table) + (cpred minibuffer-completion-predicate) + (cprops completion-extra-properties)) + (lambda (start end choice) + (unless + (or (zerop (length prefix)) + (equal prefix + (buffer-substring-no-properties + (max (point-min) (- start (length prefix))) + start))) + (message "*Completions* out of date")) + ;; FIXME: Use `md' to do quoting&terminator here. + (completion--replace start end choice) + (let* ((minibuffer-completion-table ctable) + (minibuffer-completion-predicate cpred) + (completion-extra-properties cprops) + (result (concat prefix choice)) + (bounds (completion-boundaries + result ctable cpred ""))) + ;; If the completion introduces a new field, then + ;; completion is not finished. + (completion--done result + (if (eq (car bounds) (length result)) + 'exact 'finished))))))) + + (display-completion-list completions)))) nil)) (defun minibuffer-hide-completions () @@ -1364,9 +1431,9 @@ START and END delimit the entity to complete and should include point, COLLECTION is the completion table to use to complete it, and PROPS is a property list for additional information. -Currently supported properties are: - `:predicate' a predicate that completion candidates need to satisfy. - `:annotation-function' the value to use for `completion-annotate-function'.") +Currently supported properties are all the properties that can appear in +`completion-extra-properties' plus: + `:predicate' a predicate that completion candidates need to satisfy.") (defvar completion--capf-misbehave-funs nil "List of functions found on `completion-at-point-functions' that misbehave.") @@ -1403,9 +1470,7 @@ (pcase res (`(,_ . ,(and (pred functionp) f)) (funcall f)) (`(,hookfun . (,start ,end ,collection . ,plist)) - (let* ((completion-annotate-function - (or (plist-get plist :annotation-function) - completion-annotate-function)) + (let* ((completion-extra-properties plist) (completion-in-region-mode-predicate (lambda () ;; We're still in the same completion field. @@ -1428,9 +1493,7 @@ (`(,hookfun . (,start ,end ,collection . ,plist)) (let* ((minibuffer-completion-table collection) (minibuffer-completion-predicate (plist-get plist :predicate)) - (completion-annotate-function - (or (plist-get plist :annotation-function) - completion-annotate-function)) + (completion-extra-properties plist) (completion-in-region-mode-predicate (lambda () ;; We're still in the same completion field. @@ -2029,7 +2092,7 @@ (defun completion-pcm--prepare-delim-re (delims) (setq completion-pcm--delim-wild-regex (concat "[" delims "*]"))) -(defcustom completion-pcm-word-delimiters "-_./: " +(defcustom completion-pcm-word-delimiters "-_./:| " "A string of characters treated as word delimiters for completion. Some arcane rules: If `]' is in this string, it must come first. === modified file 'lisp/pcomplete.el' --- lisp/pcomplete.el 2011-04-29 17:33:30 +0000 +++ lisp/pcomplete.el 2011-05-24 02:45:50 +0000 @@ -527,19 +527,19 @@ (funcall pcomplete-norm-func (directory-file-name f)) pcomplete-seen))))))) - (unless (zerop (length pcomplete-termination-string)) - ;; Add a space at the end of completion. Use a terminator-regexp - ;; that never matches since the terminator cannot appear - ;; within the completion field anyway. - (setq table - (apply-partially #'completion-table-with-terminator - (cons pcomplete-termination-string - "\\`a\\`") - table))) (when pcomplete-ignore-case (setq table (apply-partially #'completion-table-case-fold table))) - (list beg (point) table :predicate pred)))))) + (list beg (point) table + :predicate pred + :exit-function + (unless (zerop (length pcomplete-termination-string)) + (lambda (_s finished) + (when (memq finished '(sole finished)) + (if (looking-at + (regexp-quote pcomplete-termination-string)) + (goto-char (match-end 0)) + (insert pcomplete-termination-string))))))))))) ;; I don't think such commands are usable before first setting up buffer-local ;; variables to parse args, so there's no point autoloading it. === modified file 'lisp/shell.el' --- lisp/shell.el 2011-05-17 02:38:04 +0000 +++ lisp/shell.el 2011-05-24 02:45:50 +0000 @@ -1074,12 +1074,15 @@ (list start end (lambda (string pred action) - (completion-table-with-terminator - " " (lambda (string pred action) - (if (string-match "/" string) - (completion-file-name-table string pred action) - (complete-with-action action completions string pred))) - string pred action))))) + (if (string-match "/" string) + (completion-file-name-table string pred action) + (complete-with-action action completions string pred))) + :exit-function + (lambda (_string finished) + (when (memq finished '(sole finished)) + (if (looking-at " ") + (goto-char (match-end 0)) + (insert " "))))))) ;; (defun shell-dynamic-complete-as-command () ;; "Dynamically complete at point as a command. @@ -1150,18 +1153,17 @@ (substring x 0 (string-match "=" x))) process-environment)) (suffix (case (char-before start) (?\{ "}") (?\( ")") (t "")))) - (list - start end - (apply-partially - #'completion-table-with-terminator - (cons (lambda (comp) - (concat comp - suffix - (if (file-directory-p - (comint-directory (getenv comp))) - "/"))) - "\\`a\\`") - variables)))))) + (list start end variables + :exit-function + (lambda (s finished) + (when (memq finished '(sole finished)) + (let ((suf (concat suffix + (if (file-directory-p + (comint-directory (getenv s))) + "/")))) + (if (looking-at (regexp-quote suf)) + (goto-char (match-end 0)) + (insert suf)))))))))) (defun shell-c-a-p-replace-by-expanded-directory () === modified file 'lisp/simple.el' --- lisp/simple.el 2011-05-12 12:55:10 +0000 +++ lisp/simple.el 2011-05-24 02:45:50 +0000 @@ -5968,6 +5968,12 @@ where the completion should be inserted and END (if non-nil) is the end of the text to replace. If END is nil, point is used instead.") +(defvar completion-list-insert-choice-function #'completion--replace + "Function to use to insert the text chosen in *Completions*. +Called with 3 arguments (BEG END TEXT), it should replace the text +between BEG and END with TEXT. Expected to be set buffer-locally +in the *Completions* buffer.") + (defvar completion-base-size nil "Number of chars before point not involved in completion. This is a local variable in the completion list buffer. @@ -6031,26 +6037,30 @@ ;; In case this is run via the mouse, give temporary modes such as ;; isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) - (let (buffer base-size base-position choice) - (with-current-buffer (window-buffer (posn-window (event-start event))) - (setq buffer completion-reference-buffer) - (setq base-size completion-base-size) - (setq base-position completion-base-position) - (save-excursion - (goto-char (posn-point (event-start event))) - (let (beg end) - (if (and (not (eobp)) (get-text-property (point) 'mouse-face)) - (setq end (point) beg (1+ (point)))) - (if (and (not (bobp)) (get-text-property (1- (point)) 'mouse-face)) - (setq end (1- (point)) beg (point))) - (if (null beg) - (error "No completion here")) - (setq beg (previous-single-property-change beg 'mouse-face)) - (setq end (or (next-single-property-change end 'mouse-face) - (point-max))) - (setq choice (buffer-substring-no-properties beg end))))) + (with-current-buffer (window-buffer (posn-window (event-start event))) + (let ((buffer completion-reference-buffer) + (base-size completion-base-size) + (base-position completion-base-position) + (insert-function completion-list-insert-choice-function) + (choice + (save-excursion + (goto-char (posn-point (event-start event))) + (let (beg end) + (cond + ((and (not (eobp)) (get-text-property (point) 'mouse-face)) + (setq end (point) beg (1+ (point)))) + ((and (not (bobp)) + (get-text-property (1- (point)) 'mouse-face)) + (setq end (1- (point)) beg (point))) + (t (error "No completion here"))) + (setq beg (previous-single-property-change beg 'mouse-face)) + (setq end (or (next-single-property-change end 'mouse-face) + (point-max))) + (buffer-substring-no-properties beg end)))) + (owindow (selected-window))) - (let ((owindow (selected-window))) + (unless (buffer-live-p buffer) + (error "Destination buffer is dead")) (select-window (posn-window (event-start event))) (if (and (one-window-p t 'selected-frame) (window-dedicated-p (selected-window))) @@ -6059,20 +6069,20 @@ (or (window-dedicated-p (selected-window)) (bury-buffer))) (select-window - (or (and (buffer-live-p buffer) - (get-buffer-window buffer 0)) - owindow))) + (or (get-buffer-window buffer 0) + owindow)) - (choose-completion-string - choice buffer - (or base-position - (when base-size - ;; Someone's using old completion code that doesn't know - ;; about base-position yet. - (list (+ base-size (with-current-buffer buffer (field-beginning))))) - ;; If all else fails, just guess. - (with-current-buffer buffer - (list (choose-completion-guess-base-position choice))))))) + (with-current-buffer buffer + (choose-completion-string + choice buffer + (or base-position + (when base-size + ;; Someone's using old completion code that doesn't know + ;; about base-position yet. + (list (+ base-size (field-beginning)))) + ;; If all else fails, just guess. + (list (choose-completion-guess-base-position choice))) + insert-function))))) ;; Delete the longest partial match for STRING ;; that can be found before POINT. @@ -6118,7 +6128,8 @@ If all functions in the list return nil, that means to use the default method of inserting the completion in BUFFER.") -(defun choose-completion-string (choice &optional buffer base-position) +(defun choose-completion-string (choice &optional + buffer base-position insert-function) "Switch to BUFFER and insert the completion choice CHOICE. BASE-POSITION, says where to insert the completion." @@ -6138,8 +6149,8 @@ ;; If BUFFER is a minibuffer, barf unless it's the currently ;; active minibuffer. (if (and mini-p - (or (not (active-minibuffer-window)) - (not (equal buffer + (not (and (active-minibuffer-window) + (equal buffer (window-buffer (active-minibuffer-window)))))) (error "Minibuffer is not active for completion") ;; Set buffer so buffer-local choose-completion-string-functions works. @@ -6151,13 +6162,15 @@ ;; and indeed unused. The last used to be `base-size', so we ;; keep it to try and avoid breaking old code. choice buffer base-position nil) + ;; This remove-text-properties should be unnecessary since `choice' + ;; comes from buffer-substring-no-properties. + ;;(remove-text-properties 0 (lenth choice) '(mouse-face nil) choice) ;; Insert the completion into the buffer where it was requested. - (delete-region (or (car base-position) (point)) - (or (cadr base-position) (point))) - (insert choice) - (remove-text-properties (- (point) (length choice)) (point) - '(mouse-face nil)) - ;; Update point in the window that BUFFER is showing in. + (funcall (or insert-function completion-list-insert-choice-function) + (or (car base-position) (point)) + (or (cadr base-position) (point)) + choice) + ;; Update point in the window that BUFFER is showing in. (let ((window (get-buffer-window buffer t))) (set-window-point window (point))) ;; If completing for the minibuffer, exit it with this choice. @@ -6223,10 +6236,13 @@ 0 (or completion-base-size 0))))))) (with-current-buffer standard-output (let ((base-size completion-base-size) ;Read before killing localvars. - (base-position completion-base-position)) + (base-position completion-base-position) + (insert-fun completion-list-insert-choice-function)) (completion-list-mode) (set (make-local-variable 'completion-base-size) base-size) - (set (make-local-variable 'completion-base-position) base-position)) + (set (make-local-variable 'completion-base-position) base-position) + (set (make-local-variable 'completion-list-insert-choice-function) + insert-fun)) (set (make-local-variable 'completion-reference-buffer) mainbuf) (if base-dir (setq default-directory base-dir)) ;; Maybe insert help string. === modified file 'lisp/textmodes/bibtex.el' --- lisp/textmodes/bibtex.el 2011-05-03 14:03:48 +0000 +++ lisp/textmodes/bibtex.el 2011-05-24 02:45:50 +0000 @@ -1,4 +1,4 @@ -;;; bibtex.el --- BibTeX mode for GNU Emacs +;;; bibtex.el --- BibTeX mode for GNU Emacs -*- lexical-binding: t -*- ;; Copyright (C) 1992, 1994-1999, 2001-2011 Free Software Foundation, Inc. @@ -204,7 +204,7 @@ (const entry-class) (const t))) (put 'bibtex-maintain-sorted-entries 'safe-local-variable - '(lambda (a) (memq a '(nil t plain crossref entry-class)))) + (lambda (a) (memq a '(nil t plain crossref entry-class)))) (defcustom bibtex-sort-entry-class '(("String") @@ -968,7 +968,7 @@ (modify-syntax-entry ?\" "\"" st) (modify-syntax-entry ?$ "$$ " st) (modify-syntax-entry ?% "< " st) - (modify-syntax-entry ?' "w " st) + (modify-syntax-entry ?' "w " st) ;FIXME: Not allowed in @string keys. (modify-syntax-entry ?@ "w " st) (modify-syntax-entry ?\\ "\\" st) (modify-syntax-entry ?\f "> " st) @@ -984,7 +984,7 @@ ;; The Key `C-c&' is reserved for reftex.el (define-key km "\t" 'bibtex-find-text) (define-key km "\n" 'bibtex-next-field) - (define-key km "\M-\t" 'bibtex-complete) + (define-key km "\M-\t" 'completion-at-point) (define-key km "\C-c\"" 'bibtex-remove-delimiters) (define-key km "\C-c{" 'bibtex-remove-delimiters) (define-key km "\C-c}" 'bibtex-remove-delimiters) @@ -2018,7 +2018,7 @@ ;; remove delimiters from purely numerical fields (when (and (memq 'numerical-fields format) (progn (goto-char beg-text) - (looking-at "\\(\"[0-9]+\"\\)\\|\\({[0-9]+}\\)"))) + (looking-at "\"[0-9]+\"\\|{[0-9]+}"))) (goto-char end-text) (delete-char -1) (goto-char beg-text) @@ -2247,10 +2247,11 @@ (content (bibtex-text-in-field field bibtex-autokey-use-crossref)) case-fold-search) (unless content (setq content "")) - (dolist (pattern change-list content) + (dolist (pattern change-list) (setq content (replace-regexp-in-string (car pattern) (cdr pattern) - content t))))) + content t))) + content)) (defun bibtex-autokey-get-names () "Get contents of the name field of the current entry. @@ -2521,7 +2522,7 @@ (bibtex-sort-ignore-string-entries t) bounds) (bibtex-map-entries - (lambda (key beg end) + (lambda (key _beg end) (if (and abortable (input-pending-p)) ;; user has aborted by typing a key: return `aborted' @@ -2714,20 +2715,6 @@ (message "No BibTeX buffers defined"))) buffer-list)) -(defun bibtex-complete-internal (completions) - "Complete word fragment before point to longest prefix of COMPLETIONS. -COMPLETIONS is an alist of strings. If point is not after the part -of a word, all strings are listed. Return completion." - ;; Return value is used by cleanup functions. - ;; Code inspired by `lisp-complete-symbol'. - (let ((beg (save-excursion - (re-search-backward "[ \t{\"]") - (forward-char) - (point))) - (end (point))) - (when (completion-in-region beg end completions) - (buffer-substring beg (point))))) - (defun bibtex-complete-string-cleanup (str compl) "Cleanup after inserting string STR. Remove enclosing field delimiters for STR. Display message with @@ -2941,7 +2928,7 @@ ;; Interactive Functions: ;;;###autoload -(defun bibtex-mode () +(define-derived-mode bibtex-mode nil "BibTeX" "Major mode for editing BibTeX files. General information on working with BibTeX mode: @@ -2953,7 +2940,7 @@ Some features of BibTeX mode are available only by setting the variable `bibtex-maintain-sorted-entries' to non-nil. However, then BibTeX mode -works only with buffers containing valid (syntactical correct) and sorted +works only with buffers containing valid (syntactically correct) and sorted entries. This is usually the case, if you have created a buffer completely with BibTeX mode and finished every new entry with \\[bibtex-clean-entry]. @@ -2975,7 +2962,7 @@ \\[bibtex-remove-delimiters] removes the double-quotes or braces around the text of the current field. \\[bibtex-empty-field] replaces the text of the current field with the default \"\" or {}. \\[bibtex-find-text] moves point to the end of the current field. -\\[bibtex-complete] completes word fragment before point according to context. +\\[completion-at-point] completes word fragment before point according to context. The command \\[bibtex-clean-entry] cleans the current entry, i.e. it removes OPT/ALT from the names of all non-empty optional or alternative fields, checks that @@ -2993,12 +2980,8 @@ if that value is non-nil. \\{bibtex-mode-map}" - (interactive) - (kill-all-local-variables) - (use-local-map bibtex-mode-map) - (setq major-mode 'bibtex-mode) - (setq mode-name "BibTeX") - (set-syntax-table bibtex-mode-syntax-table) + (add-hook 'completion-at-point-functions + 'bibtex-completion-at-point-function nil 'local) (make-local-variable 'bibtex-buffer-last-parsed-tick) ;; Install stealthy parse function if not already installed (unless bibtex-parse-idle-timer @@ -3013,9 +2996,8 @@ (set (make-local-variable 'defun-prompt-regexp) "^[ \t]*@[[:alnum:]]+[ \t]*") (set (make-local-variable 'outline-regexp) "[ \t]*@") (set (make-local-variable 'fill-paragraph-function) 'bibtex-fill-field) - (set (make-local-variable 'fill-prefix) (make-string (+ bibtex-entry-offset - bibtex-contline-indentation) - ?\s)) + (set (make-local-variable 'fill-prefix) + (make-string (+ bibtex-entry-offset bibtex-contline-indentation) ?\s)) (set (make-local-variable 'font-lock-defaults) '(bibtex-font-lock-keywords nil t ((?$ . "\"") @@ -3037,11 +3019,9 @@ (setq imenu-generic-expression (list (list nil bibtex-entry-head bibtex-key-in-head)) imenu-case-fold-search t) - (make-local-variable 'choose-completion-string-functions) ;; XEmacs needs `easy-menu-add', Emacs does not care (easy-menu-add bibtex-edit-menu) - (easy-menu-add bibtex-entry-menu) - (run-mode-hooks 'bibtex-mode-hook)) + (easy-menu-add bibtex-entry-menu)) (defun bibtex-field-list (entry-type) "Return list of allowed fields for entry ENTRY-TYPE. @@ -3383,7 +3363,7 @@ (bibtex-sort-ignore-string-entries (not count-string-entries))) (save-restriction (if mark-active (narrow-to-region (region-beginning) (region-end))) - (bibtex-map-entries (lambda (key beg end) (setq number (1+ number))))) + (bibtex-map-entries (lambda (_key _beg _end) (setq number (1+ number))))) (message "%s contains %d entries." (if mark-active "Region" "Buffer") number))) @@ -3438,12 +3418,13 @@ (unless (local-variable-p 'bibtex-sort-entry-class-alist) (set (make-local-variable 'bibtex-sort-entry-class-alist) (let ((i -1) alist) - (dolist (class bibtex-sort-entry-class alist) + (dolist (class bibtex-sort-entry-class) (setq i (1+ i)) (dolist (entry class) ;; All entry types should be downcase (for ease of comparison). (push (cons (if (stringp entry) (downcase entry) entry) i) - alist))))))) + alist))) + alist)))) (defun bibtex-lessp (index1 index2) "Predicate for sorting BibTeX entries with indices INDEX1 and INDEX2. @@ -3735,7 +3716,7 @@ (let (previous current key-list) (bibtex-progress-message "Checking for duplicate keys") (bibtex-map-entries - (lambda (key beg end) + (lambda (key _beg _end) (bibtex-progress-message) (setq current (bibtex-entry-index)) (cond ((not previous)) @@ -3773,7 +3754,7 @@ "Checking required fields and month fields") (let ((bibtex-sort-ignore-string-entries t)) (bibtex-map-entries - (lambda (key beg end) + (lambda (_key beg _end) (bibtex-progress-message) (let* ((entry-list (assoc-string (bibtex-type-in-head) bibtex-entry-field-alist t)) @@ -4440,7 +4421,7 @@ (if (memq 'realign bibtex-entry-format) (bibtex-realign)) (bibtex-progress-message "Formatting" 1) - (bibtex-map-entries (lambda (key beg end) + (bibtex-map-entries (lambda (_key _beg _end) (bibtex-progress-message) (bibtex-clean-entry reformat-reference-keys t))) (bibtex-progress-message 'done)) @@ -4473,17 +4454,15 @@ (goto-char (point-max)) (message "Buffer is now parsable. Please save it."))) -(defun bibtex-complete () - "Complete word fragment before point according to context. -If point is inside key or crossref field perform key completion based on -`bibtex-reference-keys'. Inside a month field perform key completion -based on `bibtex-predefined-month-strings'. Inside any other field -\(including a String or Preamble definition) perform string completion -based on `bibtex-strings'. -An error is signaled if point is outside key or BibTeX field." - (interactive) +(define-obsolete-function-alias 'bibtex-complete 'completion-at-point "24.1") +(defun bibtex-completion-at-point-function () (let ((pnt (point)) (case-fold-search t) + (beg (save-excursion + (re-search-backward "[ \t{\"]") + (forward-char) + (point))) + (end (point)) bounds name compl) (save-excursion (if (and (setq bounds (bibtex-enclosing-field nil t)) @@ -4524,49 +4503,56 @@ (setq compl 'key))))) (cond ((eq compl 'key) - ;; key completion: no cleanup needed - (setq choose-completion-string-functions nil) - (let (completion-ignore-case) - (bibtex-complete-internal (bibtex-global-key-alist)))) + ;; Key completion: no cleanup needed. + (list beg end + (lambda (s p a) + (let (completion-ignore-case) + (complete-with-action a (bibtex-global-key-alist) s p))))) ((eq compl 'crossref-key) - ;; crossref key completion - ;; - ;; If we quit the *Completions* buffer without requesting - ;; a completion, `choose-completion-string-functions' is still - ;; non-nil. Therefore, `choose-completion-string-functions' is - ;; always set (either to non-nil or nil) when a new completion - ;; is requested. - (let (completion-ignore-case) - (setq choose-completion-string-functions - (lambda (choice buffer base-position &rest ignored) - (setq choose-completion-string-functions nil) - (choose-completion-string choice buffer base-position) - (bibtex-complete-crossref-cleanup choice) - t)) ; needed by choose-completion-string-functions - (bibtex-complete-crossref-cleanup - (bibtex-complete-internal (bibtex-global-key-alist))))) + ;; Crossref key completion. + (let* ((buf (current-buffer))) + (list beg end + (lambda (s p a) + (cond + ((eq a 'metadata) `(metadata (category . bibtex-key))) + (t (let ((completion-ignore-case nil)) + (complete-with-action + a (bibtex-global-key-alist) s p))))) + :exit-function + (lambda (string status) + (when (memq status '(exact sole finished)) + (let ((summary + (with-current-buffer buf + (save-excursion + (if (bibtex-search-entry string) + (funcall bibtex-summary-function)))))) + (when summary + (message "%s %s" string summary)))))))) ((eq compl 'string) - ;; string key completion: no cleanup needed - (setq choose-completion-string-functions nil) - (let ((completion-ignore-case t)) - (bibtex-complete-internal bibtex-strings))) + ;; String key completion: no cleanup needed. + (list beg end + (lambda (s p a) + (let ((completion-ignore-case t)) + (complete-with-action a bibtex-strings s p))))) (compl - ;; string completion - (let ((completion-ignore-case t)) - (setq choose-completion-string-functions - `(lambda (choice buffer base-position &rest ignored) - (setq choose-completion-string-functions nil) - (choose-completion-string choice buffer base-position) - (bibtex-complete-string-cleanup choice ',compl) - t)) ; needed by `choose-completion-string-functions' - (bibtex-complete-string-cleanup (bibtex-complete-internal compl) - compl))) - - (t (setq choose-completion-string-functions nil) - (error "Point outside key or BibTeX field"))))) + ;; String completion. + (list beg end + (lambda (s p a) + (cond + ((eq a 'metadata) `(metadata (category . bibtex-string))) + (t (let ((completion-ignore-case t)) + (complete-with-action a compl s p))))) + :exit-function + (lambda (string status) + (when (memq status '(exact finished sole)) + (let ((abbr (cdr (assoc-string string compl t)))) + (when abbr + (message "%s = abbreviation for `%s'" string abbr)))) + (when (eq status 'finished) + (save-excursion (bibtex-remove-delimiters))))))))) (defun bibtex-Article () "Insert a new BibTeX @Article entry; see also `bibtex-entry'." @@ -4772,5 +4758,4 @@ ;; Make BibTeX a Feature (provide 'bibtex) - ;;; bibtex.el ends here ------------------------------------------------------------ revno: 104333 committer: Paul Eggert branch nick: trunk timestamp: Mon 2011-05-23 14:53:22 -0700 message: * lib/verify.h: Merge from gnulib. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-22 21:02:48 +0000 +++ ChangeLog 2011-05-23 21:53:22 +0000 @@ -1,3 +1,7 @@ +2011-05-23 Paul Eggert + + * lib/verify.h: Merge from gnulib. + 2011-05-22 Paul Eggert * lib/intprops.h, lib/stdint.in.h, m4/mktime.m4, m4/readlink.m4: === modified file 'lib/verify.h' --- lib/verify.h 2011-05-06 06:03:30 +0000 +++ lib/verify.h 2011-05-23 21:53:22 +0000 @@ -204,7 +204,9 @@ # if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert # define static_assert _Static_assert /* Draft C1X requires this #define. */ # endif -# else +# endif + +# ifdef _GL_VERIFY_H /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike ------------------------------------------------------------ revno: 104332 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-05-23 14:57:17 -0300 message: Don't quote lambda expressions with `quote'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-23 17:03:03 +0000 +++ lisp/ChangeLog 2011-05-23 17:57:17 +0000 @@ -1,5 +1,7 @@ 2011-05-23 Stefan Monnier + * .el: Don't quote lambda expressions with `quote'. + * vc/smerge-mode.el (smerge-refine-subst): Don't deactivate the mark (bug#8710). === modified file 'lisp/allout-widgets.el' --- lisp/allout-widgets.el 2011-05-05 06:53:29 +0000 +++ lisp/allout-widgets.el 2011-05-23 17:57:17 +0000 @@ -302,7 +302,7 @@ enhancements, directly.") ;;;###autoload (put 'allout-widgets-mode-inhibit 'safe-local-variable - (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) + (if (fboundp 'booleanp) 'booleanp (lambda (x) (member x '(t nil))))) (make-variable-buffer-local 'allout-widgets-mode-inhibit) ;;;_ = allout-inhibit-body-modification-hook (defvar allout-inhibit-body-modification-hook nil === modified file 'lisp/allout.el' --- lisp/allout.el 2011-05-23 15:03:04 +0000 +++ lisp/allout.el 2011-05-23 17:57:17 +0000 @@ -416,7 +416,7 @@ (make-variable-buffer-local 'allout-use-hanging-indents) ;;;###autoload (put 'allout-use-hanging-indents 'safe-local-variable - (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) + (if (fboundp 'booleanp) 'booleanp (lambda (x) (member x '(t nil))))) ;;;_ = allout-reindent-bodies (defcustom allout-reindent-bodies (if allout-use-hanging-indents 'text) @@ -435,7 +435,7 @@ (make-variable-buffer-local 'allout-reindent-bodies) ;;;###autoload (put 'allout-reindent-bodies 'safe-local-variable - '(lambda (x) (memq x '(nil t text force)))) + (lambda (x) (memq x '(nil t text force)))) ;;;_ = allout-show-bodies (defcustom allout-show-bodies nil @@ -446,7 +446,7 @@ (make-variable-buffer-local 'allout-show-bodies) ;;;###autoload (put 'allout-show-bodies 'safe-local-variable - (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) + (if (fboundp 'booleanp) 'booleanp (lambda (x) (member x '(t nil))))) ;;;_ = allout-beginning-of-line-cycles (defcustom allout-beginning-of-line-cycles t @@ -638,7 +638,7 @@ :group 'allout) ;;;###autoload (put 'allout-use-mode-specific-leader 'safe-local-variable - '(lambda (x) (or (memq x '(t nil allout-mode-leaders comment-start)) + (lambda (x) (or (memq x '(t nil allout-mode-leaders comment-start)) (stringp x)))) ;;;_ = allout-mode-leaders (defvar allout-mode-leaders '() @@ -668,7 +668,7 @@ (make-variable-buffer-local 'allout-old-style-prefixes) ;;;###autoload (put 'allout-old-style-prefixes 'safe-local-variable - (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) + (if (fboundp 'booleanp) 'booleanp (lambda (x) (member x '(t nil))))) ;;;_ = allout-stylish-prefixes -- alternating bullets (defcustom allout-stylish-prefixes t "Do fancy stuff with topic prefix bullets according to level, etc. @@ -717,7 +717,7 @@ (make-variable-buffer-local 'allout-stylish-prefixes) ;;;###autoload (put 'allout-stylish-prefixes 'safe-local-variable - (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) + (if (fboundp 'booleanp) 'booleanp (lambda (x) (member x '(t nil))))) ;;;_ = allout-numbered-bullet (defcustom allout-numbered-bullet "#" @@ -734,7 +734,7 @@ (put 'allout-numbered-bullet 'safe-local-variable (if (fboundp 'string-or-null-p) 'string-or-null-p - '(lambda (x) (or (stringp x) (null x))))) + (lambda (x) (or (stringp x) (null x))))) ;;;_ = allout-file-xref-bullet (defcustom allout-file-xref-bullet "@" "Bullet signifying file cross-references, for `allout-resolve-xref'. @@ -746,7 +746,7 @@ (put 'allout-file-xref-bullet 'safe-local-variable (if (fboundp 'string-or-null-p) 'string-or-null-p - '(lambda (x) (or (stringp x) (null x))))) + (lambda (x) (or (stringp x) (null x))))) ;;;_ = allout-presentation-padding (defcustom allout-presentation-padding 2 "Presentation-format white-space padding factor, for greater indent." @@ -941,7 +941,7 @@ (make-variable-buffer-local 'allout-layout) ;;;###autoload (put 'allout-layout 'safe-local-variable - '(lambda (x) (or (numberp x) (listp x) (memq x '(: * + -))))) + (lambda (x) (or (numberp x) (listp x) (memq x '(: * + -))))) ;;;_ : Topic header format ;;;_ = allout-regexp === modified file 'lisp/calc/calc-alg.el' --- lisp/calc/calc-alg.el 2011-01-25 04:08:28 +0000 +++ lisp/calc/calc-alg.el 2011-05-23 17:57:17 +0000 @@ -415,17 +415,14 @@ (defmacro math-defsimplify (funcs &rest code) - (append '(progn) - (mapcar (function - (lambda (func) - (list 'put (list 'quote func) ''math-simplify - (list 'nconc - (list 'get (list 'quote func) ''math-simplify) - (list 'list - (list 'function - (append '(lambda (math-simplify-expr)) - code))))))) - (if (symbolp funcs) (list funcs) funcs)))) + (cons 'progn + (mapcar #'(lambda (func) + `(put ',func 'math-simplify + (nconc + (get ',func 'math-simplify) + (list + #'(lambda (math-simplify-expr) ,@code))))) + (if (symbolp funcs) (list funcs) funcs)))) (put 'math-defsimplify 'lisp-indent-hook 1) ;; The function created by math-defsimplify uses the variable === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2011-03-17 02:25:36 +0000 +++ lisp/calc/calc-ext.el 2011-05-23 17:57:17 +0000 @@ -2872,33 +2872,25 @@ (defmacro math-defintegral (funcs &rest code) (setq math-integral-cache nil) - (append '(progn) - (mapcar (function - (lambda (func) - (list 'put (list 'quote func) ''math-integral - (list 'nconc - (list 'get (list 'quote func) ''math-integral) - (list 'list - (list 'function - (append '(lambda (u)) - code))))))) - (if (symbolp funcs) (list funcs) funcs)))) + (cons 'progn + (mapcar #'(lambda (func) + `(put ',func 'math-integral + (nconc + (get ',func 'math-integral) + (list + #'(lambda (u) ,@code))))) + (if (symbolp funcs) (list funcs) funcs)))) (put 'math-defintegral 'lisp-indent-hook 1) (defmacro math-defintegral-2 (funcs &rest code) (setq math-integral-cache nil) - (append '(progn) - (mapcar (function - (lambda (func) - (list 'put (list 'quote func) ''math-integral-2 - (list 'nconc - (list 'get (list 'quote func) - ''math-integral-2) - (list 'list - (list 'function - (append '(lambda (u v)) - code))))))) - (if (symbolp funcs) (list funcs) funcs)))) + (cons 'progn + (mapcar #'(lambda (func) + `(put ',func 'math-integral-2 + `(nconc + (get ',func 'math-integral-2) + (list #'(lambda (u v) ,@code))))) + (if (symbolp funcs) (list funcs) funcs)))) (put 'math-defintegral-2 'lisp-indent-hook 1) (defvar var-IntegAfterRules 'calc-IntegAfterRules) === modified file 'lisp/calculator.el' --- lisp/calculator.el 2011-01-25 04:08:28 +0000 +++ lisp/calculator.el 2011-05-23 17:57:17 +0000 @@ -198,11 +198,11 @@ (setq calculator-user-registers '((?g . 1.61803398875))) before you load calculator." :type '(repeat (cons character number)) - :set '(lambda (_ val) - (and (boundp 'calculator-registers) - (setq calculator-registers - (append val calculator-registers))) - (setq calculator-user-registers val)) + :set (lambda (_ val) + (and (boundp 'calculator-registers) + (setq calculator-registers + (append val calculator-registers))) + (setq calculator-user-registers val)) :group 'calculator) (defcustom calculator-user-operators nil @@ -482,7 +482,7 @@ ["Electric mode" (progn (calculator-quit) (setq calculator-restart-other-mode t) - (run-with-timer 0.1 nil '(lambda () (message nil))) + (run-with-timer 0.1 nil (lambda () (message nil))) ;; the message from the menu will be visible, ;; couldn't make it go away... (calculator)) @@ -706,7 +706,7 @@ (Electric-command-loop 'calculator-done ;; can't use 'noprompt, bug in electric.el - '(lambda () 'noprompt) + (lambda () 'noprompt) nil (lambda (x y) (calculator-update-display)))) (and calculator-buffer === modified file 'lisp/dos-w32.el' --- lisp/dos-w32.el 2011-04-19 13:44:55 +0000 +++ lisp/dos-w32.el 2011-05-23 17:57:17 +0000 @@ -228,10 +228,10 @@ ;; directory separators changed to directory-sep-char. (let ((name nil)) (setq name (mapconcat - '(lambda (char) - (if (and (<= ?A char) (<= char ?Z)) - (char-to-string (+ (- char ?A) ?a)) - (char-to-string char))) + (lambda (char) + (if (and (<= ?A char) (<= char ?Z)) + (char-to-string (+ (- char ?A) ?a)) + (char-to-string char))) filename nil)) ;; Use expand-file-name to canonicalize directory separators, except ;; with bare drive letters (which would have the cwd appended). === modified file 'lisp/emacs-lisp/byte-run.el' --- lisp/emacs-lisp/byte-run.el 2011-02-26 15:19:08 +0000 +++ lisp/emacs-lisp/byte-run.el 2011-05-23 17:57:17 +0000 @@ -72,7 +72,7 @@ ;; "Cause the named functions to be open-coded when called from compiled code. ;; They will only be compiled open-coded when byte-compile-optimize is true." ;; (cons 'eval-and-compile -;; (mapcar '(lambda (x) +;; (mapcar (lambda (x) ;; (or (memq (get x 'byte-optimizer) ;; '(nil byte-compile-inline-expand)) ;; (error @@ -85,7 +85,7 @@ ;; (defmacro proclaim-notinline (&rest fns) ;; "Cause the named functions to no longer be open-coded." ;; (cons 'eval-and-compile -;; (mapcar '(lambda (x) +;; (mapcar (lambda (x) ;; (if (eq (get x 'byte-optimizer) 'byte-compile-inline-expand) ;; (put x 'byte-optimizer nil)) ;; (list 'if (list 'eq (list 'get (list 'quote x) ''byte-optimizer) === modified file 'lisp/emacs-lisp/chart.el' --- lisp/emacs-lisp/chart.el 2011-01-26 08:36:39 +0000 +++ lisp/emacs-lisp/chart.el 2011-05-23 17:57:17 +0000 @@ -639,7 +639,7 @@ extlst "File Extensions" cntlst "# of occurrences" 10 - '(lambda (a b) (> (cdr a) (cdr b)))) + (lambda (a b) (> (cdr a) (cdr b)))) )) (defun chart-space-usage (d) @@ -669,7 +669,7 @@ nmlst "File Name" cntlst "File Size" 10 - '(lambda (a b) (> (cdr a) (cdr b)))) + (lambda (a b) (> (cdr a) (cdr b)))) )) (defun chart-emacs-storage () @@ -737,7 +737,7 @@ nmlst "User Names" cntlst "# of occurrences" 10 - '(lambda (a b) (> (cdr a) (cdr b)))) + (lambda (a b) (> (cdr a) (cdr b)))) )) === modified file 'lisp/emacs-lisp/checkdoc.el' --- lisp/emacs-lisp/checkdoc.el 2011-05-20 18:20:12 +0000 +++ lisp/emacs-lisp/checkdoc.el 2011-05-23 17:57:17 +0000 @@ -38,8 +38,7 @@ ;; or [menu-bar emacs-lisp eval-buffer]. Additional key-bindings ;; are also provided under C-c ? KEY ;; (require 'checkdoc) -;; (add-hook 'emacs-lisp-mode-hook -;; '(lambda () (checkdoc-minor-mode 1))) +;; (add-hook 'emacs-lisp-mode-hook 'checkdoc-minor-mode) ;; ;; Using `checkdoc': ;; === modified file 'lisp/emacs-lisp/disass.el' --- lisp/emacs-lisp/disass.el 2011-04-01 15:16:50 +0000 +++ lisp/emacs-lisp/disass.el 2011-05-23 17:57:17 +0000 @@ -251,10 +251,10 @@ ((eq (car-safe (car-safe arg)) 'byte-code) (insert "(...)\n") (mapc ;recurse on list of byte-code objects - '(lambda (obj) - (disassemble-1 - obj - (+ indent disassemble-recursive-indent))) + (lambda (obj) + (disassemble-1 + obj + (+ indent disassemble-recursive-indent))) arg)) (t ;; really just a constant === modified file 'lisp/emacs-lisp/tcover-unsafep.el' --- lisp/emacs-lisp/tcover-unsafep.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lisp/tcover-unsafep.el 2011-05-23 17:57:17 +0000 @@ -29,13 +29,13 @@ ;;;These forms are all considered safe (defconst testcover-unsafep-safe '(((lambda (x) (* x 2)) 14) - (apply 'cdr (mapcar '(lambda (x) (car x)) y)) + (apply 'cdr (mapcar (lambda (x) (car x)) y)) (cond ((= x 4) 5) (t 27)) (condition-case x (car y) (error (car x))) (dolist (x y) (message "here: %s" x)) (dotimes (x 14 (* x 2)) (message "here: %d" x)) (let (x) (dolist (y '(1 2 3) (1+ y)) (push y x))) - (let (x) (apply '(lambda (x) (* x 2)) 14)) + (let (x) (apply (lambda (x) (* x 2)) 14)) (let ((x '(2))) (push 1 x) (pop x) (add-to-list 'x 2)) (let ((x 1) (y 2)) (setq x (+ x y))) (let ((x 1)) (let ((y (+ x 3))) (* x y))) @@ -90,7 +90,7 @@ . (function kill-buffer)) ( (mapcar x y) . (unquoted x)) - ( (mapcar '(lambda (x) (rename-file x "x")) '("unsafep.el")) + ( (mapcar (lambda (x) (rename-file x "x")) '("unsafep.el")) . (function rename-file)) ( (mapconcat x1 x2 " ") . (unquoted x1)) === modified file 'lisp/emulation/cua-rect.el' --- lisp/emulation/cua-rect.el 2011-01-25 04:08:28 +0000 +++ lisp/emulation/cua-rect.el 2011-05-23 17:57:17 +0000 @@ -609,12 +609,12 @@ (let ((lines 0)) (if (not (cua--rectangle-virtual-edges)) (cua--rectangle-operation nil nil t 2 t - '(lambda (s e l r v) - (setq lines (1+ lines)) - (if (and (> e s) (<= e (point-max))) - (delete-region s e)))) + (lambda (s e l r v) + (setq lines (1+ lines)) + (if (and (> e s) (<= e (point-max))) + (delete-region s e)))) (cua--rectangle-operation nil 1 t nil t - '(lambda (s e l r v) + (lambda (s e l r v) (setq lines (1+ lines)) (when (and (> e s) (<= e (point-max))) (delete-region s e))))) @@ -624,10 +624,10 @@ (let (rect) (if (not (cua--rectangle-virtual-edges)) (cua--rectangle-operation nil nil nil nil nil ; do not tabify - '(lambda (s e l r) + (lambda (s e l r) (setq rect (cons (cua--filter-buffer-noprops s e) rect)))) (cua--rectangle-operation nil 1 nil nil nil ; do not tabify - '(lambda (s e l r v) + (lambda (s e l r v) (let ((copy t) (bs 0) (as 0) row) (if (= s e) (setq e (1+ e))) (goto-char s) @@ -750,7 +750,7 @@ (when (/= left right) (sit-for 0) ; make window top/bottom reliable (cua--rectangle-operation nil t nil nil nil ; do not tabify - '(lambda (s e l r v) + (lambda (s e l r v) (let ((rface (if v 'cua-rectangle 'cua-rectangle-noselect)) overlay bs ms as) (when (cua--rectangle-virtual-edges) @@ -840,7 +840,7 @@ (pad (cua--rectangle-virtual-edges)) indent) (cua--rectangle-operation (if clear 'clear 'corners) nil t pad nil - '(lambda (s e l r) + (lambda (s e l r) (move-to-column col pad) (if (and (eolp) (< (current-column) col)) @@ -852,7 +852,7 @@ (if (cua--rectangle-right-side t) (cua--rectangle-insert-col (current-column)) (setq indent (- (current-column) l)))) - '(lambda (l r) + (lambda (l r) (when (and indent (> indent 0)) (aset cua--rectangle 2 (+ l indent)) (aset cua--rectangle 3 (+ r indent -1))))))) @@ -1000,7 +1000,7 @@ but instead winds up to the right of the rectangle." (interactive) (cua--rectangle-operation 'corners nil t 1 nil - '(lambda (s e l r) + (lambda (s e l r) (skip-chars-forward " \t") (let ((ws (- (current-column) l)) (p (point))) @@ -1015,7 +1015,7 @@ With prefix arg, also delete whitespace to the left of that column." (interactive "P") (cua--rectangle-operation 'clear nil t 1 nil - '(lambda (s e l r) + (lambda (s e l r) (when arg (skip-syntax-backward " " (line-beginning-position)) (setq s (point))) @@ -1027,7 +1027,7 @@ The text previously in the rectangle is overwritten by the blanks." (interactive) (cua--rectangle-operation 'keep nil nil 1 nil - '(lambda (s e l r) + (lambda (s e l r) (goto-char e) (skip-syntax-forward " " (line-end-position)) (setq e (point)) @@ -1042,7 +1042,7 @@ (interactive) (let (x) (cua--rectangle-operation 'clear nil t t nil - '(lambda (s e l r) + (lambda (s e l r) (let ((b (line-beginning-position))) (skip-syntax-backward "^ " b) (skip-syntax-backward " " b) @@ -1050,7 +1050,7 @@ (skip-syntax-forward " " (line-end-position)) (delete-region s (point)) (indent-to l)) - '(lambda (l r) + (lambda (l r) (move-to-column l) ;; (setq cua-save-point (point)) )))) @@ -1087,7 +1087,7 @@ The length of STRING need not be the same as the rectangle width." (interactive "sString rectangle: ") (cua--rectangle-operation 'keep nil t t nil - '(lambda (s e l r) + (lambda (s e l r) (delete-region s e) (skip-chars-forward " \t") (let ((ws (- (current-column) l))) @@ -1095,14 +1095,14 @@ (insert string) (indent-to (+ (current-column) ws)))) (unless (cua--rectangle-restriction) - '(lambda (l r) + (lambda (l r) (cua--rectangle-right (max l (+ l (length string) -1))))))) (defun cua-fill-char-rectangle (character) "Replace CUA rectangle contents with CHARACTER." (interactive "cFill rectangle with character: ") (cua--rectangle-operation 'clear nil t 1 nil - '(lambda (s e l r) + (lambda (s e l r) (delete-region s e) (move-to-column l t) (insert-char character (- r l))))) @@ -1113,7 +1113,7 @@ (if buffer-read-only (message "Cannot replace in read-only buffer") (cua--rectangle-operation 'keep nil t 1 nil - '(lambda (s e l r) + (lambda (s e l r) (if (re-search-forward regexp e t) (replace-match newtext nil nil)))))) @@ -1121,7 +1121,7 @@ "Increment each line of CUA rectangle by prefix amount." (interactive "p") (cua--rectangle-operation 'keep nil t 1 nil - '(lambda (s e l r) + (lambda (s e l r) (cond ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t) (let* ((txt (cua--filter-buffer-noprops (match-beginning 1) (match-end 1))) @@ -1154,14 +1154,14 @@ (setq format cua--rectangle-seq-format) (setq cua--rectangle-seq-format format)) (cua--rectangle-operation 'clear nil t 1 nil - '(lambda (s e l r) + (lambda (s e l r) (delete-region s e) (insert (format format first)) (setq first (+ first incr))))) (defmacro cua--convert-rectangle-as (command tabify) `(cua--rectangle-operation 'clear nil nil nil ,tabify - '(lambda (s e l r) + (lambda (s e l r) (,command s e)))) (defun cua-upcase-rectangle () @@ -1218,7 +1218,7 @@ (if cua--debug (print z auxbuf)) (cua--rectangle-operation nil nil t pad nil - '(lambda (s e l r) + (lambda (s e l r) (let (cc) (goto-char e) (skip-chars-forward " \t") @@ -1266,7 +1266,7 @@ nil nil nil nil))) (cua--rectangle-aux-replace width t t t 1 'cua--left-fill-rectangle - '(lambda () (insert text)))) + (lambda () (insert text)))) (defun cua-refill-rectangle (width) "Fill contents of current rectagle. @@ -1285,7 +1285,7 @@ nil nil nil 'shell-command-history))) (cua--rectangle-aux-replace -1 t t replace 1 - '(lambda (s e) + (lambda (s e) (shell-command-on-region s e command replace replace nil)))) @@ -1298,7 +1298,7 @@ "Remove the first line of the rectangle and scroll remaining lines up." (interactive) (cua--rectangle-aux-replace 0 t t t t - '(lambda (s e) + (lambda (s e) (if (= (forward-line 1) 0) (delete-region s (point)))))) @@ -1307,7 +1307,7 @@ The remaining lines are scrolled down, losing the last line." (interactive) (cua--rectangle-aux-replace 0 t t t t - '(lambda (s e) + (lambda (s e) (goto-char s) (insert "\n")))) @@ -1337,7 +1337,7 @@ (pad (cua--rectangle-virtual-edges)) indent) (cua--rectangle-operation 'corners nil t pad nil - '(lambda (s e l r) + (lambda (s e l r) (move-to-column (if (cua--rectangle-right-side t) (max (1+ r) col) l) @@ -1348,7 +1348,7 @@ (if (cua--rectangle-right-side t) (cua--rectangle-insert-col (current-column)) (setq indent (- l (current-column)))))) - '(lambda (l r) + (lambda (l r) (when (and indent (> indent 0)) (aset cua--rectangle 2 (- l indent)) (aset cua--rectangle 3 (- r indent 1))))))) === modified file 'lisp/emulation/tpu-edt.el' --- lisp/emulation/tpu-edt.el 2011-01-28 16:58:04 +0000 +++ lisp/emulation/tpu-edt.el 2011-05-23 17:57:17 +0000 @@ -1278,9 +1278,9 @@ (defun tpu-make-file-buffer-list (buffer-list) "Return names from BUFFER-LIST excluding those beginning with a space or star." - (delq nil (mapcar '(lambda (b) - (if (or (= (aref (buffer-name b) 0) ? ) - (= (aref (buffer-name b) 0) ?*)) nil b)) + (delq nil (mapcar (lambda (b) + (if (or (= (aref (buffer-name b) 0) ?\s) + (= (aref (buffer-name b) 0) ?*)) nil b)) buffer-list))) (defun tpu-next-window nil === modified file 'lisp/emulation/viper-cmd.el' --- lisp/emulation/viper-cmd.el 2011-03-06 02:43:19 +0000 +++ lisp/emulation/viper-cmd.el 2011-05-23 17:57:17 +0000 @@ -1084,7 +1084,7 @@ "Function that implements ESC key in Viper emulation of Vi." (interactive) (let ((cmd (or (key-binding (viper-envelop-ESC-key)) - '(lambda () (interactive) (error "Viper bell"))))) + (lambda () (interactive) (error "Viper bell"))))) ;; call the actual function to execute ESC (if no other symbols followed) ;; or the key bound to the ESC sequence (if the sequence was issued === modified file 'lisp/emulation/viper-util.el' --- lisp/emulation/viper-util.el 2011-01-26 08:36:39 +0000 +++ lisp/emulation/viper-util.el 2011-05-23 17:57:17 +0000 @@ -1080,7 +1080,7 @@ char-p (= (length base-key-name) 1)) (setq mod-char-list (mapcar - '(lambda (elt) (upcase (substring (symbol-name elt) 0 1))) + (lambda (elt) (upcase (substring (symbol-name elt) 0 1))) modifiers)) (if char-p (setq key-name @@ -1153,7 +1153,7 @@ ;; XEmacs only (defun viper-event-vector-p (vec) (and (vectorp vec) - (eval (cons 'and (mapcar '(lambda (elt) (if (eventp elt) t)) vec))))) + (eval (cons 'and (mapcar (lambda (elt) (if (eventp elt) t)) vec))))) ;; check if vec is a vector of character symbols @@ -1239,7 +1239,7 @@ the `Local variables' section of a file." (setq viper-related-files-and-buffers-ring (make-ring (1+ (length other-files-or-buffers)))) - (mapc '(lambda (elt) + (mapc (lambda (elt) (viper-ring-insert viper-related-files-and-buffers-ring elt)) other-files-or-buffers) (viper-ring-insert viper-related-files-and-buffers-ring (buffer-name)) === modified file 'lisp/emulation/viper.el' --- lisp/emulation/viper.el 2011-01-25 04:08:28 +0000 +++ lisp/emulation/viper.el 2011-05-23 17:57:17 +0000 @@ -851,19 +851,19 @@ ;; over misspelled words (due to the overlay keymaps) (defvar flyspell-mode-hook) (add-hook 'flyspell-mode-hook - '(lambda () - (define-key flyspell-mouse-map viper-ESC-key nil))) + (lambda () + (define-key flyspell-mouse-map viper-ESC-key nil))) ;; if viper is started from .emacs, it might be impossible to get certain ;; info about the display and windows until emacs initialization is complete ;; So do it via the window-setup-hook (add-hook 'window-setup-hook - '(lambda () - (modify-frame-parameters - (selected-frame) - (list (cons 'viper-vi-state-cursor-color - (viper-get-cursor-color)))) - (setq viper-vi-state-cursor-color (viper-get-cursor-color)) - )) + (lambda () + (modify-frame-parameters + (selected-frame) + (list (cons 'viper-vi-state-cursor-color + (viper-get-cursor-color)))) + (setq viper-vi-state-cursor-color (viper-get-cursor-color)) + )) ;; Tell vc-diff to put *vc* in Vi mode (eval-after-load === modified file 'lisp/eshell/em-glob.el' --- lisp/eshell/em-glob.el 2011-03-05 04:11:05 +0000 +++ lisp/eshell/em-glob.el 2011-05-23 17:57:17 +0000 @@ -148,10 +148,10 @@ ;; if this is a glob pattern than needs to be expanded, then it ;; will need to expand each member of the resulting glob list (add-to-list 'eshell-current-modifiers - '(lambda (list) - (if (listp list) - (mapcar 'expand-file-name list) - (expand-file-name list))))) + (lambda (list) + (if (listp list) + (mapcar 'expand-file-name list) + (expand-file-name list))))) (add-to-list 'eshell-current-modifiers 'eshell-extended-glob)) (defun eshell-parse-glob-chars () === modified file 'lisp/eshell/em-pred.el' --- lisp/eshell/em-pred.el 2011-03-05 04:11:05 +0000 +++ lisp/eshell/em-pred.el 2011-05-23 17:57:17 +0000 @@ -84,16 +84,16 @@ (?s . (eshell-pred-file-mode 4000)) ; setuid (?S . (eshell-pred-file-mode 2000)) ; setgid (?t . (eshell-pred-file-mode 1000)) ; sticky bit - (?U . '(lambda (file) ; owned by effective uid - (if (file-exists-p file) - (= (nth 2 (file-attributes file)) (user-uid))))) -;;; (?G . '(lambda (file) ; owned by effective gid -;;; (if (file-exists-p file) -;;; (= (nth 2 (file-attributes file)) (user-uid))))) - (?* . '(lambda (file) - (and (file-regular-p file) - (not (file-symlink-p file)) - (file-executable-p file)))) + (?U . #'(lambda (file) ; owned by effective uid + (if (file-exists-p file) + (= (nth 2 (file-attributes file)) (user-uid))))) + ;; (?G . #'(lambda (file) ; owned by effective gid + ;; (if (file-exists-p file) + ;; (= (nth 2 (file-attributes file)) (user-uid))))) + (?* . #'(lambda (file) + (and (file-regular-p file) + (not (file-symlink-p file)) + (file-executable-p file)))) (?l . (eshell-pred-file-links)) (?u . (eshell-pred-user-or-group ?u "user" 2 'eshell-user-id)) (?g . (eshell-pred-user-or-group ?g "group" 3 'eshell-group-id)) @@ -111,36 +111,25 @@ (put 'eshell-predicate-alist 'risky-local-variable t) (defcustom eshell-modifier-alist - '((?E . '(lambda (lst) - (mapcar - (function - (lambda (str) - (eshell-stringify - (car (eshell-parse-argument str))))) lst))) - (?L . '(lambda (lst) - (mapcar 'downcase lst))) - (?U . '(lambda (lst) - (mapcar 'upcase lst))) - (?C . '(lambda (lst) - (mapcar 'capitalize lst))) - (?h . '(lambda (lst) - (mapcar 'file-name-directory lst))) + '((?E . #'(lambda (lst) + (mapcar + (function + (lambda (str) + (eshell-stringify + (car (eshell-parse-argument str))))) lst))) + (?L . #'(lambda (lst) (mapcar 'downcase lst))) + (?U . #'(lambda (lst) (mapcar 'upcase lst))) + (?C . #'(lambda (lst) (mapcar 'capitalize lst))) + (?h . #'(lambda (lst) (mapcar 'file-name-directory lst))) (?i . (eshell-include-members)) (?x . (eshell-include-members t)) - (?r . '(lambda (lst) - (mapcar 'file-name-sans-extension lst))) - (?e . '(lambda (lst) - (mapcar 'file-name-extension lst))) - (?t . '(lambda (lst) - (mapcar 'file-name-nondirectory lst))) - (?q . '(lambda (lst) - (mapcar 'eshell-escape-arg lst))) - (?u . '(lambda (lst) - (eshell-uniqify-list lst))) - (?o . '(lambda (lst) - (sort lst 'string-lessp))) - (?O . '(lambda (lst) - (nreverse (sort lst 'string-lessp)))) + (?r . #'(lambda (lst) (mapcar 'file-name-sans-extension lst))) + (?e . #'(lambda (lst) (mapcar 'file-name-extension lst))) + (?t . #'(lambda (lst) (mapcar 'file-name-nondirectory lst))) + (?q . #'(lambda (lst) (mapcar 'eshell-escape-arg lst))) + (?u . #'(lambda (lst) (eshell-uniqify-list lst))) + (?o . #'(lambda (lst) (sort lst 'string-lessp))) + (?O . #'(lambda (lst) (nreverse (sort lst 'string-lessp)))) (?j . (eshell-join-members)) (?S . (eshell-split-members)) (?R . 'reverse) === modified file 'lisp/files.el' --- lisp/files.el 2011-05-22 01:18:49 +0000 +++ lisp/files.el 2011-05-23 17:57:17 +0000 @@ -278,7 +278,7 @@ :group 'backup :group 'vc) (put 'version-control 'safe-local-variable - '(lambda (x) (or (booleanp x) (equal x 'never)))) + (lambda (x) (or (booleanp x) (equal x 'never)))) (defcustom dired-kept-versions 2 "When cleaning directory, number of versions to keep." === modified file 'lisp/gnus/gnus-cus.el' --- lisp/gnus/gnus-cus.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/gnus-cus.el 2011-05-23 17:57:17 +0000 @@ -1034,19 +1034,19 @@ (widget-create 'push-button :notify - '(lambda (&rest ignore) - (let* ((info (assq gnus-agent-cat-name gnus-category-alist)) - (widgets category-fields)) - (while widgets - (let* ((widget (pop widgets)) - (value (condition-case nil (widget-value widget) (error)))) - (eval `(setf (,(widget-get widget :accessor) ',info) - ',value))))) - (gnus-category-write) - (gnus-kill-buffer (current-buffer)) - (when (get-buffer gnus-category-buffer) - (switch-to-buffer (get-buffer gnus-category-buffer)) - (gnus-category-list))) + (lambda (&rest ignore) + (let* ((info (assq gnus-agent-cat-name gnus-category-alist)) + (widgets category-fields)) + (while widgets + (let* ((widget (pop widgets)) + (value (condition-case nil (widget-value widget) (error)))) + (eval `(setf (,(widget-get widget :accessor) ',info) + ',value))))) + (gnus-category-write) + (gnus-kill-buffer (current-buffer)) + (when (get-buffer gnus-category-buffer) + (switch-to-buffer (get-buffer gnus-category-buffer)) + (gnus-category-list))) "Done") (widget-insert "\n Note: Empty fields default to the customizable global\ === modified file 'lisp/gnus/gnus-delay.el' --- lisp/gnus/gnus-delay.el 2011-02-13 23:30:55 +0000 +++ lisp/gnus/gnus-delay.el 2011-05-23 17:57:17 +0000 @@ -151,8 +151,7 @@ (when (gnus-group-entry group) (gnus-activate-group group) (add-hook 'message-send-hook - '(lambda () - (message-remove-header gnus-delay-header))) + (lambda () (message-remove-header gnus-delay-header))) (setq articles (nndraft-articles)) (while (setq article (pop articles)) (gnus-request-head article group) === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2011-05-02 22:41:38 +0000 +++ lisp/gnus/gnus.el 2011-05-23 17:57:17 +0000 @@ -4357,11 +4357,11 @@ (switch-to-buffer gnus-group-buffer) (funcall gnus-other-frame-function arg) (add-hook 'gnus-exit-gnus-hook - '(lambda nil - (when (and (frame-live-p gnus-other-frame-object) - (cdr (frame-list))) - (delete-frame gnus-other-frame-object)) - (setq gnus-other-frame-object nil))))))) + (lambda nil + (when (and (frame-live-p gnus-other-frame-object) + (cdr (frame-list))) + (delete-frame gnus-other-frame-object)) + (setq gnus-other-frame-object nil))))))) ;;;###autoload (defun gnus (&optional arg dont-connect slave) === modified file 'lisp/hilit-chg.el' --- lisp/hilit-chg.el 2011-04-19 13:44:55 +0000 +++ lisp/hilit-chg.el 2011-05-23 17:57:17 +0000 @@ -1025,9 +1025,8 @@ ;; (defun hilit-chg-debug-show (&optional beg end) ;; (interactive) ;; (message "--- hilit-chg-debug-show ---") -;; (hilit-chg-map-changes '(lambda (prop start end) -;; (message "%d-%d: %s" start end prop) -;; ) +;; (hilit-chg-map-changes (lambda (prop start end) +;; (message "%d-%d: %s" start end prop)) ;; beg end ;; )) ;; === modified file 'lisp/ido.el' --- lisp/ido.el 2011-04-19 13:44:55 +0000 +++ lisp/ido.el 2011-05-23 17:57:17 +0000 @@ -3903,7 +3903,7 @@ (funcall f completion-list :help-string "ido " :activate-callback - '(lambda (x y z) (message "Doesn't work yet, sorry!")))) + (lambda (x y z) (message "Doesn't work yet, sorry!")))) ;; else running Emacs ;;(add-hook 'completion-setup-hook 'completion-setup-function) (display-completion-list completion-list))))))) === modified file 'lisp/ielm.el' --- lisp/ielm.el 2011-04-19 13:44:55 +0000 +++ lisp/ielm.el 2011-05-23 17:57:17 +0000 @@ -62,7 +62,7 @@ wish to put something like the following in your `.emacs' file: \(add-hook 'ielm-mode-hook - '(lambda () + (lambda () (define-key ielm-map \"\\C-w\" 'comint-kill-region) (define-key ielm-map [C-S-backspace] 'comint-kill-whole-line))) === modified file 'lisp/image-dired.el' --- lisp/image-dired.el 2011-04-19 13:44:55 +0000 +++ lisp/image-dired.el 2011-05-23 17:57:17 +0000 @@ -2590,7 +2590,7 @@ ;; `(,(nth 4 fattribs) ,(nth 7 fattribs) ,f))) ;; (directory-files (image-dired-dir) t ".+\.thumb\..+$")) ;; ;; Sort function. Compare time between two files. -;; '(lambda (l1 l2) +;; (lambda (l1 l2) ;; (time-less-p (car l1) (car l2))))) ;; (dirsize (apply '+ (mapcar (lambda (x) (cadr x)) files)))) ;; (while (> dirsize image-dired-dir-max-size) === modified file 'lisp/international/quail.el' --- lisp/international/quail.el 2011-05-10 13:57:12 +0000 +++ lisp/international/quail.el 2011-05-23 17:57:17 +0000 @@ -2458,10 +2458,10 @@ (define-button-type 'quail-keyboard-layout-button :supertype 'help-xref - 'help-function '(lambda (layout) - (help-setup-xref `(quail-keyboard-layout-button ,layout) - nil) - (quail-show-keyboard-layout layout)) + 'help-function (lambda (layout) + (help-setup-xref `(quail-keyboard-layout-button ,layout) + nil) + (quail-show-keyboard-layout layout)) 'help-echo (purecopy "mouse-2, RET: show keyboard layout")) (define-button-type 'quail-keyboard-customize-button === modified file 'lisp/iswitchb.el' --- lisp/iswitchb.el 2011-04-19 13:44:55 +0000 +++ lisp/iswitchb.el 2011-05-23 17:57:17 +0000 @@ -207,7 +207,7 @@ ;; (delete-minibuffer-contents)) ;; ;; (add-hook 'iswitchb-define-mode-map-hook -;; '(lambda () (define-key +;; (lambda () (define-key ;; iswitchb-mode-map "\C-o" ;; 'iswitchb-exclude-nonmatching))) === modified file 'lisp/loadup.el' --- lisp/loadup.el 2011-05-20 00:41:03 +0000 +++ lisp/loadup.el 2011-05-23 17:57:17 +0000 @@ -81,7 +81,7 @@ ;; Do it after subr, since both after-load-functions and add-hook are ;; implemented in subr.el. -(add-hook 'after-load-functions '(lambda (f) (garbage-collect))) +(add-hook 'after-load-functions (lambda (f) (garbage-collect))) ;; We specify .el in case someone compiled version.el by mistake. (load "version.el") @@ -304,7 +304,7 @@ (equal (nth 4 command-line-args) "bootstrap")) (setcdr load-path nil)) -(remove-hook 'after-load-functions '(lambda (f) (garbage-collect))) +(remove-hook 'after-load-functions (lambda (f) (garbage-collect))) (setq inhibit-load-charset-map nil) (clear-charset-maps) === modified file 'lisp/mail/emacsbug.el' --- lisp/mail/emacsbug.el 2011-02-06 15:04:31 +0000 +++ lisp/mail/emacsbug.el 2011-05-23 17:57:17 +0000 @@ -227,8 +227,8 @@ system-configuration-options "'\n\n")) (insert "Important settings:\n") (mapc - '(lambda (var) - (insert (format " value of $%s: %s\n" var (getenv var)))) + (lambda (var) + (insert (format " value of $%s: %s\n" var (getenv var)))) '("LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LANG" "XMODIFIERS")) (insert (format " locale-coding-system: %s\n" locale-coding-system)) === modified file 'lisp/mail/feedmail.el' --- lisp/mail/feedmail.el 2011-05-18 03:39:45 +0000 +++ lisp/mail/feedmail.el 2011-05-23 17:57:17 +0000 @@ -1437,7 +1437,7 @@ ) (defcustom feedmail-queue-runner-mode-setter - '(lambda (&optional arg) (mail-mode)) + (lambda (&optional arg) (mail-mode)) "A function to set the proper mode of a message file. Called when the message is read back out of the queue directory with a single argument, the optional argument used in the call to @@ -1473,7 +1473,7 @@ (defcustom feedmail-queue-runner-message-sender - '(lambda (&optional arg) (mail-send)) + (lambda (&optional arg) (mail-send)) "Function to initiate sending a message file. Called for each message read back out of the queue directory with a single argument, the optional argument used in the call to @@ -1491,7 +1491,7 @@ (defcustom feedmail-queue-runner-cleaner-upper - '(lambda (fqm-file &optional arg) + (lambda (fqm-file &optional arg) (delete-file fqm-file) (if arg (feedmail-say-chatter "Nuked %s" fqm-file))) "Function that will be called after a message has been sent. @@ -1642,7 +1642,7 @@ ;; don't be overconfident about the name of the trace buffer (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server)))) (mapcar - '(lambda (buffy) + (lambda (buffy) (if (string-match tracer (buffer-name buffy)) (progn (insert "SMTP Trace from " (buffer-name buffy) "\n---------------") @@ -1667,7 +1667,7 @@ ;; don't be overconfident about the name of the trace buffer (tracer (concat "trace.*smtp.*" (regexp-quote smtp-server)))) (mapcar - '(lambda (buffy) + (lambda (buffy) (if (string-match tracer (buffer-name buffy)) (progn (insert "SMTP Trace from " (buffer-name buffy) "\n---------------") @@ -1996,7 +1996,7 @@ (if feedmail-queue-run-orderer (setq list-of-possible-fqms (funcall feedmail-queue-run-orderer list-of-possible-fqms))) (mapc - '(lambda (blobby) + (lambda (blobby) (setq maybe-file (expand-file-name blobby feedmail-queue-directory)) (cond ((file-directory-p maybe-file) nil) ; don't care about subdirs @@ -2238,7 +2238,7 @@ ;; iterate, counting things we find along the way in the directory (if (file-directory-p queue-directory) (mapc - '(lambda (blobby) + (lambda (blobby) (cond ((file-directory-p blobby) nil) ; don't care about subdirs ((feedmail-fqm-p blobby) @@ -2665,7 +2665,7 @@ (save-excursion (if feedmail-enable-spray (mapcar - '(lambda (feedmail-spray-this-address) + (lambda (feedmail-spray-this-address) (let ((spray-buffer (get-buffer-create " *FQM Outgoing Email Spray*"))) (with-current-buffer spray-buffer (erase-buffer) === modified file 'lisp/mail/mspools.el' --- lisp/mail/mspools.el 2011-01-25 04:08:28 +0000 +++ lisp/mail/mspools.el 2011-05-23 17:57:17 +0000 @@ -215,12 +215,12 @@ ;; Mailing list inboxes ;; must have VM already loaded to get vm-folder-directory. - (mapcar '(lambda (s) - "make the appropriate entry for vm-spool-files" - (list - (concat mspools-folder-directory s) - (concat mspools-folder-directory s "." mspools-suffix) - (concat mspools-folder-directory s ".crash"))) + (mapcar (lambda (s) + "make the appropriate entry for vm-spool-files" + (list + (concat mspools-folder-directory s) + (concat mspools-folder-directory s "." mspools-suffix) + (concat mspools-folder-directory s ".crash"))) ;; So I create a vm-spool-files entry for each of those mail drops (mapcar 'file-name-sans-extension (directory-files mspools-folder-directory nil === modified file 'lisp/mail/sendmail.el' --- lisp/mail/sendmail.el 2011-05-18 03:39:45 +0000 +++ lisp/mail/sendmail.el 2011-05-23 17:57:17 +0000 @@ -864,9 +864,9 @@ (let ((l)) (mapc ;; remove duplicates - '(lambda (e) - (unless (member e l) - (push e l))) + (lambda (e) + (unless (member e l) + (push e l))) (split-string new-header-values ",[[:space:]]+" t)) (mapconcat 'identity l ", ")) === modified file 'lisp/mh-e/mh-alias.el' --- lisp/mh-e/mh-alias.el 2011-05-10 13:57:12 +0000 +++ lisp/mh-e/mh-alias.el 2011-05-23 17:57:17 +0000 @@ -638,10 +638,10 @@ (message "Making passwd aliases...") (setq passwd-matches (mapconcat - '(lambda (elem) - (if (or (string-match regexp (car elem)) - (string-match regexp (cadr elem))) - (format "%s: %s\n" (car elem) (cadr elem)))) + (lambda (elem) + (if (or (string-match regexp (car elem)) + (string-match regexp (cadr elem))) + (format "%s: %s\n" (car elem) (cadr elem)))) mh-alias-passwd-alist "")) (message "Making passwd aliases...done"))) (if (and (string-equal "" matches) === modified file 'lisp/mh-e/mh-e.el' --- lisp/mh-e/mh-e.el 2011-04-28 15:32:28 +0000 +++ lisp/mh-e/mh-e.el 2011-05-23 17:57:17 +0000 @@ -933,7 +933,7 @@ (t (message "Unknown variant %s; use %s" variant - (mapconcat '(lambda (x) (format "%s" (car x))) + (mapconcat (lambda (x) (format "%s" (car x))) (mh-variants) " or ")))))) (defcustom-mh mh-variant 'autodetect === modified file 'lisp/mh-e/mh-inc.el' --- lisp/mh-e/mh-inc.el 2011-01-26 08:36:39 +0000 +++ lisp/mh-e/mh-inc.el 2011-05-23 17:57:17 +0000 @@ -39,12 +39,12 @@ "Help text for `mh-inc-spool-map'.") (define-key mh-inc-spool-map "?" - '(lambda () - (interactive) - (if mh-inc-spool-map-help - (mh-help mh-inc-spool-map-help) - (mh-ephem-message - "There are no keys defined yet; customize `mh-inc-spool-list'")))) + (lambda () + (interactive) + (if mh-inc-spool-map-help + (mh-help mh-inc-spool-map-help) + (mh-ephem-message + "There are no keys defined yet; customize `mh-inc-spool-list'")))) ;;;###mh-autoload (defun mh-inc-spool-make () === modified file 'lisp/mh-e/mh-junk.el' --- lisp/mh-e/mh-junk.el 2011-01-26 08:36:39 +0000 +++ lisp/mh-e/mh-junk.el 2011-05-23 17:57:17 +0000 @@ -312,9 +312,9 @@ (delete-other-windows) (pop-to-buffer (get-buffer-create "*MH-E Spammer Frequencies*")) (erase-buffer) - (maphash '(lambda (key value) "" - (if (> value 2) - (insert (format "%s %s\n" key value)))) + (maphash (lambda (key value) "" + (if (> value 2) + (insert (format "%s %s\n" key value)))) domains) (sort-numeric-fields 2 (point-min) (point-max)) (reverse-region (point-min) (point-max)) === modified file 'lisp/mh-e/mh-mime.el' --- lisp/mh-e/mh-mime.el 2011-03-05 21:56:00 +0000 +++ lisp/mh-e/mh-mime.el 2011-05-23 17:57:17 +0000 @@ -1637,8 +1637,8 @@ ;; Do an alias lookup on recipients (message-options-set 'message-recipients (mapconcat - '(lambda (ali) - (mail-strip-quoted-names (mh-alias-expand ali))) + (lambda (ali) + (mail-strip-quoted-names (mh-alias-expand ali))) (split-string (message-options-get 'message-recipients) "[, ]+") ", "))) (let ((saved-text (buffer-string)) === modified file 'lisp/msb.el' --- lisp/msb.el 2011-02-03 07:29:38 +0000 +++ lisp/msb.el 2011-05-23 17:57:17 +0000 @@ -315,7 +315,7 @@ :set 'msb-custom-set :group 'msb) -(defvar msb-horizontal-shift-function '(lambda () 0) +(defvar msb-horizontal-shift-function (lambda () 0) "*Function that specifies how many pixels to shift the top menu leftwards.") (defcustom msb-display-invisible-buffers-p nil === modified file 'lisp/net/ange-ftp.el' --- lisp/net/ange-ftp.el 2011-05-05 10:22:14 +0000 +++ lisp/net/ange-ftp.el 2011-05-23 17:57:17 +0000 @@ -5448,7 +5448,7 @@ ;; base-versions ;; (file-name-directory fn))) ;; (versions (mapcar -;; '(lambda (arg) +;; (lambda (arg) ;; (if (and (string-match ;; "[0-9]+$" arg bv-length) ;; (= (match-beginning 0) bv-length)) === modified file 'lisp/net/dbus.el' --- lisp/net/dbus.el 2011-02-07 08:01:15 +0000 +++ lisp/net/dbus.el 2011-05-23 17:57:17 +0000 @@ -121,7 +121,7 @@ hash table." (let (result) (maphash - '(lambda (key value) (add-to-list 'result (cons key value) 'append)) + (lambda (key value) (add-to-list 'result (cons key value) 'append)) dbus-registered-objects-table) result)) @@ -271,20 +271,20 @@ ;; Check whether SERVICE is a known name. (when (not (string-match "^:" service)) (maphash - '(lambda (key value) - (dolist (elt value) - ;; key has the structure (BUS INTERFACE MEMBER). - ;; elt has the structure (UNAME SERVICE PATH HANDLER). - (when (string-equal old-owner (car elt)) - ;; Remove old key, and add new entry with changed name. - (dbus-unregister-object (list key (cdr elt))) - ;; Maybe we could arrange the lists a little bit better - ;; that we don't need to extract every single element? - (dbus-register-signal - ;; BUS SERVICE PATH - (nth 0 key) (nth 1 elt) (nth 2 elt) - ;; INTERFACE MEMBER HANDLER - (nth 1 key) (nth 2 key) (nth 3 elt))))) + (lambda (key value) + (dolist (elt value) + ;; key has the structure (BUS INTERFACE MEMBER). + ;; elt has the structure (UNAME SERVICE PATH HANDLER). + (when (string-equal old-owner (car elt)) + ;; Remove old key, and add new entry with changed name. + (dbus-unregister-object (list key (cdr elt))) + ;; Maybe we could arrange the lists a little bit better + ;; that we don't need to extract every single element? + (dbus-register-signal + ;; BUS SERVICE PATH + (nth 0 key) (nth 1 elt) (nth 2 elt) + ;; INTERFACE MEMBER HANDLER + (nth 1 key) (nth 2 key) (nth 3 elt))))) (copy-hash-table dbus-registered-objects-table)))) ;; The error is reported only in debug mode. (when dbus-debug @@ -825,15 +825,15 @@ (setq direction nil)) ;; Collect the signatures. (mapconcat - '(lambda (x) - (let ((arg (dbus-introspect-get-argument - bus service path interface name x))) - (if (or (not (stringp direction)) - (string-equal - direction - (dbus-introspect-get-attribute arg "direction"))) - (dbus-introspect-get-attribute arg "type") - ""))) + (lambda (x) + (let ((arg (dbus-introspect-get-argument + bus service path interface name x))) + (if (or (not (stringp direction)) + (string-equal + direction + (dbus-introspect-get-attribute arg "direction"))) + (dbus-introspect-get-attribute arg "type") + ""))) (dbus-introspect-get-argument-names bus service path interface name) ""))) === modified file 'lisp/net/eudc-export.el' --- lisp/net/eudc-export.el 2011-01-25 04:08:28 +0000 +++ lisp/net/eudc-export.el 2011-05-23 17:57:17 +0000 @@ -44,7 +44,7 @@ ;; This function runs in a special context where lisp symbols corresponding ;; to field names in record are bound to the corresponding values (eval - `(let* (,@(mapcar '(lambda (c) + `(let* (,@(mapcar (lambda (c) (list (car c) (if (listp (cdr c)) (list 'quote (cdr c)) (cdr c)))) @@ -108,7 +108,7 @@ (void-variable nil))) ((and recurse (listp spec)) - (mapcar '(lambda (spec-elem) + (mapcar (lambda (spec-elem) (eudc-parse-spec spec-elem record nil)) spec)) (t === modified file 'lisp/net/eudc-hotlist.el' --- lisp/net/eudc-hotlist.el 2011-01-25 04:08:28 +0000 +++ lisp/net/eudc-hotlist.el 2011-05-23 17:57:17 +0000 @@ -89,7 +89,7 @@ "------" gap "--------\n" "\n") (setq eudc-hotlist-list-beginning (point)) - (mapc '(lambda (entry) + (mapc (lambda (entry) (insert (car entry)) (indent-to proto-col) (insert (symbol-name (cdr entry)) "\n")) @@ -103,7 +103,7 @@ (error "Not in a EUDC hotlist edit buffer")) (let ((server (read-from-minibuffer "Server: ")) (protocol (completing-read "Protocol: " - (mapcar '(lambda (elt) + (mapcar (lambda (elt) (cons (symbol-name elt) elt)) eudc-known-protocols))) === modified file 'lisp/net/eudc.el' --- lisp/net/eudc.el 2011-01-25 04:08:28 +0000 +++ lisp/net/eudc.el 2011-05-23 17:57:17 +0000 @@ -351,12 +351,12 @@ The translation is done according to `eudc-protocol-attributes-translation-alist'." (if eudc-protocol-attributes-translation-alist - (mapcar '(lambda (attribute) - (let ((trans (assq (car attribute) - (symbol-value eudc-protocol-attributes-translation-alist)))) - (if trans - (cons (cdr trans) (cdr attribute)) - attribute))) + (mapcar (lambda (attribute) + (let ((trans (assq (car attribute) + (symbol-value eudc-protocol-attributes-translation-alist)))) + (if trans + (cons (cdr trans) (cdr attribute)) + attribute))) query) query)) @@ -366,7 +366,7 @@ `eudc-protocol-attributes-translation-alist'." (if eudc-protocol-attributes-translation-alist (let (trans) - (mapcar '(lambda (attribute) + (mapcar (lambda (attribute) (setq trans (assq attribute (symbol-value eudc-protocol-attributes-translation-alist))) (if trans @@ -692,7 +692,7 @@ (interactive (list (read-from-minibuffer "Directory Server: ") (intern (completing-read "Protocol: " - (mapcar '(lambda (elt) + (mapcar (lambda (elt) (cons (symbol-name elt) elt)) eudc-known-protocols))))) @@ -796,7 +796,7 @@ (> n 0)) (setq formats (delq nil - (mapcar '(lambda (format) + (mapcar (lambda (format) (if (= n (length format)) format === modified file 'lisp/net/eudcb-bbdb.el' --- lisp/net/eudcb-bbdb.el 2011-01-25 04:08:28 +0000 +++ lisp/net/eudcb-bbdb.el 2011-05-23 17:57:17 +0000 @@ -73,32 +73,29 @@ "Return RECORD if it matches `eudc-bbdb-current-query', nil otherwise." (catch 'unmatch (progn - (mapc - (function - (lambda (condition) - (let ((attr (car condition)) - (val (cdr condition)) - (case-fold-search t) - bbdb-val) - (or (and (memq attr '(firstname lastname aka company phones addresses net)) - (progn - (setq bbdb-val - (eval (list (intern (concat "bbdb-record-" - (symbol-name attr))) - 'record))) - (if (listp bbdb-val) - (if eudc-bbdb-enable-substring-matches - (eval `(or ,@(mapcar '(lambda (subval) - (string-match val - subval)) - bbdb-val))) - (member (downcase val) - (mapcar 'downcase bbdb-val))) - (if eudc-bbdb-enable-substring-matches - (string-match val bbdb-val) - (string-equal (downcase val) (downcase bbdb-val)))))) - (throw 'unmatch nil))))) - eudc-bbdb-current-query) + (dolist (condition eudc-bbdb-current-query) + (let ((attr (car condition)) + (val (cdr condition)) + (case-fold-search t) + bbdb-val) + (or (and (memq attr '(firstname lastname aka company phones + addresses net)) + (progn + (setq bbdb-val + (eval (list (intern (concat "bbdb-record-" + (symbol-name attr))) + 'record))) + (if (listp bbdb-val) + (if eudc-bbdb-enable-substring-matches + (eval `(or ,@(mapcar (lambda (subval) + (string-match val subval)) + bbdb-val))) + (member (downcase val) + (mapcar 'downcase bbdb-val))) + (if eudc-bbdb-enable-substring-matches + (string-match val bbdb-val) + (string-equal (downcase val) (downcase bbdb-val)))))) + (throw 'unmatch nil)))) record))) ;; External. === modified file 'lisp/net/eudcb-ldap.el' --- lisp/net/eudcb-ldap.el 2011-01-25 04:08:28 +0000 +++ lisp/net/eudcb-ldap.el 2011-05-23 17:57:17 +0000 @@ -172,10 +172,10 @@ "Format the EUDC QUERY list as a RFC1558 LDAP search filter." (format "(&%s)" (apply 'concat - (mapcar '(lambda (item) - (format "(%s=%s)" - (car item) - (eudc-ldap-escape-query-special-chars (cdr item)))) + (mapcar (lambda (item) + (format "(%s=%s)" + (car item) + (eudc-ldap-escape-query-special-chars (cdr item)))) query)))) === modified file 'lisp/net/tramp-cache.el' --- lisp/net/tramp-cache.el 2011-03-06 00:30:16 +0000 +++ lisp/net/tramp-cache.el 2011-05-23 17:57:17 +0000 @@ -176,7 +176,7 @@ 'directory-file-name (list directory)))) (tramp-message vec 8 "%s" directory) (maphash - '(lambda (key value) + (lambda (key value) (when (and (stringp (tramp-file-name-localname key)) (string-match directory (tramp-file-name-localname key))) (remhash key tramp-cache-data))) @@ -199,7 +199,7 @@ (add-hook 'eshell-pre-command-hook 'tramp-flush-file-function) (add-hook 'kill-buffer-hook 'tramp-flush-file-function) (add-hook 'tramp-cache-unload-hook - '(lambda () + (lambda () (remove-hook 'before-revert-hook 'tramp-flush-file-function) (remove-hook 'eshell-pre-command-hook @@ -289,7 +289,7 @@ (when (hash-table-p table) (let (result) (maphash - '(lambda (key value) + (lambda (key value) (let ((tmp (format "(%s %s)" (if (processp key) @@ -309,7 +309,7 @@ "Return a list of all known connection vectors according to `tramp-cache'." (let (result) (maphash - '(lambda (key value) + (lambda (key value) (when (and (vectorp key) (null (aref key 3))) (add-to-list 'result key))) tramp-cache-data) @@ -326,7 +326,7 @@ (let ((cache (copy-hash-table tramp-cache-data))) ;; Remove temporary data. (maphash - '(lambda (key value) + (lambda (key value) (if (and (vectorp key) (not (tramp-file-name-localname key))) (progn (remhash "process-name" value) @@ -356,7 +356,7 @@ (unless noninteractive (add-hook 'kill-emacs-hook 'tramp-dump-connection-properties)) (add-hook 'tramp-cache-unload-hook - '(lambda () + (lambda () (remove-hook 'kill-emacs-hook 'tramp-dump-connection-properties))) @@ -367,7 +367,7 @@ for all methods. Resulting data are derived from connection history." (let (res) (maphash - '(lambda (key value) + (lambda (key value) (if (and (vectorp key) (string-equal method (tramp-file-name-method key)) (not (tramp-file-name-localname key))) === modified file 'lisp/net/tramp-cmds.el' --- lisp/net/tramp-cmds.el 2011-02-28 10:58:59 +0000 +++ lisp/net/tramp-cmds.el 2011-05-23 17:57:17 +0000 @@ -258,8 +258,8 @@ (dolist (buffer (delq nil (mapcar - '(lambda (b) - (when (string-match "\\*tramp/" (buffer-name b)) b)) + (lambda (b) + (when (string-match "\\*tramp/" (buffer-name b)) b)) (buffer-list)))) (let ((reporter-eval-buffer buffer) (buffer-name (buffer-name buffer)) === modified file 'lisp/net/tramp-ftp.el' --- lisp/net/tramp-ftp.el 2011-01-25 04:08:28 +0000 +++ lisp/net/tramp-ftp.el 2011-05-23 17:57:17 +0000 @@ -121,12 +121,12 @@ ;; handling. (put 'substitute-in-file-name 'ange-ftp 'tramp-handle-substitute-in-file-name) (add-hook 'tramp-ftp-unload-hook - '(lambda () - (setplist 'substitute-in-file-name - (delete 'ange-ftp - (delete 'tramp-handle-substitute-in-file-name - (symbol-plist - 'substitute-in-file-name)))))) + (lambda () + (setplist 'substitute-in-file-name + (delete 'ange-ftp + (delete 'tramp-handle-substitute-in-file-name + (symbol-plist + 'substitute-in-file-name)))))) ;;;###tramp-autoload (defun tramp-ftp-file-name-handler (operation &rest args) === modified file 'lisp/net/webjump.el' --- lisp/net/webjump.el 2011-01-25 04:08:28 +0000 +++ lisp/net/webjump.el 2011-05-23 17:57:17 +0000 @@ -447,11 +447,11 @@ (or (null str) (string-match "^[ \t]*$" str))) (defun webjump-url-encode (str) - (mapconcat '(lambda (c) - (let ((s (char-to-string c))) - (cond ((string= s " ") "+") - ((string-match "[a-zA-Z_.-/]" s) s) - (t (upcase (format "%%%02x" c)))))) + (mapconcat (lambda (c) + (let ((s (char-to-string c))) + (cond ((string= s " ") "+") + ((string-match "[a-zA-Z_.-/]" s) s) + (t (upcase (format "%%%02x" c)))))) (encode-coding-string str 'utf-8) "")) === modified file 'lisp/org/org-ascii.el' --- lisp/org/org-ascii.el 2011-01-26 08:36:39 +0000 +++ lisp/org/org-ascii.el 2011-05-23 17:57:17 +0000 @@ -369,55 +369,55 @@ (push (concat (nth 3 lang-words) "\n") thetoc) (push (concat (make-string (string-width (nth 3 lang-words)) ?=) "\n") thetoc) - (mapc '(lambda (line) - (if (string-match org-todo-line-regexp - line) - ;; This is a headline - (progn - (setq have-headings t) - (setq level (- (match-end 1) (match-beginning 1) - level-offset) - level (org-tr-level level) - txt (match-string 3 line) - todo - (or (and org-export-mark-todo-in-toc - (match-beginning 2) - (not (member (match-string 2 line) - org-done-keywords))) + (mapc (lambda (line) + (if (string-match org-todo-line-regexp + line) + ;; This is a headline + (progn + (setq have-headings t) + (setq level (- (match-end 1) (match-beginning 1) + level-offset) + level (org-tr-level level) + txt (match-string 3 line) + todo + (or (and org-export-mark-todo-in-toc + (match-beginning 2) + (not (member (match-string 2 line) + org-done-keywords))) ; TODO, not DONE - (and org-export-mark-todo-in-toc - (= level umax-toc) - (org-search-todo-below - line lines level)))) - (setq txt (org-html-expand-for-ascii txt)) - - (while (string-match org-bracket-link-regexp txt) - (setq txt - (replace-match - (match-string (if (match-end 2) 3 1) txt) - t t txt))) - - (if (and (memq org-export-with-tags '(not-in-toc nil)) - (string-match - (org-re "[ \t]+:[[:alnum:]_@#%:]+:[ \t]*$") - txt)) - (setq txt (replace-match "" t t txt))) - (if (string-match quote-re0 txt) - (setq txt (replace-match "" t t txt))) - - (if org-export-with-section-numbers - (setq txt (concat (org-section-number level) - " " txt))) - (if (<= level umax-toc) - (progn - (push - (concat - (make-string - (* (max 0 (- level org-min-level)) 4) ?\ ) - (format (if todo "%s (*)\n" "%s\n") txt)) - thetoc) - (setq org-last-level level)) - )))) + (and org-export-mark-todo-in-toc + (= level umax-toc) + (org-search-todo-below + line lines level)))) + (setq txt (org-html-expand-for-ascii txt)) + + (while (string-match org-bracket-link-regexp txt) + (setq txt + (replace-match + (match-string (if (match-end 2) 3 1) txt) + t t txt))) + + (if (and (memq org-export-with-tags '(not-in-toc nil)) + (string-match + (org-re "[ \t]+:[[:alnum:]_@#%:]+:[ \t]*$") + txt)) + (setq txt (replace-match "" t t txt))) + (if (string-match quote-re0 txt) + (setq txt (replace-match "" t t txt))) + + (if org-export-with-section-numbers + (setq txt (concat (org-section-number level) + " " txt))) + (if (<= level umax-toc) + (progn + (push + (concat + (make-string + (* (max 0 (- level org-min-level)) 4) ?\ ) + (format (if todo "%s (*)\n" "%s\n") txt)) + thetoc) + (setq org-last-level level)) + )))) lines) (setq thetoc (if have-headings (nreverse thetoc) nil)))) === modified file 'lisp/org/org-attach.el' --- lisp/org/org-attach.el 2011-01-25 04:08:28 +0000 +++ lisp/org/org-attach.el 2011-05-23 17:57:17 +0000 @@ -246,10 +246,10 @@ (cd dir) (shell-command "git add .") (shell-command "git ls-files --deleted" t) - (mapc '(lambda (file) - (unless (string= file "") - (shell-command - (concat "git rm \"" file "\"")))) + (mapc (lambda (file) + (unless (string= file "") + (shell-command + (concat "git rm \"" file "\"")))) (split-string (buffer-string) "\n")) (shell-command "git commit -m 'Synchronized attachments'"))))) === modified file 'lisp/org/org-exp.el' --- lisp/org/org-exp.el 2011-01-26 08:36:39 +0000 +++ lisp/org/org-exp.el 2011-05-23 17:57:17 +0000 @@ -2136,7 +2136,7 @@ markup (org-symname-or-string (pop params)) lang (and (member markup '("src" "SRC")) (org-symname-or-string (pop params))) - switches (mapconcat '(lambda (x) (format "%s" x)) params " ") + switches (mapconcat (lambda (x) (format "%s" x)) params " ") start nil end nil) (delete-region (match-beginning 0) (match-end 0)) (if (or (not file) === modified file 'lisp/org/org-html.el' --- lisp/org/org-html.el 2011-01-26 08:36:39 +0000 +++ lisp/org/org-html.el 2011-05-23 17:57:17 +0000 @@ -1090,74 +1090,74 @@ (push "
\n" thetoc) (push "
    \n
  • " thetoc) (setq lines - (mapcar '(lambda (line) - (if (and (string-match org-todo-line-regexp line) - (not (get-text-property 0 'org-protected line))) - ;; This is a headline - (progn - (setq have-headings t) - (setq level (- (match-end 1) (match-beginning 1) - level-offset) - level (org-tr-level level) - txt (save-match-data - (org-html-expand - (org-export-cleanup-toc-line - (match-string 3 line)))) - todo - (or (and org-export-mark-todo-in-toc - (match-beginning 2) - (not (member (match-string 2 line) - org-done-keywords))) + (mapcar (lambda (line) + (if (and (string-match org-todo-line-regexp line) + (not (get-text-property 0 'org-protected line))) + ;; This is a headline + (progn + (setq have-headings t) + (setq level (- (match-end 1) (match-beginning 1) + level-offset) + level (org-tr-level level) + txt (save-match-data + (org-html-expand + (org-export-cleanup-toc-line + (match-string 3 line)))) + todo + (or (and org-export-mark-todo-in-toc + (match-beginning 2) + (not (member (match-string 2 line) + org-done-keywords))) ; TODO, not DONE - (and org-export-mark-todo-in-toc - (= level umax-toc) - (org-search-todo-below - line lines level)))) - (if (string-match - (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt) - (setq txt (replace-match "    \\1" t nil txt))) - (if (string-match quote-re0 txt) - (setq txt (replace-match "" t t txt))) - (setq snumber (org-section-number level)) - (if org-export-with-section-numbers - (setq txt (concat snumber " " txt))) - (if (<= level (max umax umax-toc)) - (setq head-count (+ head-count 1))) - (if (<= level umax-toc) - (progn - (if (> level org-last-level) - (progn - (setq cnt (- level org-last-level)) - (while (>= (setq cnt (1- cnt)) 0) - (push "\n
      \n
    • " thetoc)) - (push "\n" thetoc))) - (if (< level org-last-level) - (progn - (setq cnt (- org-last-level level)) - (while (>= (setq cnt (1- cnt)) 0) - (push "
    • \n
    " thetoc)) - (push "\n" thetoc))) - ;; Check for targets - (while (string-match org-any-target-regexp line) - (setq line (replace-match - (concat "@" (match-string 1 line) "@ ") - t t line))) - (while (string-match "<\\(<\\)+\\|>\\(>\\)+" txt) - (setq txt (replace-match "" t t txt))) - (setq href - (replace-regexp-in-string - "\\." "_" (format "sec-%s" snumber))) - (setq href (or (cdr (assoc href org-export-preferred-target-alist)) href)) - (push - (format - (if todo - "
  • \n
  • %s" - "
  • \n
  • %s") - href txt) thetoc) + (and org-export-mark-todo-in-toc + (= level umax-toc) + (org-search-todo-below + line lines level)))) + (if (string-match + (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt) + (setq txt (replace-match "    \\1" t nil txt))) + (if (string-match quote-re0 txt) + (setq txt (replace-match "" t t txt))) + (setq snumber (org-section-number level)) + (if org-export-with-section-numbers + (setq txt (concat snumber " " txt))) + (if (<= level (max umax umax-toc)) + (setq head-count (+ head-count 1))) + (if (<= level umax-toc) + (progn + (if (> level org-last-level) + (progn + (setq cnt (- level org-last-level)) + (while (>= (setq cnt (1- cnt)) 0) + (push "\n
      \n
    • " thetoc)) + (push "\n" thetoc))) + (if (< level org-last-level) + (progn + (setq cnt (- org-last-level level)) + (while (>= (setq cnt (1- cnt)) 0) + (push "
    • \n
    " thetoc)) + (push "\n" thetoc))) + ;; Check for targets + (while (string-match org-any-target-regexp line) + (setq line (replace-match + (concat "@" (match-string 1 line) "@ ") + t t line))) + (while (string-match "<\\(<\\)+\\|>\\(>\\)+" txt) + (setq txt (replace-match "" t t txt))) + (setq href + (replace-regexp-in-string + "\\." "_" (format "sec-%s" snumber))) + (setq href (or (cdr (assoc href org-export-preferred-target-alist)) href)) + (push + (format + (if todo + "
  • \n
  • %s" + "
  • \n
  • %s") + href txt) thetoc) - (setq org-last-level level)) - ))) - line) + (setq org-last-level level)) + ))) + line) lines)) (while (> org-last-level (1- org-min-level)) (setq org-last-level (1- org-last-level)) === modified file 'lisp/org/org-mouse.el' --- lisp/org/org-mouse.el 2011-03-15 17:39:56 +0000 +++ lisp/org/org-mouse.el 2011-05-23 17:57:17 +0000 @@ -526,7 +526,7 @@ ("Check Tags" ,@(org-mouse-keyword-menu (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp) - '(lambda (tag) (org-tags-sparse-tree nil tag))) + (lambda (tag) (org-tags-sparse-tree nil tag))) "--" ["Custom Tag ..." org-tags-sparse-tree t]) ["Check Phrase ..." org-occur] @@ -537,18 +537,18 @@ ("Display Tags" ,@(org-mouse-keyword-menu (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp) - '(lambda (tag) (org-tags-view nil tag))) + (lambda (tag) (org-tags-view nil tag))) "--" ["Custom Tag ..." org-tags-view t]) ["Display Calendar" org-goto-calendar t] "--" ,@(org-mouse-keyword-menu (mapcar 'car org-agenda-custom-commands) - '(lambda (key) + (lambda (key) (eval `(flet ((read-char-exclusive () (string-to-char ,key))) (org-agenda nil)))) nil - '(lambda (key) + (lambda (key) (let ((entry (assoc key org-agenda-custom-commands))) (org-mouse-clip-text (cond @@ -832,7 +832,7 @@ ("Tags and Priorities" ,@(org-mouse-keyword-menu (org-mouse-priority-list) - '(lambda (keyword) + (lambda (keyword) (org-mouse-set-priority (string-to-char keyword))) priority "Priority %s") "--" @@ -905,7 +905,7 @@ (mouse-drag-region event))) (add-hook 'org-mode-hook - '(lambda () + (lambda () (setq org-mouse-context-menu-function 'org-mouse-context-menu) (when (memq 'context-menu org-mouse-features) @@ -1129,14 +1129,14 @@ ; (setq org-agenda-mode-hook nil) (add-hook 'org-agenda-mode-hook - '(lambda () + (lambda () (setq org-mouse-context-menu-function 'org-mouse-agenda-context-menu) (org-defkey org-agenda-mode-map [mouse-3] 'org-mouse-show-context-menu) (org-defkey org-agenda-mode-map [down-mouse-3] 'org-mouse-move-tree-start) (org-defkey org-agenda-mode-map [C-mouse-4] 'org-agenda-earlier) (org-defkey org-agenda-mode-map [C-mouse-5] 'org-agenda-later) (org-defkey org-agenda-mode-map [drag-mouse-3] - '(lambda (event) (interactive "e") + (lambda (event) (interactive "e") (case (org-mouse-get-gesture event) (:left (org-agenda-earlier 1)) (:right (org-agenda-later 1))))))) === modified file 'lisp/org/org-src.el' --- lisp/org/org-src.el 2011-03-15 17:39:56 +0000 +++ lisp/org/org-src.el 2011-05-23 17:57:17 +0000 @@ -674,7 +674,7 @@ (defun org-src-mode-configure-edit-buffer () (when (org-bound-and-true-p org-edit-src-from-org-mode) (org-add-hook 'kill-buffer-hook - '(lambda () (delete-overlay org-edit-src-overlay)) nil 'local) + (lambda () (delete-overlay org-edit-src-overlay)) nil 'local) (if (org-bound-and-true-p org-edit-src-allow-write-back-p) (progn (setq buffer-offer-save t) === modified file 'lisp/org/org.el' --- lisp/org/org.el 2011-05-10 13:57:12 +0000 +++ lisp/org/org.el 2011-05-23 17:57:17 +0000 @@ -1576,7 +1576,7 @@ (const :tag "no confirmation (dangerous)" nil))) (put 'org-confirm-shell-link-function 'safe-local-variable - '(lambda (x) (member x '(yes-or-no-p y-or-n-p)))) + (lambda (x) (member x '(yes-or-no-p y-or-n-p)))) (defcustom org-confirm-elisp-link-function 'yes-or-no-p "Non-nil means ask for confirmation before executing Emacs Lisp links. @@ -1596,7 +1596,7 @@ (const :tag "no confirmation (dangerous)" nil))) (put 'org-confirm-shell-link-function 'safe-local-variable - '(lambda (x) (member x '(yes-or-no-p y-or-n-p)))) + (lambda (x) (member x '(yes-or-no-p y-or-n-p)))) (defconst org-file-apps-defaults-gnu '((remote . emacs) @@ -2519,7 +2519,7 @@ and by using a prefix arg to `S-up/down' to specify the exact number of minutes to shift." :group 'org-time - :get '(lambda (var) ; Make sure both elements are there + :get (lambda (var) ; Make sure both elements are there (if (integerp (default-value var)) (list (default-value var) 5) (default-value var))) @@ -3021,7 +3021,7 @@ If the file does not specify a category, then file's base name is used instead.") (make-variable-buffer-local 'org-category) -(put 'org-category 'safe-local-variable '(lambda (x) (or (symbolp x) (stringp x)))) +(put 'org-category 'safe-local-variable (lambda (x) (or (symbolp x) (stringp x)))) (defcustom org-agenda-files nil "The files to be used for agenda display. === modified file 'lisp/play/fortune.el' --- lisp/play/fortune.el 2011-04-21 12:24:46 +0000 +++ lisp/play/fortune.el 2011-05-23 17:57:17 +0000 @@ -49,7 +49,7 @@ ;; I have also this in my .gnus: ;;(add-hook 'gnus-article-mode-hook -;; '(lambda () +;; (lambda () ;; (define-key gnus-article-mode-map "i" 'fortune-from-region))) ;; which allows marking a region and then pressing "i" so that the marked ;; region will be automatically added to my favourite fortune-file. === modified file 'lisp/progmodes/cperl-mode.el' --- lisp/progmodes/cperl-mode.el 2011-02-28 01:07:29 +0000 +++ lisp/progmodes/cperl-mode.el 2011-05-23 17:57:17 +0000 @@ -8594,10 +8594,10 @@ (pargs (cdr (car flist)))) (setq command (concat command " | " pcom " " - (mapconcat '(lambda (phrase) - (if (not (stringp phrase)) - (error "Malformed Man-filter-list")) - phrase) + (mapconcat (lambda (phrase) + (if (not (stringp phrase)) + (error "Malformed Man-filter-list")) + phrase) pargs " "))) (setq flist (cdr flist)))) command)) === modified file 'lisp/progmodes/f90.el' --- lisp/progmodes/f90.el 2011-05-19 06:18:58 +0000 +++ lisp/progmodes/f90.el 2011-05-23 17:57:17 +0000 @@ -78,9 +78,9 @@ ;; To customize f90-mode for your taste, use, for example: ;; (you don't have to specify values for all the parameters below) ;; -;;(add-hook 'f90-mode-hook -;; ;; These are the default values. -;; '(lambda () (setq f90-do-indent 3 +;; (add-hook 'f90-mode-hook +;; ;; These are the default values. +;; (lambda () (setq f90-do-indent 3 ;; f90-if-indent 3 ;; f90-type-indent 3 ;; f90-program-indent 2 === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/gdb-mi.el 2011-05-23 17:57:17 +0000 @@ -2539,7 +2539,7 @@ ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons. (define-key map "q" 'gdb-delete-frame-or-window) (define-key map "\r" 'gdb-goto-breakpoint) - (define-key map "\t" '(lambda () + (define-key map "\t" (lambda () (interactive) (gdb-set-window-buffer (gdb-get-buffer-create 'gdb-threads-buffer) t))) @@ -2626,7 +2626,7 @@ (define-key map "i" 'gdb-interrupt-thread) (define-key map "c" 'gdb-continue-thread) (define-key map "s" 'gdb-step-thread) - (define-key map "\t" '(lambda () + (define-key map "\t" (lambda () (interactive) (gdb-set-window-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer) t))) @@ -3582,7 +3582,7 @@ (let ((map (make-sparse-keymap))) (suppress-keymap map) (define-key map "q" 'kill-this-buffer) - (define-key map "\t" '(lambda () + (define-key map "\t" (lambda () (interactive) (gdb-set-window-buffer (gdb-get-buffer-create @@ -3670,7 +3670,7 @@ (define-key map "\r" 'gdb-edit-register-value) (define-key map [mouse-2] 'gdb-edit-register-value) (define-key map "q" 'kill-this-buffer) - (define-key map "\t" '(lambda () + (define-key map "\t" (lambda () (interactive) (gdb-set-window-buffer (gdb-get-buffer-create === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2011-05-05 06:35:41 +0000 +++ lisp/progmodes/gud.el 2011-05-23 17:57:17 +0000 @@ -116,11 +116,11 @@ (display-buffer-reuse-frames t)) (catch 'info-found (walk-windows - '(lambda (window) - (if (eq (window-buffer window) (get-buffer "*info*")) - (progn - (setq same-window-regexps nil) - (throw 'info-found nil)))) + (lambda (window) + (if (eq (window-buffer window) (get-buffer "*info*")) + (progn + (setq same-window-regexps nil) + (throw 'info-found nil)))) nil 0) (select-frame (make-frame))) (if (eq gud-minor-mode 'gdbmi) === modified file 'lisp/progmodes/idlw-help.el' --- lisp/progmodes/idlw-help.el 2011-02-10 16:56:00 +0000 +++ lisp/progmodes/idlw-help.el 2011-05-23 17:57:17 +0000 @@ -835,7 +835,7 @@ ((or idlwave-help-browser-is-local (string-match "w3" (symbol-name idlwave-help-browser-function))) - (idlwave-help-display-help-window '(lambda () (browse-url full-link)))) + (idlwave-help-display-help-window (lambda () (browse-url full-link)))) (t (browse-url full-link))))) === modified file 'lisp/progmodes/idlw-shell.el' --- lisp/progmodes/idlw-shell.el 2011-05-17 02:39:23 +0000 +++ lisp/progmodes/idlw-shell.el 2011-05-23 17:57:17 +0000 @@ -4243,15 +4243,15 @@ (define-key idlwave-shell-electric-debug-mode-map "_" 'idlwave-shell-stack-down) (define-key idlwave-shell-electric-debug-mode-map "e" - '(lambda () (interactive) (idlwave-shell-print '(16)))) + (lambda () (interactive) (idlwave-shell-print '(16)))) (define-key idlwave-shell-electric-debug-mode-map "q" 'idlwave-shell-retall) (define-key idlwave-shell-electric-debug-mode-map "t" - '(lambda () (interactive) (idlwave-shell-send-command "help,/TRACE"))) + (lambda () (interactive) (idlwave-shell-send-command "help,/TRACE"))) (define-key idlwave-shell-electric-debug-mode-map [(control ??)] 'idlwave-shell-electric-debug-help) (define-key idlwave-shell-electric-debug-mode-map "x" - '(lambda (arg) (interactive "P") - (idlwave-shell-print arg nil nil t))) + (lambda (arg) (interactive "P") + (idlwave-shell-print arg nil nil t))) ; Enter the prefix map in two places. === modified file 'lisp/progmodes/mixal-mode.el' --- lisp/progmodes/mixal-mode.el 2011-01-26 08:36:39 +0000 +++ lisp/progmodes/mixal-mode.el 2011-05-23 17:57:17 +0000 @@ -1059,8 +1059,7 @@ (let* ((completion-ignore-case t) ;; we already have a list, but it is not in the right format ;; transform it to a valid table so completition can use it - (table (mapcar '(lambda (elm) - (cons (symbol-name (car elm)) nil)) + (table (mapcar (lambda (elm) (cons (symbol-name (car elm)) nil)) mixal-operation-codes-alist)) ;; prompt is different depending on we are close to a valid op-code (have-default (assq (intern-soft (current-word)) === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2011-05-17 02:26:56 +0000 +++ lisp/progmodes/python.el 2011-05-23 17:57:17 +0000 @@ -2380,7 +2380,7 @@ (features (cons 'python-mode features))) ; and requires this (brm-init) ; second line of normal recipe (remove-hook 'python-mode-hook ; undo this from `brm-init' - '(lambda () (easy-menu-add brm-menu))) + (lambda () (easy-menu-add brm-menu))) (easy-menu-define python-brm-menu python-mode-map "Bicycle Repair Man" === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/sql.el 2011-05-23 17:57:17 +0000 @@ -1207,13 +1207,13 @@ (mapc ;; In Emacs 22+, provide SYSTEM-FLAG to define-abbrev. - '(lambda (abbrev) - (let ((name (car abbrev)) - (expansion (cdr abbrev))) - (condition-case nil - (define-abbrev sql-mode-abbrev-table name expansion nil 0 t) - (error - (define-abbrev sql-mode-abbrev-table name expansion))))) + (lambda (abbrev) + (let ((name (car abbrev)) + (expansion (cdr abbrev))) + (condition-case nil + (define-abbrev sql-mode-abbrev-table name expansion nil 0 t) + (error + (define-abbrev sql-mode-abbrev-table name expansion))))) '(("ins" . "insert") ("upd" . "update") ("del" . "delete") === modified file 'lisp/progmodes/verilog-mode.el' --- lisp/progmodes/verilog-mode.el 2011-01-25 04:08:28 +0000 +++ lisp/progmodes/verilog-mode.el 2011-05-23 17:57:17 +0000 @@ -4586,7 +4586,7 @@ (verilog-mode)))) (buffer-list)) ;; Process the files - (mapcar '(lambda (buf) + (mapcar (lambda (buf) (when (buffer-file-name buf) (save-excursion (if (not (file-exists-p (buffer-file-name buf))) @@ -6373,7 +6373,7 @@ (defun verilog-keyword-completion (keyword-list) "Give list of all possible completions of keywords in KEYWORD-LIST." - (mapcar '(lambda (s) + (mapcar (lambda (s) (if (string-match (concat "\\<" verilog-str) s) (if (or (null verilog-pred) (funcall verilog-pred s)) @@ -6493,7 +6493,7 @@ (all-completions verilog-str 'verilog-completion))) (match (if verilog-toggle-completions "" (try-completion - verilog-str (mapcar '(lambda (elm) + verilog-str (mapcar (lambda (elm) (cons elm 0)) allcomp))))) ;; Delete old string (delete-region b e) @@ -11447,13 +11447,13 @@ (verilog-auto-re-search-do "/\\*AUTOINOUTCOMP([^)]*)\\*/" 'verilog-auto-inout-comp) ;; next in/outs which need previous sucked inputs first (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\((\"[^\"]*\")\\)\\*/" - '(lambda () (verilog-auto-output t))) + (lambda () (verilog-auto-output t))) (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\*/" 'verilog-auto-output) (verilog-auto-re-search-do "/\\*AUTOINPUT\\((\"[^\"]*\")\\)\\*/" - '(lambda () (verilog-auto-input t))) + (lambda () (verilog-auto-input t))) (verilog-auto-re-search-do "/\\*AUTOINPUT\\*/" 'verilog-auto-input) (verilog-auto-re-search-do "/\\*AUTOINOUT\\((\"[^\"]*\")\\)\\*/" - '(lambda () (verilog-auto-inout t))) + (lambda () (verilog-auto-inout t))) (verilog-auto-re-search-do "/\\*AUTOINOUT\\*/" 'verilog-auto-inout) ;; Then tie off those in/outs (verilog-auto-re-search-do "/\\*AUTOTIEOFF\\*/" 'verilog-auto-tieoff) === modified file 'lisp/ps-print.el' --- lisp/ps-print.el 2011-04-19 13:44:55 +0000 +++ lisp/ps-print.el 2011-05-23 17:57:17 +0000 @@ -975,7 +975,7 @@ ;; (setq ps-font-info-database '( )) ;; or, use `ps-print-hook' (see section Hooks): ;; (add-hook 'ps-print-hook -;; '(lambda () +;; (lambda () ;; (or (assq 'Helvetica ps-font-info-database) ;; (setq ps-font-info-database (append ...))))) ;; === modified file 'lisp/term.el' --- lisp/term.el 2011-02-17 05:13:17 +0000 +++ lisp/term.el 2011-05-23 17:57:17 +0000 @@ -4254,8 +4254,8 @@ (setq x (sort (copy-sequence serial-speed-history) - '(lambda (a b) (when (and (stringp a) (stringp b)) - (> (string-to-number a) (string-to-number b)))))) + (lambda (a b) (when (and (stringp a) (stringp b)) + (> (string-to-number a) (string-to-number b)))))) (dolist (i x) (when (not (equal i (car y))) (push i y))) y)) === modified file 'lisp/terminal.el' --- lisp/terminal.el 2011-04-19 13:44:55 +0000 +++ lisp/terminal.el 2011-05-23 17:57:17 +0000 @@ -105,8 +105,8 @@ (define-key map [t] 'te-pass-through) (define-key map [switch-frame] 'handle-switch-frame) (define-key map "\e" terminal-meta-map) - ;(define-key map "\C-l" - ; '(lambda () (interactive) (te-pass-through) (redraw-display))) + ;;(define-key map "\C-l" + ;; (lambda () (interactive) (te-pass-through) (redraw-display))) (setq terminal-map map))) (defvar terminal-escape-map nil) === modified file 'lisp/textmodes/flyspell.el' --- lisp/textmodes/flyspell.el 2011-04-03 20:59:45 +0000 +++ lisp/textmodes/flyspell.el 2011-05-23 17:57:17 +0000 @@ -296,7 +296,7 @@ ;;* using flyspell with mail-mode add the following expression */ ;;* in your .emacs file: */ ;;* (add-hook 'mail-mode */ -;;* '(lambda () (setq flyspell-generic-check-word-predicate */ +;;* (lambda () (setq flyspell-generic-check-word-predicate */ ;;* 'mail-mode-flyspell-verify))) */ ;;*---------------------------------------------------------------------*/ (defvar flyspell-generic-check-word-predicate nil === modified file 'lisp/thumbs.el' --- lisp/thumbs.el 2011-01-25 04:08:28 +0000 +++ lisp/thumbs.el 2011-05-23 17:57:17 +0000 @@ -226,7 +226,7 @@ (let ((fattribs-list (file-attributes f))) `(,(nth 4 fattribs-list) ,(nth 7 fattribs-list) ,f))) (directory-files (thumbs-thumbsdir) t (image-file-name-regexp))) - '(lambda (l1 l2) (time-less-p (car l1) (car l2))))) + (lambda (l1 l2) (time-less-p (car l1) (car l2))))) (dirsize (apply '+ (mapcar (lambda (x) (cadr x)) files-list)))) (while (> dirsize thumbs-thumbsdir-max-size) (progn === modified file 'lisp/vc/add-log.el' --- lisp/vc/add-log.el 2011-05-14 23:58:25 +0000 +++ lisp/vc/add-log.el 2011-05-23 17:57:17 +0000 @@ -578,7 +578,7 @@ If nil, use local time. If t, use universal time.") (put 'add-log-time-zone-rule 'safe-local-variable - '(lambda (x) (or (booleanp x) (stringp x)))) + (lambda (x) (or (booleanp x) (stringp x)))) (defun add-log-iso8601-time-zone (&optional time) (let* ((utc-offset (or (car (current-time-zone time)) 0)) @@ -1051,8 +1051,8 @@ (set (make-local-variable 'fill-indent-according-to-mode) t) ;; Avoid that filling leaves behind a single "*" on a line. (add-hook 'fill-nobreak-predicate - '(lambda () - (looking-back "^\\s *\\*\\s *" (line-beginning-position))) + (lambda () + (looking-back "^\\s *\\*\\s *" (line-beginning-position))) nil t) (set (make-local-variable 'indent-line-function) 'change-log-indent) (set (make-local-variable 'tab-always-indent) nil) === modified file 'lisp/vc/ediff-diff.el' --- lisp/vc/ediff-diff.el 2011-01-26 08:36:39 +0000 +++ lisp/vc/ediff-diff.el 2011-05-23 17:57:17 +0000 @@ -50,7 +50,7 @@ ;; The following functions must precede all defcustom-defined variables. -(fset 'ediff-set-actual-diff-options '(lambda () nil)) +(fset 'ediff-set-actual-diff-options (lambda () nil)) (defcustom ediff-shell (cond ((memq system-type '(ms-dos windows-nt)) === modified file 'lisp/vc/ediff-util.el' --- lisp/vc/ediff-util.el 2011-01-26 08:36:39 +0000 +++ lisp/vc/ediff-util.el 2011-05-23 17:57:17 +0000 @@ -1682,7 +1682,7 @@ 'ediff-get-lines-to-region-start) ((eq op 'scroll-up) 'ediff-get-lines-to-region-end) - (t '(lambda (a b c) 0)))) + (t (lambda (a b c) 0)))) (max-lines (max (funcall func 'A n ctl-buf) (funcall func 'B n ctl-buf) (if (ediff-buffer-live-p ediff-buffer-C) ------------------------------------------------------------ revno: 104331 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8710 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-05-23 14:03:03 -0300 message: * lisp/vc/smerge-mode.el (smerge-refine-subst): Don't deactivate the mark. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-23 16:40:16 +0000 +++ lisp/ChangeLog 2011-05-23 17:03:03 +0000 @@ -1,5 +1,8 @@ 2011-05-23 Stefan Monnier + * vc/smerge-mode.el (smerge-refine-subst): Don't deactivate the mark + (bug#8710). + * emacs-lisp/lisp.el (up-list): Fix forward movement (bug#8708). 2011-05-23 Ken Manheimer === modified file 'lisp/vc/smerge-mode.el' --- lisp/vc/smerge-mode.el 2011-05-12 07:07:06 +0000 +++ lisp/vc/smerge-mode.el 2011-05-23 17:03:03 +0000 @@ -991,6 +991,7 @@ used to replace chars to try and eliminate some spurious differences." (let* ((buf (current-buffer)) (pos (point)) + deactivate-mark ; The code does not modify any visible buffer. (file1 (make-temp-file "diff1")) (file2 (make-temp-file "diff2"))) ;; Chop up regions into smaller elements and save into files. ------------------------------------------------------------ revno: 104330 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8708 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-05-23 13:40:16 -0300 message: * lisp/emacs-lisp/lisp.el (up-list): Fix forward movement. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-23 15:03:04 +0000 +++ lisp/ChangeLog 2011-05-23 16:40:16 +0000 @@ -1,3 +1,7 @@ +2011-05-23 Stefan Monnier + + * emacs-lisp/lisp.el (up-list): Fix forward movement (bug#8708). + 2011-05-23 Ken Manheimer * allout.el (allout-inhibit-auto-fill-on-headline): Create new === modified file 'lisp/emacs-lisp/lisp.el' --- lisp/emacs-lisp/lisp.el 2011-05-12 07:07:06 +0000 +++ lisp/emacs-lisp/lisp.el 2011-05-23 16:40:16 +0000 @@ -145,12 +145,12 @@ (while (/= arg 0) (if (null forward-sexp-function) (goto-char (or (scan-lists (point) inc 1) (buffer-end arg))) - (condition-case err - (while (progn (setq pos (point)) - (forward-sexp inc) - (/= (point) pos))) - (scan-error (goto-char (nth 2 err)))) - (if (= (point) pos) + (condition-case err + (while (progn (setq pos (point)) + (forward-sexp inc) + (/= (point) pos))) + (scan-error (goto-char (nth (if (> arg 0) 3 2) err)))) + (if (= (point) pos) (signal 'scan-error (list "Unbalanced parentheses" (point) (point))))) (setq arg (- arg inc))))) ------------------------------------------------------------ revno: 104329 committer: Ken Manheimer branch nick: trunk timestamp: Mon 2011-05-23 11:03:04 -0400 message: * allout.el (allout-inhibit-auto-fill-on-headline): Create new customization variable and implement: If non-nil, auto-fill will be inhibited while on topic's header line. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-23 14:46:41 +0000 +++ lisp/ChangeLog 2011-05-23 15:03:04 +0000 @@ -1,3 +1,9 @@ +2011-05-23 Ken Manheimer + + * allout.el (allout-inhibit-auto-fill-on-headline): Create new + customization variable and implement: If non-nil, auto-fill will + be inhibited while on topic's header line. + 2011-05-23 Vincent Belaïche * play/5x5.el: I/ Add an arithmetic solver to suggest positions to === modified file 'lisp/allout.el' --- lisp/allout.el 2011-05-14 20:11:34 +0000 +++ lisp/allout.el 2011-05-23 15:03:04 +0000 @@ -399,6 +399,12 @@ :type 'boolean :group 'allout) (make-variable-buffer-local 'allout-inhibit-auto-fill) +;;;_ = allout-inhibit-auto-fill-on-headline +(defcustom allout-inhibit-auto-fill-on-headline nil + "If non-nil, auto-fill will be inhibited while on topic's header line." + :type 'boolean + :group 'allout) +(make-variable-buffer-local 'allout-inhibit-auto-fill-on-headline) ;;;_ = allout-use-hanging-indents (defcustom allout-use-hanging-indents t "If non-nil, topic body text auto-indent defaults to indent of the header. @@ -3848,7 +3854,9 @@ Maintains outline hanging topic indentation if `allout-use-hanging-indents' is set." - (when (not allout-inhibit-auto-fill) + (when (and (not allout-inhibit-auto-fill) + (or (not allout-inhibit-auto-fill-on-headline) + (not (allout-on-current-heading-p)))) (let ((fill-prefix (if allout-use-hanging-indents ;; Check for topic header indentation: (save-match-data ------------------------------------------------------------ revno: 104328 author: Vincent Belaïche committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-05-23 11:46:41 -0300 message: * lisp/play/5x5.el: I/ Add an arithmetic solver to suggest positions to click on. II/ Make 5x5 multisession. III/ Ensure that random grids always have a solution in grid size = 5 cases. (5x5-mode-map): Add keybinding to function `5x5-solve-suggest'. (5x5-solver-output, 5x5-log-buffer): New vars. (5x5-grid, 5x5-x-pos, 5x5-y-pos, 5x5-moves, 5x5-cracking): Make these variables buffer local to achieve 5x5 multi-session-ness. (5x5): Set 5x5-grid-size only if SIZE is non-negative. (5x5-grid-to-vec, 5x5-vec-to-grid, 5x5-log-init, 5x5-log, 5x5-solver) (5x5-solve-suggest): New funs. (5x5-randomize): Use 5x5-make-move instead of 5x5-flip-cell to randomize a grid so that we ensure that there is always a solution. (5x5-make-random-grid): Allow other movement than flipping. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-23 14:38:28 +0000 +++ lisp/ChangeLog 2011-05-23 14:46:41 +0000 @@ -1,3 +1,19 @@ +2011-05-23 Vincent Belaïche + + * play/5x5.el: I/ Add an arithmetic solver to suggest positions to + click on. II/ Make 5x5 multisession. III/ Ensure that random grids + always have a solution in grid size = 5 cases. + (5x5-mode-map): Add keybinding to function `5x5-solve-suggest'. + (5x5-solver-output, 5x5-log-buffer): New vars. + (5x5-grid, 5x5-x-pos, 5x5-y-pos, 5x5-moves, 5x5-cracking): + Make these variables buffer local to achieve 5x5 multi-session-ness. + (5x5): Set 5x5-grid-size only if SIZE is non-negative. + (5x5-grid-to-vec, 5x5-vec-to-grid, 5x5-log-init, 5x5-log, 5x5-solver) + (5x5-solve-suggest): New funs. + (5x5-randomize): Use 5x5-make-move instead of 5x5-flip-cell to + randomize a grid so that we ensure that there is always a solution. + (5x5-make-random-grid): Allow other movement than flipping. + 2011-05-23 Kevin Ryde * emacs-lisp/advice.el (ad-read-advised-function): === modified file 'lisp/play/5x5.el' --- lisp/play/5x5.el 2011-04-21 12:24:46 +0000 +++ lisp/play/5x5.el 2011-05-23 14:46:41 +0000 @@ -1,4 +1,4 @@ -;;; 5x5.el --- simple little puzzle game +;;; 5x5.el --- simple little puzzle game -*- coding: utf-8 -*- ;; Copyright (C) 1999-2011 Free Software Foundation, Inc. @@ -24,15 +24,15 @@ ;;; Commentary: -;; The aim of 5x5 is to fill in all the squares. If you need any more of an +;; The aim of 5x5 is to fill in all the squares. If you need any more of an ;; explanation you probably shouldn't play the game. ;;; TODO: -;; o The code for updating the grid needs to be re-done. At the moment it +;; o The code for updating the grid needs to be re-done. At the moment it ;; simply re-draws the grid every time a move is made. ;; -;; o Look into tarting up the display with color. gamegrid.el looks +;; o Look into tarting up the display with color. gamegrid.el looks ;; interesting, perhaps that is the way to go? ;;; Thanks: @@ -41,7 +41,10 @@ ;; emacs mode. ;; ;; Pascal Q. Porcupine for inspiring the animated -;; solver. +;; cracker. +;; +;; Vincent Belaïche & Jay P. Belanger +;; for the math solver. ;;; Code: @@ -89,19 +92,25 @@ ;; Non-customize variables. -(defvar 5x5-grid nil +(defmacro 5x5-defvar-local (var value doc) + "Define VAR to VALUE with documentation DOC and make it buffer local." + `(progn + (defvar ,var ,value ,doc) + (make-variable-buffer-local (quote ,var)))) + +(5x5-defvar-local 5x5-grid nil "5x5 grid contents.") -(defvar 5x5-x-pos 2 +(5x5-defvar-local 5x5-x-pos 2 "X position of cursor.") -(defvar 5x5-y-pos 2 +(5x5-defvar-local 5x5-y-pos 2 "Y position of cursor.") -(defvar 5x5-moves 0 +(5x5-defvar-local 5x5-moves 0 "Moves made.") -(defvar 5x5-cracking nil +(5x5-defvar-local 5x5-cracking nil "Are we in cracking mode?") (defvar 5x5-buffer-name "*5x5*" @@ -134,10 +143,28 @@ (define-key map [(control c) (control b)] #'5x5-crack-mutating-best) (define-key map [(control c) (control x)] #'5x5-crack-xor-mutate) (define-key map "n" #'5x5-new-game) + (define-key map "s" #'5x5-solve-suggest) (define-key map "q" #'5x5-quit-game) map) "Local keymap for the 5x5 game.") +(5x5-defvar-local 5x5-solver-output nil + "List that is is the output of artihmetic solver. + +This list L is such that + +L = (M S_1 S_2 ... S_N) + +M is the move count when the solve output was stored. + +S_1 ... S_N are all the solutions ordered from least to greatest +number of strokes. S_1 is the solution to be displayed. + +Each solution S_1, ..., S_N is a a list (STROKE-COUNT GRID) where +STROKE-COUNT is to number of strokes to achieve the solution and +GRID is the grid of positions to click.") + + ;; Menu definition. (easy-menu-define 5x5-mode-menu 5x5-mode-map "5x5 menu." @@ -146,6 +173,7 @@ ["Random game" 5x5-randomize t] ["Quit game" 5x5-quit-game t] "---" + ["Use Calc solver" 5x5-solve-suggest t] ["Crack randomly" 5x5-crack-randomly t] ["Crack mutating current" 5x5-crack-mutating-current t] ["Crack mutating best" 5x5-crack-mutating-best t] @@ -158,7 +186,7 @@ (defun 5x5-mode () "A mode for playing `5x5'. -The key bindings for 5x5-mode are: +The key bindings for `5x5-mode' are: \\{5x5-mode-map}" (kill-all-local-variables) @@ -194,14 +222,14 @@ (interactive "P") (setq 5x5-cracking nil) - (when size - (setq 5x5-grid-size size)) (switch-to-buffer 5x5-buffer-name) + (5x5-mode) + (when (natnump size) + (setq 5x5-grid-size size)) (if (or (not 5x5-grid) (not (= 5x5-grid-size (length (aref 5x5-grid 0))))) (5x5-new-game)) (5x5-draw-grid (list 5x5-grid)) - (5x5-position-cursor) - (5x5-mode)) + (5x5-position-cursor)) (defun 5x5-new-game () "Start a new game of `5x5'." @@ -277,10 +305,11 @@ (defun 5x5-draw-grid (grids) "Draw the grids GRIDS into the current buffer." - (let ((buffer-read-only nil)) + (let ((inhibit-read-only t) grid-org) (erase-buffer) (loop for grid in grids do (5x5-draw-grid-end)) (insert "\n") + (setq grid-org (point)) (loop for y from 0 to (1- 5x5-grid-size) do (loop for lines from 0 to (1- 5x5-y-scale) do (loop for grid in grids do @@ -290,6 +319,23 @@ (if (5x5-cell grid y x) ?# ?.)))) (insert " | ")) (insert "\n"))) + (when 5x5-solver-output + (if (= (car 5x5-solver-output) 5x5-moves) + (save-excursion + (goto-char grid-org) + (beginning-of-line (+ 1 (/ 5x5-y-scale 2))) + (let ((solution-grid (cdadr 5x5-solver-output))) + (dotimes (y 5x5-grid-size) + (save-excursion + (forward-char (+ 1 (/ (1+ 5x5-x-scale) 2))) + (dotimes (x 5x5-grid-size) + (when (5x5-cell solution-grid y x) + (insert-char ?O 1) + (delete-char 1) + (backward-char)) + (forward-char (1+ 5x5-x-scale)))) + (forward-line 5x5-y-scale)))) + (setq 5x5-solver-output nil))) (loop for grid in grids do (5x5-draw-grid-end)) (insert "\n") (insert (format "On: %d Moves: %d" (5x5-grid-value (car grids)) 5x5-moves)))) @@ -304,13 +350,14 @@ "Keep track of how many moves have been made." (incf 5x5-moves)) -(defun 5x5-make-random-grid () +(defun 5x5-make-random-grid (&optional move) "Make a random grid." + (setq move (or move (symbol-function '5x5-flip-cell))) (let ((grid (5x5-make-new-grid))) (loop for y from 0 to (1- 5x5-grid-size) do (loop for x from 0 to (1- 5x5-grid-size) do (if (zerop (random 2)) - (5x5-flip-cell grid y x)))) + (funcall move grid y x)))) grid)) ;; Cracker functions. @@ -415,6 +462,312 @@ (sit-for 5x5-animate-delay)))) 5x5-grid) +;; Arithmetic solver +;;=========================================================================== +(defun 5x5-grid-to-vec (grid) + "Convert GRID to an equivalent Calc matrix of (mod X 2) forms +where X is 1 for setting a position, and 0 for unsetting a +position." + (cons 'vec + (mapcar (lambda (y) + (cons 'vec + (mapcar (lambda (x) + (if x '(mod 1 2) '(mod 0 2))) + y))) + grid))) + +(defun 5x5-vec-to-grid (grid-matrix) + "Convert a grid matrix GRID-MATRIX in Calc format to a grid in +5x5 format. See function `5x5-grid-to-vec'." + (apply + 'vector + (mapcar + (lambda (x) + (apply + 'vector + (mapcar + (lambda (y) (/= (cadr y) 0)) + (cdr x)))) + (cdr grid-matrix)))) + +(if nil; set to t to enable solver logging + (progn + (defvar 5x5-log-buffer nil) + (defun 5x5-log-init () + (if (buffer-live-p 5x5-log-buffer) + (with-current-buffer 5x5-log-buffer (erase-buffer)) + (setq 5x5-log-buffer (get-buffer-create "*5x5 LOG*")))) + + (defun 5x5-log (name value) + "Debug purpuse only. + +Log a matrix VALUE of (mod B 2) forms, only B is output and +Scilab matrix notation is used. VALUE is returned so that it is +easy to log a value with minimal rewrite of code." + (when (buffer-live-p 5x5-log-buffer) + (let* ((unpacked-value + (math-map-vec + (lambda (row) (math-map-vec 'cadr row)) + value)) + (calc-vector-commas "") + (calc-matrix-brackets '(C O)) + (value-to-log (math-format-value unpacked-value))) + (with-current-buffer 5x5-log-buffer + (insert name ?= value-to-log ?\n)))) + value)) + (defmacro 5x5-log-init ()) + (defmacro 5x5-log (name value) value)) + +(defun 5x5-solver (grid) + "Return a list of solutions for GRID. + +Given some grid GRID, the returned a list of solution LIST is +sorted from least Hamming weight to geatest one. + + LIST = (SOLUTION-1 ... SOLUTION-N) + +Each solution SOLUTION-I is a cons cell (HW . G) where HW is the +Hamming weight of the solution --- ie the number of strokes to +achieves it --- and G is the grid of positions to click in order +to complete the 5x5. + +Solutions are sorted from least to greatest Hamming weight." + (require 'calc-ext) + (flet ((5x5-mat-mode-2 + (a) + (math-map-vec + (lambda (y) + (math-map-vec + (lambda (x) `(mod ,x 2)) + y)) + a))) + (let* (calc-command-flags + (grid-size-squared (* 5x5-grid-size 5x5-grid-size)) + + ;; targetv is the vector the origine of which is org="current + ;; grid" and the end of which is dest="all ones". + (targetv + (5x5-log + "b" + (let ( + ;; org point is the current grid + (org (calcFunc-arrange (5x5-grid-to-vec grid) + 1)) + + ;; end point of game is the all ones matrix + (dest (calcFunc-cvec '(mod 1 2) grid-size-squared 1))) + (math-sub dest org)))) + + ;; transferm is the transfer matrix, ie it is the 25x25 + ;; matrix applied everytime a flip is carried out where a + ;; flip is defined by a 25x1 Dirac vector --- ie all zeros + ;; but 1 in the position that is flipped. + (transferm + (5x5-log + "a" + ;; transfer-grid is not a play grid, but this is the + ;; transfer matrix in the format of a vector of vectors, we + ;; do it this way because random access in vectors is + ;; faster. The motivation is just speed as we build it + ;; element by element, but that could have been created + ;; using only Calc primitives. Probably that would be a + ;; better idea to use Calc with some vector manipulation + ;; rather than going this way... + (5x5-grid-to-vec (let ((transfer-grid + (let ((5x5-grid-size grid-size-squared)) + (5x5-make-new-grid)))) + (dotimes (i 5x5-grid-size) + (dotimes (j 5x5-grid-size) + ;; k0 = flattened flip position corresponding + ;; to (i, j) on the grid. + (let* ((k0 (+ (* 5 i) j))) + ;; cross center + (5x5-set-cell transfer-grid k0 k0 t) + ;; Cross top. + (and + (> i 0) + (5x5-set-cell transfer-grid + (- k0 5x5-grid-size) k0 t)) + ;; Cross bottom. + (and + (< (1+ i) 5x5-grid-size) + (5x5-set-cell transfer-grid + (+ k0 5x5-grid-size) k0 t)) + ;; Cross left. + (and + (> j 0) + (5x5-set-cell transfer-grid (1- k0) k0 t)) + ;; Cross right. + (and + (< (1+ j) 5x5-grid-size) + (5x5-set-cell transfer-grid + (1+ k0) k0 t))))) + transfer-grid)))) + ;; TODO: this is hard-coded for grid-size = 5, make it generic. + (transferm-kernel-size + (if (= 5x5-grid-size 5) 2 + (error "Transfer matrix rank not known for grid-size != 5"))) + + ;; TODO: this is hard-coded for grid-size = 5, make it generic. + ;; + ;; base-change is a 25x25 matrix, where topleft submatrix + ;; 23x25 is a diagonal of 1, and the two last columns are a + ;; base of kernel of transferm. + ;; + ;; base-change must be by construction inversible. + (base-change + (5x5-log + "p" + (let ((id (5x5-mat-mode-2 (calcFunc-diag 1 grid-size-squared)))) + (setcdr (last id (1+ transferm-kernel-size)) + (cdr (5x5-mat-mode-2 + '(vec (vec 0 1 1 1 0 1 0 1 0 1 1 1 0 1 + 1 1 0 1 0 1 0 1 1 1 0) + (vec 1 1 0 1 1 0 0 0 0 0 1 1 0 1 + 1 0 0 0 0 0 1 1 0 1 1))))) + (calcFunc-trn id)))) + + (inv-base-change + (5x5-log "invp" + (calcFunc-inv base-change))) + + ;; B:= targetv + ;; A:= transferm + ;; P:= base-change + ;; P^-1 := inv-base-change + ;; X := solution + + ;; B = A * X + ;; P^-1 * B = P^-1 * A * P * P^-1 * X + ;; CX = P^-1 * X + ;; CA = P^-1 * A * P + ;; CB = P^-1 * B + ;; CB = CA * CX + ;; CX = CA^-1 * CB + ;; X = P * CX + (ctransferm + (5x5-log + "ca" + (math-mul + inv-base-change + (math-mul transferm base-change)))); CA + (ctarget + (5x5-log + "cb" + (math-mul inv-base-change targetv))); CB + (row-1 (math-make-intv 3 1 transferm-kernel-size)) ; 1..2 + (row-2 (math-make-intv 1 transferm-kernel-size + grid-size-squared)); 3..25 + (col-1 (math-make-intv 3 1 (- grid-size-squared + transferm-kernel-size))); 1..23 + (col-2 (math-make-intv 1 (- grid-size-squared + transferm-kernel-size) + grid-size-squared)); 24..25 + (ctransferm-1-: (calcFunc-mrow ctransferm row-1)) + (ctransferm-1-1 (calcFunc-mcol ctransferm-1-: col-1)) + + ;; By construction ctransferm-:-2 = 0, so ctransferm-1-2 = 0 + ;; and ctransferm-2-2 = 0. + + ;;(ctransferm-1-2 (calcFunc-mcol ctransferm-1-: col-2)) + (ctransferm-2-: (calcFunc-mrow ctransferm row-2)) + (ctransferm-2-1 + (5x5-log + "ca_2_1" + (calcFunc-mcol ctransferm-2-: col-1))) + + ;; By construction ctransferm-2-2 = 0. + ;; + ;;(ctransferm-2-2 (calcFunc-mcol ctransferm-2-: col-2)) + + (ctarget-1 (calcFunc-mrow ctarget row-1)) + (ctarget-2 (calcFunc-mrow ctarget row-2)) + + ;; ctarget-1(2x1) = ctransferm-1-1(2x23) *cx-1(23x1) + ;; + ctransferm-1-2(2x2) *cx-2(2x1); + ;; ctarget-2(23x1) = ctransferm-2-1(23x23)*cx-1(23x1) + ;; + ctransferm-2-2(23x2)*cx-2(2x1); + ;; By construction: + ;; + ;; ctransferm-1-2 == zeros(2,2) and ctransferm-2-2 == zeros(23,2) + ;; + ;; So: + ;; + ;; ctarget-2 = ctransferm-2-1*cx-1 + ;; + ;; So: + ;; + ;; cx-1 = inv-ctransferm-2-1 * ctarget-2 + (cx-1 (math-mul (calcFunc-inv ctransferm-2-1) ctarget-2)) + + ;; Any cx-2 can do, so there are 2^{transferm-kernel-size} solutions. + (solution-list + ;; Within solution-list each element is a cons cell: + ;; + ;; (HW . SOL) + ;; + ;; where HW is the Hamming weight of solution, and SOL is + ;; the solution in the form of a grid. + (sort + (cdr + (math-map-vec + (lambda (cx-2) + ;; Compute `solution' in the form of a 25x1 matrix of + ;; (mod B 2) forms --- with B = 0 or 1 --- and + ;; return (HW . SOL) where HW is the Hamming weight + ;; of solution and SOL a grid. + (let ((solution (math-mul + base-change + (calcFunc-vconcat cx-1 cx-2)))); X = P * CX + (cons + ;; The Hamming Weight is computed by matrix reduction + ;; with an ad-hoc operator. + (math-reduce-vec + ;; (cadadr '(vec (mod x 2))) => x + (lambda (r x) (+ (if (integerp r) r (cadadr r)) + (cadadr x))) + solution); car + (5x5-vec-to-grid + (calcFunc-arrange solution 5x5-grid-size));cdr + ))) + ;; A (2^K) x K matrix, where K is the dimension of kernel + ;; of transfer matrix --- i.e. K=2 in if the grid is 5x5 + ;; --- for I from 0 to K-1, each row rI correspond to the + ;; binary representation of number I, that is to say row + ;; rI is a 1xK vector: + ;; [ n{I,0} n{I,1} ... n{I,K-1} ] + ;; such that: + ;; I = sum for J=0..K-1 of 2^(n{I,J}) + (let ((calc-number-radix 2) + (calc-leading-zeros t) + (calc-word-size transferm-kernel-size)) + (math-map-vec + (lambda (x) + (cons 'vec + (mapcar (lambda (x) `(vec (mod ,(logand x 1) 2))) + (substring (math-format-number x) + (- transferm-kernel-size))))) + (calcFunc-index (math-pow 2 transferm-kernel-size) 0))) )) + ;; Sort solutions according to respective Hamming weight. + (lambda (x y) (< (car x) (car y))) + ))) + (message "5x5 Solution computation done.") + solution-list))) + +(defun 5x5-solve-suggest (&optional n) + "Suggest to the user where to click. + +Argument N is ignored." + ;; For the time being n is ignored, the idea was to use some numeric + ;; argument to show a limited amount of positions. + (interactive "P") + (5x5-log-init) + (let ((solutions (5x5-solver 5x5-grid))) + (setq 5x5-solver-output + (cons 5x5-moves solutions))) + (5x5-draw-grid (list 5x5-grid)) + (5x5-position-cursor)) + ;; Keyboard response functions. (defun 5x5-flip-current () @@ -490,7 +843,7 @@ (setq 5x5-x-pos (/ 5x5-grid-size 2) 5x5-y-pos (/ 5x5-grid-size 2) 5x5-moves 0 - 5x5-grid (5x5-make-random-grid)) + 5x5-grid (5x5-make-random-grid (symbol-function '5x5-make-move))) (unless 5x5-cracking (5x5-draw-grid (list 5x5-grid))) (5x5-position-cursor))) ------------------------------------------------------------ revno: 104327 author: Kevin Ryde committer: Stefan Monnier branch nick: trunk timestamp: Mon 2011-05-23 11:38:28 -0300 message: * lisp/emacs-lisp/advice.el (ad-read-advised-function): Use `function-called-at-point' as the default default, if it has advice and passes PREDICATE. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-23 01:15:17 +0000 +++ lisp/ChangeLog 2011-05-23 14:38:28 +0000 @@ -1,3 +1,9 @@ +2011-05-23 Kevin Ryde + + * emacs-lisp/advice.el (ad-read-advised-function): + Use `function-called-at-point' as the default default, if it has + advice and passes PREDICATE. + 2011-05-23 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-function-form): Only call === modified file 'lisp/emacs-lisp/advice.el' --- lisp/emacs-lisp/advice.el 2011-04-13 17:56:47 +0000 +++ lisp/emacs-lisp/advice.el 2011-05-23 14:38:28 +0000 @@ -2135,16 +2135,27 @@ ;; @@ Interactive input functions: ;; =============================== +(declare-function 'function-called-at-point "help") + (defun ad-read-advised-function (&optional prompt predicate default) "Read name of advised function with completion from the minibuffer. An optional PROMPT will be used to prompt for the function. PREDICATE plays the same role as for `try-completion' (which see). DEFAULT will -be returned on empty input (defaults to the first advised function for -which PREDICATE returns non-nil)." +be returned on empty input (defaults to the first advised function or +function at point for which PREDICATE returns non-nil)." (if (null ad-advised-functions) (error "ad-read-advised-function: There are no advised functions")) (setq default (or default + ;; Prefer func name at point, if it's in ad-advised-functions etc. + (let ((function (progn + (require 'help) + (function-called-at-point)))) + (and function + (assoc (symbol-name function) ad-advised-functions) + (or (null predicate) + (funcall predicate function)) + function)) (ad-do-advised-functions (function) (if (or (null predicate) (funcall predicate function)) ------------------------------------------------------------ revno: 104326 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2011-05-22 22:15:17 -0300 message: * lisp/emacs-lisp/bytecomp.el (byte-compile-function-form): Only call byte-compile-lambda if it's actually a lambda. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-23 00:39:25 +0000 +++ lisp/ChangeLog 2011-05-23 01:15:17 +0000 @@ -1,5 +1,8 @@ 2011-05-23 Stefan Monnier + * emacs-lisp/bytecomp.el (byte-compile-function-form): Only call + byte-compile-lambda if it's actually a lambda. + * emacs-lisp/eieio.el (eieio-defgeneric-form-primary-only-one): Fix function quoting. Use backquote better. === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2011-05-22 18:22:30 +0000 +++ lisp/emacs-lisp/bytecomp.el 2011-05-23 01:15:17 +0000 @@ -3525,9 +3525,9 @@ ;; and (funcall (function foo)) will lose with autoloads. (defun byte-compile-function-form (form) - (byte-compile-constant (if (symbolp (nth 1 form)) - (nth 1 form) - (byte-compile-lambda (nth 1 form))))) + (byte-compile-constant (if (eq 'lambda (car-safe (nth 1 form))) + (byte-compile-lambda (nth 1 form)) + (nth 1 form)))) (defun byte-compile-indent-to (form) (let ((len (length form))) ------------------------------------------------------------ revno: 104325 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2011-05-22 21:39:25 -0300 message: * lisp/emacs-lisp/eieio.el (eieio-defgeneric-form-primary-only-one): Fix function quoting. Use backquote better. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-22 19:46:47 +0000 +++ lisp/ChangeLog 2011-05-23 00:39:25 +0000 @@ -1,3 +1,8 @@ +2011-05-23 Stefan Monnier + + * emacs-lisp/eieio.el (eieio-defgeneric-form-primary-only-one): + Fix function quoting. Use backquote better. + 2011-05-22 Yuanle Song * nxml/rng-xsd.el (rng-xsd-check-pattern): Use case-sensitive === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2011-05-16 19:49:28 +0000 +++ lisp/emacs-lisp/eieio.el 2011-05-23 00:39:25 +0000 @@ -1226,29 +1226,28 @@ (if (not (eieio-object-p (car local-args))) ;; Not an object. Just signal. (signal 'no-method-definition - (list ,(list 'quote method) local-args)) + (list ',method local-args)) ;; We do have an object. Make sure it is the right type. (if ,(if (eq class eieio-default-superclass) - nil ; default superclass means just an obj. Already asked. + nil ; default superclass means just an obj. Already asked. `(not (child-of-class-p (aref (car local-args) object-class) - ,(list 'quote class))) - ) + ',class))) ;; If not the right kind of object, call no applicable (apply 'no-applicable-method (car local-args) - ,(list 'quote method) local-args) + ',method local-args) ;; It is ok, do the call. ;; Fill in inter-call variables then evaluate the method. - (let ((scoped-class ,(list 'quote class)) + (let ((scoped-class ',class) (eieio-generic-call-next-method-list nil) (eieio-generic-call-key method-primary) - (eieio-generic-call-methodname ,(list 'quote method)) + (eieio-generic-call-methodname ',method) (eieio-generic-call-arglst local-args) ) - (apply ,(list 'quote impl) local-args) - ;(,impl local-args) + (apply #',impl local-args) + ;;(,impl local-args) ))))))) (defsubst eieio-defgeneric-reset-generic-form-primary-only-one (method) ------------------------------------------------------------ revno: 104324 committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-05-22 17:03:40 -0700 message: * gnutls.c: Remove unused macros. (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function): (fn_gnutls_transport_set_push_function) [!WINDOWSNT]: Remove macros that are defined and never used. Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-22 21:57:43 +0000 +++ src/ChangeLog 2011-05-23 00:03:40 +0000 @@ -1,3 +1,11 @@ +2011-05-22 Paul Eggert + + * gnutls.c: Remove unused macros. + (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function): + (fn_gnutls_transport_set_push_function) [!WINDOWSNT]: + Remove macros that are defined and never used. + Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14). + 2011-05-22 Chong Yidong * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS. === modified file 'src/gnutls.c' --- src/gnutls.c 2011-05-06 01:05:25 +0000 +++ src/gnutls.c 2011-05-23 00:03:40 +0000 @@ -221,10 +221,7 @@ #define fn_gnutls_record_send gnutls_record_send #define fn_gnutls_strerror gnutls_strerror #define fn_gnutls_transport_set_errno gnutls_transport_set_errno -#define fn_gnutls_transport_set_lowat gnutls_transport_set_lowat #define fn_gnutls_transport_set_ptr2 gnutls_transport_set_ptr2 -#define fn_gnutls_transport_set_pull_function gnutls_transport_set_pull_function -#define fn_gnutls_transport_set_push_function gnutls_transport_set_push_function #define fn_gnutls_x509_crt_check_hostname gnutls_x509_crt_check_hostname #define fn_gnutls_x509_crt_deinit gnutls_x509_crt_deinit #define fn_gnutls_x509_crt_import gnutls_x509_crt_import ------------------------------------------------------------ revno: 104323 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-22 17:57:43 -0400 message: Remove var mistakenly introduced in revision 104320. * src/xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS. (Fx_get_selection_internal): Minor cleanup. (Fx_own_selection_internal): Rename arguments for consistency with select.el. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-22 21:12:04 +0000 +++ src/ChangeLog 2011-05-22 21:57:43 +0000 @@ -1,3 +1,10 @@ +2011-05-22 Chong Yidong + + * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS. + (Fx_get_selection_internal): Minor cleanup. + (Fx_own_selection_internal): Rename arguments for consistency with + select.el. + 2011-05-22 Paul Eggert * xselect.c (QSAVE_TARGETS): New static var, to fix build failure. === modified file 'src/xselect.c' --- src/xselect.c 2011-05-22 21:12:04 +0000 +++ src/xselect.c 2011-05-22 21:57:43 +0000 @@ -103,7 +103,7 @@ static Lisp_Object QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP, QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, - QATOM_PAIR, QSAVE_TARGETS; + QATOM_PAIR; static Lisp_Object QCOMPOUND_TEXT; /* This is a type of selection. */ static Lisp_Object QUTF8_STRING; /* This is a type of selection. */ @@ -1996,18 +1996,18 @@ DEFUN ("x-own-selection-internal", Fx_own_selection_internal, Sx_own_selection_internal, 2, 2, 0, - doc: /* Assert an X selection of the given TYPE with the given VALUE. -TYPE is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. + doc: /* Assert an X selection of type SELECTION and value VALUE. +SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. \(Those are literal upper-case symbol names, since that's what X expects.) VALUE is typically a string, or a cons of two markers, but may be anything that the functions on `selection-converter-alist' know about. */) - (Lisp_Object selection_name, Lisp_Object selection_value) + (Lisp_Object selection, Lisp_Object value) { check_x (); - CHECK_SYMBOL (selection_name); - if (NILP (selection_value)) error ("SELECTION-VALUE may not be nil"); - x_own_selection (selection_name, selection_value); - return selection_value; + CHECK_SYMBOL (selection); + if (NILP (value)) error ("VALUE may not be nil"); + x_own_selection (selection, value); + return value; } @@ -2046,22 +2046,16 @@ val = x_get_local_selection (selection_symbol, target_type, 1); if (NILP (val)) - { - val = x_get_foreign_selection (selection_symbol, target_type, time_stamp); - goto DONE; - } + RETURN_UNGCPRO (x_get_foreign_selection (selection_symbol, + target_type, time_stamp)); - if (CONSP (val) - && SYMBOLP (XCAR (val))) + if (CONSP (val) && SYMBOLP (XCAR (val))) { val = XCDR (val); if (CONSP (val) && NILP (XCDR (val))) val = XCAR (val); } - val = clean_local_selection_data (val); - DONE: - UNGCPRO; - return val; + RETURN_UNGCPRO (clean_local_selection_data (val)); } DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, @@ -2656,7 +2650,6 @@ DEFSYM (QTARGETS, "TARGETS"); DEFSYM (QATOM, "ATOM"); DEFSYM (QATOM_PAIR, "ATOM_PAIR"); - DEFSYM (QSAVE_TARGETS, "SAVE_TARGETS"); DEFSYM (QNULL, "NULL"); DEFSYM (Qcompound_text_with_extensions, "compound-text-with-extensions"); DEFSYM (Qforeign_selection, "foreign-selection"); ------------------------------------------------------------ revno: 104322 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-05-22 14:21:13 -0700 message: Merge from gnulib. diff: === modified file 'ChangeLog' --- ChangeLog 2011-05-21 09:53:32 +0000 +++ ChangeLog 2011-05-22 21:02:48 +0000 @@ -1,3 +1,8 @@ +2011-05-22 Paul Eggert + + * lib/intprops.h, lib/stdint.in.h, m4/mktime.m4, m4/readlink.m4: + Merge from gnulib. + 2011-05-21 Andreas Schwab * Makefile.in (AUTOMAKE_INPUTS): Add $(srcdir)/lib/gnulib.mk. === modified file 'lib/intprops.h' --- lib/intprops.h 2011-05-18 00:39:40 +0000 +++ lib/intprops.h 2011-05-22 21:02:48 +0000 @@ -27,6 +27,10 @@ E should not have side effects. */ #define _GL_INT_CONVERT(e, v) ((e) - (e) + (v)) +/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see + . */ +#define _GL_INT_NEGATE_CONVERT(e, v) ((e) - (e) - (v)) + /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ @@ -50,7 +54,7 @@ /* Return 1 if the integer expression E, after integer promotion, has a signed type. E should not have side effects. */ -#define _GL_INT_SIGNED(e) (_GL_INT_CONVERT (e, -1) < 0) +#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) /* Minimum and maximum values for integer types and expressions. These @@ -79,7 +83,7 @@ #define _GL_INT_MAXIMUM(e) \ (_GL_INT_SIGNED (e) \ ? _GL_SIGNED_INT_MAXIMUM (e) \ - : _GL_INT_CONVERT (e, -1)) + : _GL_INT_NEGATE_CONVERT (e, 1)) #define _GL_SIGNED_INT_MAXIMUM(e) \ (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) @@ -179,16 +183,21 @@ : 0 < (a)) /* Return 1 if A * B would overflow in [MIN,MAX] arithmetic. - See above for restrictions. */ + See above for restrictions. Avoid && and || as they tickle + bugs in Sun C 5.11 2010/08/13 and other compilers; see + . */ #define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \ ((b) < 0 \ ? ((a) < 0 \ ? (a) < (max) / (b) \ - : (b) < -1 && (min) / (b) < (a)) \ - : (0 < (b) \ - && ((a) < 0 \ - ? (a) < (min) / (b) \ - : (max) / (b) < (a)))) + : (b) == -1 \ + ? 0 \ + : (min) / (b) < (a)) \ + : (b) == 0 \ + ? 0 \ + : ((a) < 0 \ + ? (a) < (min) / (b) \ + : (max) / (b) < (a))) /* Return 1 if A / B would overflow in [MIN,MAX] arithmetic. See above for restrictions. Do not check for division by zero. */ @@ -234,11 +243,11 @@ (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \ || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max)) #define _GL_DIVIDE_OVERFLOW(a, b, min, max) \ - ((min) < 0 ? (b) == _GL_INT_CONVERT (min, -1) && (a) < - (max) \ + ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ : (a) < 0 ? (b) <= (a) + (b) - 1 \ : (b) < 0 && (a) + (b) <= (a)) #define _GL_REMAINDER_OVERFLOW(a, b, min, max) \ - ((min) < 0 ? (b) == _GL_INT_CONVERT (min, -1) && (a) < - (max) \ + ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \ : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \ : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max)) @@ -302,13 +311,10 @@ /* Return 1 if the expression A B would overflow, where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test, assuming MIN and MAX are the minimum and maximum for the result type. - - This macro assumes that A | B is a valid integer if both A and B are, - which is true of all known practical hosts. If this is a problem - for you, please let us know how to fix it for your host. */ + Arguments should be free of side effects. */ #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ op_result_overflow (a, b, \ - _GL_INT_MINIMUM ((a) | (b)), \ - _GL_INT_MAXIMUM ((a) | (b))) + _GL_INT_MINIMUM ((b) - (b) + (a)), \ + _GL_INT_MAXIMUM ((b) - (b) + (a))) #endif /* _GL_INTPROPS_H */ === modified file 'lib/stdint.in.h' --- lib/stdint.in.h 2011-02-19 07:28:29 +0000 +++ lib/stdint.in.h 2011-05-22 21:02:48 +0000 @@ -93,7 +93,7 @@ #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H -/* Minimum and maximum values for a integer type under the usual assumption. +/* Minimum and maximum values for an integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify picky compilers. */ === modified file 'm4/mktime.m4' --- m4/mktime.m4 2011-01-30 19:22:02 +0000 +++ m4/mktime.m4 2011-05-22 21:02:48 +0000 @@ -1,4 +1,4 @@ -# serial 19 +# serial 20 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -234,6 +234,23 @@ fi ]) +AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [ + AC_REQUIRE([gl_FUNC_MKTIME]) + if test $REPLACE_MKTIME = 0; then + dnl BeOS has __mktime_internal in libc, but other platforms don't. + AC_CHECK_FUNC([__mktime_internal], + [AC_DEFINE([mktime_internal], [__mktime_internal], + [Define to the real name of the mktime_internal function.]) + ], + [dnl mktime works but it doesn't export __mktime_internal, + dnl so we need to substitute our own mktime implementation. + REPLACE_MKTIME=1 + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + ]) + fi +]) + # Prerequisites of lib/mktime.c. AC_DEFUN([gl_PREREQ_MKTIME], [ === modified file 'm4/readlink.m4' --- m4/readlink.m4 2011-02-22 19:30:07 +0000 +++ m4/readlink.m4 2011-05-22 21:02:48 +0000 @@ -1,4 +1,4 @@ -# readlink.m4 serial 9 +# readlink.m4 serial 10 dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -48,7 +48,8 @@ fi ]) -# Like gl_FUNC_READLINK, except prepare for separate compilation (no AC_LIBOBJ). +# Like gl_FUNC_READLINK, except prepare for separate compilation +# (no REPLACE_READLINK, no AC_LIBOBJ). AC_DEFUN([gl_FUNC_READLINK_SEPARATE], [ AC_CHECK_FUNCS_ONCE([readlink]) ------------------------------------------------------------ revno: 104321 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-05-22 14:13:38 -0700 message: * xselect.c (QSAVE_TARGETS): New static var, to fix build failure. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-22 19:39:54 +0000 +++ src/ChangeLog 2011-05-22 21:12:04 +0000 @@ -1,3 +1,7 @@ +2011-05-22 Paul Eggert + + * xselect.c (QSAVE_TARGETS): New static var, to fix build failure. + 2011-05-22 Chong Yidong * xselect.c (syms_of_xselect): Include character.h; use DEFSYM. === modified file 'src/xselect.c' --- src/xselect.c 2011-05-22 19:39:54 +0000 +++ src/xselect.c 2011-05-22 21:12:04 +0000 @@ -103,7 +103,7 @@ static Lisp_Object QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP, QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, - QATOM_PAIR; + QATOM_PAIR, QSAVE_TARGETS; static Lisp_Object QCOMPOUND_TEXT; /* This is a type of selection. */ static Lisp_Object QUTF8_STRING; /* This is a type of selection. */ ------------------------------------------------------------ revno: 104320 author: Yuanle Song committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-22 15:46:47 -0400 message: Make rng-xsd-check-pattern case sensitive (Bug#8516). * nxml/rng-xsd.el (rng-xsd-check-pattern): Use case-sensitive matching. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-22 19:36:07 +0000 +++ lisp/ChangeLog 2011-05-22 19:46:47 +0000 @@ -1,3 +1,8 @@ +2011-05-22 Yuanle Song + + * nxml/rng-xsd.el (rng-xsd-check-pattern): Use case-sensitive + matching (Bug#8516). + 2011-01-22 Jari Aalto * vc/vc-dir.el (vc-default-dir-printer): Give edited tag a === modified file 'lisp/nxml/rng-xsd.el' --- lisp/nxml/rng-xsd.el 2011-01-25 04:08:28 +0000 +++ lisp/nxml/rng-xsd.el 2011-05-22 19:46:47 +0000 @@ -238,7 +238,7 @@ obj))) (defun rng-xsd-check-pattern (str regexp convert &rest args) - (and (string-match regexp str) + (and (let ((case-fold-search nil)) (string-match regexp str)) (apply convert (cons str args)))) ------------------------------------------------------------ revno: 104319 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-22 15:39:54 -0400 message: * src/xselect.c (syms_of_xselect): Include character.h; use DEFSYM. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-05-21 02:15:34 +0000 +++ src/ChangeLog 2011-05-22 19:39:54 +0000 @@ -1,3 +1,7 @@ +2011-05-22 Chong Yidong + + * xselect.c (syms_of_xselect): Include character.h; use DEFSYM. + 2011-05-21 YAMAMOTO Mitsuharu * dispnew.c (scrolling_window): Don't exclude the case that the === modified file 'src/xselect.c' --- src/xselect.c 2011-05-15 17:17:44 +0000 +++ src/xselect.c 2011-05-22 19:39:54 +0000 @@ -38,6 +38,7 @@ #include "process.h" #include "termhooks.h" #include "keyboard.h" +#include "character.h" #include @@ -400,17 +401,6 @@ handler_fn = Qnil; value = XCAR (XCDR (XCDR (local_value))); } -#if 0 - else if (EQ (target_type, QDELETE)) - { - handler_fn = Qnil; - Fx_disown_selection_internal - (selection_symbol, - XCAR (XCDR (XCDR (local_value)))); - value = QNULL; - } -#endif - #if 0 /* #### MULTIPLE doesn't work yet */ else if (CONSP (target_type) && XCAR (target_type) == QMULTIPLE) @@ -2651,25 +2641,23 @@ x_selection_timeout = 0; /* QPRIMARY is defined in keyboard.c. */ - QSECONDARY = intern_c_string ("SECONDARY"); staticpro (&QSECONDARY); - QSTRING = intern_c_string ("STRING"); staticpro (&QSTRING); - QINTEGER = intern_c_string ("INTEGER"); staticpro (&QINTEGER); - QCLIPBOARD = intern_c_string ("CLIPBOARD"); staticpro (&QCLIPBOARD); - QTIMESTAMP = intern_c_string ("TIMESTAMP"); staticpro (&QTIMESTAMP); - QTEXT = intern_c_string ("TEXT"); staticpro (&QTEXT); - QCOMPOUND_TEXT = intern_c_string ("COMPOUND_TEXT"); staticpro (&QCOMPOUND_TEXT); - QUTF8_STRING = intern_c_string ("UTF8_STRING"); staticpro (&QUTF8_STRING); - QDELETE = intern_c_string ("DELETE"); staticpro (&QDELETE); - QMULTIPLE = intern_c_string ("MULTIPLE"); staticpro (&QMULTIPLE); - QINCR = intern_c_string ("INCR"); staticpro (&QINCR); - QEMACS_TMP = intern_c_string ("_EMACS_TMP_"); staticpro (&QEMACS_TMP); - QTARGETS = intern_c_string ("TARGETS"); staticpro (&QTARGETS); - QATOM = intern_c_string ("ATOM"); staticpro (&QATOM); - QATOM_PAIR = intern_c_string ("ATOM_PAIR"); staticpro (&QATOM_PAIR); - QNULL = intern_c_string ("NULL"); staticpro (&QNULL); - Qcompound_text_with_extensions = intern_c_string ("compound-text-with-extensions"); - staticpro (&Qcompound_text_with_extensions); - - Qforeign_selection = intern_c_string ("foreign-selection"); - staticpro (&Qforeign_selection); + DEFSYM (QSECONDARY, "SECONDARY"); + DEFSYM (QSTRING, "STRING"); + DEFSYM (QINTEGER, "INTEGER"); + DEFSYM (QCLIPBOARD, "CLIPBOARD"); + DEFSYM (QTIMESTAMP, "TIMESTAMP"); + DEFSYM (QTEXT, "TEXT"); + DEFSYM (QCOMPOUND_TEXT, "COMPOUND_TEXT"); + DEFSYM (QUTF8_STRING, "UTF8_STRING"); + DEFSYM (QDELETE, "DELETE"); + DEFSYM (QMULTIPLE, "MULTIPLE"); + DEFSYM (QINCR, "INCR"); + DEFSYM (QEMACS_TMP, "_EMACS_TMP_"); + DEFSYM (QTARGETS, "TARGETS"); + DEFSYM (QATOM, "ATOM"); + DEFSYM (QATOM_PAIR, "ATOM_PAIR"); + DEFSYM (QSAVE_TARGETS, "SAVE_TARGETS"); + DEFSYM (QNULL, "NULL"); + DEFSYM (Qcompound_text_with_extensions, "compound-text-with-extensions"); + DEFSYM (Qforeign_selection, "foreign-selection"); } ------------------------------------------------------------ revno: 104318 author: Jari Aalto committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-22 15:36:07 -0400 message: Maked "edited" tag stand out in vc-dir (Bug#8178). * vc/vc-dir.el (vc-default-dir-printer): Give edited tag a different face. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-22 19:22:37 +0000 +++ lisp/ChangeLog 2011-05-22 19:36:07 +0000 @@ -1,3 +1,8 @@ +2011-01-22 Jari Aalto + + * vc/vc-dir.el (vc-default-dir-printer): Give edited tag a + different face (Bug#8178). + 2011-05-22 Chong Yidong * vc/diff-mode.el (diff-changed): Don't use terminal specs for === modified file 'lisp/vc/vc-dir.el' --- lisp/vc/vc-dir.el 2011-03-15 17:39:56 +0000 +++ lisp/vc/vc-dir.el 2011-05-22 19:36:07 +0000 @@ -1238,6 +1238,7 @@ (format "%-20s" state) 'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face) ((memq state '(missing conflict)) 'font-lock-warning-face) + ((eq state 'edited) 'font-lock-constant-face) (t 'font-lock-variable-name-face)) 'mouse-face 'highlight) " " ------------------------------------------------------------ revno: 104317 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-22 15:22:37 -0400 message: Fix diff-changed face definition. * lisp/vc/diff-mode.el (diff-changed): Don't use terminal specs for defface (Bug#8144). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-22 18:22:30 +0000 +++ lisp/ChangeLog 2011-05-22 19:22:37 +0000 @@ -1,3 +1,8 @@ +2011-05-22 Chong Yidong + + * vc/diff-mode.el (diff-changed): Don't use terminal specs for + defface (Bug#8144). + 2011-05-22 Stefan Monnier * emacs-lisp/macroexp.el (macroexpand-all-1): Convert ' to #' for === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2011-05-18 00:39:40 +0000 +++ lisp/vc/diff-mode.el 2011-05-22 19:22:37 +0000 @@ -295,9 +295,14 @@ (defvar diff-added-face 'diff-added) (defface diff-changed - '((((type tty pc) (class color) (background light)) + ;; We normally apply a `shadow'-based face on the `diff-context' + ;; face, and keep `diff-changed' the default. + '((((class color grayscale) (min-colors 88))) + ;; If the terminal lacks sufficient colors for shadowing, + ;; highlight changed lines explicitly. + (((class color) (background light)) :foreground "magenta" :weight bold :slant italic) - (((type tty pc) (class color) (background dark)) + (((class color) (background dark)) :foreground "yellow" :weight bold :slant italic)) "`diff-mode' face used to highlight changed lines." :group 'diff-mode) ------------------------------------------------------------ revno: 104316 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-22 15:05:14 -0400 message: Doc fixes for mule.texi. * mule.texi (Specify Coding, Text Coding, Communication Coding): (File Name Coding, Terminal Coding): Add command names (Bug#8312). diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-05-18 03:39:45 +0000 +++ doc/emacs/ChangeLog 2011-05-22 19:05:14 +0000 @@ -1,3 +1,8 @@ +2011-05-22 Chong Yidong + + * mule.texi (Specify Coding, Text Coding, Communication Coding): + (File Name Coding, Terminal Coding): Add command names (Bug#8312). + 2011-05-18 Glenn Morris * ack.texi (Acknowledgments): Remove fakemail.c. === modified file 'doc/emacs/mule.texi' --- doc/emacs/mule.texi 2011-05-17 02:26:56 +0000 +++ doc/emacs/mule.texi 2011-05-22 19:05:14 +0000 @@ -916,11 +916,12 @@ @section Specifying a File's Coding System If Emacs recognizes the encoding of a file incorrectly, you can -reread the file using the correct coding system by typing @kbd{C-x -@key{RET} r @var{coding-system} @key{RET}}. To see what coding system -Emacs actually used to decode the file, look at the coding system -mnemonic letter near the left edge of the mode line (@pxref{Mode -Line}), or type @kbd{C-h C @key{RET}}. +reread the file using the correct coding system with @kbd{C-x +@key{RET} r} (@code{revert-buffer-with-coding-system}). This command +prompts for the coding system to use. To see what coding system Emacs +actually used to decode the file, look at the coding system mnemonic +letter near the left edge of the mode line (@pxref{Mode Line}), or +type @kbd{C-h C} (@code{describe-coding-system}). @vindex coding You can specify the coding system for a particular file in the file @@ -994,15 +995,16 @@ @table @kbd @item C-x @key{RET} f @var{coding} @key{RET} -Use coding system @var{coding} for saving or revisiting the visited -file in the current buffer. +Use coding system @var{coding} to save or revisit the visited file in +the current buffer (@code{set-buffer-file-coding-system}) @item C-x @key{RET} c @var{coding} @key{RET} Specify coding system @var{coding} for the immediately following -command. +command (@code{universal-coding-system-argument}). @item C-x @key{RET} r @var{coding} @key{RET} -Revisit the current file using the coding system @var{coding}. +Revisit the current file using the coding system @var{coding} +(@code{revert-buffer-with-coding-system}). @item M-x recode-region @key{RET} @var{right} @key{RET} @var{wrong} @key{RET} Convert a region that was decoded using coding system @var{wrong}, @@ -1084,19 +1086,17 @@ @table @kbd @item C-x @key{RET} x @var{coding} @key{RET} Use coding system @var{coding} for transferring selections to and from -other window-based applications. +other window-based applications (@code{set-selection-coding-system}). @item C-x @key{RET} X @var{coding} @key{RET} Use coding system @var{coding} for transferring @emph{one} -selection---the next one---to or from another window-based application. +selection---the next one---to or from another window-based application +(@code{set-next-selection-coding-system}). @item C-x @key{RET} p @var{input-coding} @key{RET} @var{output-coding} @key{RET} Use coding systems @var{input-coding} and @var{output-coding} for -subprocess input and output in the current buffer. - -@item C-x @key{RET} c @var{coding} @key{RET} -Specify coding system @var{coding} for the immediately following -command. +subprocess input and output in the current buffer +(@code{set-buffer-process-coding-system}). @end table @kindex C-x RET x @@ -1134,9 +1134,10 @@ and from a particular subprocess by giving the command in the corresponding buffer. - You can also use @kbd{C-x @key{RET} c} just before the command that -runs or starts a subprocess, to specify the coding system to use for -communication with that subprocess. + You can also use @kbd{C-x @key{RET} c} +(@code{universal-coding-system-argument}) just before the command that +runs or starts a subprocess, to specify the coding system for +communicating with that subprocess. @xref{Text Coding}. The default for translation of process input and output depends on the current language environment. @@ -1160,7 +1161,7 @@ @table @kbd @item C-x @key{RET} F @var{coding} @key{RET} Use coding system @var{coding} for encoding and decoding file -@emph{names}. +@emph{names} (@code{set-file-name-coding-system}). @end table @vindex file-name-coding-system @@ -1205,10 +1206,12 @@ @table @kbd @item C-x @key{RET} k @var{coding} @key{RET} -Use coding system @var{coding} for keyboard input. +Use coding system @var{coding} for keyboard input +(@code{set-keyboard-coding-system}). @item C-x @key{RET} t @var{coding} @key{RET} -Use coding system @var{coding} for terminal output. +Use coding system @var{coding} for terminal output +(@code{set-terminal-coding-system}). @end table @kindex C-x RET t ------------------------------------------------------------ revno: 104315 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8712 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2011-05-22 15:22:30 -0300 message: * lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Convert ' to #' for funcall as well. Warn when performing those conversions. * lisp/emacs-lisp/bytecomp.el (byte-compile-form): Fix error report. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-22 17:19:24 +0000 +++ lisp/ChangeLog 2011-05-22 18:22:30 +0000 @@ -1,5 +1,9 @@ 2011-05-22 Stefan Monnier + * emacs-lisp/macroexp.el (macroexpand-all-1): Convert ' to #' for + funcall as well (bug#8712). Warn when performing those conversions. + * emacs-lisp/bytecomp.el (byte-compile-form): Fix error report. + * progmodes/grep.el (grep-mode): Fix it for good (bug#8684)! 2011-05-22 Glenn Morris === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2011-05-12 02:36:05 +0000 +++ lisp/emacs-lisp/bytecomp.el 2011-05-22 18:22:30 +0000 @@ -2892,8 +2892,8 @@ That command is designed for interactive use only" fn)) (if (and (fboundp (car form)) (eq (car-safe (symbol-function (car form))) 'macro)) - (byte-compile-report-error - (format "Forgot to expand macro %s" (car form)))) + (byte-compile-log-warning + (format "Forgot to expand macro %s" (car form)) nil :error)) (if (and handler ;; Make sure that function exists. This is important ;; for CL compiler macros since the symbol may be === modified file 'lisp/emacs-lisp/macroexp.el' --- lisp/emacs-lisp/macroexp.el 2011-03-12 03:32:43 +0000 +++ lisp/emacs-lisp/macroexp.el 2011-05-22 18:22:30 +0000 @@ -169,14 +169,22 @@ ;; here, so that any code that cares about the difference will ;; see the same transformation. ;; First arg is a function: - (`(,(and fun (or `apply `mapcar `mapatoms `mapconcat `mapc)) + (`(,(and fun (or `funcall `apply `mapcar `mapatoms `mapconcat `mapc)) ',(and f `(lambda . ,_)) . ,args) + (byte-compile-log-warning + (format "%s quoted with ' rather than with #'" + (list 'lambda (nth 1 f) '...)) + t) ;; We don't use `maybe-cons' since there's clearly a change. (cons fun (cons (macroexpand-all-1 (list 'function f)) (macroexpand-all-forms args)))) ;; Second arg is a function: (`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args) + (byte-compile-log-warning + (format "%s quoted with ' rather than with #'" + (list 'lambda (nth 1 f) '...)) + t) ;; We don't use `maybe-cons' since there's clearly a change. (cons fun (cons (macroexpand-all-1 arg1) ------------------------------------------------------------ revno: 104314 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8684 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2011-05-22 14:19:24 -0300 message: * lisp/progmodes/grep.el (grep-mode): Fix it for good! diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-22 00:04:49 +0000 +++ lisp/ChangeLog 2011-05-22 17:19:24 +0000 @@ -1,3 +1,7 @@ +2011-05-22 Stefan Monnier + + * progmodes/grep.el (grep-mode): Fix it for good (bug#8684)! + 2011-05-22 Glenn Morris * files.el (hack-local-variables-prop-line): Small simplifications. === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2011-05-21 23:18:22 +0000 +++ lisp/progmodes/grep.el 2011-05-22 17:19:24 +0000 @@ -700,7 +700,7 @@ grep-regexp-alist) ;; compilation-directory-matcher can't be nil, so we set it to a regexp that ;; can never match. - (set (make-local-variable 'compilation-directory-matcher) "\\`a\\`") + (set (make-local-variable 'compilation-directory-matcher) '("\\`a\\`")) (set (make-local-variable 'compilation-process-setup-function) 'grep-process-setup) (set (make-local-variable 'compilation-disable-input) t) ------------------------------------------------------------ revno: 104313 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-05-21 18:18:49 -0700 message: Further tweak previous files.el change. * lisp/files.el (hack-local-variables): In the MODE-ONLY case, try to ignore minor modes. diff: === modified file 'lisp/files.el' --- lisp/files.el 2011-05-22 00:34:41 +0000 +++ lisp/files.el 2011-05-22 01:18:49 +0000 @@ -3147,7 +3147,9 @@ (defun hack-local-variables (&optional mode-only) "Parse and put into effect this buffer's local variables spec. If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" -is specified, and return the corresponding mode symbol, or nil." +is specified, and return the corresponding mode symbol, or nil. +In this case, we try to ignore minor-modes, and only return a +major-mode." (let ((enable-local-variables (and local-enable-local-variables enable-local-variables)) result) @@ -3226,17 +3228,20 @@ (let* ((str (buffer-substring beg (point))) (var (let ((read-circle nil)) (read str))) - val) + val val2) ;; Read the variable value. (skip-chars-forward "^:") (forward-char 1) (let ((read-circle nil)) (setq val (read (current-buffer)))) (if mode-only - (if (eq var 'mode) - (setq result - (intern (concat (symbol-name val) - "-mode")))) + (and (eq var 'mode) + ;; Specifying minor-modes via mode: is + ;; deprecated, but try to reject them anyway. + (not (string-match + "-minor\\'" + (setq val2 (symbol-name val)))) + (setq result (intern (concat val2 "-mode")))) (unless (eq var 'coding) (condition-case nil (push (cons (if (eq var 'eval) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.