Now on revision 110541. ------------------------------------------------------------ revno: 110541 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2012-10-13 21:42:48 -0400 message: * lisp/emacs-lisp/eieio.el (eieio-oset-default, eieio-oset, oset-default) (oset): Move uses of object-class-fast macro after its definition. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-14 01:39:56 +0000 +++ lisp/ChangeLog 2012-10-14 01:42:48 +0000 @@ -1,5 +1,8 @@ 2012-10-14 Stefan Monnier + * emacs-lisp/eieio.el (eieio-oset-default, eieio-oset, oset-default) + (oset): Move uses of object-class-fast macro after its definition. + * emacs-lisp/gv.el (if): Don't use closures in non-lexical-binding code. 2012-10-13 Chong Yidong === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2012-10-12 20:07:58 +0000 +++ lisp/emacs-lisp/eieio.el 2012-10-14 01:42:48 +0000 @@ -1556,71 +1556,6 @@ ;; return it verbatim (t val))) -;;; Object Set macros -;; -(defmacro oset (obj slot value) - "Set the value in OBJ for slot SLOT to VALUE. -SLOT is the slot name as specified in `defclass' or the tag created -with in the :initarg slot. VALUE can be any Lisp object." - `(eieio-oset ,obj (quote ,slot) ,value)) - -(defun eieio-oset (obj slot value) - "Do the work for the macro `oset'. -Fills in OBJ's SLOT with VALUE." - (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj))) - (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) - (let ((c (eieio-slot-name-index (object-class-fast obj) obj slot))) - (if (not c) - ;; It might be missing because it is a :class allocated slot. - ;; Let's check that info out. - (if (setq c - (eieio-class-slot-name-index (aref obj object-class) slot)) - ;; Oset that slot. - (progn - (eieio-validate-class-slot-value (object-class-fast obj) c value slot) - (aset (aref (class-v (aref obj object-class)) - class-class-allocation-values) - c value)) - ;; See oref for comment on `slot-missing' - (slot-missing obj slot 'oset value) - ;;(signal 'invalid-slot-name (list (object-name obj) slot)) - ) - (eieio-validate-slot-value (object-class-fast obj) c value slot) - (aset obj c value)))) - -(defmacro oset-default (class slot value) - "Set the default slot in CLASS for SLOT to VALUE. -The default value is usually set with the :initform tag during class -creation. This allows users to change the default behavior of classes -after they are created." - `(eieio-oset-default ,class (quote ,slot) ,value)) - -(defun eieio-oset-default (class slot value) - "Do the work for the macro `oset-default'. -Fills in the default value in CLASS' in SLOT with VALUE." - (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class))) - (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) - (let* ((scoped-class class) - (c (eieio-slot-name-index class nil slot))) - (if (not c) - ;; It might be missing because it is a :class allocated slot. - ;; Let's check that info out. - (if (setq c (eieio-class-slot-name-index class slot)) - (progn - ;; Oref that slot. - (eieio-validate-class-slot-value class c value slot) - (aset (aref (class-v class) class-class-allocation-values) c - value)) - (signal 'invalid-slot-name (list (class-name class) slot))) - (eieio-validate-slot-value class c value slot) - ;; Set this into the storage for defaults. - (setcar (nthcdr (- c 3) (aref (class-v class) class-public-d)) - value) - ;; Take the value, and put it into our cache object. - (eieio-oset (aref (class-v class) class-default-object-cache) - slot value) - ))) - ;;; Handy CLOS macros ;; (defmacro with-slots (spec-list object &rest body) @@ -1871,6 +1806,71 @@ (setq ia (cdr ia))) f)) +;;; Object Set macros +;; +(defmacro oset (obj slot value) + "Set the value in OBJ for slot SLOT to VALUE. +SLOT is the slot name as specified in `defclass' or the tag created +with in the :initarg slot. VALUE can be any Lisp object." + `(eieio-oset ,obj (quote ,slot) ,value)) + +(defun eieio-oset (obj slot value) + "Do the work for the macro `oset'. +Fills in OBJ's SLOT with VALUE." + (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj))) + (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) + (let ((c (eieio-slot-name-index (object-class-fast obj) obj slot))) + (if (not c) + ;; It might be missing because it is a :class allocated slot. + ;; Let's check that info out. + (if (setq c + (eieio-class-slot-name-index (aref obj object-class) slot)) + ;; Oset that slot. + (progn + (eieio-validate-class-slot-value (object-class-fast obj) c value slot) + (aset (aref (class-v (aref obj object-class)) + class-class-allocation-values) + c value)) + ;; See oref for comment on `slot-missing' + (slot-missing obj slot 'oset value) + ;;(signal 'invalid-slot-name (list (object-name obj) slot)) + ) + (eieio-validate-slot-value (object-class-fast obj) c value slot) + (aset obj c value)))) + +(defmacro oset-default (class slot value) + "Set the default slot in CLASS for SLOT to VALUE. +The default value is usually set with the :initform tag during class +creation. This allows users to change the default behavior of classes +after they are created." + `(eieio-oset-default ,class (quote ,slot) ,value)) + +(defun eieio-oset-default (class slot value) + "Do the work for the macro `oset-default'. +Fills in the default value in CLASS' in SLOT with VALUE." + (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class))) + (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot))) + (let* ((scoped-class class) + (c (eieio-slot-name-index class nil slot))) + (if (not c) + ;; It might be missing because it is a :class allocated slot. + ;; Let's check that info out. + (if (setq c (eieio-class-slot-name-index class slot)) + (progn + ;; Oref that slot. + (eieio-validate-class-slot-value class c value slot) + (aset (aref (class-v class) class-class-allocation-values) c + value)) + (signal 'invalid-slot-name (list (class-name class) slot))) + (eieio-validate-slot-value class c value slot) + ;; Set this into the storage for defaults. + (setcar (nthcdr (- c 3) (aref (class-v class) class-public-d)) + value) + ;; Take the value, and put it into our cache object. + (eieio-oset (aref (class-v class) class-default-object-cache) + slot value) + ))) + ;;; CLOS queries into classes and slots ;; (defun slot-boundp (object slot) ------------------------------------------------------------ revno: 110540 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2012-10-13 21:39:56 -0400 message: * lisp/emacs-lisp/gv.el (if): Don't use closures in non-lexical-binding code. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-13 09:51:59 +0000 +++ lisp/ChangeLog 2012-10-14 01:39:56 +0000 @@ -1,3 +1,7 @@ +2012-10-14 Stefan Monnier + + * emacs-lisp/gv.el (if): Don't use closures in non-lexical-binding code. + 2012-10-13 Chong Yidong * textmodes/ispell.el (ispell-pdict-save): If flyspell-mode is === modified file 'lisp/emacs-lisp/gv.el' --- lisp/emacs-lisp/gv.el 2012-09-26 14:41:05 +0000 +++ lisp/emacs-lisp/gv.el 2012-10-14 01:39:56 +0000 @@ -358,7 +358,8 @@ (put 'if 'gv-expander (lambda (do test then &rest else) - (if (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy))) + (if (or (not lexical-binding) ;The other code requires lexical-binding. + (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy)))) ;; This duplicates the `do' code, which is a problem if that ;; code is large, but otherwise results in more efficient code. `(if ,test ,(gv-get then do) ------------------------------------------------------------ revno: 110539 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-10-13 17:17:07 -0700 message: ChangeLog fix diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-13 21:52:09 +0000 +++ src/ChangeLog 2012-10-14 00:17:07 +0000 @@ -1294,7 +1294,6 @@ * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't wanted even on POSIXish hosts, and it doesn't work on Windows. ->>>>>>> MERGE-SOURCE 2012-09-23 Jan Djärv * xterm.c (x_term_init): Call fixup_locale before and after calling ------------------------------------------------------------ revno: 110538 fixes bug: http://debbugs.gnu.org/12612 committer: Jan D. branch nick: trunk timestamp: Sat 2012-10-13 23:52:09 +0200 message: * gtkutil.c (xg_set_widget_bg): Divide by 65535. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-13 13:11:40 +0000 +++ src/ChangeLog 2012-10-13 21:52:09 +0000 @@ -1,3 +1,7 @@ +2012-10-13 Jan Djärv + + * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612). + 2012-10-13 HANATAKA, Shinya (tiny change) * coding.c (detect_coding): Set coding->id before calling @@ -1290,6 +1294,7 @@ * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't wanted even on POSIXish hosts, and it doesn't work on Windows. +>>>>>>> MERGE-SOURCE 2012-09-23 Jan Djärv * xterm.c (x_term_init): Call fixup_locale before and after calling === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-09-23 19:36:31 +0000 +++ src/gtkutil.c 2012-10-13 21:52:09 +0000 @@ -1035,9 +1035,9 @@ xbg.pixel = pixel; if (XQueryColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &xbg)) { - bg.red = (double)xbg.red/65536.0; - bg.green = (double)xbg.green/65536.0; - bg.blue = (double)xbg.blue/65536.0; + bg.red = (double)xbg.red/65535.0; + bg.green = (double)xbg.green/65535.0; + bg.blue = (double)xbg.blue/65535.0; bg.alpha = 1.0; gtk_widget_override_background_color (w, GTK_STATE_FLAG_NORMAL, &bg); } ------------------------------------------------------------ revno: 110537 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-10-13 13:17:16 -0700 message: Comment diff: === modified file 'lisp/url/url-file.el' --- lisp/url/url-file.el 2012-10-13 10:51:26 +0000 +++ lisp/url/url-file.el 2012-10-13 20:17:16 +0000 @@ -166,6 +166,8 @@ (or filename (error "File does not exist: %s" (url-recreate-url url))) ;; Need to figure out the content-type from the real extension, ;; not the compressed one. + ;; FIXME should this regexp not include more extensions; basically + ;; everything that url-file-find-possibly-compressed-file does? (setq uncompressed-filename (if (string-match "\\.\\(gz\\|Z\\|z\\)$" filename) (substring filename 0 (match-beginning 0)) filename)) ------------------------------------------------------------ revno: 110536 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-10-13 12:39:42 -0700 message: usertags updates diff: === modified file 'admin/notes/bugtracker' --- admin/notes/bugtracker 2012-09-23 18:40:55 +0000 +++ admin/notes/bugtracker 2012-10-13 19:39:42 +0000 @@ -270,32 +270,35 @@ 1) Anyone can define any valid usertag they like. In contrast, only a limited, predefined set of normal tags are available (see above). -2) A usertag is associated with a specific email address. +2) A usertag is associated with a specific user. This is normally +an email address (with an "@" sign and least 4 characters after the "@"), +but on debbugs.gnu.org, the definition is less strict - anything with +5 or more alphanumeric characters will work. For personal tags, +using an email address is still recommended. Please only use the +"emacs" user, or other short users, for "official" tags. -You set usertags in the same way as tags, by talking to the control -server. One difference is that you can also specify the associated -email address. If you don't explicitly specify an address, then it -will use the one from which you send the control message. The address -must have the form of an email address (with an "@" sign and least 4 -characters after the "@"). +You set usertags in the same way as tags, by talking to the control server. +One difference is that you can also specify the associated user. +If you don't explicitly specify a user, then it will use the email +address from which you send the control message. *** Setting usertags a) In a control message: -user bug-gnu-emacs@gnu.org +user emacs # or email@example.com usertags 1234 any-tag-you-like This will add a usertag "any-tag-you-like" to bug 1234. The tag will -be associated with the address "bug-gnu-emacs@gnu.org". If you omit -the first line, the tag will be associated with your email address. +be associated with the user "emacs". If you omit the first line, +the tag will be associated with your email address. The syntax of the usertags command is the same as that of tags (eg wrt the optional [=+-] argument). b) In an initial submission, in the pseudo-header: -User: bug-gnu-emacs@gnu.org +User: emacs Usertags: a-new-tag Again, the "User" is optional. @@ -312,7 +315,7 @@ **** To find all bugs usertagged by a given email address: -http://debbugs.gnu.org/cgi/pkgreport.cgi?users=bug-gnu-emacs@gnu.org +http://debbugs.gnu.org/cgi/pkgreport.cgi?users=emacs (Supposedly, the "users" field can be a comma-separated list of more than one email address, but it does not seem to work for me.) @@ -322,7 +325,7 @@ This works just like a normal tags search, but with the addition of a "users" field. Eg: -http://debbugs.gnu.org/cgi/pkgreport.cgi?users=bug-gnu-emacs@gnu.org;tag=calendar +http://debbugs.gnu.org/cgi/pkgreport.cgi?users=emacs;tag=calendar *** To merge bugs: Eg when bad replies create a bunch of new bugs for the same report. ------------------------------------------------------------ revno: 110535 [merge] committer: Kenichi Handa branch nick: trunk timestamp: Sat 2012-10-13 22:12:01 +0900 message: coding.c (detect_coding): Set coding->id before calling this->detector. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-13 08:55:26 +0000 +++ src/ChangeLog 2012-10-13 13:11:40 +0000 @@ -1,3 +1,8 @@ +2012-10-13 HANATAKA, Shinya (tiny change) + + * coding.c (detect_coding): Set coding->id before calling + this->detector. + 2012-10-13 Andreas Schwab * fileio.c: Formatting fixes. === modified file 'src/coding.c' --- src/coding.c 2012-10-01 06:36:54 +0000 +++ src/coding.c 2012-10-13 12:58:52 +0000 @@ -6301,6 +6301,9 @@ { category = coding_priorities[i]; this = coding_categories + category; + /* Some of this->detector (e.g. detect_coding_sjis) + require this information. */ + coding->id = this->id; if (this->id < 0) { /* No coding system of this category is defined. */ ------------------------------------------------------------ revno: 110534 fixes bug: http://debbugs.gnu.org/11839 author: Liam Stitt committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-10-13 18:51:26 +0800 message: Add .xz to some url code (tiny change). * url-vars.el (url-uncompressor-alist): * url-file.el (url-file-find-possibly-compressed-file, url-file): Recognize .xz compression. diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2012-10-13 09:37:25 +0000 +++ lisp/url/ChangeLog 2012-10-13 10:51:26 +0000 @@ -1,3 +1,9 @@ +2012-10-13 Liam Stitt (tiny change) + + * url-vars.el (url-uncompressor-alist): + * url-file.el (url-file-find-possibly-compressed-file, url-file): + Recognize .xz compression (Bug#11839). + 2012-10-13 Chong Yidong * url-http.el (url-http): === modified file 'lisp/url/url-file.el' --- lisp/url/url-file.el 2012-07-11 23:13:41 +0000 +++ lisp/url/url-file.el 2012-10-13 10:51:26 +0000 @@ -40,7 +40,7 @@ 'foo.gz' exists, even though the FTP server would happily serve it up to them." (let ((scratch nil) - (compressed-extensions '("" ".gz" ".z" ".Z" ".bz2")) + (compressed-extensions '("" ".gz" ".z" ".Z" ".bz2" ".xz")) (found nil)) (while (and compressed-extensions (not found)) (if (file-exists-p (setq scratch (concat fname (pop compressed-extensions)))) @@ -177,6 +177,7 @@ (".uue" "x-uuencoded") (".hqx" "x-hqx") (".bz2" "x-bzip2") + (".xz" "x-xz") (_ nil))) (if (file-directory-p filename) === modified file 'lisp/url/url-vars.el' --- lisp/url/url-vars.el 2012-06-30 21:13:05 +0000 +++ lisp/url/url-vars.el 2012-10-13 10:51:26 +0000 @@ -152,7 +152,8 @@ (".uue" . "x-uuencoded") (".hqx" . "x-hqx") (".Z" . "x-compress") - (".bz2" . "x-bzip2")) + (".bz2" . "x-bzip2") + (".xz" . "x-xz")) "An alist of file extensions and appropriate content-transfer-encodings." :type '(repeat (cons :format "%v" (string :tag "Extension") ------------------------------------------------------------ revno: 110533 fixes bug: http://debbugs.gnu.org/11963 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-10-13 17:51:59 +0800 message: After saving ispell dictionary, re-enable flyspell if necessary. * lisp/textmodes/ispell.el (ispell-pdict-save): If flyspell-mode is enabled, re-enable it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-13 07:58:53 +0000 +++ lisp/ChangeLog 2012-10-13 09:51:59 +0000 @@ -1,3 +1,8 @@ +2012-10-13 Chong Yidong + + * textmodes/ispell.el (ispell-pdict-save): If flyspell-mode is + enabled, re-enable it (Bug#11963). + 2012-10-13 Martin Rudalics * emacs-lisp/debug.el (debug): When debugger-will-be-back is === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2012-09-17 05:41:04 +0000 +++ lisp/textmodes/ispell.el 2012-10-13 09:51:59 +0000 @@ -1893,11 +1893,14 @@ (interactive (list ispell-silently-savep t)) (if (and ispell-pdict-modified-p (listp ispell-pdict-modified-p)) (setq ispell-pdict-modified-p (car ispell-pdict-modified-p))) - (if (or ispell-pdict-modified-p force-save) - (if (or no-query (y-or-n-p "Personal dictionary modified. Save? ")) - (progn - (ispell-send-string "#\n") ; save dictionary - (message "Personal dictionary saved.")))) + (when (and (or ispell-pdict-modified-p force-save) + (or no-query + (y-or-n-p "Personal dictionary modified. Save? "))) + (ispell-send-string "#\n") ; save dictionary + (message "Personal dictionary saved.") + (when flyspell-mode + (flyspell-mode 0) + (flyspell-mode 1))) ;; unassert variable, even if not saved to avoid questioning. (setq ispell-pdict-modified-p nil)) ------------------------------------------------------------ revno: 110532 fixes bug: http://debbugs.gnu.org/6407 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-10-13 17:37:25 +0800 message: Doc fix for url-http. * url-http.el (url-http): * url.el (url-retrieve-internal): Doc fix. diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2012-10-08 07:47:23 +0000 +++ lisp/url/ChangeLog 2012-10-13 09:37:25 +0000 @@ -1,3 +1,8 @@ +2012-10-13 Chong Yidong + + * url-http.el (url-http): + * url.el (url-retrieve-internal): Doc fix (Bug#6407). + 2012-10-08 Glenn Morris * url-methods.el (url-scheme-get-property): url-https.el was === modified file 'lisp/url/url-http.el' --- lisp/url/url-http.el 2012-10-02 03:48:01 +0000 +++ lisp/url/url-http.el 2012-10-13 09:37:25 +0000 @@ -1150,8 +1150,12 @@ (defun url-http (url callback cbargs &optional retry-buffer) "Retrieve URL via HTTP asynchronously. URL must be a parsed URL. See `url-generic-parse-url' for details. -When retrieval is completed, the function CALLBACK is executed with -CBARGS as the arguments. + +When retrieval is completed, execute the function CALLBACK, using +the arguments listed in CBARGS. The first element in CBARGS +should be a plist describing what has happened so far during the +request, as described in the docstring of `url-retrieve' (if in +doubt, specify nil). Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a previous `url-http' call, which is being re-attempted." === modified file 'lisp/url/url.el' --- lisp/url/url.el 2012-07-11 23:13:41 +0000 +++ lisp/url/url.el 2012-10-13 09:37:25 +0000 @@ -131,9 +131,9 @@ CALLBACK is called when the object has been completely retrieved, with the current buffer containing the object, and any MIME headers associated with it. It is called as (apply CALLBACK STATUS CBARGS). -STATUS is a list with an even number of elements representing -what happened during the request, with most recent events first, -or an empty list if no events have occurred. Each pair is one of: +STATUS is a plist representing what happened during the request, +with most recent events first, or an empty list if no events have +occurred. Each pair is one of: \(:redirect REDIRECTED-TO) - the request was redirected to this URL \(:error (ERROR-SYMBOL . DATA)) - an error occurred. The error can be @@ -169,8 +169,10 @@ (defun url-retrieve-internal (url callback cbargs &optional silent inhibit-cookies) "Internal function; external interface is `url-retrieve'. -CBARGS is what the callback will actually receive - the first item is -the list of events, as described in the docstring of `url-retrieve'. +CBARGS is the list of arguments that the callback function will +receive; its first element should be a plist specifying what has +happened so far during the request, as described in the docstring +of `url-retrieve' (if in doubt, specify nil). If SILENT, don't message progress reports and the like. If INHIBIT-COOKIES, cookies will neither be stored nor sent to ------------------------------------------------------------ revno: 110531 committer: Andreas Schwab branch nick: emacs timestamp: Sat 2012-10-13 10:55:26 +0200 message: * fileio.c: Formatting fixes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-13 00:52:01 +0000 +++ src/ChangeLog 2012-10-13 08:55:26 +0000 @@ -1,3 +1,7 @@ +2012-10-13 Andreas Schwab + + * fileio.c: Formatting fixes. + 2012-10-13 Paul Eggert Fix some stat-related races. === modified file 'src/fileio.c' --- src/fileio.c 2012-10-13 00:52:01 +0000 +++ src/fileio.c 2012-10-13 08:55:26 +0000 @@ -1370,8 +1370,7 @@ p = nm; while (*p) { - if (p[0] == '/' && p[1] == '/' - ) + if (p[0] == '/' && p[1] == '/') nm = p + 1; if (p[0] == '/' && p[1] == '~') nm = p + 1, lose = 1; @@ -1510,17 +1509,16 @@ for (p = nm + 1; p < endp; p++) { - if ((0 - || IS_DIRECTORY_SEP (p[-1])) + if (IS_DIRECTORY_SEP (p[-1]) && file_name_absolute_p (p) #if defined (WINDOWSNT) || defined (CYGWIN) /* // at start of file name is meaningful in Apollo, WindowsNT and Cygwin systems. */ && !(IS_DIRECTORY_SEP (p[0]) && p - 1 == nm) #endif /* not (WINDOWSNT || CYGWIN) */ - ) + ) { - for (s = p; *s && (!IS_DIRECTORY_SEP (*s)); s++); + for (s = p; *s && !IS_DIRECTORY_SEP (*s); s++); if (p[0] == '~' && s > p + 1) /* We've got "/~something/". */ { char *o = alloca (s - p + 1); @@ -1735,7 +1733,7 @@ *x = 0; /* If /~ or // appears, discard everything through first slash. */ - while ((p = search_embedded_absfilename (xnm, x))) + while ((p = search_embedded_absfilename (xnm, x)) != NULL) /* This time we do not start over because we've already expanded envvars and replaced $$ with $. Maybe we should start over as well, but we'd need to quote some $ to $$ first. */ @@ -2169,7 +2167,7 @@ encoded_file = ENCODE_FILE (filename); - if (0 > unlink (SSDATA (encoded_file))) + if (unlink (SSDATA (encoded_file)) < 0) report_file_error ("Removing old name", list1 (filename)); return Qnil; } @@ -2218,8 +2216,8 @@ #endif ) { - Lisp_Object fname = NILP (Ffile_directory_p (file)) - ? file : Fdirectory_file_name (file); + Lisp_Object fname = (NILP (Ffile_directory_p (file)) + ? file : Fdirectory_file_name (file)); newname = Fexpand_file_name (Ffile_name_nondirectory (fname), newname); } else @@ -2247,7 +2245,7 @@ || INTEGERP (ok_if_already_exists)) barf_or_query_if_file_exists (newname, "rename to it", INTEGERP (ok_if_already_exists), 0, 0); - if (0 > rename (SSDATA (encoded_file), SSDATA (encoded_newname))) + if (rename (SSDATA (encoded_file), SSDATA (encoded_newname)) < 0) { if (errno == EXDEV) { @@ -2328,7 +2326,7 @@ INTEGERP (ok_if_already_exists), 0, 0); unlink (SSDATA (newname)); - if (0 > link (SSDATA (encoded_file), SSDATA (encoded_newname))) + if (link (SSDATA (encoded_file), SSDATA (encoded_newname)) < 0) report_file_error ("Adding new name", list2 (file, newname)); UNGCPRO; @@ -2385,15 +2383,14 @@ || INTEGERP (ok_if_already_exists)) barf_or_query_if_file_exists (linkname, "make it a link", INTEGERP (ok_if_already_exists), 0, 0); - if (0 > symlink (SSDATA (encoded_filename), - SSDATA (encoded_linkname))) + if (symlink (SSDATA (encoded_filename), SSDATA (encoded_linkname)) < 0) { /* If we didn't complain already, silently delete existing file. */ if (errno == EEXIST) { unlink (SSDATA (encoded_linkname)); - if (0 <= symlink (SSDATA (encoded_filename), - SSDATA (encoded_linkname))) + if (symlink (SSDATA (encoded_filename), SSDATA (encoded_linkname)) + >= 0) { UNGCPRO; return Qnil; @@ -3203,7 +3200,7 @@ { /* Use "&" rather than "&&" to suppress a bogus GCC warning; see . */ - if (! ((TYPE_MINIMUM (off_t) <= offset) & (offset <= TYPE_MAXIMUM (off_t)))) + if (! ((offset >= TYPE_MINIMUM (off_t)) & (offset <= TYPE_MAXIMUM (off_t)))) { errno = EINVAL; return -1; @@ -3376,7 +3373,7 @@ if (!NILP (beg)) { - if (! (RANGED_INTEGERP (0, beg, TYPE_MAXIMUM (off_t)))) + if (! RANGED_INTEGERP (0, beg, TYPE_MAXIMUM (off_t))) wrong_type_argument (intern ("file-offset"), beg); beg_offset = XFASTINT (beg); } @@ -3385,7 +3382,7 @@ if (!NILP (end)) { - if (! (RANGED_INTEGERP (0, end, TYPE_MAXIMUM (off_t)))) + if (! RANGED_INTEGERP (0, end, TYPE_MAXIMUM (off_t))) wrong_type_argument (intern ("file-offset"), end); end_offset = XFASTINT (end); } @@ -3421,8 +3418,8 @@ if (beg_offset < likely_end) { - ptrdiff_t buf_bytes = - Z_BYTE - (!NILP (replace) ? ZV_BYTE - BEGV_BYTE : 0); + ptrdiff_t buf_bytes + = Z_BYTE - (!NILP (replace) ? ZV_BYTE - BEGV_BYTE : 0); ptrdiff_t buf_growth_max = BUF_BYTES_MAX - buf_bytes; off_t likely_growth = likely_end - beg_offset; if (buf_growth_max < likely_growth) @@ -5050,12 +5047,12 @@ if (coding->produced > 0) { - coding->produced -= - emacs_write (desc, - STRINGP (coding->dst_object) - ? SSDATA (coding->dst_object) - : (char *) BYTE_POS_ADDR (coding->dst_pos_byte), - coding->produced); + coding->produced + -= emacs_write (desc, + STRINGP (coding->dst_object) + ? SSDATA (coding->dst_object) + : (char *) BYTE_POS_ADDR (coding->dst_pos_byte), + coding->produced); if (coding->produced) return 0; @@ -5234,8 +5231,8 @@ if (stat (SSDATA (BVAR (current_buffer, filename)), &st) >= 0) /* But make sure we can overwrite it later! */ auto_save_mode_bits = (st.st_mode | 0600) & 0777; - else if ((modes = Ffile_modes (BVAR (current_buffer, filename)), - INTEGERP (modes))) + else if (modes = Ffile_modes (BVAR (current_buffer, filename)), + INTEGERP (modes)) /* Remote files don't cooperate with stat. */ auto_save_mode_bits = (XINT (modes) | 0600) & 0777; } ------------------------------------------------------------ revno: 110530 committer: martin rudalics branch nick: trunk timestamp: Sat 2012-10-13 09:58:53 +0200 message: In debug restore window configuration when debugger-will-be-back is non-nil (Bug#12623). * emacs-lisp/debug.el (debug): When debugger-will-be-back is non-nil, restore window configuration (Bug#12623). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-12 20:11:50 +0000 +++ lisp/ChangeLog 2012-10-13 07:58:53 +0000 @@ -1,3 +1,8 @@ +2012-10-13 Martin Rudalics + + * emacs-lisp/debug.el (debug): When debugger-will-be-back is + non-nil, restore window configuration (Bug#12623). + 2012-10-12 Stefan Monnier * help-fns.el (describe-variable, describe-function-1): === modified file 'lisp/emacs-lisp/debug.el' --- lisp/emacs-lisp/debug.el 2012-10-03 07:18:50 +0000 +++ lisp/emacs-lisp/debug.el 2012-10-13 07:58:53 +0000 @@ -213,7 +213,8 @@ (or enable-recursive-minibuffers (> (minibuffer-depth) 0))) (standard-input t) (standard-output t) inhibit-redisplay - (cursor-in-echo-area nil)) + (cursor-in-echo-area nil) + (window-configuration (current-window-configuration))) (unwind-protect (save-excursion (when (eq (car debugger-args) 'debug) @@ -266,16 +267,19 @@ ;; Make sure we unbind buffer-read-only in the right buffer. (save-excursion (recursive-edit)))) - (when (and (not debugger-will-be-back) - (window-live-p debugger-window) - (eq (window-buffer debugger-window) debugger-buffer)) - ;; Record height of debugger window. - (setq debugger-previous-window-height - (window-total-size debugger-window)) - ;; Unshow debugger-buffer. - (quit-restore-window debugger-window debugger-bury-or-kill) - ;; Restore current buffer (Bug#12502). - (set-buffer debugger-old-buffer)) + (if debugger-will-be-back + ;; Restore previous window configuration (Bug#12623). + (set-window-configuration window-configuration) + (when (and (window-live-p debugger-window) + (eq (window-buffer debugger-window) debugger-buffer)) + (progn + ;; Record height of debugger window. + (setq debugger-previous-window-height + (window-total-size debugger-window)) + ;; Unshow debugger-buffer. + (quit-restore-window debugger-window debugger-bury-or-kill) + ;; Restore current buffer (Bug#12502). + (set-buffer debugger-old-buffer)))) ;; Restore previous state of debugger-buffer in case we were ;; in a recursive invocation of the debugger, otherwise just ;; erase the buffer and put it into fundamental mode. ------------------------------------------------------------ revno: 110529 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-10-13 09:18:52 +0800 message: Document 24.3 ImageMagick changes. * doc/emacs/files.texi (File Conveniences): ImageMagick enabled by default. * doc/lispref/display.texi (ImageMagick Images): ImageMagick enabled by default. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-10-10 02:52:55 +0000 +++ doc/emacs/ChangeLog 2012-10-13 01:18:52 +0000 @@ -1,3 +1,7 @@ +2012-10-13 Chong Yidong + + * files.texi (File Conveniences): ImageMagick enabled by default. + 2012-10-10 Dani Moncayo * basic.texi (Arguments): Fix typos. === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2012-09-23 10:46:50 +0000 +++ doc/emacs/files.texi 2012-10-13 01:18:52 +0000 @@ -1931,15 +1931,22 @@ files. @cindex ImageMagick support - If your Emacs was compiled with ImageMagick support, it is possible -to view a much wider variety of image types in Image mode, by -rendering the images via ImageMagick. However, this feature is -currently disabled by default. To enable it, add the following line -to your init file: - -@example -(imagemagick-register-types) -@end example +@vindex imagemagick-enabled-types +@vindex imagemagick-types-inhibit + If Emacs was compiled with support for the ImageMagick library, it +can use ImageMagick to render a wide variety of images. The variable +@code{imagemagick-enabled-types} lists the image types that Emacs may +render using ImageMagick; each element in the list should be an +internal ImageMagick name for an image type, as a symbol or an +equivalent string (e.g.@: @code{BMP} for @file{.bmp} images). To +enable ImageMagick for all possible image types, change +@code{imagemagick-enabled-types} to @code{t}. The variable +@code{imagemagick-types-inhibit} lists the image types which should +never be rendered using ImageMagick, regardless of the value of +@code{imagemagick-enabled-types} (the default list includes types like +@code{C} and @code{HTML}, which ImageMagick can render as an ``image'' +but Emacs should not). To disable ImageMagick entirely, change +@code{imagemagick-types-inhibit} to @code{t}. @findex thumbs-mode @findex mode, thumbs === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-10-10 02:52:55 +0000 +++ doc/lispref/ChangeLog 2012-10-13 01:18:52 +0000 @@ -1,3 +1,7 @@ +2012-10-13 Chong Yidong + + * display.texi (ImageMagick Images): ImageMagick enabled by default. + 2012-10-05 Chong Yidong * minibuf.texi (Basic Completion): Clarify list form of completion === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2012-09-18 05:14:42 +0000 +++ doc/lispref/display.texi 2012-10-13 01:18:52 +0000 @@ -4579,57 +4579,35 @@ @cindex images, support for more formats If you build Emacs with ImageMagick support, you can use the -ImageMagick library to load many image formats. The image type symbol +ImageMagick library to load many image formats (@pxref{File +Conveniences,,, emacs, The GNU Emacs Manual}). The image type symbol for images loaded via ImageMagick is @code{imagemagick}, regardless of the actual underlying image format. @defun imagemagick-types This function returns a list of image file extensions supported by the -current ImageMagick installation. -@end defun - - By default, Emacs does not use ImageMagick to display images in -Image mode, e.g.@: when visiting such files with @kbd{C-x C-f}. This -feature is enabled by calling @code{imagemagick-register-types}. - -@defun imagemagick-register-types -This function enables using Image mode to visit image files supported -by ImageMagick. @xref{File Conveniences,,, emacs, The GNU Emacs -Manual}. It also causes @code{create-image} and other helper -functions to associate such file names with the @code{imagemagick} -image type (@pxref{Defining Images}). - -All image file extensions supported by ImageMagick are registered, -except those specified in @code{imagemagick-types-inhibit}. If Emacs -was not compiled with ImageMagick support, this function does nothing. -@end defun +current ImageMagick installation. Each list element is a symbol +representing an internal ImageMagick name for an image type, such as +@code{BMP} for @file{.bmp} images. +@end defun + +@defopt imagemagick-enabled-types +The value of this variable is a list of ImageMagick image types which +Emacs may attempt to render using ImageMagick. Each list element +should be one of the symbols in the list returned by +@code{imagemagick-types}, or an equivalent string. Alternatively, a +value of @code{t} enables ImageMagick for all possible image types. +Regardless of the value of this variable, +@code{imagemagick-types-inhibit} (see below) takes precedence. +@end defopt @defopt imagemagick-types-inhibit -This variable specifies a list of image types that should @emph{not} -be registered by @code{imagemagick-register-types}. Each entry in -this list should be one of the symbols returned by -@code{imagemagick-types}. The default value lists several file types -that are considered ``images'' by ImageMagick, but which should not be -considered as images by Emacs, including C files and HTML files. +The value of this variable lists the ImageMagick image types which +should never be rendered using ImageMagick, regardless of the value of +@code{imagemagick-enabled-types}. A value of @code{t} disables +ImageMagick entirely. @end defopt -@ignore -@c I don't know what this means. I suspect it means eg loading jpg -@c images via libjpeg or ImageMagick. But it doesn't work. -@c If you don't have libjpeg support compiled in, you cannot -@c view jpeg images, even if you have imagemagick support: -@c http://debbugs.gnu.org/9045 -@c And if you have both compiled in, then you always get -@c the libjpeg version: -@c http://debbugs.gnu.org/10746 -There may be overlap between image loaders in your Emacs installation, -and you may prefer to use a different one for a given image type -(which loader will be used in practice depends on the priority of the -loaders). -For example, if you never want to use the ImageMagick loader to view -JPEG files, add @code{JPG} to this list. -@end ignore - Images loaded with ImageMagick support the following additional image descriptor properties: === modified file 'etc/NEWS' --- etc/NEWS 2012-10-08 16:20:59 +0000 +++ etc/NEWS 2012-10-13 01:18:52 +0000 @@ -137,16 +137,16 @@ explicitly to install ImageMagick image types; that function is called automatically at startup, or when customizing a relevant imagemagick- option. - ++++ *** Setting `imagemagick-types-inhibit' to t now disables the use of ImageMagick to view images. You must call imagemagick-register-types afterwards if you do not use customize to change this. - ++++ *** The new variable `imagemagick-enabled-types' also affects which ImageMagick types are treated as images. The function `imagemagick-filter-types' returns the list of types that will be treated as images. - +--- *** Images displayed via ImageMagick now support transparency and the :background image spec property. ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.