Now on revision 111344. ------------------------------------------------------------ revno: 111344 author: Vitalie Spinu committer: martin rudalics branch nick: trunk timestamp: Thu 2012-12-27 08:33:47 +0100 message: Cleanup comint-postoutput-scroll-to-bottom (Bug#13248). * comint.el (comint-adjust-window-point): New function. (comint-postoutput-scroll-to-bottom): Call comint-adjust-window-point (Bug#13248). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-26 19:52:56 +0000 +++ lisp/ChangeLog 2012-12-27 07:33:47 +0000 @@ -1,3 +1,9 @@ +2012-12-27 Vitalie Spinu (tiny change) + + * comint.el (comint-adjust-window-point): New function. + (comint-postoutput-scroll-to-bottom): Call + comint-adjust-window-point (Bug#13248). + 2012-12-26 Dmitry Gutov * progmodes/ruby-mode.el (auto-mode-alist): `purecopy' the === modified file 'lisp/comint.el' --- lisp/comint.el 2012-12-21 02:08:29 +0000 +++ lisp/comint.el 2012-12-27 07:33:47 +0000 @@ -2120,19 +2120,31 @@ ((bound-and-true-p follow-mode) (follow-comint-scroll-to-bottom)) (t - (let ((selected (selected-window))) - (dolist (w (get-buffer-window-list current nil t)) - (select-window w) - (unwind-protect - (progn - (comint-adjust-point selected) - ;; Optionally scroll to the bottom of the window. - (and comint-scroll-show-maximum-output - (eobp) - (recenter (- -1 scroll-margin)))) - (select-window selected)))))) + (dolist (w (get-buffer-window-list current nil t)) + (comint-adjust-window-point w process) + ;; Optionally scroll to the bottom of the window. + (and comint-scroll-show-maximum-output + (eq (window-point w) (point-max)) + (with-selected-window w + (recenter (- -1 scroll-margin))))))) (set-buffer current)))) + +(defun comint-adjust-window-point (window process) + "Move point in WINDOW based on Comint settings. +For point adjustment use the process-mark of PROCESS." + (and (< (window-point window) (process-mark process)) + (or (memq comint-move-point-for-output '(t all)) + ;; Maybe user wants point to jump to end. + (eq comint-move-point-for-output + (if (eq (selected-window) window) 'this 'others)) + ;; If point was at the end, keep it at end. + (and (marker-position comint-last-output-start) + (>= (window-point window) comint-last-output-start))) + (set-window-point window (process-mark process)))) + + +;; this function is nowhere used (defun comint-adjust-point (selected) "Move point in the selected window based on Comint settings. SELECTED is the window that was originally selected." ------------------------------------------------------------ revno: 111343 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2012-12-26 22:30:58 +0000 message: Merge changes made in Gnus master 2012-12-26 Katsumi Yamaoka * mml2015.el (mml2015-epg-key-image): Use mm-set-buffer-multibyte. 2012-12-25 Adam Sjøgren * mml2015.el (mml2015-epg-key-image): use --attribute-fd rather than temporary file to get PGP key image. Pass no-show-photos when extracting image to avoid having it pop up twice. 2012-12-26 Lars Ingebrigtsen * gnus-art.el (gnus-article-treat-types): Include text/html as parts eligible for treatment. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-12-26 13:58:54 +0000 +++ lisp/gnus/ChangeLog 2012-12-26 22:30:58 +0000 @@ -1,5 +1,18 @@ +2012-12-26 Katsumi Yamaoka + + * mml2015.el (mml2015-epg-key-image): Use mm-set-buffer-multibyte. + +2012-12-25 Adam Sjøgren + + * mml2015.el (mml2015-epg-key-image): use --attribute-fd rather than + temporary file to get PGP key image. Pass no-show-photos when extracting + image to avoid having it pop up twice. + 2012-12-26 Lars Ingebrigtsen + * gnus-art.el (gnus-article-treat-types): Include text/html as parts + eligible for treatment. + * gnus-util.el (gnus-goto-colon): Move to the beginning of the visual lines. This makes summary commands with hidden threads work more reliably. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2012-12-25 22:12:59 +0000 +++ lisp/gnus/gnus-art.el 2012-12-26 22:30:58 +0000 @@ -1121,8 +1121,8 @@ (const :tag "Header" head))) (defvar gnus-article-treat-types '("text/plain" "text/x-verbatim" - "text/x-patch") - "Parts to treat.") + "text/x-patch" "text/html") + "Part types eligible for treatment.") (defvar gnus-inhibit-treatment nil "Whether to inhibit treatment.") === modified file 'lisp/gnus/mml2015.el' --- lisp/gnus/mml2015.el 2012-12-26 04:20:21 +0000 +++ lisp/gnus/mml2015.el 2012-12-26 22:30:58 +0000 @@ -822,15 +822,16 @@ (defun mml2015-epg-key-image (key-id) "Return the image of a key, if any" - (let ((filename - (replace-regexp-in-string - "\n" "" - (shell-command-to-string - (format "%s --photo-viewer 'echo %%I >&2' --list-keys %s > /dev/null" - epg-gpg-program key-id))))) - (when (and (not (string-equal filename "")) - (file-exists-p filename)) - (create-image filename)))) + (with-temp-buffer + (mm-set-buffer-multibyte nil) + (let* ((coding-system-for-write 'binary) + (coding-system-for-read 'binary) + (data (shell-command-to-string + (format "%s --list-options no-show-photos --attribute-fd 2 --list-keys %s > /dev/null" + epg-gpg-program key-id)))) + (when (> (length data) 0) + (insert (substring data 16)) + (create-image (buffer-string) nil t))))) (defun mml2015-epg-key-image-to-string (key-id) "Return a string with the image of a key, if any" ------------------------------------------------------------ revno: 111342 committer: Dmitry Gutov branch nick: trunk timestamp: Wed 2012-12-26 23:52:56 +0400 message: * lisp/progmodes/ruby-mode.el (auto-mode-alist): `purecopy' the Rakefile regexp. (auto-mode-alist): Associate .gemspec files with ruby-mode (https://bugs.ruby-lang.org/issues/5453). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-26 16:22:18 +0000 +++ lisp/ChangeLog 2012-12-26 19:52:56 +0000 @@ -1,3 +1,10 @@ +2012-12-26 Dmitry Gutov + + * progmodes/ruby-mode.el (auto-mode-alist): `purecopy' the + Rakefile regexp. + (auto-mode-alist): Associate .gemspec files with ruby-mode + (https://bugs.ruby-lang.org/issues/5453). + 2012-12-26 Jürgen Hötzel * net/tramp-adb.el (tramp-adb-get-ls-command): New defun. Suppress === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2012-12-14 20:05:03 +0000 +++ lisp/progmodes/ruby-mode.el 2012-12-26 19:52:56 +0000 @@ -1682,7 +1682,9 @@ ;;;###autoload (add-to-list 'auto-mode-alist (cons (purecopy "\\.rb\\'") 'ruby-mode)) ;;;###autoload -(add-to-list 'auto-mode-alist '("Rakefile\\'" . ruby-mode)) +(add-to-list 'auto-mode-alist (cons (purecopy "Rakefile\\'") 'ruby-mode)) +;;;###autoload +(add-to-list 'auto-mode-alist (cons (purecopy "\\.gemspec\\'") 'ruby-mode)) ;;;###autoload (dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8")) ------------------------------------------------------------ revno: 111341 author: Jürgen Hötzel committer: Michael Albinus branch nick: trunk timestamp: Wed 2012-12-26 17:22:18 +0100 message: * net/tramp-adb.el (tramp-adb-get-ls-command): New defun. Suppress coloring, if possible (required for BusyBox based systems like CynagenMod). (tramp-adb-handle-file-attributes) (tramp-adb-handle-insert-directory) (tramp-adb-handle-file-name-all-completions): Use it. (tramp-adb-get-toolbox): New defun. Check for remote shell implementation (BusyBox or Toolbox). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-12-26 04:20:21 +0000 +++ lisp/ChangeLog 2012-12-26 16:22:18 +0000 @@ -1,3 +1,14 @@ +2012-12-26 Jürgen Hötzel + + * net/tramp-adb.el (tramp-adb-get-ls-command): New defun. Suppress + coloring, if possible (required for BusyBox based systems like + CynagenMod). + (tramp-adb-handle-file-attributes) + (tramp-adb-handle-insert-directory) + (tramp-adb-handle-file-name-all-completions): Use it. + (tramp-adb-get-toolbox): New defun. Check for remote shell + implementation (BusyBox or Toolbox). + 2012-12-24 Constantin Kulikov (tiny change) * startup.el (initial-buffer-choice): Allow function as value === modified file 'lisp/net/tramp-adb.el' --- lisp/net/tramp-adb.el 2012-12-22 13:44:06 +0000 +++ lisp/net/tramp-adb.el 2012-12-26 16:22:18 +0000 @@ -46,13 +46,15 @@ (defconst tramp-adb-method "adb" "*When this method name is used, forward all calls to Android Debug Bridge.") -(defcustom tramp-adb-prompt "^\\(?:[[:alnum:]]*@[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]" +(defcustom tramp-adb-prompt + "^\\(?:[[:alnum:]]*@[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]" "Regexp used as prompt in almquist shell." :type 'string :version "24.4" :group 'tramp) -(defconst tramp-adb-ls-date-regexp "[[:space:]][0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9][[:space:]][0-9][0-9]:[0-9][0-9][[:space:]]") +(defconst tramp-adb-ls-date-regexp + "[[:space:]][0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9][[:space:]][0-9][0-9]:[0-9][0-9][[:space:]]") ;;;###tramp-autoload (add-to-list 'tramp-methods `(,tramp-adb-method)) @@ -269,16 +271,21 @@ (unless id-format (setq id-format 'integer)) (ignore-errors (with-parsed-tramp-file-name filename nil - (with-tramp-file-property v localname (format "file-attributes-%s" id-format) + (with-tramp-file-property + v localname (format "file-attributes-%s" id-format) (tramp-adb-barf-unless-okay - v (format "ls -d -l %s" (tramp-shell-quote-argument localname)) "") + v (format "%s -d -l %s" + (tramp-adb-get-ls-command v) + (tramp-shell-quote-argument localname)) "") (with-current-buffer (tramp-get-buffer v) (tramp-adb-sh-fix-ls-output) (let* ((columns (split-string (buffer-string))) (mod-string (nth 0 columns)) (is-dir (eq ?d (aref mod-string 0))) (is-symlink (eq ?l (aref mod-string 0))) - (symlink-target (and is-symlink (cadr (split-string (buffer-string) "\\( -> \\|\n\\)")))) + (symlink-target + (and is-symlink + (cadr (split-string (buffer-string) "\\( -> \\|\n\\)")))) (uid (nth 1 columns)) (gid (nth 2 columns)) (date (format "%s %s" (nth 4 columns) (nth 5 columns))) @@ -297,6 +304,27 @@ ;; fake t 1 1))))))) +(defun tramp-adb-get-ls-command (vec) + (with-tramp-connection-property vec "ls" + (tramp-message vec 5 "Finding a suitable `ls' command") + (if (zerop (tramp-adb-command-exit-status + vec "ls --color=never -al /dev/null")) + ;; On CyanogenMod based system BusyBox is used and "ls" output + ;; coloring is enabled by default. So we try to disable it + ;; when possible. + "ls --color=never" + "ls"))) + +(defun tramp-adb-get-toolbox (vec) + "Get shell toolbox implementation: `toolbox' for orginal distributions +or `busybox' for CynagenMode based distributions" + (with-tramp-connection-property vec "toolbox" + (tramp-message vec 5 "Checking shell toolbox implementation") + (cond + ((zerop (tramp-adb-command-exit-status vec "busybox")) 'busybox) + ((zerop (tramp-adb-command-exit-status vec "toolbox")) 'toolbox) + (t 'unkown)))) + (defun tramp-adb--gnu-switches-to-ash (switches) "Almquist shell can't handle multiple arguments. @@ -310,7 +338,8 @@ ;; FIXME: Warning about removed switches (long and non-dash). (delq nil (mapcar - (lambda (s) (and (not (string-match "\\(^--\\|^[^-]\\)" s)) s)) + (lambda (s) + (and (not (string-match "\\(^--\\|^[^-]\\)" s)) s)) switches)))))) (defun tramp-adb-handle-insert-directory @@ -325,14 +354,15 @@ (switch-t (member "-t" switches)) (switches (mapconcat 'identity (remove "-t" switches) " "))) (tramp-adb-barf-unless-okay - v (format "ls %s %s" switches name) + v (format "%s %s %s" (tramp-adb-get-ls-command v) switches name) "Cannot insert directory listing: %s" filename) (unless switch-d ;; We insert also filename/. and filename/.., because "ls" doesn't. (narrow-to-region (point) (point)) (ignore-errors (tramp-adb-barf-unless-okay - v (format "ls -d %s %s %s" + v (format "%s -d %s %s %s" + (tramp-adb-get-ls-command v) switches (concat (file-name-as-directory name) ".") (concat (file-name-as-directory name) "..")) @@ -342,11 +372,15 @@ (insert-buffer-substring (tramp-get-buffer v)))) (defun tramp-adb-sh-fix-ls-output (&optional sort-by-time) - "Androids ls command doesn't insert size column for directories: Emacs dired can't find files. Insert dummy 0 in empty size columns." + "Insert dummy 0 in empty size columns. +Androids \"ls\" command doesn't insert size column for directories: +Emacs dired can't find files." (save-excursion ;; Insert missing size. (goto-char (point-min)) - (while (search-forward-regexp "[[:space:]]\\([[:space:]][0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9][[:space:]]\\)" nil t) + (while + (search-forward-regexp + "[[:space:]]\\([[:space:]][0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9][[:space:]]\\)" nil t) (replace-match "0\\1" "\\1" nil) ;; Insert missing "/". (when (looking-at "[0-9][0-9]:[0-9][0-9][[:space:]]+$") @@ -429,7 +463,9 @@ (with-tramp-file-property v localname "file-name-all-completions" (save-match-data (tramp-adb-send-command - v (format "ls %s" (tramp-shell-quote-argument localname))) + v (format "%s %s" + (tramp-adb-get-ls-command v) + (tramp-shell-quote-argument localname))) (mapcar (lambda (f) (if (file-directory-p f) @@ -787,7 +823,7 @@ (tramp-compat-funcall 'display-message-or-buffer output-buffer) (pop-to-buffer output-buffer)))))))) -;; We use BUFFER also as connection buffer during setup. Because of +;; We use BUFFER also as connection buffer during setup. Because of ;; this, its original contents must be saved, and restored once ;; connection has been setup. (defun tramp-adb-handle-start-file-process (name buffer program &rest args) ------------------------------------------------------------ revno: 111340 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-12-26 19:46:51 +0400 message: * print.c (print_object): Fix last change. diff: === modified file 'src/print.c' --- src/print.c 2012-12-26 15:40:19 +0000 +++ src/print.c 2012-12-26 15:46:51 +0000 @@ -2054,7 +2054,7 @@ { Lisp_Object maybe = ((Lisp_Object *) v->pointer)[i]; - if (valid_lisp_object_p (maybe)) + if (valid_lisp_object_p (maybe) > 0) { PRINTCHAR (' '); print_object (maybe, printcharfun, escapeflag); ------------------------------------------------------------ revno: 111339 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-12-26 19:40:19 +0400 message: * print.c (print_object): If Lisp_Save_Value object's pointer is the address of a memory area containing Lisp_Objects, try to print them. * alloc.c (valid_lisp_object_p): Adjust comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-12-26 14:10:11 +0000 +++ src/ChangeLog 2012-12-26 15:40:19 +0000 @@ -2,6 +2,10 @@ * lisp.h (toplevel): Add two notices to the comment about defining a new Lisp data type. + * print.c (print_object): If Lisp_Save_Value object's pointer + is the address of a memory area containing Lisp_Objects, try + to print them. + * alloc.c (valid_lisp_object_p): Adjust comment. 2012-12-26 Dmitry Antipov === modified file 'src/alloc.c' --- src/alloc.c 2012-12-10 12:08:02 +0000 +++ src/alloc.c 2012-12-26 15:40:19 +0000 @@ -4721,12 +4721,12 @@ #endif } -/* Return 2 if OBJ is a killed or special buffer object. - Return 1 if OBJ is a valid lisp object. - Return 0 if OBJ is NOT a valid lisp object. - Return -1 if we cannot validate OBJ. - This function can be quite slow, - so it should only be used in code for manual debugging. */ +/* Return 2 if OBJ is a killed or special buffer object, 1 if OBJ is a + valid lisp object, 0 if OBJ is NOT a valid lisp object, or -1 if we + cannot validate OBJ. This function can be quite slow, so its primary + use is the manual debugging. The only exception is print_object, where + we use it to check whether the memory referenced by the pointer of + Lisp_Save_Value object contains valid objects. */ int valid_lisp_object_p (Lisp_Object obj) === modified file 'src/print.c' --- src/print.c 2012-11-08 21:58:55 +0000 +++ src/print.c 2012-12-26 15:40:19 +0000 @@ -2034,14 +2034,44 @@ break; case Lisp_Misc_Save_Value: - strout ("#pointer, - XSAVE_VALUE (obj)->integer); - strout (buf, len, len, printcharfun); + int i; + struct Lisp_Save_Value *v = XSAVE_VALUE (obj); + + strout ("#dogc) + { + int lim = min (v->integer, 8); + + /* Try to print up to 8 objects we have saved. Although + valid_lisp_object_p is slow, this shouldn't be a real + bottleneck because such a saved values are quite rare. */ + + i = sprintf (buf, "with %"pD"d objects", v->integer); + strout (buf, i, i, printcharfun); + + for (i = 0; i < lim; i++) + { + Lisp_Object maybe = ((Lisp_Object *) v->pointer)[i]; + + if (valid_lisp_object_p (maybe)) + { + PRINTCHAR (' '); + print_object (maybe, printcharfun, escapeflag); + } + else + strout (" ", -1, -1, printcharfun); + } + if (i == lim && i < v->integer) + strout (" ...", 4, 4, printcharfun); + } + else + { + i = sprintf (buf, "ptr=%p int=%"pD"d", v->pointer, v->integer); + strout (buf, i, i, printcharfun); + } + PRINTCHAR ('>'); } - PRINTCHAR ('>'); break; default: ------------------------------------------------------------ revno: 111338 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-12-26 18:10:11 +0400 message: * lisp.h (toplevel): Add two notices to the comment about defining a new Lisp data type. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-12-26 09:40:45 +0000 +++ src/ChangeLog 2012-12-26 14:10:11 +0000 @@ -1,5 +1,10 @@ 2012-12-26 Dmitry Antipov + * lisp.h (toplevel): Add two notices to the comment about + defining a new Lisp data type. + +2012-12-26 Dmitry Antipov + * keyboard.c (record_asynch_buffer_change): Initialize an event only if it's really needed. * frame.h (enum output_method): Remove output_mac member since === modified file 'src/lisp.h' --- src/lisp.h 2012-12-20 16:09:05 +0000 +++ src/lisp.h 2012-12-26 14:10:11 +0000 @@ -325,6 +325,10 @@ members that are accessible only from C. A Lisp_Misc object is a wrapper for a C struct that can contain anything you like. + Explicit freeing is discouraged for Lisp objects in general. But if + you really need to exploit this, use Lisp_Misc (check free_misc in + alloc.c to see why). There is no way to free a vectorlike object. + To add a new pseudovector type, extend the pvec_type enumeration; to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration. @@ -334,6 +338,10 @@ enumeration and a 1-bit GC markbit) and make sure the overall size of the union is not increased by your addition. + For a new pseudovector, it's highly desirable to limit the size + of your data type by VBLOCK_BYTES_MAX bytes (defined in alloc.c). + Otherwise you will need to change sweep_vectors (also in alloc.c). + Then you will need to add switch branches in print.c (in print_object, to print your object, and possibly also in print_preprocess) and to alloc.c, to mark your object (in ------------------------------------------------------------ revno: 111337 author: Lars Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2012-12-26 13:58:54 +0000 message: Merge changes made in Gnus master gnus-util.el (gnus-goto-colon): Move to the beginning of the visual lines. This makes summary commands with hidden threads work more reliably. gnus-cite.el (gnus-article-hide-citation-maybe): Leave an expansion button to mark the hidden citations (bug#9395). diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-12-26 04:20:21 +0000 +++ lisp/gnus/ChangeLog 2012-12-26 13:58:54 +0000 @@ -1,3 +1,12 @@ +2012-12-26 Lars Ingebrigtsen + + * gnus-util.el (gnus-goto-colon): Move to the beginning of the visual + lines. This makes summary commands with hidden threads work more + reliably. + + * gnus-cite.el (gnus-article-hide-citation-maybe): Leave an expansion + button to mark the hidden citations (bug#9395). + 2012-12-26 Daiki Ueno * mml2015.el (mml2015-epg-signature-to-string): New function. === modified file 'lisp/gnus/gnus-cite.el' --- lisp/gnus/gnus-cite.el 2012-07-24 22:17:17 +0000 +++ lisp/gnus/gnus-cite.el 2012-12-26 13:58:54 +0000 @@ -745,28 +745,14 @@ (gnus-article-search-signature) (setq total (count-lines start (point))) (while atts - (setq hidden (+ hidden (length (cdr (assoc (cdar atts) - gnus-cite-prefix-alist)))) + (setq hidden (+ hidden (length + (cdr (assoc (cdar atts) + gnus-cite-prefix-alist)))) atts (cdr atts))) (when (or force (and (> (* 100 hidden) (* gnus-cite-hide-percentage total)) (> hidden gnus-cite-hide-absolute))) - (gnus-add-wash-type 'cite) - (setq atts gnus-cite-attribution-alist) - (while atts - (setq total (cdr (assoc (cdar atts) gnus-cite-prefix-alist)) - atts (cdr atts)) - (while total - (setq hidden (car total) - total (cdr total)) - (goto-char (point-min)) - (forward-line (1- hidden)) - (unless (assq hidden gnus-cite-attribution-alist) - (gnus-add-text-properties - (point) (progn (forward-line 1) (point)) - (nconc (list 'article-type 'cite) - gnus-hidden-properties))))))))) - (gnus-set-mode-line 'article))) + (gnus-article-hide-citation))))))) (defun gnus-article-hide-citation-in-followups () "Hide cited text in non-root articles." === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2012-12-25 22:12:59 +0000 +++ lisp/gnus/gnus-util.el 2012-12-26 13:58:54 +0000 @@ -225,7 +225,7 @@ (defun gnus-goto-colon () - (beginning-of-line) + (move-beginning-of-line 1) (let ((eol (point-at-eol))) (goto-char (or (text-property-any (point) eol 'gnus-position t) (search-forward ":" eol t) ------------------------------------------------------------ revno: 111336 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-12-26 06:17:38 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2012-12-24 11:17:34 +0000 +++ autogen/configure 2012-12-26 11:17:38 +0000 @@ -7292,38 +7292,12 @@ # . nw="$nw -Wshadow" + # Emacs's use of alloca inhibits protecting the stack. + nw="$nw -Wstack-protector" + # The following line should be removable at some point. nw="$nw -Wsuggest-attribute=pure" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use -Wstack-protector" >&5 -$as_echo_n "checking whether to use -Wstack-protector... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if (1 <= __LONG_MAX__ >> 31 >> 31 \ - && 4 < __GNUC__ + (7 < __GNUC_MINOR__ + (2 <= __GNUC_PATCHLEVEL__))) - /* OK */ - #else - #error "Not GCC, or GCC before 4.7.2, or 'long int' has < 64 bits." - #endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - nw="$nw -Wstack-protector" -fi -rm -f conftest.err conftest.$ac_ext - if test -n "$GCC"; then ------------------------------------------------------------ revno: 111335 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-12-26 13:40:45 +0400 message: * keyboard.c (record_asynch_buffer_change): Initialize an event only if it's really needed. * frame.h (enum output_method): Remove output_mac member since it's a leftover from the deleted code. * frame.c (Fframep): Adjust user here ... * terminal.c (Fterminal_live_p): ... and here. * coding.c (Qmac): Now here because it's only used to denote end-of-line encoding type. (syms_of_coding): DEFSYM it. * frame.h (Qmac): Remove duplicated declaration. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-12-26 02:45:43 +0000 +++ src/ChangeLog 2012-12-26 09:40:45 +0000 @@ -1,3 +1,16 @@ +2012-12-26 Dmitry Antipov + + * keyboard.c (record_asynch_buffer_change): Initialize an event + only if it's really needed. + * frame.h (enum output_method): Remove output_mac member since + it's a leftover from the deleted code. + * frame.c (Fframep): Adjust user here ... + * terminal.c (Fterminal_live_p): ... and here. + * coding.c (Qmac): Now here because it's only used to denote + end-of-line encoding type. + (syms_of_coding): DEFSYM it. + * frame.h (Qmac): Remove duplicated declaration. + 2012-12-26 Paul Eggert * window.c (select_window_1): Now static, since it's used only here. === modified file 'src/coding.c' --- src/coding.c 2012-12-19 15:52:48 +0000 +++ src/coding.c 2012-12-26 09:40:45 +0000 @@ -301,7 +301,7 @@ static Lisp_Object Qcoding_system, Qeol_type; static Lisp_Object Qcoding_aliases; -Lisp_Object Qunix, Qdos; +Lisp_Object Qunix, Qdos, Qmac; Lisp_Object Qbuffer_file_coding_system; static Lisp_Object Qpost_read_conversion, Qpre_write_conversion; static Lisp_Object Qdefault_char; @@ -10303,6 +10303,7 @@ DEFSYM (Qeol_type, "eol-type"); DEFSYM (Qunix, "unix"); DEFSYM (Qdos, "dos"); + DEFSYM (Qmac, "mac"); DEFSYM (Qbuffer_file_coding_system, "buffer-file-coding-system"); DEFSYM (Qpost_read_conversion, "post-read-conversion"); === modified file 'src/frame.c' --- src/frame.c 2012-12-07 08:13:49 +0000 +++ src/frame.c 2012-12-26 09:40:45 +0000 @@ -60,7 +60,7 @@ Lisp_Object Qframep, Qframe_live_p; Lisp_Object Qicon, Qmodeline; Lisp_Object Qonly, Qnone; -Lisp_Object Qx, Qw32, Qmac, Qpc, Qns; +Lisp_Object Qx, Qw32, Qpc, Qns; Lisp_Object Qvisible; Lisp_Object Qdisplay_type; static Lisp_Object Qbackground_mode; @@ -225,8 +225,6 @@ return Qw32; case output_msdos_raw: return Qpc; - case output_mac: - return Qmac; case output_ns: return Qns; default: === modified file 'src/frame.h' --- src/frame.h 2012-12-06 13:48:11 +0000 +++ src/frame.h 2012-12-26 09:40:45 +0000 @@ -46,7 +46,6 @@ output_x_window, output_msdos_raw, output_w32, - output_mac, output_ns }; @@ -1178,7 +1177,7 @@ extern Lisp_Object Qleft_fringe, Qright_fringe; extern Lisp_Object Qheight, Qwidth; extern Lisp_Object Qminibuffer, Qmodeline; -extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns; +extern Lisp_Object Qx, Qw32, Qpc, Qns; extern Lisp_Object Qvisible; extern Lisp_Object Qdisplay_type; === modified file 'src/keyboard.c' --- src/keyboard.c 2012-12-11 06:08:53 +0000 +++ src/keyboard.c 2012-12-26 09:40:45 +0000 @@ -6700,37 +6700,35 @@ void record_asynch_buffer_change (void) { - struct input_event event; - Lisp_Object tem; - EVENT_INIT (event); - - event.kind = BUFFER_SWITCH_EVENT; - event.frame_or_window = Qnil; - event.arg = Qnil; - /* We don't need a buffer-switch event unless Emacs is waiting for input. The purpose of the event is to make read_key_sequence look up the keymaps again. If we aren't in read_key_sequence, we don't need one, and the event could cause trouble by messing up (input-pending-p). Note: Fwaiting_for_user_input_p always returns nil when async subprocesses aren't supported. */ - tem = Fwaiting_for_user_input_p (); - if (NILP (tem)) - return; - - /* Make sure no interrupt happens while storing the event. */ + if (!NILP (Fwaiting_for_user_input_p ())) + { + struct input_event event; + + EVENT_INIT (event); + event.kind = BUFFER_SWITCH_EVENT; + event.frame_or_window = Qnil; + event.arg = Qnil; + + /* Make sure no interrupt happens while storing the event. */ #ifdef USABLE_SIGIO - if (interrupt_input) - kbd_buffer_store_event (&event); - else + if (interrupt_input) + kbd_buffer_store_event (&event); + else #endif - { - stop_polling (); - kbd_buffer_store_event (&event); - start_polling (); + { + stop_polling (); + kbd_buffer_store_event (&event); + start_polling (); + } } } - + /* Read any terminal input already buffered up by the system into the kbd_buffer, but do not wait. === modified file 'src/terminal.c' --- src/terminal.c 2012-11-06 13:26:20 +0000 +++ src/terminal.c 2012-12-26 09:40:45 +0000 @@ -398,8 +398,6 @@ return Qw32; case output_msdos_raw: return Qpc; - case output_mac: - return Qmac; case output_ns: return Qns; default: ------------------------------------------------------------ revno: 111334 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-12-25 21:41:42 -0800 message: Revert static checking of stack smashing. * configure.ac (WARN_CFLAGS): Omit -Wstack-protector when configured with --enable-gcc-warnings. -Wstack-protector causes diagnostics to be issued on Ubuntu 12.10 x86-64. diff: === modified file 'ChangeLog' --- ChangeLog 2012-12-24 06:24:08 +0000 +++ ChangeLog 2012-12-26 05:41:42 +0000 @@ -1,3 +1,10 @@ +2012-12-26 Paul Eggert + + Revert static checking of stack smashing. + * configure.ac (WARN_CFLAGS): Omit -Wstack-protector when + configured with --enable-gcc-warnings. -Wstack-protector causes + diagnostics to be issued on Ubuntu 12.10 x86-64. + 2012-12-24 Paul Eggert Merge from gnulib, incorporating: === modified file 'configure.ac' --- configure.ac 2012-12-21 19:32:43 +0000 +++ configure.ac 2012-12-26 05:41:42 +0000 @@ -727,23 +727,12 @@ # . nw="$nw -Wshadow" + # Emacs's use of alloca inhibits protecting the stack. + nw="$nw -Wstack-protector" + # The following line should be removable at some point. nw="$nw -Wsuggest-attribute=pure" - AC_MSG_CHECKING([whether to use -Wstack-protector]) - AC_PREPROC_IFELSE( - [AC_LANG_PROGRAM( - [[#if (1 <= __LONG_MAX__ >> 31 >> 31 \ - && 4 < __GNUC__ + (7 < __GNUC_MINOR__ + (2 <= __GNUC_PATCHLEVEL__))) - /* OK */ - #else - #error "Not GCC, or GCC before 4.7.2, or 'long int' has < 64 bits." - #endif - ]])], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - nw="$nw -Wstack-protector"]) - gl_MANYWARN_ALL_GCC([ws]) gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) for w in $ws; do