commit 94a3f7648cfc9d1d205e69eff0beec416d30a0fe (HEAD, refs/remotes/origin/master) Author: Andreas Schwab Date: Wed Dec 10 09:44:26 2014 +0100 * files.el (file-tree-walk): Use file-name-as-directory unconditionally. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 445a461..454ee00 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-10 Andreas Schwab + + * files.el (file-tree-walk): Use file-name-as-directory + unconditionally. + 2014-12-10 Lars Magne Ingebrigtsen * files.el (directory-files-recursively): Use diff --git a/lisp/files.el b/lisp/files.el index e948c74..568c1bb 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -743,8 +743,7 @@ The ACTION is applied to each subdirectory before descending into it, and if nil is returned at that point, the descent will be prevented. Directory entries are sorted with string-lessp." (cond ((file-directory-p dir) - (or (char-equal ?/ (aref dir (1- (length dir)))) - (setq dir (file-name-as-directory dir))) + (setq dir (file-name-as-directory dir)) (let ((lst (directory-files dir nil nil t)) fullname file) (while lst commit 5c9a98bffb2c824e2fc07350ac7492a0bd9cbc18 Author: Michael Albinus Date: Wed Dec 10 09:42:44 2014 +0100 * automated/vc-tests.el (vc-test--register): Check, that the file still exists after register and unregister operations. diff --git a/test/ChangeLog b/test/ChangeLog index d760b11..8b7b74d 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-12-10 Michael Albinus + + * automated/vc-tests.el (vc-test--register): Check, that the file + still exists after register and unregister operations. + 2014-12-06 Michael Albinus * automated/vc-tests.el: New file. diff --git a/test/automated/vc-tests.el b/test/automated/vc-tests.el index b64a3bf..d0f2dc7 100644 --- a/test/automated/vc-tests.el +++ b/test/automated/vc-tests.el @@ -225,10 +225,12 @@ Don't set it globally, the functions shall be let-bound.") (should-not (vc-registered tmp-name2)) (vc-register (list backend (list tmp-name1 tmp-name2))) + (should (file-exists-p tmp-name1)) (should (vc-registered tmp-name1)) + (should (file-exists-p tmp-name2)) (should (vc-registered tmp-name2)) - ;; Unregister the file2. Why isn't there `vc-unregister'? + ;; Unregister the files. Why isn't there `vc-unregister'? (condition-case err (progn (funcall (vc-test--unregister-function backend) tmp-name1) @@ -236,7 +238,9 @@ Don't set it globally, the functions shall be let-bound.") (funcall (vc-test--unregister-function backend) tmp-name2) (should-not (vc-registered tmp-name2))) ;; CVS, SVN, SCCS, SRC and Mtn are not supported. - (vc-not-supported (message "%s" (error-message-string err)))))) + (vc-not-supported (message "%s" (error-message-string err)))) + (should (file-exists-p tmp-name1)) + (should (file-exists-p tmp-name2)))) ;; Save exit. (ignore-errors (run-hooks 'vc-test--cleanup-hook))))) commit 99be75085cec471fa35a811bddaf09fe91fc3452 Author: Paul Eggert Date: Tue Dec 9 23:47:16 2014 -0800 Fix glitches in gnutls.c, mostly memory-related * gnutls.c: Sort macro definitions by name. (fn_gnutls_transport_set_errno): Omit unreachable definition. (fn_gnutls_x509_crt_get_signature): Omit unused symbol. (gnutls_hex_string): Arg is now unsigned char *, to avoid a cast. Prefer ptrdiff_t for sizes. Check for arithmetic overflow when calculating string length. Use make_uninit_string, to avoid copying the string. Cast the char, not the pointer. (gnutls_certificate_details): Use xmalloc and xfree, not malloc and free. Work even for dates past the year 9999. Use void * for buffers, to avoid casts. diff --git a/src/ChangeLog b/src/ChangeLog index 762ce48..09268d1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2014-12-10 Paul Eggert + + Fix glitches in gnutls.c, mostly memory-related + * gnutls.c: Sort macro definitions by name. + (fn_gnutls_transport_set_errno): Omit unreachable definition. + (fn_gnutls_x509_crt_get_signature): Omit unused symbol. + (gnutls_hex_string): Arg is now unsigned char *, to avoid a cast. + Prefer ptrdiff_t for sizes. Check for arithmetic overflow when + calculating string length. Use make_uninit_string, to avoid + copying the string. Cast the char, not the pointer. + (gnutls_certificate_details): Use xmalloc and xfree, not malloc + and free. Work even for dates past the year 9999. Use void * + for buffers, to avoid casts. + 2014-12-09 Andy Moreton (tiny change) * gnutls.c (gnutls_protocol_get_name): Fix a copy/paste typo. diff --git a/src/gnutls.c b/src/gnutls.c index aa800be..4de2eaf 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -317,65 +317,61 @@ init_gnutls_functions (void) #define fn_gnutls_certificate_set_x509_trust_file gnutls_certificate_set_x509_trust_file #define fn_gnutls_certificate_type_get gnutls_certificate_type_get #define fn_gnutls_certificate_verify_peers2 gnutls_certificate_verify_peers2 +#define fn_gnutls_cipher_get gnutls_cipher_get +#define fn_gnutls_cipher_get_name gnutls_cipher_get_name #define fn_gnutls_credentials_set gnutls_credentials_set #define fn_gnutls_deinit gnutls_deinit -#define fn_gnutls_dh_set_prime_bits gnutls_dh_set_prime_bits #define fn_gnutls_dh_get_prime_bits gnutls_dh_get_prime_bits +#define fn_gnutls_dh_set_prime_bits gnutls_dh_set_prime_bits #define fn_gnutls_error_is_fatal gnutls_error_is_fatal #define fn_gnutls_global_init gnutls_global_init -#define fn_gnutls_global_set_log_function gnutls_global_set_log_function #ifdef HAVE_GNUTLS3 #define fn_gnutls_global_set_audit_log_function gnutls_global_set_audit_log_function #endif +#define fn_gnutls_global_set_log_function gnutls_global_set_log_function #define fn_gnutls_global_set_log_level gnutls_global_set_log_level #define fn_gnutls_global_set_mem_functions gnutls_global_set_mem_functions #define fn_gnutls_handshake gnutls_handshake #define fn_gnutls_init gnutls_init +#define fn_gnutls_kx_get gnutls_kx_get +#define fn_gnutls_kx_get_name gnutls_kx_get_name +#define fn_gnutls_mac_get gnutls_mac_get +#define fn_gnutls_mac_get_name gnutls_mac_get_name +#define fn_gnutls_pk_algorithm_get_name gnutls_pk_algorithm_get_name +#define fn_gnutls_pk_bits_to_sec_param gnutls_pk_bits_to_sec_param #define fn_gnutls_priority_set_direct gnutls_priority_set_direct +#define fn_gnutls_protocol_get_name gnutls_protocol_get_name +#define fn_gnutls_protocol_get_version gnutls_protocol_get_version #define fn_gnutls_record_check_pending gnutls_record_check_pending #define fn_gnutls_record_recv gnutls_record_recv #define fn_gnutls_record_send gnutls_record_send +#define fn_gnutls_sec_param_get_name gnutls_sec_param_get_name +#define fn_gnutls_server_name_set gnutls_server_name_set +#define fn_gnutls_sign_get_name gnutls_sign_get_name #define fn_gnutls_strerror gnutls_strerror -#ifdef WINDOWSNT -#define fn_gnutls_transport_set_errno gnutls_transport_set_errno -#endif #define fn_gnutls_transport_set_ptr2 gnutls_transport_set_ptr2 #define fn_gnutls_x509_crt_check_hostname gnutls_x509_crt_check_hostname #define fn_gnutls_x509_crt_deinit gnutls_x509_crt_deinit -#define fn_gnutls_x509_crt_import gnutls_x509_crt_import -#define fn_gnutls_x509_crt_init gnutls_x509_crt_init -#define fn_gnutls_x509_crt_get_fingerprint gnutls_x509_crt_get_fingerprint -#define fn_gnutls_x509_crt_get_version gnutls_x509_crt_get_version -#define fn_gnutls_x509_crt_get_serial gnutls_x509_crt_get_serial -#define fn_gnutls_x509_crt_get_issuer_dn gnutls_x509_crt_get_issuer_dn #define fn_gnutls_x509_crt_get_activation_time gnutls_x509_crt_get_activation_time -#define fn_gnutls_x509_crt_get_expiration_time gnutls_x509_crt_get_expiration_time #define fn_gnutls_x509_crt_get_dn gnutls_x509_crt_get_dn -#define fn_gnutls_x509_crt_get_pk_algorithm gnutls_x509_crt_get_pk_algorithm -#define fn_gnutls_pk_algorithm_get_name gnutls_pk_algorithm_get_name -#define fn_gnutls_pk_bits_to_sec_param gnutls_pk_bits_to_sec_param +#define fn_gnutls_x509_crt_get_expiration_time gnutls_x509_crt_get_expiration_time +#define fn_gnutls_x509_crt_get_fingerprint gnutls_x509_crt_get_fingerprint +#define fn_gnutls_x509_crt_get_issuer_dn gnutls_x509_crt_get_issuer_dn #define fn_gnutls_x509_crt_get_issuer_unique_id gnutls_x509_crt_get_issuer_unique_id -#define fn_gnutls_x509_crt_get_subject_unique_id gnutls_x509_crt_get_subject_unique_id -#define fn_gnutls_x509_crt_get_signature_algorithm gnutls_x509_crt_get_signature_algorithm -#define fn_gnutls_x509_crt_get_signature gnutls_x509_crt_get_signature #define fn_gnutls_x509_crt_get_key_id gnutls_x509_crt_get_key_id -#define fn_gnutls_sec_param_get_name gnutls_sec_param_get_name -#define fn_gnutls_sign_get_name gnutls_sign_get_name -#define fn_gnutls_server_name_set gnutls_server_name_set -#define fn_gnutls_kx_get gnutls_kx_get -#define fn_gnutls_kx_get_name gnutls_kx_get_name -#define fn_gnutls_protocol_get_version gnutls_protocol_get_version -#define fn_gnutls_protocol_get_name gnutls_protocol_get_name -#define fn_gnutls_cipher_get gnutls_cipher_get -#define fn_gnutls_cipher_get_name gnutls_cipher_get_name -#define fn_gnutls_mac_get gnutls_mac_get -#define fn_gnutls_mac_get_name gnutls_mac_get_name +#define fn_gnutls_x509_crt_get_pk_algorithm gnutls_x509_crt_get_pk_algorithm +#define fn_gnutls_x509_crt_get_serial gnutls_x509_crt_get_serial +#define fn_gnutls_x509_crt_get_signature_algorithm gnutls_x509_crt_get_signature_algorithm +#define fn_gnutls_x509_crt_get_subject_unique_id gnutls_x509_crt_get_subject_unique_id +#define fn_gnutls_x509_crt_get_version gnutls_x509_crt_get_version +#define fn_gnutls_x509_crt_import gnutls_x509_crt_import +#define fn_gnutls_x509_crt_init gnutls_x509_crt_init #endif /* !WINDOWSNT */ #ifdef HAVE_GNUTLS3 -/* Function to log a simple audit message. */ +/* Log a simple audit message. */ static void gnutls_audit_log_function (gnutls_session_t session, const char *string) { @@ -386,21 +382,21 @@ gnutls_audit_log_function (gnutls_session_t session, const char *string) } #endif -/* Function to log a simple message. */ +/* Log a simple message. */ static void gnutls_log_function (int level, const char *string) { message ("gnutls.c: [%d] %s", level, string); } -/* Function to log a message and a string. */ +/* Log a message and a string. */ static void gnutls_log_function2 (int level, const char *string, const char *extra) { message ("gnutls.c: [%d] %s %s", level, string, extra); } -/* Function to log a message and an integer. */ +/* Log a message and an integer. */ static void gnutls_log_function2i (int level, const char *string, int extra) { @@ -804,21 +800,21 @@ DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, } static Lisp_Object -gnutls_hex_string (char *buf, size_t buf_size, const char *prefix) +gnutls_hex_string (unsigned char *buf, ptrdiff_t buf_size, const char *prefix) { - size_t prefix_length = strlen (prefix); - char *string = malloc (buf_size * 3 + prefix_length); - Lisp_Object ret; - + ptrdiff_t prefix_length = strlen (prefix); + if ((STRING_BYTES_BOUND - prefix_length) / 3 < buf_size) + string_overflow (); + Lisp_Object ret = make_uninit_string (prefix_length + 3 * buf_size + - (buf_size != 0)); + char *string = SSDATA (ret); strcpy (string, prefix); - for (int i = 0; i < buf_size; i++) + for (ptrdiff_t i = 0; i < buf_size; i++) sprintf (string + i * 3 + prefix_length, i == buf_size - 1 ? "%02x" : "%02x:", - ((unsigned char*) buf)[i]); + buf[i]); - ret = build_string (string); - free (string); return ret; } @@ -842,12 +838,12 @@ gnutls_certificate_details (gnutls_x509_crt_t cert) err = fn_gnutls_x509_crt_get_serial (cert, NULL, &buf_size); if (err == GNUTLS_E_SHORT_MEMORY_BUFFER) { - char *serial = malloc (buf_size); + void *serial = xmalloc (buf_size); err = fn_gnutls_x509_crt_get_serial (cert, serial, &buf_size); if (err >= GNUTLS_E_SUCCESS) res = nconc2 (res, list2 (intern (":serial-number"), gnutls_hex_string (serial, buf_size, ""))); - free (serial); + xfree (serial); } /* Issuer. */ @@ -855,28 +851,27 @@ gnutls_certificate_details (gnutls_x509_crt_t cert) err = fn_gnutls_x509_crt_get_issuer_dn (cert, NULL, &buf_size); if (err == GNUTLS_E_SHORT_MEMORY_BUFFER) { - char *dn = malloc (buf_size); + char *dn = xmalloc (buf_size); err = fn_gnutls_x509_crt_get_issuer_dn (cert, dn, &buf_size); if (err >= GNUTLS_E_SUCCESS) res = nconc2 (res, list2 (intern (":issuer"), make_string (dn, buf_size))); - free (dn); + xfree (dn); } /* Validity. */ { - char buf[11]; - size_t buf_size = sizeof (buf); + /* Add 1 to the buffer size, since 1900 is added to tm_year and + that might add 1 to the year length. */ + char buf[INT_STRLEN_BOUND (int) + 1 + sizeof "-12-31"]; struct tm t; time_t tim = fn_gnutls_x509_crt_get_activation_time (cert); - if (gmtime_r (&tim, &t) != NULL && - strftime (buf, buf_size, "%Y-%m-%d", &t) != 0) + if (gmtime_r (&tim, &t) && strftime (buf, sizeof buf, "%Y-%m-%d", &t)) res = nconc2 (res, list2 (intern (":valid-from"), build_string (buf))); tim = fn_gnutls_x509_crt_get_expiration_time (cert); - if (gmtime_r (&tim, &t) != NULL && - strftime (buf, buf_size, "%Y-%m-%d", &t) != 0) + if (gmtime_r (&tim, &t) && strftime (buf, sizeof buf, "%Y-%m-%d", &t)) res = nconc2 (res, list2 (intern (":valid-to"), build_string (buf))); } @@ -885,12 +880,12 @@ gnutls_certificate_details (gnutls_x509_crt_t cert) err = fn_gnutls_x509_crt_get_dn (cert, NULL, &buf_size); if (err == GNUTLS_E_SHORT_MEMORY_BUFFER) { - char *dn = malloc (buf_size); + char *dn = xmalloc (buf_size); err = fn_gnutls_x509_crt_get_dn (cert, dn, &buf_size); if (err >= GNUTLS_E_SUCCESS) res = nconc2 (res, list2 (intern (":subject"), make_string (dn, buf_size))); - free (dn); + xfree (dn); } /* Versions older than 2.11 doesn't have these four functions. */ @@ -919,24 +914,24 @@ gnutls_certificate_details (gnutls_x509_crt_t cert) err = fn_gnutls_x509_crt_get_issuer_unique_id (cert, NULL, &buf_size); if (err == GNUTLS_E_SHORT_MEMORY_BUFFER) { - char *buf = malloc (buf_size); + char *buf = xmalloc (buf_size); err = fn_gnutls_x509_crt_get_issuer_unique_id (cert, buf, &buf_size); if (err >= GNUTLS_E_SUCCESS) res = nconc2 (res, list2 (intern (":issuer-unique-id"), make_string (buf, buf_size))); - free (buf); + xfree (buf); } buf_size = 0; err = fn_gnutls_x509_crt_get_subject_unique_id (cert, NULL, &buf_size); if (err == GNUTLS_E_SHORT_MEMORY_BUFFER) { - char *buf = malloc (buf_size); + char *buf = xmalloc (buf_size); err = fn_gnutls_x509_crt_get_subject_unique_id (cert, buf, &buf_size); if (err >= GNUTLS_E_SUCCESS) res = nconc2 (res, list2 (intern (":subject-unique-id"), make_string (buf, buf_size))); - free (buf); + xfree (buf); } #endif @@ -955,13 +950,12 @@ gnutls_certificate_details (gnutls_x509_crt_t cert) err = fn_gnutls_x509_crt_get_key_id (cert, 0, NULL, &buf_size); if (err == GNUTLS_E_SHORT_MEMORY_BUFFER) { - unsigned char *buf = malloc (buf_size); + void *buf = xmalloc (buf_size); err = fn_gnutls_x509_crt_get_key_id (cert, 0, buf, &buf_size); if (err >= GNUTLS_E_SUCCESS) res = nconc2 (res, list2 (intern (":public-key-id"), - gnutls_hex_string ((char *)buf, - buf_size, "sha1:"))); - free (buf); + gnutls_hex_string (buf, buf_size, "sha1:"))); + xfree (buf); } /* Certificate fingerprint. */ @@ -970,21 +964,20 @@ gnutls_certificate_details (gnutls_x509_crt_t cert) NULL, &buf_size); if (err == GNUTLS_E_SHORT_MEMORY_BUFFER) { - unsigned char *buf = malloc (buf_size); + void *buf = xmalloc (buf_size); err = fn_gnutls_x509_crt_get_fingerprint (cert, GNUTLS_DIG_SHA1, buf, &buf_size); if (err >= GNUTLS_E_SUCCESS) res = nconc2 (res, list2 (intern (":certificate-id"), - gnutls_hex_string ((char *)buf, - buf_size, "sha1:"))); - free (buf); + gnutls_hex_string (buf, buf_size, "sha1:"))); + xfree (buf); } return res; } DEFUN ("gnutls-peer-status-warning-describe", Fgnutls_peer_status_warning_describe, Sgnutls_peer_status_warning_describe, 1, 1, 0, - doc: /* Describe the warning of a GnuTLS peer status from `gnutls-peer-status'.*/) + doc: /* Describe the warning of a GnuTLS peer status from `gnutls-peer-status'. */) (Lisp_Object status_symbol) { CHECK_SYMBOL (status_symbol); @@ -1109,9 +1102,9 @@ The return value is a property list with top-level keys :warnings and } -/* Initializes global GnuTLS state to defaults. -Call `gnutls-global-deinit' when GnuTLS usage is no longer needed. -Returns zero on success. */ +/* Initialize global GnuTLS state to defaults. + Call `gnutls-global-deinit' when GnuTLS usage is no longer needed. + Return zero on success. */ static Lisp_Object emacs_gnutls_global_init (void) { @@ -1141,8 +1134,8 @@ gnutls_ip_address_p (char *string) } #if 0 -/* Deinitializes global GnuTLS state. -See also `gnutls-global-init'. */ +/* Deinitialize global GnuTLS state. + See also `gnutls-global-init'. */ static Lisp_Object emacs_gnutls_global_deinit (void) { @@ -1282,7 +1275,7 @@ one trustfile (usually a CA bundle). */) GNUTLS_LOG2 (1, max_log_level, "connecting to host:", c_hostname); - /* always initialize globals. */ + /* Always initialize globals. */ global_init = emacs_gnutls_global_init (); if (! NILP (Fgnutls_errorp (global_init))) return global_init; commit c9e3deffab6e9de3a214a3b7f7a5921018fc1a9d Author: Lars Magne Ingebrigtsen Date: Wed Dec 10 05:38:23 2014 +0100 Speed up directory-files-recursively * files.el (directory-files-recursively): Use `file-name-all-completions' instead of `directory-files' for greater speed. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20461a6..445a461 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2014-12-10 Lars Magne Ingebrigtsen + * files.el (directory-files-recursively): Use + `file-name-all-completions' instead of `directory-files' for + greater speed. + * net/shr.el (shr-tag-object): Don't bug out on text elements in . diff --git a/lisp/files.el b/lisp/files.el index 5127519..e948c74 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -769,18 +769,21 @@ and alphabetical order. If INCLUDE-DIRECTORIES, also include directories that have matching names." (let ((result nil) (files nil)) - (dolist (file (directory-files dir t)) - (let ((leaf (file-name-nondirectory file))) - (unless (member leaf '("." "..")) - (if (file-directory-p file) - (progn - (when (and include-directories - (string-match match leaf)) - (push file files)) - (setq result (nconc result (directory-files-recursively - file match include-directories)))) - (when (string-match match leaf) - (push file files)))))) + (dolist (file (sort (file-name-all-completions "" dir) + 'string<)) + (unless (member file '("./" "../")) + (if (= (aref file (1- (length file))) ?/) + (progn + (setq result (nconc result (directory-files-recursively + (expand-file-name file dir) + match include-directories))) + (when (and include-directories + (string-match match + (substring file 0 (1- (length file))))) + (setq result (nconc result (list + (expand-file-name file dir)))))) + (when (string-match match file) + (push (expand-file-name file dir) files))))) (nconc result (nreverse files)))) (defun load-file (file) commit ef8892db3cdf679231cf71613f14589fc3702a80 Author: Lars Magne Ingebrigtsen Date: Wed Dec 10 05:00:22 2014 +0100 (shr-tag-object): Don't bug out on text elements in diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3ab15aa..20461a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-10 Lars Magne Ingebrigtsen + + * net/shr.el (shr-tag-object): Don't bug out on text elements in + . + 2014-12-09 Bozhidar Batsov * progmodes/ruby-mode.el (auto-mode-alist): Add .rabl, Berksfile diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 186c9f5..695b91d 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1134,7 +1134,7 @@ ones, in case fg and bg are nil." (when (string-match "\\`image/svg" type) (setq url (dom-attr dom 'data) image t))) - (dolist (child (dom-children dom)) + (dolist (child (dom-non-text-children dom)) (cond ((eq (dom-tag child) 'embed) (setq url (or url (dom-attr child 'src)) commit cc857dd0db0fad257747134bdbd8318a21d12cab Author: Paul Eggert Date: Tue Dec 9 16:26:46 2014 -0800 Fix misspellings like "an unibyte buffer" diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index 83fff5e..3e01fab 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -1649,7 +1649,7 @@ aren't they and how to fix it? @subsubheading Answer -The message-ID is an unique identifier for messages you +The message-ID is a unique identifier for messages you send. To make it unique, Gnus need to know which machine name to put after the "@@". If the name of the machine where Gnus is running isn't suitable (it probably isn't diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 8eb25c6..62aa5c0 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2843,7 +2843,7 @@ uid=0(root) gid=0(root) groups=0(root) @cindex gdb @cindex perldb -@file{gud.el} offers an unified interface to several symbolic +@file{gud.el} offers a unified interface to several symbolic debuggers @ifset emacs @ifinfo diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index cde0af0..f5b4d7c 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -647,7 +647,7 @@ MIME-Version header before proceeding." (unless from (setq from (mail-fetch-field "from"))) ;; FIXME: In some circumstances, this code is running within - ;; an unibyte macro. mail-extract-address-components + ;; a unibyte macro. mail-extract-address-components ;; creates unibyte buffers. This `if', though not a perfect ;; solution, avoids most of them. (if from diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index e909372..6802484 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -438,7 +438,7 @@ Valid types include `google', `dejanews', and `gmane'.") t) (defun nnweb-google-identity (url) - "Return an unique identifier based on URL." + "Return a unique identifier based on URL." (if (string-match "selm=\\([^ &>]+\\)" url) (match-string 1 url) url)) diff --git a/lisp/org/org.el b/lisp/org/org.el index 30bb98d..78536eb 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -20348,7 +20348,7 @@ This command does many different things, depending on context: (item ;; At an item: a double C-u set checkbox to "[-]" ;; unconditionally, whereas a single one will toggle its - ;; presence. Without an universal argument, if the item + ;; presence. Without a universal argument, if the item ;; has a checkbox, toggle it. Otherwise repair the list. (let* ((box (org-element-property :checkbox context)) (struct (org-element-property :structure context)) diff --git a/lisp/org/ox-ascii.el b/lisp/org/ox-ascii.el index cd2a9af..50a2011 100644 --- a/lisp/org/ox-ascii.el +++ b/lisp/org/ox-ascii.el @@ -185,7 +185,7 @@ original Org buffer at the same place." :package-version '(Org . "8.0") :type '(choice (const :tag "Replicate original spacing" nil) - (cons :tag "Set an uniform spacing" + (cons :tag "Set a uniform spacing" (integer :tag "Number of blank lines before contents") (integer :tag "Number of blank lines after contents")))) diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 1b77eaf..b6646e7 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -20769,7 +20769,7 @@ * fontset.c (syms_of_fontset): Setup Vfont_encoding_alist here. - * editfns.c (Fformat): Convert an unibyte char argument that is + * editfns.c (Fformat): Convert a unibyte char argument that is formatted by "%c" to multibyte if the total result must be a multibyte string. diff --git a/src/alloc.c b/src/alloc.c index 1019c2a..35a5ee2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2226,7 +2226,7 @@ make_string (const char *contents, ptrdiff_t nbytes) return val; } -/* Make an unibyte string from LENGTH bytes at CONTENTS. */ +/* Make a unibyte string from LENGTH bytes at CONTENTS. */ Lisp_Object make_unibyte_string (const char *contents, ptrdiff_t length) @@ -2295,7 +2295,7 @@ make_specified_string (const char *contents, } -/* Return an unibyte Lisp_String set up to hold LENGTH characters +/* Return a unibyte Lisp_String set up to hold LENGTH characters occupying LENGTH bytes. */ Lisp_Object diff --git a/src/indent.c b/src/indent.c index e6b267a..04f5d6c 100644 --- a/src/indent.c +++ b/src/indent.c @@ -439,7 +439,7 @@ current_column (void) /* With a display table entry, C is displayed as is, and not displayed as \NNN or as ^N. If C is a single-byte character, it takes one column. If C is multi-byte in - an unibyte buffer, it's translated to unibyte, so it + a unibyte buffer, it's translated to unibyte, so it also takes one column. */ ++col; else commit c54f8f8aebe27089a1f84d9fc24b37c93762a7e5 Author: Glenn Morris Date: Tue Dec 9 18:24:33 2014 -0500 eww.texi: Add missing "." diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index e6221ce..c8118d1 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -237,7 +237,7 @@ variables @code{shr-color-visible-distance-min} and In addition to maintaining the history at run-time, EWW will also save the partial state of its buffers (the URIs and the titles of the pages visited) in the desktop file if one is used. @xref{Saving Emacs -Sessions, , emacs, The GNU Emacs Manual} +Sessions, , emacs, The GNU Emacs Manual}. @vindex eww-desktop-remove-duplicates EWW history may sensibly contain multiple entries for the same page commit 08a980a4007fe7543cdc47af072dfbd834319927 Author: Lars Magne Ingebrigtsen Date: Tue Dec 9 22:32:44 2014 +0000 lisp/gnus/gnus-art.el: Refactored out gnus-article-mime-handles diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2f0641f..d8dd1d3 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2014-12-09 Lars Magne Ingebrigtsen + + * gnus-art.el (gnus-article-mime-handles): Refactored out into own + function for reuse. + (gnus-mime-buttonize-attachments-in-header): Adjusted. + 2014-12-07 Lars Magne Ingebrigtsen * message.el (message-change-subject): Really check whether the subject @@ -13,7 +19,7 @@ * gnus-cloud.el (gnus-cloud): Add :version tag. -2014-11-29 John Mastro (tiny change) +2014-11-29 John Mastro (tiny change) * auth-source.el (auth-source-macos-keychain-search-items): Return result of `auth-source-macos-keychain-result-append' (bug#19074). diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 62a60b2..53da05e 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -6335,6 +6335,40 @@ Provided for backwards compatibility." (when image (gnus-add-image 'shr image)))) +(defun gnus-article-mime-handles (&optional alist id all) + (if alist + (let ((i 1) newid flat) + (dolist (handle alist flat) + (setq newid (append id (list i)) + i (1+ i)) + (if (stringp (car handle)) + (setq flat (nconc flat (gnus-article-mime-handles + (cdr handle) newid all))) + (delq (rassq handle all) all) + (setq flat (nconc flat (list (cons newid handle))))))) + (let ((flat (list nil))) + ;; Assume that elements of `gnus-article-mime-handle-alist' + ;; are in the decreasing order, but unnumbered subsidiaries + ;; in each element are in the increasing order. + (dolist (handle (reverse gnus-article-mime-handle-alist)) + (if (stringp (cadr handle)) + (setq flat (nconc flat (gnus-article-mime-handles + (cddr handle) (list (car handle)) flat))) + (delq (rassq (cdr handle) flat) flat) + (setq flat (nconc flat (list (cons (list (car handle)) + (cdr handle))))))) + (setq flat (cdr flat)) + (mapc (lambda (handle) + (if (cdar handle) + ;; This is a hidden (i.e. unnumbered) handle. + (progn + (setcar handle + (1+ (caar gnus-article-mime-handle-alist))) + (push handle gnus-article-mime-handle-alist)) + (setcar handle (caar handle)))) + flat) + flat))) + (defun gnus-mime-buttonize-attachments-in-header (&optional interactive) "Show attachments as buttons in the end of the header of an article. This function toggles the display when called interactively. Note that @@ -6342,108 +6376,70 @@ buttons to be added to the header are only the ones that aren't inlined in the body. Use `gnus-header-face-alist' to highlight buttons." (interactive (list t)) (gnus-with-article-buffer - (gmm-labels - ;; Function that returns a flattened version of - ;; `gnus-article-mime-handle-alist'. - ((flattened-alist - (&optional alist id all) - (if alist - (let ((i 1) newid flat) - (dolist (handle alist flat) - (setq newid (append id (list i)) - i (1+ i)) - (if (stringp (car handle)) - (setq flat (nconc flat (flattened-alist (cdr handle) - newid all))) - (delq (rassq handle all) all) - (setq flat (nconc flat (list (cons newid handle))))))) - (let ((flat (list nil))) - ;; Assume that elements of `gnus-article-mime-handle-alist' - ;; are in the decreasing order, but unnumbered subsidiaries - ;; in each element are in the increasing order. - (dolist (handle (reverse gnus-article-mime-handle-alist)) - (if (stringp (cadr handle)) - (setq flat (nconc flat (flattened-alist (cddr handle) - (list (car handle)) - flat))) - (delq (rassq (cdr handle) flat) flat) - (setq flat (nconc flat (list (cons (list (car handle)) - (cdr handle))))))) - (setq flat (cdr flat)) - (mapc (lambda (handle) - (if (cdar handle) - ;; This is a hidden (i.e. unnumbered) handle. - (progn - (setcar handle - (1+ (caar gnus-article-mime-handle-alist))) - (push handle gnus-article-mime-handle-alist)) - (setcar handle (caar handle)))) - flat) - flat)))) - (let ((case-fold-search t) buttons handle type st) - (save-excursion - (save-restriction - (widen) - (article-narrow-to-head) - ;; Header buttons exist? - (while (and (not buttons) - (re-search-forward "^attachments?:[\n ]+" nil t)) - (when (get-char-property (match-end 0) - 'gnus-button-attachment-extra) - (setq buttons (match-beginning 0)))) - (widen) + (let ((case-fold-search t) buttons handle type st) + (save-excursion + (save-restriction + (widen) + (article-narrow-to-head) + ;; Header buttons exist? + (while (and (not buttons) + (re-search-forward "^attachments?:[\n ]+" nil t)) + (when (get-char-property (match-end 0) + 'gnus-button-attachment-extra) + (setq buttons (match-beginning 0)))) + (widen) + (when buttons + ;; Delete header buttons. + (delete-region buttons (if (re-search-forward "^[^ ]" nil t) + (match-beginning 0) + (point-max)))) + (unless (and interactive buttons) + ;; Find buttons. + (setq buttons nil) + (dolist (button (gnus-article-mime-handles)) + (setq handle (cdr button) + type (mm-handle-media-type handle)) + (when (or (and (if (gnus-buffer-live-p gnus-summary-buffer) + (with-current-buffer gnus-summary-buffer + gnus-inhibit-images) + gnus-inhibit-images) + (string-match "\\`image/" type)) + (mm-inline-override-p handle) + (and (mm-handle-disposition handle) + (not (equal (car (mm-handle-disposition handle)) + "inline")) + (not (mm-attachment-override-p handle))) + (not (mm-automatic-display-p handle)) + (not (or (and (mm-inlinable-p handle) + (mm-inlined-p handle)) + (mm-automatic-external-display-p type)))) + (push button buttons))) (when buttons - ;; Delete header buttons. - (delete-region buttons (if (re-search-forward "^[^ ]" nil t) - (match-beginning 0) - (point-max)))) - (unless (and interactive buttons) - ;; Find buttons. - (setq buttons nil) - (dolist (button (flattened-alist)) - (setq handle (cdr button) - type (mm-handle-media-type handle)) - (when (or (and (if (gnus-buffer-live-p gnus-summary-buffer) - (with-current-buffer gnus-summary-buffer - gnus-inhibit-images) - gnus-inhibit-images) - (string-match "\\`image/" type)) - (mm-inline-override-p handle) - (and (mm-handle-disposition handle) - (not (equal (car (mm-handle-disposition handle)) - "inline")) - (not (mm-attachment-override-p handle))) - (not (mm-automatic-display-p handle)) - (not (or (and (mm-inlinable-p handle) - (mm-inlined-p handle)) - (mm-automatic-external-display-p type)))) - (push button buttons))) - (when buttons - ;; Add header buttons. - (article-goto-body) - (forward-line -1) - (narrow-to-region (point) (point)) - (insert "Attachment" (if (cdr buttons) "s" "") ":") - (dolist (button (nreverse buttons)) - (setq st (point)) - (insert " ") - (mm-handle-set-undisplayer - (setq handle (copy-sequence (cdr button))) nil) - (gnus-insert-mime-button handle (car button)) - (skip-chars-backward "\t\n ") - (delete-region (point) (point-max)) - (when (> (current-column) (window-width)) - (goto-char st) - (insert "\n") - (end-of-line))) - (insert "\n") - (dolist (ovl (gnus-overlays-in (point-min) (point))) - (gnus-overlay-put ovl 'gnus-button-attachment-extra t) - (gnus-overlay-put ovl 'face nil)) - (let ((gnus-treatment-function-alist - '((gnus-treat-highlight-headers - gnus-article-highlight-headers)))) - (gnus-treat-article 'head)))))))))) + ;; Add header buttons. + (article-goto-body) + (forward-line -1) + (narrow-to-region (point) (point)) + (insert "Attachment" (if (cdr buttons) "s" "") ":") + (dolist (button (nreverse buttons)) + (setq st (point)) + (insert " ") + (mm-handle-set-undisplayer + (setq handle (copy-sequence (cdr button))) nil) + (gnus-insert-mime-button handle (car button)) + (skip-chars-backward "\t\n ") + (delete-region (point) (point-max)) + (when (> (current-column) (window-width)) + (goto-char st) + (insert "\n") + (end-of-line))) + (insert "\n") + (dolist (ovl (gnus-overlays-in (point-min) (point))) + (gnus-overlay-put ovl 'gnus-button-attachment-extra t) + (gnus-overlay-put ovl 'face nil)) + (let ((gnus-treatment-function-alist + '((gnus-treat-highlight-headers + gnus-article-highlight-headers)))) + (gnus-treat-article 'head))))))))) ;;; Article savers. commit e8acfc7fb4a6c01d50ed121ca5ce2ed41f7b0db9 Author: Bozhidar Batsov Date: Tue Dec 9 19:43:24 2014 +0200 Add a command for string quotes toggling to ruby-mode * progmodes/ruby-mode.el (ruby-toggle-string-quotes): New command that allows you to quickly toggle between single-quoted and double-quoted string literals. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5ed3e47..3ab15aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,8 @@ * progmodes/ruby-mode.el (auto-mode-alist): Add .rabl, Berksfile and Puppetfile. + (ruby-toggle-string-quotes): New command that allows you to quickly + toggle between single-quoted and double-quoted string literals. 2014-12-09 Eric S. Raymond diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 803bf57..225f1f6 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -152,6 +152,7 @@ This should only be called after matching against `ruby-here-doc-beg-re'." (define-key map (kbd "M-C-p") 'ruby-beginning-of-block) (define-key map (kbd "M-C-n") 'ruby-end-of-block) (define-key map (kbd "C-c {") 'ruby-toggle-block) + (define-key map (kbd "C-c '") 'ruby-toggle-string-quotes) map) "Keymap used in Ruby mode.") @@ -164,6 +165,8 @@ This should only be called after matching against `ruby-here-doc-beg-re'." ["End of Block" ruby-end-of-block t] ["Toggle Block" ruby-toggle-block t] "--" + ["Toggle String Quotes" ruby-toggle-string-quotes t] + "--" ["Backward Sexp" ruby-backward-sexp :visible (not ruby-use-smie)] ["Backward Sexp" backward-sexp @@ -1763,6 +1766,48 @@ If the result is do-end block, it will always be multiline." (ruby-do-end-to-brace beg end))) (goto-char start)))) +(defun ruby--string-region () + "Return region for string at point." + (let ((orig-point (point)) (regex "'\\(\\(\\\\'\\)\\|[^']\\)*'\\|\"\\(\\(\\\\\"\\)\\|[^\"]\\)*\"") beg end) + (save-excursion + (goto-char (line-beginning-position)) + (while (and (re-search-forward regex (line-end-position) t) (not (and beg end))) + (let ((match-beg (match-beginning 0)) (match-end (match-end 0))) + (when (and + (> orig-point match-beg) + (< orig-point match-end)) + (setq beg match-beg) + (setq end match-end)))) + (and beg end (list beg end))))) + +(defun ruby-string-at-point-p () + "Check if cursor is at a string or not." + (ruby--string-region)) + +(defun ruby--inverse-string-quote (string-quote) + "Get the inverse string quoting for STRING-QUOTE." + (if (equal string-quote "\"") "'" "\"")) + +(defun ruby-toggle-string-quotes () + "Toggle string literal quoting between single and double." + (interactive) + (when (ruby-string-at-point-p) + (let* ((region (ruby--string-region)) + (min (nth 0 region)) + (max (nth 1 region)) + (string-quote (ruby--inverse-string-quote (buffer-substring-no-properties min (1+ min)))) + (content + (buffer-substring-no-properties (1+ min) (1- max)))) + (setq content + (if (equal string-quote "\"") + (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\([^\\\\]\\)'" "\\1\\\\'" content)) + (replace-regexp-in-string "\\\\\'" "'" (replace-regexp-in-string "\\([^\\\\]\\)\"" "\\1\\\\\"" content)))) + (let ((orig-point (point))) + (delete-region min max) + (insert + (format "%s%s%s" string-quote content string-quote)) + (goto-char orig-point))))) + (eval-and-compile (defconst ruby-percent-literal-beg-re "\\(%\\)[qQrswWxIi]?\\([[:punct:]]\\)" commit 9b185aa1ae060025f5479cf8d6d64548aff8dbe3 Author: Andy Moreton Date: Tue Dec 9 19:16:55 2014 +0200 gnutls.c (gnutls_protocol_get_name): Fix a copy/paste typo. diff --git a/src/ChangeLog b/src/ChangeLog index b65fbb5..762ce48 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2014-12-09 Andy Moreton (tiny change) + + * gnutls.c (gnutls_protocol_get_name): Fix a copy/paste typo. + 2014-12-08 Lars Magne Ingebrigtsen * gnutls.c (Fgnutls_peer_status): Return the key exchange, cipher diff --git a/src/gnutls.c b/src/gnutls.c index 46ef211..aa800be 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -194,7 +194,7 @@ DEF_GNUTLS_FN (gnutls_kx_algorithm_t, gnutls_kx_get, (gnutls_session_t)); DEF_GNUTLS_FN (const char*, gnutls_kx_get_name, (gnutls_kx_algorithm_t)); DEF_GNUTLS_FN (gnutls_protocol_t, gnutls_protocol_get_version, (gnutls_session_t)); -DEF_GNUTLS_FN (const char*, gnutls_protocol_get_version, (gnutls_protocol_t)); +DEF_GNUTLS_FN (const char*, gnutls_protocol_get_name, (gnutls_protocol_t)); DEF_GNUTLS_FN (gnutls_cipher_algorithm_t, gnutls_cipher_get, (gnutls_session_t)); DEF_GNUTLS_FN (const char*, gnutls_cipher_get_name, commit fda355b5bd8330762cb7894fc038492c6c9720a1 Author: Bozhidar Batsov Date: Tue Dec 9 19:05:13 2014 +0200 Associate more files with ruby-mode * progmodes/ruby-mode.el (auto-mode-alist): Add .rabl, Berksfile and Puppetfile. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bf139d6..5ed3e47 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-09 Bozhidar Batsov + + * progmodes/ruby-mode.el (auto-mode-alist): Add .rabl, Berksfile + and Puppetfile. + 2014-12-09 Eric S. Raymond * vc/vc-src.el (vc-src-do-comand): Prepend -- to file argument diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 2f23e33..803bf57 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2206,9 +2206,10 @@ See `font-lock-syntax-table'.") (add-to-list 'auto-mode-alist (cons (purecopy (concat "\\(?:\\." "rb\\|ru\\|rake\\|thor" - "\\|jbuilder\\|gemspec\\|podspec" + "\\|jbuilder\\|rabl\\|gemspec\\|podspec" "\\|/" "\\(?:Gem\\|Rake\\|Cap\\|Thor" + "\\|Puppet\\|Berks" "\\|Vagrant\\|Guard\\|Pod\\)file" "\\)\\'")) 'ruby-mode)) commit baab20d73e2a3ee6a06dc83fe97d0b781870e29f Author: Eric S. Raymond Date: Tue Dec 9 06:55:54 2014 -0500 vc/vc-src.el (vc-src-do-comand): Prepend -- to file argument list * vc/vc-src.el (vc-src-do-comand): Prepend -- to file argument list, avoids problems witth names containing hyphens. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 81afe8a..bf139d6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-09 Eric S. Raymond + + * vc/vc-src.el (vc-src-do-comand): Prepend -- to file argument + list, avoids problems witth names containing hyphens. + 2014-12-09 Wilson Snyder Sync with upstream verilog-mode revision aa4b777. diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el index 3186d72..36d6a20 100644 --- a/lisp/vc/vc-src.el +++ b/lisp/vc/vc-src.el @@ -193,7 +193,12 @@ For a description of possible values, see `vc-check-master-templates'." (defun vc-src-command (buffer file-or-list &rest flags) "A wrapper around `vc-do-command' for use in vc-src.el. This function differs from vc-do-command in that it invokes `vc-src-program'." - (apply 'vc-do-command (or buffer "*vc*") 0 vc-src-program file-or-list flags)) + (let (file-list) + (cond ((stringp file-or-list) + (setq file-list (list "--" file-or-list))) + (file-or-list + (setq file-list (cons "--" file-or-list)))) + (apply 'vc-do-command (or buffer "*vc*") 0 vc-src-program file-list flags))) (defun vc-src-working-revision (file) "SRC-specific version of `vc-working-revision'." commit bc71376cc02b39e10f1ceb047f698bf614e18811 Author: Eric S. Raymond Date: Mon Dec 8 17:15:58 2014 -0500 Typo fix. diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index d969b8e..3ed8c13 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -5,7 +5,7 @@ 2014-12-08 Eric S. Raymond - * maintaining.texi: Suopport fo Arch has been moved to obolte, + * maintaining.texi: Suopport fo Arch has been moved to obosolete, remove references that imply otherwise. 2014-11-29 Paul Eggert