commit 938426d1ca0930b859c3e37b26513f5d74761284 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Sun Feb 19 09:33:24 2017 +0100 Fix bug#25788 * lisp/net/tramp.el (tramp-autoload-file-name-handler): Do not load tramp.el just for "/". (Bug#25788) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 2bd75ab83f..b05d55f9e0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2156,11 +2156,14 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;;;###autoload (progn (defun tramp-autoload-file-name-handler (operation &rest args) "Load Tramp file name handler, and perform OPERATION." - ;; Avoid recursive loading of tramp.el. - (if (let ((default-directory temporary-file-directory)) - (and (null load-in-progress) (load "tramp" 'noerror 'nomessage))) + (if (and + ;; Do not load tramp.el just for "/". + (not (and (stringp (car args)) (string-equal (car args) "/"))) + ;; Avoid recursive loading of tramp.el. + (let ((default-directory temporary-file-directory)) + (and (null load-in-progress) (load "tramp" 'noerror 'nomessage)))) (apply operation args) - ;; tramp.el not available for loading, fall back. + ;; tramp.el not needed or not available for loading, fall back. (tramp-completion-run-real-handler operation args)))) ;; `tramp-autoload-file-name-handler' must be registered before commit e420e9f032dc3d73f89dee569c54fcf98618a50c Author: YAMAMOTO Mitsuharu Date: Sun Feb 19 13:42:05 2017 +0900 Fix fringe bitmap initialization on MS-Windows * src/fringe.c (init_fringe_bitmap) [HAVE_NTGUI]: Fix initialization of fb->bits. (Bug#25673) diff --git a/src/fringe.c b/src/fringe.c index c41a5d3f5e..dbcd52be05 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -1449,6 +1449,19 @@ init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p) #endif /* not USE_CAIRO */ #endif /* HAVE_X_WINDOWS */ +#ifdef HAVE_NTGUI + unsigned short *bits = fb->bits; + int j; + for (j = 0; j < fb->height; j++) + { + unsigned short b = *bits; + b <<= (16 - fb->width); +#ifndef WORDS_BIGENDIAN + b = ((b >> 8) | (b << 8)); +#endif + *bits++ = b; + } +#endif } if (!once_p) commit fe927ecfe45f66ec58d9e7cab6f2526fc87a6803 Author: Stefan Monnier Date: Sat Feb 18 22:37:05 2017 -0500 Change type of `rehash_threshold' and `pure' fields in hash-tables * src/lisp.h (struct Lisp_Hash_Table): Change type of `rehash_threshold' and `pure' fields and move them after `count'. * src/fns.c (make_hash_table): Change type of `rehash_threshold' and `pure'. (Fmake_hash_table, Fhash_table_rehash_threshold): * src/category.c (hash_get_category_set): * src/xterm.c (syms_of_xterm): * src/profiler.c (make_log): * src/print.c (print_object): * src/alloc.c (purecopy_hash_table, purecopy): Adjust accordingly. diff --git a/src/alloc.c b/src/alloc.c index deb1ca3250..b579e7ed1a 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5443,7 +5443,7 @@ static struct Lisp_Hash_Table * purecopy_hash_table (struct Lisp_Hash_Table *table) { eassert (NILP (table->weak)); - eassert (!NILP (table->pure)); + eassert (table->pure); struct Lisp_Hash_Table *pure = pure_alloc (sizeof *pure, Lisp_Vectorlike); struct hash_table_test pure_test = table->test; @@ -5457,14 +5457,14 @@ purecopy_hash_table (struct Lisp_Hash_Table *table) pure->header = table->header; pure->weak = purecopy (Qnil); pure->rehash_size = purecopy (table->rehash_size); - pure->rehash_threshold = purecopy (table->rehash_threshold); pure->hash = purecopy (table->hash); pure->next = purecopy (table->next); pure->next_free = purecopy (table->next_free); pure->index = purecopy (table->index); pure->count = table->count; + pure->pure = table->pure; + pure->rehash_threshold = table->rehash_threshold; pure->key_and_value = purecopy (table->key_and_value); - pure->pure = purecopy (table->pure); return pure; } @@ -5524,7 +5524,7 @@ purecopy (Lisp_Object obj) /* Do not purify hash tables which haven't been defined with :purecopy as non-nil or are weak - they aren't guaranteed to not change. */ - if (!NILP (table->weak) || NILP (table->pure)) + if (!NILP (table->weak) || !table->pure) { /* Instead, add the hash table to the list of pinned objects, so that it will be marked during GC. */ diff --git a/src/category.c b/src/category.c index ff287a4af3..f5edd20c8a 100644 --- a/src/category.c +++ b/src/category.c @@ -66,8 +66,8 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set) (table, 1, make_hash_table (hashtest_equal, make_number (DEFAULT_HASH_SIZE), make_float (DEFAULT_REHASH_SIZE), - make_float (DEFAULT_REHASH_THRESHOLD), - Qnil, Qnil)); + DEFAULT_REHASH_THRESHOLD, + Qnil, false)); h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]); i = hash_lookup (h, category_set, &hash); if (i >= 0) diff --git a/src/fns.c b/src/fns.c index ffe3218ca7..e3e040b82d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3676,8 +3676,8 @@ allocate_hash_table (void) Lisp_Object make_hash_table (struct hash_table_test test, Lisp_Object size, Lisp_Object rehash_size, - Lisp_Object rehash_threshold, Lisp_Object weak, - Lisp_Object pure) + float rehash_threshold, Lisp_Object weak, + bool pure) { struct Lisp_Hash_Table *h; Lisp_Object table; @@ -3690,15 +3690,13 @@ make_hash_table (struct hash_table_test test, eassert (INTEGERP (size) && XINT (size) >= 0); eassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0) || (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size))); - eassert (FLOATP (rehash_threshold) - && 0 < XFLOAT_DATA (rehash_threshold) - && XFLOAT_DATA (rehash_threshold) <= 1.0); + eassert (0 < rehash_threshold && rehash_threshold <= 1.0); if (XFASTINT (size) == 0) size = make_number (1); sz = XFASTINT (size); - index_float = sz / XFLOAT_DATA (rehash_threshold); + index_float = sz / rehash_threshold; index_size = (index_float < INDEX_SIZE_BOUND + 1 ? next_almost_prime (index_float) : INDEX_SIZE_BOUND + 1); @@ -3797,7 +3795,7 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h) else new_size = INDEX_SIZE_BOUND + 1; } - index_float = new_size / XFLOAT_DATA (h->rehash_threshold); + index_float = new_size / h->rehash_threshold; index_size = (index_float < INDEX_SIZE_BOUND + 1 ? next_almost_prime (index_float) : INDEX_SIZE_BOUND + 1); @@ -4391,7 +4389,9 @@ in an error. usage: (make-hash-table &rest KEYWORD-ARGS) */) (ptrdiff_t nargs, Lisp_Object *args) { - Lisp_Object test, size, rehash_size, rehash_threshold, weak, pure; + Lisp_Object test, size, rehash_size, weak; + float rehash_threshold; + bool pure; struct hash_table_test testdesc; ptrdiff_t i; USE_SAFE_ALLOCA; @@ -4427,7 +4427,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) /* See if there's a `:purecopy PURECOPY' argument. */ i = get_key_arg (QCpurecopy, nargs, args, used); - pure = i ? args[i] : Qnil; + pure = i && !NILP (args[i]); /* See if there's a `:size SIZE' argument. */ i = get_key_arg (QCsize, nargs, args, used); size = i ? args[i] : Qnil; @@ -4445,11 +4445,11 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) /* Look for `:rehash-threshold THRESHOLD'. */ i = get_key_arg (QCrehash_threshold, nargs, args, used); - rehash_threshold = i ? args[i] : make_float (DEFAULT_REHASH_THRESHOLD); - if (! (FLOATP (rehash_threshold) - && 0 < XFLOAT_DATA (rehash_threshold) - && XFLOAT_DATA (rehash_threshold) <= 1)) - signal_error ("Invalid hash table rehash threshold", rehash_threshold); + rehash_threshold = + i ? (FLOATP (args[i]) ? XFLOAT_DATA (args[i]) : -1.0) + : DEFAULT_REHASH_THRESHOLD; + if (! (0 < rehash_threshold && rehash_threshold <= 1)) + signal_error ("Invalid hash table rehash threshold", args[i]); /* Look for `:weakness WEAK'. */ i = get_key_arg (QCweakness, nargs, args, used); @@ -4504,7 +4504,7 @@ DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold, doc: /* Return the current rehash threshold of TABLE. */) (Lisp_Object table) { - return check_hash_table (table)->rehash_threshold; + return make_float (check_hash_table (table)->rehash_threshold); } diff --git a/src/lisp.h b/src/lisp.h index 080bcf74ce..985d54a079 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1974,10 +1974,6 @@ struct Lisp_Hash_Table new size by multiplying the old size with this factor. */ Lisp_Object rehash_size; - /* Resize hash table when number of entries/ table size is >= this - ratio, a float. */ - Lisp_Object rehash_threshold; - /* Vector of hash codes. If hash[I] is nil, this means that the I-th entry is unused. */ Lisp_Object hash; @@ -1995,10 +1991,6 @@ struct Lisp_Hash_Table hash table size to reduce collisions. */ Lisp_Object index; - /* Non-nil if the table can be purecopied. The table cannot be - changed afterwards. */ - Lisp_Object pure; - /* Only the fields above are traced normally by the GC. The ones below `count' are special and are either ignored by the GC or traced in a special way (e.g. because of weakness). */ @@ -2006,6 +1998,14 @@ struct Lisp_Hash_Table /* Number of key/value entries in the table. */ ptrdiff_t count; + /* Non-nil if the table can be purecopied. The table cannot be + changed afterwards. */ + bool_bf pure : 1; + + /* Resize hash table when number of entries/ table size is >= this + ratio, a float. */ + float rehash_threshold; + /* Vector of keys and values. The key of item I is found at index 2 * I, the value is found at index 2 * I + 1. This is gc_marked specially if the table is weak. */ @@ -3361,8 +3361,10 @@ extern Lisp_Object larger_vector (Lisp_Object, ptrdiff_t, ptrdiff_t); extern void sweep_weak_hash_tables (void); EMACS_UINT hash_string (char const *, ptrdiff_t); EMACS_UINT sxhash (Lisp_Object, int); -Lisp_Object make_hash_table (struct hash_table_test, Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object make_hash_table (struct hash_table_test test, + Lisp_Object size, Lisp_Object rehash_size, + float rehash_threshold, Lisp_Object weak, + bool pure); ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *); ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object, EMACS_UINT); diff --git a/src/print.c b/src/print.c index db3d00f51f..3a36a4eb54 100644 --- a/src/print.c +++ b/src/print.c @@ -1812,16 +1812,14 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) print_object (h->rehash_size, printcharfun, escapeflag); } - if (!NILP (h->rehash_threshold)) - { - print_c_string (" rehash-threshold ", printcharfun); - print_object (h->rehash_threshold, printcharfun, escapeflag); - } + print_c_string (" rehash-threshold ", printcharfun); + print_object (make_float (h->rehash_threshold), + printcharfun, escapeflag); - if (!NILP (h->pure)) + if (h->pure) { print_c_string (" purecopy ", printcharfun); - print_object (h->pure, printcharfun, escapeflag); + print_object (h->pure ? Qt : Qnil, printcharfun, escapeflag); } print_c_string (" data ", printcharfun); diff --git a/src/profiler.c b/src/profiler.c index a223a7e7c0..edc28fc842 100644 --- a/src/profiler.c +++ b/src/profiler.c @@ -47,8 +47,8 @@ make_log (EMACS_INT heap_size, EMACS_INT max_stack_depth) Lisp_Object log = make_hash_table (hashtest_profiler, make_number (heap_size), make_float (DEFAULT_REHASH_SIZE), - make_float (DEFAULT_REHASH_THRESHOLD), - Qnil, Qnil); + DEFAULT_REHASH_THRESHOLD, + Qnil, false); struct Lisp_Hash_Table *h = XHASH_TABLE (log); /* What is special about our hash-tables is that the keys are pre-filled diff --git a/src/xterm.c b/src/xterm.c index 38229a5f31..b04c6999b3 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12876,8 +12876,8 @@ keysyms. The default is nil, which is the same as `super'. */); doc: /* Hash table of character codes indexed by X keysym codes. */); Vx_keysym_table = make_hash_table (hashtest_eql, make_number (900), make_float (DEFAULT_REHASH_SIZE), - make_float (DEFAULT_REHASH_THRESHOLD), - Qnil, Qnil); + DEFAULT_REHASH_THRESHOLD, + Qnil, false); DEFVAR_BOOL ("x-frame-normalize-before-maximize", x_frame_normalize_before_maximize, commit b2a83eed23d540b4b0ab9e0bf5605821011bfd7d Author: Paul Eggert Date: Sat Feb 18 18:16:37 2017 -0800 Use 'char *FOO' instead of 'char* FOO' diff --git a/src/alloc.c b/src/alloc.c index 62f43669f2..deb1ca3250 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -7237,9 +7237,9 @@ find_suspicious_object_in_range (void *begin, void *end) } static void -note_suspicious_free (void* ptr) +note_suspicious_free (void *ptr) { - struct suspicious_free_record* rec; + struct suspicious_free_record *rec; rec = &suspicious_free_history[suspicious_free_history_index++]; if (suspicious_free_history_index == @@ -7254,7 +7254,7 @@ note_suspicious_free (void* ptr) } static void -detect_suspicious_free (void* ptr) +detect_suspicious_free (void *ptr) { int i; diff --git a/src/callproc.c b/src/callproc.c index 84324c48dc..08fa6e9772 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1381,7 +1381,7 @@ getenv_internal (const char *var, ptrdiff_t varlen, char **value, without recording them in Vprocess_environment. */ #ifdef WINDOWSNT { - char* tmpval = getenv (var); + char *tmpval = getenv (var); if (tmpval) { *value = tmpval; diff --git a/src/data.c b/src/data.c index ba5bdc5df3..32ec89871a 100644 --- a/src/data.c +++ b/src/data.c @@ -1426,7 +1426,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, static void set_symbol_trapped_write (Lisp_Object symbol, enum symbol_trapped_write trap) { - struct Lisp_Symbol* sym = XSYMBOL (symbol); + struct Lisp_Symbol *sym = XSYMBOL (symbol); if (sym->trapped_write == SYMBOL_NOWRITE) xsignal1 (Qtrapping_constant, symbol); sym->trapped_write = trap; diff --git a/src/dbusbind.c b/src/dbusbind.c index 077e8fdc06..e7c3251c14 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -941,7 +941,7 @@ xd_get_connection_references (DBusConnection *connection) } /* Convert a Lisp D-Bus object to a pointer. */ -static DBusConnection* +static DBusConnection * xd_lisp_dbus_to_dbus (Lisp_Object bus) { return (DBusConnection *) XSAVE_POINTER (bus, 0); diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index 64b74ea24c..75cb3c1c72 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -148,7 +148,7 @@ emacs_fixed_class_init (EmacsFixedClass *klass) { GtkWidgetClass *widget_class; - widget_class = (GtkWidgetClass*) klass; + widget_class = (GtkWidgetClass *) klass; widget_class->get_preferred_width = emacs_fixed_get_preferred_width; widget_class->get_preferred_height = emacs_fixed_get_preferred_height; @@ -205,9 +205,9 @@ emacs_fixed_get_preferred_height (GtkWidget *widget, (Bug#8919), and so users can resize our frames as they wish. */ void -XSetWMSizeHints (Display* d, +XSetWMSizeHints (Display *d, Window w, - XSizeHints* hints, + XSizeHints *hints, Atom prop) { struct x_display_info *dpyinfo = x_display_info_for_display (d); diff --git a/src/gnutls.c b/src/gnutls.c index d0d7f2dfc8..28ab10de05 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -142,7 +142,7 @@ DEF_DLL_FN (int, gnutls_x509_crt_get_dn, (gnutls_x509_crt_t, char *, size_t *)); DEF_DLL_FN (int, gnutls_x509_crt_get_pk_algorithm, (gnutls_x509_crt_t, unsigned int *)); -DEF_DLL_FN (const char*, gnutls_pk_algorithm_get_name, +DEF_DLL_FN (const char *, gnutls_pk_algorithm_get_name, (gnutls_pk_algorithm_t)); DEF_DLL_FN (int, gnutls_pk_bits_to_sec_param, (gnutls_pk_algorithm_t, unsigned int)); @@ -154,22 +154,22 @@ DEF_DLL_FN (int, gnutls_x509_crt_get_signature_algorithm, (gnutls_x509_crt_t)); DEF_DLL_FN (int, gnutls_x509_crt_get_key_id, (gnutls_x509_crt_t, unsigned int, unsigned char *, size_t *_size)); -DEF_DLL_FN (const char*, gnutls_sec_param_get_name, (gnutls_sec_param_t)); -DEF_DLL_FN (const char*, gnutls_sign_get_name, (gnutls_sign_algorithm_t)); +DEF_DLL_FN (const char *, gnutls_sec_param_get_name, (gnutls_sec_param_t)); +DEF_DLL_FN (const char *, gnutls_sign_get_name, (gnutls_sign_algorithm_t)); DEF_DLL_FN (int, gnutls_server_name_set, (gnutls_session_t, gnutls_server_name_type_t, const void *, size_t)); DEF_DLL_FN (gnutls_kx_algorithm_t, gnutls_kx_get, (gnutls_session_t)); -DEF_DLL_FN (const char*, gnutls_kx_get_name, (gnutls_kx_algorithm_t)); +DEF_DLL_FN (const char *, gnutls_kx_get_name, (gnutls_kx_algorithm_t)); DEF_DLL_FN (gnutls_protocol_t, gnutls_protocol_get_version, (gnutls_session_t)); -DEF_DLL_FN (const char*, gnutls_protocol_get_name, (gnutls_protocol_t)); +DEF_DLL_FN (const char *, gnutls_protocol_get_name, (gnutls_protocol_t)); DEF_DLL_FN (gnutls_cipher_algorithm_t, gnutls_cipher_get, (gnutls_session_t)); -DEF_DLL_FN (const char*, gnutls_cipher_get_name, +DEF_DLL_FN (const char *, gnutls_cipher_get_name, (gnutls_cipher_algorithm_t)); DEF_DLL_FN (gnutls_mac_algorithm_t, gnutls_mac_get, (gnutls_session_t)); -DEF_DLL_FN (const char*, gnutls_mac_get_name, (gnutls_mac_algorithm_t)); +DEF_DLL_FN (const char *, gnutls_mac_get_name, (gnutls_mac_algorithm_t)); static bool diff --git a/src/gtkutil.c b/src/gtkutil.c index b028254a51..3a00e36222 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1694,7 +1694,7 @@ pop_down_dialog (void *arg) } /* If there are any emacs timers pending, add a timeout to main loop in DATA. - We pass in DATA as gpointer* so we can use this as a callback. */ + Pass DATA as gpointer so we can use this as a callback. */ static gboolean xg_maybe_add_timer (gpointer data) diff --git a/src/inotify.c b/src/inotify.c index 701d8ff3b3..61ef615328 100644 --- a/src/inotify.c +++ b/src/inotify.c @@ -145,7 +145,7 @@ inotify_callback (int fd, void *_) i = 0; while (i < (size_t)n) { - struct inotify_event *ev = (struct inotify_event*)&buffer[i]; + struct inotify_event *ev = (struct inotify_event *) &buffer[i]; watch_object = Fassoc (make_watch_descriptor (ev->wd), watch_list); if (!NILP (watch_object)) diff --git a/src/intervals.h b/src/intervals.h index cd0ba9ad70..db91b3f21a 100644 --- a/src/intervals.h +++ b/src/intervals.h @@ -290,7 +290,7 @@ Lisp_Object text_property_list (Lisp_Object, Lisp_Object, Lisp_Object, void add_text_properties_from_list (Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object extend_property_ranges (Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object get_char_property_and_overlay (Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object*); + Lisp_Object, Lisp_Object *); extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer); diff --git a/src/keymap.c b/src/keymap.c index 9caf55f98f..b568f47cba 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -93,7 +93,7 @@ static void describe_command (Lisp_Object, Lisp_Object); static void describe_translation (Lisp_Object, Lisp_Object); static void describe_map (Lisp_Object, Lisp_Object, void (*) (Lisp_Object, Lisp_Object), - bool, Lisp_Object, Lisp_Object*, bool, bool); + bool, Lisp_Object, Lisp_Object *, bool, bool); static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object, void (*) (Lisp_Object, Lisp_Object), bool, Lisp_Object, Lisp_Object, bool, bool); diff --git a/src/menu.c b/src/menu.c index 14272dc0c3..99a2ce8f7e 100644 --- a/src/menu.c +++ b/src/menu.c @@ -603,7 +603,7 @@ free_menubar_widget_value_tree (widget_value *wv) wv->name = wv->value = wv->key = (char *) 0xDEADBEEF; - if (wv->contents && (wv->contents != (widget_value*)1)) + if (wv->contents && (wv->contents != (widget_value *) 1)) { free_menubar_widget_value_tree (wv->contents); wv->contents = (widget_value *) 0xDEADBEEF; diff --git a/src/nsfns.m b/src/nsfns.m index a709935db9..9e904c6838 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2074,10 +2074,10 @@ and GNUstep implementations ("distributor-specific release ns_do_applescript (Lisp_Object script, Lisp_Object *result) { NSAppleEventDescriptor *desc; - NSDictionary* errorDict; - NSAppleEventDescriptor* returnDescriptor = NULL; + NSDictionary *errorDict; + NSAppleEventDescriptor *returnDescriptor = NULL; - NSAppleScript* scriptObject = + NSAppleScript *scriptObject = [[NSAppleScript alloc] initWithSource: [NSString stringWithUTF8String: SSDATA (script)]]; diff --git a/src/nsfont.m b/src/nsfont.m index d9cae8c27d..1bfc3df146 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -855,7 +855,7 @@ when setting family in ns_spec_to_descriptor(). */ ((CFStringRef)@"Monaco", kATSOptionFlagsDefault); } } - font_info->cgfont = CGFontCreateWithPlatformFont ((void*)&atsFont); + font_info->cgfont = CGFontCreateWithPlatformFont ((void *) &atsFont); } #endif diff --git a/src/nsterm.h b/src/nsterm.h index 534ec68c22..53d9344cc7 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -53,7 +53,7 @@ along with GNU Emacs. If not, see . */ /* CGFloat on GNUstep may be 4 or 8 byte, but functions expect float* for some versions. - On Cocoa >= 10.5, functions expect CGFloat*. Make compatible type. */ + On Cocoa >= 10.5, functions expect CGFloat *. Make compatible type. */ #ifdef NS_IMPL_COCOA typedef CGFloat EmacsCGFloat; #elif GNUSTEP_GUI_MAJOR_VERSION > 0 || GNUSTEP_GUI_MINOR_VERSION >= 22 @@ -1198,7 +1198,7 @@ extern void ns_finish_events (void); #ifdef __OBJC__ /* Needed in nsfns.m. */ extern void -ns_set_represented_filename (NSString* fstr, struct frame *f); +ns_set_represented_filename (NSString *fstr, struct frame *f); #endif diff --git a/src/nsterm.m b/src/nsterm.m index 63f1b15b24..28764c8a4f 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -423,14 +423,14 @@ - (NSColor *)colorUsingDefaultColorSpace ========================================================================== */ void -ns_set_represented_filename (NSString* fstr, struct frame *f) +ns_set_represented_filename (NSString *fstr, struct frame *f) { represented_filename = [fstr retain]; represented_frame = f; } void -ns_init_events (struct input_event* ev) +ns_init_events (struct input_event *ev) { EVENT_INIT (*ev); emacs_event = ev; @@ -5817,7 +5817,7 @@ flag set (this is probably a bug in the OS). Handle uchrHandle = GetResource ('uchr', GetScriptVariable (smv, smScriptKeys)); UInt32 dummy = 0; - UCKeyTranslate ((UCKeyboardLayout*)*uchrHandle, + UCKeyTranslate ((UCKeyboardLayout *) *uchrHandle, [[theEvent characters] characterAtIndex: 0], kUCKeyActionDisplay, (flags & ~NSEventModifierFlagCommand) >> 8, diff --git a/src/process.c b/src/process.c index 434a3955b2..2f2e5c1b25 100644 --- a/src/process.c +++ b/src/process.c @@ -4379,7 +4379,7 @@ network_interface_info (Lisp_Object ifname) for (it = ifap; it != NULL; it = it->ifa_next) { - struct sockaddr_dl *sdl = (struct sockaddr_dl*) it->ifa_addr; + struct sockaddr_dl *sdl = (struct sockaddr_dl *) it->ifa_addr; unsigned char linkaddr[6]; int n; diff --git a/src/regex.c b/src/regex.c index 796f868d1c..8e38a920cd 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1421,7 +1421,7 @@ do { \ { \ /* It's a counter. */ \ /* Here, we discard `const', making re_match non-reentrant. */ \ - unsigned char *ptr = (unsigned char*) POP_FAILURE_POINTER (); \ + unsigned char *ptr = (unsigned char *) POP_FAILURE_POINTER (); \ pfreg = POP_FAILURE_INT (); \ STORE_NUMBER (ptr, pfreg); \ DEBUG_PRINT (" Pop counter %p = %ld\n", ptr, pfreg); \ @@ -4220,8 +4220,8 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, size_t size1, struct re_registers *regs, ssize_t stop) { regoff_t val; - re_char *string1 = (re_char*) str1; - re_char *string2 = (re_char*) str2; + re_char *string1 = (re_char *) str1; + re_char *string2 = (re_char *) str2; register char *fastmap = bufp->fastmap; register RE_TRANSLATE_TYPE translate = bufp->translate; size_t total_size = size1 + size2; @@ -4887,7 +4887,7 @@ regoff_t re_match (struct re_pattern_buffer *bufp, const char *string, size_t size, ssize_t pos, struct re_registers *regs) { - regoff_t result = re_match_2_internal (bufp, NULL, 0, (re_char*) string, + regoff_t result = re_match_2_internal (bufp, NULL, 0, (re_char *) string, size, pos, regs, size); return result; } @@ -4921,8 +4921,8 @@ re_match_2 (struct re_pattern_buffer *bufp, const char *string1, SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1); #endif - result = re_match_2_internal (bufp, (re_char*) string1, size1, - (re_char*) string2, size2, + result = re_match_2_internal (bufp, (re_char *) string1, size1, + (re_char *) string2, size2, pos, regs, stop); return result; } @@ -5785,8 +5785,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, { re_char *p1 = p; /* Next operation. */ /* Here, we discard `const', making re_match non-reentrant. */ - unsigned char *p2 = (unsigned char*) p + mcnt; /* Jump dest. */ - unsigned char *p3 = (unsigned char*) p - 3; /* opcode location. */ + unsigned char *p2 = (unsigned char *) p + mcnt; /* Jump dest. */ + unsigned char *p3 = (unsigned char *) p - 3; /* opcode location. */ p -= 3; /* Reset so that we will re-execute the instruction once it's been changed. */ @@ -5837,7 +5837,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, if (mcnt != 0) { /* Here, we discard `const', making re_match non-reentrant. */ - unsigned char *p2 = (unsigned char*) p + 2; /* counter loc. */ + unsigned char *p2 = (unsigned char *) p + 2; /* counter loc. */ mcnt--; p += 4; PUSH_NUMBER (p2, mcnt); @@ -5856,7 +5856,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, if (mcnt != 0) { /* Here, we discard `const', making re_match non-reentrant. */ - unsigned char *p2 = (unsigned char*) p + 2; /* counter loc. */ + unsigned char *p2 = (unsigned char *) p + 2; /* counter loc. */ mcnt--; PUSH_NUMBER (p2, mcnt); goto unconditional_jump; @@ -5873,7 +5873,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1, EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Here, we discard `const', making re_match non-reentrant. */ - p2 = (unsigned char*) p + mcnt; + p2 = (unsigned char *) p + mcnt; /* Signedness doesn't matter since we only copy MCNT's bits. */ EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT (" Setting %p to %d.\n", p2, mcnt); @@ -6283,7 +6283,7 @@ re_compile_pattern (const char *pattern, size_t length, setting no_sub. */ bufp->no_sub = 0; - ret = regex_compile ((re_char*) pattern, length, + ret = regex_compile ((re_char *) pattern, length, #ifdef emacs posix_backtracking, whitespace_regexp, @@ -6446,7 +6446,7 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, /* POSIX says a null character in the pattern terminates it, so we can use strlen here in compiling the pattern. */ - ret = regex_compile ((re_char*) pattern, strlen (pattern), syntax, preg); + ret = regex_compile ((re_char *) pattern, strlen (pattern), syntax, preg); /* POSIX doesn't distinguish between an unmatched open-group and an unmatched close-group: both are REG_EPAREN. */ diff --git a/src/term.c b/src/term.c index 35fa8c931c..8770aff8a9 100644 --- a/src/term.c +++ b/src/term.c @@ -2536,7 +2536,8 @@ term_mouse_click (struct input_event *result, Gpm_Event *event, } int -handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct input_event* hold_quit) +handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, + struct input_event *hold_quit) { struct frame *f = XFRAME (tty->top_frame); struct input_event ie; @@ -4134,9 +4135,11 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ #ifdef TERMINFO /* Non-standard support for 24-bit colors. */ { - const char* fg = tigetstr ("setf24"); - const char* bg = tigetstr ("setb24"); - if (fg && bg && fg != (char *)-1 && bg != (char *)-1) + const char *fg = tigetstr ("setf24"); + const char *bg = tigetstr ("setb24"); + if (fg && bg + && fg != (char *) (intptr_t) -1 + && bg != (char *) (intptr_t) -1) { tty->TS_set_foreground = fg; tty->TS_set_background = bg; diff --git a/src/widget.c b/src/widget.c index b05fd8310a..96555ed2ac 100644 --- a/src/widget.c +++ b/src/widget.c @@ -148,7 +148,7 @@ WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec; static void get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height) { - struct frame* f = ew->emacs_frame.frame; + struct frame *f = ew->emacs_frame.frame; *pixel_width = FRAME_COLUMN_WIDTH (f); *pixel_height = FRAME_LINE_HEIGHT (f); } @@ -156,7 +156,7 @@ get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height) static void pixel_to_char_size (EmacsFrame ew, Dimension pixel_width, Dimension pixel_height, int *char_width, int *char_height) { - struct frame* f = ew->emacs_frame.frame; + struct frame *f = ew->emacs_frame.frame; *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width); *char_height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (int) pixel_height); } @@ -164,7 +164,7 @@ pixel_to_char_size (EmacsFrame ew, Dimension pixel_width, Dimension pixel_height static void pixel_to_text_size (EmacsFrame ew, Dimension pixel_width, Dimension pixel_height, int *text_width, int *text_height) { - struct frame* f = ew->emacs_frame.frame; + struct frame *f = ew->emacs_frame.frame; *text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, (int) pixel_width); *text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, (int) pixel_height); } @@ -172,7 +172,7 @@ pixel_to_text_size (EmacsFrame ew, Dimension pixel_width, Dimension pixel_height static void char_to_pixel_size (EmacsFrame ew, int char_width, int char_height, Dimension *pixel_width, Dimension *pixel_height) { - struct frame* f = ew->emacs_frame.frame; + struct frame *f = ew->emacs_frame.frame; *pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width); *pixel_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, char_height); } @@ -365,8 +365,8 @@ EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2) static void resize_cb (Widget widget, XtPointer closure, - XEvent* event, - Boolean* continue_to_dispatch) + XEvent *event, + Boolean *continue_to_dispatch) { EmacsFrameResize (widget); } diff --git a/src/widget.h b/src/widget.h index bb36f61a8f..2c5fb61df2 100644 --- a/src/widget.h +++ b/src/widget.h @@ -92,7 +92,7 @@ typedef struct _EmacsFrameClassRec *EmacsFrameClass; extern WidgetClass emacsFrameClass; -extern struct _DisplayContext* display_context; +extern struct _DisplayContext *display_context; /* Special entry points */ void EmacsFrameSetCharSize (Widget, int, int); diff --git a/src/widgetprv.h b/src/widgetprv.h index 9d31bddbe7..309aed779d 100644 --- a/src/widgetprv.h +++ b/src/widgetprv.h @@ -25,11 +25,11 @@ along with GNU Emacs. If not, see . */ #include typedef struct { - struct frame* frame; /* the *emacs* frame object */ + struct frame *frame; /* the *emacs* frame object */ /* Resources that can't be done from lisp. */ - char* geometry; /* geometry spec of this frame */ + char * geometry; /* geometry spec of this frame */ Boolean iconic; /* whether this frame is iconic */ /* The rest of this is crap and should be deleted. commit 7f89c208bf4bb256c67cc59351f4171c7a6b63aa Author: Mark Oteiza Date: Sat Feb 18 20:25:50 2017 -0500 More json.el changes * lisp/json.el (json-read-keyword, json-read-number, json-read-object): (json-read-array): Just use = for char comparison. diff --git a/lisp/json.el b/lisp/json.el index 59942dbed8..049c9b1951 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -293,7 +293,7 @@ KEYWORD is the keyword expected." (unless (member keyword json-keywords) (signal 'json-unknown-keyword (list keyword))) (mapc (lambda (char) - (unless (char-equal char (json-peek)) + (when (/= char (json-peek)) (signal 'json-unknown-keyword (list (save-excursion (backward-word-strictly 1) @@ -330,10 +330,10 @@ representation will be parsed correctly." ;; If SIGN is non-nil, the number is explicitly signed. (let ((number-regexp "\\([0-9]+\\)?\\(\\.[0-9]+\\)?\\([Ee][+-]?[0-9]+\\)?")) - (cond ((and (null sign) (char-equal (json-peek) ?-)) + (cond ((and (null sign) (= (json-peek) ?-)) (json-advance) (- (json-read-number t))) - ((and (null sign) (char-equal (json-peek) ?+)) + ((and (null sign) (= (json-peek) ?+)) (json-advance) (json-read-number t)) ((and (looking-at number-regexp) @@ -495,11 +495,11 @@ Please see the documentation of `json-object-type' and `json-key-type'." ;; read key/value pairs until "}" (let ((elements (json-new-object)) key value) - (while (not (char-equal (json-peek) ?})) + (while (not (= (json-peek) ?})) (json-skip-whitespace) (setq key (json-read-string)) (json-skip-whitespace) - (if (char-equal (json-peek) ?:) + (if (= (json-peek) ?:) (json-advance) (signal 'json-object-format (list ":" (json-peek)))) (json-skip-whitespace) @@ -510,8 +510,8 @@ Please see the documentation of `json-object-type' and `json-key-type'." (funcall json-post-element-read-function)) (setq elements (json-add-to-object elements key value)) (json-skip-whitespace) - (unless (char-equal (json-peek) ?}) - (if (char-equal (json-peek) ?,) + (when (/= (json-peek) ?}) + (if (= (json-peek) ?,) (json-advance) (signal 'json-object-format (list "," (json-peek)))))) ;; Skip over the "}" @@ -621,7 +621,7 @@ become JSON objects." (json-skip-whitespace) ;; read values until "]" (let (elements) - (while (not (char-equal (json-peek) ?\])) + (while (not (= (json-peek) ?\])) (json-skip-whitespace) (when json-pre-element-read-function (funcall json-pre-element-read-function (length elements))) @@ -629,8 +629,8 @@ become JSON objects." (when json-post-element-read-function (funcall json-post-element-read-function)) (json-skip-whitespace) - (unless (char-equal (json-peek) ?\]) - (if (char-equal (json-peek) ?,) + (when (/= (json-peek) ?\]) + (if (= (json-peek) ?,) (json-advance) (signal 'json-error (list 'bleah))))) ;; Skip over the "]" commit 861ff2ba2cfc19065b13bf9b9670b44e1496c64e Author: Alan Mackenzie Date: Sat Feb 18 16:01:15 2017 +0000 Fix edebug-spec on c-lang-defvar. This allows c-lang-defvars with the symbol 'dont-doc in the place of the optional documentation to be instrumented for edebug. lisp/progmodes/cc-langs.el (top-level): Amend the edebug-spec for c-lang-defvar. (c-opt-identifier-concat-key, c-decl-prefix-or-start-re): remove redundant 'dont-doc. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 037404696d..3b455fc090 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -204,7 +204,7 @@ the evaluated constant value at compile time." ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el. ; ' (def-edebug-spec c-lang-defvar - (&define name def-form &optional stringp)) ;) + (&define name def-form &optional &or ("quote" symbolp) stringp)) ;; Suppress "might not be defined at runtime" warning. ;; This file is only used when compiling other cc files. @@ -712,8 +712,7 @@ This value is by default merged into `c-operators'." (when ops (c-make-keywords-re 'appendable ops)))) (c-lang-defvar c-opt-identifier-concat-key - (c-lang-const c-opt-identifier-concat-key) - 'dont-doc) + (c-lang-const c-opt-identifier-concat-key)) (c-lang-defconst c-opt-identifier-concat-key-depth ;; Number of regexp grouping parens in `c-opt-identifier-concat-key'. @@ -2975,8 +2974,7 @@ constructs." (c-make-keywords-re t (c-lang-const c-decl-start-kwds))) (c-lang-const c-decl-prefix-re))) (c-lang-defvar c-decl-prefix-or-start-re - (c-lang-const c-decl-prefix-or-start-re) - 'dont-doc) + (c-lang-const c-decl-prefix-or-start-re)) (c-lang-defconst c-cast-parens ;; List containing the paren characters that can open a cast, or nil in commit 7d15daf713f7fe2d067a10812cdfcb32963f596e Author: Lars Ingebrigtsen Date: Sat Feb 18 16:46:06 2017 +0100 Lists used as plists now have to be an even length * lisp/net/eww.el (eww-size-text-inputs): `eww-form' isn't a plist. (eww-process-text-input): Not here, either. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index f7e0634144..c9f4e61a6f 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1135,7 +1135,8 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (insert (make-string (abs length) ? )) (set-text-properties start (point) properties)) (goto-char (1- end))))) - (set-text-properties (plist-get form :start) (plist-get form :end) + (set-text-properties (cdr (assq :start form)) + (cdr (assq :end form)) properties) (let ((value (buffer-substring-no-properties (eww-beginning-of-field) @@ -1348,10 +1349,10 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") (when (or (get-text-property start 'eww-form) (setq start (next-single-property-change start 'eww-form))) (let ((props (get-text-property start 'eww-form))) - (plist-put props :start start) - (setq start (next-single-property-change - start 'eww-form nil (point-max))) - (plist-put props :end start)))))) + (nconc props (list (cons :start start))) + (setq start (next-single-property-change + start 'eww-form nil (point-max))) + (nconc props (list (cons :end start)))))))) (defun eww-input-value (input) (let ((type (plist-get input :type)) commit 6ad34b3d542e874609f3be2c2bc899da9af109d0 Author: Michael Albinus Date: Sat Feb 18 14:29:19 2017 +0100 Unset `non-essential' in Tramp when not needed anymore * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.3.2-pre". * lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use `tramp-completion-mode-p'. * lisp/net/tramp.el (tramp-file-name-handler): Unset `non-essential' when file name doesn't match `tramp-completion-file-name-regexp'. diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index 77b6de3809..70701aa358 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -8,7 +8,7 @@ @c In the Tramp GIT, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.3.1 +@set trampver 2.3.2-pre @c Other flags from configuration @set instprefix /usr/local diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index a3641c6c40..1489405b84 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4653,12 +4653,11 @@ connection if a previous connection has died for some reason." (condition-case err (unless (tramp-compat-process-live-p p) - ;; If `non-essential' is non-nil, don't reopen a new connection. - ;; This variable has been introduced with Emacs 24.1. - ;; We check this for the process related to + ;; During completion, don't reopen a new connection. We + ;; check this for the process related to ;; `tramp-buffer-name'; otherwise `start-file-process' ;; wouldn't run ever when `non-essential' is non-nil. - (when (and (boundp 'non-essential) (symbol-value 'non-essential) + (when (and (tramp-completion-mode-p) (null (get-process (tramp-buffer-name vec)))) (throw 'non-essential 'non-essential)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index c0f6fdcfad..2bd75ab83f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2021,6 +2021,10 @@ Falls back to normal file name handler if no Tramp file name handler exists." (if (and tramp-mode (tramp-tramp-file-p filename)) (save-match-data (let* ((filename (tramp-replace-environment-variables filename)) + (non-essential + (and non-essential + (string-match + tramp-completion-file-name-regexp filename))) (completion (tramp-completion-mode-p)) (foreign (tramp-find-foreign-file-name-handler diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 9bf9102cc7..14d224142d 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -6,7 +6,7 @@ ;; Author: Kai Großjohann ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.3.1 +;; Version: 2.3.2-pre ;; This file is part of GNU Emacs. @@ -32,7 +32,7 @@ ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.3.1" +(defconst tramp-version "2.3.2-pre" "This version of Tramp.") ;;;###tramp-autoload @@ -54,7 +54,7 @@ ;; Check for Emacs version. (let ((x (if (>= emacs-major-version 23) "ok" - (format "Tramp 2.3.1 is not fit for %s" + (format "Tramp 2.3.2-pre is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) commit ba6e7232d0324a52be4cd5d5cd3da93ca651ebda Author: Eli Zaretskii Date: Sat Feb 18 14:49:30 2017 +0200 Automatically regenerate emacs.1 and *.rc files * Makefile.in (CONFIG_STATUS_FILES_IN): New variable, lists non-Makefile files produced by config.status. ($(MAKEFILE_NAME)): Depend on $(CONFIG_STATUS_FILES_IN), so that their targets are regenerated when the source changes. diff --git a/Makefile.in b/Makefile.in index 807a40a284..2cc41feb46 100644 --- a/Makefile.in +++ b/Makefile.in @@ -307,6 +307,11 @@ SUBDIR = $(NTDIR) lib lib-src src lisp SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@ SUBDIR_MAKEFILES = $(patsubst ${srcdir}/%,%,${SUBDIR_MAKEFILES_IN:.in=}) +# Non-makefile files created by config.status. +CONFIG_STATUS_FILES_IN = \ + ${srcdir}/nt/emacs.rc.in ${srcdir}/nt/emacsclient.rc.in \ + ${srcdir}/doc/man/emacs.1.in + # Subdirectories to install, and where they'll go. lib-src's and nt's # makefiles know how to install them, so we don't do that here. # Directories that cannot simply be copied, eg info, are treated @@ -424,7 +429,7 @@ blessmail: Makefile src # etc. to be built without running into similar recursion problems. MAKEFILE_NAME = Makefile $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \ - $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) + $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) $(CONFIG_STATUS_FILES_IN) MAKE='$(MAKE)' ./config.status # Don't erase these files if make is interrupted while refreshing them. commit a848d36c578cb849a283d72edbd69d1b955350f9 Author: Alan Mackenzie Date: Sat Feb 18 12:38:29 2017 +0000 Set the syntax table in AWK Mode. This is a partial reversion of CC Mode commit on 2016-05-09 17:49:45 +0000. It fixes bug #25722. lisp/progmodes/cc-mode.el (awk-mode): Explicitly set the syntax table. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index e2969c607a..8326e6a6f2 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -2036,6 +2036,7 @@ Key bindings: :syntax-table nil (require 'cc-awk) ; Added 2003/6/10. (c-initialize-cc-mode t) + (set-syntax-table awk-mode-syntax-table) (setq abbrev-mode t) (c-init-language-vars-for 'awk-mode) (c-common-init 'awk-mode) commit 879a3e445fa13c9624558515c8189dae634d91a1 Author: Göktuğ Kayaalp Date: Sat Feb 18 13:17:40 2017 +0200 Fix Turkish language environment setup * lisp/language/european.el ("Turkish"): Fix a typo in Turkish language setup. (Bug#25763) diff --git a/lisp/language/european.el b/lisp/language/european.el index 954ac1f450..6c0232efd3 100644 --- a/lisp/language/european.el +++ b/lisp/language/european.el @@ -506,7 +506,7 @@ and it selects the Spanish tutorial.")) (input-method . "turkish-postfix") (sample-text . "Turkish (Türkçe) Merhaba") (setup-function . turkish-case-conversion-enable) - (setup-function . turkish-case-conversion-disable) + (exit-function . turkish-case-conversion-disable) (documentation . "Support for Turkish. Differs from the Latin-5 environment in using the `turkish-postfix' input method and applying Turkish case rules for the characters i, I, ı, İ."))) commit e463e5762bbe628be3d15da066a90f079a8468b3 Author: Rami Ylimäki Date: Sat Feb 18 13:04:55 2017 +0200 Support 24-bit direct colors on text terminals * src/term.c (init_tty): Use 24-bit terminal colors if corresponding foreground and background functions are present in terminal type definition. * src/tparam.h: Define prototype for tigetstr. * lisp/term/tty-colors.el (tty-color-define): Convert color palette index to pixel value on 16.7M color terminals. (tty-color-24bit): New function to convert color palette index to pixel value on 16.7M color terminals. (tty-color-desc): Don't approximate colors on 16.7M color terminals. * lisp/term/xterm.el (xterm-register-default-colors): Define all named TTY colors on 16.7M color terminals. * doc/misc/efaq.texi (Colors on a TTY): Add instructions on how to enable direct color TTY mode. * etc/NEWS: Mention direct color TTY mode and point to FAQ. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index f7a47f8675..e9cfe7afce 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1491,6 +1491,39 @@ exhibits all the colors Emacs knows about on the current display. Syntax highlighting is on by default since version 22.1. +Emacs 26.1 and later support direct color mode in terminals. If Emacs +finds Terminfo capabilities @samp{setb24} and @samp{setf24}, 24-bit +direct color mode is used. The capability strings are expected to +take one 24-bit pixel value as argument and transform the pixel to a +string that can be used to send 24-bit colors to the terminal. + +There aren't yet any standard terminal type definitions that would +support the capabilities, but Emacs can be invoked with a custom +definition as shown below. + +@example +$ cat terminfo-24bit.src + +# Use colon separators. +xterm-24bit|xterm with 24-bit direct color mode, + use=xterm-256color, + setb24=\E[48:2:%p1%@{65536@}%/%d:%p1%@{256@}%/%@{255@}%&%d:%p1%@{255@}%&%dm, + setf24=\E[38:2:%p1%@{65536@}%/%d:%p1%@{256@}%/%@{255@}%&%d:%p1%@{255@}%&%dm, +# Use semicolon separators. +xterm-24bits|xterm with 24-bit direct color mode, + use=xterm-256color, + setb24=\E[48;2;%p1%@{65536@}%/%d;%p1%@{256@}%/%@{255@}%&%d;%p1%@{255@}%&%dm, + setf24=\E[38;2;%p1%@{65536@}%/%d;%p1%@{256@}%/%@{255@}%&%d;%p1%@{255@}%&%dm, + +$ tic -x -o ~/.terminfo terminfo-24bit.src + +$ TERM=xterm-24bit emacs -nw +@end example + +Currently there's no standard way to determine whether a terminal +supports direct color mode. If such standard arises later on, support +for @samp{setb24} and @samp{setf24} may be removed. + @node Debugging a customization file @section How do I debug a @file{.emacs} file? @cindex Debugging @file{.emacs} file diff --git a/etc/NEWS b/etc/NEWS index 73085f626b..143e4655de 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -77,6 +77,12 @@ modern init systems such as systemd, which manage many of the traditional aspects of daemon behavior themselves. '--old-daemon' is now an alias for '--daemon'. ++++ +** Emacs now supports 24-bit colors on capable text terminals +Terminal is automatically initialized to use 24-bit colors if the +required capabilities are found in terminfo. See the FAQ node +"Colors on a TTY" for more information. + * Changes in Emacs 26.1 diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el index 252a430129..9cfe30a463 100644 --- a/lisp/term/tty-colors.el +++ b/lisp/term/tty-colors.el @@ -824,6 +824,15 @@ A canonicalized color name is all-lower case, with any blanks removed." (replace-regexp-in-string " +" "" (downcase color)) color))) +(defun tty-color-24bit (rgb) + "Return pixel value on 24-bit terminals. Return nil if RGB is +nil or not on 24-bit terminal." + (when (and rgb (= (display-color-cells) 16777216)) + (let ((r (lsh (car rgb) -8)) + (g (lsh (cadr rgb) -8)) + (b (lsh (nth 2 rgb) -8))) + (logior (lsh r 16) (lsh g 8) b)))) + (defun tty-color-define (name index &optional rgb frame) "Specify a tty color by its NAME, terminal INDEX and RGB values. NAME is a string, INDEX is typically a small integer used to send to @@ -840,7 +849,10 @@ If FRAME is not specified or is nil, it defaults to the selected frame." (and rgb (or (not (listp rgb)) (/= (length rgb) 3)))) (error "Invalid specification for tty color \"%s\"" name)) (tty-modify-color-alist - (append (list (tty-color-canonicalize name) index) rgb) frame)) + (append (list (tty-color-canonicalize name) + (or (tty-color-24bit rgb) index)) + rgb) + frame)) (defun tty-color-clear (&optional _frame) "Clear the list of supported tty colors for frame FRAME. @@ -1013,7 +1025,10 @@ might need to be approximated if it is not supported directly." (let ((color (tty-color-canonicalize color))) (or (assoc color (tty-color-alist frame)) (let ((rgb (tty-color-standard-values color))) - (and rgb (tty-color-approximate rgb frame))))))) + (and rgb + (let ((pixel (tty-color-24bit rgb))) + (or (and pixel (cons color (cons pixel rgb))) + (tty-color-approximate rgb frame))))))))) (defun tty-color-gray-shades (&optional display) "Return the number of gray colors supported by DISPLAY's terminal. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 339d05d972..e6d224dd3d 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -930,6 +930,14 @@ versions of xterm." ;; are more colors to support, compute them now. (when (> ncolors 0) (cond + ((= ncolors 16777200) ; 24-bit xterm + ;; all named tty colors + (let ((idx (length xterm-standard-colors))) + (mapc (lambda (color) + (unless (assoc (car color) xterm-standard-colors) + (tty-color-define (car color) idx (cdr color)) + (setq idx (1+ idx)))) + color-name-rgb-alist))) ((= ncolors 240) ; 256-color xterm ;; 216 non-gray colors first (let ((r 0) (g 0) (b 0)) diff --git a/src/term.c b/src/term.c index b0ff9cb546..35fa8c931c 100644 --- a/src/term.c +++ b/src/term.c @@ -4131,6 +4131,20 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ tty->TN_max_colors = tgetnum ("Co"); +#ifdef TERMINFO + /* Non-standard support for 24-bit colors. */ + { + const char* fg = tigetstr ("setf24"); + const char* bg = tigetstr ("setb24"); + if (fg && bg && fg != (char *)-1 && bg != (char *)-1) + { + tty->TS_set_foreground = fg; + tty->TS_set_background = bg; + tty->TN_max_colors = 16777216; + } + } +#endif + tty->TN_no_color_video = tgetnum ("NC"); if (tty->TN_no_color_video == -1) tty->TN_no_color_video = 0; diff --git a/src/tparam.h b/src/tparam.h index 15664d68bd..02136b6ca5 100644 --- a/src/tparam.h +++ b/src/tparam.h @@ -36,4 +36,8 @@ extern char PC; extern char *BC; extern char *UP; +#ifdef TERMINFO +char *tigetstr(const char *); +#endif + #endif /* EMACS_TPARAM_H */ commit 464a51ed46990554bed8a9443168c976d6c3c6d3 Author: Rami Ylimäki Date: Sat Feb 18 12:56:12 2017 +0200 Remove unused TN_max_pairs field * src/termchar.h (tty_display_info): Remove TN_max_pairs field, describing maximum number of terminal background/foreground color pairs. * src/term.c (tty_default_color_capabilities, tty_setup_colors) (init_tty): Remove references to TN_max_pairs. diff --git a/src/term.c b/src/term.c index c067a86d18..b0ff9cb546 100644 --- a/src/term.c +++ b/src/term.c @@ -2048,7 +2048,6 @@ TERMINAL does not refer to a text terminal. */) to work around an HPUX compiler bug (?). See http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00410.html */ static int default_max_colors; -static int default_max_pairs; static int default_no_color_video; static char *default_orig_pair; static char *default_set_foreground; @@ -2066,7 +2065,6 @@ tty_default_color_capabilities (struct tty_display_info *tty, bool save) dupstring (&default_set_foreground, tty->TS_set_foreground); dupstring (&default_set_background, tty->TS_set_background); default_max_colors = tty->TN_max_colors; - default_max_pairs = tty->TN_max_pairs; default_no_color_video = tty->TN_no_color_video; } else @@ -2075,7 +2073,6 @@ tty_default_color_capabilities (struct tty_display_info *tty, bool save) tty->TS_set_foreground = default_set_foreground; tty->TS_set_background = default_set_background; tty->TN_max_colors = default_max_colors; - tty->TN_max_pairs = default_max_pairs; tty->TN_no_color_video = default_no_color_video; } } @@ -2095,7 +2092,6 @@ tty_setup_colors (struct tty_display_info *tty, int mode) { case -1: /* no colors at all */ tty->TN_max_colors = 0; - tty->TN_max_pairs = 0; tty->TN_no_color_video = 0; tty->TS_set_foreground = tty->TS_set_background = tty->TS_orig_pair = NULL; break; @@ -2113,7 +2109,6 @@ tty_setup_colors (struct tty_display_info *tty, int mode) tty->TS_set_background = "\033[4%dm"; #endif tty->TN_max_colors = 8; - tty->TN_max_pairs = 64; tty->TN_no_color_video = 0; break; } @@ -4135,7 +4130,6 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ } tty->TN_max_colors = tgetnum ("Co"); - tty->TN_max_pairs = tgetnum ("pa"); tty->TN_no_color_video = tgetnum ("NC"); if (tty->TN_no_color_video == -1) diff --git a/src/termchar.h b/src/termchar.h index e6e483e571..cf061a9780 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -149,10 +149,6 @@ struct tty_display_info int TN_max_colors; /* "Co" -- number of colors. */ - /* "pa" -- max. number of color pairs on screen. Not handled yet. - Could be a problem if not equal to TN_max_colors * TN_max_colors. */ - int TN_max_pairs; - /* "op" -- SVr4 set default pair to its original value. */ const char *TS_orig_pair; commit 723dd50a9fea03ca54692e5cb50ca2907b4c66f5 Author: Eli Zaretskii Date: Sat Feb 18 12:44:17 2017 +0200 Improve documentation of query-replace-from-to-separator * doc/emacs/search.texi (Query Replace): Document the meaning of the nil value of query-replace-from-to-separator. (Bug#25482) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 77baae2a8f..905df025d2 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1527,7 +1527,9 @@ replacements in the form @samp{@var{from} -> @var{to}}, where @var{from} is the search pattern, @var{to} is its replacement, and the separator between them is determined by the value of the variable @code{query-replace-from-to-separator}. Type @key{RET} to select the -desired replacement. +desired replacement. If the value of this variable is @code{nil}, +replacements are not added to the command history, and cannot be +reused. @cindex faces for highlighting query replace @cindex query-replace face commit b5ab3a52fc0c8fd54b1827b354b13d9093411c89 Author: Eli Zaretskii Date: Sat Feb 18 12:30:25 2017 +0200 Improve commentary for a recent change in keyboard.c * src/keyboard.c (Fset__this_command_keys): Add a comment about the magic 248 value. (Bug#25612) diff --git a/src/keyboard.c b/src/keyboard.c index d2f4b504ab..0245dfa975 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -10020,7 +10020,7 @@ Internal use only. */) int key0 = SREF (keys, 0); /* Kludge alert: this makes M-x be in the form expected by - novice.el. Any better ideas? */ + novice.el. (248 is \370, a.k.a. "Meta-x".) Any better ideas? */ if (key0 == 248) add_command_key (make_number ('x' | meta_modifier)); else