Now on revision 111287. ------------------------------------------------------------ revno: 111287 fixes bug: http://debbugs.gnu.org/13177 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-12-21 15:51:33 +0800 message: Make read-char-by-name signal an error for invalid input. * international/mule-cmds.el (read-char-by-name): Signal an error if the user does not supply a valid character. * editfns.c (Finsert_char): Since read-char-by-name now signals an error for invalid chars, don't check for a nil return value. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-21 07:35:02 +0000 +++ lisp/ChangeLog 2012-12-21 07:51:33 +0000 @@ -5,6 +5,9 @@ 2012-12-21 Chong Yidong + * international/mule-cmds.el (read-char-by-name): Signal an error + if the user does not supply a valid character (Bug#13177). + * simple.el (transpose-subr-1): Preserve marker positions by changing the insertion sequence (Bug#13122). === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-12-15 13:03:17 +0000 +++ lisp/international/mule-cmds.el 2012-12-21 07:51:33 +0000 @@ -2953,14 +2953,18 @@ (let ((completion-ignore-case t)) (if (eq action 'metadata) '(metadata (category . unicode-name)) - (complete-with-action action (ucs-names) string pred))))))) - (cond - ((string-match-p "\\`[0-9a-fA-F]+\\'" input) - (string-to-number input 16)) - ((string-match-p "\\`#" input) - (read input)) - (t - (cdr (assoc-string input (ucs-names) t)))))) + (complete-with-action action (ucs-names) string pred)))))) + (char + (cond + ((string-match-p "\\`[0-9a-fA-F]+\\'" input) + (string-to-number input 16)) + ((string-match-p "\\`#" input) + (read input)) + (t + (cdr (assoc-string input (ucs-names) t)))))) + (unless (characterp char) + (error "Invalid character")) + char)) (define-obsolete-function-alias 'ucs-insert 'insert-char "24.3") (define-key ctl-x-map "8\r" 'insert-char) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-12-20 16:09:05 +0000 +++ src/ChangeLog 2012-12-21 07:51:33 +0000 @@ -1,3 +1,8 @@ +2012-12-21 Chong Yidong + + * editfns.c (Finsert_char): Since read-char-by-name now signals an + error for invalid chars, don't check for a nil return value. + 2012-12-20 Dmitry Antipov Avoid calls to CHAR_TO_BYTE if byte position is known. === modified file 'src/editfns.c' --- src/editfns.c 2012-12-20 16:09:05 +0000 +++ src/editfns.c 2012-12-21 07:51:33 +0000 @@ -2361,10 +2361,9 @@ } DEFUN ("insert-char", Finsert_char, Sinsert_char, 1, 3, - "(list (or (read-char-by-name \"Insert character (Unicode name or hex): \")\ - (error \"You did not specify a valid character\"))\ - (prefix-numeric-value current-prefix-arg)\ - t))", + "(list (read-char-by-name \"Insert character (Unicode name or hex): \")\ + (prefix-numeric-value current-prefix-arg)\ + t))", doc: /* Insert COUNT copies of CHARACTER. Interactively, prompt for CHARACTER. You can specify CHARACTER in one of these ways: ------------------------------------------------------------ revno: 111286 committer: Daiki Ueno branch nick: trunk timestamp: Fri 2012-12-21 16:35:02 +0900 message: * epg.el (epg-error): Set `error-message' property. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-21 07:21:35 +0000 +++ lisp/ChangeLog 2012-12-21 07:35:02 +0000 @@ -1,6 +1,7 @@ 2012-12-21 Daiki Ueno * epg.el (epg--start): Print GPG_AGENT_INFO in the debug buffer. + (epg-error): Set `error-message' property. 2012-12-21 Chong Yidong === modified file 'lisp/epg.el' --- lisp/epg.el 2012-12-21 07:21:35 +0000 +++ lisp/epg.el 2012-12-21 07:35:02 +0000 @@ -161,6 +161,7 @@ (defvar epg-prompt-alist nil) (put 'epg-error 'error-conditions '(epg-error error)) +(put 'epg-error 'error-message "GPG error") (defun epg-make-data-from-file (file) "Make a data object from FILE." ------------------------------------------------------------ revno: 111285 committer: Daiki Ueno branch nick: trunk timestamp: Fri 2012-12-21 16:21:35 +0900 message: * epg.el (epg--start): Print GPG_AGENT_INFO in the debug buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-21 05:42:59 +0000 +++ lisp/ChangeLog 2012-12-21 07:21:35 +0000 @@ -1,3 +1,7 @@ +2012-12-21 Daiki Ueno + + * epg.el (epg--start): Print GPG_AGENT_INFO in the debug buffer. + 2012-12-21 Chong Yidong * simple.el (transpose-subr-1): Preserve marker positions by === modified file 'lisp/epg.el' --- lisp/epg.el 2012-09-25 04:13:02 +0000 +++ lisp/epg.el 2012-12-21 07:21:35 +0000 @@ -1130,12 +1130,12 @@ (if (eq (epg-context-protocol context) 'CMS) epg-gpgsm-program epg-gpg-program))) - (let* ((args (append (list "--no-tty" + (let* ((agent-info (getenv "GPG_AGENT_INFO")) + (args (append (list "--no-tty" "--status-fd" "1" "--yes") (if (and (not (eq (epg-context-protocol context) 'CMS)) - (string-match ":" (or (getenv "GPG_AGENT_INFO") - ""))) + (string-match ":" (or agent-info ""))) '("--use-agent")) (if (and (not (eq (epg-context-protocol context) 'CMS)) (epg-context-progress-callback context)) @@ -1161,7 +1161,10 @@ (setq epg-debug-buffer (generate-new-buffer " *epg-debug*"))) (set-buffer epg-debug-buffer) (goto-char (point-max)) - (insert (format "%s %s\n" + (insert (if agent-info + (format "GPG_AGENT_INFO=%s\n" agent-info) + "GPG_AGENT_INFO is not set\n") + (format "%s %s\n" (if (eq (epg-context-protocol context) 'CMS) epg-gpgsm-program epg-gpg-program) ------------------------------------------------------------ revno: 111284 fixes bug: http://debbugs.gnu.org/13122 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-12-21 13:42:59 +0800 message: * simple.el (transpose-subr-1): Preserve marker positions by changing the insertion sequence. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-21 03:49:28 +0000 +++ lisp/ChangeLog 2012-12-21 05:42:59 +0000 @@ -1,3 +1,8 @@ +2012-12-21 Chong Yidong + + * simple.el (transpose-subr-1): Preserve marker positions by + changing the insertion sequence (Bug#13122). + 2012-12-21 Kelly Dean (tiny change) * simple.el (kill-region): Deactivate mark even for empty regions === modified file 'lisp/simple.el' --- lisp/simple.el 2012-12-21 03:49:28 +0000 +++ lisp/simple.el 2012-12-21 05:42:59 +0000 @@ -5300,14 +5300,21 @@ (setq pos1 pos2 pos2 swap))) (if (> (cdr pos1) (car pos2)) (error "Don't have two things to transpose")) (atomic-change-group - (let (word2) - ;; FIXME: We first delete the two pieces of text, so markers that - ;; used to point to after the text end up pointing to before it :-( - (setq word2 (delete-and-extract-region (car pos2) (cdr pos2))) - (goto-char (car pos2)) - (insert (delete-and-extract-region (car pos1) (cdr pos1))) - (goto-char (car pos1)) - (insert word2)))) + ;; This sequence of insertions attempts to preserve marker + ;; positions at the start and end of the transposed objects. + (let* ((word (buffer-substring (car pos2) (cdr pos2))) + (len1 (- (cdr pos1) (car pos1))) + (len2 (length word)) + (boundary (make-marker))) + (set-marker boundary (car pos2)) + (goto-char (cdr pos1)) + (insert-before-markers word) + (setq word (delete-and-extract-region (car pos1) (+ (car pos1) len1))) + (goto-char boundary) + (insert word) + (goto-char (+ boundary len1)) + (delete-region (point) (+ (point) len2)) + (set-marker boundary nil)))) (defun backward-word (&optional arg) "Move backward until encountering the beginning of a word. ------------------------------------------------------------ revno: 111283 fixes bug: http://debbugs.gnu.org/13169 author: Kelly Dean committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-12-21 11:49:28 +0800 message: * simple.el (kill-region): Deactivate mark even for empty regions. (tiny change) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-21 03:37:02 +0000 +++ lisp/ChangeLog 2012-12-21 03:49:28 +0000 @@ -1,3 +1,8 @@ +2012-12-21 Kelly Dean (tiny change) + + * simple.el (kill-region): Deactivate mark even for empty regions + (Bug#13169). + 2012-12-21 Chong Yidong * help-fns.el (describe-variable): Make sure we get the right === modified file 'lisp/simple.el' --- lisp/simple.el 2012-12-10 02:00:42 +0000 +++ lisp/simple.el 2012-12-21 03:49:28 +0000 @@ -3370,6 +3370,7 @@ (kill-new string nil yank-handler))) (when (or string (eq last-command 'kill-region)) (setq this-command 'kill-region)) + (setq deactivate-mark t) nil) ((buffer-read-only text-read-only) ;; The code above failed because the buffer, or some of the characters ------------------------------------------------------------ revno: 111282 fixes bug: http://debbugs.gnu.org/13105 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-12-21 11:37:02 +0800 message: * help-fns.el (describe-variable): Make sure we get the right buffer name. Suggested by Kelly Dean. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-21 02:08:29 +0000 +++ lisp/ChangeLog 2012-12-21 03:37:02 +0000 @@ -1,3 +1,8 @@ +2012-12-21 Chong Yidong + + * help-fns.el (describe-variable): Make sure we get the right + buffer name (Bug#13105). Suggested by Kelly Dean. + 2012-12-20 Michael R. Mauger * comint.el (comint-redirect-previous-input-string): New variable. === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2012-10-12 20:11:50 +0000 +++ lisp/help-fns.el 2012-12-21 03:37:02 +0000 @@ -789,7 +789,7 @@ (cond ((bufferp locus) (princ (format "Local in buffer %s; " - (buffer-name)))) + (buffer-name buffer)))) ((framep locus) (princ (format "It is a frame-local variable; "))) ((terminal-live-p locus) ------------------------------------------------------------ revno: 111281 committer: Michael Mauger branch nick: trunk timestamp: Thu 2012-12-20 21:08:29 -0500 message: * comint.el (comint-redirect-previous-input-string): New variable. (comint-redirect-setup, comint-redirect-cleanup) (comint-redirect-preoutput-filter): Use it. Fixes redirection bug. (comint-redirect-preoutput-filter): Fix verbose message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-20 11:15:38 +0000 +++ lisp/ChangeLog 2012-12-21 02:08:29 +0000 @@ -1,3 +1,10 @@ +2012-12-20 Michael R. Mauger + + * comint.el (comint-redirect-previous-input-string): New variable. + (comint-redirect-setup, comint-redirect-cleanup) + (comint-redirect-preoutput-filter): Use it. Fixes redirection bug. + (comint-redirect-preoutput-filter): Fix verbose message. + 2012-12-20 Michael Albinus * progmodes/grep.el (rgrep): Escape command line. Sometimes, it === modified file 'lisp/comint.el' --- lisp/comint.el 2012-10-08 00:12:26 +0000 +++ lisp/comint.el 2012-12-21 02:08:29 +0000 @@ -3490,6 +3490,11 @@ This is useful, for instance, for insertion into Help mode buffers. You probably want to set it locally to the output buffer.") +(defvar comint-redirect-previous-input-string nil + "Last redirected line of text. +Allows detection of the end of the redirection in case the +completion string is split between two output segments.") + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -3527,6 +3532,9 @@ (make-local-variable 'comint-redirect-completed) (setq comint-redirect-completed nil) + (make-local-variable 'comint-redirect-previous-input-string) + (setq comint-redirect-previous-input-string "") + (setq mode-line-process (if mode-line-process (list (concat (elt mode-line-process 0) " Redirection")) @@ -3535,6 +3543,8 @@ (defun comint-redirect-cleanup () "End a Comint redirection. See `comint-redirect-send-command'." (interactive) + ;; Release the last redirected string + (setq comint-redirect-previous-input-string nil) ;; Restore the process filter (set-process-filter (get-buffer-process (current-buffer)) comint-redirect-original-filter-function) @@ -3616,18 +3626,21 @@ ;; Message (and comint-redirect-verbose - (message "Redirected output to buffer(s) %s" - (mapconcat 'identity output-buffer-list " "))) + (message "Redirected output to buffer(s) %s" output-buffer-list)) ;; If we see the prompt, tidy up ;; We'll look for the prompt in the original string, so nobody can ;; clobber it - (and (string-match comint-redirect-finished-regexp input-string) + (and (string-match comint-redirect-finished-regexp + (concat comint-redirect-previous-input-string + input-string)) (progn (and comint-redirect-verbose (message "Redirection completed")) (comint-redirect-cleanup) (run-hooks 'comint-redirect-hook))) + (setq comint-redirect-previous-input-string input-string) + ;; Echo input? (if comint-redirect-echo-input filtered-input-string ------------------------------------------------------------ revno: 111280 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-12-20 20:09:05 +0400 message: Avoid calls to CHAR_TO_BYTE if byte position is known. * editfns.c (make_buffer_string_both): Use move_gap_both. (Fbuffer_string): Use make_buffer_string_both. * marker.c (buf_charpos_to_bytepos): Convert to eassert. Adjust comment. (buf_bytepos_to_charpos): Likewise. (charpos_to_bytepos): Remove. * fileio.c (Finsert_file_contents): Use move_gap_both. * search.c (Freplace_match): Likewise. * process.c (process_send_region): Likewise. Use convenient names for byte positions. * lisp.h (charpos_to_bytepos): Remove prototype. * indent.c (scan_for_column): Use CHAR_TO_BYTE. * insdel.c (move_gap): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-12-20 14:57:40 +0000 +++ src/ChangeLog 2012-12-20 16:09:05 +0000 @@ -1,3 +1,20 @@ +2012-12-20 Dmitry Antipov + + Avoid calls to CHAR_TO_BYTE if byte position is known. + * editfns.c (make_buffer_string_both): Use move_gap_both. + (Fbuffer_string): Use make_buffer_string_both. + * marker.c (buf_charpos_to_bytepos): Convert to eassert. + Adjust comment. + (buf_bytepos_to_charpos): Likewise. + (charpos_to_bytepos): Remove. + * fileio.c (Finsert_file_contents): Use move_gap_both. + * search.c (Freplace_match): Likewise. + * process.c (process_send_region): Likewise. Use convenient + names for byte positions. + * lisp.h (charpos_to_bytepos): Remove prototype. + * indent.c (scan_for_column): Use CHAR_TO_BYTE. + * insdel.c (move_gap): Likewise. + 2012-12-20 Paul Eggert * xdisp.c (redisplay_internal): Remove now-unused local. === modified file 'src/editfns.c' --- src/editfns.c 2012-12-14 19:43:12 +0000 +++ src/editfns.c 2012-12-20 16:09:05 +0000 @@ -2501,7 +2501,7 @@ Lisp_Object result, tem, tem1; if (start < GPT && GPT < end) - move_gap (start); + move_gap_both (start, start_byte); if (! NILP (BVAR (current_buffer, enable_multibyte_characters))) result = make_uninit_multibyte_string (end - start, end_byte - start_byte); @@ -2599,7 +2599,7 @@ of the buffer. */) (void) { - return make_buffer_string (BEGV, ZV, 1); + return make_buffer_string_both (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 1); } DEFUN ("insert-buffer-substring", Finsert_buffer_substring, Sinsert_buffer_substring, === modified file 'src/fileio.c' --- src/fileio.c 2012-12-17 19:14:34 +0000 +++ src/fileio.c 2012-12-20 16:09:05 +0000 @@ -4131,7 +4131,7 @@ prepare_to_modify_buffer (GPT, GPT, NULL); } - move_gap (PT); + move_gap_both (PT, PT_BYTE); if (GAP_SIZE < total) make_gap (total - GAP_SIZE); === modified file 'src/indent.c' --- src/indent.c 2012-12-11 06:08:53 +0000 +++ src/indent.c 2012-12-20 16:09:05 +0000 @@ -571,7 +571,8 @@ col += width; if (endp > scan) /* Avoid infinite loops with 0-width overlays. */ { - scan = endp; scan_byte = charpos_to_bytepos (scan); + scan = endp; + scan_byte = CHAR_TO_BYTE (scan); continue; } } === modified file 'src/insdel.c' --- src/insdel.c 2012-12-11 09:51:12 +0000 +++ src/insdel.c 2012-12-20 16:09:05 +0000 @@ -90,7 +90,7 @@ void move_gap (ptrdiff_t charpos) { - move_gap_both (charpos, charpos_to_bytepos (charpos)); + move_gap_both (charpos, CHAR_TO_BYTE (charpos)); } /* Move gap to byte position BYTEPOS, which is also char position CHARPOS. === modified file 'src/lisp.h' --- src/lisp.h 2012-12-15 15:33:43 +0000 +++ src/lisp.h 2012-12-20 16:09:05 +0000 @@ -3176,7 +3176,6 @@ extern ptrdiff_t marker_position (Lisp_Object); extern ptrdiff_t marker_byte_position (Lisp_Object); extern void clear_charpos_cache (struct buffer *); -extern ptrdiff_t charpos_to_bytepos (ptrdiff_t); extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t); extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t); extern void unchain_marker (struct Lisp_Marker *marker); === modified file 'src/marker.c' --- src/marker.c 2012-10-11 16:23:37 +0000 +++ src/marker.c 2012-12-20 16:09:05 +0000 @@ -82,9 +82,7 @@ and everywhere there is a marker. So we find the one of these places that is closest to the specified position, and scan from there. */ -/* charpos_to_bytepos returns the byte position corresponding to CHARPOS. */ - -/* This macro is a subroutine of charpos_to_bytepos. +/* This macro is a subroutine of buf_charpos_to_bytepos. Note that it is desirable that BYTEPOS is not evaluated except when we really want its value. */ @@ -128,11 +126,7 @@ } \ } -ptrdiff_t -charpos_to_bytepos (ptrdiff_t charpos) -{ - return buf_charpos_to_bytepos (current_buffer, charpos); -} +/* Return the byte position corresponding to CHARPOS in B. */ ptrdiff_t buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos) @@ -141,8 +135,7 @@ ptrdiff_t best_above, best_above_byte; ptrdiff_t best_below, best_below_byte; - if (charpos < BUF_BEG (b) || charpos > BUF_Z (b)) - emacs_abort (); + eassert (BUF_BEG (b) <= charpos && charpos <= BUF_Z (b)); best_above = BUF_Z (b); best_above_byte = BUF_Z_BYTE (b); @@ -242,9 +235,6 @@ #undef CONSIDER -/* buf_bytepos_to_charpos returns the char position corresponding to - BYTEPOS. */ - /* This macro is a subroutine of buf_bytepos_to_charpos. It is used when BYTEPOS is actually the byte position. */ @@ -288,6 +278,8 @@ } \ } +/* Return the character position corresponding to BYTEPOS in B. */ + ptrdiff_t buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos) { @@ -295,8 +287,7 @@ ptrdiff_t best_above, best_above_byte; ptrdiff_t best_below, best_below_byte; - if (bytepos < BUF_BEG_BYTE (b) || bytepos > BUF_Z_BYTE (b)) - emacs_abort (); + eassert (BUF_BEG_BYTE (b) <= bytepos && bytepos <= BUF_Z_BYTE (b)); best_above = BUF_Z (b); best_above_byte = BUF_Z_BYTE (b); === modified file 'src/process.c' --- src/process.c 2012-12-17 17:51:25 +0000 +++ src/process.c 2012-12-20 16:09:05 +0000 @@ -5556,19 +5556,19 @@ Output from processes can arrive in between bunches. */) (Lisp_Object process, Lisp_Object start, Lisp_Object end) { - Lisp_Object proc; - ptrdiff_t start1, end1; + Lisp_Object proc = get_process (process); + ptrdiff_t start_byte, end_byte; - proc = get_process (process); validate_region (&start, &end); + start_byte = CHAR_TO_BYTE (XINT (start)); + end_byte = CHAR_TO_BYTE (XINT (end)); + if (XINT (start) < GPT && XINT (end) > GPT) - move_gap (XINT (start)); + move_gap_both (XINT (start), start_byte); - start1 = CHAR_TO_BYTE (XINT (start)); - end1 = CHAR_TO_BYTE (XINT (end)); - send_process (proc, (char *) BYTE_POS_ADDR (start1), end1 - start1, - Fcurrent_buffer ()); + send_process (proc, (char *) BYTE_POS_ADDR (start_byte), + end_byte - start_byte, Fcurrent_buffer ()); return Qnil; } === modified file 'src/search.c' --- src/search.c 2012-12-11 15:30:45 +0000 +++ src/search.c 2012-12-20 16:09:05 +0000 @@ -2599,7 +2599,7 @@ ptrdiff_t begbyte = CHAR_TO_BYTE (search_regs.start[idx]); add_len = CHAR_TO_BYTE (search_regs.end[idx]) - begbyte; if (search_regs.start[idx] < GPT && GPT < search_regs.end[idx]) - move_gap (search_regs.start[idx]); + move_gap_both (search_regs.start[idx], begbyte); add_stuff = BYTE_POS_ADDR (begbyte); } ------------------------------------------------------------ revno: 111279 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-12-20 06:57:40 -0800 message: * xdisp.c (redisplay_internal): Remove now-unused local. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-12-20 14:03:34 +0000 +++ src/ChangeLog 2012-12-20 14:57:40 +0000 @@ -1,3 +1,7 @@ +2012-12-20 Paul Eggert + + * xdisp.c (redisplay_internal): Remove now-unused local. + 2012-12-20 Stefan Monnier * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove. === modified file 'src/xdisp.c' --- src/xdisp.c 2012-12-20 14:03:34 +0000 +++ src/xdisp.c 2012-12-20 14:57:40 +0000 @@ -12976,7 +12976,7 @@ ptrdiff_t count, count1; struct frame *sf; int polling_stopped_here = 0; - Lisp_Object tail, frame, old_frame = selected_frame; + Lisp_Object tail, frame; struct backtrace backtrace; /* Non-zero means redisplay has to consider all windows on all ------------------------------------------------------------ revno: 111278 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2012-12-20 09:03:34 -0500 message: * src/xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove. (redisplay_internal): Don't bother selecting the frame to get the proper value of frame-local variables. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-12-19 21:32:56 +0000 +++ etc/NEWS 2012-12-20 14:03:34 +0000 @@ -156,6 +156,10 @@ * Incompatible Lisp Changes in Emacs 24.4 +** frame-local variables that affect redisplay do not work any more. +More specifically, the redisplay does not bother to check for a frame-local +value when looking up variables. + ** nil and "unbound" are indistinguishable in symbol-function. `symbol-function' never signals `void-function' any more. `fboundp' returns non-nil if the symbol was `fset' to nil. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-12-20 08:49:21 +0000 +++ src/ChangeLog 2012-12-20 14:03:34 +0000 @@ -1,3 +1,9 @@ +2012-12-20 Stefan Monnier + + * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove. + (redisplay_internal): Don't bother selecting the frame to get the + proper value of frame-local variables. + 2012-12-20 Dmitry Antipov * textprop.c (set_text_properties_1): Do not allow NULL interval. === modified file 'src/xdisp.c' --- src/xdisp.c 2012-12-17 19:17:06 +0000 +++ src/xdisp.c 2012-12-20 14:03:34 +0000 @@ -12951,49 +12951,6 @@ } -/* Select FRAME to forward the values of frame-local variables into C - variables so that the redisplay routines can access those values - directly. */ - -static void -select_frame_for_redisplay (Lisp_Object frame) -{ - Lisp_Object tail, tem; - Lisp_Object old = selected_frame; - struct Lisp_Symbol *sym; - - eassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame))); - - selected_frame = frame; - /* If redisplay causes scrolling, it sets point in the window, so we need to - be careful with the selected-window's point handling. */ - select_window_1 (XFRAME (frame)->selected_window, 0); - - do { - for (tail = XFRAME (frame)->param_alist; - CONSP (tail); tail = XCDR (tail)) - if (CONSP (XCAR (tail)) - && (tem = XCAR (XCAR (tail)), - SYMBOLP (tem)) - && (sym = indirect_variable (XSYMBOL (tem)), - sym->redirect == SYMBOL_LOCALIZED) - && sym->val.blv->frame_local) - /* Use find_symbol_value rather than Fsymbol_value - to avoid an error if it is void. */ - find_symbol_value (tem); - } while (!EQ (frame, old) && (frame = old, 1)); -} - -/* Make sure that previously selected OLD_FRAME is selected unless it has been - deleted (by an X connection failure during redisplay, for example). */ - -static void -ensure_selected_frame (Lisp_Object frame) -{ - if (!EQ (frame, selected_frame) && FRAME_LIVE_P (XFRAME (frame))) - select_frame_for_redisplay (frame); -} - #define STOP_POLLING \ do { if (! polling_stopped_here) stop_polling (); \ polling_stopped_here = 1; } while (0) @@ -13078,12 +13035,6 @@ /* Remember the currently selected window. */ sw = w; - /* When running redisplay, we play a bit fast-and-loose and allow e.g. - selected_frame and selected_window to be temporarily out-of-sync so - when we come back here via `goto retry', we need to resync because we - may need to run Elisp code (via prepare_menu_bars). */ - ensure_selected_frame (old_frame); - pending = 0; reconsider_clip_changes (w, current_buffer); last_escape_glyph_frame = NULL; @@ -13491,9 +13442,6 @@ if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf) { - /* Select the frame, for the sake of frame-local variables. */ - ensure_selected_frame (frame); - /* Mark all the scroll bars to be removed; we'll redeem the ones we want when we redisplay their windows. */ if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook) @@ -13543,10 +13491,6 @@ } } - /* We played a bit fast-and-loose above and allowed selected_frame - and selected_window to be temporarily out-of-sync but let's make - sure this stays contained. */ - ensure_selected_frame (old_frame); eassert (EQ (XFRAME (selected_frame)->selected_window, selected_window)); if (!pending) @@ -13772,7 +13716,6 @@ unwind_redisplay (Lisp_Object old_frame) { redisplaying_p = 0; - ensure_selected_frame (old_frame); return Qnil; } ------------------------------------------------------------ revno: 111277 committer: Michael Albinus branch nick: trunk timestamp: Thu 2012-12-20 14:15:43 +0100 message: * ob.el (org-babel-temp-file): Fix setting of `temporary-file-directory' on remote hosts. * ob-eval.el (org-babel-shell-command-on-region): Use `process-file' instead of `call-process-region'. The latter one does not work on remote hosts. diff: === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2012-12-13 05:29:15 +0000 +++ lisp/org/ChangeLog 2012-12-20 13:15:43 +0000 @@ -1,3 +1,12 @@ +2012-12-20 Michael Albinus + + * ob.el (org-babel-temp-file): Fix setting of + `temporary-file-directory' on remote hosts. + + * ob-eval.el (org-babel-shell-command-on-region): Use + `process-file' instead of `call-process-region'. The latter one + does not work on remote hosts. + 2012-12-13 Bastien Guerry * org-latex.el (org-export-latex-links): Escape raw path when === modified file 'lisp/org/ob-eval.el' --- lisp/org/ob-eval.el 2012-09-30 15:14:59 +0000 +++ lisp/org/ob-eval.el 2012-12-20 13:15:43 +0000 @@ -134,14 +134,13 @@ current-prefix-arg shell-command-default-error-buffer t))) - (let ((error-file - (if error-buffer - (make-temp-file - (expand-file-name "scor" - (if (featurep 'xemacs) - (temp-directory) - temporary-file-directory))) - nil)) + (let ((input-file (org-babel-temp-file "input-")) + (error-file (if error-buffer (org-babel-temp-file "scor-") nil)) + (shell-file-name + (if (file-executable-p + (concat (file-remote-p default-directory) shell-file-name)) + shell-file-name + "/bin/sh")) exit-status) (if (or replace (and output-buffer @@ -151,12 +150,14 @@ ;; Don't muck with mark unless REPLACE says we should. (goto-char start) (and replace (push-mark (point) 'nomsg)) + (write-region start end input-file) + (delete-region start end) (setq exit-status - (call-process-region start end shell-file-name t - (if error-file - (list output-buffer error-file) - t) - nil shell-command-switch command)) + (process-file shell-file-name input-file + (if error-file + (list output-buffer error-file) + t) + nil shell-command-switch command)) ;; It is rude to delete a buffer which the command is not using. ;; (let ((shell-buffer (get-buffer "*Shell Command Output*"))) ;; (and shell-buffer (not (eq shell-buffer (current-buffer))) @@ -175,14 +176,14 @@ (progn (setq buffer-read-only nil) (delete-region (max start end) (point-max)) (delete-region (point-min) (min start end)) + (write-region (point-min) (point-max) input-file) + (delete-region (point-min) (point-max)) (setq exit-status - (call-process-region (point-min) (point-max) - shell-file-name t - (if error-file - (list t error-file) - t) - nil shell-command-switch - command))) + (process-file shell-file-name input-file + (if error-file + (list t error-file) + t) + nil shell-command-switch command))) ;; Clear the output buffer, then run the command with ;; output there. (let ((directory default-directory)) @@ -192,11 +193,11 @@ (setq default-directory directory)) (erase-buffer))) (setq exit-status - (call-process-region start end shell-file-name nil - (if error-file - (list buffer error-file) - buffer) - nil shell-command-switch command))) + (process-file shell-file-name nil + (if error-file + (list buffer error-file) + buffer) + nil shell-command-switch command))) ;; Report the output. (with-current-buffer buffer (setq mode-line-process @@ -230,6 +231,9 @@ ;; (kill-buffer buffer) )))) + (when (and input-file (file-exists-p input-file)) + (delete-file input-file)) + (when (and error-file (file-exists-p error-file)) (if (< 0 (nth 7 (file-attributes error-file))) (with-current-buffer (get-buffer-create error-buffer) === modified file 'lisp/org/ob.el' --- lisp/org/ob.el 2012-10-26 14:42:05 +0000 +++ lisp/org/ob.el 2012-12-20 13:15:43 +0000 @@ -2547,18 +2547,14 @@ Passes PREFIX and SUFFIX directly to `make-temp-file' with the value of `temporary-file-directory' temporarily set to the value of `org-babel-temporary-directory'." - (if (file-remote-p default-directory) - (make-temp-file - (concat (file-remote-p default-directory) - (expand-file-name - prefix temporary-file-directory) - nil suffix)) - (let ((temporary-file-directory + (let ((temporary-file-directory + (if (file-remote-p default-directory) + (concat (file-remote-p default-directory) "/tmp") (or (and (boundp 'org-babel-temporary-directory) (file-exists-p org-babel-temporary-directory) org-babel-temporary-directory) - temporary-file-directory))) - (make-temp-file prefix nil suffix)))) + temporary-file-directory)))) + (make-temp-file prefix nil suffix))) (defun org-babel-remove-temporary-directory () "Remove `org-babel-temporary-directory' on Emacs shutdown." ------------------------------------------------------------ revno: 111276 committer: Michael Albinus branch nick: trunk timestamp: Thu 2012-12-20 12:15:38 +0100 message: * progmodes/grep.el (rgrep): Escape command line. Sometimes, it is too long for Tramp. See discussion in . * progmodes/compile.el (compilation-start): Remove line escape template. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-20 05:05:41 +0000 +++ lisp/ChangeLog 2012-12-20 11:15:38 +0000 @@ -1,3 +1,12 @@ +2012-12-20 Michael Albinus + + * progmodes/grep.el (rgrep): Escape command line. Sometimes, it + is too long for Tramp. See discussion in + . + + * progmodes/compile.el (compilation-start): Remove line escape + template. + 2012-12-20 Dmitry Antipov * vc/ediff-ptch.el (ediff-map-patch-buffer): Use `point-min-marker'. === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2012-10-23 19:07:44 +0000 +++ lisp/progmodes/compile.el 2012-12-20 11:15:38 +0000 @@ -1611,7 +1611,11 @@ (format "%s started at %s\n\n" mode-name (substring (current-time-string) 0 19)) - command "\n") + ;; The command could be split into several lines, see + ;; `rgrep' for example. We want to display it as one + ;; line. + (apply 'concat (split-string command (regexp-quote "\\\n") t)) + "\n") (setq thisdir default-directory)) (set-buffer-modified-p nil)) ;; Pop up the compilation buffer. === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2012-11-30 07:37:23 +0000 +++ lisp/progmodes/grep.el 2012-12-20 11:15:38 +0000 @@ -992,14 +992,17 @@ (compilation-start regexp 'grep-mode)) (setq dir (file-name-as-directory (expand-file-name dir))) (require 'find-dired) ; for `find-name-arg' + ;; In Tramp, there could be problems if the command line is too + ;; long. We escape it, therefore. (let ((command (grep-expand-template grep-find-template regexp (concat (shell-quote-argument "(") " " find-name-arg " " - (mapconcat #'shell-quote-argument - (split-string files) - (concat " -o " find-name-arg " ")) + (mapconcat + #'shell-quote-argument + (split-string files) + (concat "\\\n" " -o " find-name-arg " ")) " " (shell-quote-argument ")")) dir @@ -1020,7 +1023,7 @@ (concat "*/" (cdr ignore))))))) grep-find-ignored-directories - " -o -path ") + "\\\n -o -path ") " " (shell-quote-argument ")") " -prune -o ")) @@ -1038,7 +1041,7 @@ (shell-quote-argument (cdr ignore)))))) grep-find-ignored-files - " -o -name ") + "\\\n -o -name ") " " (shell-quote-argument ")") " -prune -o ")))))) ------------------------------------------------------------ revno: 111275 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-12-20 12:49:21 +0400 message: * textprop.c (set_text_properties_1): Do not allow NULL interval. Rename 4th argument since it may be buffer or string. Adjust comment. * intervals.c (graft_intervals_info_buffer): Find an interval here. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-12-19 15:52:48 +0000 +++ src/ChangeLog 2012-12-20 08:49:21 +0000 @@ -1,3 +1,9 @@ +2012-12-20 Dmitry Antipov + + * textprop.c (set_text_properties_1): Do not allow NULL interval. + Rename 4th argument since it may be buffer or string. Adjust comment. + * intervals.c (graft_intervals_info_buffer): Find an interval here. + 2012-12-19 Dmitry Antipov * coding.c (Fdetect_coding_region): Do not check start and end with === modified file 'src/intervals.c' --- src/intervals.c 2012-10-01 06:36:54 +0000 +++ src/intervals.c 2012-12-20 08:49:21 +0000 @@ -1624,7 +1624,8 @@ XSETBUFFER (buf, buffer); set_text_properties_1 (make_number (position), make_number (position + length), - Qnil, buf, 0); + Qnil, buf, + find_interval (tree, position)); } /* Shouldn't be necessary. --Stef */ buffer_balance_intervals (buffer); === modified file 'src/textprop.c' --- src/textprop.c 2012-12-03 14:13:06 +0000 +++ src/textprop.c 2012-12-20 08:49:21 +0000 @@ -1323,14 +1323,13 @@ } /* Replace properties of text from START to END with new list of - properties PROPERTIES. BUFFER is the buffer containing + properties PROPERTIES. OBJECT is the buffer or string containing the text. This does not obey any hooks. - You can provide the interval that START is located in as I, - or pass NULL for I and this function will find it. + You should provide the interval that START is located in as I. START and END can be in any order. */ void -set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i) +set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object, INTERVAL i) { register INTERVAL prev_changed = NULL; register ptrdiff_t s, len; @@ -1349,8 +1348,7 @@ else return; - if (i == NULL) - i = find_interval (buffer_intervals (XBUFFER (buffer)), s); + eassert (i); if (i->position != s) { @@ -1361,11 +1359,11 @@ { copy_properties (unchanged, i); i = split_interval_left (i, len); - set_properties (properties, i, buffer); + set_properties (properties, i, object); return; } - set_properties (properties, i, buffer); + set_properties (properties, i, object); if (LENGTH (i) == len) return; @@ -1388,7 +1386,7 @@ /* We have to call set_properties even if we are going to merge the intervals, so as to make the undo records and cause redisplay to happen. */ - set_properties (properties, i, buffer); + set_properties (properties, i, object); if (prev_changed) merge_interval_left (i); return; @@ -1399,7 +1397,7 @@ /* We have to call set_properties even if we are going to merge the intervals, so as to make the undo records and cause redisplay to happen. */ - set_properties (properties, i, buffer); + set_properties (properties, i, object); if (!prev_changed) prev_changed = i; else ------------------------------------------------------------ revno: 111274 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-12-20 09:05:41 +0400 message: * vc/ediff-ptch.el (ediff-map-patch-buffer): Use `point-min-marker'. Adjust comment. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-19 19:51:40 +0000 +++ lisp/ChangeLog 2012-12-20 05:05:41 +0000 @@ -1,3 +1,8 @@ +2012-12-20 Dmitry Antipov + + * vc/ediff-ptch.el (ediff-map-patch-buffer): Use `point-min-marker'. + Adjust comment. + 2012-12-19 Jonas Bernoulli * emacs-lisp/lisp-mnt.el (lm-section-end): Always end before the === modified file 'lisp/vc/ediff-ptch.el' --- lisp/vc/ediff-ptch.el 2012-01-19 07:21:25 +0000 +++ lisp/vc/ediff-ptch.el 2012-12-20 05:05:41 +0000 @@ -190,15 +190,15 @@ ;; We usually come up with two candidates and ediff-file-name-sans-prefix ;; resolves this later. ;; -;; The marker `marker1' delimits the beginning of the corresponding patch and -;; `marker2' does it for the end. +;; The marker `mark1' delimits the beginning of the corresponding patch and +;; `mark2' does it for the end. ;; The result of ediff-map-patch-buffer is a list, which is then assigned ;; to ediff-patch-map. ;; The function returns the number of elements in the list ediff-patch-map (defun ediff-map-patch-buffer (buf) (ediff-with-current-buffer buf (let ((count 0) - (mark1 (move-marker (make-marker) (point-min))) + (mark1 (point-min-marker)) (mark1-end (point-min)) (possible-file-names '("/dev/null" . "/dev/null")) mark2-end mark2 filenames