Now on revision 109255. ------------------------------------------------------------ revno: 109255 fixes bug(s): http://debbugs.gnu.org/10056 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-07-29 12:45:48 +0800 message: Deactivate the mark on more copy operations, and indicate the copied region. * lisp/simple.el (indicate-copied-region): New function. (kill-ring-save): Split off from here. * lisp/rect.el (copy-rectangle-as-kill): Call indicate-copied-region. (kill-rectangle): Set deactivate-mark to t on read-only error. * lisp/register.el (copy-to-register, copy-rectangle-to-register): Deactivate the mark, and use indicate-copied-region. (append-to-register, prepend-to-register): Call diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-29 00:03:26 +0000 +++ lisp/ChangeLog 2012-07-29 04:45:48 +0000 @@ -1,3 +1,15 @@ +2012-07-29 Chong Yidong + + * simple.el (indicate-copied-region): New function. + (kill-ring-save): Split off from here. + + * rect.el (copy-rectangle-as-kill): Call indicate-copied-region. + (kill-rectangle): Set deactivate-mark to t on read-only error. + + * register.el (copy-to-register, copy-rectangle-to-register): + Deactivate the mark, and use indicate-copied-region (Bug#10056). + (append-to-register, prepend-to-register): Call + 2012-07-29 Juri Linkov * simple.el (async-shell-command-buffer): New defcustom. === modified file 'lisp/rect.el' --- lisp/rect.el 2012-07-14 02:19:07 +0000 +++ lisp/rect.el 2012-07-29 04:45:48 +0000 @@ -219,6 +219,7 @@ (condition-case nil (setq killed-rectangle (delete-extract-rectangle start end fill)) ((buffer-read-only text-read-only) + (setq deactivate-mark t) (setq killed-rectangle (extract-rectangle start end)) (if kill-read-only-ok (progn (message "Read only text copied to kill ring") nil) @@ -230,7 +231,9 @@ "Copy the region-rectangle and save it as the last killed one." (interactive "r") (setq killed-rectangle (extract-rectangle start end)) - (setq deactivate-mark t)) + (setq deactivate-mark t) + (if (called-interactively-p 'interactive) + (indicate-copied-region (length (car killed-rectangle))))) ;;;###autoload (defun yank-rectangle () === modified file 'lisp/register.el' --- lisp/register.el 2012-07-14 02:19:07 +0000 +++ lisp/register.el 2012-07-29 04:45:48 +0000 @@ -336,7 +336,11 @@ START and END are buffer positions indicating what to copy." (interactive "cCopy to register: \nr\nP") (set-register register (filter-buffer-substring start end)) - (if delete-flag (delete-region start end))) + (setq deactivate-mark t) + (cond (delete-flag + (delete-region start end)) + ((called-interactively-p 'interactive) + (indicate-copied-region)))) (defun append-to-register (register start end &optional delete-flag) "Append region to text in register REGISTER. @@ -350,7 +354,10 @@ register (cond ((not reg) text) ((stringp reg) (concat reg text)) (t (error "Register does not contain text"))))) - (if delete-flag (delete-region start end))) + (cond (delete-flag + (delete-region start end)) + ((called-interactively-p 'interactive) + (indicate-copied-region)))) (defun prepend-to-register (register start end &optional delete-flag) "Prepend region to text in register REGISTER. @@ -364,7 +371,10 @@ register (cond ((not reg) text) ((stringp reg) (concat text reg)) (t (error "Register does not contain text"))))) - (if delete-flag (delete-region start end))) + (cond (delete-flag + (delete-region start end)) + ((called-interactively-p 'interactive) + (indicate-copied-region)))) (defun copy-rectangle-to-register (register start end &optional delete-flag) "Copy rectangular region into register REGISTER. @@ -374,10 +384,15 @@ Called from a program, takes four args: REGISTER, START, END and DELETE-FLAG. START and END are buffer positions giving two corners of rectangle." (interactive "cCopy rectangle to register: \nr\nP") - (set-register register - (if delete-flag - (delete-extract-rectangle start end) - (extract-rectangle start end)))) + (let ((rectangle (if delete-flag + (delete-extract-rectangle start end) + (extract-rectangle start end)))) + (set-register register rectangle) + (when (and (null delete-flag) + (called-interactively-p 'interactive)) + (setq deactivate-mark t) + (indicate-copied-region (length (car rectangle)))))) + (provide 'register) ;;; register.el ends here === modified file 'lisp/simple.el' --- lisp/simple.el 2012-07-29 00:03:26 +0000 +++ lisp/simple.el 2012-07-29 04:45:48 +0000 @@ -3408,38 +3408,50 @@ visual feedback indicating the extent of the region being copied." (interactive "r") (copy-region-as-kill beg end) - ;; This use of called-interactively-p is correct - ;; because the code it controls just gives the user visual feedback. + ;; This use of called-interactively-p is correct because the code it + ;; controls just gives the user visual feedback. (if (called-interactively-p 'interactive) - (let ((other-end (if (= (point) beg) end beg)) - (opoint (point)) - ;; Inhibit quitting so we can make a quit here - ;; look like a C-g typed as a command. - (inhibit-quit t)) - (if (pos-visible-in-window-p other-end (selected-window)) - ;; Swap point-and-mark quickly so as to show the region that - ;; was selected. Don't do it if the region is highlighted. - (unless (and (region-active-p) - (face-background 'region)) - ;; Swap point and mark. - (set-marker (mark-marker) (point) (current-buffer)) - (goto-char other-end) - (sit-for blink-matching-delay) - ;; Swap back. - (set-marker (mark-marker) other-end (current-buffer)) - (goto-char opoint) - ;; If user quit, deactivate the mark - ;; as C-g would as a command. - (and quit-flag mark-active - (deactivate-mark))) - (let* ((killed-text (current-kill 0)) - (message-len (min (length killed-text) 40))) - (if (= (point) beg) - ;; Don't say "killed"; that is misleading. - (message "Saved text until \"%s\"" - (substring killed-text (- message-len))) - (message "Saved text from \"%s\"" - (substring killed-text 0 message-len)))))))) + (indicate-copied-region))) + +(defun indicate-copied-region (&optional message-len) + "Indicate that the region text has been copied interactively. +If the mark is visible in the selected window, blink the cursor +between point and mark if there is currently no active region +highlighting. + +If the mark lies outside the selected window, display an +informative message containing a sample of the copied text. The +optional argument MESSAGE-LEN, if non-nil, specifies the length +of this sample text; it defaults to 40." + (let ((mark (mark t)) + (point (point)) + ;; Inhibit quitting so we can make a quit here + ;; look like a C-g typed as a command. + (inhibit-quit t)) + (if (pos-visible-in-window-p mark (selected-window)) + ;; Swap point-and-mark quickly so as to show the region that + ;; was selected. Don't do it if the region is highlighted. + (unless (and (region-active-p) + (face-background 'region)) + ;; Swap point and mark. + (set-marker (mark-marker) (point) (current-buffer)) + (goto-char mark) + (sit-for blink-matching-delay) + ;; Swap back. + (set-marker (mark-marker) mark (current-buffer)) + (goto-char point) + ;; If user quit, deactivate the mark + ;; as C-g would as a command. + (and quit-flag mark-active + (deactivate-mark))) + (let ((len (min (abs (- mark point)) + (or message-len 40)))) + (if (< point mark) + ;; Don't say "killed"; that is misleading. + (message "Saved text until \"%s\"" + (buffer-substring-no-properties (- mark len) mark)) + (message "Saved text from \"%s\"" + (buffer-substring-no-properties mark (+ mark len)))))))) (defun append-next-kill (&optional interactive) "Cause following command, if it kills, to append to previous kill. ------------------------------------------------------------ revno: 109254 committer: Juri Linkov branch nick: trunk timestamp: Sun 2012-07-29 03:12:13 +0300 message: * test/automated/occur-tests.el (occur-test-case): Use predefined buffer name " *test-occur*" instead of a random buffer name. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2012-07-20 11:10:25 +0000 +++ test/ChangeLog 2012-07-29 00:12:13 +0000 @@ -1,3 +1,8 @@ +2012-07-29 Juri Linkov + + * automated/occur-tests.el (occur-test-case): Use predefined + buffer name " *test-occur*" instead of a random buffer name. + 2012-07-20 Dmitry Gutov * automated/ruby-mode-tests.el: New file with one test. === modified file 'test/automated/occur-tests.el' --- test/automated/occur-tests.el 2012-01-05 09:46:05 +0000 +++ test/automated/occur-tests.el 2012-07-29 00:12:13 +0000 @@ -35,7 +35,7 @@ xex fx " "\ -5 matches for \"x\" in buffer: *temp*<2> +5 matches for \"x\" in buffer: *test-occur* 1:xa 3:cx 4:xd @@ -52,7 +52,7 @@ a a " "\ -2 matches for \"a^Ja\" in buffer: *temp*<2> +2 matches for \"a^Ja\" in buffer: *test-occur* 1:a :a 3:a @@ -68,7 +68,7 @@ a b " "\ -2 matches for \"a^Jb\" in buffer: *temp*<2> +2 matches for \"a^Jb\" in buffer: *test-occur* 1:a :b 4:a @@ -82,7 +82,7 @@ a " "\ -2 matches for \"a^J\" in buffer: *temp*<2> +2 matches for \"a^J\" in buffer: *test-occur* 1:a : 4:a @@ -97,7 +97,7 @@ ex fx " "\ -2 matches for \"x^J.x^J\" in buffer: *temp*<2> +2 matches for \"x^J.x^J\" in buffer: *test-occur* 1:ax :bx :c @@ -116,7 +116,7 @@ g hx " "\ -3 matches for \"x\" in buffer: *temp*<2> +3 matches for \"x\" in buffer: *test-occur* 1:ax :b ------- @@ -136,7 +136,7 @@ ex f " "\ -2 matches for \"x\" in buffer: *temp*<2> +2 matches for \"x\" in buffer: *test-occur* :a 2:bx :c @@ -159,7 +159,7 @@ j kx " "\ -5 matches for \"x\" in buffer: *temp*<2> +5 matches for \"x\" in buffer: *test-occur* 1:ax 2:bx :c @@ -184,7 +184,7 @@ h i " "\ -2 matches for \"x\" in buffer: *temp*<2> +2 matches for \"x\" in buffer: *test-occur* :a :b 3:cx @@ -207,7 +207,7 @@ h " "\ -2 matches for \"x\" in buffer: *temp*<2> +2 matches for \"x\" in buffer: *test-occur* : :b 3:cx @@ -232,7 +232,7 @@ jx kx " "\ -3 matches for \"x^J.x\" in buffer: *temp*<2> +3 matches for \"x^J.x\" in buffer: *test-occur* 1:ax :bx :c @@ -256,7 +256,7 @@ gx hx " "\ -2 matches for \"x^J.x\" in buffer: *temp*<2> +2 matches for \"x^J.x\" in buffer: *test-occur* 1:ax :bx :c @@ -279,7 +279,7 @@ h ix " "\ -3 matches for \"x\" in buffer: *temp*<2> +3 matches for \"x\" in buffer: *test-occur* :a 2:bx ------- @@ -302,7 +302,7 @@ gx h " "\ -3 matches for \"x\" in buffer: *temp*<2> +3 matches for \"x\" in buffer: *test-occur* :a 2:bx :c @@ -321,14 +321,19 @@ (let ((regexp (nth 0 test)) (nlines (nth 1 test)) (input-buffer-string (nth 2 test)) - (output-buffer-string (nth 3 test))) - (save-window-excursion - (with-temp-buffer - (insert input-buffer-string) - (occur regexp nlines) - (equal output-buffer-string - (with-current-buffer "*Occur*" - (buffer-string))))))) + (output-buffer-string (nth 3 test)) + (temp-buffer (get-buffer-create " *test-occur*"))) + (unwind-protect + (save-window-excursion + (with-current-buffer temp-buffer + (erase-buffer) + (insert input-buffer-string) + (occur regexp nlines) + (equal output-buffer-string + (with-current-buffer "*Occur*" + (buffer-string))))) + (and (buffer-name temp-buffer) + (kill-buffer temp-buffer))))) (ert-deftest occur-tests () "Test the functionality of `occur'. ------------------------------------------------------------ revno: 109253 fixes bug(s): http://debbugs.gnu.org/4719 committer: Juri Linkov branch nick: trunk timestamp: Sun 2012-07-29 03:03:26 +0300 message: * lisp/simple.el (async-shell-command-buffer): New defcustom. (shell-command): Use it. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-07-28 16:35:52 +0000 +++ etc/NEWS 2012-07-29 00:03:26 +0000 @@ -360,6 +360,12 @@ if the command ends in `;' (when operating on multiple files). Otherwise, it executes the command on each file in parallel. +** Shell + +*** New option `async-shell-command-buffer' specifies what buffer to use +for a new asynchronous shell command when the default output buffer +`*Async Shell Command*' is already taken by another running command. + ** FFAP *** The option `ffap-url-unwrap-remote' can now be a list of strings, === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-28 16:57:57 +0000 +++ lisp/ChangeLog 2012-07-29 00:03:26 +0000 @@ -1,3 +1,8 @@ +2012-07-29 Juri Linkov + + * simple.el (async-shell-command-buffer): New defcustom. + (shell-command): Use it. (Bug#4719) + 2012-07-28 Eli Zaretskii * international/mule-cmds.el (set-locale-environment): In a === modified file 'lisp/simple.el' --- lisp/simple.el 2012-07-28 10:38:55 +0000 +++ lisp/simple.el 2012-07-29 00:03:26 +0000 @@ -2264,6 +2264,33 @@ (or hist 'shell-command-history) args))) +(defcustom async-shell-command-buffer 'confirm-new-buffer + "What to do when the output buffer is used by another shell command. +This option specifies how to resolve the conflict where a new command +wants to direct its output to the buffer `*Async Shell Command*', +but this buffer is already taken by another running shell command. + +The value `confirm-kill-process' is used to ask for confirmation before +killing the already running process and running a new process +in the same buffer, `confirm-new-buffer' for confirmation before running +the command in a new buffer with a name other than the default buffer name, +`new-buffer' for doing the same without confirmation, +`confirm-rename-buffer' for confirmation before renaming the existing +output buffer and running a new command in the default buffer, +`rename-buffer' for doing the same without confirmation." + :type '(choice (const :tag "Confirm killing of running command" + confirm-kill-process) + (const :tag "Confirm creation of a new buffer" + confirm-new-buffer) + (const :tag "Create a new buffer" + new-buffer) + (const :tag "Confirm renaming of existing buffer" + confirm-rename-buffer) + (const :tag "Rename the existing buffer" + rename-buffer)) + :group 'shell + :version "24.2") + (defun async-shell-command (command &optional output-buffer error-buffer) "Execute string COMMAND asynchronously in background. @@ -2418,12 +2445,40 @@ proc) ;; Remove the ampersand. (setq command (substring command 0 (match-beginning 0))) - ;; If will kill a process, query first. + ;; Ask the user what to do with already running process. (setq proc (get-buffer-process buffer)) - (if proc - (if (yes-or-no-p "A command is running. Kill it? ") + (when proc + (cond + ((eq async-shell-command-buffer 'confirm-kill-process) + ;; If will kill a process, query first. + (if (yes-or-no-p "A command is running in the default buffer. Kill it? ") (kill-process proc) (error "Shell command in progress"))) + ((eq async-shell-command-buffer 'confirm-new-buffer) + ;; If will create a new buffer, query first. + (if (yes-or-no-p "A command is running in the default buffer. Use a new buffer? ") + (setq buffer (generate-new-buffer + (or output-buffer "*Async Shell Command*"))) + (error "Shell command in progress"))) + ((eq async-shell-command-buffer 'new-buffer) + ;; It will create a new buffer. + (setq buffer (generate-new-buffer + (or output-buffer "*Async Shell Command*")))) + ((eq async-shell-command-buffer 'confirm-rename-buffer) + ;; If will rename the buffer, query first. + (if (yes-or-no-p "A command is running in the default buffer. Rename it? ") + (progn + (with-current-buffer buffer + (rename-uniquely)) + (setq buffer (get-buffer-create + (or output-buffer "*Async Shell Command*")))) + (error "Shell command in progress"))) + ((eq async-shell-command-buffer 'rename-buffer) + ;; It will rename the buffer. + (with-current-buffer buffer + (rename-uniquely)) + (setq buffer (get-buffer-create + (or output-buffer "*Async Shell Command*")))))) (with-current-buffer buffer (setq buffer-read-only nil) ;; Setting buffer-read-only to nil doesn't suffice ------------------------------------------------------------ revno: 109252 fixes bug(s): http://debbugs.gnu.org/9772 http://debbugs.gnu.org/9960 committer: Paul Eggert branch nick: trunk timestamp: Sat 2012-07-28 16:05:32 -0700 message: Use Gnulib stdalign and environ modules (Bug#9772, Bug#9960). * .bzrignore: Add lib/stdalign.h. * config.bat: Do not set NO_DECL_ALIGN; no longer needed. Copy lib/stdalign.in.h to lib/stdalign.in-h as needed. * configure.ac (HAVE_ATTRIBUTE_ALIGNED): Remove the code that fiddles with this, as gnulib now does this for us. * admin/merge-gnulib: Add environ, stdalign. * m4/environ.m4: New file, from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/stdalign.in.h, m4/stdalign.m4: New files, from gnulib. * sed2v2.inp (HAVE_ATTRIBUTE_ALIGNED): Remove edit. * sedlibmk.inp (STDALIGN_H, @GL_GENERATE_STDALIGN_H_TRUE@) (GL_GENERATE_STDALIGN_H_FALSE): New edits. * nt/config.nt (HAVE_ATTRIBUTE_ALIGNED): Remove. * src/alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc): Simplify by using alignof. (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values. * src/lisp.h: Include . (GCALIGNMENT): New macro and constant. (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT). (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN. (stdalign): New macro, if not already defined. diff: === modified file '.bzrignore' --- .bzrignore 2012-06-06 01:38:04 +0000 +++ .bzrignore 2012-07-28 23:05:32 +0000 @@ -86,6 +86,7 @@ lib/c++defs.h lib/getopt.h lib/inttypes.h +lib/stdalign.h lib/stdbool.h lib/stdio.h lib/stdint.h === modified file 'ChangeLog' --- ChangeLog 2012-07-17 07:30:25 +0000 +++ ChangeLog 2012-07-28 23:05:32 +0000 @@ -1,3 +1,18 @@ +2012-07-28 Paul Eggert + + Use Gnulib environ module (Bug#9772). + * m4/environ.m4: New file, from gnulib. + * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. + + Use Gnulib stdalign module (Bug#9772, Bug#9960). + This should improve portability of macros like alignof and DECL_ALIGN. + * lib/stdalign.in.h, m4/stdalign.m4: New files, from gnulib. + * .bzrignore: Add lib/stdalign.h. + * config.bat: Do not set NO_DECL_ALIGN; no longer needed. + Copy lib/stdalign.in.h to lib/stdalign.in-h as needed. + * configure.ac (HAVE_ATTRIBUTE_ALIGNED): Remove the code that + fiddles with this, as gnulib now does this for us. + 2012-07-17 Dmitry Antipov Fix toolkit configuration report. === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-07-20 07:29:04 +0000 +++ admin/ChangeLog 2012-07-28 23:05:32 +0000 @@ -1,3 +1,8 @@ +2012-07-28 Paul Eggert + + Use Gnulib environ and stdalign modules (Bug#9772, Bug#9960). + * merge-gnulib: Add environ, stdalign. + 2012-07-20 Dmitry Antipov * coccinelle/unibyte_string.cocci: Semantic patch to convert from === modified file 'admin/merge-gnulib' --- admin/merge-gnulib 2012-07-06 21:07:46 +0000 +++ admin/merge-gnulib 2012-07-28 23:05:32 +0000 @@ -28,11 +28,12 @@ GNULIB_MODULES=' alloca-opt c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 - dtoastr dtotimespec dup2 + dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink - socklen stat-time stdarg stdio strftime strtoimax strtoumax symlink sys_stat + socklen stat-time stdalign stdarg stdio + strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings ' === modified file 'config.bat' --- config.bat 2012-05-27 13:42:13 +0000 +++ config.bat 2012-07-28 23:05:32 +0000 @@ -161,22 +161,6 @@ if exist ..\autogen\config.in sed -f ../msdos/sed2x.inp < ..\autogen\config.in > config.tmp :src4 sed -f ../msdos/sed2v2.inp config.h2 -Rem See if DECL_ALIGN can be supported with this GCC -rm -f junk.c junk.o junk junk.exe -echo struct { int i; char *p; } __attribute__((__aligned__(8))) foo; >junk.c -rem Two percent signs because it is a special character for COMMAND.COM/CMD -rem Filter thru Sed because "&" is special for CMD.EXE -echo int main(void) { return (unsigned long)"&"foo %% 8; } | sed "s/.&./\&/" >>junk.c -gcc -o junk junk.c -if not exist junk.exe coff2exe junk -junk -If Not ErrorLevel 1 Goto alignOk -Echo WARNING: Your GCC does not support 8-byte aligned variables. -Echo WARNING: Therefore Emacs cannot support buffers larger than 128MB. -rem The following line disables DECL_ALIGN which in turn disables USE_LSB_TAG -rem For details see lisp.h where it defines USE_LSB_TAG -echo #define NO_DECL_ALIGN >>config.h2 -:alignOk Rem See if they have libxml2 later than v2.2.0 installed Echo Checking whether libxml2 v2.2.1 or later is installed ... rm -f junk.c junk.o junk junk.exe @@ -281,6 +265,7 @@ If Exist build-aux\snippet\c++defs.h update build-aux/snippet/c++defs.h build-aux/snippet/cxxdefs.h If Exist alloca.in.h update alloca.in.h alloca.in-h If Exist getopt.in.h update getopt.in.h getopt.in-h +If Exist stdalign.in.h update stdalign.in.h stdalign.in-h If Exist stdbool.in.h update stdbool.in.h stdbool.in-h If Exist signal.in.h update signal.in.h signal.in-h If Exist stdalign.in.h update stdalign.in.h stdalign.in-h @@ -346,4 +331,3 @@ set djgpp_ver= set sys_malloc= set libxml= - === modified file 'configure.ac' --- configure.ac 2012-07-17 07:30:25 +0000 +++ configure.ac 2012-07-28 23:05:32 +0000 @@ -1298,19 +1298,6 @@ dnl Check for endianness. dnl AC_C_BIGENDIAN is done by gnulib. -AC_CACHE_CHECK([for __attribute__ ((__aligned__ (expr)))], - [emacs_cv_attribute_aligned], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[char __attribute__ ((__aligned__ (1 << 3))) c;]], - [[]])], - [emacs_cv_attribute_aligned=yes], - [emacs_cv_attribute_aligned=no])]) -if test $emacs_cv_attribute_aligned = yes; then - AC_DEFINE([HAVE_ATTRIBUTE_ALIGNED], 1, - [Define to 1 if GCC-style __attribute__ ((__aligned__ (expr))) works.]) -fi - dnl check for Make feature dnl AC_PROG_MAKE_SET is done by Automake. === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2012-07-06 21:07:46 +0000 +++ lib/gnulib.mk 2012-07-28 23:05:32 +0000 @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdarg stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=errno --avoid=fcntl --avoid=fcntl-h --avoid=fstat --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-strcase careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ filemode getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings mktime pselect pthread_sigmask readlink socklen stat-time stdalign stdarg stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timespec-add timespec-sub utimens warnings MOSTLYCLEANFILES += core *.stackdump === added file 'm4/environ.m4' --- m4/environ.m4 1970-01-01 00:00:00 +0000 +++ m4/environ.m4 2012-07-28 23:05:32 +0000 @@ -0,0 +1,47 @@ +# environ.m4 serial 6 +dnl Copyright (C) 2001-2004, 2006-2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN_ONCE([gl_ENVIRON], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + dnl Persuade glibc to declare environ. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + gt_CHECK_VAR_DECL( + [#if HAVE_UNISTD_H + #include + #endif + /* mingw, BeOS, Haiku declare environ in , not in . */ + #include + ], + [environ]) + if test $gt_cv_var_environ_declaration != yes; then + HAVE_DECL_ENVIRON=0 + fi +]) + +# Check if a variable is properly declared. +# gt_CHECK_VAR_DECL(includes,variable) +AC_DEFUN([gt_CHECK_VAR_DECL], +[ + define([gt_cv_var], [gt_cv_var_]$2[_declaration]) + AC_MSG_CHECKING([if $2 is properly declared]) + AC_CACHE_VAL([gt_cv_var], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[$1 + extern struct { int foo; } $2;]], + [[$2.foo = 1;]])], + [gt_cv_var=no], + [gt_cv_var=yes])]) + AC_MSG_RESULT([$gt_cv_var]) + if test $gt_cv_var = yes; then + AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1, + [Define if you have the declaration of $2.]) + fi + undefine([gt_cv_var]) +]) === modified file 'm4/gnulib-comp.m4' --- m4/gnulib-comp.m4 2012-07-09 08:34:39 +0000 +++ m4/gnulib-comp.m4 2012-07-28 23:05:32 +0000 @@ -52,6 +52,7 @@ # Code from module dtoastr: # Code from module dtotimespec: # Code from module dup2: + # Code from module environ: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module filemode: @@ -148,6 +149,8 @@ gl_PREREQ_DUP2 fi gl_UNISTD_MODULE_INDICATOR([dup2]) +gl_ENVIRON +gl_UNISTD_MODULE_INDICATOR([environ]) gl_FILEMODE gl_GETLOADAVG if test $HAVE_GETLOADAVG = 0; then @@ -598,6 +601,7 @@ m4/c-strtod.m4 m4/clock_time.m4 m4/dup2.m4 + m4/environ.m4 m4/extensions.m4 m4/filemode.m4 m4/getloadavg.m4 === modified file 'msdos/ChangeLog' --- msdos/ChangeLog 2012-07-14 10:03:30 +0000 +++ msdos/ChangeLog 2012-07-28 23:05:32 +0000 @@ -1,3 +1,10 @@ +2012-07-28 Paul Eggert + + Use Gnulib stdalign module (Bug#9772, Bug#9960). + * sed2v2.inp (HAVE_ATTRIBUTE_ALIGNED): Remove edit. + * sedlibmk.inp (STDALIGN_H, @GL_GENERATE_STDALIGN_H_TRUE@) + (GL_GENERATE_STDALIGN_H_FALSE): New edits. + 2012-07-14 Eli Zaretskii * sed1v2.inp: In the recipe for $(leimdir)/leim-list.el, edit the === modified file 'msdos/sed2v2.inp' --- msdos/sed2v2.inp 2012-07-14 10:03:30 +0000 +++ msdos/sed2v2.inp 2012-07-28 23:05:32 +0000 @@ -35,7 +35,6 @@ /^#undef HAVE_FREXP *$/s/^.*$/#define HAVE_FREXP 1/ /^#undef HAVE_FMOD *$/s/^.*$/#define HAVE_FMOD 1/ /^#undef HAVE_RINT *$/s/^.*$/#define HAVE_RINT 1/ -/^#undef HAVE_ATTRIBUTE_ALIGNED *$/s/^.*$/#define HAVE_ATTRIBUTE_ALIGNED 1/ /^#undef HAVE_C99_STRTOLD *$/s/^.*$/#define HAVE_C99_STRTOLD 1/ /^#undef HAVE_CBRT *$/s/^.*$/#define HAVE_CBRT 1/ /^#undef HAVE_DIFFTIME *$/s/^.*$/#define HAVE_DIFFTIME 1/ === modified file 'msdos/sedlibmk.inp' --- msdos/sedlibmk.inp 2012-07-14 10:03:30 +0000 +++ msdos/sedlibmk.inp 2012-07-28 23:05:32 +0000 @@ -647,6 +647,8 @@ s/^@GL_GENERATE_ALLOCA_H_FALSE@/\#/ s/^@GL_GENERATE_STDBOOL_H_TRUE@/\#/ s/^@GL_GENERATE_STDBOOL_H_FALSE@// +s/^@GL_GENERATE_STDALIGN_H_TRUE@// +s/^@GL_GENERATE_STDALIGN_H_FALSE@/\#/ s/^@GL_GENERATE_STDARG_H_TRUE@/\#/ s/^@GL_GENERATE_STDARG_H_FALSE@/\#/ s/^@GL_GENERATE_STDDEF_H_TRUE@/\#/ === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-07-14 02:26:31 +0000 +++ nt/ChangeLog 2012-07-28 23:05:32 +0000 @@ -1,3 +1,8 @@ +2012-07-28 Paul Eggert + + Use Gnulib stdalign module (Bug#9772, Bug#9960). + * config.nt (HAVE_ATTRIBUTE_ALIGNED): Remove. + 2012-07-14 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/config.nt' --- nt/config.nt 2012-07-14 02:26:31 +0000 +++ nt/config.nt 2012-07-28 23:05:32 +0000 @@ -227,9 +227,6 @@ /* Define to 1 if ALSA is available. */ #undef HAVE_ALSA -/* Define to 1 if GCC-style __attribute__ ((__aligned__ (expr))) works. */ -#undef HAVE_ATTRIBUTE_ALIGNED - /* Define to 1 if strtold conforms to C99. */ #undef HAVE_C99_STRTOLD === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-28 16:57:57 +0000 +++ src/ChangeLog 2012-07-28 23:05:32 +0000 @@ -1,3 +1,15 @@ +2012-07-28 Paul Eggert + + Use Gnulib stdalign module (Bug#9772, Bug#9960). + * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc): + Simplify by using alignof. + (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values. + * lisp.h: Include . + (GCALIGNMENT): New macro and constant. + (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT). + (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN. + (stdalign): New macro, if not already defined. + 2012-07-28 Eli Zaretskii Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055) === modified file 'src/alloc.c' --- src/alloc.c 2012-07-27 10:29:26 +0000 +++ src/alloc.c 2012-07-28 23:05:32 +0000 @@ -533,12 +533,7 @@ hold a size_t value and (2) the header size is a multiple of the alignment that Emacs needs for C types and for USE_LSB_TAG. */ #define XMALLOC_BASE_ALIGNMENT \ - offsetof ( \ - struct { \ - union { long double d; intmax_t i; void *p; } u; \ - char c; \ - }, \ - c) + alignof (union { long double d; intmax_t i; void *p; }) #if USE_LSB_TAG # define XMALLOC_HEADER_ALIGNMENT \ @@ -4652,10 +4647,10 @@ } -/* Alignment of pointer values. Use offsetof, as it sometimes returns +/* Alignment of pointer values. Use alignof, as it sometimes returns a smaller alignment than GCC's __alignof__ and mark_memory might miss objects if __alignof__ were used. */ -#define GC_POINTER_ALIGNMENT offsetof (struct {char a; void *b;}, b) +#define GC_POINTER_ALIGNMENT alignof (void *) /* Define POINTERS_MIGHT_HIDE_IN_OBJECTS to 1 if marking via C pointers does not suffice, which is the typical case. A host where a Lisp_Object is @@ -5103,17 +5098,11 @@ #if USE_LSB_TAG size_t alignment = (1 << GCTYPEBITS); #else - size_t alignment = sizeof (EMACS_INT); + size_t alignment = alignof (EMACS_INT); /* Give Lisp_Floats an extra alignment. */ if (type == Lisp_Float) - { -#if defined __GNUC__ && __GNUC__ >= 2 - alignment = __alignof (struct Lisp_Float); -#else - alignment = sizeof (struct Lisp_Float); -#endif - } + alignment = alignof (struct Lisp_Float); #endif again: === modified file 'src/buffer.c' --- src/buffer.c 2012-07-27 09:24:34 +0000 +++ src/buffer.c 2012-07-28 23:05:32 +0000 @@ -56,7 +56,7 @@ Setting the default value also goes through the alist of buffers and stores into each buffer that does not say it has a local value. */ -DECL_ALIGN (struct buffer, buffer_defaults); +struct buffer alignas (GCALIGNMENT) buffer_defaults; /* A Lisp_Object pointer to the above, used for staticpro */ @@ -83,7 +83,7 @@ /* This structure holds the names of symbols whose values may be buffer-local. It is indexed and accessed in the same way as the above. */ -DECL_ALIGN (struct buffer, buffer_local_symbols); +struct buffer alignas (GCALIGNMENT) buffer_local_symbols; /* A Lisp_Object pointer to the above, used for staticpro */ static Lisp_Object Vbuffer_local_symbols; === modified file 'src/lisp.h' --- src/lisp.h 2012-07-27 09:24:34 +0000 +++ src/lisp.h 2012-07-28 23:05:32 +0000 @@ -20,6 +20,7 @@ #ifndef EMACS_LISP_H #define EMACS_LISP_H +#include #include #include #include @@ -151,10 +152,6 @@ on the few static Lisp_Objects used: all the defsubr as well as the two special buffers buffer_defaults and buffer_local_symbols. */ -/* First, try and define DECL_ALIGN(type,var) which declares a static - variable VAR of type TYPE with the added requirement that it be - TYPEBITS-aligned. */ - enum Lisp_Bits { /* Number of bits in a Lisp_Object tag. This can be used in #if, @@ -163,6 +160,12 @@ #define GCTYPEBITS 3 GCTYPEBITS, + /* 2**GCTYPEBITS. This must also be a macro that expands to a + literal integer constant, for MSVC. */ + GCALIGNMENT = +#define GCALIGNMENT 8 + GCALIGNMENT, + /* Number of bits in a Lisp_Object value, not counting the tag. */ VALBITS = BITS_PER_EMACS_INT - GCTYPEBITS, @@ -173,36 +176,22 @@ FIXNUM_BITS = VALBITS + 1 }; +#if GCALIGNMENT != 1 << GCTYPEBITS +# error "GCALIGNMENT and GCTYPEBITS are inconsistent" +#endif + /* The maximum value that can be stored in a EMACS_INT, assuming all bits other than the type bits contribute to a nonnegative signed value. This can be used in #if, e.g., '#if VAL_MAX < UINTPTR_MAX' below. */ #define VAL_MAX (EMACS_INT_MAX >> (GCTYPEBITS - 1)) -#ifndef NO_DECL_ALIGN -# ifndef DECL_ALIGN -# if HAVE_ATTRIBUTE_ALIGNED -# define DECL_ALIGN(type, var) \ - type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var -# elif defined(_MSC_VER) -# define ALIGN_GCTYPEBITS 8 -# if (1 << GCTYPEBITS) != ALIGN_GCTYPEBITS -# error ALIGN_GCTYPEBITS is wrong! -# endif -# define DECL_ALIGN(type, var) \ - type __declspec(align(ALIGN_GCTYPEBITS)) var -# else - /* What directives do other compilers use? */ -# endif -# endif -#endif - /* Unless otherwise specified, use USE_LSB_TAG on systems where: */ #ifndef USE_LSB_TAG /* 1. We know malloc returns a multiple of 8. */ # if (defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ \ || defined DARWIN_OS || defined __sun) /* 2. We can specify multiple-of-8 alignment on static variables. */ -# ifdef DECL_ALIGN +# ifdef alignas /* 3. Pointers-as-ints exceed VAL_MAX. On hosts where pointers-as-ints do not exceed VAL_MAX, USE_LSB_TAG is: a. unnecessary, because the top bits of an EMACS_INT are unused, and @@ -223,12 +212,11 @@ # define USE_LSB_TAG 0 #endif -/* If we cannot use 8-byte alignment, make DECL_ALIGN a no-op. */ -#ifndef DECL_ALIGN +#ifndef alignas +# define alignas(alignment) /* empty */ # if USE_LSB_TAG -# error "USE_LSB_TAG used without defining DECL_ALIGN" +# error "USE_LSB_TAG requires alignas" # endif -# define DECL_ALIGN(type, var) type var #endif @@ -1882,7 +1870,7 @@ #ifdef _MSC_VER #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ - static DECL_ALIGN (struct Lisp_Subr, sname) = \ + static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ { (PVEC_SUBR << PSEUDOVECTOR_SIZE_BITS) \ | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ { (Lisp_Object (__cdecl *)(void))fnname }, \ @@ -1891,7 +1879,7 @@ #else /* not _MSC_VER */ #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ - static DECL_ALIGN (struct Lisp_Subr, sname) = \ + static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ { PVEC_SUBR << PSEUDOVECTOR_SIZE_BITS, \ { .a ## maxargs = fnname }, \ minargs, maxargs, lname, intspec, 0}; \ ------------------------------------------------------------ revno: 109251 fixes bug(s): http://debbugs.gnu.org/12055 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-07-28 19:57:57 +0300 message: Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055) src/w32inevt.c: Include w32inevt.h. (w32_read_console_input): New inline function, calls either ReadConsoleInputA or ReadConsoleInputW, depending on the value of w32_console_unicode_input. (fill_queue): Call w32_read_console_input instead of ReadConsoleInput. (w32_kbd_patch_key, key_event): Use the codepage returned by GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo. (key_event): use uChar.UnicodeChar only if w32_console_unicode_input is non-zero. src/w32console.c: Include w32heap.h. : New global variable. (initialize_w32_display): Set w32_console_unicode_input to 1 on NT family of Windows, zero otherwise. src/w32inevt.h: Declare w32_console_unicode_input. lisp/international/mule-cmds.el (set-locale-environment): In a console session on MS-Windows, set up keyboard and terminal encoding from the OEM codepage, not the ANSI codepage. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-28 15:12:12 +0000 +++ lisp/ChangeLog 2012-07-28 16:57:57 +0000 @@ -1,3 +1,10 @@ +2012-07-28 Eli Zaretskii + + * international/mule-cmds.el (set-locale-environment): In a + console session on MS-Windows, set up keyboard and terminal + encoding from the OEM codepage, not the ANSI codepage. + (Bug#12055) + 2012-07-28 Chong Yidong * progmodes/gdb-mi.el (gdb-place-breakpoints): Fix the call to === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2012-07-25 23:11:23 +0000 +++ lisp/international/mule-cmds.el 2012-07-28 16:57:57 +0000 @@ -2655,23 +2655,32 @@ ;; On Windows, override locale-coding-system, ;; default-file-name-coding-system, keyboard-coding-system, - ;; terminal-coding-system with system codepage. + ;; terminal-coding-system with the appropriate codepages. (when (boundp 'w32-ansi-code-page) - (let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page)))) - (when (coding-system-p code-page-coding) - (unless frame (setq locale-coding-system code-page-coding)) - (set-keyboard-coding-system code-page-coding frame) - (set-terminal-coding-system code-page-coding frame) - ;; Set default-file-name-coding-system last, so that Emacs - ;; doesn't try to use cpNNNN when it defines keyboard and - ;; terminal encoding. That's because the above two lines - ;; will want to load code-pages.el, where cpNNNN are - ;; defined; if default-file-name-coding-system were set to - ;; cpNNNN while these two lines run, Emacs will want to use - ;; it for encoding the file name it wants to load. And that - ;; will fail, since cpNNNN is not yet usable until - ;; code-pages.el finishes loading. - (setq default-file-name-coding-system code-page-coding)))) + (let ((ansi-code-page-coding (intern (format "cp%d" w32-ansi-code-page))) + (oem-code-page-coding + (intern (format "cp%d" (w32-get-console-codepage)))) + (oem-code-page-output-coding + (intern (format "cp%d" (w32-get-console-output-codepage)))) + ansi-cs-p oem-cs-p oem-o-cs-p) + (setq ansi-cs-p (coding-system-p ansi-code-page-coding)) + (setq oem-cs-p (coding-system-p oem-code-page-coding)) + (setq oem-o-cs-p (coding-system-p oem-code-page-output-coding)) + ;; Set the keyboard and display encoding to either the current + ;; ANSI codepage of the OEM codepage, depending on whether + ;; this is a GUI or a TTY frame. + (when ansi-cs-p + (unless frame (setq locale-coding-system ansi-code-page-coding)) + (when (display-graphic-p frame) + (set-keyboard-coding-system ansi-code-page-coding frame) + (set-terminal-coding-system ansi-code-page-coding frame)) + (setq default-file-name-coding-system ansi-code-page-coding)) + (when oem-cs-p + (unless (display-graphic-p frame) + (set-keyboard-coding-system oem-code-page-coding frame) + (set-terminal-coding-system + (if oem-o-cs-p oem-code-page-output-coding oem-code-page-coding) + frame))))) (when (eq system-type 'darwin) ;; On Darwin, file names are always encoded in utf-8, no matter === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-28 07:59:34 +0000 +++ src/ChangeLog 2012-07-28 16:57:57 +0000 @@ -1,5 +1,23 @@ 2012-07-28 Eli Zaretskii + Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055) + * w32inevt.c: Include w32inevt.h. + (w32_read_console_input): New inline function, calls either + ReadConsoleInputA or ReadConsoleInputW, depending on the value of + w32_console_unicode_input. + (fill_queue): Call w32_read_console_input instead of ReadConsoleInput. + (w32_kbd_patch_key, key_event): Use the codepage returned by + GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo. + (key_event): use uChar.UnicodeChar only if + w32_console_unicode_input is non-zero. + + * w32console.c: Include w32heap.h. + : New global variable. + (initialize_w32_display): Set w32_console_unicode_input to 1 on NT + family of Windows, zero otherwise. + + * w32inevt.h: Declare w32_console_unicode_input. + * xdisp.c (init_iterator): Don't reference tip_frame in a build --without-x. (Bug#11742) === modified file 'src/w32console.c' --- src/w32console.c 2012-06-28 07:50:27 +0000 +++ src/w32console.c 2012-07-28 16:57:57 +0000 @@ -37,6 +37,7 @@ #include "termhooks.h" #include "termchar.h" #include "dispextern.h" +#include "w32heap.h" /* for os_subtype */ #include "w32inevt.h" /* from window.c */ @@ -67,6 +68,7 @@ #endif HANDLE keyboard_handle; +int w32_console_unicode_input; /* Setting this as the ctrl handler prevents emacs from being killed when @@ -786,6 +788,11 @@ info.srWindow.Left); } + if (os_subtype == OS_NT) + w32_console_unicode_input = 1; + else + w32_console_unicode_input = 0; + /* Setup w32_display_info structure for this frame. */ w32_initialize_display_info (build_string ("Console")); === modified file 'src/w32inevt.c' --- src/w32inevt.c 2012-05-26 11:58:19 +0000 +++ src/w32inevt.c 2012-07-28 16:57:57 +0000 @@ -41,6 +41,7 @@ #include "termchar.h" #include "w32heap.h" #include "w32term.h" +#include "w32inevt.h" /* stdin, from w32console.c */ extern HANDLE keyboard_handle; @@ -61,6 +62,15 @@ /* Temporarily store lead byte of DBCS input sequences. */ static char dbcs_lead = 0; +static inline BOOL +w32_read_console_input (HANDLE h, INPUT_RECORD *rec, DWORD recsize, + DWORD *waiting) +{ + return (w32_console_unicode_input + ? ReadConsoleInputW (h, rec, recsize, waiting) + : ReadConsoleInputA (h, rec, recsize, waiting)); +} + static int fill_queue (BOOL block) { @@ -80,8 +90,8 @@ return 0; } - rc = ReadConsoleInput (keyboard_handle, event_queue, EVENT_QUEUE_SIZE, - &events_waiting); + rc = w32_read_console_input (keyboard_handle, event_queue, EVENT_QUEUE_SIZE, + &events_waiting); if (!rc) return -1; queue_ptr = event_queue; @@ -224,7 +234,7 @@ #endif /* On NT, call ToUnicode instead and then convert to the current - locale's default codepage. */ + console input codepage. */ if (os_subtype == OS_NT) { WCHAR buf[128]; @@ -233,14 +243,9 @@ keystate, buf, 128, 0); if (isdead > 0) { - char cp[20]; - int cpId; + int cpId = GetConsoleCP (); event->uChar.UnicodeChar = buf[isdead - 1]; - - GetLocaleInfo (GetThreadLocale (), - LOCALE_IDEFAULTANSICODEPAGE, cp, 20); - cpId = atoi (cp); isdead = WideCharToMultiByte (cpId, 0, buf, isdead, ansi_code, 4, NULL, NULL); } @@ -447,26 +452,34 @@ } else if (event->uChar.AsciiChar > 0) { + /* Pure ASCII characters < 128. */ emacs_ev->kind = ASCII_KEYSTROKE_EVENT; emacs_ev->code = event->uChar.AsciiChar; } - else if (event->uChar.UnicodeChar > 0) + else if (event->uChar.UnicodeChar > 0 + && w32_console_unicode_input) { + /* Unicode codepoint; only valid if we are using Unicode + console input mode. */ emacs_ev->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT; emacs_ev->code = event->uChar.UnicodeChar; } else { - /* Fallback for non-Unicode versions of Windows. */ + /* Fallback handling of non-ASCII characters for non-Unicode + versions of Windows, and for non-Unicode input on NT + family of Windows. Only characters in the current + console codepage are supported by this fallback. */ wchar_t code; char dbcs[2]; - char cp[20]; int cpId; - /* Get the codepage to interpret this key with. */ - GetLocaleInfo (GetThreadLocale (), - LOCALE_IDEFAULTANSICODEPAGE, cp, 20); - cpId = atoi (cp); + /* Get the current console input codepage to interpret this + key with. Note that the system defaults for the OEM + codepage could have been changed by calling SetConsoleCP + or w32-set-console-codepage, so using GetLocaleInfo to + get LOCALE_IDEFAULTCODEPAGE is not TRT here. */ + cpId = GetConsoleCP (); dbcs[0] = dbcs_lead; dbcs[1] = event->uChar.AsciiChar; @@ -501,6 +514,7 @@ } else { + /* Function keys and other non-character keys. */ emacs_ev->kind = NON_ASCII_KEYSTROKE_EVENT; emacs_ev->code = event->wVirtualKeyCode; } === modified file 'src/w32inevt.h' --- src/w32inevt.h 2012-01-19 07:21:25 +0000 +++ src/w32inevt.h 2012-07-28 16:57:57 +0000 @@ -19,6 +19,8 @@ #ifndef EMACS_W32INEVT_H #define EMACS_W32INEVT_H +extern int w32_console_unicode_input; + extern int w32_console_read_socket (struct terminal *term, int numchars, struct input_event *hold_quit); extern void w32_console_mouse_position (FRAME_PTR *f, int insist, ------------------------------------------------------------ revno: 109250 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2012-07-28 18:35:52 +0200 message: etc/NEWS: Fix typo. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-07-26 08:12:03 +0000 +++ etc/ChangeLog 2012-07-28 16:35:52 +0000 @@ -1,3 +1,7 @@ +2012-07-28 Juanma Barranquero + + * NEWS: Fix typo. + 2012-07-26 Paul Eggert Simplify export of symbols to GDB. === modified file 'etc/NEWS' --- etc/NEWS 2012-07-28 10:38:55 +0000 +++ etc/NEWS 2012-07-28 16:35:52 +0000 @@ -147,8 +147,8 @@ * Editing Changes in Emacs 24.2 -** New option `delete-trailing-lines' specifies whether the -M-x delete-trailing-lines command should delete trailing lines at the +** New option `delete-trailing-lines' specifies whether the M-x +delete-trailing-whitespace command should delete trailing lines at the end of the buffer. It defaults to t. ** Search changes ------------------------------------------------------------ revno: 109249 [merge] committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-07-28 23:12:37 +0800 message: Merge from emacs-24 branch; up to r108082 diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-07-21 06:13:23 +0000 +++ doc/emacs/ChangeLog 2012-07-28 15:12:12 +0000 @@ -1,3 +1,8 @@ +2012-07-21 Eli Zaretskii + + * frames.texi (Mouse Commands): Fix the description of mouse-2. + (Bug#11958) + 2012-07-19 Chong Yidong * emacs.texi: Update ISBN. === modified file 'doc/emacs/frames.texi' --- doc/emacs/frames.texi 2012-06-17 05:13:40 +0000 +++ doc/emacs/frames.texi 2012-07-28 15:12:12 +0000 @@ -81,8 +81,8 @@ to the kill ring (@code{mouse-set-region}). @item Mouse-2 -Yank the last killed text at the click position -(@code{mouse-yank-at-click}). +Move point to where you click, and insert the contents of the primary +selection there (@code{mouse-yank-primary}). @item Mouse-3 If the region is active, move the nearer end of the region to the === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-07-25 05:48:19 +0000 +++ doc/misc/ChangeLog 2012-07-28 15:12:12 +0000 @@ -1,3 +1,8 @@ +2012-07-28 Eli Zaretskii + + * faq.texi (Right-to-left alphabets): Update for Emacs 24. + (Bug#12073) + 2012-07-25 Paul Eggert Prefer typical American spelling for "acknowledgment". === modified file 'doc/misc/faq.texi' --- doc/misc/faq.texi 2012-04-28 19:04:01 +0000 +++ doc/misc/faq.texi 2012-07-28 07:38:32 +0000 @@ -4044,13 +4044,13 @@ @cindex Right-to-left alphabets @cindex Hebrew, handling with Emacs @cindex Semitic alphabets -@cindex Arabic alphabets -@cindex Bidirectional text +@cindex Arabic +@cindex Farsi +@cindex bidirectional scripts -Emacs supports Hebrew characters (ISO 8859-8) since version 20, but does -not yet support right-to-left character entry and display. The -@uref{http://lists.gnu.org/mailman/listinfo/emacs-bidi, emacs-bidi -mailing list} discusses development of support for this feature. +Emacs supports display and editing of bidirectional scripts, such as +Arabic, Farsi, and Hebrew, since version 24.1. +@xref{New in Emacs 24, bidirectional display}. @node How to add fonts === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-28 14:18:51 +0000 +++ lisp/ChangeLog 2012-07-28 15:12:12 +0000 @@ -1,3 +1,13 @@ +2012-07-28 Chong Yidong + + * progmodes/gdb-mi.el (gdb-place-breakpoints): Fix the call to + gdb-get-location. + +2012-07-25 Leo Liu + + * progmodes/cc-menus.el (cc-imenu-objc-function): Avoid leaving nil in + the alist (bug#12029). + 2012-07-28 Eli Zaretskii * makefile.w32-in (custom-deps, finder-data, updates, compile) === modified file 'lisp/progmodes/cc-menus.el' --- lisp/progmodes/cc-menus.el 2012-04-11 18:09:10 +0000 +++ lisp/progmodes/cc-menus.el 2012-07-25 16:11:23 +0000 @@ -399,14 +399,10 @@ str2 "@protocol"))) (setq str (cc-imenu-objc-remove-white-space str)) (setq methodlist (cons (cons str2 - (match-beginning langnum)) + (match-beginning langnum)) methodlist)) - (setq toplist (cons nil (cons (cons str - methodlist) toplist)) + (setq toplist (cons (cons str methodlist) toplist) methodlist nil)))) - ;; - (if (eq (car toplist) nil) - (setq toplist (cdr toplist))) ;; In this buffer, there is only one or zero @{interface|implementation|protocol}. (if (< classcount 2) === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2012-07-11 23:13:41 +0000 +++ lisp/progmodes/gdb-mi.el 2012-07-28 15:12:12 +0000 @@ -2487,20 +2487,23 @@ (let ((file (bindat-get-field breakpoint 'fullname)) (flag (bindat-get-field breakpoint 'enabled)) (bptno (bindat-get-field breakpoint 'number))) - (unless (file-exists-p file) + (unless (and file (file-exists-p file)) (setq file (cdr (assoc bptno gdb-location-alist)))) - (if (and file - (not (string-equal file "File not found"))) - (with-current-buffer - (find-file-noselect file 'nowarn) - (gdb-init-buffer) - ;; Only want one breakpoint icon at each location. - (gdb-put-breakpoint-icon (string-equal flag "y") bptno - (string-to-number line))) - (gdb-input (concat "list " file ":1") 'ignore) - (gdb-input "-file-list-exec-source-file" - `(lambda () (gdb-get-location - ,bptno ,line ,flag))))))))) + (if (or (null file) + (string-equal file "File not found")) + ;; If the full filename is not recorded in the + ;; breakpoint structure or in `gdb-location-alist', use + ;; -file-list-exec-source-file to extract it. + (when (setq file (bindat-get-field breakpoint 'file)) + (gdb-input (concat "list " file ":1") 'ignore) + (gdb-input "-file-list-exec-source-file" + `(lambda () (gdb-get-location + ,bptno ,line ,flag)))) + (with-current-buffer (find-file-noselect file 'nowarn) + (gdb-init-buffer) + ;; Only want one breakpoint icon at each location. + (gdb-put-breakpoint-icon (string-equal flag "y") bptno + (string-to-number line))))))))) (defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") ------------------------------------------------------------ revno: 109248 fixes bug(s): http://debbugs.gnu.org/7350 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-07-28 22:18:51 +0800 message: In C-x v L and C-x v D, prompt for directory if there is no default backend. * lisp/vc/vc.el (vc-root-diff, vc-print-root-log): Prompt for a directory if vc-deduce-backend returns nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-28 11:21:43 +0000 +++ lisp/ChangeLog 2012-07-28 14:18:51 +0000 @@ -12,6 +12,9 @@ 2012-07-28 Chong Yidong + * vc/vc.el (vc-root-diff, vc-print-root-log): Prompt for a + directory if vc-deduce-backend returns nil (Bug#7350). + * simple.el (delete-trailing-lines): New option. (delete-trailing-whitespace): Obey it (Bug#11879). === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2012-07-11 23:13:41 +0000 +++ lisp/vc/vc.el 2012-07-28 14:18:51 +0000 @@ -1757,10 +1757,15 @@ (call-interactively 'vc-version-diff) (when buffer-file-name (vc-buffer-sync not-urgent)) (let ((backend (vc-deduce-backend)) + (default-directory default-directory) rootdir working-revision) - (unless backend - (error "Buffer is not version controlled")) - (setq rootdir (vc-call-backend backend 'root default-directory)) + (if backend + (setq rootdir (vc-call-backend backend 'root default-directory)) + (setq rootdir (read-directory-name "Directory for VC root-diff: ")) + (setq backend (vc-responsible-backend rootdir)) + (if backend + (setq default-directory rootdir) + (error "Directory is not version controlled"))) (setq working-revision (vc-working-revision rootdir)) ;; VC diff for the root directory produces output that is ;; relative to it. Bind default-directory to the root directory @@ -2213,10 +2218,15 @@ (t (list (when (> vc-log-show-limit 0) vc-log-show-limit))))) (let ((backend (vc-deduce-backend)) + (default-directory default-directory) rootdir working-revision) - (unless backend - (error "Buffer is not version controlled")) - (setq rootdir (vc-call-backend backend 'root default-directory)) + (if backend + (setq rootdir (vc-call-backend backend 'root default-directory)) + (setq rootdir (read-directory-name "Directory for VC root-log: ")) + (setq backend (vc-responsible-backend rootdir)) + (if backend + (setq default-directory rootdir) + (error "Directory is not version controlled"))) (setq working-revision (vc-working-revision rootdir)) (vc-print-log-internal backend (list rootdir) working-revision nil limit))) ------------------------------------------------------------ revno: 109247 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Sat 2012-07-28 11:38:47 +0000 message: message.el: defalias mail-dont-reply-to if needed diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-07-27 08:01:44 +0000 +++ lisp/gnus/ChangeLog 2012-07-28 11:38:47 +0000 @@ -1,3 +1,8 @@ +2012-07-27 Julien Danjou + + * message.el (fboundp): Add a defalias on `mail-dont-reply-to' for + Emacs < 24.1 + 2012-07-27 Katsumi Yamaoka * message.el (message-kill-address): Don't kill last newline. === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2012-07-27 08:01:44 +0000 +++ lisp/gnus/message.el 2012-07-28 11:38:47 +0000 @@ -1933,10 +1933,13 @@ (autoload 'nndraft-request-associate-buffer "nndraft") (autoload 'nndraft-request-expire-articles "nndraft") (autoload 'nnvirtual-find-group-art "nnvirtual") -(autoload 'mail-dont-reply-to "mail-utils") (autoload 'rmail-msg-is-pruned "rmail") (autoload 'rmail-output "rmailout") +;; Emacs < 24.1 do not have mail-dont-reply-to +(unless (fboundp 'mail-dont-reply-to) + (defalias 'mail-dont-reply-to 'rmail-dont-reply-to)) + ;;; ------------------------------------------------------------ revno: 109246 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-07-28 14:21:43 +0300 message: More fixes in lisp/ for parallel builds on MS-Windows. lisp/makefile.w32-in (custom-deps, finder-data, updates, compile) (compile-always, compile-first) ($(lisp)/calendar/cal-loaddefs.el) ($(lisp)/calendar/diary-loaddefs.el) ($(lisp)/calendar/hol-loaddefs.el, $(lisp)/mh-e/mh-loaddefs.el) ($(lisp)/net/tramp-loaddefs.el, bootstrap) ($(lisp)/progmodes/cc-mode.elc): Depend on $(lisp)subdirs.el, instead of on update-subdirs. (bootstrap-clean): Delete $(lisp)/subdirs.el. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-28 10:38:55 +0000 +++ lisp/ChangeLog 2012-07-28 11:21:43 +0000 @@ -1,3 +1,15 @@ +2012-07-28 Eli Zaretskii + + * makefile.w32-in (custom-deps, finder-data, updates, compile) + (compile-always, compile-first) + ($(lisp)/calendar/cal-loaddefs.el) + ($(lisp)/calendar/diary-loaddefs.el) + ($(lisp)/calendar/hol-loaddefs.el, $(lisp)/mh-e/mh-loaddefs.el) + ($(lisp)/net/tramp-loaddefs.el, bootstrap) + ($(lisp)/progmodes/cc-mode.elc): Depend on $(lisp)subdirs.el, + instead of on update-subdirs. + (bootstrap-clean): Delete $(lisp)/subdirs.el. + 2012-07-28 Chong Yidong * simple.el (delete-trailing-lines): New option. === modified file 'lisp/makefile.w32-in' --- lisp/makefile.w32-in 2012-07-26 17:10:21 +0000 +++ lisp/makefile.w32-in 2012-07-28 11:21:43 +0000 @@ -168,12 +168,12 @@ # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as # this can break with GNU Make 3.81 and later if sh.exe is used. -custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit +custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el $(lisp)/subdirs.el doit @echo Directories: $(WINS_UPDATES) -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) \ -f custom-make-dependencies $(lisp) $(WINS_UPDATES) -finder-data: $(lisp)/loaddefs.el doit +finder-data: $(lisp)/loaddefs.el $(lisp)/subdirs.el doit @echo Directories: $(WINS_UPDATES) $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_UPDATES) @@ -243,7 +243,7 @@ $(srcdir)/build-aux/update-subdirs $$file; \ done; -updates: update-subdirs autoloads mh-autoloads finder-data custom-deps +updates: $(lisp)/subdirs.el autoloads mh-autoloads finder-data custom-deps # This is useful after "bzr up". bzr-update: recompile autoloads finder-data custom-deps @@ -311,7 +311,7 @@ # compiled find the right files. # Need separate version for sh and native cmd.exe -compile: update-subdirs compile-$(SHELLTYPE) doit +compile: $(lisp)/subdirs.el compile-$(SHELLTYPE) doit compile-CMD: autoloads # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g @@ -340,7 +340,7 @@ # unconditionally. Some files don't actually get compiled because they # set the local variable no-byte-compile. -compile-always: update-subdirs compile-always-$(SHELLTYPE) doit +compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit compile-always-CMD: # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g @@ -383,7 +383,7 @@ compile-after-backup: backup-compiled-files compile-always compile-first: $(lisp)/emacs-lisp/bytecomp.elc $(lisp)/emacs-lisp/byte-opt.elc \ - $(lisp)/emacs-lisp/autoload.elc + $(lisp)/emacs-lisp/autoload.elc $(lisp)/subdirs.el # Recompile all Lisp files which are newer than their .elc files. # Note that this doesn't create .elc files. It only recompiles if an @@ -393,7 +393,7 @@ recompile: compile-first autoloads doit $(lisp)/progmodes/cc-mode.elc $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp) -$(lisp)/calendar/cal-loaddefs.el: update-subdirs +$(lisp)/calendar/cal-loaddefs.el: $(lisp)/subdirs.el "$(EMACS)" $(EMACSOPT) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ --eval "(setq find-file-suppress-same-file-warnings t)" \ @@ -401,7 +401,7 @@ -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \ $(MAKE) ./calendar -$(lisp)/calendar/diary-loaddefs.el: update-subdirs +$(lisp)/calendar/diary-loaddefs.el: $(lisp)/subdirs.el "$(EMACS)" $(EMACSOPT) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ --eval "(setq find-file-suppress-same-file-warnings t)" \ @@ -409,7 +409,7 @@ -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \ $(MAKE) ./calendar -$(lisp)/calendar/hol-loaddefs.el: update-subdirs +$(lisp)/calendar/hol-loaddefs.el: $(lisp)/subdirs.el "$(EMACS)" $(EMACSOPT) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ --eval "(setq find-file-suppress-same-file-warnings t)" \ @@ -437,7 +437,7 @@ # See the commentary for autoloads above for why we use ./mh-e below # instead of $(lisp)/mh-e. mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el -$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC) update-subdirs +$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC) $(lisp)/subdirs.el "$(EMACS)" $(EMACSOPT) \ -l autoload \ --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \ @@ -456,7 +456,7 @@ $(lisp)/net/tramp-smb.el $(lisp)/net/tramp-uu.el \ $(lisp)/net/trampver.el -$(lisp)/net/tramp-loaddefs.el: $(TRAMP_SRC) update-subdirs +$(lisp)/net/tramp-loaddefs.el: $(TRAMP_SRC) $(lisp)/subdirs.el "$(EMACS)" $(EMACSOPT) \ -l autoload \ --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###tramp-autoload$(DQUOTE))$(ARGQUOTE) \ @@ -481,6 +481,7 @@ # Need separate version for sh and native cmd.exe bootstrap-clean: - $(DEL) $(lisp)/loaddefs.el + - $(DEL) $(lisp)/subdirs.el $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE) bootstrap-clean-CMD: @@ -496,7 +497,7 @@ # When done, remove bootstrap-emacs from ../bin, so that # it will not be mistaken for an installed binary. -bootstrap: update-subdirs compile finder-data custom-deps +bootstrap: $(lisp)/subdirs.el compile finder-data custom-deps - $(DEL) "$(EMACS)" # @@ -600,7 +601,8 @@ $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \ $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \ $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \ - $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc + $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc \ + $(lisp)/subdirs.el $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \ $(lisp)/progmodes/cc-align.elc ------------------------------------------------------------ revno: 109245 committer: David Engster branch nick: trunk timestamp: Sat 2012-07-28 13:07:17 +0200 message: Fix various issues with url-dav package (Bug#11916). * url-dav.el (url-dav-supported-p): Added doc-string and remove check for feature `xml' and function `xml-expand-namespace' which never existed in Emacs proper. (url-dav-process-response): Remove all indentation and newlines from XML before parsing. Change call to `xml-parse-region' to do namespace expansion with simple qualified names (Bug#11916). (url-dav-request): Add autoload. (url-dav-directory-files): Properly deal with empty directories. Unhex URL before generating relative URLs. (url-dav-file-directory-p): Fix check for 'DAV:collection. diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2012-07-14 02:08:32 +0000 +++ lisp/url/ChangeLog 2012-07-28 11:07:17 +0000 @@ -1,3 +1,16 @@ +2012-07-28 David Engster + + * url-dav.el (url-dav-supported-p): Added doc-string and remove + check for feature `xml' and function `xml-expand-namespace' which + never existed in Emacs proper. + (url-dav-process-response): Remove all indentation and newlines + from XML before parsing. Change call to `xml-parse-region' to do + namespace expansion with simple qualified names (Bug#11916). + (url-dav-request): Add autoload. + (url-dav-directory-files): Properly deal with empty directories. + Unhex URL before generating relative URLs. + (url-dav-file-directory-p): Fix check for 'DAV:collection. + 2012-07-11 Stefan Monnier * url.el, url-queue.el, url-parse.el, url-http.el, url-future.el: === modified file 'lisp/url/url-dav.el' --- lisp/url/url-dav.el 2012-07-11 23:13:41 +0000 +++ lisp/url/url-dav.el 2012-07-28 11:07:17 +0000 @@ -53,10 +53,10 @@ ;;;###autoload (defun url-dav-supported-p (url) - (and (featurep 'xml) - (fboundp 'xml-expand-namespace) - (url-intersection url-dav-supported-protocols - (plist-get (url-http-options url) 'dav)))) + "Return WebDAV protocol version supported by URL. +Returns nil if WebDAV is not supported." + (url-intersection url-dav-supported-protocols + (plist-get (url-http-options url) 'dav))) (defun url-dav-node-text (node) "Return the text data from the XML node NODE." @@ -385,7 +385,12 @@ (when buffer (unwind-protect (with-current-buffer buffer + ;; First remove all indentation and line endings (goto-char url-http-end-of-headers) + (indent-rigidly (point) (point-max) -1000) + (save-excursion + (while (re-search-forward "\r?\n" nil t) + (replace-match ""))) (setq overall-status url-http-response-status) ;; XML documents can be transferred as either text/xml or @@ -395,7 +400,7 @@ url-http-content-type (string-match "\\`\\(text\\|application\\)/xml" url-http-content-type)) - (setq tree (xml-parse-region (point) (point-max))))) + (setq tree (xml-parse-region (point) (point-max) nil nil 'symbol-qnames)))) ;; Clean up after ourselves. (kill-buffer buffer))) @@ -411,6 +416,7 @@ ;; nobody but us needs to know the difference. (list (cons url properties)))))) +;;;###autoload (defun url-dav-request (url method tag body &optional depth headers namespaces) "Perform WebDAV operation METHOD on URL. Return the parsed responses. @@ -768,8 +774,8 @@ (defun url-dav-directory-files (url &optional full match nosort files-only) "Return a list of names of files in URL. There are three optional arguments: -If FULL is non-nil, return absolute file names. Otherwise return names - that are relative to the specified directory. +If FULL is non-nil, return absolute URLs. Otherwise return names + that are relative to the specified URL. If MATCH is non-nil, mention only file names that match the regexp MATCH. If NOSORT is non-nil, the list is not sorted--its order is unpredictable. NOSORT is useful if you plan to sort the result yourself." @@ -779,8 +785,9 @@ (files nil) (parsed-url (url-generic-parse-url url))) - (if (= (length properties) 1) - (signal 'file-error (list "Opening directory" "not a directory" url))) + (when (and (= (length properties) 1) + (not (url-dav-file-directory-p url))) + (signal 'file-error (list "Opening directory" "not a directory" url))) (while properties (setq child-props (pop properties) @@ -794,7 +801,9 @@ ;; are not supposed to return fully-qualified names. (setq child-url (url-expand-file-name child-url parsed-url)) (if (not full) - (setq child-url (substring child-url (length url)))) + ;; Parts of the URL might be hex'ed. + (setq child-url (substring (url-unhex-string child-url) + (length url)))) ;; We don't want '/' as the last character in filenames... (if (string-match "/$" child-url) @@ -814,7 +823,8 @@ (defun url-dav-file-directory-p (url) "Return t if URL names an existing DAV collection." (let ((properties (cdar (url-dav-get-properties url '(DAV:resourcetype))))) - (eq (plist-get properties 'DAV:resourcetype) 'DAV:collection))) + (when (member 'DAV:collection (plist-get properties 'DAV:resourcetype)) + t))) (defun url-dav-make-directory (url &optional parents) "Create the directory DIR and any nonexistent parent dirs." ------------------------------------------------------------ revno: 109244 fixes bug(s): http://debbugs.gnu.org/11879 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-07-28 18:38:55 +0800 message: * simple.el (delete-trailing-lines): New option. (delete-trailing-whitespace): Obey it. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-07-26 01:27:33 +0000 +++ etc/NEWS 2012-07-28 10:38:55 +0000 @@ -147,6 +147,10 @@ * Editing Changes in Emacs 24.2 +** New option `delete-trailing-lines' specifies whether the +M-x delete-trailing-lines command should delete trailing lines at the +end of the buffer. It defaults to t. + ** Search changes *** Global `M-s _' starts a symbol (identifier) incremental search, === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-28 09:19:53 +0000 +++ lisp/ChangeLog 2012-07-28 10:38:55 +0000 @@ -1,3 +1,8 @@ +2012-07-28 Chong Yidong + + * simple.el (delete-trailing-lines): New option. + (delete-trailing-whitespace): Obey it (Bug#11879). + 2012-07-28 David Engster * xml.el (xml-node-name, xml-parse-file, xml-parse-region): === modified file 'lisp/simple.el' --- lisp/simple.el 2012-07-18 14:29:34 +0000 +++ lisp/simple.el 2012-07-28 10:38:55 +0000 @@ -564,13 +564,28 @@ (if (looking-at "^[ \t]*\n\\'") (delete-region (point) (point-max))))) +(defcustom delete-trailing-lines t + "If non-nil, \\[delete-trailing-whitespace] deletes trailing lines. +Trailing lines are deleted only if `delete-trailing-whitespace' +is called on the entire buffer (rather than an active region)." + :type 'boolean + :group 'editing + :version "24.2") + (defun delete-trailing-whitespace (&optional start end) - "Delete all the trailing whitespace across the current buffer. -All whitespace after the last non-whitespace character in a line is deleted. -This respects narrowing, created by \\[narrow-to-region] and friends. -A formfeed is not considered whitespace by this function. -If END is nil, also delete all trailing lines at the end of the buffer. -If the region is active, only delete whitespace within the region." + "Delete trailing whitespace between START and END. +If called interactively, START and END are the start/end of the +region if the mark is active, or of the buffer's accessible +portion if the mark is inactive. + +This command deletes whitespace characters after the last +non-whitespace character in each line between START and END. It +does not consider formfeed characters to be whitespace. + +If this command acts on the entire buffer (i.e. if called +interactively with the mark inactive, or called from Lisp with +END nil), it also deletes all trailing lines at the end of the +buffer if the variable `delete-trailing-lines' is non-nil." (interactive (progn (barf-if-buffer-read-only) (if (use-region-p) @@ -590,6 +605,7 @@ ;; Delete trailing empty lines. (goto-char end-marker) (when (and (not end) + delete-trailing-lines ;; Really the end of buffer. (save-restriction (widen) (eobp)) (<= (skip-chars-backward "\n") -2)) ------------------------------------------------------------ revno: 109243 committer: David Engster branch nick: trunk timestamp: Sat 2012-07-28 11:19:53 +0200 message: Maybe return expanded XML qnames as plain symbols (Bug#11916). * xml.el (xml-node-name, xml-parse-file, xml-parse-region): Explanation of new 'symbol-qnames feature in doc-strings. (xml-maybe-do-ns): Return expanded names as plain symbols if 'symbol-qnames was provided in XML-NS argument (Bug#11916). (xml-parse-tag-1): Deal with new definition of PARSE-NS argument. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-27 16:42:19 +0000 +++ lisp/ChangeLog 2012-07-28 09:19:53 +0000 @@ -1,3 +1,11 @@ +2012-07-28 David Engster + + * xml.el (xml-node-name, xml-parse-file, xml-parse-region): + Explanation of new 'symbol-qnames feature in doc-strings. + (xml-maybe-do-ns): Return expanded names as plain symbols if + 'symbol-qnames was provided in XML-NS argument (Bug#11916). + (xml-parse-tag-1): Deal with new definition of PARSE-NS argument. + 2012-07-27 Fabián Ezequiel Gallina Consistent completion in inferior python with emacs -nw. === modified file 'lisp/xml.el' --- lisp/xml.el 2012-07-04 16:14:05 +0000 +++ lisp/xml.el 2012-07-28 09:19:53 +0000 @@ -126,7 +126,10 @@ would be represented by - '(\"\" . \"foo\")." + '(\"\" . \"foo\"). + +If you'd just like a plain symbol instead, use 'symbol-qnames in +the PARSE-NS argument." (car node)) @@ -313,7 +316,22 @@ "Parse the well-formed XML file FILE. Return the top node with all its children. If PARSE-DTD is non-nil, the DTD is parsed rather than skipped. -If PARSE-NS is non-nil, then QNAMES are expanded." + +If PARSE-NS is non-nil, then QNAMES are expanded. By default, +the variable `xml-default-ns' is the mapping from namespaces to +URIs, and expanded names will be returned as a cons + + (\"namespace:\" . \"foo\"). + +If PARSE-NS is an alist, it will be used as the mapping from +namespace to URIs instead. + +If it is the symbol 'symbol-qnames, expanded names will be +returned as a plain symbol 'namespace:foo instead of a cons. + +Both features can be combined by providing a cons cell + + (symbol-qnames . ALIST)." (with-temp-buffer (insert-file-contents file) (xml--parse-buffer parse-dtd parse-ns))) @@ -329,7 +347,21 @@ If BUFFER is nil, it defaults to the current buffer. If PARSE-DTD is non-nil, parse the DTD and return it as the first element of the list. -If PARSE-NS is non-nil, expand QNAMES." +If PARSE-NS is non-nil, then QNAMES are expanded. By default, +the variable `xml-default-ns' is the mapping from namespaces to +URIs, and expanded names will be returned as a cons + + (\"namespace:\" . \"foo\"). + +If PARSE-NS is an alist, it will be used as the mapping from +namespace to URIs instead. + +If it is the symbol 'symbol-qnames, expanded names will be +returned as a plain symbol 'namespace:foo instead of a cons. + +Both features can be combined by providing a cons cell + + (symbol-qnames . ALIST)." ;; Use fixed syntax table to ensure regexp char classes and syntax ;; specs DTRT. (unless buffer @@ -386,26 +418,36 @@ During namespace-aware parsing, any name without a namespace is put into the namespace identified by DEFAULT. nil is used to -specify that the name shouldn't be given a namespace." +specify that the name shouldn't be given a namespace. +Expanded names will by default be returned as a cons. If you +would like to get plain symbols instead, provide a cons cell + + (symbol-qnames . ALIST) + +in the XML-NS argument." (if (consp xml-ns) - (let* ((nsp (string-match ":" name)) + (let* ((symbol-qnames (eq (car-safe xml-ns) 'symbol-qnames)) + (nsp (string-match ":" name)) (lname (if nsp (substring name (match-end 0)) name)) (prefix (if nsp (substring name 0 (match-beginning 0)) default)) (special (and (string-equal lname "xmlns") (not prefix))) ;; Setting default to nil will insure that there is not ;; matching cons in xml-ns. In which case we (ns (or (cdr (assoc (if special "xmlns" prefix) - xml-ns)) + (if symbol-qnames (cdr xml-ns) xml-ns))) ""))) - (cons ns (if special "" lname))) + (if (and symbol-qnames + (not (string= prefix "xmlns"))) + (intern (concat ns lname)) + (cons ns (if special "" lname)))) (intern name))) (defun xml-parse-tag (&optional parse-dtd parse-ns) "Parse the tag at point. If PARSE-DTD is non-nil, the DTD of the document, if any, is parsed and returned as the first element in the list. -If PARSE-NS is non-nil, expand QNAMES; if the value of PARSE-NS -is a list, use it as an alist mapping namespaces to URIs. +If PARSE-NS is non-nil, expand QNAMES; for further details, see +`xml-parse-region'. Return one of: - a list : the matching node @@ -425,9 +467,16 @@ (defun xml-parse-tag-1 (&optional parse-dtd parse-ns) "Like `xml-parse-tag', but possibly modify the buffer while working." - (let ((xml-validating-parser (or parse-dtd xml-validating-parser)) - (xml-ns (cond ((consp parse-ns) parse-ns) - (parse-ns xml-default-ns)))) + (let* ((xml-validating-parser (or parse-dtd xml-validating-parser)) + (xml-ns + (cond ((eq parse-ns 'symbol-qnames) + (cons 'symbol-qnames xml-default-ns)) + ((or (consp (car-safe parse-ns)) + (and (eq (car-safe parse-ns) 'symbol-qnames) + (listp (cdr parse-ns)))) + parse-ns) + (parse-ns + xml-default-ns)))) (cond ;; Processing instructions, like . ((looking-at "<\\?") @@ -475,7 +524,9 @@ (equal "http://www.w3.org/2000/xmlns/" (caar attr))) (push (cons (cdar attr) (cdr attr)) - xml-ns)))) + (if (symbolp (car xml-ns)) + (cdr xml-ns) + xml-ns))))) (setq children (list attrs (xml-maybe-do-ns node-name "" xml-ns))) (cond ;; is this an empty element ? ------------------------------------------------------------ revno: 109242 fixes bug(s): http://debbugs.gnu.org/11742 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-07-28 10:59:34 +0300 message: Fix --without-x build. src/xdisp.c (init_iterator): Don't reference tip_frame in a build --without-x. (Bug#11742) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-27 20:50:02 +0000 +++ src/ChangeLog 2012-07-28 07:59:34 +0000 @@ -1,3 +1,8 @@ +2012-07-28 Eli Zaretskii + + * xdisp.c (init_iterator): Don't reference tip_frame in a build + --without-x. (Bug#11742) + 2012-07-27 Paul Eggert Adjust GDB to reflect pvec_type changes (Bug#12036). === modified file 'src/xdisp.c' --- src/xdisp.c 2012-07-27 09:24:34 +0000 +++ src/xdisp.c 2012-07-28 07:59:34 +0000 @@ -2736,7 +2736,11 @@ frames when the fringes are turned off. But leave the dimensions zero for tooltip frames, as these glyphs look ugly there and also sabotage calculations of tooltip dimensions in x-show-tip. */ - if (!(FRAMEP (tip_frame) && it->f == XFRAME (tip_frame))) +#ifdef HAVE_WINDOW_SYSTEM + if (!(FRAME_WINDOW_P (it->f) + && FRAMEP (tip_frame) + && it->f == XFRAME (tip_frame))) +#endif { if (it->line_wrap == TRUNCATE) { ------------------------------------------------------------ revno: 109241 fixes bug(s): http://debbugs.gnu.org/12062 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-07-28 10:47:58 +0300 message: Fix bug #12062 with a typo in Elisp manual. doc/lispref/nonascii.texi (Character Sets): Fix a typo. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-07-25 05:48:19 +0000 +++ doc/lispref/ChangeLog 2012-07-28 07:47:58 +0000 @@ -1,3 +1,7 @@ +2012-07-28 Eli Zaretskii + + * nonascii.texi (Character Sets): Fix a typo. (Bug#12062) + 2012-07-25 Paul Eggert Prefer typical American spelling for "acknowledgment". === modified file 'doc/lispref/nonascii.texi' --- doc/lispref/nonascii.texi 2012-06-17 05:13:40 +0000 +++ doc/lispref/nonascii.texi 2012-07-28 07:47:58 +0000 @@ -606,7 +606,7 @@ @end defvar @defun charset-priority-list &optional highestp -This functions returns a list of all defined character sets ordered by +This function returns a list of all defined character sets ordered by their priority. If @var{highestp} is non-@code{nil}, the function returns a single character set of the highest priority. @end defun ------------------------------------------------------------ revno: 109240 fixes bug(s): http://debbugs.gnu.org/12036 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-07-27 13:50:02 -0700 message: Adjust GDB to reflect pvec_type changes. * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the 2012-07-04 changes to pseudovector representation. Problem reported by Eli Zaretskii in . diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2012-07-27 06:18:36 +0000 +++ src/.gdbinit 2012-07-27 20:50:02 +0000 @@ -653,7 +653,11 @@ define xvectype xgetptr $ set $size = ((struct Lisp_Vector *) $ptr)->header.size - output ($size & PSEUDOVECTOR_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~ARRAY_MARK_FLAG + if ($size & PSEUDOVECTOR_FLAG) + output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS) + else + output $size & ~ARRAY_MARK_FLAG + end echo \n end document xvectype @@ -992,7 +996,7 @@ if $type == Lisp_Vectorlike set $size = ((struct Lisp_Vector *) $ptr)->header.size if ($size & PSEUDOVECTOR_FLAG) - set $vec = (enum pvec_type) ($size & PVEC_TYPE_MASK) + set $vec = (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS) if $vec == PVEC_NORMAL_VECTOR xvector end @@ -1127,7 +1131,11 @@ if $type == Lisp_Vectorlike xgetptr (*$bt->function) set $size = ((struct Lisp_Vector *) $ptr)->header.size - output ($size & PSEUDOVECTOR_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~ARRAY_MARK_FLAG + if ($size & PSEUDOVECTOR_FLAG) + output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS) + else + output $size & ~ARRAY_MARK_FLAG + end else printf "Lisp type %d", $type end === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-27 11:10:21 +0000 +++ src/ChangeLog 2012-07-27 20:50:02 +0000 @@ -1,3 +1,10 @@ +2012-07-27 Paul Eggert + + Adjust GDB to reflect pvec_type changes (Bug#12036). + * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the + 2012-07-04 changes to pseudovector representation. Problem + reported by Eli Zaretskii in . + 2012-07-27 Michael Albinus * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.