Now on revision 109624. ------------------------------------------------------------ revno: 109624 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12117 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-08-15 00:02:14 -0400 message: * src/minibuf.c (read_minibuf): Ignore caller's inhibit-read-only. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 21:38:06 +0000 +++ src/ChangeLog 2012-08-15 04:02:14 +0000 @@ -1,3 +1,8 @@ +2012-08-15 Stefan Monnier + + * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only + (bug#12117). + 2012-08-14 Stefan Monnier * alloc.c (Fgarbage_collect): Use plural form consistently. === modified file 'src/minibuf.c' --- src/minibuf.c 2012-08-14 08:44:24 +0000 +++ src/minibuf.c 2012-08-15 04:02:14 +0000 @@ -408,6 +408,7 @@ Lisp_Object dummy, frame; specbind (Qminibuffer_default, defalt); + specbind (intern ("inhibit-read-only"), Qnil); /* If Vminibuffer_completing_file_name is `lambda' on entry, it was t in previous recursive minibuffer, but was not set explicitly ------------------------------------------------------------ revno: 109623 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12137 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 23:46:47 -0400 message: * lisp/textmodes/tex-mode.el (tex-insert-quote): ~ is a space. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-15 03:37:07 +0000 +++ lisp/ChangeLog 2012-08-15 03:46:47 +0000 @@ -1,3 +1,7 @@ +2012-08-15 Stefan Monnier + + * textmodes/tex-mode.el (tex-insert-quote): ~ is a space (bug#12137). + 2012-08-15 Wolfgang Jenkner * man.el (Man-overstrike-face, Man-underline-face) === modified file 'lisp/textmodes/tex-mode.el' --- lisp/textmodes/tex-mode.el 2012-08-03 02:29:59 +0000 +++ lisp/textmodes/tex-mode.el 2012-08-15 03:46:47 +0000 @@ -1286,7 +1286,8 @@ (delete-char (length tex-open-quote)) t))) (self-insert-command (prefix-numeric-value arg)) - (insert (if (memq (char-syntax (preceding-char)) '(?\( ?> ?\s)) + (insert (if (or (memq (char-syntax (preceding-char)) '(?\( ?> ?\s)) + (memq (preceding-char) '(?~))) tex-open-quote tex-close-quote)))) (defun tex-validate-buffer () ------------------------------------------------------------ revno: 109622 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12147 author: Wolfgang Jenkner committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 23:37:07 -0400 message: * lisp/man.el (Man-overstrike-face, Man-underline-face) (Man-reverse-face): Remove variables. (Man-overstrike, Man-underline, Man-reverse): New faces. (Man-fontify-manpage): Use them instead of the variables. (Man-cleanup-manpage): Comment change. (Man-ansi-color-map): New variable. (Man-fontify-manpage): Use it. Call ansi-color-apply-on-region to replace ad hoc code. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-15 03:33:55 +0000 +++ lisp/ChangeLog 2012-08-15 03:37:07 +0000 @@ -1,5 +1,14 @@ 2012-08-15 Wolfgang Jenkner + * man.el (Man-overstrike-face, Man-underline-face) + (Man-reverse-face): Remove variables. + (Man-overstrike, Man-underline, Man-reverse): New faces. + (Man-fontify-manpage): Use them instead of the variables. + (Man-cleanup-manpage): Comment change. + (Man-ansi-color-map): New variable. + (Man-fontify-manpage): Use it. + Call ansi-color-apply-on-region to replace ad hoc code (bug#12147). + Implement ANSI SGR parameters 22-27 (bug#12146). * ansi-color.el (ansi-colors): Doc fix. (ansi-color-context, ansi-color-context-region): Doc fix. === modified file 'lisp/man.el' --- lisp/man.el 2012-08-09 13:37:31 +0000 +++ lisp/man.el 2012-08-15 03:37:07 +0000 @@ -88,6 +88,7 @@ ;;; Code: +(require 'ansi-color) (require 'button) (defgroup man nil @@ -124,20 +125,29 @@ :type 'boolean :group 'man) -(defcustom Man-overstrike-face 'bold +(defface Man-overstrike + '((t (:inherit bold))) "Face to use when fontifying overstrike." - :type 'face - :group 'man) + :group 'man + :version "24.2") -(defcustom Man-underline-face 'underline +(defface Man-underline + '((t (:inherit underline))) "Face to use when fontifying underlining." - :type 'face - :group 'man) + :group 'man + :version "24.2") -(defcustom Man-reverse-face 'highlight +(defface Man-reverse + '((t (:inherit highlight))) "Face to use when fontifying reverse video." - :type 'face - :group 'man) + :group 'man + :version "24.2") + +(defvar Man-ansi-color-map (let ((ansi-color-faces-vector + [ default Man-overstrike default Man-underline + Man-underline default default Man-reverse ])) + (ansi-color-make-color-map)) + "The value used here for `ansi-color-map'.") ;; Use the value of the obsolete user option Man-notify, if set. (defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly) @@ -962,7 +972,6 @@ Man-width) (Man-width (frame-width)) ((window-width)))))) - (setenv "GROFF_NO_SGR" "1") ;; Since man-db 2.4.3-1, man writes plain text with no escape ;; sequences when stdout is not a tty. In 2.5.0, the following ;; env-var was added to allow control of this (see Debian Bug#340673). @@ -1050,38 +1059,12 @@ (message "Please wait: formatting the %s man page..." Man-arguments) (goto-char (point-min)) ;; Fontify ANSI escapes. - (let ((faces nil) - (buffer-undo-list t) - (start (point))) - ;; http://www.isthe.com/chongo/tech/comp/ansi_escapes.html - ;; suggests many codes, but we only handle: - ;; ESC [ 00 m reset to normal display - ;; ESC [ 01 m bold - ;; ESC [ 04 m underline - ;; ESC [ 07 m reverse-video - ;; ESC [ 22 m no-bold - ;; ESC [ 24 m no-underline - ;; ESC [ 27 m no-reverse-video - (while (re-search-forward "\e\\[0?\\([1470]\\|2\\([247]\\)\\)m" nil t) - (if faces (put-text-property start (match-beginning 0) 'face - (if (cdr faces) faces (car faces)))) - (setq faces - (cond - ((match-beginning 2) - (delq (pcase (char-after (match-beginning 2)) - (?2 Man-overstrike-face) - (?4 Man-underline-face) - (?7 Man-reverse-face)) - faces)) - ((eq (char-after (match-beginning 1)) ?0) nil) - (t - (cons (pcase (char-after (match-beginning 1)) - (?1 Man-overstrike-face) - (?4 Man-underline-face) - (?7 Man-reverse-face)) - faces)))) - (delete-region (match-beginning 0) (match-end 0)) - (setq start (point)))) + (let ((ansi-color-apply-face-function + (lambda (beg end face) + (when face + (put-text-property beg end 'face face)))) + (ansi-color-map Man-ansi-color-map)) + (ansi-color-apply-on-region (point-min) (point-max))) ;; Other highlighting. (let ((buffer-undo-list t)) (if (< (buffer-size) (position-bytes (point-max))) @@ -1090,23 +1073,23 @@ (goto-char (point-min)) (while (search-forward "__\b\b" nil t) (backward-delete-char 4) - (put-text-property (point) (1+ (point)) 'face Man-underline-face)) + (put-text-property (point) (1+ (point)) 'face 'Man-underline)) (goto-char (point-min)) (while (search-forward "\b\b__" nil t) (backward-delete-char 4) - (put-text-property (1- (point)) (point) 'face Man-underline-face)))) + (put-text-property (1- (point)) (point) 'face 'Man-underline)))) (goto-char (point-min)) (while (search-forward "_\b" nil t) (backward-delete-char 2) - (put-text-property (point) (1+ (point)) 'face Man-underline-face)) + (put-text-property (point) (1+ (point)) 'face 'Man-underline)) (goto-char (point-min)) (while (search-forward "\b_" nil t) (backward-delete-char 2) - (put-text-property (1- (point)) (point) 'face Man-underline-face)) + (put-text-property (1- (point)) (point) 'face 'Man-underline)) (goto-char (point-min)) (while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t) (replace-match "\\1") - (put-text-property (1- (point)) (point) 'face Man-overstrike-face)) + (put-text-property (1- (point)) (point) 'face 'Man-overstrike)) (goto-char (point-min)) (while (re-search-forward "o\b\\+\\|\\+\bo" nil t) (replace-match "o") @@ -1117,7 +1100,7 @@ (put-text-property (1- (point)) (point) 'face 'bold)) ;; When the header is longer than the manpage name, groff tries to ;; condense it to a shorter line interspersed with ^H. Remove ^H with - ;; their preceding chars (but don't put Man-overstrike-face). (Bug#5566) + ;; their preceding chars (but don't put Man-overstrike). (Bug#5566) (goto-char (point-min)) (while (re-search-forward ".\b" nil t) (backward-delete-char 2)) (goto-char (point-min)) @@ -1128,7 +1111,7 @@ (while (re-search-forward Man-heading-regexp nil t) (put-text-property (match-beginning 0) (match-end 0) - 'face Man-overstrike-face))) + 'face 'Man-overstrike))) (message "%s man page formatted" (Man-page-from-arguments Man-arguments))) (defun Man-highlight-references (&optional xref-man-type) @@ -1211,7 +1194,7 @@ (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) (replace-match "+")) ;; When the header is longer than the manpage name, groff tries to ;; condense it to a shorter line interspersed with ^H. Remove ^H with - ;; their preceding chars (but don't put Man-overstrike-face). (Bug#5566) + ;; their preceding chars (but don't put Man-overstrike). (Bug#5566) (goto-char (point-min)) (while (re-search-forward ".\b" nil t) (backward-delete-char 2)) (Man-softhyphen-to-minus) ------------------------------------------------------------ revno: 109621 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12146 author: Wolfgang Jenkner committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 23:33:55 -0400 message: Implement ANSI SGR parameters 22-27. * lisp/ansi-color.el (ansi-colors): Doc fix. (ansi-color-context, ansi-color-context-region): Doc fix. (ansi-color--find-face): New function. (ansi-color-apply, ansi-color-apply-on-region): Use it. Rename the local variable `face' to `codes' since it is now a list of ansi codes. Doc fix. (ansi-color-get-face): Remove. (ansi-color-parse-sequence): New function, derived from ansi-color-get-face. (ansi-color-apply-sequence): Use it. Rewrite, and support ansi codes 22-27. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 21:48:52 +0000 +++ lisp/ChangeLog 2012-08-15 03:33:55 +0000 @@ -1,3 +1,18 @@ +2012-08-15 Wolfgang Jenkner + + Implement ANSI SGR parameters 22-27 (bug#12146). + * ansi-color.el (ansi-colors): Doc fix. + (ansi-color-context, ansi-color-context-region): Doc fix. + (ansi-color--find-face): New function. + (ansi-color-apply, ansi-color-apply-on-region): Use it. + Rename the local variable `face' to `codes' since it is now a list of + ansi codes. Doc fix. + (ansi-color-get-face): Remove. + (ansi-color-parse-sequence): New function, derived from + ansi-color-get-face. + (ansi-color-apply-sequence): Use it. Rewrite, and support ansi + codes 22-27. + 2012-08-14 Stefan Monnier * subr.el (read-passwd): Allow use from a minibuffer. === modified file 'lisp/ansi-color.el' --- lisp/ansi-color.el 2012-06-23 09:28:10 +0000 +++ lisp/ansi-color.el 2012-08-15 03:33:55 +0000 @@ -83,7 +83,7 @@ "Translating SGR control sequences to faces. This translation effectively colorizes strings and regions based upon SGR control sequences embedded in the text. SGR (Select Graphic -Rendition) control sequences are defined in section 3.8.117 of the +Rendition) control sequences are defined in section 8.3.117 of the ECMA-48 standard \(identical to ISO/IEC 6429), which is freely available as a PDF file ." :version "21.1" @@ -236,9 +236,10 @@ ;; Working with strings (defvar ansi-color-context nil "Context saved between two calls to `ansi-color-apply'. -This is a list of the form (FACES FRAGMENT) or nil. FACES is a list of -faces the last call to `ansi-color-apply' ended with, and FRAGMENT is a -string starting with an escape sequence, possibly the start of a new +This is a list of the form (CODES FRAGMENT) or nil. CODES +represents the state the last call to `ansi-color-apply' ended +with, currently a list of ansi codes, and FRAGMENT is a string +starting with an escape sequence, possibly the start of a new escape sequence.") (make-variable-buffer-local 'ansi-color-context) @@ -270,6 +271,20 @@ (setq ansi-color-context (if fragment (list nil fragment)))) result)) +(defun ansi-color--find-face (codes) + "Return the face corresponding to CODES." + (let (faces) + (while codes + (let ((face (ansi-color-get-face-1 (pop codes)))) + ;; In the (default underline) face, say, the value of the + ;; "underline" attribute of the `default' face wins. + (unless (eq face 'default) + (push face faces)))) + ;; Avoid some long-lived conses in the common case. + (if (cdr faces) + (nreverse faces) + (car faces)))) + (defun ansi-color-apply (string) "Translates SGR control sequences into text properties. Delete all other control sequences without processing them. @@ -280,12 +295,12 @@ See function `ansi-color-apply-sequence' for details. Every call to this function will set and use the buffer-local variable -`ansi-color-context' to save partial escape sequences and current face. +`ansi-color-context' to save partial escape sequences and current ansi codes. This information will be used for the next call to `ansi-color-apply'. Set `ansi-color-context' to nil if you don't want this. This function can be added to `comint-preoutput-filter-functions'." - (let ((face (car ansi-color-context)) + (let ((codes (car ansi-color-context)) (start 0) end escape-sequence result colorized-substring) ;; If context was saved and is a string, prepend it. @@ -296,8 +311,8 @@ (while (setq end (string-match ansi-color-regexp string start)) (setq escape-sequence (match-string 1 string)) ;; Colorize the old block from start to end using old face. - (when face - (put-text-property start end 'font-lock-face face string)) + (when codes + (put-text-property start end 'font-lock-face (ansi-color--find-face codes) string)) (setq colorized-substring (substring string start end) start (match-end 0)) ;; Eliminate unrecognized ANSI sequences. @@ -306,10 +321,10 @@ (replace-match "" nil nil colorized-substring))) (push colorized-substring result) ;; Create new face, by applying escape sequence parameters. - (setq face (ansi-color-apply-sequence escape-sequence face))) + (setq codes (ansi-color-apply-sequence escape-sequence codes))) ;; if the rest of the string should have a face, put it there - (when face - (put-text-property start (length string) 'font-lock-face face string)) + (when codes + (put-text-property start (length string) 'font-lock-face (ansi-color--find-face codes) string)) ;; save context, add the remainder of the string to the result (let (fragment) (if (string-match "\033" string start) @@ -317,17 +332,18 @@ (setq fragment (substring string pos)) (push (substring string start pos) result)) (push (substring string start) result)) - (setq ansi-color-context (if (or face fragment) (list face fragment)))) + (setq ansi-color-context (if (or codes fragment) (list codes fragment)))) (apply 'concat (nreverse result)))) ;; Working with regions (defvar ansi-color-context-region nil "Context saved between two calls to `ansi-color-apply-on-region'. -This is a list of the form (FACES MARKER) or nil. FACES is a list of -faces the last call to `ansi-color-apply-on-region' ended with, and -MARKER is a buffer position within an escape sequence or the last -position processed.") +This is a list of the form (CODES MARKER) or nil. CODES +represents the state the last call to `ansi-color-apply-on-region' +ended with, currently a list of ansi codes, and MARKER is a +buffer position within an escape sequence or the last position +processed.") (make-variable-buffer-local 'ansi-color-context-region) (defun ansi-color-filter-region (begin end) @@ -365,13 +381,14 @@ in `ansi-color-faces-vector' and `ansi-color-names-vector'. See `ansi-color-apply-sequence' for details. -Every call to this function will set and use the buffer-local variable -`ansi-color-context-region' to save position and current face. This -information will be used for the next call to -`ansi-color-apply-on-region'. Specifically, it will override BEGIN, the -start of the region and set the face with which to start. Set -`ansi-color-context-region' to nil if you don't want this." - (let ((face (car ansi-color-context-region)) +Every call to this function will set and use the buffer-local +variable `ansi-color-context-region' to save position and current +ansi codes. This information will be used for the next call to +`ansi-color-apply-on-region'. Specifically, it will override +BEGIN, the start of the region and set the face with which to +start. Set `ansi-color-context-region' to nil if you don't want +this." + (let ((codes (car ansi-color-context-region)) (start-marker (or (cadr ansi-color-context-region) (copy-marker begin))) (end-marker (copy-marker end)) @@ -388,28 +405,27 @@ ;; Colorize the old block from start to end using old face. (funcall ansi-color-apply-face-function start-marker (match-beginning 0) - face) + (ansi-color--find-face codes)) ;; store escape sequence and new start position (setq escape-sequence (match-string 1) start-marker (copy-marker (match-end 0))) ;; delete the escape sequence (replace-match "") - ;; create new face by applying all the parameters in the escape - ;; sequence - (setq face (ansi-color-apply-sequence escape-sequence face))) + ;; Update the list of ansi codes. + (setq codes (ansi-color-apply-sequence escape-sequence codes))) ;; search for the possible start of a new escape sequence (if (re-search-forward "\033" end-marker t) (progn ;; if the rest of the region should have a face, put it there (funcall ansi-color-apply-face-function - start-marker (point) face) - ;; save face and point + start-marker (point) (ansi-color--find-face codes)) + ;; save codes and point (setq ansi-color-context-region - (list face (copy-marker (match-beginning 0))))) + (list codes (copy-marker (match-beginning 0))))) ;; if the rest of the region should have a face, put it there (funcall ansi-color-apply-face-function - start-marker end-marker face) - (setq ansi-color-context-region (if face (list face))))))) + start-marker end-marker (ansi-color--find-face codes)) + (setq ansi-color-context-region (if codes (list codes))))))) (defun ansi-color-apply-overlay-face (beg end face) "Make an overlay from BEG to END, and apply face FACE. @@ -497,32 +513,56 @@ ;; Helper functions -(defun ansi-color-apply-sequence (escape-sequence faces) - "Apply ESCAPE-SEQ to FACES and return the new list of faces. - -ESCAPE-SEQ is an escape sequences parsed by `ansi-color-get-face'. - -If the new faces start with the symbol `default', then the new -faces are returned. If the faces start with something else, -they are appended to the front of the FACES list, and the new -list of faces is returned. - -If `ansi-color-get-face' returns nil, then we either got a -null-sequence, or we stumbled upon some garbage. In either -case we return nil." - (let ((new-faces (ansi-color-get-face escape-sequence))) - (cond ((null new-faces) - nil) - ((eq (car new-faces) 'default) - (cdr new-faces)) - (t - ;; Like (append NEW-FACES FACES) - ;; but delete duplicates in FACES. - (let ((modified-faces (copy-sequence faces))) - (dolist (face (nreverse new-faces)) - (setq modified-faces (delete face modified-faces)) - (push face modified-faces)) - modified-faces))))) +(defsubst ansi-color-parse-sequence (escape-seq) + "Return the list of all the parameters in ESCAPE-SEQ. + +ESCAPE-SEQ is a SGR control sequences such as \\033[34m. The parameter +34 is used by `ansi-color-get-face-1' to return a face definition. + +Returns nil only if there's no match for `ansi-color-parameter-regexp'." + (let ((i 0) + codes val) + (while (string-match ansi-color-parameter-regexp escape-seq i) + (setq i (match-end 0) + val (string-to-number (match-string 1 escape-seq) 10)) + ;; It so happens that (string-to-number "") => 0. + (push val codes)) + (nreverse codes))) + +(defun ansi-color-apply-sequence (escape-sequence codes) + "Apply ESCAPE-SEQ to CODES and return the new list of codes. + +ESCAPE-SEQ is an escape sequence parsed by `ansi-color-parse-sequence'. + +If the new codes resulting from ESCAPE-SEQ start with 0, then the +old codes are discarded and the remaining new codes are +processed. Otherwise, for each new code: if it is 21-25 or 27-29 +delete appropriate parameters from the list of codes; any other +code that makes sense is added to the list of codes. Finally, +the so changed list of codes is returned." + (let ((new-codes (ansi-color-parse-sequence escape-sequence))) + (while new-codes + (setq codes + (let ((new (pop new-codes))) + (cond ((zerop new) + nil) + ((or (<= new 20) + (>= new 30)) + (if (memq new codes) + codes + (cons new codes))) + ;; The standard says `21 doubly underlined' while + ;; http://en.wikipedia.org/wiki/ANSI_escape_code claims + ;; `21 Bright/Bold: off or Underline: Double'. + ((/= new 26) + (remq (- new 20) + (cond ((= new 22) + (remq 1 codes)) + ((= new 25) + (remq 6 codes)) + (t codes)))) + (t codes))))) + codes)) (defun ansi-color-make-color-map () "Creates a vector of face definitions and returns it. @@ -588,28 +628,6 @@ (aref ansi-color-map ansi-code) (args-out-of-range nil))) -(defun ansi-color-get-face (escape-seq) - "Create a new face by applying all the parameters in ESCAPE-SEQ. - -Should any of the parameters result in the default face (usually this is -the parameter 0), then the effect of all previous parameters is canceled. - -ESCAPE-SEQ is a SGR control sequences such as \\033[34m. The parameter -34 is used by `ansi-color-get-face-1' to return a face definition." - (let ((i 0) - f val) - (while (string-match ansi-color-parameter-regexp escape-seq i) - (setq i (match-end 0) - val (ansi-color-get-face-1 - (string-to-number (match-string 1 escape-seq) 10))) - (cond ((not val)) - ((eq val 'default) - (setq f (list val))) - (t - (unless (member val f) - (push val f))))) - f)) - (provide 'ansi-color) ;;; ansi-color.el ends here ------------------------------------------------------------ revno: 109620 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 17:48:52 -0400 message: * lisp/subr.el (read-passwd): Allow use from a minibuffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 18:48:39 +0000 +++ lisp/ChangeLog 2012-08-14 21:48:52 +0000 @@ -1,3 +1,7 @@ +2012-08-14 Stefan Monnier + + * subr.el (read-passwd): Allow use from a minibuffer. + 2012-08-14 Eli Zaretskii * tooltip.el (tooltip-identifier-from-point): Don't treat tokens @@ -13,8 +17,8 @@ * progmodes/gdb-mi.el (gdb-tooltip-print): Don't ignore error messages from GDB, pop them up in a tooltip to give feedback to user. - (gdb-tooltip-print-1): Quote the expression to evaluate. This - allows to evaluate expressions with embedded whitespace. + (gdb-tooltip-print-1): Quote the expression to evaluate. + This allows to evaluate expressions with embedded whitespace. (gdb-inferior-io--init-proc): Don't send "-inferior-tty" command if the TTY name is nil or empty (which happens when communicating with the inferior via pipes, e.g. on MS-Windows). === modified file 'lisp/subr.el' --- lisp/subr.el 2012-08-14 04:37:00 +0000 +++ lisp/subr.el 2012-08-14 21:48:52 +0000 @@ -2182,7 +2182,8 @@ (set (make-local-variable 'post-self-insert-hook) nil) (add-hook 'after-change-functions hide-chars-fun nil 'local)) (unwind-protect - (read-string prompt nil t default) ; t = "no history" + (let ((enable-recursive-minibuffers t)) + (read-string prompt nil t default)) ; t = "no history" (when (buffer-live-p minibuf) (with-current-buffer minibuf ;; Not sure why but it seems that there might be cases where the ------------------------------------------------------------ revno: 109619 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 17:38:06 -0400 message: * src/alloc.c (Fgarbage_collect): Use plural form consistently. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 18:25:47 +0000 +++ src/ChangeLog 2012-08-14 21:38:06 +0000 @@ -1,3 +1,7 @@ +2012-08-14 Stefan Monnier + + * alloc.c (Fgarbage_collect): Use plural form consistently. + 2012-08-14 Eli Zaretskii * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each === modified file 'src/alloc.c' --- src/alloc.c 2012-08-14 04:49:18 +0000 +++ src/alloc.c 2012-08-14 21:38:06 +0000 @@ -228,7 +228,7 @@ #define PURE_POINTER_P(P) \ ((uintptr_t) (P) - (uintptr_t) purebeg <= pure_size) -/* Index in pure at which next pure Lisp object will be allocated.. */ +/* Index in pure at which next pure Lisp object will be allocated.. */ static ptrdiff_t pure_bytes_used_lisp; @@ -254,6 +254,14 @@ static ptrdiff_t stack_copy_size; #endif +static Lisp_Object Qconses; +static Lisp_Object Qsymbols; +static Lisp_Object Qmiscs; +static Lisp_Object Qstrings; +static Lisp_Object Qvectors; +static Lisp_Object Qfloats; +static Lisp_Object Qintervals; +static Lisp_Object Qbuffers; static Lisp_Object Qstring_bytes, Qvector_slots, Qheap; static Lisp_Object Qgc_cons_threshold; Lisp_Object Qchar_table_extra_slots; @@ -5386,9 +5394,9 @@ char stack_top_variable; ptrdiff_t i; int message_p; - Lisp_Object total[11]; ptrdiff_t count = SPECPDL_INDEX (); EMACS_TIME start; + Lisp_Object retval = Qnil; if (abort_on_gc) abort (); @@ -5607,59 +5615,62 @@ } unbind_to (count, Qnil); - - total[0] = list4 (Qcons, make_number (sizeof (struct Lisp_Cons)), - bounded_number (total_conses), - bounded_number (total_free_conses)); - - total[1] = list4 (Qsymbol, make_number (sizeof (struct Lisp_Symbol)), - bounded_number (total_symbols), - bounded_number (total_free_symbols)); - - total[2] = list4 (Qmisc, make_number (sizeof (union Lisp_Misc)), - bounded_number (total_markers), - bounded_number (total_free_markers)); - - total[3] = list4 (Qstring, make_number (sizeof (struct Lisp_String)), - bounded_number (total_strings), - bounded_number (total_free_strings)); - - total[4] = list3 (Qstring_bytes, make_number (1), - bounded_number (total_string_bytes)); - - total[5] = list3 (Qvector, make_number (sizeof (struct Lisp_Vector)), - bounded_number (total_vectors)); - - total[6] = list4 (Qvector_slots, make_number (word_size), - bounded_number (total_vector_slots), - bounded_number (total_free_vector_slots)); - - total[7] = list4 (Qfloat, make_number (sizeof (struct Lisp_Float)), - bounded_number (total_floats), - bounded_number (total_free_floats)); - - total[8] = list4 (Qinterval, make_number (sizeof (struct interval)), - bounded_number (total_intervals), - bounded_number (total_free_intervals)); - - total[9] = list3 (Qbuffer, make_number (sizeof (struct buffer)), - bounded_number (total_buffers)); - - total[10] = list4 (Qheap, make_number (1024), + { + Lisp_Object total[11]; + int total_size = 10; + + total[0] = list4 (Qconses, make_number (sizeof (struct Lisp_Cons)), + bounded_number (total_conses), + bounded_number (total_free_conses)); + + total[1] = list4 (Qsymbols, make_number (sizeof (struct Lisp_Symbol)), + bounded_number (total_symbols), + bounded_number (total_free_symbols)); + + total[2] = list4 (Qmiscs, make_number (sizeof (union Lisp_Misc)), + bounded_number (total_markers), + bounded_number (total_free_markers)); + + total[3] = list4 (Qstrings, make_number (sizeof (struct Lisp_String)), + bounded_number (total_strings), + bounded_number (total_free_strings)); + + total[4] = list3 (Qstring_bytes, make_number (1), + bounded_number (total_string_bytes)); + + total[5] = list3 (Qvectors, make_number (sizeof (struct Lisp_Vector)), + bounded_number (total_vectors)); + + total[6] = list4 (Qvector_slots, make_number (word_size), + bounded_number (total_vector_slots), + bounded_number (total_free_vector_slots)); + + total[7] = list4 (Qfloats, make_number (sizeof (struct Lisp_Float)), + bounded_number (total_floats), + bounded_number (total_free_floats)); + + total[8] = list4 (Qintervals, make_number (sizeof (struct interval)), + bounded_number (total_intervals), + bounded_number (total_free_intervals)); + + total[9] = list3 (Qbuffers, make_number (sizeof (struct buffer)), + bounded_number (total_buffers)); + #ifdef DOUG_LEA_MALLOC - bounded_number ((mallinfo ().uordblks + 1023) >> 10), - bounded_number ((mallinfo ().fordblks + 1023) >> 10) -#else - Qnil, Qnil + total_size++; + total[10] = list4 (Qheap, make_number (1024), + bounded_number ((mallinfo ().uordblks + 1023) >> 10), + bounded_number ((mallinfo ().fordblks + 1023) >> 10)); #endif - ); + retval = Flist (total_size, total); + } #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES { /* Compute average percentage of zombies. */ - double nlive = - (total_conses + total_symbols + total_markers + total_strings - + total_vectors + total_floats + total_intervals + total_buffers); + double nlive + = (total_conses + total_symbols + total_markers + total_strings + + total_vectors + total_floats + total_intervals + total_buffers); avg_live = (avg_live * ngcs + nlive) / (ngcs + 1); max_live = max (nlive, max_live); @@ -5686,7 +5697,7 @@ gcs_done++; - return Flist (sizeof total / sizeof *total, total); + return retval; } @@ -6804,6 +6815,14 @@ doc: /* Non-nil means Emacs cannot get much more Lisp memory. */); Vmemory_full = Qnil; + DEFSYM (Qconses, "conses"); + DEFSYM (Qsymbols, "symbols"); + DEFSYM (Qmiscs, "miscs"); + DEFSYM (Qstrings, "strings"); + DEFSYM (Qvectors, "vectors"); + DEFSYM (Qfloats, "floats"); + DEFSYM (Qintervals, "intervals"); + DEFSYM (Qbuffers, "buffers"); DEFSYM (Qstring_bytes, "string-bytes"); DEFSYM (Qvector_slots, "vector-slots"); DEFSYM (Qheap, "heap"); ------------------------------------------------------------ revno: 109618 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-08-14 22:44:55 +0300 message: Fix compiler warning in keyboard.c. diff: === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-14 19:11:45 +0000 +++ src/keyboard.c 2012-08-14 19:44:55 +0000 @@ -8441,7 +8441,9 @@ read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps, Lisp_Object prev_event, int *used_mouse_menu) { +#ifdef HAVE_MENUS ptrdiff_t mapno; +#endif if (used_mouse_menu) *used_mouse_menu = 0; ------------------------------------------------------------ revno: 109617 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-08-14 22:11:45 +0300 message: Fix last change in keyboard.c. diff: === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-14 18:25:47 +0000 +++ src/keyboard.c 2012-08-14 19:11:45 +0000 @@ -1393,11 +1393,14 @@ Vdeactivate_mark = Qnil; +#if defined (HAVE_MOUSE) || defined (HAVE_GPM) + /* Don't ignore mouse movements for more than a single command loop. (This flag is set in xdisp.c whenever the tool bar is resized, because the resize moves text up or down, and would generate false mouse drag events if we don't ignore them.) */ ignore_mouse_drag_p = 0; +#endif /* If minibuffer on and echo area in use, wait a short time and redraw minibuffer. */ ------------------------------------------------------------ revno: 109616 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-08-14 21:48:39 +0300 message: Fix and improve GUD Tooltip mode. lisp/tooltip.el (tooltip-identifier-from-point): Don't treat tokens inside comments and strings as identifiers. lisp/progmodes/gud.el (gud-tooltip-print-command): Quote the expression to evaluate. This allows to evaluate expressions with embedded whitespace. (gud-tooltip-tips): Add a blank before the newline in the message-box text, for the benefit of message-box emulation on MS-Windows. lisp/progmodes/gdb-mi.el (gdb-tooltip-print): Don't ignore error messages from GDB, pop them up in a tooltip to give feedback to user. (gdb-tooltip-print-1): Quote the expression to evaluate. This allows to evaluate expressions with embedded whitespace. (gdb-inferior-io--init-proc): Don't send "-inferior-tty" command if the TTY name is nil or empty (which happens when communicating with the inferior via pipes, e.g. on MS-Windows). (gdb-internals): If GDB sends a "&\n" empty debugging message, don't send that to the GUD buffer. doc/emacs/building.texi (Debugger Operation): Correct and improve documentation of the GUD Tooltip mode. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-08-09 07:15:04 +0000 +++ doc/emacs/ChangeLog 2012-08-14 18:48:39 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Eli Zaretskii + + * building.texi (Debugger Operation): Correct and improve + documentation of the GUD Tooltip mode. + 2012-07-31 Chong Yidong * emacs.texi: Fix ISBN (Bug#12080). === modified file 'doc/emacs/building.texi' --- doc/emacs/building.texi 2012-06-17 05:13:40 +0000 +++ doc/emacs/building.texi 2012-08-14 18:48:39 +0000 @@ -588,19 +588,25 @@ GUD Tooltip mode is a global minor mode that adds tooltip support to GUD. To toggle this mode, type @kbd{M-x gud-tooltip-mode}. It is disabled by default. If enabled, you can move the mouse cursor over a -variable to show its value in a tooltip (@pxref{Tooltips}); this takes -effect in the GUD interaction buffer, and in all source buffers with -major modes listed in the variable @code{gud-tooltip-modes}. If the -variable @code{gud-tooltip-echo-area} is non-@code{nil}, values are -shown in the echo area instead of a tooltip. +variable, a function, or a macro (collectively called +@dfn{identifiers}) to show their values in tooltips +(@pxref{Tooltips}). Alternatively, mark an identifier or an +expression by dragging the mouse over it, then leave the mouse in the +marked area to have the value of the expression displayed in a +tooltip. The GUD Tooltip mode takes effect in the GUD interaction +buffer, and in all source buffers with major modes listed in the +variable @code{gud-tooltip-modes}. If the variable +@code{gud-tooltip-echo-area} is non-@code{nil}, or if you turned off +the tooltip mode, values are shown in the echo area instead of a +tooltip. - When using GUD Tooltip mode with @kbd{M-x gud-gdb}, you should note -that displaying an expression's value in GDB can sometimes expand a -macro, potentially causing side effects in the debugged program. If -you use the @kbd{M-x gdb} interface, this problem does not occur, as -there is special code to avoid side-effects; furthermore, you can -display macro definitions associated with an identifier when the -program is not executing. + When using GUD Tooltip mode with @kbd{M-x gud-gdb}, displaying an +expression's value in GDB can sometimes expand a macro, potentially +causing side effects in the debugged program. For that reason, using +tooltips in @code{gud-gdb} is disabled. If you use the @kbd{M-x gdb} +interface, this problem does not occur, as there is special code to +avoid side-effects; furthermore, you can display macro definitions +associated with an identifier when the program is not executing. @node Commands of GUD @subsection Commands of GUD === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 18:23:10 +0000 +++ lisp/ChangeLog 2012-08-14 18:48:39 +0000 @@ -1,3 +1,26 @@ +2012-08-14 Eli Zaretskii + + * tooltip.el (tooltip-identifier-from-point): Don't treat tokens + inside comments and strings as identifiers. + + * progmodes/gud.el (gud-tooltip-print-command): Quote the + expression to evaluate. This allows to evaluate expressions with + embedded whitespace. + (gud-tooltip-tips): Add a blank before the newline in the + message-box text, for the benefit of message-box emulation on + MS-Windows. + + * progmodes/gdb-mi.el (gdb-tooltip-print): Don't ignore error + messages from GDB, pop them up in a tooltip to give feedback to + user. + (gdb-tooltip-print-1): Quote the expression to evaluate. This + allows to evaluate expressions with embedded whitespace. + (gdb-inferior-io--init-proc): Don't send "-inferior-tty" command + if the TTY name is nil or empty (which happens when communicating + with the inferior via pipes, e.g. on MS-Windows). + (gdb-internals): If GDB sends a "&\n" empty debugging message, + don't send that to the GUD buffer. + 2012-08-14 Glenn Morris * emacs-lisp/bytecomp.el (byte-compile-setq-default): === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2012-07-28 15:12:12 +0000 +++ lisp/progmodes/gdb-mi.el 2012-08-14 18:48:39 +0000 @@ -944,11 +944,16 @@ (defun gdb-tooltip-print (expr) (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) (goto-char (point-min)) - (if (re-search-forward ".*value=\\(\".*\"\\)" nil t) - (tooltip-show - (concat expr " = " (read (match-string 1))) - (or gud-tooltip-echo-area - (not (display-graphic-p))))))) + (cond + ((re-search-forward ".*value=\\(\".*\"\\)" nil t) + (tooltip-show + (concat expr " = " (read (match-string 1))) + (or gud-tooltip-echo-area + (not (display-graphic-p))))) + ((re-search-forward "msg=\\(\".+\"\\)$" nil t) + (tooltip-show (read (match-string 1)) + (or gud-tooltip-echo-area + (not (display-graphic-p)))))))) ;; If expr is a macro for a function don't print because of possible dangerous ;; side-effects. Also printing a function within a tooltip generates an @@ -958,7 +963,7 @@ (goto-char (point-min)) (if (search-forward "expands to: " nil t) (unless (looking-at "\\S-+.*(.*).*") - (gdb-input (concat "-data-evaluate-expression " expr) + (gdb-input (concat "-data-evaluate-expression \"" expr "\"") `(lambda () (gdb-tooltip-print ,expr))))))) (defun gdb-init-buffer () @@ -1513,12 +1518,13 @@ ;; Set up inferior I/O. Needs GDB 6.4 onwards. (set-process-filter proc 'gdb-inferior-filter) (set-process-sentinel proc 'gdb-inferior-io-sentinel) - (gdb-input - (concat "-inferior-tty-set " - ;; The process can run on a remote host. - (or (process-get proc 'remote-tty) - (process-tty-name proc))) - 'ignore)) + ;; The process can run on a remote host. + (let ((tty (or (process-get proc 'remote-tty) + (process-tty-name proc)))) + (unless (or (null tty) + (string= tty "")) + (gdb-input + (concat "-inferior-tty-set " tty) 'ignore)))) (defun gdb-inferior-io-sentinel (proc str) (when (eq (process-status proc) 'failed) @@ -2100,13 +2106,15 @@ (setq gdb-filter-output (gdb-concat-output gdb-filter-output - (let ((error-message - (read output-field))) - (put-text-property - 0 (length error-message) - 'face font-lock-warning-face - error-message) - error-message)))) + (if (string= output-field "\"\\n\"") + "" + (let ((error-message + (read output-field))) + (put-text-property + 0 (length error-message) + 'face font-lock-warning-face + error-message) + error-message))))) ;; Remove the trimmings from the console stream and send to GUD buffer ;; (frontend MI commands should not print to this stream) === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2012-07-11 23:13:41 +0000 +++ lisp/progmodes/gud.el 2012-08-14 18:48:39 +0000 @@ -3411,7 +3411,7 @@ (defun gud-tooltip-print-command (expr) "Return a suitable command to print the expression EXPR." (pcase gud-minor-mode - (`gdbmi (concat "-data-evaluate-expression " expr)) + (`gdbmi (concat "-data-evaluate-expression \"" expr "\"")) (`dbx (concat "print " expr)) ((or `xdb `pdb) (concat "p " expr)) (`sdb (concat expr "/")))) @@ -3456,7 +3456,10 @@ (let ((cmd (gud-tooltip-print-command expr))) (when (and gud-tooltip-mode (eq gud-minor-mode 'gdb)) (gud-tooltip-mode -1) - (message-box "Using GUD tooltips in this mode is unsafe\n\ + ;; The blank before the newline is for MS-Windows, + ;; whose emulation of message box removes newlines and + ;; displays a single long line. + (message-box "Using GUD tooltips in this mode is unsafe \n\ so they have been disabled.")) (unless (null cmd) ; CMD can be nil if unknown debugger (if (eq gud-minor-mode 'gdbmi) === modified file 'lisp/tooltip.el' --- lisp/tooltip.el 2012-05-13 03:05:06 +0000 +++ lisp/tooltip.el 2012-08-14 18:48:39 +0000 @@ -25,6 +25,8 @@ ;;; Code: +(require 'syntax) + (defvar comint-prompt-regexp) (defgroup tooltip nil @@ -277,8 +279,11 @@ is based on the current syntax table." (save-excursion (goto-char point) - (let ((start (progn (skip-syntax-backward "w_") (point)))) - (unless (looking-at "[0-9]") + (let* ((start (progn (skip-syntax-backward "w_") (point))) + (pstate (syntax-ppss))) + (unless (or (looking-at "[0-9]") + (nth 3 pstate) + (nth 4 pstate)) (skip-syntax-forward "w_") (when (> (point) start) (buffer-substring start (point))))))) ------------------------------------------------------------ revno: 109615 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-08-14 21:25:47 +0300 message: Fix a problem with disabled mouse movement events. src/keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each iteration through the command loop. Fixes a problem whereby mouse movements are ignored until the first mouse click. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 17:45:25 +0000 +++ src/ChangeLog 2012-08-14 18:25:47 +0000 @@ -1,3 +1,9 @@ +2012-08-14 Eli Zaretskii + + * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each + iteration through the command loop. Fixes a problem whereby mouse + movements are ignored until the first mouse click. + 2012-08-14 Paul Eggert Use bool, not int, for Lisp booleans. === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-14 12:11:59 +0000 +++ src/keyboard.c 2012-08-14 18:25:47 +0000 @@ -1393,6 +1393,12 @@ Vdeactivate_mark = Qnil; + /* Don't ignore mouse movements for more than a single command + loop. (This flag is set in xdisp.c whenever the tool bar is + resized, because the resize moves text up or down, and would + generate false mouse drag events if we don't ignore them.) */ + ignore_mouse_drag_p = 0; + /* If minibuffer on and echo area in use, wait a short time and redraw minibuffer. */ ------------------------------------------------------------ revno: 109614 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-14 14:23:10 -0400 message: byte-compile-setq-default fix for bug#12195 * lisp/emacs-lisp/bytecomp.el (byte-compile-setq-default): Optimize away setq-default with no args, as is done for setq. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 17:10:38 +0000 +++ lisp/ChangeLog 2012-08-14 18:23:10 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Glenn Morris + + * emacs-lisp/bytecomp.el (byte-compile-setq-default): + Optimize away setq-default with no args, as for setq. (Bug#12195) + 2012-08-14 Chong Yidong * minibuffer.el (read-file-name): Doc fix (Bug#10881). === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2012-08-14 15:58:46 +0000 +++ lisp/emacs-lisp/bytecomp.el 2012-08-14 18:23:10 +0000 @@ -3578,20 +3578,22 @@ (defun byte-compile-setq-default (form) (setq form (cdr form)) - (if (> (length form) 2) - (let ((setters ())) - (while (consp form) - (push `(setq-default ,(pop form) ,(pop form)) setters)) - (byte-compile-form (cons 'progn (nreverse setters)))) - (let ((var (car form))) - (and (or (not (symbolp var)) - (macroexp--const-symbol-p var t)) - (byte-compile-warning-enabled-p 'constants) - (byte-compile-warn - "variable assignment to %s `%s'" - (if (symbolp var) "constant" "nonvariable") - (prin1-to-string var))) - (byte-compile-normal-call `(set-default ',var ,@(cdr form)))))) + (if (null form) ; (setq-default), with no arguments + (byte-compile-form nil byte-compile--for-effect) + (if (> (length form) 2) + (let ((setters ())) + (while (consp form) + (push `(setq-default ,(pop form) ,(pop form)) setters)) + (byte-compile-form (cons 'progn (nreverse setters)))) + (let ((var (car form))) + (and (or (not (symbolp var)) + (macroexp--const-symbol-p var t)) + (byte-compile-warning-enabled-p 'constants) + (byte-compile-warn + "variable assignment to %s `%s'" + (if (symbolp var) "constant" "nonvariable") + (prin1-to-string var))) + (byte-compile-normal-call `(set-default ',var ,@(cdr form))))))) (byte-defop-compiler-1 set-default) (defun byte-compile-set-default (form) ------------------------------------------------------------ revno: 109613 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-08-14 10:45:25 -0700 message: Use bool for Emacs Lisp booleans. This is more natural, and on my platform (GCC 4.7.1 x86-64) it makes Emacs's text size .03% smaller and presumably a bit faster. * admin/merge-gnulib (GNULIB_MODULES): Add stdbool. This documents a new direct dependency; stdbool was already being used indirectly via other gnulib modules. * lib-src/make-docfile.c (enum global_type): Sort values roughly in decreasing alignment, except put functions last. (compare_globals): Use this new property of enum global_type. (write_globals): Use bool, not int, for booleans. * src/lisp.h: Include . (struct Lisp_Boolfwd, defvar_bool): * src/lread.c (defvar_bool): Use bool, not int, for Lisp booleans. * src/regex.c [!emacs]: Include . (false, true): Remove; does this for us now. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-08-11 04:46:38 +0000 +++ admin/ChangeLog 2012-08-14 17:45:25 +0000 @@ -1,3 +1,10 @@ +2012-08-14 Paul Eggert + + Use bool for Emacs Lisp booleans. + * merge-gnulib (GNULIB_MODULES): Add stdbool. This documents a + new direct dependency; stdbool was already being used indirectly + via other gnulib modules. + 2012-08-11 Glenn Morris * bzrmerge.el (bzrmerge-resolve): Disable local eval:. === modified file 'admin/merge-gnulib' --- admin/merge-gnulib 2012-07-28 23:05:32 +0000 +++ admin/merge-gnulib 2012-08-14 17:45:25 +0000 @@ -32,7 +32,7 @@ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink - socklen stat-time stdalign stdarg stdio + socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-08-10 18:23:45 +0000 +++ lib-src/ChangeLog 2012-08-14 17:45:25 +0000 @@ -1,3 +1,10 @@ +2012-08-14 Paul Eggert + + * make-docfile.c (enum global_type): Sort values roughly in + decreasing alignment, except put functions last. + (compare_globals): Use this new property of enum global_type. + (write_globals): Use bool, not int, for booleans. + 2012-08-10 Glenn Morris * make-docfile.c (IF_LINT): === modified file 'lib-src/make-docfile.c' --- lib-src/make-docfile.c 2012-08-10 18:23:45 +0000 +++ lib-src/make-docfile.c 2012-08-14 17:45:25 +0000 @@ -545,14 +545,15 @@ putc (')', out); } -/* The types of globals. */ +/* The types of globals. These are sorted roughly in decreasing alignment + order to avoid allocation gaps, except that functions are last. */ enum global_type { - FUNCTION, + INVALID, + LISP_OBJECT, EMACS_INTEGER, BOOLEAN, - LISP_OBJECT, - INVALID + FUNCTION, }; /* A single global. */ @@ -601,13 +602,8 @@ const struct global *ga = a; const struct global *gb = b; - if (ga->type == FUNCTION) - { - if (gb->type != FUNCTION) - return 1; - } - else if (gb->type == FUNCTION) - return -1; + if (ga->type != gb->type) + return ga->type - gb->type; return strcmp (ga->name, gb->name); } @@ -634,7 +630,7 @@ type = "EMACS_INT"; break; case BOOLEAN: - type = "int"; + type = "bool"; break; case LISP_OBJECT: type = "Lisp_Object"; === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 17:10:38 +0000 +++ src/ChangeLog 2012-08-14 17:45:25 +0000 @@ -1,3 +1,14 @@ +2012-08-14 Paul Eggert + + Use bool, not int, for Lisp booleans. + This is more natural, and on my platform (GCC 4.7.1 x86-64) it + makes Emacs a bit smaller and presumably a bit faster. + * lisp.h: Include . + (struct Lisp_Boolfwd, defvar_bool): + * lread.c (defvar_bool): Use bool, not int, for Lisp booleans. + * regex.c [!emacs]: Include . + (false, true): Remove; does this for us now. + 2012-08-14 Chong Yidong * character.c (Fcharacterp): Doc fix (Bug#12076). === modified file 'src/lisp.h' --- src/lisp.h 2012-08-14 12:11:59 +0000 +++ src/lisp.h 2012-08-14 17:45:25 +0000 @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -1394,7 +1395,7 @@ struct Lisp_Boolfwd { enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Bool */ - int *boolvar; + bool *boolvar; }; /* Forwarding pointer to a Lisp_Object variable. @@ -1929,7 +1930,7 @@ extern void defvar_lisp (struct Lisp_Objfwd *, const char *, Lisp_Object *); extern void defvar_lisp_nopro (struct Lisp_Objfwd *, const char *, Lisp_Object *); -extern void defvar_bool (struct Lisp_Boolfwd *, const char *, int *); +extern void defvar_bool (struct Lisp_Boolfwd *, const char *, bool *); extern void defvar_int (struct Lisp_Intfwd *, const char *, EMACS_INT *); extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int); === modified file 'src/lread.c' --- src/lread.c 2012-08-11 15:34:01 +0000 +++ src/lread.c 2012-08-14 17:45:25 +0000 @@ -3987,7 +3987,7 @@ nil if address contains 0. */ void defvar_bool (struct Lisp_Boolfwd *b_fwd, - const char *namestring, int *address) + const char *namestring, bool *address) { Lisp_Object sym; sym = intern_c_string (namestring); === modified file 'src/regex.c' --- src/regex.c 2012-07-30 18:56:42 +0000 +++ src/regex.c 2012-08-14 17:45:25 +0000 @@ -248,6 +248,7 @@ # endif # define realloc xrealloc +# include # include /* Define the syntax stuff for \<, \>, etc. */ @@ -535,8 +536,6 @@ #endif typedef char boolean; -#define false 0 -#define true 1 static regoff_t re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, size_t size1, ------------------------------------------------------------ revno: 109612 fixes bugs: http://debbugs.gnu.org/11542 http://debbugs.gnu.org/11040 http://debbugs.gnu.org/12076 http://debbugs.gnu.org/10881 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-08-15 01:10:38 +0800 message: More doc fixes. * lisp/minibuffer.el (read-file-name): Doc fix. * character.c (Fcharacterp): Doc fix (Bug#12076). * data.c (Findirect_variable): Doc fix (Bug#11040). * editfns.c (Fsave_current_buffer): Doc fix (Bug#11542). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 16:28:23 +0000 +++ lisp/ChangeLog 2012-08-14 17:10:38 +0000 @@ -1,5 +1,7 @@ 2012-08-14 Chong Yidong + * minibuffer.el (read-file-name): Doc fix (Bug#10881). + * emacs-lisp/regexp-opt.el (regexp-opt-charset): Doc fix (Bug#12085). === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2012-07-10 11:51:54 +0000 +++ lisp/minibuffer.el 2012-08-14 17:10:38 +0000 @@ -2259,14 +2259,24 @@ (defun read-file-name (prompt &optional dir default-filename mustmatch initial predicate) "Read file name, prompting with PROMPT and completing in directory DIR. Value is not expanded---you must call `expand-file-name' yourself. -Default name to DEFAULT-FILENAME if user exits the minibuffer with -the same non-empty string that was inserted by this function. - (If DEFAULT-FILENAME is omitted, the visited file name is used, - except that if INITIAL is specified, that combined with DIR is used. - If DEFAULT-FILENAME is a list of file names, the first file name is used.) -If the user exits with an empty minibuffer, this function returns -an empty string. (This can only happen if the user erased the -pre-inserted contents or if `insert-default-directory' is nil.) + +DIR is the directory to use for completing relative file names. +It should be an absolute directory name, or nil (which means the +current buffer's value of `default-directory'). + +DEFAULT-FILENAME specifies the default file name to return if the +user exits the minibuffer with the same non-empty string inserted +by this function. If DEFAULT-FILENAME is a string, that serves +as the default. If DEFAULT-FILENAME is a list of strings, the +first string is the default. If DEFAULT-FILENAME is omitted or +nil, then if INITIAL is non-nil, the default is DIR combined with +INITIAL; otherwise, if the current buffer is visiting a file, +that file serves as the default; otherwise, the default is simply +the string inserted into the minibuffer. + +If the user exits with an empty minibuffer, return an empty +string. (This happens only if the user erases the pre-inserted +contents, or if `insert-default-directory' is nil.) Fourth arg MUSTMATCH can take the following values: - nil means that the user can exit with any input. @@ -2283,10 +2293,10 @@ Fifth arg INITIAL specifies text to start with. -If optional sixth arg PREDICATE is non-nil, possible completions and -the resulting file name must satisfy (funcall PREDICATE NAME). -DIR should be an absolute directory name. It defaults to the value of -`default-directory'. +Sixth arg PREDICATE, if non-nil, should be a function of one +argument; then a file name is considered an acceptable completion +alternative only if PREDICATE returns non-nil with the file name +as its argument. If this command was invoked with the mouse, use a graphical file dialog if `use-dialog-box' is non-nil, and the window system or X === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 16:28:23 +0000 +++ src/ChangeLog 2012-08-14 17:10:38 +0000 @@ -1,8 +1,13 @@ 2012-08-14 Chong Yidong + * character.c (Fcharacterp): Doc fix (Bug#12076). + + * data.c (Findirect_variable): Doc fix (Bug#11040). + * chartab.c (Fmap_char_table): Doc fix (Bug#12061). * editfns.c (Fformat): Doc fix (Bug#12059). + (Fsave_current_buffer): Doc fix (Bug#11542). 2012-08-14 Barry OReilly (tiny change) === modified file 'src/character.c' --- src/character.c 2012-08-03 23:36:11 +0000 +++ src/character.c 2012-08-14 17:10:38 +0000 @@ -258,6 +258,9 @@ DEFUN ("characterp", Fcharacterp, Scharacterp, 1, 2, 0, doc: /* Return non-nil if OBJECT is a character. +In Emacs Lisp, characters are represented by character codes, which +are non-negative integers. The function `max-char' returns the +maximum character code. usage: (characterp OBJECT) */) (Lisp_Object object, Lisp_Object ignore) { === modified file 'src/data.c' --- src/data.c 2012-08-13 03:39:07 +0000 +++ src/data.c 2012-08-14 17:10:38 +0000 @@ -808,10 +808,12 @@ DEFUN ("indirect-variable", Findirect_variable, Sindirect_variable, 1, 1, 0, doc: /* Return the variable at the end of OBJECT's variable chain. -If OBJECT is a symbol, follow all variable indirections and return the final -variable. If OBJECT is not a symbol, just return it. -Signal a cyclic-variable-indirection error if there is a loop in the -variable chain of symbols. */) +If OBJECT is a symbol, follow its variable indirections (if any), and +return the variable at the end of the chain of aliases. See Info node +`(elisp)Variable Aliases'. + +If OBJECT is not a symbol, just return it. If there is a loop in the +chain of aliases, signal a `cyclic-variable-indirection' error. */) (Lisp_Object object) { if (SYMBOLP (object)) === modified file 'src/editfns.c' --- src/editfns.c 2012-08-14 16:28:23 +0000 +++ src/editfns.c 2012-08-14 17:10:38 +0000 @@ -946,8 +946,8 @@ } DEFUN ("save-current-buffer", Fsave_current_buffer, Ssave_current_buffer, 0, UNEVALLED, 0, - doc: /* Save the current buffer; execute BODY; restore the current buffer. -Executes BODY just like `progn'. + doc: /* Record which buffer is current; execute BODY; make that buffer current. +BODY is executed just like `progn'. usage: (save-current-buffer &rest BODY) */) (Lisp_Object args) { ------------------------------------------------------------ revno: 109611 fixes bugs: http://debbugs.gnu.org/12059 http://debbugs.gnu.org/12085 http://debbugs.gnu.org/12061 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-08-15 00:28:23 +0800 message: Doc fixes. * lisp/emacs-lisp/regexp-opt.el (regexp-opt-charset): Doc fix. * src/chartab.c (Fmap_char_table): Doc fix. * src/editfns.c (Fformat): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 15:58:46 +0000 +++ lisp/ChangeLog 2012-08-14 16:28:23 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Chong Yidong + + * emacs-lisp/regexp-opt.el (regexp-opt-charset): Doc fix + (Bug#12085). + 2012-08-14 Glenn Morris * emacs-lisp/bytecomp.el (byte-recompile-file): Doc fix. === modified file 'lisp/emacs-lisp/regexp-opt.el' --- lisp/emacs-lisp/regexp-opt.el 2012-04-16 03:47:43 +0000 +++ lisp/emacs-lisp/regexp-opt.el 2012-08-14 16:28:23 +0000 @@ -234,7 +234,8 @@ (defun regexp-opt-charset (chars) - "Return a regexp to match a character in CHARS." + "Return a regexp to match a character in CHARS. +CHARS should be a list of characters." ;; The basic idea is to find character ranges. Also we take care in the ;; position of character set meta characters in the character set regexp. ;; === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 12:11:59 +0000 +++ src/ChangeLog 2012-08-14 16:28:23 +0000 @@ -1,3 +1,9 @@ +2012-08-14 Chong Yidong + + * chartab.c (Fmap_char_table): Doc fix (Bug#12061). + + * editfns.c (Fformat): Doc fix (Bug#12059). + 2012-08-14 Barry OReilly (tiny change) * keyboard.c (access_keymap_keyremap): Accept anonymous functions === modified file 'src/chartab.c' --- src/chartab.c 2011-12-11 00:56:50 +0000 +++ src/chartab.c 2012-08-14 16:28:23 +0000 @@ -945,11 +945,11 @@ DEFUN ("map-char-table", Fmap_char_table, Smap_char_table, 2, 2, 0, - doc: /* -Call FUNCTION for each character in CHAR-TABLE that has non-nil value. -FUNCTION is called with two arguments--a key and a value. -The key is a character code or a cons of character codes specifying a -range of characters that have the same value. */) + doc: /* Call FUNCTION for each character in CHAR-TABLE that has non-nil value. +FUNCTION is called with two arguments, KEY and VALUE. +KEY is a character code or a cons of character codes specifying a +range of characters that have the same value. +VALUE is what (char-table-range CHAR-TABLE KEY) returns. */) (Lisp_Object function, Lisp_Object char_table) { CHECK_CHAR_TABLE (char_table); === modified file 'src/editfns.c' --- src/editfns.c 2012-08-14 04:49:18 +0000 +++ src/editfns.c 2012-08-14 16:28:23 +0000 @@ -3615,9 +3615,13 @@ The + flag character inserts a + before any positive number, while a space inserts a space before any positive number; these flags only affect %d, %e, %f, and %g sequences, and the + flag takes precedence. +The - and 0 flags affect the width specifier, as described below. + The # flag means to use an alternate display form for %o, %x, %X, %e, -%f, and %g sequences. The - and 0 flags affect the width specifier, -as described below. +%f, and %g sequences: for %o, it ensures that the result begins with +\"0\"; for %x and %X, it prefixes the result with \"0x\" or \"0X\"; +for %e, %f, and %g, it causes a decimal point to be included even if +the precision is zero. The width specifier supplies a lower limit for the length of the printed representation. The padding, if any, normally goes on the ------------------------------------------------------------ revno: 109610 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2012-08-14 18:15:28 +0200 message: nt/config.nt: Sync with autogen/config.in. (_GL_INLINE_HEADER_BEGIN): Update. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-08-10 00:02:10 +0000 +++ nt/ChangeLog 2012-08-14 16:15:28 +0000 @@ -1,10 +1,15 @@ +2012-08-14 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (_GL_INLINE_HEADER_BEGIN): Update. + 2012-08-10 Glenn Morris * config.nt (DIRECTORY_SEP): Move here from src/lisp.h. 2012-08-07 Juanma Barranquero - * config.nt: Sync with autogen/config.nt. + * config.nt: Sync with autogen/config.in. (BROKEN_GETWD, DISPNEW_NEEDS_STDIO_EXT): New macros. (PENDING_OUTPUT_COUNT): Move definition to inc/ms-w32.h. === modified file 'nt/config.nt' --- nt/config.nt 2012-08-10 00:02:10 +0000 +++ nt/config.nt 2012-08-14 16:15:28 +0000 @@ -1563,7 +1563,8 @@ # if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") # define _GL_INLINE_HEADER_END \ _Pragma ("GCC diagnostic pop") # endif ------------------------------------------------------------ revno: 109609 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-14 08:58:46 -0700 message: * lisp/emacs-lisp/bytecomp.el (byte-recompile-file): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 14:48:28 +0000 +++ lisp/ChangeLog 2012-08-14 15:58:46 +0000 @@ -1,3 +1,7 @@ +2012-08-14 Glenn Morris + + * emacs-lisp/bytecomp.el (byte-recompile-file): Doc fix. + 2012-08-14 Michael Albinus * net/tramp-sh.el (tramp-open-shell): Cache the shell name. @@ -7,8 +11,7 @@ 2012-08-14 Fabián Ezequiel Gallina * progmodes/python.el (python-shell-send-string): - (python-shell-send-setup-code): Do not use `format' with - `message'. + (python-shell-send-setup-code): Do not use `format' with `message'. 2012-08-14 Dmitry Gutov === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2012-08-14 08:37:41 +0000 +++ lisp/emacs-lisp/bytecomp.el 2012-08-14 15:58:46 +0000 @@ -1621,21 +1621,20 @@ "Recompile FILENAME file if it needs recompilation. This happens when its `.elc' file is older than itself. -If the `.elc' file exists and is up-to-date, normally this -function *does not* compile FILENAME. However, if the -prefix argument FORCE is set, that means do compile -FILENAME even if the destination already exists and is -up-to-date. - -If the `.elc' file does not exist, normally this function *does -not* compile FILENAME. If ARG is 0, that means -compile the file even if it has never been compiled before. -A nonzero ARG means ask the user. - -If LOAD is non-nil, `load' the file after compiling. - -The value returned is the value returned by `byte-compile-file', -or 'no-byte-compile if the file did not need recompilation." +If the `.elc' file exists and is up-to-date, normally this function +*does not* compile FILENAME. If the prefix argument FORCE is non-nil, +however, it compiles FILENAME even if the destination already +exists and is up-to-date. + +If the `.elc' file does not exist, normally this function *does not* +compile FILENAME. If optional argument ARG is 0, it compiles +the input file even if the `.elc' file does not exist. +Any other non-nil value of ARG means to ask the user. + +If optional argument LOAD is non-nil, loads the file after compiling. + +If compilation is needed, this functions returns the result of +`byte-compile-file'; otherwise it returns 'no-byte-compile." (interactive (let ((file buffer-file-name) (file-name nil) ------------------------------------------------------------ revno: 109608 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11981 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 10:54:51 -0400 message: * lisp/url/url-http.el (url-http-parse-headers): Re-enable file-name-handlers. diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2012-08-12 17:35:15 +0000 +++ lisp/url/ChangeLog 2012-08-14 14:54:51 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Stefan Monnier + + * url-http.el (url-http-parse-headers): Re-enable file-name-handlers + (bug#11981). + 2012-08-12 David Engster * url-util.el (url-file-directory, url-file-nondirectory): Avoid === modified file 'lisp/url/url-http.el' --- lisp/url/url-http.el 2012-08-11 14:48:37 +0000 +++ lisp/url/url-http.el 2012-08-14 14:54:51 +0000 @@ -508,13 +508,10 @@ (class nil) (success nil) ;; other status symbols: jewelry and luxury cars - (status-symbol (cadr (assq url-http-response-status url-http-codes))) - ;; The filename part of a URL could be in remote file syntax, - ;; see Bug#6717 for an example. We disable file name - ;; handlers, therefore. - (file-name-handler-alist nil)) + (status-symbol (cadr (assq url-http-response-status url-http-codes)))) (setq class (/ url-http-response-status 100)) - (url-http-debug "Parsed HTTP headers: class=%d status=%d" class url-http-response-status) + (url-http-debug "Parsed HTTP headers: class=%d status=%d" + class url-http-response-status) (when (url-use-cookies url-http-target-url) (url-http-handle-cookies)) @@ -531,7 +528,8 @@ ;; 101 = Switching protocols ;; 102 = Processing (Added by DAV) (url-mark-buffer-as-dead buffer) - (error "HTTP responses in class 1xx not supported (%d)" url-http-response-status)) + (error "HTTP responses in class 1xx not supported (%d)" + url-http-response-status)) (2 ; Success ;; 200 Ok ;; 201 Created ------------------------------------------------------------ revno: 109607 committer: Michael Albinus + + * net/tramp-sh.el (tramp-open-shell): Cache the shell name. + (tramp-find-shell, tramp-open-connection-setup-interactive-shell): + Use cached shell name. + 2012-08-14 Fabián Ezequiel Gallina * progmodes/python.el (python-shell-send-string): === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2012-08-08 13:40:45 +0000 +++ lisp/net/tramp-sh.el 2012-08-14 14:48:28 +0000 @@ -3599,11 +3599,14 @@ (setq item (pop alist)) (when (string-match (car item) shell) (setq extra-args (cdr item)))) - (when extra-args (setq shell (concat shell " " extra-args))) (tramp-send-command - vec (format "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s" - (tramp-shell-quote-argument tramp-end-of-output) shell) + vec (format + "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" + (tramp-shell-quote-argument tramp-end-of-output) + shell (or extra-args "")) t)) + (tramp-set-connection-property + (tramp-get-connection-process vec) "remote-shell" shell) ;; Setting prompts. (tramp-send-command vec (format "PS1=%s" (tramp-shell-quote-argument tramp-end-of-output)) t) @@ -3614,8 +3617,12 @@ (defun tramp-find-shell (vec) "Opens a shell on the remote host which groks tilde expansion." (with-current-buffer (tramp-get-buffer vec) - (let ((default-shell (tramp-get-method-parameter - (tramp-file-name-method vec) 'tramp-remote-shell)) + (let ((default-shell + (or + (tramp-get-connection-property + (tramp-get-connection-process vec) "remote-shell" nil) + (tramp-get-method-parameter + (tramp-file-name-method vec) 'tramp-remote-shell))) shell) (setq shell (with-connection-property vec "remote-shell" @@ -3692,8 +3699,9 @@ ;; discarded as well. (tramp-open-shell vec - (tramp-get-method-parameter - (tramp-file-name-method vec) 'tramp-remote-shell)) + (or (tramp-get-connection-property vec "remote-shell" nil) + (tramp-get-method-parameter + (tramp-file-name-method vec) 'tramp-remote-shell))) ;; Disable echo. (tramp-message vec 5 "Setting up remote shell environment") ------------------------------------------------------------ revno: 109606 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Tue 2012-08-14 10:39:27 -0300 message: * progmodes/python.el (python-shell-send-string): (python-shell-send-setup-code): Do not use `format' with `message'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 12:38:11 +0000 +++ lisp/ChangeLog 2012-08-14 13:39:27 +0000 @@ -1,3 +1,9 @@ +2012-08-14 Fabián Ezequiel Gallina + + * progmodes/python.el (python-shell-send-string): + (python-shell-send-setup-code): Do not use `format' with + `message'. + 2012-08-14 Dmitry Gutov * progmodes/ruby-mode.el: Improve percent literals (bug#6286). === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-08-14 04:18:41 +0000 +++ lisp/progmodes/python.el 2012-08-14 13:39:27 +0000 @@ -1822,8 +1822,7 @@ (interactive "sPython command: ") (let ((process (or process (python-shell-get-or-create-process))) (lines (split-string string "\n" t))) - (when msg - (message (format "Sent: %s..." (nth 0 lines)))) + (and msg (message "Sent: %s..." (nth 0 lines))) (if (> (length lines) 1) (let* ((temp-file-name (make-temp-file "py")) (file-name (or (buffer-file-name) temp-file-name))) @@ -1953,11 +1952,10 @@ "Send all setup code for shell. This function takes the list of setup code to send from the `python-shell-setup-codes' list." - (let ((msg "Sent %s") - (process (get-buffer-process (current-buffer)))) + (let ((process (get-buffer-process (current-buffer)))) (dolist (code python-shell-setup-codes) (when code - (message (format msg code)) + (message "Sent %s" code) (python-shell-send-string (symbol-value code) process))))) ------------------------------------------------------------ revno: 109605 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6286 author: Dmitry Gutov committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 08:38:11 -0400 message: * lisp/progmodes/ruby-mode.el (ruby-syntax-methods-before-regexp): New const. (ruby-syntax-propertize-function): Use it to recognize regexps. Don't look at the text after regexp, just use the whitelist. * test/indent/ruby.rb: Rearrange examples, add new ones. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 12:28:12 +0000 +++ lisp/ChangeLog 2012-08-14 12:38:11 +0000 @@ -10,6 +10,9 @@ (ruby-syntax-propertize-percent-literal): Only propertize when not inside a simple string or comment. When the literal is unclosed, leave the text after it unpropertized. + (ruby-syntax-methods-before-regexp): New constant. + (ruby-syntax-propertize-function): Use it to recognize regexps. + Don't look at the text after regexp, just use the whitelist. 2012-08-14 Andreas Schwab === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2012-08-14 12:28:12 +0000 +++ lisp/progmodes/ruby-mode.el 2012-08-14 12:38:11 +0000 @@ -1178,7 +1178,13 @@ (eval-and-compile (defconst ruby-percent-literal-beg-re "\\(%\\)[qQrswWx]?\\([[:punct:]]\\)" - "Regexp to match the beginning of percent literal.")) + "Regexp to match the beginning of percent literal.") + + (defconst ruby-syntax-methods-before-regexp + '("gsub" "gsub!" "sub" "sub!" "scan" "split" "split!" "index" "match" + "assert_match" "Given" "Then" "When") + "Methods that can take regexp as the first argument. +It will be properly highlighted even when the call omits parens.")) (defun ruby-syntax-propertize-function (start end) "Syntactic keywords for Ruby mode. See `syntax-propertize-function'." @@ -1196,28 +1202,23 @@ ;; Not within a string. (nth 3 (syntax-ppss (match-beginning 0)))) (string-to-syntax "\\")))) - ;; Regexps: regexps are distinguished from division either because - ;; of the keyword/symbol before them, or because of the code - ;; following them. + ;; Regexps: regexps are distinguished from division because + ;; of the keyword, symbol, or method name before them. ((concat ;; Special tokens that can't be followed by a division operator. - "\\(?:\\(^\\|[[=(,~?:;<>]\\|\\(?:^\\|\\s \\)" + "\\(^\\|[[=(,~?:;<>]" + ;; Control flow keywords and operators following bol or whitespace. + "\\|\\(?:^\\|\\s \\)" (regexp-opt '("if" "elsif" "unless" "while" "until" "when" "and" - "or" "&&" "||" - "gsub" "gsub!" "sub" "sub!" "scan" "split" "split!")) - "\\)\\s *\\)?" + "or" "not" "&&" "||")) + ;; Method name from the list. + "\\|\\_<" + (regexp-opt ruby-syntax-methods-before-regexp) + "\\)\\s *" ;; The regular expression itself. - "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)" - ;; Special code that cannot follow a division operator. - ;; FIXME: Just because the second slash of "/foo/ do bar" can't - ;; be a division, doesn't mean it can't *start* a regexp, as in - ;; "x = toto/foo; if /do bar/". - "\\([imxo]*\\s *\\(?:,\\|\\_\\)\\)?") - (2 (when (or (match-beginning 1) (match-beginning 4)) - (string-to-syntax "\"/"))) - (3 (if (or (match-beginning 1) (match-beginning 4)) - (string-to-syntax "\"/") - (goto-char (match-end 2))))) + "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)") + (2 (string-to-syntax "\"/")) + (3 (string-to-syntax "\"/"))) ("^=en\\(d\\)\\_>" (1 "!")) ("^\\(=\\)begin\\_>" (1 "!")) ;; Handle here documents. === modified file 'test/ChangeLog' --- test/ChangeLog 2012-08-12 22:06:56 +0000 +++ test/ChangeLog 2012-08-14 12:38:11 +0000 @@ -1,3 +1,7 @@ +2012-08-14 Dmitry Gutov + + * indent/ruby.rb: Rearrange examples, add new ones. + 2012-08-12 Dmitry Gutov * automated/ruby-mode-tests.el (ruby-move-to-block-stops-at-opening) === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2012-04-24 17:02:46 +0000 +++ test/indent/ruby.rb 2012-08-14 12:38:11 +0000 @@ -1,17 +1,25 @@ +# Percent literals. +b = %Q{This is a "string"} +c = %w!foo + bar + baz! +d = %(hello (nested) world) + +# Don't propertize percent literals inside strings. +"(%s, %s)" % [123, 456] + +# Or inside comments. +x = # "tot %q/to"; = +y = 2 / 3 + +# Regexp after whitelisted method. +"abc".sub /b/, 'd' + # Don't mis-match "sub" at the end of words. a = asub / aslb + bsub / bslb; -b = %Q{This is a "string"} -c = %w(foo - bar - baz) -d = %!hello! - -# A "do" after a slash means that slash is not a division, but it doesn't imply -# it's a regexp-ender, since it can be a regexp-starter instead! -x = toto / foo; if /do bar/ then - toto = 1 - end +# Highlight the regexp after "if". +x = toto / foo if /do bar/ =~ "dobar" # Some Cucumber code: Given /toto/ do ------------------------------------------------------------ revno: 109604 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6286 author: Dmitry Gutov committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 08:28:12 -0400 message: * lisp/progmodes/ruby-mode.el: Improve percent literals. (ruby-percent-literal-beg-re): New constant. (ruby-syntax-general-delimiters-goto-beg): Rename to `ruby-syntax-enclosing-percent-literal', improve literal type check. (ruby-syntax-propertize-general-delimiters): Rename to `ruby-syntax-propertize-percent-literal', it's a shorter and more popular term. Adjust comments everywhere. (ruby-syntax-propertize-percent-literal): Only propertize when not inside a simple string or comment. When the literal is unclosed, leave the text after it unpropertized. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 08:37:41 +0000 +++ lisp/ChangeLog 2012-08-14 12:28:12 +0000 @@ -1,3 +1,16 @@ +2012-08-14 Dmitry Gutov + + * progmodes/ruby-mode.el: Improve percent literals (bug#6286). + (ruby-percent-literal-beg-re): New constant. + (ruby-syntax-general-delimiters-goto-beg): Rename to + `ruby-syntax-enclosing-percent-literal', improve literal type check. + (ruby-syntax-propertize-general-delimiters): Rename to + `ruby-syntax-propertize-percent-literal', it's a shorter and more + popular term. Adjust comments everywhere. + (ruby-syntax-propertize-percent-literal): Only propertize when not + inside a simple string or comment. When the literal is unclosed, + leave the text after it unpropertized. + 2012-08-14 Andreas Schwab * emacs-lisp/bytecomp.el (byte-recompile-file): When LOAD is @@ -22,8 +35,8 @@ Use `completion-table-dynamic' for completion functions. * progmodes/python.el (python-shell-completion--do-completion-at-point) - (python-shell-completion--get-completions): Remove - functions. + (python-shell-completion--get-completions): + Remove functions. (python-shell-completion-complete-at-point): New function. (python-completion-complete-at-point): Use it. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2012-08-12 22:06:56 +0000 +++ lisp/progmodes/ruby-mode.el 2012-08-14 12:28:12 +0000 @@ -800,7 +800,7 @@ ;; (not (or (eolp) (looking-at "#") ;; (and (eq (car (nth 1 state)) ?{) ;; (looking-at "|")))))) - ;; Not a regexp or general delimited literal. + ;; Not a regexp or percent literal. (null (nth 0 (ruby-parse-region (or begin parse-start) (point)))) (or (not (eq ?| (char-after (point)))) @@ -1169,17 +1169,22 @@ (ruby-do-end-to-brace))) (declare-function ruby-syntax-propertize-heredoc "ruby-mode" (limit)) -(declare-function ruby-syntax-general-delimiters-goto-beg "ruby-mode" ()) -(declare-function ruby-syntax-propertize-general-delimiters "ruby-mode" (limit)) +(declare-function ruby-syntax-enclosing-percent-literal "ruby-mode" (limit)) +(declare-function ruby-syntax-propertize-percent-literal "ruby-mode" (limit)) (if (eval-when-compile (fboundp #'syntax-propertize-rules)) ;; New code that works independently from font-lock. (progn + (eval-and-compile + (defconst ruby-percent-literal-beg-re + "\\(%\\)[qQrswWx]?\\([[:punct:]]\\)" + "Regexp to match the beginning of percent literal.")) + (defun ruby-syntax-propertize-function (start end) "Syntactic keywords for Ruby mode. See `syntax-propertize-function'." (goto-char start) (ruby-syntax-propertize-heredoc end) - (ruby-syntax-general-delimiters-goto-beg) + (ruby-syntax-enclosing-percent-literal end) (funcall (syntax-propertize-rules ;; #{ }, #$hoge, #@foo are not comments. @@ -1222,8 +1227,8 @@ 'syntax-table (string-to-syntax "\"")) (ruby-syntax-propertize-heredoc end)))) ;; Handle percent literals: %w(), %q{}, etc. - ("\\(?:^\\|[[ \t\n<+(,=]\\)\\(%\\)[qQrswWx]?\\([[:punct:]]\\)" - (1 (prog1 "|" (ruby-syntax-propertize-general-delimiters end))))) + ((concat "\\(?:^\\|[[ \t\n<+(,=]\\)" ruby-percent-literal-beg-re) + (1 (prog1 "|" (ruby-syntax-propertize-percent-literal end))))) (point) end)) (defun ruby-syntax-propertize-heredoc (limit) @@ -1251,40 +1256,46 @@ ;; inf-loop. (if (< (point) start) (goto-char start)))))) - (defun ruby-syntax-general-delimiters-goto-beg () - (let ((state (syntax-ppss))) - ;; Move to the start of the literal, in case it's multiline. - ;; TODO: determine the literal type more reliably here? + (defun ruby-syntax-enclosing-percent-literal (limit) + (let ((state (syntax-ppss)) + (start (point))) + ;; When already inside percent literal, re-propertize it. (when (eq t (nth 3 state)) (goto-char (nth 8 state)) - (beginning-of-line)))) + (when (looking-at ruby-percent-literal-beg-re) + (ruby-syntax-propertize-percent-literal limit)) + (when (< (point) start) (goto-char start))))) - (defun ruby-syntax-propertize-general-delimiters (limit) + (defun ruby-syntax-propertize-percent-literal (limit) (goto-char (match-beginning 2)) - (let* ((op (char-after)) - (ops (char-to-string op)) - (cl (or (cdr (aref (syntax-table) op)) - (cdr (assoc op '((?< . ?>)))))) - parse-sexp-lookup-properties) - (ignore-errors - (if cl - (progn ; Paired delimiters. - ;; Delimiter pairs of the same kind can be nested - ;; inside the literal, as long as they are balanced. - ;; Create syntax table that ignores other characters. - (with-syntax-table (make-char-table 'syntax-table nil) - (modify-syntax-entry op (concat "(" (char-to-string cl))) - (modify-syntax-entry cl (concat ")" ops)) - (modify-syntax-entry ?\\ "\\") - (save-restriction - (narrow-to-region (point) limit) - (forward-list)))) ; skip to the paired character - ;; Single character delimiter. - (re-search-forward (concat "[^\\]\\(?:\\\\\\\\\\)*" - (regexp-quote ops)) limit nil)) - ;; If we reached here, the closing delimiter was found. - (put-text-property (1- (point)) (point) - 'syntax-table (string-to-syntax "|"))))) + ;; Not inside a simple string or comment. + (when (eq t (nth 3 (syntax-ppss))) + (let* ((op (char-after)) + (ops (char-to-string op)) + (cl (or (cdr (aref (syntax-table) op)) + (cdr (assoc op '((?< . ?>)))))) + parse-sexp-lookup-properties) + (condition-case nil + (progn + (if cl ; Paired delimiters. + ;; Delimiter pairs of the same kind can be nested + ;; inside the literal, as long as they are balanced. + ;; Create syntax table that ignores other characters. + (with-syntax-table (make-char-table 'syntax-table nil) + (modify-syntax-entry op (concat "(" (char-to-string cl))) + (modify-syntax-entry cl (concat ")" ops)) + (modify-syntax-entry ?\\ "\\") + (save-restriction + (narrow-to-region (point) limit) + (forward-list))) ; skip to the paired character + ;; Single character delimiter. + (re-search-forward (concat "[^\\]\\(?:\\\\\\\\\\)*" + (regexp-quote ops)) limit nil)) + ;; Found the closing delimiter. + (put-text-property (1- (point)) (point) 'syntax-table + (string-to-syntax "|"))) + ;; Unclosed literal, leave the following text unpropertized. + ((scan-error search-failed) (goto-char limit)))))) ) ;; For Emacsen where syntax-propertize-rules is not (yet) available, @@ -1329,7 +1340,7 @@ (4 (7 . ?/)) (6 (7 . ?/))) ("^=en\\(d\\)\\_>" 1 "!") - ;; General delimited string. + ;; Percent literal. ("\\(^\\|[[ \t\n<+(,=]\\)\\(%[xrqQwW]?\\([^<[{(a-zA-Z0-9 \n]\\)[^\n\\\\]*\\(\\\\.[^\n\\\\]*\\)*\\(\\3\\)\\)" (3 "\"") (5 "\"")) ------------------------------------------------------------ revno: 109603 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12022 author: Barry OReilly committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-08-14 08:11:59 -0400 message: * src/keyboard.c (access_keymap_keyremap): Accept anonymous functions. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 08:44:24 +0000 +++ src/ChangeLog 2012-08-14 12:11:59 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Barry OReilly (tiny change) + + * keyboard.c (access_keymap_keyremap): Accept anonymous functions + (bug#12022). + 2012-08-14 Martin Rudalics * frame.c (make_frame_without_minibuffer, make_minibuffer_frame) === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-13 03:44:27 +0000 +++ src/keyboard.c 2012-08-14 12:11:59 +0000 @@ -8836,7 +8836,7 @@ /* If the keymap gives a function, not an array, then call the function with one arg and use its value instead. */ - if (SYMBOLP (next) && !NILP (Ffboundp (next)) && do_funcall) + if (do_funcall && FUNCTIONP (next)) { Lisp_Object tem; tem = next; === modified file 'src/lisp.h' --- src/lisp.h 2012-08-10 18:23:45 +0000 +++ src/lisp.h 2012-08-14 12:11:59 +0000 @@ -641,7 +641,7 @@ typedef struct interval *INTERVAL; -/* Complain if object is not string or buffer type */ +/* Complain if object is not string or buffer type. */ #define CHECK_STRING_OR_BUFFER(x) \ CHECK_TYPE (STRINGP (x) || BUFFERP (x), Qbuffer_or_string_p, x) ------------------------------------------------------------ revno: 109602 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-14 06:17:30 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-08-10 10:17:28 +0000 +++ autogen/config.in 2012-08-14 10:17:30 +0000 @@ -1554,7 +1554,8 @@ # if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") # define _GL_INLINE_HEADER_END \ _Pragma ("GCC diagnostic pop") # endif ------------------------------------------------------------ revno: 109601 committer: martin rudalics branch nick: trunk timestamp: Tue 2012-08-14 10:44:24 +0200 message: Don't call Fset_window_buffer from C code. * frame.c (make_frame_without_minibuffer, make_minibuffer_frame) (delete_frame, Fmake_frame_invisible, Ficonify_frame): * minibuf.c (choose_minibuf_frame, read_minibuf): * w32fns.c (x_create_tip_frame): * xfns.c (x_create_tip_frame): Call set_window_buffer instead of Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 08:30:52 +0000 +++ src/ChangeLog 2012-08-14 08:44:24 +0000 @@ -1,3 +1,12 @@ +2012-08-14 Martin Rudalics + + * frame.c (make_frame_without_minibuffer, make_minibuffer_frame) + (delete_frame, Fmake_frame_invisible, Ficonify_frame): + * minibuf.c (choose_minibuf_frame, read_minibuf): + * w32fns.c (x_create_tip_frame): + * xfns.c (x_create_tip_frame): Call set_window_buffer instead of + Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026). + 2012-08-14 Paul Eggert * intervals.c (offset_intervals): Remove obsolete comment. === modified file 'src/frame.c' --- src/frame.c 2012-08-13 03:44:27 +0000 +++ src/frame.c 2012-08-14 08:44:24 +0000 @@ -407,10 +407,12 @@ /* Make the chosen minibuffer window display the proper minibuffer, unless it is already showing a minibuffer. */ if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list))) - Fset_window_buffer (mini_window, - (NILP (Vminibuffer_list) - ? get_minibuffer (0) - : Fcar (Vminibuffer_list)), Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (mini_window, + (NILP (Vminibuffer_list) + ? get_minibuffer (0) + : Fcar (Vminibuffer_list)), 0, 0); return f; } @@ -445,10 +447,12 @@ /* Put the proper buffer in that window. */ - Fset_window_buffer (mini_window, - (NILP (Vminibuffer_list) - ? get_minibuffer (0) - : Fcar (Vminibuffer_list)), Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (mini_window, + (NILP (Vminibuffer_list) + ? get_minibuffer (0) + : Fcar (Vminibuffer_list)), 0, 0); return f; } #endif /* HAVE_WINDOW_SYSTEM */ @@ -1240,8 +1244,10 @@ /* Don't allow minibuf_window to remain on a deleted frame. */ if (EQ (f->minibuffer_window, minibuf_window)) { - Fset_window_buffer (sf->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (sf->minibuffer_window, + XWINDOW (minibuf_window)->buffer, 0, 0); minibuf_window = sf->minibuffer_window; /* If the dying minibuffer window was selected, @@ -1713,8 +1719,10 @@ if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (sf->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (sf->minibuffer_window, + XWINDOW (minibuf_window)->buffer, 0, 0); minibuf_window = sf->minibuffer_window; } @@ -1747,12 +1755,14 @@ Fhandle_switch_frame (next_frame (frame, Qt)); #endif - /* Don't allow minibuf_window to remain on a deleted frame. */ + /* Don't allow minibuf_window to remain on an iconified frame. */ if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (sf->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (sf->minibuffer_window, + XWINDOW (minibuf_window)->buffer, 0, 0); minibuf_window = sf->minibuffer_window; } === modified file 'src/minibuf.c' --- src/minibuf.c 2012-08-13 03:39:07 +0000 +++ src/minibuf.c 2012-08-14 08:44:24 +0000 @@ -117,7 +117,9 @@ init_window_once. That window doesn't have a buffer. */ buffer = XWINDOW (minibuf_window)->buffer; if (BUFFERP (buffer)) - Fset_window_buffer (sf->minibuffer_window, buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (sf->minibuffer_window, buffer, 0, 0); minibuf_window = sf->minibuffer_window; } @@ -617,11 +619,15 @@ if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window) && !NILP (Fwindow_minibuffer_p (mini_window))) - Fset_window_buffer (mini_window, empty_minibuf, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (mini_window, empty_minibuf, 0, 0); } /* Display this minibuffer in the proper window. */ - Fset_window_buffer (minibuf_window, Fcurrent_buffer (), Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (minibuf_window, Fcurrent_buffer (), 0, 0); Fselect_window (minibuf_window, Qnil); XWINDOW (minibuf_window)->hscroll = 0; === modified file 'src/w32fns.c' --- src/w32fns.c 2012-08-13 03:44:27 +0000 +++ src/w32fns.c 2012-08-14 08:44:24 +0000 @@ -5237,7 +5237,9 @@ XSETFRAME (frame, f); buffer = Fget_buffer_create (build_string (" *tip*")); - Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (FRAME_ROOT_WINDOW (f), buffer, 0, 0); old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (buffer)); BSET (current_buffer, truncate_lines, Qnil); === modified file 'src/xfns.c' --- src/xfns.c 2012-08-13 03:44:27 +0000 +++ src/xfns.c 2012-08-14 08:44:24 +0000 @@ -4591,7 +4591,9 @@ XSETFRAME (frame, f); buffer = Fget_buffer_create (build_string (" *tip*")); - Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (FRAME_ROOT_WINDOW (f), buffer, 0, 0); old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (buffer)); BSET (current_buffer, truncate_lines, Qnil); ------------------------------------------------------------ revno: 109600 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-08-14 10:37:41 +0200 message: Fixes: debbugs:12197 * emacs-lisp/bytecomp.el (byte-recompile-file): When LOAD is non-nil always load the compiled file if it exists. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 06:52:59 +0000 +++ lisp/ChangeLog 2012-08-14 08:37:41 +0000 @@ -1,3 +1,8 @@ +2012-08-14 Andreas Schwab + + * emacs-lisp/bytecomp.el (byte-recompile-file): When LOAD is + non-nil always load the compiled file if it exists. (Bug#12197) + 2012-08-14 Chong Yidong * hi-lock.el (hi-lock-mode): Do not unilaterally enable font lock. === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/bytecomp.el 2012-08-14 08:37:41 +0000 @@ -1632,7 +1632,7 @@ compile the file even if it has never been compiled before. A nonzero ARG means ask the user. -If LOAD is set, `load' the file after compiling. +If LOAD is non-nil, `load' the file after compiling. The value returned is the value returned by `byte-compile-file', or 'no-byte-compile if the file did not need recompilation." @@ -1665,7 +1665,8 @@ (if (and noninteractive (not byte-compile-verbose)) (message "Compiling %s..." filename)) (byte-compile-file filename load)) - (when load (load filename)) + (when load + (load (if (file-exists-p dest) dest filename))) 'no-byte-compile))) ;;;###autoload ------------------------------------------------------------ revno: 109599 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-08-14 01:30:52 -0700 message: * intervals.c (offset_intervals): Remove obsolete comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 08:06:07 +0000 +++ src/ChangeLog 2012-08-14 08:30:52 +0000 @@ -1,3 +1,7 @@ +2012-08-14 Paul Eggert + + * intervals.c (offset_intervals): Remove obsolete comment. + 2012-08-14 Andreas Schwab * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP. === modified file 'src/intervals.c' --- src/intervals.c 2012-08-13 03:39:07 +0000 +++ src/intervals.c 2012-08-14 08:30:52 +0000 @@ -1366,11 +1366,7 @@ /* Make the adjustments necessary to the interval tree of BUFFER to represent an addition or deletion of LENGTH characters starting at position START. Addition or deletion is indicated by the sign - of LENGTH. - - The two inline functions (one static) pacify Sun C 5.8, a pre-C99 - compiler that does not allow calling a static function (here, - adjust_intervals_for_deletion) from a non-static inline function. */ + of LENGTH. */ void offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length) @@ -1609,7 +1605,7 @@ eassert (length == TOTAL_LENGTH (source)); if ((BUF_Z (buffer) - BUF_BEG (buffer)) == length) - { + { /* The inserted text constitutes the whole buffer, so simply copy over the interval structure. */ Lisp_Object buf; ------------------------------------------------------------ revno: 109598 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-08-14 10:06:07 +0200 message: * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-14 05:09:35 +0000 +++ src/ChangeLog 2012-08-14 08:06:07 +0000 @@ -1,3 +1,7 @@ +2012-08-14 Andreas Schwab + + * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP. + 2012-08-14 Gergely Risko * coding.c (decode_coding): Record buffer modification before === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-08-14 04:47:05 +0000 +++ src/gtkutil.c 2012-08-14 08:06:07 +0000 @@ -4306,7 +4306,7 @@ { file = call1 (intern ("file-name-sans-extension"), Ffile_name_nondirectory (file)); - if (EQ (Fequal (file, rtl_name), Qt)) + if (! NILP (Fequal (file, rtl_name))) { image = rtl_image; break; @@ -4583,8 +4583,8 @@ && tbinfo->n_last_items == f->n_tool_bar_items && tbinfo->hmargin == hmargin && tbinfo->vmargin == vmargin && tbinfo->dir == dir - && EQ (Fequal (tbinfo->style, style), Qt) - && EQ (Fequal (tbinfo->last_tool_bar, f->tool_bar_items), Qt)) + && ! NILP (Fequal (tbinfo->style, style)) + && ! NILP (Fequal (tbinfo->last_tool_bar, f->tool_bar_items))) { UNBLOCK_INPUT; return; ------------------------------------------------------------ revno: 109597 fixes bug: http://debbugs.gnu.org/12168 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-14 14:52:59 +0800 message: Fix highlight-regexp's use of Font Lock mode. * hi-lock.el (hi-lock-mode): Do not unilaterally enable font lock. (hi-lock-set-pattern): When deciding whether to use font lock or overlays, look at font-lock-mode instead of font-lock-fontified. (hi-lock-mode, hi-lock-line-face-buffer, hi-lock-unface-buffer) (hi-lock-face-buffer, hi-lock-face-phrase-buffer): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-14 04:37:00 +0000 +++ lisp/ChangeLog 2012-08-14 06:52:59 +0000 @@ -1,3 +1,12 @@ +2012-08-14 Chong Yidong + + * hi-lock.el (hi-lock-mode): Do not unilaterally enable font lock. + (hi-lock-set-pattern): When deciding whether to use font lock or + overlays, look at font-lock-mode instead of font-lock-fontified + (Bug#12168). + (hi-lock-mode, hi-lock-line-face-buffer, hi-lock-unface-buffer) + (hi-lock-face-buffer, hi-lock-face-phrase-buffer): Doc fix. + 2012-08-14 Daiki Ueno * subr.el (internal--after-with-selected-window): Fix typo === modified file 'lisp/hi-lock.el' --- lisp/hi-lock.el 2012-05-21 04:33:54 +0000 +++ lisp/hi-lock.el 2012-08-14 06:52:59 +0000 @@ -287,12 +287,19 @@ positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. -Issuing one the highlighting commands listed below will -automatically enable Hi Lock mode. To enable Hi Lock mode in all -buffers, use `global-hi-lock-mode' or add (global-hi-lock-mode 1) -to your init file. When Hi Lock mode is enabled, a \"Regexp -Highlighting\" submenu is added to the \"Edit\" menu. The -commands in the submenu, which can be called interactively, are: +Hi Lock mode is automatically enabled when you invoke any of the +highlighting commands listed below, such as \\[highlight-regexp]. +To enable Hi Lock mode in all buffers, use `global-hi-lock-mode' +or add (global-hi-lock-mode 1) to your init file. + +In buffers where Font Lock mode is enabled, patterns are +highlighted using font lock. In buffers where Font Lock mode is +disabled, patterns are applied using overlays; in this case, the +highlighting will not be updated as you type. + +When Hi Lock mode is enabled, a \"Regexp Highlighting\" submenu +is added to the \"Edit\" menu. The commands in the submenu, +which can be called interactively, are: \\[highlight-regexp] REGEXP FACE Highlight matches of pattern REGEXP in current buffer with FACE. @@ -326,12 +333,12 @@ rejected, the beginning of the buffer is searched for lines of the form: Hi-lock: FOO -where FOO is a list of patterns. These are added to the font lock -keywords already present. The patterns must start before position -\(number of characters into buffer) `hi-lock-file-patterns-range'. -Patterns will be read until - Hi-lock: end -is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'." + +where FOO is a list of patterns. The patterns must start before +position \(number of characters into buffer) +`hi-lock-file-patterns-range'. Patterns will be read until +Hi-lock: end is found. A mode is excluded if it's in the list +`hi-lock-exclude-modes'." :group 'hi-lock :lighter (:eval (if (or hi-lock-interactive-patterns hi-lock-file-patterns) @@ -358,7 +365,6 @@ (if hi-lock-mode ;; Turned on. (progn - (unless font-lock-mode (font-lock-mode 1)) (define-key-after menu-bar-edit-menu [hi-lock] (cons "Regexp Highlighting" hi-lock-menu)) (hi-lock-find-patterns) @@ -392,12 +398,13 @@ ;;;###autoload (defun hi-lock-line-face-buffer (regexp &optional face) "Set face of all lines containing a match of REGEXP to FACE. +Interactively, prompt for REGEXP then FACE, using a buffer-local +history list for REGEXP and a global history list for FACE. -Interactively, prompt for REGEXP then FACE. Buffer-local history -list maintained for regexps, global history maintained for faces. -\\Use \\[previous-history-element] to retrieve previous history items, -and \\[next-history-element] to retrieve default values. -\(See info node `Minibuffer History'.)" +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type." (interactive (list (hi-lock-regexp-okay @@ -416,12 +423,13 @@ ;;;###autoload (defun hi-lock-face-buffer (regexp &optional face) "Set face of each match of REGEXP to FACE. +Interactively, prompt for REGEXP then FACE, using a buffer-local +history list for REGEXP and a global history list for FACE. -Interactively, prompt for REGEXP then FACE. Buffer-local history -list maintained for regexps, global history maintained for faces. -\\Use \\[previous-history-element] to retrieve previous history items, -and \\[next-history-element] to retrieve default values. -\(See info node `Minibuffer History'.)" +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type." (interactive (list (hi-lock-regexp-okay @@ -436,9 +444,13 @@ ;;;###autoload (defun hi-lock-face-phrase-buffer (regexp &optional face) "Set face of each match of phrase REGEXP to FACE. - Whitespace in REGEXP converted to arbitrary whitespace and initial -lower-case letters made case insensitive." +lower-case letters made case insensitive. + +If Font Lock mode is enabled in the buffer, it is used to +highlight REGEXP. If Font Lock mode is disabled, overlays are +used for highlighting; in this case, the highlighting will not be +updated as you type." (interactive (list (hi-lock-regexp-okay @@ -456,12 +468,8 @@ ;;;###autoload (defun hi-lock-unface-buffer (regexp) "Remove highlighting of each match to REGEXP set by hi-lock. - -Interactively, prompt for REGEXP. Buffer-local history of inserted -regexp's maintained. Will accept only regexps inserted by hi-lock -interactive functions. \(See `hi-lock-interactive-patterns'.\) -\\Use \\[minibuffer-complete] to complete a partially typed regexp. -\(See info node `Minibuffer History'.\)" +Interactively, prompt for REGEXP, accepting only regexps +previously inserted by hi-lock interactive functions." (interactive (if (and (display-popup-menus-p) (listp last-nonmenu-event) @@ -573,7 +581,7 @@ (let ((pattern (list regexp (list 0 (list 'quote face) t)))) (unless (member pattern hi-lock-interactive-patterns) (push pattern hi-lock-interactive-patterns) - (if font-lock-fontified + (if font-lock-mode (progn (font-lock-add-keywords nil (list pattern) t) (font-lock-fontify-buffer))