------------------------------------------------------------ revno: 117955 author: Ken Brown committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2014-09-26 10:06:35 +0300 message: src/w32term.h (ALIGN_STACK): Fix the cpp condition. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-25 17:49:02 +0000 +++ src/ChangeLog 2014-09-26 07:06:35 +0000 @@ -1,3 +1,7 @@ +2014-09-26 Ken Brown + + * w32term.h (ALIGN_STACK): Fix the cpp condition. + 2014-09-25 Eli Zaretskii * lisp.h (USE_STACK_LISP_OBJECTS): Default to false for 32-bit === modified file 'src/w32term.h' --- src/w32term.h 2014-09-25 17:28:48 +0000 +++ src/w32term.h 2014-09-26 07:06:35 +0000 @@ -30,7 +30,7 @@ re-align the stack at function entry. Further details about this can be found in http://www.peterstock.co.uk/games/mingw_sse/. */ #ifdef __GNUC__ -# if defined USE_STACK_LISP_OBJECTS && !defined _W64 \ +# if USE_STACK_LISP_OBJECTS && !defined _W64 && !defined __x86_64__ \ && __GNUC__ + (__GNUC_MINOR__ > 1) >= 5 # define ALIGN_STACK __attribute__((force_align_arg_pointer)) # else ------------------------------------------------------------ revno: 117954 committer: Leo Liu branch nick: trunk timestamp: Fri 2014-09-26 10:01:17 +0800 message: * emacs-lisp/cl-extra.el (cl-parse-integer): Fix last change. diff: === modified file 'lisp/emacs-lisp/cl-extra.el' --- lisp/emacs-lisp/cl-extra.el 2014-09-26 00:15:21 +0000 +++ lisp/emacs-lisp/cl-extra.el 2014-09-26 02:01:17 +0000 @@ -415,7 +415,8 @@ (skip-whitespace) (cond ((and junk-allowed (null sum)) sum) (junk-allowed (* sign sum)) - ((/= start end) (error "Not an integer string: %s" string)) + ((or (/= start end) (null sum)) + (error "Not an integer string: `%s'" string)) (t (* sign sum))))))) ------------------------------------------------------------ revno: 117953 fixes bug: http://debbugs.gnu.org/18557 committer: Leo Liu branch nick: trunk timestamp: Fri 2014-09-26 08:15:21 +0800 message: Add cl-parse-integer based on parse-integer * doc/misc/cl.texi (Predicates on Numbers): Document cl-digit-char-p. (Numerical Functions): Document cl-parse-integer. * lisp/calendar/parse-time.el (parse-time-digits): Remove. (digit-char-p, parse-integer) Moved to cl-lib.el. (parse-time-tokenize, parse-time-rules, parse-time-string): Use cl-parse-integer. * lisp/emacs-lisp/cl-extra.el (cl-parse-integer): New function. * lisp/emacs-lisp/cl-lib.el (cl-digit-char-table): New var. (cl-digit-char-p): New function. * test/automated/cl-lib.el (cl-digit-char-p, cl-parse-integer): New tests. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-09-24 17:33:54 +0000 +++ doc/misc/ChangeLog 2014-09-26 00:15:21 +0000 @@ -1,3 +1,8 @@ +2014-09-26 Leo Liu + + * cl.texi (Predicates on Numbers): Document cl-digit-char-p. + (Numerical Functions): Document cl-parse-integer. (Bug#18557) + 2014-09-24 Ulf Jasper * newsticker.texi: Reworked. Document new treeview group === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2014-06-10 02:20:31 +0000 +++ doc/misc/cl.texi 2014-09-26 00:15:21 +0000 @@ -2929,6 +2929,12 @@ error if the argument is not an integer. @end defun +@defun cl-digit-char-p char radix +Test if @var{char} is a digit in the specified @var{radix} (default is +10). If true return the decimal value of digit @var{char} in +@var{radix}. +@end defun + @node Numerical Functions @section Numerical Functions @@ -3011,6 +3017,15 @@ of @code{cl-truncate}. @end defun +@defun cl-parse-integer string &key start end radix junk-allowed +This function implements the Common Lisp @code{parse-integer} +function. It parses an integer in the specified @var{radix} from the +substring of @var{string} between @var{start} and @var{end}. Any +leading and trailing whitespace chars are ignored. It signals an error +if the substring between @var{start} and @var{end} cannot be parsed as +an integer unless @var{junk-allowed} is non-nil. +@end defun + @node Random Numbers @section Random Numbers === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-25 20:55:58 +0000 +++ lisp/ChangeLog 2014-09-26 00:15:21 +0000 @@ -1,3 +1,16 @@ +2014-09-26 Leo Liu + + Add cl-parse-integer based on parse-integer (Bug#18557) + * calendar/parse-time.el (parse-time-digits): Remove. + (digit-char-p, parse-integer) Moved to cl-lib.el. + (parse-time-tokenize, parse-time-rules, parse-time-string): Use + cl-parse-integer. + + * emacs-lisp/cl-extra.el (cl-parse-integer): New function. + + * emacs-lisp/cl-lib.el (cl-digit-char-table): New var. + (cl-digit-char-p): New function. + 2014-09-25 Juri Linkov * vc/add-log.el (change-log-next-buffer): Don't create an empty === modified file 'lisp/calendar/parse-time.el' --- lisp/calendar/parse-time.el 2014-08-03 15:38:52 +0000 +++ lisp/calendar/parse-time.el 2014-09-26 00:15:21 +0000 @@ -34,21 +34,12 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) - -(defvar parse-time-digits (make-vector 256 nil)) +(require 'cl-lib) ;; Byte-compiler warnings (defvar parse-time-elt) (defvar parse-time-val) -(unless (aref parse-time-digits ?0) - (cl-loop for i from ?0 to ?9 - do (aset parse-time-digits i (- i ?0)))) - -(defsubst digit-char-p (char) - (aref parse-time-digits char)) - (defsubst parse-time-string-chars (char) (save-match-data (let (case-fold-search str) @@ -59,30 +50,6 @@ ((string-match "[[:lower:]]" str) ?a) ((string-match "[[:digit:]]" str) ?0))))) -(put 'parse-error 'error-conditions '(parse-error error)) -(put 'parse-error 'error-message "Parsing error") - -(defsubst parse-integer (string &optional start end) - "[CL] Parse and return the integer in STRING, or nil if none." - (let ((integer 0) - (digit 0) - (index (or start 0)) - (end (or end (length string)))) - (when (< index end) - (let ((sign (aref string index))) - (if (or (eq sign ?+) (eq sign ?-)) - (setq sign (parse-time-string-chars sign) - index (1+ index)) - (setq sign 1)) - (while (and (< index end) - (setq digit (digit-char-p (aref string index)))) - (setq integer (+ (* integer 10) digit) - index (1+ index))) - (if (/= index end) - (signal 'parse-error `("not an integer" - ,(substring string (or start 0) end))) - (* sign integer)))))) - (defun parse-time-tokenize (string) "Tokenize STRING into substrings." (let ((start nil) @@ -100,7 +67,7 @@ (setq c (parse-time-string-chars (aref string index)))) (setq all-digits (and all-digits (eq c ?0)))) (if (<= index end) - (push (if all-digits (parse-integer string start index) + (push (if all-digits (cl-parse-integer string :start start :end index) (substring string start index)) list))) (nreverse list))) @@ -147,8 +114,8 @@ (= 5 (length parse-time-elt)) (or (= (aref parse-time-elt 0) ?+) (= (aref parse-time-elt 0) ?-)))) - ,#'(lambda () (* 60 (+ (parse-integer parse-time-elt 3 5) - (* 60 (parse-integer parse-time-elt 1 3))) + ,#'(lambda () (* 60 (+ (cl-parse-integer parse-time-elt :start 3 :end 5) + (* 60 (cl-parse-integer parse-time-elt :start 1 :end 3))) (if (= (aref parse-time-elt 0) ?-) -1 1)))) ((5 4 3) ,#'(lambda () (and (stringp parse-time-elt) @@ -210,9 +177,10 @@ (let ((new-val (if rule (let ((this (pop rule))) (if (vectorp this) - (parse-integer + (cl-parse-integer parse-time-elt - (aref this 0) (aref this 1)) + :start (aref this 0) + :end (aref this 1)) (funcall this))) parse-time-val))) (rplaca (nthcdr (pop slots) time) new-val)))))))) === modified file 'lisp/emacs-lisp/cl-extra.el' --- lisp/emacs-lisp/cl-extra.el 2014-03-20 18:16:47 +0000 +++ lisp/emacs-lisp/cl-extra.el 2014-09-26 00:15:21 +0000 @@ -383,6 +383,41 @@ "Return 1 if X is positive, -1 if negative, 0 if zero." (cond ((> x 0) 1) ((< x 0) -1) (t 0))) +;;;###autoload +(cl-defun cl-parse-integer (string &key start end radix junk-allowed) + "Parse integer from the substring of STRING from START to END. +STRING may be surrounded by whitespace chars (chars with syntax ` '). +Other non-digit chars are considered junk. +RADIX is an integer between 2 and 36, the default is 10. Signal +an error if the substring between START and END cannot be parsed +as an integer unless JUNK-ALLOWED is non-nil." + (cl-check-type string string) + (let* ((start (or start 0)) + (len (length string)) + (end (or end len)) + (radix (or radix 10))) + (or (<= start end len) + (error "Bad interval: [%d, %d)" start end)) + (cl-flet ((skip-whitespace () + (while (and (< start end) + (= 32 (char-syntax (aref string start)))) + (setq start (1+ start))))) + (skip-whitespace) + (let ((sign (cl-case (and (< start end) (aref string start)) + (?+ (cl-incf start) +1) + (?- (cl-incf start) -1) + (t +1))) + digit sum) + (while (and (< start end) + (setq digit (cl-digit-char-p (aref string start) radix))) + (setq sum (+ (* (or sum 0) radix) digit) + start (1+ start))) + (skip-whitespace) + (cond ((and junk-allowed (null sum)) sum) + (junk-allowed (* sign sum)) + ((/= start end) (error "Not an integer string: %s" string)) + (t (* sign sum))))))) + ;; Random numbers. === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2014-05-21 00:41:21 +0000 +++ lisp/emacs-lisp/cl-lib.el 2014-09-26 00:15:21 +0000 @@ -279,6 +279,25 @@ "Return t if INTEGER is even." (eq (logand integer 1) 0)) +(defconst cl-digit-char-table + (let* ((digits (make-vector 256 nil)) + (populate (lambda (start end base) + (mapc (lambda (i) + (aset digits i (+ base (- i start)))) + (number-sequence start end))))) + (funcall populate ?0 ?9 0) + (funcall populate ?A ?Z 10) + (funcall populate ?a ?z 10) + digits)) + +(defun cl-digit-char-p (char &optional radix) + "Test if CHAR is a digit in the specified RADIX (default 10). +If true return the decimal value of digit CHAR in RADIX." + (or (<= 2 (or radix 10) 36) + (signal 'args-out-of-range (list 'radix radix '(2 36)))) + (let ((n (aref cl-digit-char-table char))) + (and n (< n (or radix 10)) n))) + (defvar cl--random-state (vector 'cl--random-state-tag -1 30 (cl--random-time))) === modified file 'test/ChangeLog' --- test/ChangeLog 2014-09-24 17:33:54 +0000 +++ test/ChangeLog 2014-09-26 00:15:21 +0000 @@ -1,3 +1,8 @@ +2014-09-26 Leo Liu + + * automated/cl-lib.el (cl-digit-char-p, cl-parse-integer): New + tests. (Bug#18557) + 2014-09-24 Ulf Jasper * automated/newsticker-tests.el === modified file 'test/automated/cl-lib.el' --- test/automated/cl-lib.el 2014-04-22 21:32:51 +0000 +++ test/automated/cl-lib.el 2014-09-26 00:15:21 +0000 @@ -223,6 +223,25 @@ (should (= (cl-the integer (cl-incf side-effect)) 1)) (should (= side-effect 1)))) +(ert-deftest cl-digit-char-p () + (should (cl-digit-char-p ?3)) + (should (cl-digit-char-p ?a 11)) + (should-not (cl-digit-char-p ?a)) + (should (cl-digit-char-p ?w 36)) + (should-error (cl-digit-char-p ?a 37)) + (should-error (cl-digit-char-p ?a 1))) + +(ert-deftest cl-parse-integer () + (should-error (cl-parse-integer "abc")) + (should (null (cl-parse-integer "abc" :junk-allowed t))) + (should (null (cl-parse-integer "" :junk-allowed t))) + (should (= 342391 (cl-parse-integer "0123456789" :radix 8 :junk-allowed t))) + (should-error (cl-parse-integer "0123456789" :radix 8)) + (should (= -239 (cl-parse-integer "-efz" :radix 16 :junk-allowed t))) + (should-error (cl-parse-integer "efz" :radix 16)) + (should (= 239 (cl-parse-integer "zzef" :radix 16 :start 2))) + (should (= -123 (cl-parse-integer " -123 ")))) + (ert-deftest cl-loop-destructuring-with () (should (equal (cl-loop with (a b c) = '(1 2 3) return (+ a b c)) 6))) ------------------------------------------------------------ revno: 117952 fixes bug: http://debbugs.gnu.org/18547 committer: Juri Linkov branch nick: trunk timestamp: Thu 2014-09-25 23:55:58 +0300 message: * lisp/vc/add-log.el (change-log-next-buffer): Don't create an empty buffer "ChangeLog" when the current buffer doesn't match ChangeLog.[0-9]. Return the current buffer if no files match the default pattern ChangeLog.[0-9]. Signal "end of multi" when file is nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-25 13:07:28 +0000 +++ lisp/ChangeLog 2014-09-25 20:55:58 +0000 @@ -1,3 +1,10 @@ +2014-09-25 Juri Linkov + + * vc/add-log.el (change-log-next-buffer): Don't create an empty + buffer "ChangeLog" when the current buffer doesn't match ChangeLog.[0-9]. + Return the current buffer if no files match the default pattern + ChangeLog.[0-9]. Signal "end of multi" when file is nil. (Bug#18547) + 2014-09-25 Stefan Monnier * net/tramp-sh.el (tramp-sh-handle-vc-registered): Don't modify === modified file 'lisp/vc/add-log.el' --- lisp/vc/add-log.el 2014-02-10 01:34:22 +0000 +++ lisp/vc/add-log.el 2014-09-25 20:55:58 +0000 @@ -1097,12 +1097,17 @@ (ignore-errors (version< (substring b (length name)) (substring a (length name)))))))) - (files (if isearch-forward files (reverse files)))) - (find-file-noselect - (if wrap - (car files) - (cadr (member (file-name-nondirectory (buffer-file-name buffer)) - files)))))) + (files (if isearch-forward files (reverse files))) + (file (if wrap + (car files) + (cadr (member (file-name-nondirectory (buffer-file-name buffer)) + files))))) + ;; If there are no files that match the default pattern ChangeLog.[0-9], + ;; return the current buffer to force isearch wrapping to its beginning. + ;; If file is nil, multi-isearch-search-fun will signal "end of multi". + (if (file-exists-p file) + (find-file-noselect file) + (current-buffer)))) (defun change-log-fill-forward-paragraph (n) "Cut paragraphs so filling preserves open parentheses at beginning of lines." ------------------------------------------------------------ revno: 117951 fixes bug: http://debbugs.gnu.org/18559 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-09-25 20:49:02 +0300 message: Don't use USE_STACK_LISP_OBJECTS on Windows with GCC older than 4.2. src/lisp.h (USE_STACK_LISP_OBJECTS): Default to false for 32-bit MinGW builds that use GCC before 4.2. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-25 09:34:53 +0000 +++ src/ChangeLog 2014-09-25 17:49:02 +0000 @@ -1,5 +1,8 @@ 2014-09-25 Eli Zaretskii + * lisp.h (USE_STACK_LISP_OBJECTS): Default to false for 32-bit + MinGW builds that use GCC before 4.2. + Default to stack objects on DOS_NT platforms as well. * w32term.h (ALIGN_STACK) [__GNUC__]: Define to __attribute__((force_align_arg_pointer)) for GCC 4.2 and later. === modified file 'src/lisp.h' --- src/lisp.h 2014-09-25 10:24:57 +0000 +++ src/lisp.h 2014-09-25 17:49:02 +0000 @@ -286,7 +286,13 @@ http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00506.html. */ #ifndef USE_STACK_LISP_OBJECTS # if defined __GNUC__ && !defined __clang__ -# define USE_STACK_LISP_OBJECTS true + /* 32-bit MinGW builds need at least GCC 4.2 to support this. */ +# if defined __MINGW32__ && !defined _W64 \ + && __GNUC__ + (__GNUC_MINOR__ > 1) < 5 +# define USE_STACK_LISP_OBJECTS false +# else /* !(__MINGW32__ && __GNUC__ < 4.2) */ +# define USE_STACK_LISP_OBJECTS true +# endif # else # define USE_STACK_LISP_OBJECTS false # endif ------------------------------------------------------------ revno: 117950 fixes bug: http://debbugs.gnu.org/18559 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-09-25 20:28:48 +0300 message: src/w32term.h (ALIGN_STACK): Fix a typo in last commit. diff: === modified file 'src/w32term.h' --- src/w32term.h 2014-09-25 09:34:53 +0000 +++ src/w32term.h 2014-09-25 17:28:48 +0000 @@ -30,7 +30,7 @@ re-align the stack at function entry. Further details about this can be found in http://www.peterstock.co.uk/games/mingw_sse/. */ #ifdef __GNUC__ -# if defined USE_STACK_LISP_OBJECTS && defined _W64 \ +# if defined USE_STACK_LISP_OBJECTS && !defined _W64 \ && __GNUC__ + (__GNUC_MINOR__ > 1) >= 5 # define ALIGN_STACK __attribute__((force_align_arg_pointer)) # else ------------------------------------------------------------ revno: 117949 committer: Kelvin White branch nick: trunk timestamp: Thu 2014-09-25 10:07:30 -0400 message: Follow Emacs versioning diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2014-08-13 13:14:43 +0000 +++ lisp/erc/ChangeLog 2014-09-25 14:07:30 +0000 @@ -1,3 +1,13 @@ +2014-09-25 Kelvin White + + * erc.el: Follow Emacs version instead of tracking it seperately. + (erc-quit/part-reason-default) : Clean up quit/part message + functions by abstracting repetitive code, change version string. + (erc-quit-reason-various, erc-quit-reason-normal, erc-quit-reason-zippy) + (erc-part-reason-normal, erc-part-reason-zippy, erc-part-reason-various) + (erc-cmd-SV, erc-ctcp-query-VERSION, erc-version, erc-version-string): + Change version string. + 2014-08-13 Kelvin White * erc.el (erc-send-input): Disable display commands in current buffer === modified file 'lisp/erc/erc.el' --- lisp/erc/erc.el 2014-08-13 13:14:43 +0000 +++ lisp/erc/erc.el 2014-09-25 14:07:30 +0000 @@ -12,7 +12,7 @@ ;; Kelvin White (kwhite@gnu.org) ;; Maintainer: emacs-devel@gnu.org ;; Keywords: IRC, chat, client, Internet -;; Version: 5.3 + ;; This file is part of GNU Emacs. @@ -63,11 +63,11 @@ ;;; History: ;; +(defconst erc-version-string (format "\C-bERC\C-b (IRC client for Emacs %s)" emacs-version) + "ERC version. This is used by function `erc-version'.") + ;;; Code: -(defconst erc-version-string "Version 5.3" - "ERC version. This is used by function `erc-version'.") - (eval-when-compile (require 'cl-lib)) (require 'font-lock) (require 'pp) @@ -3380,14 +3380,16 @@ (signal 'wrong-number-of-arguments "")))) (defalias 'erc-cmd-Q 'erc-cmd-QUERY) +(defun erc-quit/part-reason-default () + "Default quit/part message." + (format "\C-bERC\C-b (IRC client for Emacs %s)" emacs-version)) + + (defun erc-quit-reason-normal (&optional s) "Normal quit message. If S is non-nil, it will be used as the quit reason." - (or s - (format "\C-bERC\C-b %s (IRC client for Emacs)"; - \C-b%s\C-b" - erc-version-string) ; erc-official-location) - )) + (or s (erc-quit/part-reason-default))) (defun erc-quit-reason-zippy (&optional s) "Zippy quit message. @@ -3396,7 +3398,7 @@ (or s (if (fboundp 'yow) (erc-replace-regexp-in-string "\n" "" (yow)) - (erc-quit-reason-normal)))) + (erc-quit/part-reason-default)))) (make-obsolete 'erc-quit-reason-zippy "it will be removed." "24.4") @@ -3409,16 +3411,13 @@ ((functionp res) (funcall res)) ((stringp res) res) (s s) - (t (erc-quit-reason-normal))))) + (t (erc-quit/part-reason-default))))) (defun erc-part-reason-normal (&optional s) "Normal part message. -If S is non-nil, it will be used as the quit reason." - (or s - (format "\C-bERC\C-b %s (IRC client for Emacs)"; - \C-b%s\C-b" - erc-version-string) ; erc-official-location) - )) +If S is non-nil, it will be used as the part reason." + (or s (erc-quit/part-reason-default))) (defun erc-part-reason-zippy (&optional s) "Zippy part message. @@ -3427,7 +3426,7 @@ (or s (if (fboundp 'yow) (erc-replace-regexp-in-string "\n" "" (yow)) - (erc-part-reason-normal)))) + (erc-quit/part-reason-default)))) (make-obsolete 'erc-part-reason-zippy "it will be removed." "24.4") @@ -3440,7 +3439,7 @@ ((functionp res) (funcall res)) ((stringp res) res) (s s) - (t (erc-part-reason-normal))))) + (t (erc-quit/part-reason-default))))) (defun erc-cmd-QUIT (reason) "Disconnect from the current server. @@ -3534,8 +3533,7 @@ (defun erc-cmd-SV () "Say the current ERC and Emacs version into channel." - (erc-send-message (format "I'm using ERC %s with %s %s (%s%s) of %s." - erc-version-string + (erc-send-message (format "I'm using ERC with %s %s (%s%s) of %s." (if (featurep 'xemacs) "XEmacs" "GNU Emacs") emacs-version system-configuration @@ -4594,8 +4592,8 @@ (unless erc-disable-ctcp-replies (erc-send-ctcp-notice nick (format - "VERSION \C-bERC\C-b %s - an IRC client for emacs (\C-b%s\C-b)" - erc-version-string + "VERSION \C-bERC\C-b - an IRC client for Emacs %s (\C-b%s\C-b)" + emacs-version erc-official-location))) nil) @@ -6373,7 +6371,7 @@ If optional argument HERE is non-nil, insert version number at point." (interactive "P") (let ((version-string - (format "ERC %s (GNU Emacs %s)" erc-version-string emacs-version))) + (format "ERC (IRC client for Emacs %s)" emacs-version))) (if here (insert version-string) (if (called-interactively-p 'interactive) ------------------------------------------------------------ revno: 117948 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18535 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2014-09-25 09:07:28 -0400 message: * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered): Don't modify the global vc-handled-backends. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-24 19:23:13 +0000 +++ lisp/ChangeLog 2014-09-25 13:07:28 +0000 @@ -1,3 +1,8 @@ +2014-09-25 Stefan Monnier + + * net/tramp-sh.el (tramp-sh-handle-vc-registered): Don't modify + the global vc-handled-backends (bug#18535). + 2014-09-24 Stefan Monnier * find-cmd.el (find-cmd): Use grep's `find-program' (bug#18518). @@ -6,29 +11,22 @@ 2014-09-24 Ulf Jasper * net/newst-treeview.el (newsticker--treeview-do-get-node-by-id): - Renamed `newsticker--treeview-do-get-node' to - `newsticker--treeview-do-get-node-by-id'. - (newsticker--treeview-get-node-by-id): Renamed - `newsticker--treeview-get-node' to - `newsticker--treeview-get-node-by-id'. - (newsticker--treeview-get-current-node): Renamed ` - `newsticker--treeview-get-node' to - `newsticker--treeview-get-node-by-id'. + Rename from `newsticker--treeview-do-get-node'. + (newsticker--treeview-get-node-by-id): + Rename from `newsticker--treeview-get-node'. (newsticker--treeview-buffer-init) (newsticker--treeview-buffer-init): Disable buffer undo. - (newsticker--treeview-unfold-node): Adapted to modified + (newsticker--treeview-unfold-node): Adapt to modified `newsticker--group-find-parent-group'. - (newsticker--group-do-find-group): Renamed - `newsticker--group-do-find-group-for-feed' to - `newsticker--group-do-find-group'. Now works for both, groups and - feeds. - (newsticker--group-find-parent-group): Renamed - `newsticker--group-find-group-for-feed' to - `newsticker--group-find-parent-group'. Now works for both, groups - and feeds. + (newsticker--group-do-find-group): + Rename from `newsticker--group-do-find-group-for-feed'. + Now works for both, groups and feeds. + (newsticker--group-find-parent-group): + Rename from `newsticker--group-find-group-for-feed'. + Now works for both, groups and feeds. (newsticker--group-do-get-parent-group) - (newsticker--group-get-parent-group): Removed. - (newsticker-group-add-group): Changed interactive prompts. + (newsticker--group-get-parent-group): Remove. + (newsticker-group-add-group): Change interactive prompts. (newsticker-group-add-group): Finally jump to added group. (newsticker-group-delete-group): Finally jump to current feed. (newsticker--group-do-rename-group, newsticker-group-rename-group) @@ -36,23 +34,16 @@ (newsticker-group-move-feed): Finally jump to moved feed. (newsticker-group-shift-feed-down, newsticker-group-shift-feed-up) (newsticker-group-shift-group-down) - (newsticker-group-shift-group-up, newsticker--group-shift): New - (newsticker--group-manage-orphan-feeds): Renamed - `newsticker--group-find-group-for-feed' to - `newsticker--group-find-parent-group'. + (newsticker-group-shift-group-up, newsticker--group-shift): New. (newsticker-treeview-mode-map): New keybindings for new shift commands. - (newsticker-treeview-tree-do-click): Renamed - `newsticker--treeview-get-node' to - `newsticker--treeview-get-node-by-id'. * net/newst-backend.el (newsticker--item-list) (newsticker--item-position, newsticker--prev-message) - (newsticker--scrollable-text): Moved to newst-ticker.el. + (newsticker--scrollable-text): Move to newst-ticker.el. * net/newst-ticker.el (newsticker--item-list) (newsticker--item-position, newsticker--prev-message) - (newsticker--scrollable-text): Moved from newst-backend.el. - + (newsticker--scrollable-text): Move from newst-backend.el. 2014-09-22 Kan-Ru Chen === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-09-05 14:12:48 +0000 +++ lisp/net/tramp-sh.el 2014-09-25 13:07:28 +0000 @@ -3464,19 +3464,19 @@ (not (with-tramp-connection-property v vc-bzr-program (tramp-find-executable v vc-bzr-program (tramp-get-remote-path v))))) - (setq vc-handled-backends (delq 'Bzr vc-handled-backends))) + (setq vc-handled-backends (remq 'Bzr vc-handled-backends))) (when (and (memq 'Git vc-handled-backends) (boundp 'vc-git-program) (not (with-tramp-connection-property v vc-git-program (tramp-find-executable v vc-git-program (tramp-get-remote-path v))))) - (setq vc-handled-backends (delq 'Git vc-handled-backends))) + (setq vc-handled-backends (remq 'Git vc-handled-backends))) (when (and (memq 'Hg vc-handled-backends) (boundp 'vc-hg-program) (not (with-tramp-connection-property v vc-hg-program (tramp-find-executable v vc-hg-program (tramp-get-remote-path v))))) - (setq vc-handled-backends (delq 'Hg vc-handled-backends))) + (setq vc-handled-backends (remq 'Hg vc-handled-backends))) ;; Run. (ignore-errors (tramp-run-real-handler 'vc-registered (list file)))))))) ------------------------------------------------------------ revno: 117947 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-09-25 15:16:25 +0400 message: * xterm.c (x_new_font): Fix typo introduced by the recent dead code removal. diff: === modified file 'src/xterm.c' --- src/xterm.c 2014-09-25 07:01:35 +0000 +++ src/xterm.c 2014-09-25 11:16:25 +0000 @@ -8643,7 +8643,7 @@ FRAME_COLUMN_WIDTH (f) = font->average_width; FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (font); -#ifndef USE_X_TOOLKIT \ +#ifndef USE_X_TOOLKIT FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); #endif ------------------------------------------------------------ revno: 117946 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2014-09-25 14:24:57 +0400 message: * lisp.h (toplevel): Adjust comment around USE_STACK_LISP_OBJECTS. diff: === modified file 'src/lisp.h' --- src/lisp.h 2014-09-25 09:34:53 +0000 +++ src/lisp.h 2014-09-25 10:24:57 +0000 @@ -4595,18 +4595,17 @@ } while (false) -/* If USE_STACK_LISP_OBJECTS, define macros that and functions that - allocate block-scoped conses and function-scoped vectors and - strings. These objects are not managed by the garbage collector, - so they are dangerous: passing them out of their scope (e.g., to - user code) results in undefined behavior. Conversely, they have - better performance because GC is not involved. +/* If USE_STACK_LISP_OBJECTS, define macros that and functions that allocate + block-scoped conses and function-scoped vectors and strings. These objects + are not managed by the garbage collector, so they are dangerous: passing + them out of their scope (e.g., to user code) results in undefined behavior. + Conversely, they have better performance because GC is not involved. - This feature is experimental and requires careful debugging. - It's enabled by default on GNU/Linux with GCC. On other systems, - brave users can compile with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS' - to get into the game. Also note that this feature requires - GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS. */ + This feature is experimental and requires careful debugging. It's enabled + by default if GCC or a compiler that mimics GCC well (like Intel C/C++) is + used, except clang (see notice above). For other compilers, brave users can + compile with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS' to get into the game. + Note that this feature requires GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS. */ /* A struct Lisp_Cons inside a union that is no larger and may be better-aligned. */ ------------------------------------------------------------ revno: 117945 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-09-25 12:34:53 +0300 message: Default to stack objects on DOS_NT platforms as well. src/w32term.h (ALIGN_STACK) [__GNUC__]: Define to __attribute__((force_align_arg_pointer)) for GCC 4.2 and later. src/lisp.h (USE_STACK_LISP_OBJECTS): Remove the !DOS_NT condition. src/w32proc.c (enum_locale_fn, enum_codepage_fn): Add the ALIGN_STACK attribute. src/w32fns.c (w32_monitor_enum): Add the ALIGN_STACK attribute. src/w32uniscribe.c (add_opentype_font_name_to_list): Add the ALIGN_STACK attribute. src/w32font.c (add_font_name_to_list, add_font_entity_to_list) (add_one_font_entity_to_list): Add the ALIGN_STACK attribute. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-25 07:01:35 +0000 +++ src/ChangeLog 2014-09-25 09:34:53 +0000 @@ -1,3 +1,22 @@ +2014-09-25 Eli Zaretskii + + Default to stack objects on DOS_NT platforms as well. + * w32term.h (ALIGN_STACK) [__GNUC__]: Define to + __attribute__((force_align_arg_pointer)) for GCC 4.2 and later. + + * lisp.h (USE_STACK_LISP_OBJECTS): Remove the !DOS_NT condition. + + * w32proc.c (enum_locale_fn, enum_codepage_fn): Add the + ALIGN_STACK attribute. + + * w32fns.c (w32_monitor_enum): Add the ALIGN_STACK attribute. + + * w32uniscribe.c (add_opentype_font_name_to_list): Add the + ALIGN_STACK attribute. + + * w32font.c (add_font_name_to_list, add_font_entity_to_list) + (add_one_font_entity_to_list): Add the ALIGN_STACK attribute. + 2014-09-25 Martin Rudalics * frame.c (frame_inhibit_resize): === modified file 'src/lisp.h' --- src/lisp.h 2014-09-25 02:01:14 +0000 +++ src/lisp.h 2014-09-25 09:34:53 +0000 @@ -282,12 +282,10 @@ # endif #endif -/* This should work with GCC on non-DOS_NT. Clang has known problems; see - http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00506.html. - Also http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00422.html - describes an issue with 32-bit MS-Windows. */ +/* This should work with GCC. Clang has known problems; see + http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00506.html. */ #ifndef USE_STACK_LISP_OBJECTS -# if defined __GNUC__ && !defined __clang__ && !defined DOS_NT +# if defined __GNUC__ && !defined __clang__ # define USE_STACK_LISP_OBJECTS true # else # define USE_STACK_LISP_OBJECTS false === modified file 'src/w32fns.c' --- src/w32fns.c 2014-09-23 17:03:48 +0000 +++ src/w32fns.c 2014-09-25 09:34:53 +0000 @@ -5012,7 +5012,7 @@ return Qnil; } -static BOOL CALLBACK +static BOOL CALLBACK ALIGN_STACK w32_monitor_enum (HMONITOR monitor, HDC hdc, RECT *rcMonitor, LPARAM dwData) { Lisp_Object *monitor_list = (Lisp_Object *) dwData; === modified file 'src/w32font.c' --- src/w32font.c 2014-09-22 06:06:19 +0000 +++ src/w32font.c 2014-09-25 09:34:53 +0000 @@ -115,15 +115,15 @@ static Lisp_Object w32_registry (LONG, DWORD); /* EnumFontFamiliesEx callbacks. */ -static int CALLBACK add_font_entity_to_list (ENUMLOGFONTEX *, - NEWTEXTMETRICEX *, - DWORD, LPARAM); -static int CALLBACK add_one_font_entity_to_list (ENUMLOGFONTEX *, - NEWTEXTMETRICEX *, - DWORD, LPARAM); -static int CALLBACK add_font_name_to_list (ENUMLOGFONTEX *, - NEWTEXTMETRICEX *, - DWORD, LPARAM); +static int CALLBACK ALIGN_STACK add_font_entity_to_list (ENUMLOGFONTEX *, + NEWTEXTMETRICEX *, + DWORD, LPARAM); +static int CALLBACK ALIGN_STACK add_one_font_entity_to_list (ENUMLOGFONTEX *, + NEWTEXTMETRICEX *, + DWORD, LPARAM); +static int CALLBACK ALIGN_STACK add_font_name_to_list (ENUMLOGFONTEX *, + NEWTEXTMETRICEX *, + DWORD, LPARAM); /* struct passed in as LPARAM arg to EnumFontFamiliesEx, for keeping track of what we really want. */ @@ -1000,7 +1000,7 @@ /* Callback function for EnumFontFamiliesEx. * Adds the name of a font to a Lisp list (passed in as the lParam arg). */ -static int CALLBACK +static int CALLBACK ALIGN_STACK add_font_name_to_list (ENUMLOGFONTEX *logical_font, NEWTEXTMETRICEX *physical_font, DWORD font_type, LPARAM list_object) @@ -1446,7 +1446,7 @@ * and if so, adds it to a list. Both the data we are checking against * and the list to which the fonts are added are passed in via the * lparam argument, in the form of a font_callback_data struct. */ -static int CALLBACK +static int CALLBACK ALIGN_STACK add_font_entity_to_list (ENUMLOGFONTEX *logical_font, NEWTEXTMETRICEX *physical_font, DWORD font_type, LPARAM lParam) @@ -1565,7 +1565,7 @@ /* Callback function for EnumFontFamiliesEx. * Terminates the search once we have a match. */ -static int CALLBACK +static int CALLBACK ALIGN_STACK add_one_font_entity_to_list (ENUMLOGFONTEX *logical_font, NEWTEXTMETRICEX *physical_font, DWORD font_type, LPARAM lParam) === modified file 'src/w32proc.c' --- src/w32proc.c 2014-09-23 17:03:48 +0000 +++ src/w32proc.c 2014-09-25 09:34:53 +0000 @@ -2909,7 +2909,7 @@ function isn't given a context pointer. */ Lisp_Object Vw32_valid_locale_ids; -static BOOL CALLBACK +static BOOL CALLBACK ALIGN_STACK enum_locale_fn (LPTSTR localeNum) { DWORD id = int_from_hex (localeNum); @@ -2973,7 +2973,7 @@ function isn't given a context pointer. */ Lisp_Object Vw32_valid_codepages; -static BOOL CALLBACK +static BOOL CALLBACK ALIGN_STACK enum_codepage_fn (LPTSTR codepageNum) { DWORD id = atoi (codepageNum); === modified file 'src/w32term.h' --- src/w32term.h 2014-07-27 13:21:30 +0000 +++ src/w32term.h 2014-09-25 09:34:53 +0000 @@ -22,6 +22,22 @@ #include "frame.h" #include "atimer.h" +/* Stack alignment stuff. Every CALLBACK function should have the + ALIGN_STACK attribute if it manipulates Lisp objects, because + Windows x86 32-bit ABI only guarantees 4-byte stack alignment, and + that is what we will get when a Windows function calls us. The + ALIGN_STACK attribute forces GCC to emit a preamble code to + re-align the stack at function entry. Further details about this + can be found in http://www.peterstock.co.uk/games/mingw_sse/. */ +#ifdef __GNUC__ +# if defined USE_STACK_LISP_OBJECTS && defined _W64 \ + && __GNUC__ + (__GNUC_MINOR__ > 1) >= 5 +# define ALIGN_STACK __attribute__((force_align_arg_pointer)) +# else +# define ALIGN_STACK +# endif /* USE_STACK_LISP_OBJECTS */ +#endif + #define BLACK_PIX_DEFAULT(f) PALETTERGB(0,0,0) #define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255) === modified file 'src/w32uniscribe.c' --- src/w32uniscribe.c 2014-08-25 07:00:42 +0000 +++ src/w32uniscribe.c 2014-09-25 09:34:53 +0000 @@ -52,9 +52,9 @@ extern Lisp_Object Qopentype; /* EnumFontFamiliesEx callback. */ -static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *, - NEWTEXTMETRICEX *, - DWORD, LPARAM); +static int CALLBACK ALIGN_STACK add_opentype_font_name_to_list (ENUMLOGFONTEX *, + NEWTEXTMETRICEX *, + DWORD, LPARAM); /* Used by uniscribe_otf_capability. */ static Lisp_Object otf_features (HDC context, char *table); @@ -613,7 +613,7 @@ /* Callback function for EnumFontFamiliesEx. Adds the name of opentype fonts to a Lisp list (passed in as the lParam arg). */ -static int CALLBACK +static int CALLBACK ALIGN_STACK add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font, NEWTEXTMETRICEX *physical_font, DWORD font_type, LPARAM list_object) ------------------------------------------------------------ revno: 117944 committer: martin rudalics branch nick: trunk timestamp: Thu 2014-09-25 09:01:35 +0200 message: Remove code left dead after 2014-07-27 changes. * frame.c (frame_inhibit_resize): * widget.c (EmacsFrameResize): * window.c (resize_frame_windows, Fset_window_configuration): * xdisp.c (expose_frame): * xfns.c (x_change_tool_bar_height): * xmenu.c (update_frame_menubar): * xterm.c (handle_one_xevent, x_new_font, x_set_window_size_1): Remove code left dead after 2014-07-27 changes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-09-25 02:01:14 +0000 +++ src/ChangeLog 2014-09-25 07:01:35 +0000 @@ -1,3 +1,14 @@ +2014-09-25 Martin Rudalics + + * frame.c (frame_inhibit_resize): + * widget.c (EmacsFrameResize): + * window.c (resize_frame_windows, Fset_window_configuration): + * xdisp.c (expose_frame): + * xfns.c (x_change_tool_bar_height): + * xmenu.c (update_frame_menubar): + * xterm.c (handle_one_xevent, x_new_font, x_set_window_size_1): + Remove code left dead after 2014-07-27 changes. + 2014-09-25 Paul Eggert Fix local_cons etc. to not exhaust the stack when in a loop. === modified file 'src/frame.c' --- src/frame.c 2014-09-25 02:01:14 +0000 +++ src/frame.c 2014-09-25 07:01:35 +0000 @@ -219,21 +219,6 @@ || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)); } -#if 0 -bool -frame_inhibit_resize (struct frame *f, bool horizontal) -{ - Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); - - return (frame_inhibit_implied_resize - || EQ (fullscreen, Qfullboth) - || EQ (fullscreen, Qfullscreen) - || EQ (fullscreen, Qmaximized) - || (horizontal && EQ (fullscreen, Qfullwidth)) - || (!horizontal && EQ (fullscreen, Qfullheight))); -} -#endif - static void set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) { === modified file 'src/widget.c' --- src/widget.c 2014-08-09 09:06:25 +0000 +++ src/widget.c 2014-09-25 07:01:35 +0000 @@ -579,15 +579,6 @@ if (true || frame_resize_pixelwise) { int width, height; -/** int width = (ew->core.width **/ -/** - FRAME_SCROLL_BAR_AREA_WIDTH (f) **/ -/** - FRAME_TOTAL_FRINGE_WIDTH (f) **/ -/** - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); **/ - -/** int height = (ew->core.height **/ -/** - FRAME_TOOLBAR_HEIGHT (f) **/ -/** - FRAME_SCROLL_BAR_AREA_HEIGHT (f) **/ -/** - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); **/ pixel_to_text_size (ew, ew->core.width, ew->core.height, &width, &height); change_frame_size (f, width, height, 0, 1, 0, 1); === modified file 'src/window.c' --- src/window.c 2014-09-15 00:20:21 +0000 +++ src/window.c 2014-09-25 07:01:35 +0000 @@ -4163,7 +4163,6 @@ new_pixel_size = max (horflag ? size : (size -/** - FRAME_TOP_MARGIN_HEIGHT (f) **/ - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) ? FRAME_LINE_HEIGHT (f) : 0)), @@ -4175,7 +4174,6 @@ new_size = max (horflag ? size : (size -/** - FRAME_TOP_MARGIN (f) **/ - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) ? 1 : 0)), @@ -6462,420 +6460,6 @@ } -#if 0 -DEFUN ("set-window-configuration", Fset_window_configuration, - Sset_window_configuration, 1, 1, 0, - doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION. -CONFIGURATION must be a value previously returned -by `current-window-configuration' (which see). -If CONFIGURATION was made from a frame that is now deleted, -only frame-independent values can be restored. In this case, -the return value is nil. Otherwise the value is t. */) - (Lisp_Object configuration) -{ - register struct save_window_data *data; - struct Lisp_Vector *saved_windows; - Lisp_Object new_current_buffer; - Lisp_Object frame; - struct frame *f; - ptrdiff_t old_point = -1; - - CHECK_WINDOW_CONFIGURATION (configuration); - - data = (struct save_window_data *) XVECTOR (configuration); - saved_windows = XVECTOR (data->saved_windows); - - new_current_buffer = data->current_buffer; - if (!BUFFER_LIVE_P (XBUFFER (new_current_buffer))) - new_current_buffer = Qnil; - else - { - if (XBUFFER (new_current_buffer) == current_buffer) - /* The code further down "preserves point" by saving here PT in - old_point and then setting it later back into PT. When the - current-selected-window and the final-selected-window both show - the current buffer, this suffers from the problem that the - current PT is the window-point of the current-selected-window, - while the final PT is the point of the final-selected-window, so - this copy from one PT to the other would end up moving the - window-point of the final-selected-window to the window-point of - the current-selected-window. So we have to be careful which - point of the current-buffer we copy into old_point. */ - if (EQ (XWINDOW (data->current_window)->contents, new_current_buffer) - && WINDOWP (selected_window) - && EQ (XWINDOW (selected_window)->contents, new_current_buffer) - && !EQ (selected_window, data->current_window)) - old_point = marker_position (XWINDOW (data->current_window)->pointm); - else - old_point = PT; - else - /* BUF_PT (XBUFFER (new_current_buffer)) gives us the position of - point in new_current_buffer as of the last time this buffer was - used. This can be non-deterministic since it can be changed by - things like jit-lock by mere temporary selection of some random - window that happens to show this buffer. - So if possible we want this arbitrary choice of "which point" to - be the one from the to-be-selected-window so as to prevent this - window's cursor from being copied from another window. */ - if (EQ (XWINDOW (data->current_window)->contents, new_current_buffer) - /* If current_window = selected_window, its point is in BUF_PT. */ - && !EQ (selected_window, data->current_window)) - old_point = marker_position (XWINDOW (data->current_window)->pointm); - else - old_point = BUF_PT (XBUFFER (new_current_buffer)); - } - - frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; - f = XFRAME (frame); - - /* If f is a dead frame, don't bother rebuilding its window tree. - However, there is other stuff we should still try to do below. */ - if (FRAME_LIVE_P (f)) - { - Lisp_Object window; - Lisp_Object dead_windows = Qnil; - register Lisp_Object tem, par, pers; - register struct window *w; - register struct saved_window *p; - struct window *root_window; - struct window **leaf_windows; - int n_leaf_windows; - ptrdiff_t k; - int i, n; - ptrdiff_t count = SPECPDL_INDEX (); - /* If the frame has been resized since this window configuration was - made, we change the frame to the size specified in the - configuration, restore the configuration, and then resize it - back. We keep track of the prevailing height in these variables. */ - int previous_frame_text_height = FRAME_TEXT_HEIGHT (f); - int previous_frame_text_width = FRAME_TEXT_WIDTH (f); - /* int previous_frame_menu_bar_height = FRAME_MENU_BAR_HEIGHT (f); */ - /* int previous_frame_tool_bar_height = FRAME_TOOL_BAR_HEIGHT (f); */ - /* int previous_frame_lines = FRAME_LINES (f); */ - /* int previous_frame_cols = FRAME_COLS (f); */ - int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); - int previous_frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f); - - /* Don't do this within the main loop below: This may call Lisp - code and is thus potentially unsafe while input is blocked. */ - for (k = 0; k < saved_windows->header.size; k++) - { - p = SAVED_WINDOW_N (saved_windows, k); - window = p->window; - w = XWINDOW (window); - if (BUFFERP (w->contents) - && !EQ (w->contents, p->buffer) - && BUFFER_LIVE_P (XBUFFER (p->buffer))) - /* If a window we restore gets another buffer, record the - window's old buffer. */ - call1 (Qrecord_window_buffer, window); - } - - /* Consider frame unofficial, temporarily. */ - f->official = false; - /* The mouse highlighting code could get screwed up - if it runs during this. */ - block_input (); - - if (data->frame_text_width != previous_frame_text_width - || data->frame_text_height != previous_frame_text_height) - /* Make frame size fit the one in data, so window sizes restored - from data match those of the frame. */ - adjust_frame_size (f, data->frame_text_width, - data->frame_text_height, 5, 0); - - if (data->frame_menu_bar_lines != previous_frame_menu_bar_lines) - { -#ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (f)) - x_set_menu_bar_lines (f, make_number (data->frame_menu_bar_lines), - make_number (0)); - else /* TTY or MSDOS */ -#endif - set_menu_bar_lines (f, make_number (data->frame_menu_bar_lines), - make_number (0)); - } -#ifdef HAVE_WINDOW_SYSTEM - if (data->frame_tool_bar_lines != previous_frame_tool_bar_lines) - x_set_tool_bar_lines (f, make_number (data->frame_tool_bar_lines), - make_number (0)); -#endif - - /* "Swap out" point from the selected window's buffer - into the window itself. (Normally the pointm of the selected - window holds garbage.) We do this now, before - restoring the window contents, and prevent it from - being done later on when we select a new window. */ - if (! NILP (XWINDOW (selected_window)->contents)) - { - w = XWINDOW (selected_window); - set_marker_both (w->pointm, - w->contents, - BUF_PT (XBUFFER (w->contents)), - BUF_PT_BYTE (XBUFFER (w->contents))); - } - - fset_redisplay (f); - FRAME_WINDOW_SIZES_CHANGED (f) = 1; - - /* Problem: Freeing all matrices and later allocating them again - is a serious redisplay flickering problem. What we would - really like to do is to free only those matrices not reused - below. */ - root_window = XWINDOW (FRAME_ROOT_WINDOW (f)); - leaf_windows = alloca (count_windows (root_window) - * sizeof *leaf_windows); - n_leaf_windows = get_leaf_windows (root_window, leaf_windows, 0); - - /* Kludge Alert! - Mark all windows now on frame as "deleted". - Restoring the new configuration "undeletes" any that are in it. - - Save their current buffers in their height fields, since we may - need it later, if a buffer saved in the configuration is now - dead. */ - delete_all_child_windows (FRAME_ROOT_WINDOW (f)); - - for (k = 0; k < saved_windows->header.size; k++) - { - p = SAVED_WINDOW_N (saved_windows, k); - window = p->window; - w = XWINDOW (window); - wset_next (w, Qnil); - - if (!NILP (p->parent)) - wset_parent - (w, SAVED_WINDOW_N (saved_windows, XFASTINT (p->parent))->window); - else - wset_parent (w, Qnil); - - if (!NILP (p->prev)) - { - wset_prev - (w, SAVED_WINDOW_N (saved_windows, XFASTINT (p->prev))->window); - wset_next (XWINDOW (w->prev), p->window); - } - else - { - wset_prev (w, Qnil); - if (!NILP (w->parent)) - wset_combination (XWINDOW (w->parent), - (XINT (p->total_cols) - != XWINDOW (w->parent)->total_cols), - p->window); - } - - /* If we squirreled away the buffer, restore it now. */ - if (BUFFERP (w->combination_limit)) - wset_buffer (w, w->combination_limit); - w->pixel_left = XFASTINT (p->pixel_left); - w->pixel_top = XFASTINT (p->pixel_top); - w->pixel_width = XFASTINT (p->pixel_width); - w->pixel_height = XFASTINT (p->pixel_height); - w->left_col = XFASTINT (p->left_col); - w->top_line = XFASTINT (p->top_line); - w->total_cols = XFASTINT (p->total_cols); - w->total_lines = XFASTINT (p->total_lines); - wset_normal_cols (w, p->normal_cols); - wset_normal_lines (w, p->normal_lines); - w->hscroll = XFASTINT (p->hscroll); - w->suspend_auto_hscroll = !NILP (p->suspend_auto_hscroll); - w->min_hscroll = XFASTINT (p->min_hscroll); - w->hscroll_whole = XFASTINT (p->hscroll_whole); - wset_display_table (w, p->display_table); - w->left_margin_cols = XINT (p->left_margin_cols); - w->right_margin_cols = XINT (p->right_margin_cols); - w->left_fringe_width = XINT (p->left_fringe_width); - w->right_fringe_width = XINT (p->right_fringe_width); - w->fringes_outside_margins = !NILP (p->fringes_outside_margins); - w->scroll_bar_width = XINT (p->scroll_bar_width); - w->scroll_bar_height = XINT (p->scroll_bar_height); - wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type); - wset_horizontal_scroll_bar_type (w, p->horizontal_scroll_bar_type); - wset_dedicated (w, p->dedicated); - wset_combination_limit (w, p->combination_limit); - /* Restore any window parameters that have been saved. - Parameters that have not been saved are left alone. */ - for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) - { - pers = XCAR (tem); - if (CONSP (pers)) - { - if (NILP (XCDR (pers))) - { - par = Fassq (XCAR (pers), w->window_parameters); - if (CONSP (par) && !NILP (XCDR (par))) - /* Reset a parameter to nil if and only if it - has a non-nil association. Don't make new - associations. */ - Fsetcdr (par, Qnil); - } - else - /* Always restore a non-nil value. */ - Fset_window_parameter (window, XCAR (pers), XCDR (pers)); - } - } - - if (BUFFERP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer))) - /* If saved buffer is alive, install it. */ - { - wset_buffer (w, p->buffer); - w->start_at_line_beg = !NILP (p->start_at_line_beg); - set_marker_restricted (w->start, p->start, w->contents); - set_marker_restricted (w->pointm, p->pointm, w->contents); - set_marker_restricted (w->old_pointm, p->old_pointm, w->contents); - /* As documented in Fcurrent_window_configuration, don't - restore the location of point in the buffer which was - current when the window configuration was recorded. */ - if (!EQ (p->buffer, new_current_buffer) - && XBUFFER (p->buffer) == current_buffer) - Fgoto_char (w->pointm); - } - else if (BUFFERP (w->contents) && BUFFER_LIVE_P (XBUFFER (w->contents))) - /* Keep window's old buffer; make sure the markers are real. */ - { - /* Set window markers at start of visible range. */ - if (XMARKER (w->start)->buffer == 0) - set_marker_restricted_both (w->start, w->contents, 0, 0); - if (XMARKER (w->pointm)->buffer == 0) - set_marker_restricted_both - (w->pointm, w->contents, - BUF_PT (XBUFFER (w->contents)), - BUF_PT_BYTE (XBUFFER (w->contents))); - if (XMARKER (w->old_pointm)->buffer == 0) - set_marker_restricted_both - (w->old_pointm, w->contents, - BUF_PT (XBUFFER (w->contents)), - BUF_PT_BYTE (XBUFFER (w->contents))); - w->start_at_line_beg = 1; - } - else if (!NILP (w->start)) - /* Leaf window has no live buffer, get one. */ - { - /* Get the buffer via other_buffer_safely in order to - avoid showing an unimportant buffer and, if necessary, to - recreate *scratch* in the course (part of Juanma's bs-show - scenario from March 2011). */ - wset_buffer (w, other_buffer_safely (Fcurrent_buffer ())); - /* This will set the markers to beginning of visible - range. */ - set_marker_restricted_both (w->start, w->contents, 0, 0); - set_marker_restricted_both (w->pointm, w->contents, 0, 0); - set_marker_restricted_both (w->old_pointm, w->contents, 0, 0); - w->start_at_line_beg = 1; - if (!NILP (w->dedicated)) - /* Record this window as dead. */ - dead_windows = Fcons (window, dead_windows); - /* Make sure window is no more dedicated. */ - wset_dedicated (w, Qnil); - } - } - - fset_root_window (f, data->root_window); - /* Arrange *not* to restore point in the buffer that was - current when the window configuration was saved. */ - if (EQ (XWINDOW (data->current_window)->contents, new_current_buffer)) - set_marker_restricted (XWINDOW (data->current_window)->pointm, - make_number (old_point), - XWINDOW (data->current_window)->contents); - - /* In the following call to `select-window', prevent "swapping out - point" in the old selected window using the buffer that has - been restored into it. We already swapped out that point from - that window's old buffer. - - Do not record the buffer here. We do that in a separate call - to select_window below. See also Bug#16207. */ - select_window (data->current_window, Qt, 1); - BVAR (XBUFFER (XWINDOW (selected_window)->contents), - last_selected_window) - = selected_window; - - if (NILP (data->focus_frame) - || (FRAMEP (data->focus_frame) - && FRAME_LIVE_P (XFRAME (data->focus_frame)))) - Fredirect_frame_focus (frame, data->focus_frame); - - /* Set the frame size to the value it had before this function. */ - if (previous_frame_text_width != FRAME_TEXT_WIDTH (f) - || previous_frame_text_height != FRAME_TEXT_HEIGHT (f)) - adjust_frame_size (f, previous_frame_text_width, - previous_frame_text_height, 5, 0); - - if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f)) - { -#ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (f)) - x_set_menu_bar_lines (f, - make_number (previous_frame_menu_bar_lines), - make_number (0)); - else /* TTY or MSDOS */ -#endif - set_menu_bar_lines (f, make_number (previous_frame_menu_bar_lines), - make_number (0)); - } -#ifdef HAVE_WINDOW_SYSTEM - if (previous_frame_tool_bar_lines != FRAME_TOOL_BAR_LINES (f)) - x_set_tool_bar_lines (f, make_number (previous_frame_tool_bar_lines), - make_number (0)); -#endif - - /* Now, free glyph matrices in windows that were not reused. */ - for (i = n = 0; i < n_leaf_windows; ++i) - { - if (NILP (leaf_windows[i]->contents)) - free_window_matrices (leaf_windows[i]); - else if (EQ (leaf_windows[i]->contents, new_current_buffer)) - ++n; - } - - /* Make frame official again and apply frame size changes if - needed. */ - f->official = true; - adjust_frame_size (f, -1, -1, 1, 0); - - adjust_frame_glyphs (f); - unblock_input (); - - /* Scan dead buffer windows. */ - for (; CONSP (dead_windows); dead_windows = XCDR (dead_windows)) - { - window = XCAR (dead_windows); - if (WINDOW_LIVE_P (window) && !EQ (window, FRAME_ROOT_WINDOW (f))) - delete_deletable_window (window); - } - - /* Record the selected window's buffer here. The window should - already be the selected one from the call above. */ - select_window (data->current_window, Qnil, 0); - - /* Fselect_window will have made f the selected frame, so we - reselect the proper frame here. Fhandle_switch_frame will change the - selected window too, but that doesn't make the call to - Fselect_window above totally superfluous; it still sets f's - selected window. */ - if (FRAME_LIVE_P (XFRAME (data->selected_frame))) - do_switch_frame (data->selected_frame, 0, 0, Qnil); - - run_window_configuration_change_hook (f); - } - - if (!NILP (new_current_buffer)) - { - Fset_buffer (new_current_buffer); - /* If the new current buffer doesn't appear in the selected - window, go to its old point (see bug#12208). */ - if (!EQ (XWINDOW (data->current_window)->contents, new_current_buffer)) - Fgoto_char (make_number (old_point)); - } - - Vminibuf_scroll_window = data->minibuf_scroll_window; - minibuf_selected_window = data->minibuf_selected_window; - - return (FRAME_LIVE_P (f) ? Qt : Qnil); -} -#endif - void restore_window_configuration (Lisp_Object configuration) { === modified file 'src/xdisp.c' --- src/xdisp.c 2014-09-25 02:01:14 +0000 +++ src/xdisp.c 2014-09-25 07:01:35 +0000 @@ -30145,8 +30145,6 @@ r.x = r.y = 0; r.width = FRAME_TEXT_WIDTH (f); r.height = FRAME_TEXT_HEIGHT (f); -/** r.width = FRAME_COLUMN_WIDTH (f) * FRAME_COLS (f); **/ -/** r.height = FRAME_LINE_HEIGHT (f) * FRAME_LINES (f); **/ } else { === modified file 'src/xfns.c' --- src/xfns.c 2014-09-25 02:01:14 +0000 +++ src/xfns.c 2014-09-25 07:01:35 +0000 @@ -1140,10 +1140,8 @@ adjust_frame_size (f, -1, -1, 4, 0); -/** #if !defined USE_X_TOOLKIT **/ if (FRAME_X_WINDOW (f)) x_clear_under_internal_border (f); -/** #endif **/ #endif /* USE_GTK */ } === modified file 'src/xmenu.c' --- src/xmenu.c 2014-09-07 07:04:01 +0000 +++ src/xmenu.c 2014-09-25 07:01:35 +0000 @@ -627,7 +627,6 @@ xg_update_frame_menubar (f); #else struct x_output *x; -/** int columns, rows; **/ eassert (FRAME_X_P (f)); @@ -637,10 +636,6 @@ return; block_input (); - /* Save the size of the frame because the pane widget doesn't accept - to resize itself. So force it. */ -/** columns = FRAME_COLS (f); **/ -/** rows = FRAME_LINES (f); **/ /* Do the voodoo which means "I'm changing lots of things, don't try to refigure sizes until I'm done." */ @@ -661,8 +656,7 @@ XtManageChild (x->edit_widget); lw_refigure_widget (x->column_widget, True); - /* Force the pane widget to resize itself with the right values. */ -/** EmacsFrameSetCharSize (x->edit_widget, columns, rows); **/ + /* Force the pane widget to resize itself. */ adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 2, 0); unblock_input (); #endif === modified file 'src/xterm.c' --- src/xterm.c 2014-09-25 02:01:14 +0000 +++ src/xterm.c 2014-09-25 07:01:35 +0000 @@ -7560,9 +7560,6 @@ SET_FRAME_GARBAGED (f); cancel_mouse_face (f); } - -/** FRAME_PIXEL_WIDTH (f) = event->xconfigure.width; **/ -/** FRAME_PIXEL_HEIGHT (f) = event->xconfigure.height; **/ #endif /* not USE_GTK */ #endif @@ -8647,7 +8644,6 @@ FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (font); #ifndef USE_X_TOOLKIT \ -/** FRAME_TOOL_BAR_HEIGHT (f) = FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); **/ FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); #endif @@ -9490,18 +9486,6 @@ { int pixelwidth, pixelheight; -/** if (pixelwise) **/ -/** { **/ -/** pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); **/ -/** pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); **/ -/** } **/ -/** else **/ -/** { **/ -/** pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); **/ -/** pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); **/ -/** } **/ - -/** FRAME_TOOL_BAR_HEIGHT (f) = FRAME_TOOLBAR_HEIGHT (f); **/ pixelwidth = (pixelwise ? FRAME_TEXT_TO_PIXEL_WIDTH (f, width) : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width)); @@ -9509,16 +9493,6 @@ ? FRAME_TEXT_TO_PIXEL_HEIGHT (f, height) : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height))); -/** pixelwidth = ((pixelwise ? width : (width * FRAME_COLUMN_WIDTH (f))) **/ -/** + FRAME_SCROLL_BAR_AREA_WIDTH (f) **/ -/** + FRAME_TOTAL_FRINGE_WIDTH (f) **/ -/** + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); **/ - -/** pixelheight = ((pixelwise ? height : (height * FRAME_LINE_HEIGHT (f))) **/ -/** + FRAME_TOOLBAR_HEIGHT (f) **/ -/** + FRAME_SCROLL_BAR_AREA_HEIGHT (f) **/ -/** + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); **/ - if (change_gravity) f->win_gravity = NorthWestGravity; x_wm_set_size_hint (f, 0, 0); XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),