Now on revision 110124. ------------------------------------------------------------ revno: 110124 fixes bug: http://debbugs.gnu.org/12463 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-21 11:52:23 +0800 message: Fix list duplication error in define_image_type. * image.c (define_image_type): Avoid adding duplicate types to image_types. Suggested by Jörg Walter. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-21 03:03:48 +0000 +++ src/ChangeLog 2012-09-21 03:52:23 +0000 @@ -1,3 +1,8 @@ +2012-09-21 Chong Yidong + + * image.c (define_image_type): Avoid adding duplicate types to + image_types (Bug#12463). Suggested by Jörg Walter. + 2012-09-21 YAMAMOTO Mitsuharu * unexmacosx.c: Define LC_DATA_IN_CODE if not defined. === modified file 'src/image.c' --- src/image.c 2012-09-15 08:45:27 +0000 +++ src/image.c 2012-09-21 03:52:23 +0000 @@ -590,9 +590,15 @@ success = Qnil; else { + struct image_type *p; + Lisp_Object target_type = *(type->type); + for (p = image_types; p; p = p->next) + if (EQ (*(p->type), target_type)) + return Qt; + /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. The initialized data segment is read-only. */ - struct image_type *p = xmalloc (sizeof *p); + p = xmalloc (sizeof *p); *p = *type; p->next = image_types; image_types = p; ------------------------------------------------------------ revno: 110123 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-09-20 20:22:27 -0700 message: ChangeLog date fix diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-21 03:03:48 +0000 +++ doc/lispref/ChangeLog 2012-09-21 03:22:27 +0000 @@ -1,4 +1,4 @@ -2012-09-12 Glenn Morris +2012-09-21 Glenn Morris * debugging.texi (Using Debugger): Fix typo. ------------------------------------------------------------ revno: 110122 [merge] committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-21 11:04:28 +0800 message: Merge from emacs-24; up to r108145 diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-18 05:14:42 +0000 +++ doc/lispref/ChangeLog 2012-09-21 03:03:48 +0000 @@ -1,3 +1,7 @@ +2012-09-12 Glenn Morris + + * debugging.texi (Using Debugger): Fix typo. + 2012-09-18 Chong Yidong * display.texi (Faces): Discuss anonymous faces. === modified file 'doc/lispref/debugging.texi' --- doc/lispref/debugging.texi 2012-09-04 21:21:00 +0000 +++ doc/lispref/debugging.texi 2012-09-21 03:03:48 +0000 @@ -331,7 +331,7 @@ non-@code{nil}, @code{debug-on-error} will temporarily be set to @code{t}. This means that any further errors that occur while doing a debugging session will (by default) trigger another backtrace. If -this is not want you want, you can either set +this is not what you want, you can either set @code{eval-expression-debug-on-error} to @code{nil}, or set @code{debug-on-error} to @code{nil} in @code{debugger-mode-hook}. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 21:57:13 +0000 +++ lisp/ChangeLog 2012-09-21 03:03:48 +0000 @@ -1,3 +1,31 @@ +2012-09-21 Leo Liu + + IDO: Disable match re-ordering for buffer switching. + * ido.el (ido-buffer-disable-smart-matches): New variable. + (ido-set-matches-1): Use it. (Bug#2042) + +2012-09-21 Jose Marino (tiny change) + + * progmodes/idlw-shell.el (idlwave-shell-complete-filename): + Fix 2011-05-17 change. (Bug#12418) + +2012-09-21 Leo Liu + + * subr.el (ignore-errors): Mention with-demoted-errors in doc-string. + +2012-09-21 Glenn Morris + + * emacs-lisp/shadow.el (load-path-shadows-font-lock-keywords): + Be more robust about locating simple.el. + +2012-09-21 Glenn Morris + + * mail/emacsbug.el (report-emacs-bug): Trap load-path-shadows errors. + +2012-09-21 Joel Bion (tiny change) + + * pcmpl-gnu.el (pcmpl-gnu-tarfile-regexp): Add tar.xz. (Bug#12382) + 2012-09-20 Juri Linkov * replace.el (query-replace-read-from): Use `read-regexp' instead === modified file 'lisp/emacs-lisp/shadow.el' --- lisp/emacs-lisp/shadow.el 2012-01-19 07:21:25 +0000 +++ lisp/emacs-lisp/shadow.el 2012-09-11 07:13:21 +0000 @@ -158,8 +158,14 @@ (eq 0 (call-process "cmp" nil nil nil "-s" f1 f2)))))))) (defvar load-path-shadows-font-lock-keywords + ;; The idea is that shadows of files supplied with Emacs are more + ;; serious than various versions of external packages shadowing each + ;; other. `((,(format "hides \\(%s.*\\)" - (file-name-directory (locate-library "simple.el"))) + (file-name-directory + (or (locate-library "simple") + (file-name-as-directory + (expand-file-name "../lisp" data-directory))))) . (1 font-lock-warning-face))) "Keywords to highlight in `load-path-shadows-mode'.") === modified file 'lisp/ido.el' --- lisp/ido.el 2012-07-25 05:48:19 +0000 +++ lisp/ido.el 2012-09-21 03:03:48 +0000 @@ -493,6 +493,18 @@ :type 'boolean :group 'ido) +;; See http://debbugs.gnu.org/2042 for more info. +(defcustom ido-buffer-disable-smart-matches t + "Non-nil means not to re-order matches for buffer switching. +By default, ido aranges matches in the following order: + + full-matches > suffix matches > prefix matches > remaining matches + +which can get in the way for buffer switching." + :version "24.3" + :type 'boolean + :group 'ido) + (defcustom ido-confirm-unique-completion nil "Non-nil means that even a unique completion must be confirmed. This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuffer] @@ -3688,10 +3700,17 @@ (rex0 (if ido-enable-regexp text (regexp-quote text))) (rexq (concat rex0 (if slash ".*/" ""))) (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) - (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) + (full-re (and do-full + (and (eq ido-cur-item 'buffer) + (not ido-buffer-disable-smart-matches)) + (not ido-enable-regexp) + (not (string-match "\$\\'" rex0)) (concat "\\`" rex0 (if slash "/" "") "\\'"))) (suffix-re (and do-full slash - (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) + (and (eq ido-cur-item 'buffer) + (not ido-buffer-disable-smart-matches)) + (not ido-enable-regexp) + (not (string-match "\$\\'" rex0)) (concat rex0 "/\\'"))) (prefix-re (and full-re (not ido-enable-prefix) (concat "\\`" rexq))) === modified file 'lisp/mail/emacsbug.el' --- lisp/mail/emacsbug.el 2012-08-15 16:29:11 +0000 +++ lisp/mail/emacsbug.el 2012-09-21 03:03:48 +0000 @@ -308,9 +308,14 @@ (insert "\n")) (insert "\n") (insert "Load-path shadows:\n") - (message "Checking for load-path shadows...") - (let ((shadows (list-load-path-shadows t))) - (message "Checking for load-path shadows...done") + (let* ((msg "Checking for load-path shadows...") + (result "done") + (shadows (progn (message "%s" msg) + (condition-case nil (list-load-path-shadows t) + (error + (setq result "error") + "Error during checking"))))) + (message "%s%s" msg result) (insert (if (zerop (length shadows)) "None found.\n" shadows))) === modified file 'lisp/pcmpl-gnu.el' --- lisp/pcmpl-gnu.el 2012-01-24 18:10:39 +0000 +++ lisp/pcmpl-gnu.el 2012-09-08 00:59:04 +0000 @@ -128,8 +128,9 @@ (pcomplete-uniqify-list rules)))) (defcustom pcmpl-gnu-tarfile-regexp - "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" + "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\|xz\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" "A regexp which matches any tar archive." + :version "24.3" ; added xz :type 'regexp :group 'pcmpl-gnu) === modified file 'lisp/progmodes/idlw-shell.el' --- lisp/progmodes/idlw-shell.el 2012-09-17 05:41:04 +0000 +++ lisp/progmodes/idlw-shell.el 2012-09-21 03:03:48 +0000 @@ -2170,7 +2170,7 @@ ;; CWD might have changed, resync, to set default directory (idlwave-shell-resync-dirs) (let ((comint-file-name-chars idlwave-shell-file-name-chars)) - (comint-filename-completion))) + (comint-dynamic-complete-filename))) (defun idlwave-shell-executive-command () "Return the name of the current executive command, if any." === modified file 'lisp/subr.el' --- lisp/subr.el 2012-09-14 03:55:16 +0000 +++ lisp/subr.el 2012-09-21 03:03:48 +0000 @@ -280,7 +280,9 @@ (defmacro ignore-errors (&rest body) "Execute BODY; if an error occurs, return nil. -Otherwise, return result of last form in BODY." +Otherwise, return result of last form in BODY. +See also `with-demoted-errors' that does something similar +without silencing all errors." (declare (debug t) (indent 0)) `(condition-case nil (progn ,@body) (error nil))) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-20 03:10:52 +0000 +++ src/ChangeLog 2012-09-21 03:03:48 +0000 @@ -1,3 +1,30 @@ +2012-09-21 YAMAMOTO Mitsuharu + + * unexmacosx.c: Define LC_DATA_IN_CODE if not defined. + (print_load_command_name): Add case LC_DATA_IN_CODE. + (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data. + +2012-09-21 Glenn Morris + + * eval.c (Frun_hook_with_args_until_success) + (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393) + +2012-09-21 Andreas Schwab + + * fileio.c (Ffile_selinux_context): Only call freecon when + lgetfilecon succeeded. + (Fset_file_selinux_context): Likewise. (Bug#12444) + +2012-09-21 Eli Zaretskii + + * xdisp.c (try_window_reusing_current_matrix): Under bidi + reordering, locate the cursor by calling set_cursor_from_row; if + that fails, clear the desired glyph matrix before returning a + failure indication to the caller. Fixes leaving garbled display + when fast scrolling with a down-key. (Bug#12403) + (compute_stop_pos_backwards): Fix a typo that caused crashes while + scrolling through multibyte text. + 2012-09-20 Stefan Monnier * alloc.c (mark_object) : Mark prev/next_buffers *after* === modified file 'src/eval.c' --- src/eval.c 2012-09-16 21:43:55 +0000 +++ src/eval.c 2012-09-21 03:03:48 +0000 @@ -2399,6 +2399,7 @@ with the given arguments ARGS, until one of them returns a non-nil value. Then we return that value. However, if they all return nil, we return nil. +If the value of HOOK is nil, this function returns nil. Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. @@ -2420,10 +2421,12 @@ HOOK should be a symbol, a hook variable. If HOOK has a non-nil value, that value may be a function or a list of functions to be called to run the hook. If the value is a function, it is called with -the given arguments and its return value is returned. +the given arguments. Then we return nil if the function returns nil, +and t if it returns non-nil. If it is a list of functions, those functions are called, in order, with the given arguments ARGS, until one of them returns nil. -Then we return nil. However, if they all return non-nil, we return non-nil. +Then we return nil. However, if they all return non-nil, we return t. +If the value of HOOK is nil, this function returns t. Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. === modified file 'src/fileio.c' --- src/fileio.c 2012-09-15 07:06:56 +0000 +++ src/fileio.c 2012-09-21 03:03:48 +0000 @@ -2833,9 +2833,8 @@ if (context_range_get (context)) values[3] = build_string (context_range_get (context)); context_free (context); + freecon (con); } - if (con) - freecon (con); } #endif @@ -2914,12 +2913,10 @@ report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil)); context_free (parsed_con); + freecon (con); } else report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil)); - - if (con) - freecon (con); } #endif === modified file 'src/unexmacosx.c' --- src/unexmacosx.c 2012-08-11 02:12:12 +0000 +++ src/unexmacosx.c 2012-09-21 03:03:48 +0000 @@ -117,6 +117,13 @@ #include +/* LC_DATA_IN_CODE is not defined in mach-o/loader.h on OS X 10.7. + But it is used if we build with "Command Line Tools for Xcode 4.5 + (OS X Lion) - Septemper 2012". */ +#ifndef LC_DATA_IN_CODE +#define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */ +#endif + #ifdef _LP64 #define mach_header mach_header_64 #define segment_command segment_command_64 @@ -612,6 +619,11 @@ printf ("LC_MAIN "); break; #endif +#ifdef LC_DATA_IN_CODE + case LC_DATA_IN_CODE: + printf ("LC_DATA_IN_CODE "); + break; +#endif #ifdef LC_SOURCE_VERSION case LC_SOURCE_VERSION: printf ("LC_SOURCE_VERSION"); @@ -1178,9 +1190,9 @@ #endif #ifdef LC_FUNCTION_STARTS -/* Copy a LC_FUNCTION_STARTS/LC_DYLIB_CODE_SIGN_DRS load command from - the input file to the output file, adjusting the data offset - field. */ +/* Copy a LC_FUNCTION_STARTS/LC_DATA_IN_CODE/LC_DYLIB_CODE_SIGN_DRS + load command from the input file to the output file, adjusting the + data offset field. */ static void copy_linkedit_data (struct load_command *lc, long delta) { @@ -1274,6 +1286,9 @@ #endif #ifdef LC_FUNCTION_STARTS case LC_FUNCTION_STARTS: +#ifdef LC_DATA_IN_CODE + case LC_DATA_IN_CODE: +#endif #ifdef LC_DYLIB_CODE_SIGN_DRS case LC_DYLIB_CODE_SIGN_DRS: #endif === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-16 21:43:55 +0000 +++ src/xdisp.c 2012-09-21 03:03:48 +0000 @@ -7755,7 +7755,7 @@ { it->end_charpos = min (charpos + 1, ZV); charpos = max (charpos - SCAN_BACK_LIMIT, BEGV); - SET_TEXT_POS (pos, charpos, BYTE_TO_CHAR (charpos)); + SET_TEXT_POS (pos, charpos, CHAR_TO_BYTE (charpos)); reseat_1 (it, pos, 0); compute_stop_pos (it); /* We must advance forward, right? */ @@ -16744,28 +16744,33 @@ } if (row < bottom_row) { - struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos; - struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA]; - - /* Can't use this optimization with bidi-reordered glyph - rows, unless cursor is already at point. */ + /* Can't simply scan the row for point with + bidi-reordered glyph rows. Let set_cursor_from_row + figure out where to put the cursor, and if it fails, + give up. */ if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) { - if (!(w->cursor.hpos >= 0 - && w->cursor.hpos < row->used[TEXT_AREA] - && BUFFERP (glyph->object) - && glyph->charpos == PT)) - return 0; + if (!set_cursor_from_row (w, row, w->current_matrix, + 0, 0, 0, 0)) + { + clear_glyph_matrix (w->desired_matrix); + return 0; + } } else - for (; glyph < end - && (!BUFFERP (glyph->object) - || glyph->charpos < PT); - glyph++) - { - w->cursor.hpos++; - w->cursor.x += glyph->pixel_width; - } + { + struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos; + struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA]; + + for (; glyph < end + && (!BUFFERP (glyph->object) + || glyph->charpos < PT); + glyph++) + { + w->cursor.hpos++; + w->cursor.x += glyph->pixel_width; + } + } } } ------------------------------------------------------------ revno: 110121 fixes bug: http://debbugs.gnu.org/7567 committer: Juri Linkov branch nick: trunk timestamp: Fri 2012-09-21 00:57:13 +0300 message: * lisp/replace.el (query-replace-read-from): Use `read-regexp' instead of `read-from-minibuffer' when `regexp-flag' is non-nil. (occur-read-primary-args): Use `read-regexp' instead of `read-string'. (multi-occur-in-matching-buffers): Use `read-regexp' instead of `read-from-minibuffer'. * lisp/isearch.el (isearch-occur): Use `read-regexp' instead of `read-string'. * lisp/dired.el (dired-read-regexp): Use `read-regexp' instead of `read-from-minibuffer'. * lisp/progmodes/grep.el (grep-read-regexp): Use `read-regexp' instead of `read-string'. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-20 18:59:00 +0000 +++ etc/NEWS 2012-09-20 21:57:13 +0000 @@ -750,6 +750,14 @@ **** `special-display-function' **** `display-buffer-function' +** Minibuffer + +*** `read-regexp' has a new argument HISTORY; the first argument PROMPT +of `read-regexp' accepts a string ending with a colon and space, and its +second argument DEFAULTS can be a list of strings accessible via M-n +in the minibuffer ahead of other hard-coded useful regexp-related values. +More commands use `read-regexp' now to read their regexp arguments. + ** Completion *** New function `completion-table-with-quoting' to handle completion === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 21:35:40 +0000 +++ lisp/ChangeLog 2012-09-20 21:57:13 +0000 @@ -1,5 +1,18 @@ 2012-09-20 Juri Linkov + * replace.el (query-replace-read-from): Use `read-regexp' instead + of `read-from-minibuffer' when `regexp-flag' is non-nil. + (occur-read-primary-args): Use `read-regexp' instead of + `read-string'. + (multi-occur-in-matching-buffers): Use `read-regexp' instead of + `read-from-minibuffer'. + * isearch.el (isearch-occur): Use `read-regexp' instead of + `read-string'. + * dired.el (dired-read-regexp): Use `read-regexp' instead of + `read-from-minibuffer'. + * progmodes/grep.el (grep-read-regexp): Use `read-regexp' instead + of `read-string'. (Bug#7567) + * replace.el (read-regexp): Rename DEFAULT-VALUE arg to DEFAULTS and allow accepting a list of strings prepended to a list of standard default values. Doc fix. (Bug#12321) === modified file 'lisp/dired.el' --- lisp/dired.el 2012-09-20 10:19:05 +0000 +++ lisp/dired.el 2012-09-20 21:57:13 +0000 @@ -3178,8 +3178,8 @@ (defvar dired-regexp-history nil "History list of regular expressions used in Dired commands.") -(defun dired-read-regexp (prompt) - (read-from-minibuffer prompt nil nil nil 'dired-regexp-history)) +(defun dired-read-regexp (prompt &optional default history) + (read-regexp prompt default (or history 'dired-regexp-history))) (defun dired-mark-files-regexp (regexp &optional marker-char) "Mark all files matching REGEXP for use in later commands. === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-09-09 22:15:24 +0000 +++ lisp/isearch.el 2012-09-20 21:57:13 +0000 @@ -1649,9 +1649,9 @@ (isearch-done nil t) (isearch-clean-overlays) (let ((default (car occur-collect-regexp-history))) - (read-string + (read-regexp (format "Regexp to collect (default %s): " default) - nil 'occur-collect-regexp-history default))) + default 'occur-collect-regexp-history))) ;; Otherwise normal occur takes numerical prefix argument. (when current-prefix-arg (prefix-numeric-value current-prefix-arg)))))) === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2012-04-20 08:48:50 +0000 +++ lisp/progmodes/grep.el 2012-09-20 21:57:13 +0000 @@ -817,11 +817,11 @@ (defun grep-read-regexp () "Read regexp arg for interactive grep." (let ((default (grep-tag-default))) - (read-string + (read-regexp (concat "Search for" (if (and default (> (length default) 0)) (format " (default \"%s\"): " default) ": ")) - nil 'grep-regexp-history default))) + default 'grep-regexp-history))) (defun grep-read-files (regexp) "Read files arg for interactive grep." === modified file 'lisp/replace.el' --- lisp/replace.el 2012-09-20 21:35:40 +0000 +++ lisp/replace.el 2012-09-20 21:57:13 +0000 @@ -128,20 +128,21 @@ (if query-replace-interactive (car (if regexp-flag regexp-search-ring search-ring)) (let* ((history-add-new-input nil) + (prompt + (if query-replace-defaults + (format "%s (default %s -> %s): " prompt + (query-replace-descr (car query-replace-defaults)) + (query-replace-descr (cdr query-replace-defaults))) + (format "%s: " prompt))) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. ;; That should not clobber the region for the query-replace itself. (save-excursion - (read-from-minibuffer - (if query-replace-defaults - (format "%s (default %s -> %s): " prompt - (query-replace-descr (car query-replace-defaults)) - (query-replace-descr (cdr query-replace-defaults))) - (format "%s: " prompt)) - nil nil nil - query-replace-from-history-variable - nil t)))) + (if regexp-flag + (read-regexp prompt nil query-replace-from-history-variable) + (read-from-minibuffer + prompt nil nil nil query-replace-from-history-variable nil t))))) (if (and (zerop (length from)) query-replace-defaults) (cons (car query-replace-defaults) (query-replace-compile-replacement @@ -1139,9 +1140,9 @@ "\\&" ;; Get the regexp for collection pattern. (let ((default (car occur-collect-regexp-history))) - (read-string + (read-regexp (format "Regexp to collect (default %s): " default) - nil 'occur-collect-regexp-history default))) + default 'occur-collect-regexp-history))) ;; Otherwise normal occur takes numerical prefix argument. (when current-prefix-arg (prefix-numeric-value current-prefix-arg)))))) @@ -1228,14 +1229,10 @@ (cons (let* ((default (car regexp-history)) (input - (read-from-minibuffer + (read-regexp (if current-prefix-arg "List lines in buffers whose names match regexp: " - "List lines in buffers whose filenames match regexp: ") - nil - nil - nil - 'regexp-history))) + "List lines in buffers whose filenames match regexp: ")))) (if (equal input "") default input)) ------------------------------------------------------------ revno: 110120 fixes bug: http://debbugs.gnu.org/12321 committer: Juri Linkov branch nick: trunk timestamp: Fri 2012-09-21 00:35:40 +0300 message: * lisp/replace.el (read-regexp): Rename DEFAULT-VALUE arg to DEFAULTS and allow accepting a list of strings prepended to a list of standard default values. Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 21:28:47 +0000 +++ lisp/ChangeLog 2012-09-20 21:35:40 +0000 @@ -1,5 +1,9 @@ 2012-09-20 Juri Linkov + * replace.el (read-regexp): Rename DEFAULT-VALUE arg to DEFAULTS + and allow accepting a list of strings prepended to a list of + standard default values. Doc fix. (Bug#12321) + * replace.el (read-regexp): Add HISTORY arg. (Bug#7567) * replace.el (read-regexp): Don't add ": " when PROMPT already === modified file 'lisp/replace.el' --- lisp/replace.el 2012-09-20 21:28:47 +0000 +++ lisp/replace.el 2012-09-20 21:35:40 +0000 @@ -574,41 +574,45 @@ (defvar occur-collect-regexp-history '("\\1") "History of regexp for occur's collect operation") -(defun read-regexp (prompt &optional default-value history) - "Read regexp as a string using the regexp history and some useful defaults. +(defun read-regexp (prompt &optional defaults history) + "Read and return a regular expression as a string. When PROMPT doesn't end with a colon and space, it adds a final \": \". -If DEFAULT-VALUE is non-nil, it displays the first default in the prompt. -The optional argument DEFAULT-VALUE provides the value to display -in the minibuffer prompt that is returned if the user just types RET. -Values available via M-n are the string at point, the last isearch -regexp, the last isearch string, and the last replacement regexp. +If DEFAULTS is non-nil, it displays the first default in the prompt. + +Non-nil optional arg DEFAULTS is a string or a list of strings that +are prepended to a list of standard default values, which include the +string at point, the last isearch regexp, the last isearch string, and +the last replacement regexp. Non-nil HISTORY is a symbol to use for the history list. If HISTORY is nil, `regexp-history' is used." - (let* ((defaults - (list (regexp-quote - (or (funcall (or find-tag-default-function - (get major-mode 'find-tag-default-function) - 'find-tag-default)) - "")) - (car regexp-search-ring) - (regexp-quote (or (car search-ring) "")) - (car (symbol-value - query-replace-from-history-variable)))) + (let* ((default (if (consp defaults) (car defaults) defaults)) + (defaults + (append + (if (listp defaults) defaults (list defaults)) + (list (regexp-quote + (or (funcall (or find-tag-default-function + (get major-mode 'find-tag-default-function) + 'find-tag-default)) + "")) + (car regexp-search-ring) + (regexp-quote (or (car search-ring) "")) + (car (symbol-value + query-replace-from-history-variable))))) (defaults (delete-dups (delq nil (delete "" defaults)))) - ;; Don't add automatically the car of defaults for empty input + ;; Do not automatically add default to the history for empty input. (history-add-new-input nil) (input (read-from-minibuffer (cond ((string-match-p ":[ \t]*\\'" prompt) prompt) - (default-value + (default (format "%s (default %s): " prompt - (query-replace-descr default-value))) + (query-replace-descr default))) (t (format "%s: " prompt))) nil nil nil (or history 'regexp-history) defaults t))) (if (equal input "") - (or default-value input) + (or default input) (prog1 input (add-to-history (or history 'regexp-history) input))))) ------------------------------------------------------------ revno: 110119 fixes bug: http://debbugs.gnu.org/7567 committer: Juri Linkov branch nick: trunk timestamp: Fri 2012-09-21 00:28:47 +0300 message: * lisp/replace.el (read-regexp): Add HISTORY arg. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 21:21:46 +0000 +++ lisp/ChangeLog 2012-09-20 21:28:47 +0000 @@ -1,5 +1,7 @@ 2012-09-20 Juri Linkov + * replace.el (read-regexp): Add HISTORY arg. (Bug#7567) + * replace.el (read-regexp): Don't add ": " when PROMPT already ends with a colon and space. (Bug#12321) === modified file 'lisp/replace.el' --- lisp/replace.el 2012-09-20 21:21:46 +0000 +++ lisp/replace.el 2012-09-20 21:28:47 +0000 @@ -574,14 +574,17 @@ (defvar occur-collect-regexp-history '("\\1") "History of regexp for occur's collect operation") -(defun read-regexp (prompt &optional default-value) +(defun read-regexp (prompt &optional default-value history) "Read regexp as a string using the regexp history and some useful defaults. When PROMPT doesn't end with a colon and space, it adds a final \": \". If DEFAULT-VALUE is non-nil, it displays the first default in the prompt. The optional argument DEFAULT-VALUE provides the value to display in the minibuffer prompt that is returned if the user just types RET. Values available via M-n are the string at point, the last isearch -regexp, the last isearch string, and the last replacement regexp." +regexp, the last isearch string, and the last replacement regexp. + +Non-nil HISTORY is a symbol to use for the history list. +If HISTORY is nil, `regexp-history' is used." (let* ((defaults (list (regexp-quote (or (funcall (or find-tag-default-function @@ -603,11 +606,11 @@ (query-replace-descr default-value))) (t (format "%s: " prompt))) - nil nil nil 'regexp-history defaults t))) + nil nil nil (or history 'regexp-history) defaults t))) (if (equal input "") (or default-value input) (prog1 input - (add-to-history 'regexp-history input))))) + (add-to-history (or history 'regexp-history) input))))) (defalias 'delete-non-matching-lines 'keep-lines) ------------------------------------------------------------ revno: 110118 fixes bug: http://debbugs.gnu.org/12321 committer: Juri Linkov branch nick: trunk timestamp: Fri 2012-09-21 00:21:46 +0300 message: * lisp/replace.el (read-regexp): Don't add ": " when PROMPT already ends with a colon and space. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 19:53:40 +0000 +++ lisp/ChangeLog 2012-09-20 21:21:46 +0000 @@ -1,3 +1,8 @@ +2012-09-20 Juri Linkov + + * replace.el (read-regexp): Don't add ": " when PROMPT already + ends with a colon and space. (Bug#12321) + 2012-09-20 Tassilo Horn * doc-view.el (doc-view-display): Better fix for the cl-assertion === modified file 'lisp/replace.el' --- lisp/replace.el 2012-09-09 22:15:24 +0000 +++ lisp/replace.el 2012-09-20 21:21:46 +0000 @@ -576,10 +576,10 @@ (defun read-regexp (prompt &optional default-value) "Read regexp as a string using the regexp history and some useful defaults. -Prompt for a regular expression with PROMPT (without a colon and -space) in the minibuffer. The optional argument DEFAULT-VALUE -provides the value to display in the minibuffer prompt that is -returned if the user just types RET. +When PROMPT doesn't end with a colon and space, it adds a final \": \". +If DEFAULT-VALUE is non-nil, it displays the first default in the prompt. +The optional argument DEFAULT-VALUE provides the value to display +in the minibuffer prompt that is returned if the user just types RET. Values available via M-n are the string at point, the last isearch regexp, the last isearch string, and the last replacement regexp." (let* ((defaults @@ -595,13 +595,15 @@ (defaults (delete-dups (delq nil (delete "" defaults)))) ;; Don't add automatically the car of defaults for empty input (history-add-new-input nil) - (input - (read-from-minibuffer - (if default-value - (format "%s (default %s): " prompt - (query-replace-descr default-value)) - (format "%s: " prompt)) - nil nil nil 'regexp-history defaults t))) + (input (read-from-minibuffer + (cond ((string-match-p ":[ \t]*\\'" prompt) + prompt) + (default-value + (format "%s (default %s): " prompt + (query-replace-descr default-value))) + (t + (format "%s: " prompt))) + nil nil nil 'regexp-history defaults t))) (if (equal input "") (or default-value input) (prog1 input ------------------------------------------------------------ revno: 110117 committer: Tassilo Horn branch nick: trunk timestamp: Thu 2012-09-20 21:53:40 +0200 message: * doc-view.el (doc-view-display): Better fix for the cl-assertion error. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 18:59:00 +0000 +++ lisp/ChangeLog 2012-09-20 19:53:40 +0000 @@ -1,3 +1,8 @@ +2012-09-20 Tassilo Horn + + * doc-view.el (doc-view-display): Better fix for the cl-assertion + error. + 2012-09-20 Stefan Merten * rst.el: Integrate support for `imenu' and `which-function'. === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2012-09-19 17:54:59 +0000 +++ lisp/doc-view.el 2012-09-20 19:53:40 +0000 @@ -1169,15 +1169,16 @@ If FORCE is non-nil, start viewing even if the document does not have the page we want to view." (with-current-buffer buffer - (let ((prev-pages doc-view-current-files)) + (let ((prev-pages doc-view-current-files) + (windows (get-buffer-window-list buffer nil t))) (setq doc-view-current-files (sort (directory-files (doc-view-current-cache-dir) t "page-[0-9]+\\.png" t) 'doc-view-sort)) - (dolist (win (or (get-buffer-window-list buffer nil t) - (list (let ((w (selected-window))) - (set-window-buffer w buffer) - w)))) + (unless windows + (switch-to-buffer buffer) + (setq windows (get-buffer-window-list buffer nil t))) + (dolist (win windows) (let* ((page (doc-view-current-page win)) (pagefile (expand-file-name (format "page-%d.png" page) (doc-view-current-cache-dir)))) ------------------------------------------------------------ revno: 110116 committer: Stefan Merten branch nick: trunk timestamp: Thu 2012-09-20 20:59:00 +0200 message: * rst.el: Integrate support for `imenu' and `which-function'. Fixes feature request bug#11711. (rst-mode): Create `imenu-create-index-function'. (rst-get-stripped-line): Delete after refactoring. (rst-section-tree, rst-section-tree-rec) (rst-section-tree-point): Refactor and document properly. (rst-imenu-find-adornments-for-position) (rst-imenu-convert-cell, rst-imenu-create-index): New function. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-19 07:27:29 +0000 +++ etc/NEWS 2012-09-20 18:59:00 +0000 @@ -419,6 +419,8 @@ *** Package version in `rst-version'. +*** Support `imenu' and `which-func'. + ** New `derived-mode' filter for Ibuffer, bound to `/ M'. `/ m' is now bound to filter by used-mode, which used to be bound to `/ M'. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 13:46:36 +0000 +++ lisp/ChangeLog 2012-09-20 18:59:00 +0000 @@ -1,3 +1,15 @@ +2012-09-20 Stefan Merten + + * rst.el: Integrate support for `imenu' and `which-function'. + Fixes feature request bug#11711. + (rst-mode): Create `imenu-create-index-function'. + (rst-get-stripped-line): Delete after refactoring. + (rst-section-tree, rst-section-tree-rec) + (rst-section-tree-point): Refactor and document properly. + (rst-imenu-find-adornments-for-position) + (rst-imenu-convert-cell, rst-imenu-create-index): New + function. + 2012-09-20 Stefan Monnier * emacs-lisp/macroexp.el (macroexp--obsolete-warning): New function. === modified file 'lisp/textmodes/rst.el' --- lisp/textmodes/rst.el 2012-09-17 17:38:09 +0000 +++ lisp/textmodes/rst.el 2012-09-20 18:59:00 +0000 @@ -112,6 +112,9 @@ ;; FIXME: Use `testcover'. +;; FIXME: The adornment classification often called `ado' should be a +;; `defstruct'. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Support for `testcover' @@ -214,7 +217,7 @@ ;; Use CVSHeader to really get information from CVS and not other version ;; control systems. (defconst rst-cvs-header - "$CVSHeader: sm/rst_el/rst.el,v 1.309.2.1 2012-09-17 17:30:49 stefan Exp $") + "$CVSHeader: sm/rst_el/rst.el,v 1.324 2012-09-20 18:52:46 stefan Exp $") (defconst rst-cvs-rev (rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+" " .*" rst-cvs-header "0.0") @@ -844,6 +847,12 @@ (set (make-local-variable 'uncomment-region-function) 'rst-uncomment-region) + ;; Imenu and which function. + ;; FIXME: Check documentation of `which-function' for alternative ways to + ;; determine the current function name. + (set (make-local-variable 'imenu-create-index-function) + 'rst-imenu-create-index) + ;; Font lock. (set (make-local-variable 'font-lock-defaults) '(rst-font-lock-keywords @@ -2170,126 +2179,112 @@ ;; Table of contents ;; ================= -(defun rst-get-stripped-line () - "Return the line at cursor, stripped from whitespace." - (re-search-forward (rst-re "\\S .*\\S ") (line-end-position)) - (buffer-substring-no-properties (match-beginning 0) - (match-end 0)) ) - +;; FIXME: Return value should be a `defstruct'. (defun rst-section-tree () - "Get the hierarchical tree of section titles. - -Returns a hierarchical tree of the sections titles in the -document. This can be used to generate a table of contents for -the document. The top node will always be a nil node, with the -top level titles as children (there may potentially be more than -one). - -Each section title consists in a cons of the stripped title -string and a marker to the section in the original text document. - -If there are missing section levels, the section titles are -inserted automatically, and the title string is set to nil, and -the marker set to the first non-nil child of itself. -Conceptually, the nil nodes--i.e.\ those which have no title--are -to be considered as being the same line as their first non-nil -child. This has advantages later in processing the graph." - + "Return the hierarchical tree of section titles. +A tree entry looks like ((TITLE MARKER) CHILD...). TITLE is the +stripped text of the section title. MARKER is a marker for the +beginning of the title text. For the top node or a missing +section level node TITLE is nil and MARKER points to the title +text of the first child. Each CHILD is another tree entry. The +CHILD list may be empty." (let ((hier (rst-get-hierarchy)) - (levels (make-hash-table :test 'equal :size 10)) - lines) + (ch-sty2level (make-hash-table :test 'equal :size 10)) + lev-ttl-mrk-l) (let ((lev 0)) (dolist (ado hier) ;; Compare just the character and indent in the hash table. - (puthash (cons (car ado) (cadr ado)) lev levels) + (puthash (cons (car ado) (cadr ado)) lev ch-sty2level) (incf lev))) - ;; Create a list of lines that contains (text, level, marker) for each - ;; adornment. + ;; Create a list that contains (LEVEL TITLE MARKER) for each adornment. (save-excursion - (setq lines + (setq lev-ttl-mrk-l (mapcar (lambda (ado) (goto-char (point-min)) - (forward-line (1- (car ado))) - (list (gethash (cons (cadr ado) (caddr ado)) levels) - (rst-get-stripped-line) - (progn - (beginning-of-line 1) - (point-marker)))) + (1value ;; This should really succeed. + (forward-line (1- (car ado)))) + (list (gethash (cons (cadr ado) (caddr ado)) ch-sty2level) + ;; Get title. + (save-excursion + (if (re-search-forward + (rst-re "\\S .*\\S ") (line-end-position) t) + (buffer-substring-no-properties + (match-beginning 0) (match-end 0)) + "")) + (point-marker))) (rst-find-all-adornments)))) - (let ((lcontnr (cons nil lines))) - (rst-section-tree-rec lcontnr -1)))) - - -(defun rst-section-tree-rec (ados lev) - "Recursive guts of the section tree construction. -ADOS is a cons cell whose cdr is the remaining list of -adornments, and we change it as we consume them. LEV is -the current level of that node. This function returns a -pair of the subtree that was built. This treats the ADOS -list destructively." - - (let ((nado (cadr ados)) - node - children) - - ;; If the next adornment matches our level. - (when (and nado (= (car nado) lev)) - ;; Pop the next adornment and create the current node with it. - (setcdr ados (cddr ados)) - (setq node (cdr nado)) ) - ;; Else we let the node title/marker be unset. - - ;; Build the child nodes. - (while (and (cdr ados) (> (caadr ados) lev)) - (setq children - (cons (rst-section-tree-rec ados (1+ lev)) - children))) + (cdr (rst-section-tree-rec lev-ttl-mrk-l -1)))) + +;; FIXME: Return value should be a `defstruct'. +(defun rst-section-tree-rec (remaining lev) + "Process the first entry of REMAINING expected to be on level LEV. +REMAINING is the remaining list of adornments consisting +of (LEVEL TITLE MARKER) entries. + +Return (UNPROCESSED (TITLE MARKER) CHILD...) for the first entry +of REMAINING where TITLE is nil if the expected level is not +matched. UNPROCESSED is the list of still unprocessed entries. +Each CHILD is a child of this entry in the same format but +without UNPROCESSED." + (let ((cur (car remaining)) + (unprocessed remaining) + ttl-mrk children) + ;; If the current adornment matches expected level. + (when (and cur (= (car cur) lev)) + ;; Consume the current entry and create the current node with it. + (setq unprocessed (cdr remaining)) + (setq ttl-mrk (cdr cur))) + + ;; Build the child nodes as long as they have deeper level. + (while (and unprocessed (> (caar unprocessed) lev)) + (let ((rem-children (rst-section-tree-rec unprocessed (1+ lev)))) + (setq children (cons (cdr rem-children) children)) + (setq unprocessed (car rem-children)))) (setq children (reverse children)) - ;; If node is still unset, we use the marker of the first child. - (when (eq node nil) - (setq node (cons nil (cdaar children)))) - - ;; Return this node with its children. - (cons node children))) - - -(defun rst-section-tree-point (node &optional point) - "Find tree node at point. -Given a computed and valid section tree in NODE and a point -POINT (default being the current point in the current buffer), -find and return the node within the section tree where the cursor -lives. - -Return values: a pair of (parent path, container subtree). -The parent path is simply a list of the nodes above the -container subtree node that we're returning." - - (let (path outtree) - - (let* ((curpoint (or point (point)))) - - ;; Check if we are before the current node. - (if (and (cadar node) (>= curpoint (cadar node))) - - ;; Iterate all the children, looking for one that might contain the - ;; current section. - (let ((curnode (cdr node)) - last) - - (while (and curnode (>= curpoint (cadaar curnode))) - (setq last curnode - curnode (cdr curnode))) - - (if last - (let ((sub (rst-section-tree-point (car last) curpoint))) - (setq path (car sub) - outtree (cdr sub))) - (setq outtree node))))) - (cons (cons (car node) path) outtree))) - + (cons unprocessed + (cons (or ttl-mrk + ;; Node on this level missing - use nil as text and the + ;; marker of the first child. + (cons nil (cdaar children))) + children)))) + +(defun rst-section-tree-point (tree &optional point) + "Return section containing POINT by returning the closest node in TREE. +TREE is a section tree as returned by `rst-section-tree' +consisting of (NODE CHILD...) entries. POINT defaults to the +current point. A NODE must have the structure (IGNORED MARKER +...). + +Return (PATH NODE CHILD...). NODE is the node where POINT is in +if any. PATH is a list of nodes from the top of the tree down to +and including NODE. List of CHILD are the children of NODE if +any." + (setq point (or point (point))) + (let ((cur (car tree)) + (children (cdr tree))) + ;; Point behind current node? + (if (and (cadr cur) (>= point (cadr cur))) + ;; Iterate all the children, looking for one that might contain the + ;; current section. + (let (found) + (while (and children (>= point (cadaar children))) + (setq found children + children (cdr children))) + (if found + ;; Found section containing point in children. + (let ((sub (rst-section-tree-point (car found) point))) + ;; Extend path with current node and return NODE CHILD... from + ;; sub. + (cons (cons cur (car sub)) (cdr sub))) + ;; Point in this section: Start a new path with current node and + ;; return current NODE CHILD... + (cons (list cur) tree))) + ;; Current node behind point: start a new path with current node and + ;; no NODE CHILD... + (list (list cur))))) (defgroup rst-toc nil "Settings for reStructuredText table of contents." @@ -4132,6 +4127,79 @@ )) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Imenu support. + +;; FIXME: Integrate this properly. Consider a key binding. + +;; Based on code from Masatake YAMATO . + +(defun rst-imenu-find-adornments-for-position (adornments pos) + "Find adornments cell in ADORNMENTS for position POS." + (let ((a nil)) + (while adornments + (if (and (car adornments) + (eq (car (car adornments)) pos)) + (setq a adornments + adornments nil) + (setq adornments (cdr adornments)))) + a)) + +(defun rst-imenu-convert-cell (elt adornments) + "Convert a cell ELT in a tree returned from `rst-section-tree' to imenu index. +ADORNMENTS is used as hint information for conversion." + (let* ((kar (car elt)) + (kdr (cdr elt)) + (title (car kar))) + (if kar + (let* ((p (marker-position (cadr kar))) + (adornments + (rst-imenu-find-adornments-for-position adornments p)) + (a (car adornments)) + (adornments (cdr adornments)) + ;; FIXME: Overline adornment characters need to be in front so + ;; they become visible even for long title lines. May be + ;; an additional level number is also useful. + (title (format "%s%s%s" + (make-string (1+ (nth 3 a)) (nth 1 a)) + title + (if (eq (nth 2 a) 'simple) + "" + (char-to-string (nth 1 a)))))) + (cons title + (if (null kdr) + p + (cons + ;; A bit ugly but this make which-func happy. + (cons title p) + (mapcar (lambda (elt0) + (rst-imenu-convert-cell elt0 adornments)) + kdr))))) + nil))) + +;; FIXME: Document title and subtitle need to be handled properly. They should +;; get an own "Document" top level entry. +(defun rst-imenu-create-index () + "Create index for imenu. +Return as described for `imenu--index-alist'." + (rst-reset-section-caches) + (let ((tree (rst-section-tree)) + ;; Translate line notation to point notation. + (adornments (save-excursion + (mapcar (lambda (ln-ado) + (cons (progn + (goto-char (point-min)) + (forward-line (1- (car ln-ado))) + ;; FIXME: Need to consider + ;; `imenu-use-markers' here? + (point)) + (cdr ln-ado))) + (rst-find-all-adornments))))) + (delete nil (mapcar (lambda (elt) + (rst-imenu-convert-cell elt adornments)) + tree)))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Generic text functions that are more convenient than the defaults. ------------------------------------------------------------ revno: 110115 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2012-09-20 09:46:36 -0400 message: * lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): New function. (macroexp--expand-all): Use it. (macroexp--funcall-and-return): Remove by folding it into its sole caller (macroexp--warn-and-return). * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Use macroexp--obsolete-warning. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 13:44:45 +0000 +++ lisp/ChangeLog 2012-09-20 13:46:36 +0000 @@ -1,5 +1,12 @@ 2012-09-20 Stefan Monnier + * emacs-lisp/macroexp.el (macroexp--obsolete-warning): New function. + (macroexp--expand-all): Use it. + (macroexp--funcall-and-return): Remove by folding it into its sole + caller (macroexp--warn-and-return). + * emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): + Use macroexp--obsolete-warning. + * calc/calc.el: Fix last change by removing the whole chunk, since it was only needed back when Calc was not bundled. === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2012-09-13 02:41:46 +0000 +++ lisp/emacs-lisp/bytecomp.el 2012-09-20 13:46:36 +0000 @@ -1115,18 +1115,12 @@ "Warn that SYMBOL (a variable or function) is obsolete." (when (byte-compile-warning-enabled-p 'obsolete) (let* ((funcp (get symbol 'byte-obsolete-info)) - (obsolete (or funcp (get symbol 'byte-obsolete-variable))) - (instead (car obsolete)) - (asof (nth 2 obsolete))) + (msg (macroexp--obsolete-warning + symbol + (or funcp (get symbol 'byte-obsolete-variable)) + (if funcp "function" "variable")))) (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs)) - (byte-compile-warn "`%s' is an obsolete %s%s%s" symbol - (if funcp "function" "variable") - (if asof (concat " (as of " asof ")") "") - (cond ((stringp instead) - (concat "; " instead)) - (instead - (format "; use `%s' instead." instead)) - (t "."))))))) + (byte-compile-warn "%s" msg))))) (defun byte-compile-report-error (error-info) "Report Lisp error in compilation. ERROR-INFO is the error data." === modified file 'lisp/emacs-lisp/macroexp.el' --- lisp/emacs-lisp/macroexp.el 2012-09-20 03:29:41 +0000 +++ lisp/emacs-lisp/macroexp.el 2012-09-20 13:46:36 +0000 @@ -111,23 +111,30 @@ (funcall (eval (cadr form))) (byte-compile-constant nil))) -(defun macroexp--funcall-and-return (when-compiled when-interpreted form) - ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this - ;; macro-expansion will be processed by the byte-compiler, we check - ;; circumstantial evidence. - (if (member '(declare-function . byte-compile-macroexpand-declare-function) - macroexpand-all-environment) +(defun macroexp--warn-and-return (msg form) + (let ((when-compiled (lambda () (byte-compile-log-warning msg t)))) + (cond + ((null msg) form) + ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this + ;; macro-expansion will be processed by the byte-compiler, we check + ;; circumstantial evidence. + ((member '(declare-function . byte-compile-macroexpand-declare-function) + macroexpand-all-environment) `(progn (macroexp--funcall-if-compiled ',when-compiled) - ,form) - (funcall when-interpreted) - form)) + ,form)) + (t + (message "%s" msg) + form)))) -(defun macroexp--warn-and-return (msg form) - (macroexp--funcall-and-return - (lambda () (byte-compile-log-warning msg t)) - (lambda () (message "%s" msg)) - form)) +(defun macroexp--obsolete-warning (fun obsolescence-data type) + (let ((instead (car obsolescence-data)) + (asof (nth 2 obsolescence-data))) + (format "`%s' is an obsolete %s%s%s" fun type + (if asof (concat " (as of " asof ")") "") + (cond ((stringp instead) (concat "; " instead)) + (instead (format "; use `%s' instead." instead)) + (t "."))))) (defun macroexp--expand-all (form) "Expand all macros in FORM. @@ -148,10 +155,11 @@ (car-safe form) (symbolp (car form)) (get (car form) 'byte-obsolete-info)) - (macroexp--funcall-and-return - (lambda () (byte-compile-warn-obsolete (car form))) - #'ignore ;FIXME: We should `message' something. - new-form) + (let* ((fun (car form)) + (obsolete (get fun 'byte-obsolete-info))) + (macroexp--warn-and-return + (macroexp--obsolete-warning fun obsolete "macro") + new-form)) new-form))) (pcase form (`(cond . ,clauses) ------------------------------------------------------------ revno: 110114 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2012-09-20 09:44:45 -0400 message: * lisp/calc/calc.el: Fix last change by removing the whole chunk, since it was only needed back when Calc was not bundled. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 13:35:13 +0000 +++ lisp/ChangeLog 2012-09-20 13:44:45 +0000 @@ -1,3 +1,8 @@ +2012-09-20 Stefan Monnier + + * calc/calc.el: Fix last change by removing the whole chunk, since it + was only needed back when Calc was not bundled. + 2012-09-20 Martin Rudalics * emacs-lisp/debug.el (debug): Restore assignment to === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2012-09-20 03:44:57 +0000 +++ lisp/calc/calc.el 2012-09-20 13:44:45 +0000 @@ -912,34 +912,6 @@ (defvar calc-embedded-mode-hook nil "Hook run when starting embedded mode.") -;; Set up the autoloading linkage. -(let ((name (and (fboundp 'calc-dispatch) - (autoloadp (symbol-function 'calc-dispatch)))) - (p load-path)) - - ;; If Calc files exist on the load-path, we're all set. - (while (and p (not (file-exists-p - (expand-file-name "calc-misc.elc" (car p))))) - (setq p (cdr p))) - (or p - - ;; If Calc is autoloaded using a path name, look there for Calc files. - ;; This works for both relative ("calc/calc.elc") and absolute paths. - (and name (file-name-directory name) - (let ((p2 load-path) - (name2 (concat (file-name-directory name) - "calc-misc.elc"))) - (while (and p2 (not (file-exists-p - (expand-file-name name2 (car p2))))) - (setq p2 (cdr p2))) - (when p2 - (setq load-path (nconc load-path - (list - (directory-file-name - (file-name-directory - (expand-file-name - name (car p2)))))))))))) - ;; The following modes use specially-formatted data. (put 'calc-mode 'mode-class 'special) (put 'calc-trail-mode 'mode-class 'special) ------------------------------------------------------------ revno: 110113 committer: martin rudalics branch nick: trunk timestamp: Thu 2012-09-20 15:35:13 +0200 message: In debug restore assignment to debugger-old-buffer. * emacs-lisp/debug.el (debug): Restore assignment to debugger-old-buffer removed on 2012-09-08. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 09:03:51 +0000 +++ lisp/ChangeLog 2012-09-20 13:35:13 +0000 @@ -1,3 +1,8 @@ +2012-09-20 Martin Rudalics + + * emacs-lisp/debug.el (debug): Restore assignment to + debugger-old-buffer removed on 2012-09-08. + 2012-09-20 Juri Linkov * dired-aux.el (dired-diff): Remove (require 'diff) since === modified file 'lisp/emacs-lisp/debug.el' --- lisp/emacs-lisp/debug.el 2012-09-18 07:07:13 +0000 +++ lisp/emacs-lisp/debug.el 2012-09-20 13:35:13 +0000 @@ -166,6 +166,7 @@ (with-current-buffer (get-buffer "*Backtrace*") (list major-mode (buffer-string))))) (debugger-buffer (get-buffer-create "*Backtrace*")) + (debugger-old-buffer (current-buffer)) (debugger-window nil) (debugger-step-after-exit nil) (debugger-will-be-back nil) ------------------------------------------------------------ revno: 110112 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-09-20 06:19:05 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/dired.el' --- lisp/dired.el 2012-09-18 23:40:39 +0000 +++ lisp/dired.el 2012-09-20 10:19:05 +0000 @@ -3763,7 +3763,7 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "2a883f0d481a8d0292eb90c09ae36a8e") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "244227ae609852d3dc10ab3fc40ba9ab") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ ------------------------------------------------------------ revno: 110111 committer: Juri Linkov branch nick: trunk timestamp: Thu 2012-09-20 12:03:51 +0300 message: * lisp/dired-aux.el (dired-diff): Remove (require 'diff) since `diff-latest-backup-file' is now autoloaded. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 04:29:04 +0000 +++ lisp/ChangeLog 2012-09-20 09:03:51 +0000 @@ -1,3 +1,8 @@ +2012-09-20 Juri Linkov + + * dired-aux.el (dired-diff): Remove (require 'diff) since + `diff-latest-backup-file' is now autoloaded. + 2012-09-20 Chong Yidong * vc/diff.el (diff-latest-backup-file): Autoload. === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-09-19 20:09:55 +0000 +++ lisp/dired-aux.el 2012-09-20 09:03:51 +0000 @@ -51,8 +51,6 @@ (defconst dired-star-subst-regexp "\\(^\\|[ \t]\\)\\*\\([ \t]\\|$\\)") (defconst dired-quark-subst-regexp "\\(^\\|[ \t]\\)\\?\\([ \t]\\|$\\)") -(declare-function diff-latest-backup-file "diff" (fn)) ; actually belongs into files.el - ;;;###autoload (defun dired-diff (file &optional switches) "Compare file at point with file FILE using `diff'. @@ -70,7 +68,7 @@ (interactive (let* ((current (dired-get-filename t)) ;; Get the latest existing backup file. - (oldf (progn (require 'diff) (diff-latest-backup-file current))) + (oldf (diff-latest-backup-file current)) ;; Get the file at the mark. (file-at-mark (if (and transient-mark-mode mark-active) (save-excursion (goto-char (mark t)) ------------------------------------------------------------ revno: 110110 committer: Chong Yidong branch nick: trunk timestamp: Thu 2012-09-20 12:29:04 +0800 message: * vc/diff.el (diff-latest-backup-file): Autoload. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-20 03:44:57 +0000 +++ lisp/ChangeLog 2012-09-20 04:29:04 +0000 @@ -1,3 +1,7 @@ +2012-09-20 Chong Yidong + + * vc/diff.el (diff-latest-backup-file): Autoload. + 2012-09-20 Stefan Monnier * calc/calc.el: Remove redundant autoload shape check. === modified file 'lisp/vc/diff.el' --- lisp/vc/diff.el 2012-07-10 11:51:54 +0000 +++ lisp/vc/diff.el 2012-09-20 04:29:04 +0000 @@ -197,7 +197,8 @@ ori file)) (diff bak ori switches))) -(defun diff-latest-backup-file (fn) ; actually belongs into files.el +;;;###autoload +(defun diff-latest-backup-file (fn) "Return the latest existing backup of FILE, or nil." (let ((handler (find-file-name-handler fn 'diff-latest-backup-file))) (if handler ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.