------------------------------------------------------------ revno: 117879 fixes bug: http://debbugs.gnu.org/18474 committer: Jan D. branch nick: trunk timestamp: Sun 2014-09-14 10:23:48 +0200 message: * callproc.c (init_callproc): Fix bug introduced at 2014-09-07. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-13 04:41:54 +0000 +++ src/ChangeLog 2014-09-14 08:23:48 +0000 @@ -1,3 +1,8 @@ +2014-09-14 Jan Djärv + + * callproc.c (init_callproc): Fix bug introduced at + 2014-09-07 (Bug#18474). + 2014-09-13 Dmitry Antipov Prefer ptrdiff_t to int and avoid integer overflows. === modified file 'src/callproc.c' --- src/callproc.c 2014-09-07 20:31:18 +0000 +++ src/callproc.c 2014-09-14 08:23:48 +0000 @@ -1579,7 +1579,7 @@ Lisp_Object tempdir; #ifdef HAVE_NS if (data_dir == 0) - data_dir == ns_etc_directory () != 0; + data_dir = ns_etc_directory () != 0; #endif if (!NILP (Vinstallation_directory)) ------------------------------------------------------------ revno: 117878 committer: Sam Steingold branch nick: trunk timestamp: Sat 2014-09-13 21:28:27 -0400 message: oops diff: === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2014-09-12 19:57:40 +0000 +++ lisp/progmodes/sql.el 2014-09-14 01:28:27 +0000 @@ -5108,11 +5108,6 @@ (interactive "P") (sql-product-interactive 'vertica buffer)) -(provide 'vertica) - -;;; vertica.el ends here - - (provide 'sql) ------------------------------------------------------------ revno: 117877 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2014-09-13 21:59:56 +0300 message: etc/NEWS: Mention HTML support in Rmail. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-09-13 17:44:32 +0000 +++ etc/NEWS 2014-09-13 18:59:56 +0000 @@ -136,6 +136,12 @@ ** The Rmail commands d, C-d and u now handle repeat counts to delete or undelete multiple messages. +** Rmail can now render HTML mail messages if your Emacs was built with +libxml2 or if you have the Lynx browser installed. By default, Rmail +will display the HTML version of a mail message that has both HTML and +plain text parts, if display of HTML email is possible; customize the +`rmail-mime-prefer-html' option to `nil' if you don't want that. + ** SES now supports local printer functions; see `ses-define-local-printer'. ** In sh-mode, you can now use `sh-shell' as a file-local variable to ------------------------------------------------------------ revno: 117876 fixes bug: http://debbugs.gnu.org/18467 committer: Christopher Schmidt branch nick: trunk timestamp: Sat 2014-09-13 19:44:32 +0200 message: * etc/NEWS: Mention nil `calendar-mode-line-format' will not modify the mode line of the calendar buffer. * lisp/calendar/calendar.el (calendar-update-mode-line): Do not overwrite mode-line-format if calendar-mode-line-format is nil. (Bug#18467) diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-09-06 00:59:00 +0000 +++ etc/ChangeLog 2014-09-13 17:44:32 +0000 @@ -1,3 +1,8 @@ +2014-09-13 Christopher Schmidt + + * NEWS: Mention nil `calendar-mode-line-format' will not modify + the mode line of the calendar buffer. (Bug#18467) + 2014-09-06 Leo Liu * NEWS: Mention vector qpattern for pcase. (Bug#18327). === modified file 'etc/NEWS' --- etc/NEWS 2014-09-12 19:57:40 +0000 +++ etc/NEWS 2014-09-13 17:44:32 +0000 @@ -127,6 +127,9 @@ *** Calendar can list and mark diary entries with Chinese dates. See `diary-chinese-list-entries' and `diary-chinese-mark-entries'. +*** The mode line of the calendar buffer will not be modified if +`calendar-mode-line-format' is nil. + ** New ERT function `ert-summarize-tests-batch-and-exit'. --- === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-13 16:30:21 +0000 +++ lisp/ChangeLog 2014-09-13 17:44:32 +0000 @@ -1,3 +1,9 @@ +2014-09-13 Christopher Schmidt + + * calendar/calendar.el (calendar-update-mode-line): + Do not overwrite mode-line-format if calendar-mode-line-format is + nil. (Bug#18467) + 2014-09-13 Leo Liu * emacs-lisp/pcase.el (pcase--dontwarn-upats): New var. === modified file 'lisp/calendar/calendar.el' --- lisp/calendar/calendar.el 2014-09-08 06:03:19 +0000 +++ lisp/calendar/calendar.el 2014-09-13 17:44:32 +0000 @@ -1804,14 +1804,18 @@ nil "today")) '(calendar-date-string (calendar-current-date) t) (calendar-mode-line-entry 'calendar-scroll-left "next month" ">")) - "The mode line of the calendar buffer. + "If non-nil, the mode line of the calendar buffer. This is a list of items that evaluate to strings. The elements are evaluated and concatenated, evenly separated by blanks. During evaluation, the variable `date' is available as the date nearest the cursor (or today's date if that fails). To update -the mode-line as the cursor moves, add `calendar-update-mode-line' -to `calendar-move-hook'. Here is an example that has the Hebrew date, -the day number/days remaining in the year, and the ISO week/year numbers: +the mode-line as the cursor moves, add +`calendar-update-mode-line' to `calendar-move-hook'. + +If nil, do not modify the mode line at all. + +Here is an example that has the Hebrew date, the day number/days +remaining in the year, and the ISO week/year numbers: (list \"\" @@ -1889,7 +1893,8 @@ (defun calendar-update-mode-line () "Update the calendar mode line with the current date and date style." - (if (bufferp (get-buffer calendar-buffer)) + (if (and calendar-mode-line-format + (bufferp (get-buffer calendar-buffer))) (with-current-buffer calendar-buffer (let ((start (- calendar-left-margin 2)) (date (condition-case nil ------------------------------------------------------------ revno: 117875 fixes bug: http://debbugs.gnu.org/16567 committer: Leo Liu branch nick: trunk timestamp: Sun 2014-09-14 00:30:21 +0800 message: * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Add pcase-exhaustive. * emacs-lisp/pcase.el (pcase--dontwarn-upats): New var. (pcase--expand): Use it. (pcase-exhaustive): New macro. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-13 09:25:38 +0000 +++ lisp/ChangeLog 2014-09-13 16:30:21 +0000 @@ -1,3 +1,12 @@ +2014-09-13 Leo Liu + + * emacs-lisp/pcase.el (pcase--dontwarn-upats): New var. + (pcase--expand): Use it. + (pcase-exhaustive): New macro. (Bug#16567) + + * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Add + pcase-exhaustive. + 2014-09-13 Eli Zaretskii * mail/rmailmm.el (rmail-mime-insert-html): Decode the HTML part === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2014-06-19 14:03:45 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2014-09-13 16:30:21 +0000 @@ -197,9 +197,9 @@ (el-vdefs '("defconst" "defcustom" "defvaralias" "defvar-local" "defface")) (el-tdefs '("defgroup" "deftheme")) - (el-kw '("while-no-input" "letrec" "pcase" "pcase-let" - "pcase-let*" "save-restriction" "save-excursion" - "save-selected-window" + (el-kw '("while-no-input" "letrec" "pcase" "pcase-exhaustive" + "pcase-let" "pcase-let*" "save-restriction" + "save-excursion" "save-selected-window" ;; "eval-after-load" "eval-next-after-load" "save-window-excursion" "save-current-buffer" "save-match-data" "combine-after-change-calls" === modified file 'lisp/emacs-lisp/pcase.el' --- lisp/emacs-lisp/pcase.el 2014-09-06 00:59:00 +0000 +++ lisp/emacs-lisp/pcase.el 2014-09-13 16:30:21 +0000 @@ -68,6 +68,8 @@ (defconst pcase--dontcare-upats '(t _ pcase--dontcare)) +(defvar pcase--dontwarn-upats '(pcase--dontcare)) + (def-edebug-spec pcase-UPAT (&or symbolp @@ -148,6 +150,15 @@ ;; (puthash (car cases) `(,exp ,cases ,@expansion) pcase--memoize-2) expansion)))) +;;;###autoload +(defmacro pcase-exhaustive (exp &rest cases) + "The exhaustive version of `pcase' (which see)." + (declare (indent 1) (debug pcase)) + (let* ((x (make-symbol "x")) + (pcase--dontwarn-upats (cons x pcase--dontwarn-upats))) + (pcase--expand + exp (append cases `((,x (error "No clause matching `%S'" ,x))))))) + (defun pcase--let* (bindings body) (cond ((null bindings) (macroexp-progn body)) @@ -280,7 +291,8 @@ vars)))) cases)))) (dolist (case cases) - (unless (or (memq case used-cases) (eq (car case) 'pcase--dontcare)) + (unless (or (memq case used-cases) + (memq (car case) pcase--dontwarn-upats)) (message "Redundant pcase pattern: %S" (car case)))) (macroexp-let* defs main)))) ------------------------------------------------------------ revno: 117874 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-09-13 06:18:48 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2014-05-30 09:33:43 +0000 +++ lisp/mail/rmail.el 2014-09-13 10:18:48 +0000 @@ -4684,7 +4684,7 @@ ;;;*** -;;;### (autoloads nil "rmailmm" "rmailmm.el" "4904dafb4e3b7b456c14e63d2dc9163d") +;;;### (autoloads nil "rmailmm" "rmailmm.el" "5d0f7ffd902384a3d1676a8f9268e348") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ ------------------------------------------------------------ revno: 117873 fixes bug: http://debbugs.gnu.org/4258 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2014-09-13 12:25:38 +0300 message: Fix HTML rendering by shr-insert-document in Rmail. lisp/mail/rmailmm.el (rmail-mime-insert-html): Decode the HTML part using the specified transfer-encoding, if any, or 'undecided'. (rmail-mime-render-html-shr): Bind shr-width to nil, so lines are broken at the window margin. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-13 09:20:15 +0000 +++ lisp/ChangeLog 2014-09-13 09:25:38 +0000 @@ -2,6 +2,8 @@ * mail/rmailmm.el (rmail-mime-insert-html): Decode the HTML part using the specified transfer-encoding, if any, or 'undecided'. + (rmail-mime-render-html-shr): Bind shr-width to nil, so lines are + broken at the window margin. 2013-12-27 Ken Olum === modified file 'lisp/mail/rmailmm.el' --- lisp/mail/rmailmm.el 2014-09-13 09:20:15 +0000 +++ lisp/mail/rmailmm.el 2014-09-13 09:25:38 +0000 @@ -694,7 +694,12 @@ ;; Image retrieval happens asynchronously, but meanwhile ;; `rmail-swap-buffers' may have been run, leaving ;; `shr-image-fetched' trying to insert the image in the wrong buffer. - (shr-inhibit-images t)) + (shr-inhibit-images t) + ;; Bind shr-width to nil to force shr-insert-document break + ;; the lines at the window margin. The default is + ;; fill-column, whose default value is too small, and screws + ;; up display of the quoted messages. + shr-width) (shr-insert-document dom))) (defun rmail-mime-render-html-lynx (source-buffer) ------------------------------------------------------------ revno: 117872 fixes bug: http://debbugs.gnu.org/4258 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2014-09-13 12:20:15 +0300 message: Decode HTML text before presenting it in Rmail. lisp/mail/rmailmm.el (rmail-mime-insert-html): Decode the HTML part using the specified transfer-encoding, if any, or 'undecided'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-13 09:01:56 +0000 +++ lisp/ChangeLog 2014-09-13 09:20:15 +0000 @@ -1,3 +1,8 @@ +2014-09-13 Eli Zaretskii + + * mail/rmailmm.el (rmail-mime-insert-html): Decode the HTML part + using the specified transfer-encoding, if any, or 'undecided'. + 2013-12-27 Ken Olum Support rendering of HTML parts in Rmail (bug#4258). === modified file 'lisp/mail/rmailmm.el' --- lisp/mail/rmailmm.el 2014-09-13 09:01:56 +0000 +++ lisp/mail/rmailmm.el 2014-09-13 09:20:15 +0000 @@ -659,7 +659,12 @@ "Decode, render, and insert html from MIME-entity ENTITY." (let ((body (rmail-mime-entity-body entity)) (transfer-encoding (rmail-mime-entity-transfer-encoding entity)) - (buffer (current-buffer))) + (charset (cdr (assq 'charset (cdr (rmail-mime-entity-type entity))))) + (buffer (current-buffer)) + coding-system) + (if charset (setq coding-system (coding-system-from-name charset))) + (or (and coding-system (coding-system-p coding-system)) + (setq coding-system 'undecided)) (with-temp-buffer (set-buffer-multibyte nil) (setq buffer-undo-list t) @@ -669,6 +674,11 @@ (ignore-errors (base64-decode-region (point-min) (point-max)))) ((string= transfer-encoding "quoted-printable") (quoted-printable-decode-region (point-min) (point-max)))) + (decode-coding-region (point-min) (point) coding-system) + (if (and + (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system)) + (not (eq (coding-system-base coding-system) 'us-ascii))) + (setq rmail-mime-coding-system coding-system)) ;; Convert html in temporary buffer to text and insert in original buffer (let ((source-buffer (current-buffer))) (with-current-buffer buffer ------------------------------------------------------------ revno: 117871 fixes bug: http://debbugs.gnu.org/4258 author: Ken Olum committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2014-09-13 12:01:56 +0300 message: Support rendering of HTML parts in Rmail (bug #4258). lisp/mail/rmailmm.el (rmail-mime-process): Handle text/html separately from other text/ types. Suppress tagline for multipart body. (rmail-mime-parse): Don't change visibility of tagline here. (rmail-mime-set-bulk-data, rmail-mime-insert-bulk): Handle text/html specially. (rmail-mime-render-html-function,rmail-mime-prefer-html): New variables. (rmail-mime-insert-html, rmail-mime-render-html-shr) (rmail-mime-render-html-lynx): New functions. (rmail-mime-fix-inserted-faces): New function. (rmail-mime-process-multipart): Find the best part to show following rmail-mime-prefer-html if set. (rmail-mime-searching): New variable. (rmail-search-mime-message): Bind rmail-mime-searching to suppress rendering while searching. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-12 19:57:40 +0000 +++ lisp/ChangeLog 2014-09-13 09:01:56 +0000 @@ -1,3 +1,22 @@ +2013-12-27 Ken Olum + + Support rendering of HTML parts in Rmail (bug#4258). + * mail/rmailmm.el (rmail-mime-process): Handle text/html + separately from other text/ types. Suppress tagline for + multipart body. + (rmail-mime-parse): Don't change visibility of tagline here. + (rmail-mime-set-bulk-data, rmail-mime-insert-bulk): + Handle text/html specially. + (rmail-mime-render-html-function,rmail-mime-prefer-html): New variables. + (rmail-mime-insert-html, rmail-mime-render-html-shr) + (rmail-mime-render-html-lynx): New functions. + (rmail-mime-fix-inserted-faces): New function. + (rmail-mime-process-multipart): Find the best part to show + following rmail-mime-prefer-html if set. + (rmail-mime-searching): New variable. + (rmail-search-mime-message): Bind rmail-mime-searching to + suppress rendering while searching. + 2014-09-12 Sam Steingold * progmodes/sql.el (sql-product-alist): Add vertica. === modified file 'lisp/mail/rmailmm.el' --- lisp/mail/rmailmm.el 2014-02-10 01:34:22 +0000 +++ lisp/mail/rmailmm.el 2014-09-13 09:01:56 +0000 @@ -131,6 +131,26 @@ :version "23.2" :group 'rmail-mime) +(defcustom rmail-mime-render-html-function + (cond ((fboundp 'libxml-parse-html-region) 'rmail-mime-render-html-shr) + ((executable-find "lynx") 'rmail-mime-render-html-lynx) + (t nil)) + "Function to convert HTML to text. Called with buffer containing HTML +extracted from message in a temporary buffer. Converts to text in current +buffer. If NIL, display HTML source." + :group 'rmail + :version "24.5" + :type '(choice function (const nil))) + +(defcustom rmail-mime-prefer-html + ;; Default to preferring HTML parts, but only if we have a renderer + (if rmail-mime-render-html-function t nil) + "If non-nil, default to showing HTML part rather than text part +when both are available" + :group 'rmail + :version "24.5" + :type 'boolean) + ;;; End of user options. ;;; Global variables that always have let-binding when referred. @@ -150,6 +170,10 @@ The value is usually nil, and bound to non-nil while inserting MIME entities.") +(defvar rmail-mime-searching nil + "Bound to T inside `rmail-search-mime-message' to suppress expensive +operations such as HTML decoding") + ;;; MIME-entity object (defun rmail-mime-entity (type disposition transfer-encoding @@ -631,6 +655,57 @@ (insert-image (create-image data (cdr bulk-data) t)) (insert "\n"))) +(defun rmail-mime-insert-html (entity) + "Decode, render, and insert html from MIME-entity ENTITY." + (let ((body (rmail-mime-entity-body entity)) + (transfer-encoding (rmail-mime-entity-transfer-encoding entity)) + (buffer (current-buffer))) + (with-temp-buffer + (set-buffer-multibyte nil) + (setq buffer-undo-list t) + (insert-buffer-substring rmail-mime-mbox-buffer + (aref body 0) (aref body 1)) + (cond ((string= transfer-encoding "base64") + (ignore-errors (base64-decode-region (point-min) (point-max)))) + ((string= transfer-encoding "quoted-printable") + (quoted-printable-decode-region (point-min) (point-max)))) + ;; Convert html in temporary buffer to text and insert in original buffer + (let ((source-buffer (current-buffer))) + (with-current-buffer buffer + (let ((start (point))) + (if rmail-mime-render-html-function + (funcall rmail-mime-render-html-function source-buffer) + (insert-buffer-substring source-buffer)) + (rmail-mime-fix-inserted-faces start))))))) + +(defun rmail-mime-render-html-shr (source-buffer) + (let ((dom (with-current-buffer source-buffer + (libxml-parse-html-region (point-min) (point-max)))) + ;; Image retrieval happens asynchronously, but meanwhile + ;; `rmail-swap-buffers' may have been run, leaving + ;; `shr-image-fetched' trying to insert the image in the wrong buffer. + (shr-inhibit-images t)) + (shr-insert-document dom))) + +(defun rmail-mime-render-html-lynx (source-buffer) + (let ((destination-buffer (current-buffer))) + (with-current-buffer source-buffer + (call-process-region (point-min) (point-max) + "lynx" nil destination-buffer nil + "-stdin" "-dump" "-force_html" + "-dont_wrap_pre" "-width=70")))) + +;; Put font-lock-face properties matching face properties on text +;; inserted, e.g., by shr, in text from START to point. +(defun rmail-mime-fix-inserted-faces (start) + (while (< start (point)) + (let ((face (get-text-property start 'face)) + (next (next-single-property-change + start 'face (current-buffer) (point)))) + (if face ; anything to do? + (put-text-property start next 'font-lock-face face)) + (setq start next)))) + (defun rmail-mime-toggle-button (button) "Hide or show the body of the MIME-entity associated with BUTTON." (save-excursion @@ -675,6 +750,8 @@ (setq size (/ (* size 7) 3))))))) (cond + ((string-match "text/html" content-type) + (setq type 'html)) ((string-match "text/" content-type) (setq type 'text)) ((string-match "image/\\(.*\\)" content-type) @@ -784,6 +861,12 @@ (if (rmail-mime-display-body new) (cond ((eq (cdr bulk-data) 'text) (rmail-mime-insert-decoded-text entity)) + ((eq (cdr bulk-data) 'html) + ;; Render HTML if display single message, but if searching + ;; don't render but just search HTML itself. + (if rmail-mime-searching + (rmail-mime-insert-decoded-text entity) + (rmail-mime-insert-html entity))) ((cdr bulk-data) (rmail-mime-insert-image entity)) (t @@ -918,18 +1001,28 @@ (setq entities (nreverse entities)) (if (string-match "alternative" subtype) ;; Find the best entity to show, and hide all the others. - (let (best second) + ;; If rmail-mime-prefer-html is set, html is best, then plain. + ;; If not, plain is best, then html. + ;; Then comes any other text part. + ;; If thereto of the same type, earlier entities in the message (later + ;; in the reverse list) are preferred. + (let (best best-priority) (dolist (child entities) (if (string= (or (car (rmail-mime-entity-disposition child)) (car content-disposition)) "inline") - (if (string-match "text/plain" - (car (rmail-mime-entity-type child))) - (setq best child) - (if (string-match "text/.*" - (car (rmail-mime-entity-type child))) - (setq second child))))) - (or best (not second) (setq best second)) + (let ((type (car (rmail-mime-entity-type child)))) + (if (string-match "text/" type) + ;; Consider all inline text parts + (let ((priority + (cond ((string-match "text/html" type) + (if rmail-mime-prefer-html 1 2)) + ((string-match "text/plain" type) + (if rmail-mime-prefer-html 2 1)) + (t 3)))) + (if (or (null best) (<= priority best-priority)) + (setq best child + best-priority priority))))))) (dolist (child entities) (unless (eq best child) (aset (rmail-mime-entity-body child) 2 nil) @@ -1114,6 +1207,8 @@ (cond ((string-match "multipart/.*" (car content-type)) (save-restriction (narrow-to-region (1- end) (point-max)) + (if (zerop (length parse-tag)) ; top level of message + (aset new 1 (aset tagline 2 nil))) ; don't show tagline (setq children (rmail-mime-process-multipart content-type content-disposition @@ -1134,6 +1229,12 @@ (aset (rmail-mime-entity-tagline msg) 2 nil) (setq children (list msg) handler 'rmail-mime-insert-multipart)))) + ((and is-inline (string-match "text/html" (car content-type))) + ;; Display tagline, so part can be detached + (aset new 1 (aset tagline 2 t)) + (aset new 2 (aset body 2 t)) ; display body also. + (setq handler 'rmail-mime-insert-bulk)) + ;; Inline non-HTML text ((and is-inline (string-match "text/" (car content-type))) ;; Don't need a tagline. (aset new 1 (aset tagline 2 nil)) @@ -1186,10 +1287,6 @@ (new (aref (rmail-mime-entity-display entity) 1))) ;; Show header. (aset new 0 (aset (rmail-mime-entity-header entity) 2 t)) - ;; Show tagline if and only if body is not shown. - (if (aref new 2) - (aset new 1 (aset (rmail-mime-entity-tagline entity) 2 nil)) - (aset new 1 (aset (rmail-mime-entity-tagline entity) 2 t))) entity))) (error (format "%s" err))))) @@ -1390,7 +1487,8 @@ "Function to set in `rmail-search-mime-message-function' (which see)." (save-restriction (narrow-to-region (rmail-msgbeg msg) (rmail-msgend msg)) - (let* ((rmail-mime-mbox-buffer (current-buffer)) + (let* ((rmail-mime-searching t) ; mark inside search + (rmail-mime-mbox-buffer (current-buffer)) (rmail-mime-view-buffer rmail-view-buffer) (header-end (save-excursion (re-search-forward "^$" nil 'move) (point))) ------------------------------------------------------------ revno: 117870 committer: Dmitry Antipov branch nick: trunk timestamp: Sat 2014-09-13 08:41:54 +0400 message: Prefer ptrdiff_t to int and avoid integer overflows. * fileio.c (make_temp_name): * font.c (font_parse_family_registry): Avoid integer overflow on string size calculation. * data.c (Faset): Likewise for byte index. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-12 11:12:40 +0000 +++ src/ChangeLog 2014-09-13 04:41:54 +0000 @@ -1,3 +1,11 @@ +2014-09-13 Dmitry Antipov + + Prefer ptrdiff_t to int and avoid integer overflows. + * fileio.c (make_temp_name): + * font.c (font_parse_family_registry): Avoid integer + overflow on string size calculation. + * data.c (Faset): Likewise for byte index. + 2014-09-12 Detlev Zundel * buffer.c (syms_of_buffer): DEFSYM Qchoice (Bug#18337). @@ -15,7 +23,7 @@ * lread.c (readevalloop_eager_expand_eval): Add GCPRO and fix bootstrap broken if GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE. - Remove redundant GCPROs around Ffuncall and Fapply calls. This + Remove redundant GCPROs around Ffuncall and Fapply calls. This is safe because Ffuncall protects all of its arguments by itself. * charset.c (map_charset_for_dump): Remove redundant GCPRO. * eval.c (Fapply, apply1, call0, call1, call2, call3, call4, call5) === modified file 'src/data.c' --- src/data.c 2014-09-08 06:00:58 +0000 +++ src/data.c 2014-09-13 04:41:54 +0000 @@ -2310,7 +2310,7 @@ { if (! SINGLE_BYTE_CHAR_P (c)) { - int i; + ptrdiff_t i; for (i = SBYTES (array) - 1; i >= 0; i--) if (SREF (array, i) >= 0x80) === modified file 'src/fileio.c' --- src/fileio.c 2014-09-07 07:04:01 +0000 +++ src/fileio.c 2014-09-13 04:41:54 +0000 @@ -728,7 +728,7 @@ make_temp_name (Lisp_Object prefix, bool base64_p) { Lisp_Object val, encoded_prefix; - int len; + ptrdiff_t len; printmax_t pid; char *p, *data; char pidbuf[INT_BUFSIZE_BOUND (printmax_t)]; === modified file 'src/font.c' --- src/font.c 2014-09-07 17:04:19 +0000 +++ src/font.c 2014-09-13 04:41:54 +0000 @@ -1761,7 +1761,7 @@ void font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Object font_spec) { - int len; + ptrdiff_t len; char *p0, *p1; if (! NILP (family) ------------------------------------------------------------ revno: 117869 committer: Sam Steingold branch nick: trunk timestamp: Fri 2014-09-12 15:57:40 -0400 message: Add support for Vertica SQL. * lisp/progmodes/sql.el (sql-product-alist): Add vertica. (sql-vertica-program, sql-vertica-options) (sql-vertica-login-params, sql-comint-vertica, sql-vertica): New functions and variables to support Vertica. Inspired by code by Roman Scherer . diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-09-08 12:38:53 +0000 +++ etc/NEWS 2014-09-12 19:57:40 +0000 @@ -155,6 +155,8 @@ interactive buffer and advances to the next line, skipping whitespace and comments. +*** Add support for Vertica SQL. + ** VC and related modes *** New option `vc-annotate-background-mode' controls whether === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-11 19:44:25 +0000 +++ lisp/ChangeLog 2014-09-12 19:57:40 +0000 @@ -1,3 +1,11 @@ +2014-09-12 Sam Steingold + + * progmodes/sql.el (sql-product-alist): Add vertica. + (sql-vertica-program, sql-vertica-options) + (sql-vertica-login-params, sql-comint-vertica, sql-vertica): + New functions and variables to support Vertica. + Inspired by code by Roman Scherer . + 2014-09-11 Paul Eggert * ses.el (ses-file-format-extend-parameter-list): Rename from === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2014-09-09 20:39:31 +0000 +++ lisp/progmodes/sql.el 2014-09-12 19:57:40 +0000 @@ -505,6 +505,19 @@ :prompt-length 5 :syntax-alist ((?@ . "_")) :terminator ("^go" . "go")) + + (vertica + :name "Vertica" + :sqli-program sql-vertica-program + :sqli-options sql-vertica-options + :sqli-login sql-vertica-login-params + :sqli-comint-func 'sql-comint-vertica + :list-all ("select table_name from v_catalog.tables" . + "select * from v_catalog.tables") + :list-table "\\d %s" + :prompt-regexp "^\\w*=[#>] " + :prompt-length 5 + :prompt-cont-regexp "^\\w*[-(][#>] ") ) "An alist of product specific configuration settings. @@ -5056,6 +5069,51 @@ +(defcustom sql-vertica-program "vsql" + "Command to start the Vertica client." + :version "24.5" + :type 'file + :group 'SQL) + +(defcustom sql-vertica-options '("-P" "pager=off") + "List of additional options for `sql-vertica-program'. +The default value disables the internal pager." + :version "24.5" + :type '(repeat string) + :group 'SQL) + +(defcustom sql-vertica-login-params '(user password database server) + "List of login parameters needed to connect to Vertica." + :version "24.5" + :type 'sql-login-params + :group 'SQL) + +(defun sql-comint-vertica (product options) + "Create comint buffer and connect to Vertica." + (sql-comint product + (nconc + (and (not (string= "" sql-server)) + (list "-h" sql-server)) + (and (not (string= "" sql-database)) + (list "-d" sql-database)) + (and (not (string= "" sql-password)) + (list "-w" sql-password)) + (and (not (string= "" sql-user)) + (list "-U" sql-user)) + options))) + +;;;###autoload +(defun sql-vertica (&optional buffer) + "Run vsql as an inferior process." + (interactive "P") + (sql-product-interactive 'vertica buffer)) + +(provide 'vertica) + +;;; vertica.el ends here + + + (provide 'sql) ;;; sql.el ends here ------------------------------------------------------------ revno: 117868 author: Detlev Zundel committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2014-09-12 15:12:40 +0400 message: * buffer.c (syms_of_buffer): DEFSYM Qchoice (Bug#18337). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-11 13:21:19 +0000 +++ src/ChangeLog 2014-09-12 11:12:40 +0000 @@ -1,3 +1,7 @@ +2014-09-12 Detlev Zundel + + * buffer.c (syms_of_buffer): DEFSYM Qchoice (Bug#18337). + 2014-09-11 Dmitry Antipov * lisp.h (make_local_string): Nitpick indent. === modified file 'src/buffer.c' --- src/buffer.c 2014-09-11 19:44:25 +0000 +++ src/buffer.c 2014-09-12 11:12:40 +0000 @@ -5391,6 +5391,7 @@ staticpro (&Qpermanent_local); staticpro (&Qkill_buffer_hook); + DEFSYM (Qchoice, "choice"); DEFSYM (Qleft, "left"); DEFSYM (Qright, "right"); DEFSYM (Qrange, "range"); ------------------------------------------------------------ revno: 117867 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-09-11 12:44:25 -0700 message: Spelling fixes. * lisp/ses.el (ses-file-format-extend-parameter-list): Rename from ses-file-format-extend-paramter-list. All uses changed. * lisp/gnus-cloud.el (gnus-cloud-parse-version-1): Fix misspelling of ":delete". diff: === modified file 'doc/misc/vhdl-mode.texi' --- doc/misc/vhdl-mode.texi 2014-06-10 02:20:31 +0000 +++ doc/misc/vhdl-mode.texi 2014-09-11 19:44:25 +0000 @@ -212,7 +212,7 @@ @cindex comment only line Syntactic component lists can contain more than one component, and -individual syntactic compenents need not have relative buffer positions. +individual syntactic components need not have relative buffer positions. The most common example of this is a line that contains a @dfn{comment only line}. @example @@ -416,7 +416,7 @@ @end group @end example -In other words, we want to change the indentation of the statments +In other words, we want to change the indentation of the statements inside the inverter process. Notice that the construct we want to change starts on line 3. To change the indentation of a line, we need to see which syntactic component affect the offset calculations for that @@ -630,7 +630,7 @@ @findex set-offset (vhdl-) Another variable, @code{vhdl-file-offsets}, takes an association list similar to what is allowed in @code{vhdl-offsets-alist}. When the file is -visited, VHDL Mode will automatically institute these offets using +visited, VHDL Mode will automatically institute these offsets using @code{vhdl-set-offset}. @xref{Customizing Indentation}. Note that file style settings (i.e. @code{vhdl-file-style}) are applied @@ -648,7 +648,7 @@ For most users, VHDL Mode will support their coding styles with very little need for customizations. Usually, one of the standard styles defined in @code{vhdl-style-alist} will do the trick. Sometimes, -one of the syntactic symbol offsets will need to be tweeked slightly, or +one of the syntactic symbol offsets will need to be tweaked slightly, or perhaps @code{vhdl-basic-offset} will need to be changed. However, some styles require a more advanced ability for customization, and one of the real strengths of VHDL Mode is that the syntactic analysis model === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-10 21:38:11 +0000 +++ lisp/ChangeLog 2014-09-11 19:44:25 +0000 @@ -1,3 +1,9 @@ +2014-09-11 Paul Eggert + + * ses.el (ses-file-format-extend-parameter-list): Rename from + ses-file-format-extend-paramter-list, to correct a misspelling. + All uses changed. + 2014-09-10 Alan Mackenzie CC Mode: revert recent changes and fix bug 17463 (cc-langs.elc === modified file 'lisp/ChangeLog.16' --- lisp/ChangeLog.16 2014-08-28 22:18:39 +0000 +++ lisp/ChangeLog.16 2014-09-11 19:44:25 +0000 @@ -5052,7 +5052,7 @@ (w32-handle-dropped-file): Convert incoming dropped files from Windows paths to Cygwin ones before passing them on to the rest of Emacs. - (w32-drag-n-drop): New paramter new-frame. Simplify logic. + (w32-drag-n-drop): New parameter new-frame. Simplify logic. (w32-initialize-window-system): Assert we're not initialized twice. * term/x-win.el: Require cl-lib; add ourselves to display-format-alist. === modified file 'lisp/calendar/icalendar.el' --- lisp/calendar/icalendar.el 2014-08-11 00:47:10 +0000 +++ lisp/calendar/icalendar.el 2014-09-11 19:44:25 +0000 @@ -1531,7 +1531,7 @@ Enumerate the evaluated sexp entry for the next `icalendar-export-sexp-enumeration-days' days. NONMARKER is a regular expression matching the start of non-marking entries. -ENTRY-MAIN is the first line of the diary entry. +ENTRY-MAIN is the first line of the diary entry. Optional argument START determines the first day of the enumeration, given as a time value, in same format as returned by @@ -1574,8 +1574,8 @@ (let ((calendar-date-style 'iso)) (icalendar--convert-ordinary-to-ical nonmarker (format "%4d/%02d/%02d %s" y m d see)))) - (;TODO: - (error (format "Unsopported Sexp-entry: %s" + (;TODO: + (error (format "Unsupported Sexp-entry: %s" entry-main)))))) (number-sequence 0 (- icalendar-export-sexp-enumeration-days 1)))))) === modified file 'lisp/composite.el' --- lisp/composite.el 2014-06-28 01:34:17 +0000 +++ lisp/composite.el 2014-09-11 19:44:25 +0000 @@ -702,7 +702,7 @@ (setq xoff (- (lglyph-rbearing fc)))) (if (< dc-width fc-width) ;; The following glyph is wider, but we don't know how to - ;; align both glyphs. So, try the easiet method; + ;; align both glyphs. So, try the easiest method; ;; i.e. align left edges of the glyphs. (setq xoff (- xoff (- dc-width) (- (lglyph-lbearing fc ))) width (- fc-width dc-width))) === modified file 'lisp/emacs-lisp/eldoc.el' --- lisp/emacs-lisp/eldoc.el 2014-09-04 15:23:37 +0000 +++ lisp/emacs-lisp/eldoc.el 2014-09-11 19:44:25 +0000 @@ -411,7 +411,7 @@ (when (cdr split) (setq key-have-value t)))))))) ;; If `cur-a' is not one of `args-lst-ak' - ;; assume user is entering an unknow key + ;; assume user is entering an unknown key ;; referenced in last position in signature. (other-key-arg (and (stringp cur-a) args-lst-ak === modified file 'lisp/emacs-lisp/subr-x.el' --- lisp/emacs-lisp/subr-x.el 2014-06-30 20:17:17 +0000 +++ lisp/emacs-lisp/subr-x.el 2014-09-11 19:44:25 +0000 @@ -47,7 +47,7 @@ (_ (car forms)))) (defmacro thread-first (&rest forms) - "Thread FORMS elements as the first argument of their succesor. + "Thread FORMS elements as the first argument of their successor. Example: (thread-first 5 @@ -64,7 +64,7 @@ `(internal--thread-argument t ,@forms)) (defmacro thread-last (&rest forms) - "Thread FORMS elements as the last argument of their succesor. + "Thread FORMS elements as the last argument of their successor. Example: (thread-last 5 @@ -118,7 +118,7 @@ "Process BINDINGS and if all values are non-nil eval THEN, else ELSE. Argument BINDINGS is a list of tuples whose car is a symbol to be bound and (optionally) used in THEN, and its cadr is a sexp to be -evaled to set symbol's value. In the special case you only want +evalled to set symbol's value. In the special case you only want to bind a single value, BINDINGS can just be a plain tuple." (declare (indent 2) (debug ((&rest (symbolp form)) form body))) (when (and (<= (length bindings) 2) @@ -134,7 +134,7 @@ "Process BINDINGS and if all values are non-nil eval BODY. Argument BINDINGS is a list of tuples whose car is a symbol to be bound and (optionally) used in BODY, and its cadr is a sexp to be -evaled to set symbol's value. In the special case you only want +evalled to set symbol's value. In the special case you only want to bind a single value, BINDINGS can just be a plain tuple." (declare (indent 1) (debug if-let)) (list 'if-let bindings (macroexp-progn body))) === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-08-26 23:56:11 +0000 +++ lisp/gnus/ChangeLog 2014-09-11 19:44:25 +0000 @@ -1,3 +1,8 @@ +2014-09-11 Paul Eggert + + * gnus-cloud.el (gnus-cloud-parse-version-1): Fix misspelling + of ":delete". + 2014-08-26 Katsumi Yamaoka * gnus-art.el (gnus-article-browse-html-save-cid-content) === modified file 'lisp/gnus/gnus-cloud.el' --- lisp/gnus/gnus-cloud.el 2014-03-24 00:35:00 +0000 +++ lisp/gnus/gnus-cloud.el 2014-09-11 19:44:25 +0000 @@ -125,7 +125,7 @@ (let ((spec (ignore-errors (read (current-buffer)))) length) (when (and (consp spec) - (memq (plist-get spec :type) '(:file :data :deleta))) + (memq (plist-get spec :type) '(:file :data :delete))) (setq length (plist-get spec :length)) (push (append spec (list === modified file 'lisp/gnus/gnus-fun.el' --- lisp/gnus/gnus-fun.el 2014-05-08 03:41:21 +0000 +++ lisp/gnus/gnus-fun.el 2014-09-11 19:44:25 +0000 @@ -239,7 +239,7 @@ ;;;###autoload (defun gnus-insert-random-face-header () - "Insert a randome Face header from `gnus-face-directory'." + "Insert a random Face header from `gnus-face-directory'." (gnus--insert-random-face-with-type 'gnus-random-face 'Face)) (defface gnus-x-face '((t (:foreground "black" :background "white"))) === modified file 'lisp/ldefs-boot.el' --- lisp/ldefs-boot.el 2014-09-01 10:21:26 +0000 +++ lisp/ldefs-boot.el 2014-09-11 19:44:25 +0000 @@ -25893,7 +25893,7 @@ NSGraphicsContext => \"NS\", \"Graphics\" and \"Context\" This mode changes the definition of a word so that word commands -treat nomenclature boundaries as word bounaries. +treat nomenclature boundaries as word boundaries. \\{subword-mode-map} === modified file 'lisp/ls-lisp.el' --- lisp/ls-lisp.el 2014-09-01 15:03:45 +0000 +++ lisp/ls-lisp.el 2014-09-11 19:44:25 +0000 @@ -543,7 +543,7 @@ On GNU/Linux systems, if the locale specifies UTF-8 as the codeset, the sorting order will place together file names that differ only by punctuation characters, like `.emacs' and `emacs'. To have a -similar behavior on MS-Widnows, customize `ls-lisp-UCA-like-collation' +similar behavior on MS-Windows, customize `ls-lisp-UCA-like-collation' to a non-nil value." (let ((w32-collate-ignore-punctuation ls-lisp-UCA-like-collation)) (if ls-lisp-use-string-collate === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2014-09-10 21:38:11 +0000 +++ lisp/progmodes/cc-engine.el 2014-09-11 19:44:25 +0000 @@ -3296,7 +3296,7 @@ (setq res (c-remove-stale-state-cache start-point here here-bopl)) (setq cache-pos (car res) scan-backward-pos (cadr res) - cons-separated (car (cddr res)) + cons-separated (car (cddr res)) bopl-state (cadr (cddr res))) ; will be nil if (< here-bopl ; start-point) (if (and scan-backward-pos @@ -6286,7 +6286,7 @@ ;; `*-font-lock-extra-types'); ;; o - 'prefix if it's a known prefix of a type; ;; o - 'found if it's a type that matches one in `c-found-types'; - ;; o - 'maybe if it's an identfier that might be a type; + ;; o - 'maybe if it's an identifier that might be a type; ;; o - 'decltype if it's a decltype(variable) declaration; - or ;; o - nil if it can't be a type (the point isn't moved then). ;; @@ -6668,8 +6668,8 @@ ;; auto foo = 5; ;; car ^ ^ point ;; auto cplusplus_11 (int a, char *b) -> decltype (bar): - ;; car ^ ^ point - ;; + ;; car ^ ^ point + ;; ;; ;; ;; The cdr of the return value is non-nil when a === modified file 'lisp/progmodes/hideif.el' --- lisp/progmodes/hideif.el 2014-07-21 06:03:08 +0000 +++ lisp/progmodes/hideif.el 2014-09-11 19:44:25 +0000 @@ -653,7 +653,7 @@ (stringp id)))) (defun hif-define-operator (tokens) - "`Upgrade' hif-define xxx to '(hif-define xxx)' so it won't be subsitituted." + "`Upgrade' hif-define xxx to '(hif-define xxx)' so it won't be substituted." (let ((result nil) (tok nil)) (while (setq tok (pop tokens)) @@ -975,7 +975,7 @@ (defun hif-define-macro (_parmlist _token-body) "A marker for defined macro with arguments. -This macro cannot be evaluated alone without parameters inputed." +This macro cannot be evaluated alone without parameters input." ;;TODO: input arguments at run time, use minibuffer to query all arguments (error "Argumented macro cannot be evaluated without passing any parameter")) @@ -1144,14 +1144,14 @@ actual-count (length actual-parms)) (if (> formal-count actual-count) - (error "Too few parmameter for macro %S" macro-name) + (error "Too few parameters for macro %S" macro-name) (if (< formal-count actual-count) (or etc (error "Too many parameters for macro %S" macro-name)))) ;; Perform token replacement on the MACRO-BODY with the parameters (while (setq formal (pop formal-parms)) - ;; Prevent repetitive substitutation, thus cannot use `subst' + ;; Prevent repetitive substitution, thus cannot use `subst' ;; for example: ;; #define mac(a,b) (a+b) ;; #define testmac mac(b,y) @@ -1734,7 +1734,7 @@ (or (setcdr SA expr) t) ;; Lazy evaluation, eval only if hif-lookup find it. ;; Define it anyway, even if nil it's still in list - ;; and therefore considerred defined + ;; and therefore considered defined. (push (cons (intern name) expr) hide-ifdef-env))))) ;; #undef (and name @@ -1912,7 +1912,7 @@ (defun hide-ifdef-block (&optional arg start end) "Hide the ifdef block (true or false part) enclosing or before the cursor. -With optional prefix agument ARG, also hide the #ifdefs themselves." +With optional prefix argument ARG, also hide the #ifdefs themselves." (interactive "P\nr") (let ((hide-ifdef-lines arg)) (if mark-active === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2014-09-03 04:21:40 +0000 +++ lisp/progmodes/python.el 2014-09-11 19:44:25 +0000 @@ -2153,7 +2153,7 @@ received in chunks, since `accept-process-output' gives no guarantees they will be grabbed in a single call. An example use case for this would be the CPython shell start-up, where the -banner and the initial prompt are received separetely." +banner and the initial prompt are received separately." (let ((regexp (or regexp comint-prompt-regexp))) (catch 'found (while t @@ -4110,7 +4110,7 @@ (cdr pair)))) (buffer-local-variables from-buffer))) -(defvar comint-last-prompt-overlay) ; Shut up, bytecompiler +(defvar comint-last-prompt-overlay) ; Shut up, byte compiler. (defun python-util-comint-last-prompt () "Return comint last prompt overlay start and end. === modified file 'lisp/progmodes/subword.el' --- lisp/progmodes/subword.el 2014-05-24 20:43:40 +0000 +++ lisp/progmodes/subword.el 2014-09-11 19:44:25 +0000 @@ -113,7 +113,7 @@ NSGraphicsContext => \"NS\", \"Graphics\" and \"Context\" This mode changes the definition of a word so that word commands -treat nomenclature boundaries as word bounaries. +treat nomenclature boundaries as word boundaries. \\{subword-mode-map}" :lighter " ," @@ -130,7 +130,7 @@ ;; N.B. These commands aren't used unless explicitly invoked; they're ;; here for compatibility. Today, subword-mode leaves motion commands ;; alone and uses `find-word-boundary-function-table' to change how -;; `forward-word' and other low-level commands detect word bounaries. +;; `forward-word' and other low-level commands detect word boundaries. ;; This way, all word-related activities, not just the images we ;; imagine here, get subword treatment. @@ -334,7 +334,7 @@ tab) "Assigned to `find-word-boundary-function-table' in `subword-mode' and `superword-mode'; defers to -`subword-find-word-bounary'.") +`subword-find-word-boundary'.") (defconst subword-empty-char-table (make-char-table nil) === modified file 'lisp/rect.el' --- lisp/rect.el 2014-08-04 06:27:14 +0000 +++ lisp/rect.el 2014-09-11 19:44:25 +0000 @@ -113,7 +113,7 @@ (if (window-parameter nil 'rectangle--point-crutches) (setf (window-parameter nil 'rectangle--point-crutches) nil)) (if rectangle--mark-crutches (setq rectangle--mark-crutches nil))) - ;; If move-to-column over-shooted, move back one char so we're + ;; If move-to-column overshot, move back one char so we're ;; at the position where rectangle--highlight-for-redisplay ;; will add the overlay (so that the cursor can be drawn at the ;; right place). === modified file 'lisp/ses.el' --- lisp/ses.el 2014-07-21 17:53:38 +0000 +++ lisp/ses.el 2014-09-11 19:44:25 +0000 @@ -301,7 +301,7 @@ (defmacro ses--metaprogramming (exp) (declare (debug t)) (eval exp t)) (ses--metaprogramming `(progn ,@(mapcar (lambda (x) `(defvar ,(or (car-safe x) x))) ses-localvars))) - + (defun ses-set-localvars () "Set buffer-local and initialize some SES variables." (dolist (x ses-localvars) @@ -1349,11 +1349,11 @@ (goto-char ses--params-marker) (forward-line def)))) -(defun ses-file-format-extend-paramter-list (new-file-format) +(defun ses-file-format-extend-parameter-list (new-file-format) "Extend the global parameters list when file format is updated from 2 to 3. This happens when local printer function are added to a sheet that was created with SES version 2. This is not -undoable. Return nil when there was no change, and non nil otherwise." +undoable. Return nil when there was no change, and non nil otherwise." (save-excursion (cond ((and (= ses--file-format 2) (= 3 new-file-format)) @@ -1759,7 +1759,7 @@ (numberp (nth 2 params)) (> (nth 2 params) 0) (or (<= params-len 3) - (let ((numlocprn (nth 3 params))) + (let ((numlocprn (nth 3 params))) (and (integerp numlocprn) (>= numlocprn 0))))) (error "Invalid SES file")) (setq ses--file-format (car params) @@ -1793,8 +1793,8 @@ (mapc 'ses-printer-record ses-standard-printer-functions) (setq ses--symbolic-formulas nil) - ;; Load local printer definitions. - ;; This must be loaded *BEFORE* cells and column printers because the latters + ;; Load local printer definitions. + ;; This must be loaded *BEFORE* cells and column printers because the latter ;; may call them. (save-excursion (forward-line (* ses--numrows (1+ ses--numcols))) @@ -3462,7 +3462,7 @@ (backward-char)) (insert printer-def-text) (when (= create-printer 1) - (ses-file-format-extend-paramter-list 3) + (ses-file-format-extend-parameter-list 3) (ses-set-parameter 'ses--numlocprn (+ ses--numlocprn create-printer)))))))))) === modified file 'lisp/textmodes/tex-mode.el' --- lisp/textmodes/tex-mode.el 2014-09-05 19:07:52 +0000 +++ lisp/textmodes/tex-mode.el 2014-09-11 19:44:25 +0000 @@ -2576,7 +2576,7 @@ (defcustom tex-print-file-extension ".dvi" "The TeX-compiled file extension for viewing and printing. If you use pdflatex instead of latex, set this to \".pdf\" and modify - `tex-dvi-view-command' and `tex-dvi-print-command' appropriatelty." + `tex-dvi-view-command' and `tex-dvi-print-command' appropriately." :type 'string :group 'tex-view :version "24.5") === modified file 'lisp/window.el' --- lisp/window.el 2014-08-29 10:39:17 +0000 +++ lisp/window.el 2014-09-11 19:44:25 +0000 @@ -3026,12 +3026,12 @@ If necessary and possible, make sure that every window on frame FRAME has its minimum height. Optional argument HORIZONTAL non-nil means to make sure that every window on frame FRAME has -its minimum width. The minimumm height/width of a window is the +its minimum width. The minimum height/width of a window is the respective value returned by `window-min-size' for that window. Return t if all windows were resized appropriately. Return nil if at least one window could not be resized as requested, which -may happen when the FRAME is not large enough to accomodate it." +may happen when the FRAME is not large enough to accommodate it." (let ((value t)) (walk-window-tree (lambda (window) === modified file 'src/alloc.c' --- src/alloc.c 2014-09-10 15:21:46 +0000 +++ src/alloc.c 2014-09-11 19:44:25 +0000 @@ -453,7 +453,7 @@ /* If we can't store all memory addresses in our lisp objects, it's risky to let the heap use mmap and give us addresses from all over our address space. We also can't use mmap for lisp objects - if we might dump: unexec doesn't preserve the contents of mmaped + if we might dump: unexec doesn't preserve the contents of mmapped regions. */ return pointers_fit_in_lispobj_p () && !might_dump; } @@ -7131,7 +7131,7 @@ DEFUN ("suspicious-object", Fsuspicious_object, Ssuspicious_object, 1, 1, 0, doc: /* Return OBJ, maybe marking it for extra scrutiny. -If Emacs is compiled with suspicous object checking, capture +If Emacs is compiled with suspicious object checking, capture a stack trace when OBJ is freed in order to help track down garbage collection bugs. Otherwise, do nothing and return OBJ. */) (Lisp_Object obj) === modified file 'src/buffer.c' --- src/buffer.c 2014-09-07 07:04:01 +0000 +++ src/buffer.c 2014-09-11 19:44:25 +0000 @@ -5943,7 +5943,7 @@ for instance, with `set-window-buffer' or when `display-buffer' displays it. A value of `bottom' means put the horizontal scroll bar at the bottom of -the window; a value of nil means don't show any horizonal scroll bars. +the window; a value of nil means don't show any horizontal scroll bars. A value of t (the default) means do whatever the window's frame specifies. */); === modified file 'src/frame.c' --- src/frame.c 2014-09-11 00:48:57 +0000 +++ src/frame.c 2014-09-11 19:44:25 +0000 @@ -351,7 +351,7 @@ /* Make sure windows sizes of frame F are OK. new_width and new_height are in pixels. A value of -1 means no change is requested for that - size (but the frame may still have to be resized to accomodate + size (but the frame may still have to be resized to accommodate windows with their minimum sizes. The argument INHIBIT can assume the following values: === modified file 'src/frame.h' --- src/frame.h 2014-09-11 00:48:57 +0000 +++ src/frame.h 2014-09-11 19:44:25 +0000 @@ -1288,7 +1288,7 @@ / FRAME_LINE_HEIGHT (f)) /* Return the pixel width/height of frame F with a text size of - width/heigh. */ + width/height. */ #define FRAME_TEXT_TO_PIXEL_WIDTH(f, width) \ ((width) \ + FRAME_SCROLL_BAR_AREA_WIDTH (f) \ === modified file 'test/automated/subr-x-tests.el' --- test/automated/subr-x-tests.el 2014-06-30 19:58:56 +0000 +++ test/automated/subr-x-tests.el 2014-09-11 19:44:25 +0000 @@ -165,7 +165,7 @@ (list 1 2 3)))) (ert-deftest subr-x-test-if-let-false () - "Test `if-let' with falsey bindings." + "Test `if-let' with falsie bindings." (should (equal (if-let (a nil) (list a b c) @@ -205,8 +205,8 @@ "no") (list 1 2 3)))) -(ert-deftest subr-x-test-if-let-and-lazyness-is-preserved () - "Test `if-let' respects `and' lazyness." +(ert-deftest subr-x-test-if-let-and-laziness-is-preserved () + "Test `if-let' respects `and' laziness." (let (a-called b-called c-called) (should (equal (if-let ((a nil) @@ -360,7 +360,7 @@ (list 1 2 3)))) (ert-deftest subr-x-test-when-let-false () - "Test `when-let' with falsey bindings." + "Test `when-let' with falsie bindings." (should (equal (when-let (a nil) (list a b c) @@ -399,8 +399,8 @@ (list a b c)) (list 1 2 3)))) -(ert-deftest subr-x-test-when-let-and-lazyness-is-preserved () - "Test `when-let' respects `and' lazyness." +(ert-deftest subr-x-test-when-let-and-laziness-is-preserved () + "Test `when-let' respects `and' laziness." (let (a-called b-called c-called) (should (equal (progn === modified file 'test/automated/tildify-tests.el' --- test/automated/tildify-tests.el 2014-06-05 14:42:45 +0000 +++ test/automated/tildify-tests.el 2014-09-11 19:44:25 +0000 @@ -1,4 +1,4 @@ -;;; tildify-test.el --- ERT tests for teldify.el +;;; tildify-test.el --- ERT tests for tildify.el ;; Copyright (C) 2014 Free Software Foundation, Inc. ------------------------------------------------------------ revno: 117866 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-09-11 17:21:19 +0400 message: Remove redundant GCPROs around Ffuncall and Fapply calls. This is safe because Ffuncall protects all of its arguments by itself. * charset.c (map_charset_for_dump): Remove redundant GCPRO. * eval.c (Fapply, apply1, call0, call1, call2, call3, call4, call5) (call6, call7): Likewise. Use compound literals where applicable. (run_hook_with_args_2): Use compound literal. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-11 13:02:09 +0000 +++ src/ChangeLog 2014-09-11 13:21:19 +0000 @@ -11,6 +11,13 @@ * lread.c (readevalloop_eager_expand_eval): Add GCPRO and fix bootstrap broken if GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE. + Remove redundant GCPROs around Ffuncall and Fapply calls. This + is safe because Ffuncall protects all of its arguments by itself. + * charset.c (map_charset_for_dump): Remove redundant GCPRO. + * eval.c (Fapply, apply1, call0, call1, call2, call3, call4, call5) + (call6, call7): Likewise. Use compound literals where applicable. + (run_hook_with_args_2): Use compound literal. + 2014-09-11 Paul Eggert Pacify --enable-gcc-warnings when no window system is used. === modified file 'src/charset.c' --- src/charset.c 2014-09-11 00:29:54 +0000 +++ src/charset.c 2014-09-11 13:21:19 +0000 @@ -667,12 +667,8 @@ { int from_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, from); int to_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, to); - Lisp_Object range; + Lisp_Object range = Fcons (Qnil, Qnil); int c, stop; - struct gcpro gcpro1; - - range = Fcons (Qnil, Qnil); - GCPRO1 (range); c = temp_charset_work->min_char; stop = (temp_charset_work->max_char < 0x20000 @@ -715,7 +711,6 @@ } c++; } - UNGCPRO; } void === modified file 'src/eval.c' --- src/eval.c 2014-09-07 07:04:01 +0000 +++ src/eval.c 2014-09-11 13:21:19 +0000 @@ -2274,12 +2274,10 @@ usage: (apply FUNCTION &rest ARGUMENTS) */) (ptrdiff_t nargs, Lisp_Object *args) { - ptrdiff_t i; - EMACS_INT numargs; + ptrdiff_t i, numargs, funcall_nargs; register Lisp_Object spread_arg; register Lisp_Object *funcall_args; Lisp_Object fun, retval; - struct gcpro gcpro1; USE_SAFE_ALLOCA; fun = args [0]; @@ -2320,10 +2318,9 @@ /* Avoid making funcall cons up a yet another new vector of arguments by explicitly supplying nil's for optional values. */ SAFE_ALLOCA_LISP (funcall_args, 1 + XSUBR (fun)->max_args); - for (i = numargs; i < XSUBR (fun)->max_args;) + for (i = numargs; i < XSUBR (fun)->max_args; /* nothing */) funcall_args[++i] = Qnil; - GCPRO1 (*funcall_args); - gcpro1.nvars = 1 + XSUBR (fun)->max_args; + funcall_nargs = 1 + XSUBR (fun)->max_args; } } funcall: @@ -2332,8 +2329,7 @@ if (!funcall_args) { SAFE_ALLOCA_LISP (funcall_args, 1 + numargs); - GCPRO1 (*funcall_args); - gcpro1.nvars = 1 + numargs; + funcall_nargs = 1 + numargs; } memcpy (funcall_args, args, nargs * word_size); @@ -2346,11 +2342,10 @@ spread_arg = XCDR (spread_arg); } - /* By convention, the caller needs to gcpro Ffuncall's args. */ - retval = Ffuncall (gcpro1.nvars, funcall_args); - UNGCPRO; + /* Ffuncall gcpro's all of its args. */ + retval = Ffuncall (funcall_nargs, funcall_args); + SAFE_FREE (); - return retval; } @@ -2558,41 +2553,22 @@ void run_hook_with_args_2 (Lisp_Object hook, Lisp_Object arg1, Lisp_Object arg2) { - Lisp_Object temp[3]; - temp[0] = hook; - temp[1] = arg1; - temp[2] = arg2; + Frun_hook_with_args (3, ((Lisp_Object []) { hook, arg1, arg2 })); +} - Frun_hook_with_args (3, temp); -} - /* Apply fn to arg. */ Lisp_Object apply1 (Lisp_Object fn, Lisp_Object arg) { - struct gcpro gcpro1; - - GCPRO1 (fn); - if (NILP (arg)) - RETURN_UNGCPRO (Ffuncall (1, &fn)); - gcpro1.nvars = 2; - { - Lisp_Object args[2]; - args[0] = fn; - args[1] = arg; - gcpro1.var = args; - RETURN_UNGCPRO (Fapply (2, args)); - } + return (NILP (arg) ? Ffuncall (1, &fn) + : Fapply (2, ((Lisp_Object []) { fn, arg }))); } /* Call function fn on no arguments. */ Lisp_Object call0 (Lisp_Object fn) { - struct gcpro gcpro1; - - GCPRO1 (fn); - RETURN_UNGCPRO (Ffuncall (1, &fn)); + return Ffuncall (1, &fn); } /* Call function fn with 1 argument arg1. */ @@ -2600,14 +2576,7 @@ Lisp_Object call1 (Lisp_Object fn, Lisp_Object arg1) { - struct gcpro gcpro1; - Lisp_Object args[2]; - - args[0] = fn; - args[1] = arg1; - GCPRO1 (args[0]); - gcpro1.nvars = 2; - RETURN_UNGCPRO (Ffuncall (2, args)); + return Ffuncall (2, ((Lisp_Object []) { fn, arg1 })); } /* Call function fn with 2 arguments arg1, arg2. */ @@ -2615,14 +2584,7 @@ Lisp_Object call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) { - struct gcpro gcpro1; - Lisp_Object args[3]; - args[0] = fn; - args[1] = arg1; - args[2] = arg2; - GCPRO1 (args[0]); - gcpro1.nvars = 3; - RETURN_UNGCPRO (Ffuncall (3, args)); + return Ffuncall (3, ((Lisp_Object []) { fn, arg1, arg2 })); } /* Call function fn with 3 arguments arg1, arg2, arg3. */ @@ -2630,15 +2592,7 @@ Lisp_Object call3 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { - struct gcpro gcpro1; - Lisp_Object args[4]; - args[0] = fn; - args[1] = arg1; - args[2] = arg2; - args[3] = arg3; - GCPRO1 (args[0]); - gcpro1.nvars = 4; - RETURN_UNGCPRO (Ffuncall (4, args)); + return Ffuncall (4, ((Lisp_Object []) { fn, arg1, arg2, arg3 })); } /* Call function fn with 4 arguments arg1, arg2, arg3, arg4. */ @@ -2647,16 +2601,7 @@ call4 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4) { - struct gcpro gcpro1; - Lisp_Object args[5]; - args[0] = fn; - args[1] = arg1; - args[2] = arg2; - args[3] = arg3; - args[4] = arg4; - GCPRO1 (args[0]); - gcpro1.nvars = 5; - RETURN_UNGCPRO (Ffuncall (5, args)); + return Ffuncall (5, ((Lisp_Object []) { fn, arg1, arg2, arg3, arg4 })); } /* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5. */ @@ -2665,17 +2610,7 @@ call5 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5) { - struct gcpro gcpro1; - Lisp_Object args[6]; - args[0] = fn; - args[1] = arg1; - args[2] = arg2; - args[3] = arg3; - args[4] = arg4; - args[5] = arg5; - GCPRO1 (args[0]); - gcpro1.nvars = 6; - RETURN_UNGCPRO (Ffuncall (6, args)); + return Ffuncall (6, ((Lisp_Object []) { fn, arg1, arg2, arg3, arg4, arg5 })); } /* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6. */ @@ -2684,18 +2619,8 @@ call6 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6) { - struct gcpro gcpro1; - Lisp_Object args[7]; - args[0] = fn; - args[1] = arg1; - args[2] = arg2; - args[3] = arg3; - args[4] = arg4; - args[5] = arg5; - args[6] = arg6; - GCPRO1 (args[0]); - gcpro1.nvars = 7; - RETURN_UNGCPRO (Ffuncall (7, args)); + return Ffuncall (7, ((Lisp_Object []) + { fn, arg1, arg2, arg3, arg4, arg5, arg6 })); } /* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7. */ @@ -2704,19 +2629,8 @@ call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6, Lisp_Object arg7) { - struct gcpro gcpro1; - Lisp_Object args[8]; - args[0] = fn; - args[1] = arg1; - args[2] = arg2; - args[3] = arg3; - args[4] = arg4; - args[5] = arg5; - args[6] = arg6; - args[7] = arg7; - GCPRO1 (args[0]); - gcpro1.nvars = 8; - RETURN_UNGCPRO (Ffuncall (8, args)); + return Ffuncall (8, ((Lisp_Object []) + { fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7 })); } /* The caller should GCPRO all the elements of ARGS. */ ------------------------------------------------------------ revno: 117865 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-09-11 17:02:09 +0400 message: * lread.c (readevalloop_eager_expand_eval): Add GCPRO and fix bootstrap broken if GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-11 09:14:45 +0000 +++ src/ChangeLog 2014-09-11 13:02:09 +0000 @@ -8,6 +8,9 @@ (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, GCPRO7): Minor restyle. If DEBUG_GCPRO, initialize extra fields. + * lread.c (readevalloop_eager_expand_eval): Add GCPRO and fix + bootstrap broken if GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE. + 2014-09-11 Paul Eggert Pacify --enable-gcc-warnings when no window system is used. === modified file 'src/lread.c' --- src/lread.c 2014-09-07 07:04:01 +0000 +++ src/lread.c 2014-09-11 13:02:09 +0000 @@ -1782,15 +1782,17 @@ val = call2 (macroexpand, val, Qnil); if (EQ (CAR_SAFE (val), Qprogn)) { + struct gcpro gcpro1; Lisp_Object subforms = XCDR (val); - val = Qnil; - for (; CONSP (subforms); subforms = XCDR (subforms)) + + GCPRO1 (subforms); + for (val = Qnil; CONSP (subforms); subforms = XCDR (subforms)) val = readevalloop_eager_expand_eval (XCAR (subforms), macroexpand); + UNGCPRO; } else val = eval_sub (call2 (macroexpand, val, Qt)); - return val; } ------------------------------------------------------------ revno: 117864 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-09-11 13:14:45 +0400 message: More debugging aids around GCPROs. * lisp.h (struct gcpro) [DEBUG_GCPRO]: Add extra members. (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, GCPRO7): Minor restyle. If DEBUG_GCPRO, initialize extra fields. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-11 06:21:55 +0000 +++ src/ChangeLog 2014-09-11 09:14:45 +0000 @@ -3,6 +3,11 @@ * lisp.h (make_local_string): Nitpick indent. * print.c (Fprin1_to_string): Remove unused GCPROs. + More debugging aids around GCPROs. + * lisp.h (struct gcpro) [DEBUG_GCPRO]: Add extra members. + (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, GCPRO7): + Minor restyle. If DEBUG_GCPRO, initialize extra fields. + 2014-09-11 Paul Eggert Pacify --enable-gcc-warnings when no window system is used. === modified file 'src/lisp.h' --- src/lisp.h 2014-09-11 06:21:55 +0000 +++ src/lisp.h 2014-09-11 09:14:45 +0000 @@ -3016,6 +3016,16 @@ ptrdiff_t nvars; #ifdef DEBUG_GCPRO + /* File name where this record is used. */ + const char *name; + + /* Line number in this file. */ + int lineno; + + /* Index in the local chain of records. */ + int idx; + + /* Nesting level. */ int level; #endif }; @@ -3071,122 +3081,150 @@ #ifndef DEBUG_GCPRO -#define GCPRO1(varname) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ - gcprolist = &gcpro1; } - -#define GCPRO2(varname1, varname2) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcprolist = &gcpro2; } - -#define GCPRO3(varname1, varname2, varname3) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ - gcprolist = &gcpro3; } - -#define GCPRO4(varname1, varname2, varname3, varname4) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ - gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ - gcprolist = &gcpro4; } - -#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ - gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ - gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ - gcprolist = &gcpro5; } - -#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ - gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ - gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ - gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ - gcprolist = &gcpro6; } - -#define GCPRO7(a, b, c, d, e, f, g) \ - {gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ - gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ - gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ - gcpro5.next = &gcpro4; gcpro5.var = &(e); gcpro5.nvars = 1; \ - gcpro6.next = &gcpro5; gcpro6.var = &(f); gcpro6.nvars = 1; \ - gcpro7.next = &gcpro6; gcpro7.var = &(g); gcpro7.nvars = 1; \ - gcprolist = &gcpro7; } +#define GCPRO1(a) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcprolist = &gcpro1; } + +#define GCPRO2(a, b) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcprolist = &gcpro2; } + +#define GCPRO3(a, b, c) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcprolist = &gcpro3; } + +#define GCPRO4(a, b, c, d) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ + gcprolist = &gcpro4; } + +#define GCPRO5(a, b, c, d, e) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &(e); gcpro5.nvars = 1; \ + gcprolist = &gcpro5; } + +#define GCPRO6(a, b, c, d, e, f) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &(e); gcpro5.nvars = 1; \ + gcpro6.next = &gcpro5; gcpro6.var = &(f); gcpro6.nvars = 1; \ + gcprolist = &gcpro6; } + +#define GCPRO7(a, b, c, d, e, f, g) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &(e); gcpro5.nvars = 1; \ + gcpro6.next = &gcpro5; gcpro6.var = &(f); gcpro6.nvars = 1; \ + gcpro7.next = &gcpro6; gcpro7.var = &(g); gcpro7.nvars = 1; \ + gcprolist = &gcpro7; } #define UNGCPRO (gcprolist = gcpro1.next) -#else +#else /* !DEBUG_GCPRO */ extern int gcpro_level; -#define GCPRO1(varname) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ - gcpro1.level = gcpro_level++; \ - gcprolist = &gcpro1; } - -#define GCPRO2(varname1, varname2) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro1.level = gcpro_level; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro2.level = gcpro_level++; \ - gcprolist = &gcpro2; } - -#define GCPRO3(varname1, varname2, varname3) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro1.level = gcpro_level; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ - gcpro3.level = gcpro_level++; \ - gcprolist = &gcpro3; } - -#define GCPRO4(varname1, varname2, varname3, varname4) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro1.level = gcpro_level; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ - gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ - gcpro4.level = gcpro_level++; \ - gcprolist = &gcpro4; } - -#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro1.level = gcpro_level; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ - gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ - gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ - gcpro5.level = gcpro_level++; \ - gcprolist = &gcpro5; } - -#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ - {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ - gcpro1.level = gcpro_level; \ - gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ - gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ - gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ - gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ - gcpro6.level = gcpro_level++; \ - gcprolist = &gcpro6; } +#define GCPRO1(a) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro1.name = __FILE__; gcpro1.lineno = __LINE__; gcpro1.idx = 1; \ + gcpro1.level = gcpro_level++; \ + gcprolist = &gcpro1; } + +#define GCPRO2(a, b) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro1.name = __FILE__; gcpro1.lineno = __LINE__; gcpro1.idx = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro2.name = __FILE__; gcpro2.lineno = __LINE__; gcpro2.idx = 2; \ + gcpro2.level = gcpro_level++; \ + gcprolist = &gcpro2; } + +#define GCPRO3(a, b, c) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro1.name = __FILE__; gcpro1.lineno = __LINE__; gcpro1.idx = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro2.name = __FILE__; gcpro2.lineno = __LINE__; gcpro2.idx = 2; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro3.name = __FILE__; gcpro3.lineno = __LINE__; gcpro3.idx = 3; \ + gcpro3.level = gcpro_level++; \ + gcprolist = &gcpro3; } + +#define GCPRO4(a, b, c, d) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro1.name = __FILE__; gcpro1.lineno = __LINE__; gcpro1.idx = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro2.name = __FILE__; gcpro2.lineno = __LINE__; gcpro2.idx = 2; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro3.name = __FILE__; gcpro3.lineno = __LINE__; gcpro3.idx = 3; \ + gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ + gcpro4.name = __FILE__; gcpro4.lineno = __LINE__; gcpro4.idx = 4; \ + gcpro4.level = gcpro_level++; \ + gcprolist = &gcpro4; } + +#define GCPRO5(a, b, c, d, e) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro1.name = __FILE__; gcpro1.lineno = __LINE__; gcpro1.idx = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro2.name = __FILE__; gcpro2.lineno = __LINE__; gcpro2.idx = 2; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro3.name = __FILE__; gcpro3.lineno = __LINE__; gcpro3.idx = 3; \ + gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ + gcpro4.name = __FILE__; gcpro4.lineno = __LINE__; gcpro4.idx = 4; \ + gcpro5.next = &gcpro4; gcpro5.var = &(e); gcpro5.nvars = 1; \ + gcpro5.name = __FILE__; gcpro5.lineno = __LINE__; gcpro5.idx = 5; \ + gcpro5.level = gcpro_level++; \ + gcprolist = &gcpro5; } + +#define GCPRO6(a, b, c, d, e, f) \ + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro1.name = __FILE__; gcpro1.lineno = __LINE__; gcpro1.idx = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro2.name = __FILE__; gcpro2.lineno = __LINE__; gcpro2.idx = 2; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro3.name = __FILE__; gcpro3.lineno = __LINE__; gcpro3.idx = 3; \ + gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ + gcpro4.name = __FILE__; gcpro4.lineno = __LINE__; gcpro4.idx = 4; \ + gcpro5.next = &gcpro4; gcpro5.var = &(e); gcpro5.nvars = 1; \ + gcpro5.name = __FILE__; gcpro5.lineno = __LINE__; gcpro5.idx = 5; \ + gcpro6.next = &gcpro5; gcpro6.var = &(f); gcpro6.nvars = 1; \ + gcpro6.name = __FILE__; gcpro6.lineno = __LINE__; gcpro6.idx = 6; \ + gcpro6.level = gcpro_level++; \ + gcprolist = &gcpro6; } #define GCPRO7(a, b, c, d, e, f, g) \ - {gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ - gcpro1.level = gcpro_level; \ - gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ - gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ - gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ - gcpro5.next = &gcpro4; gcpro5.var = &(e); gcpro5.nvars = 1; \ - gcpro6.next = &gcpro5; gcpro6.var = &(f); gcpro6.nvars = 1; \ - gcpro7.next = &gcpro6; gcpro7.var = &(g); gcpro7.nvars = 1; \ - gcpro7.level = gcpro_level++; \ - gcprolist = &gcpro7; } + { gcpro1.next = gcprolist; gcpro1.var = &(a); gcpro1.nvars = 1; \ + gcpro1.name = __FILE__; gcpro1.lineno = __LINE__; gcpro1.idx = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &(b); gcpro2.nvars = 1; \ + gcpro2.name = __FILE__; gcpro2.lineno = __LINE__; gcpro2.idx = 2; \ + gcpro3.next = &gcpro2; gcpro3.var = &(c); gcpro3.nvars = 1; \ + gcpro3.name = __FILE__; gcpro3.lineno = __LINE__; gcpro3.idx = 3; \ + gcpro4.next = &gcpro3; gcpro4.var = &(d); gcpro4.nvars = 1; \ + gcpro4.name = __FILE__; gcpro4.lineno = __LINE__; gcpro4.idx = 4; \ + gcpro5.next = &gcpro4; gcpro5.var = &(e); gcpro5.nvars = 1; \ + gcpro5.name = __FILE__; gcpro5.lineno = __LINE__; gcpro5.idx = 5; \ + gcpro6.next = &gcpro5; gcpro6.var = &(f); gcpro6.nvars = 1; \ + gcpro6.name = __FILE__; gcpro6.lineno = __LINE__; gcpro6.idx = 6; \ + gcpro7.next = &gcpro6; gcpro7.var = &(g); gcpro7.nvars = 1; \ + gcpro7.name = __FILE__; gcpro7.lineno = __LINE__; gcpro7.idx = 7; \ + gcpro7.level = gcpro_level++; \ + gcprolist = &gcpro7; } #define UNGCPRO \ (--gcpro_level != gcpro1.level \ ------------------------------------------------------------ revno: 117863 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-09-11 10:21:55 +0400 message: * lisp.h (make_local_string): Nitpick indent. * print.c (Fprin1_to_string): Remove unused GCPROs. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-11 00:48:57 +0000 +++ src/ChangeLog 2014-09-11 06:21:55 +0000 @@ -1,3 +1,8 @@ +2014-09-11 Dmitry Antipov + + * lisp.h (make_local_string): Nitpick indent. + * print.c (Fprin1_to_string): Remove unused GCPROs. + 2014-09-11 Paul Eggert Pacify --enable-gcc-warnings when no window system is used. === modified file 'src/lisp.h' --- src/lisp.h 2014-09-10 20:56:05 +0000 +++ src/lisp.h 2014-09-11 06:21:55 +0000 @@ -4594,8 +4594,8 @@ Lisp_Object string_; \ if (nbytes_ <= MAX_ALLOCA - sizeof (struct Lisp_String) - 1) \ { \ - struct Lisp_String *ptr_ = alloca (sizeof (struct Lisp_String) + 1 \ - + nbytes_); \ + struct Lisp_String *ptr_ \ + = alloca (sizeof (struct Lisp_String) + 1 + nbytes_); \ string_ = local_string_init (ptr_, data_, nbytes_); \ } \ else \ === modified file 'src/print.c' --- src/print.c 2014-09-07 07:04:01 +0000 +++ src/print.c 2014-09-11 06:21:55 +0000 @@ -583,7 +583,6 @@ { Lisp_Object printcharfun; bool prev_abort_on_gc; - /* struct gcpro gcpro1, gcpro2; */ Lisp_Object save_deactivate_mark; ptrdiff_t count = SPECPDL_INDEX (); struct buffer *previous; @@ -597,7 +596,6 @@ but we don't want to deactivate the mark just for that. No need for specbind, since errors deactivate the mark. */ save_deactivate_mark = Vdeactivate_mark; - /* GCPRO2 (object, save_deactivate_mark); */ prev_abort_on_gc = abort_on_gc; abort_on_gc = 1; @@ -621,7 +619,6 @@ set_buffer_internal (previous); Vdeactivate_mark = save_deactivate_mark; - /* UNGCPRO; */ abort_on_gc = prev_abort_on_gc; return unbind_to (count, object);