From 9063124b9125ed5e2ad87bbb8bd6224526723a92 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 19 Dec 2019 17:33:16 +0100 Subject: [PATCH 01/13] Use pthread_setname_np to set thread name * configure.ac: Remove check for sys/prctl.h and prctl, check for pthread_setname_np instead. * systhread.c: Remove sys/prctl.h include. (sys_thread_create) [HAVE_PTHREAD_SETNAME_NP]: Use pthread_setname_np to set the name of the newly created thread (Bug#38632). * thread.c (Fmake_thread): Use ENCODE_SYSTEM instead of ENCODE_UTF_8 on the thread name. --- configure.ac | 4 ++-- src/systhread.c | 17 +++++++++++------ src/thread.c | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 39bfcf59886..de4710f150a 100644 --- a/configure.ac +++ b/configure.ac @@ -1767,7 +1767,7 @@ AC_CHECK_HEADERS_ONCE( sys/sysinfo.h coff.h pty.h sys/resource.h - sys/utsname.h pwd.h utmp.h util.h sys/prctl.h) + sys/utsname.h pwd.h utmp.h util.h) AC_CACHE_CHECK([for ADDR_NO_RANDOMIZE], [emacs_cv_personality_addr_no_randomize], @@ -4180,7 +4180,7 @@ pthread_sigmask strsignal setitimer timer_getoverrun \ sendto recvfrom getsockname getifaddrs freeifaddrs \ gai_strerror sync \ getpwent endpwent getgrent endgrent \ -cfmakeraw cfsetspeed __executable_start log2 prctl) +cfmakeraw cfsetspeed __executable_start log2 pthread_setname_np) LIBS=$OLD_LIBS dnl No need to check for posix_memalign if aligned_alloc works. diff --git a/src/systhread.c b/src/systhread.c index c3e4e6a2c5a..1dda036cc2f 100644 --- a/src/systhread.c +++ b/src/systhread.c @@ -98,10 +98,6 @@ sys_thread_yield (void) #include -#ifdef HAVE_SYS_PRCTL_H -#include -#endif - void sys_mutex_init (sys_mutex_t *mutex) { @@ -227,9 +223,18 @@ sys_thread_create (sys_thread_t *thread_ptr, const char *name, if (!pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED)) { result = pthread_create (thread_ptr, &attr, func, arg) == 0; -#if defined (HAVE_SYS_PRCTL_H) && defined (HAVE_PRCTL) && defined (PR_SET_NAME) +#ifdef HAVE_PTHREAD_SETNAME_NP if (result && name != NULL) - prctl (PR_SET_NAME, name); + { + /* We need to truncate here otherwise pthread_setname_np + fails to set the name. TASK_COMM_LEN is what the length + is called in the Linux kernel headers (Bug#38632). */ +#define TASK_COMM_LEN 16 + char p_name[TASK_COMM_LEN]; + strncpy (p_name, name, TASK_COMM_LEN - 1); + p_name[TASK_COMM_LEN - 1] = '\0'; + pthread_setname_np (*thread_ptr, p_name); + } #endif } diff --git a/src/thread.c b/src/thread.c index f81163414bb..f7e39dc4273 100644 --- a/src/thread.c +++ b/src/thread.c @@ -826,7 +826,7 @@ If NAME is given, it must be a string; it names the new thread. */) new_thread->next_thread = all_threads; all_threads = new_thread; - char const *c_name = !NILP (name) ? SSDATA (ENCODE_UTF_8 (name)) : NULL; + char const *c_name = !NILP (name) ? SSDATA (ENCODE_SYSTEM (name)) : NULL; if (c_name) new_thread->thread_name = xstrdup (c_name); else From 16c6dfb4f16bd399c70eade799ee5621614f7e83 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 6 Jan 2020 21:49:24 +0200 Subject: [PATCH 02/13] Avoid assertion violations in very small-height windows * src/xdisp.c (try_cursor_movement, redisplay_window) (row_containing_pos): Skip tab-line glyph rows in addition to header-line rows, when working on the top-most glyph row of a window. This avoids assertion violations in set_cursor_from_row. (Bug#38966) --- src/xdisp.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 3d286cb22fb..f3a297a7020 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -16244,8 +16244,8 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, bool string_from_text_prop = false; /* Don't even try doing anything if called for a mode-line or - header-line row, since the rest of the code isn't prepared to - deal with such calamities. */ + header-line or tab-line row, since the rest of the code isn't + prepared to deal with such calamities. */ eassert (!row->mode_line_p); if (row->mode_line_p) return false; @@ -17504,6 +17504,9 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, else { row = MATRIX_ROW (w->current_matrix, w->last_cursor_vpos); + /* Skip the tab-line and header-line rows, if any. */ + if (row->tab_line_p) + ++row; if (row->mode_line_p) ++row; if (!row->enabled_p) @@ -17576,6 +17579,9 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, || row->mode_line_p) { row = w->current_matrix->rows; + /* Skip the tab-line and header-line rows, if any. */ + if (row->tab_line_p) + ++row; if (row->mode_line_p) ++row; } @@ -17640,8 +17646,9 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, ; else if (rc != CURSOR_MOVEMENT_SUCCESS && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row) - /* Make sure this isn't a header line by any chance, since - then MATRIX_ROW_PARTIALLY_VISIBLE_P might yield true. */ + /* Make sure this isn't a header line nor a tab-line by + any chance, since then MATRIX_ROW_PARTIALLY_VISIBLE_P + might yield true. */ && !row->mode_line_p && !cursor_row_fully_visible_p (w, true, true, true)) { @@ -18769,11 +18776,14 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) } } /* Finally, fall back on the first row of the window after the - header line (if any). This is slightly better than not - displaying the cursor at all. */ + tab-line and header line (if any). This is slightly better + than not displaying the cursor at all. */ if (!row) { row = matrix->rows; + /* Skip the tab-line and header-line rows, if any. */ + if (row->tab_line_p) + ++row; if (row->mode_line_p) ++row; } @@ -19787,7 +19797,9 @@ row_containing_pos (struct window *w, ptrdiff_t charpos, ptrdiff_t mindif = BUF_ZV (XBUFFER (w->contents)) + 1; int last_y; - /* If we happen to start on a header-line, skip that. */ + /* If we happen to start on a header-line or a tab-line, skip that. */ + if (row->tab_line_p) + ++row; if (row->mode_line_p) ++row; @@ -22380,7 +22392,7 @@ find_row_edges (struct it *it, struct glyph_row *row, if (STRINGP (it->object) /* this is not the first row */ && row > it->w->desired_matrix->rows - /* previous row is not the header line */ + /* previous row is not the header line or tab-line */ && !r1->mode_line_p /* previous row also ends in a newline from a string */ && r1->ends_in_newline_from_string_p) From 075f21c0e3f4893c07c93298368ef8ac7c9eb012 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Tue, 7 Jan 2020 12:32:42 +0900 Subject: [PATCH 03/13] Avoid crash by access to cleared img->pixmap->data/img->mask->data (Bug#38774) * src/image.c (prepare_image_for_display) [USE_CAIRO]: Call IMAGE_BACKGROUND and IMAGE_BACKGROUND_TRANSPARENT. --- src/image.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/image.c b/src/image.c index 5fe0d713e1b..e36253b3960 100644 --- a/src/image.c +++ b/src/image.c @@ -1242,6 +1242,10 @@ prepare_image_for_display (struct frame *f, struct image *img) if (img->cr_data == NULL || (cairo_pattern_get_type (img->cr_data) != CAIRO_PATTERN_TYPE_SURFACE)) { + /* Fill in the background/background_transparent field while + we have img->pixmap->data/img->mask->data. */ + IMAGE_BACKGROUND (img, f, img->pixmap); + IMAGE_BACKGROUND_TRANSPARENT (img, f, img->mask); cr_put_image_to_cr_data (img); if (img->cr_data == NULL) { From c01f55f126fd057c7fe559de53d7edb81f92c832 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Tue, 7 Jan 2020 12:42:19 +0900 Subject: [PATCH 04/13] Fix rendering bug due to unsynchronized cairo surface size (Bug#38497) * src/xterm.c (handle_one_xevent) [USE_CAIRO && !USE_GTK]: Call x_cr_update_surface_desired_size for a related frame as a fallback. --- src/xterm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index ada3cec1636..21d99f0c7bb 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8934,6 +8934,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (f) x_cr_update_surface_desired_size (f, configureEvent.xconfigure.width, configureEvent.xconfigure.height); + else if (any && configureEvent.xconfigure.window == FRAME_X_WINDOW (any)) + x_cr_update_surface_desired_size (any, + configureEvent.xconfigure.width, + configureEvent.xconfigure.height); #endif #ifdef USE_GTK if (!f From 883b3490d82c4fac66c7427c411ddd9254e09be6 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 7 Jan 2020 13:10:35 +0100 Subject: [PATCH 05/13] * lisp/net/tramp.el (tramp-file-local-name): Remove `save-match-data'. --- lisp/net/tramp.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 52c6a9ec430..e0013def5d0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1339,14 +1339,14 @@ entry does not exist, return nil." "Return the local name component of NAME. This function removes from NAME the specification of the remote host and the method of accessing the host, leaving only the part -that identifies NAME locally on the remote system. NAME must be -a string that matches `tramp-file-name-regexp'. The returned -file name can be used directly as argument of `process-file', -`start-file-process', or `shell-command'." - (save-match-data - (and (tramp-tramp-file-p name) - (string-match (nth 0 tramp-file-name-structure) name) - (match-string (nth 4 tramp-file-name-structure) name)))) +that identifies NAME locally on the remote system. If NAME does +not match `tramp-file-name-regexp', just NAME is returned. The +returned file name can be used directly as argument of +`process-file', `start-file-process', or `shell-command'." + (or (and (tramp-tramp-file-p name) + (string-match (nth 0 tramp-file-name-structure) name) + (match-string (nth 4 tramp-file-name-structure) name)) + name)) (defun tramp-find-method (method user host) "Return the right method string to use depending on USER and HOST. From b46c75b16cb870584c0e00eb81c85715c5421d20 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 7 Jan 2020 16:30:25 +0300 Subject: [PATCH 06/13] xref-matches-in-files: Big Tramp speed-up * lisp/progmodes/xref.el (xref-matches-in-files): Greatly improve performance with remote files using Tramp (bug#34343). --- lisp/progmodes/xref.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a8ca6f8fbec..4fbcd08506b 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1218,6 +1218,9 @@ IGNORES is a list of glob patterns for files to ignore." #'xref-matches-in-directory "27.1") +(declare-function tramp-tramp-file-p "tramp") +(declare-function tramp-file-local-name "tramp") + ;;;###autoload (defun xref-matches-in-files (regexp files) "Find all matches for REGEXP in FILES. @@ -1240,7 +1243,12 @@ FILES must be a list of absolute file names." "") (shell-quote-argument (xref--regexp-to-extended regexp))))) (when remote-id - (setq files (mapcar #'file-local-name files))) + (require 'tramp) + (setq files (mapcar + (if (tramp-tramp-file-p dir) + #'tramp-file-local-name + #'file-local-name) + files))) (with-current-buffer output (erase-buffer) (with-temp-buffer From f54b24304decc52defbf12576993d746e02a80ee Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Tue, 7 Jan 2020 14:41:52 +0100 Subject: [PATCH 07/13] Scale top-left coordinates in display-monitor-attributes-list When using multiple monitors, and HiDPI, the top-left coordinates of the monitors need to be adjusted, not just the width and height (Bug#31223). * xfns.c (Fx_display_monitor_attributes_list): Scale top-left coordinates. --- src/xfns.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xfns.c b/src/xfns.c index d0d5d399dc4..276ea1c3935 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5089,6 +5089,8 @@ Internal use only, use `display-monitor-attributes-list' instead. */) #elif defined HAVE_GTK3 scale = gdk_screen_get_monitor_scale_factor (gscreen, i); #endif + rec.x *= scale; + rec.y *= scale; rec.width *= scale; rec.height *= scale; work.x *= scale; From 73fd8a4b535928990f24702cdfaeeeceb6d33d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Tue, 7 Jan 2020 17:08:25 +0100 Subject: [PATCH 08/13] Fix BSD and macOS builds w.r.t. pthread_setname_np (bug#38632) pthread_setname_np takes only a single argument on BSD and macOS, and affects the current thread only. * configure.ac: Add check for single-argument pthread_setname_np * src/systhread.c (sys_thread_set_name): New (w32 and pthread versions). (sys_thread_create): Remove name argument and name-setting. (w32_beginthread_wrapper): Remove name-setting. * src/systhread.h (sys_thread_create, sys_thread_set_name): Update prototypes. * src/thread.c (run_thread): Call sys_thread_set_name. (Fmake_thread): Adapt call to sys_thread_create. * src/thread.h (struct thread_state): Adjust comment. --- configure.ac | 17 +++++++++++++++ src/systhread.c | 58 +++++++++++++++++++++++++------------------------ src/systhread.h | 5 +++-- src/thread.c | 5 ++++- src/thread.h | 3 +-- 5 files changed, 55 insertions(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index de4710f150a..068ef5c20c6 100644 --- a/configure.ac +++ b/configure.ac @@ -4183,6 +4183,23 @@ getpwent endpwent getgrent endgrent \ cfmakeraw cfsetspeed __executable_start log2 pthread_setname_np) LIBS=$OLD_LIBS +if test "$ac_cv_func_pthread_setname_np" = "yes"; then + AC_CACHE_CHECK( + [whether pthread_setname_np takes a single argument], + [emacs_cv_pthread_setname_np_1arg], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[pthread_setname_np ("a");]])], + [emacs_cv_pthread_setname_np_1arg=yes], + [emacs_cv_pthread_setname_np_1arg=no])]) + if test "$emacs_cv_pthread_setname_np_1arg" = "yes"; then + AC_DEFINE( + HAVE_PTHREAD_SETNAME_NP_1ARG, 1, + [Define to 1 if pthread_setname_np takes a single argument.]) + fi +fi + dnl No need to check for posix_memalign if aligned_alloc works. AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break]) AC_CHECK_DECLS([aligned_alloc], [], [], [[#include ]]) diff --git a/src/systhread.c b/src/systhread.c index 1dda036cc2f..2c3a060a17e 100644 --- a/src/systhread.c +++ b/src/systhread.c @@ -200,9 +200,28 @@ sys_thread_equal (sys_thread_t t, sys_thread_t u) return pthread_equal (t, u); } +void +sys_thread_set_name (const char *name) +{ +#ifdef HAVE_PTHREAD_SETNAME_NP + /* We need to truncate here otherwise pthread_setname_np + fails to set the name. TASK_COMM_LEN is what the length + is called in the Linux kernel headers (Bug#38632). */ +#define TASK_COMM_LEN 16 + char p_name[TASK_COMM_LEN]; + strncpy (p_name, name, TASK_COMM_LEN - 1); + p_name[TASK_COMM_LEN - 1] = '\0'; + #ifdef HAVE_PTHREAD_SETNAME_NP_1ARG + pthread_setname_np (p_name); + #else + pthread_setname_np (pthread_self (), p_name); + #endif +#endif +} + bool -sys_thread_create (sys_thread_t *thread_ptr, const char *name, - thread_creation_function *func, void *arg) +sys_thread_create (sys_thread_t *thread_ptr, thread_creation_function *func, + void *arg) { pthread_attr_t attr; bool result = false; @@ -221,22 +240,7 @@ sys_thread_create (sys_thread_t *thread_ptr, const char *name, } if (!pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED)) - { - result = pthread_create (thread_ptr, &attr, func, arg) == 0; -#ifdef HAVE_PTHREAD_SETNAME_NP - if (result && name != NULL) - { - /* We need to truncate here otherwise pthread_setname_np - fails to set the name. TASK_COMM_LEN is what the length - is called in the Linux kernel headers (Bug#38632). */ -#define TASK_COMM_LEN 16 - char p_name[TASK_COMM_LEN]; - strncpy (p_name, name, TASK_COMM_LEN - 1); - p_name[TASK_COMM_LEN - 1] = '\0'; - pthread_setname_np (*thread_ptr, p_name); - } -#endif - } + result = pthread_create (thread_ptr, &attr, func, arg) == 0; out: ; int error = pthread_attr_destroy (&attr); @@ -457,26 +461,24 @@ w32_set_thread_name (DWORD thread_id, const char *name) static thread_creation_function *thread_start_address; +void +sys_thread_set_name (const char *name) +{ + w32_set_thread_name (GetCurrentThreadId (), name); +} + /* _beginthread wants a void function, while we are passed a function that returns a pointer. So we use a wrapper. See the command in w32term.h about the need for ALIGN_STACK attribute. */ static void ALIGN_STACK w32_beginthread_wrapper (void *arg) { - /* FIXME: This isn't very clean: systhread.c is not supposed to know - that ARG is a pointer to a thread_state object, or be familiar - with thread_state object's structure in general. */ - struct thread_state *this_thread = arg; - - if (this_thread->thread_name) - w32_set_thread_name (GetCurrentThreadId (), this_thread->thread_name); - (void)thread_start_address (arg); } bool -sys_thread_create (sys_thread_t *thread_ptr, const char *name, - thread_creation_function *func, void *arg) +sys_thread_create (sys_thread_t *thread_ptr, thread_creation_function *func, + void *arg) { /* FIXME: Do threads that run Lisp require some minimum amount of stack? Zero here means each thread will get the same amount as diff --git a/src/systhread.h b/src/systhread.h index 5368acfb52c..005388fd5a4 100644 --- a/src/systhread.h +++ b/src/systhread.h @@ -112,10 +112,11 @@ extern sys_thread_t sys_thread_self (void) extern bool sys_thread_equal (sys_thread_t, sys_thread_t) ATTRIBUTE_WARN_UNUSED_RESULT; -extern bool sys_thread_create (sys_thread_t *, const char *, - thread_creation_function *, void *) +extern bool sys_thread_create (sys_thread_t *, thread_creation_function *, + void *) ATTRIBUTE_WARN_UNUSED_RESULT; extern void sys_thread_yield (void); +extern void sys_thread_set_name (const char *); #endif /* SYSTHREAD_H */ diff --git a/src/thread.c b/src/thread.c index f7e39dc4273..c7fe0614269 100644 --- a/src/thread.c +++ b/src/thread.c @@ -725,6 +725,9 @@ run_thread (void *state) self->m_stack_bottom = self->stack_top = (char *) &stack_pos; self->thread_id = sys_thread_self (); + if (self->thread_name) + sys_thread_set_name (self->thread_name); + acquire_global_lock (self); /* Put a dummy catcher at top-level so that handlerlist is never NULL. @@ -832,7 +835,7 @@ If NAME is given, it must be a string; it names the new thread. */) else new_thread->thread_name = NULL; sys_thread_t thr; - if (! sys_thread_create (&thr, c_name, run_thread, new_thread)) + if (! sys_thread_create (&thr, run_thread, new_thread)) { /* Restore the previous situation. */ all_threads = all_threads->next_thread; diff --git a/src/thread.h b/src/thread.h index e96a063a10b..a09929fa440 100644 --- a/src/thread.h +++ b/src/thread.h @@ -169,8 +169,7 @@ struct thread_state interrupter should broadcast to this condition. */ sys_cond_t *wait_condvar; - /* Thread's name in the locale encoding. Actually used only on - WINDOWSNT. */ + /* Thread's name in the locale encoding. */ char *thread_name; /* This thread might have released the global lock. If so, this is From a18373a999dcb5603e27900394dbd7e1fc139fe0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 7 Jan 2020 19:41:02 +0200 Subject: [PATCH 09/13] ; * etc/NEWS: Update the text about the XDG_CONFIG_HOME/emacs behavior. --- etc/NEWS | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a8c8e2763e4..6eb5d3811a0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -164,10 +164,15 @@ and will override their traditional locations (the home directory, "~/.emacs.d", etc.). Emacs will still look for init files in their traditional locations if -XDG_CONFIG_HOME/emacs does not exist, so invoking Emacs with -XDG_CONFIG_HOME='/nowhere' might be useful if your new-location init -files are scrambled, or if you want to force Emacs to ignore files -under XDG_CONFIG_HOME for some other reason. +XDG_CONFIG_HOME/emacs does not exist, but ~/.emacs.d or ~/.emacs does +exist, so invoking Emacs with XDG_CONFIG_HOME='/nowhere' might be +useful if your new-location init files are scrambled, or if you want +to force Emacs to ignore files under XDG_CONFIG_HOME for some other +reason. + +If neither XDG_CONFIG_HOME/emacs nor ~/.emacs.d exist, Emacs will now +default to XDG_CONFIG_HOME/emacs, and will create that directory and +set 'user-emacs-directory' to point to it. +++ ** Emacs can now be configured using an early init file. From fb432446f5378b99e284e237cf1341600ddb1636 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Tue, 7 Jan 2020 20:07:24 +0000 Subject: [PATCH 10/13] Objective C Mode imenu: cease recognizing "functions" within comments, etc. This fixes bug #38749. * lisp/progmodes/cc-menus.el (cc-imenu-objc-function): Put a c-literal-limits test around the innards of the main re-search-backward loop. --- lisp/progmodes/cc-menus.el | 98 +++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index 9c8c7ab56f5..97037dea6e8 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -45,6 +45,7 @@ (cc-bytecomp-defvar imenu-case-fold-search) (cc-bytecomp-defvar imenu-generic-expression) (cc-bytecomp-defvar imenu-create-index-function) +(cc-bytecomp-defun c-literal-limits) ;; imenu integration @@ -437,55 +438,56 @@ Example: (goto-char (point-max)) ;; (while (re-search-backward cc-imenu-objc-generic-expression nil t) - (setq langnum (if (match-beginning OBJC) - OBJC - (cond - ((match-beginning Cproto) Cproto) - ((match-beginning Cgeneralfunc) Cgeneralfunc) - ((match-beginning Cnoreturn) Cnoreturn)))) - (setq str (funcall func (match-beginning langnum) (match-end langnum))) - ;; - (cond - ;; - ;; C - ;; - ((not (eq langnum OBJC)) - (setq clist (cons (cons str (match-beginning langnum)) clist))) - ;; - ;; ObjC - ;; - ;; An instance Method - ((eq (aref str 0) ?-) - (setq str (concat "-" (cc-imenu-objc-method-to-selector str))) - (setq methodlist (cons (cons str - (match-beginning langnum)) - methodlist))) - ;; A factory Method - ((eq (aref str 0) ?+) - (setq str (concat "+" (cc-imenu-objc-method-to-selector str))) - (setq methodlist (cons (cons str - (match-beginning langnum)) - methodlist))) - ;; Interface or implementation or protocol - ((eq (aref str 0) ?@) - (setq classcount (1+ classcount)) + (when (not (c-literal-limits)) + (setq langnum (if (match-beginning OBJC) + OBJC + (cond + ((match-beginning Cproto) Cproto) + ((match-beginning Cgeneralfunc) Cgeneralfunc) + ((match-beginning Cnoreturn) Cnoreturn)))) + (setq str (funcall func (match-beginning langnum) (match-end langnum))) + ;; (cond - ((and (> (length str) implen) - (string= (substring str 0 implen) "@implementation")) - (setq str (substring str implen) - str2 "@implementation")) - ((string= (substring str 0 intflen) "@interface") - (setq str (substring str intflen) - str2 "@interface")) - ((string= (substring str 0 prtlen) "@protocol") - (setq str (substring str prtlen) - str2 "@protocol"))) - (setq str (cc-imenu-objc-remove-white-space str)) - (setq methodlist (cons (cons str2 - (match-beginning langnum)) - methodlist)) - (setq toplist (cons (cons str methodlist) toplist) - methodlist nil)))) + ;; + ;; C + ;; + ((not (eq langnum OBJC)) + (setq clist (cons (cons str (match-beginning langnum)) clist))) + ;; + ;; ObjC + ;; + ;; An instance Method + ((eq (aref str 0) ?-) + (setq str (concat "-" (cc-imenu-objc-method-to-selector str))) + (setq methodlist (cons (cons str + (match-beginning langnum)) + methodlist))) + ;; A factory Method + ((eq (aref str 0) ?+) + (setq str (concat "+" (cc-imenu-objc-method-to-selector str))) + (setq methodlist (cons (cons str + (match-beginning langnum)) + methodlist))) + ;; Interface or implementation or protocol + ((eq (aref str 0) ?@) + (setq classcount (1+ classcount)) + (cond + ((and (> (length str) implen) + (string= (substring str 0 implen) "@implementation")) + (setq str (substring str implen) + str2 "@implementation")) + ((string= (substring str 0 intflen) "@interface") + (setq str (substring str intflen) + str2 "@interface")) + ((string= (substring str 0 prtlen) "@protocol") + (setq str (substring str prtlen) + str2 "@protocol"))) + (setq str (cc-imenu-objc-remove-white-space str)) + (setq methodlist (cons (cons str2 + (match-beginning langnum)) + methodlist)) + (setq toplist (cons (cons str methodlist) toplist) + methodlist nil))))) ;; In this buffer, there is only one or zero @{interface|implementation|protocol}. (if (< classcount 2) From af5709f16b0aa21aea8158a953e9a5a803e61018 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 8 Jan 2020 09:54:04 +0100 Subject: [PATCH 11/13] Further enhancement on `tramp-file-local-name' * lisp/net/tramp.el (tramp-file-local-name): Call `file-local-name' if NAME is not a Tramp file name. --- lisp/net/tramp.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e0013def5d0..0ad65fb8bd0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1330,8 +1330,7 @@ entry does not exist, return nil." t)) ;; This function bypasses the file name handler approach. It is NOT -;; recommended to use it in any package if not absolutely necessary, -;; because it won't work for remote file names not supported by Tramp. +;; recommended to use it in any package if not absolutely necessary. ;; However, it is more performant than `file-local-name', and might be ;; useful where performance matters, like in operations over a bulk ;; list of file names. @@ -1340,13 +1339,13 @@ entry does not exist, return nil." This function removes from NAME the specification of the remote host and the method of accessing the host, leaving only the part that identifies NAME locally on the remote system. If NAME does -not match `tramp-file-name-regexp', just NAME is returned. The -returned file name can be used directly as argument of -`process-file', `start-file-process', or `shell-command'." +not match `tramp-file-name-regexp', just `file-local-name' is +called. The returned file name can be used directly as argument +of `process-file', `start-file-process', or `shell-command'." (or (and (tramp-tramp-file-p name) (string-match (nth 0 tramp-file-name-structure) name) (match-string (nth 4 tramp-file-name-structure) name)) - name)) + (tramp-compat-file-local-name name))) (defun tramp-find-method (method user host) "Return the right method string to use depending on USER and HOST. From 42329e6d3b51dd7a9202cd1a98160d5e2db34509 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 8 Jan 2020 14:44:18 +0100 Subject: [PATCH 12/13] ; * etc/NEWS: Review of the whole text. --- etc/NEWS | 300 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 156 insertions(+), 144 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 6eb5d3811a0..6d4a6119afa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -69,8 +69,8 @@ When built with the portable dumping support (which is the default), Emacs looks for the 'emacs.pdmp' file, generated during the build, in its data directory at startup, and loads the dumped state from there. The new command-line argument '--dump-file=FILE' allows to specify a -non-default '.pdmp' file to load the state from; see the node "Initial -Options" in the Emacs manual for more information. +non-default '.pdmp' file to load the state from; see the node +"(emacs) Initial Options" in the Emacs manual for more information. An Emacs started via a dump file can create a new dump file only if it was invoked with the '-batch' option. (This is a temporary @@ -92,7 +92,7 @@ change to one of the data structures that it relies on. '--enable-checking=xmallocoverrun' have been withdrawn. The former made Emacs irredeemably slow, and the latter made it crash. Neither option was useful with modern debugging tools such as AddressSanitizer. -(See etc/DEBUG for the details of using the modern replacements of the +(See "etc/DEBUG" for the details of using the modern replacements of the removed configure options.) --- @@ -158,25 +158,25 @@ support. For example, it looks for init.el in "~/.config/emacs/init.el", and similarly for other init files. -The XDG_CONFIG_HOME environment variable (which defaults to "~/.config") +The 'XDG_CONFIG_HOME' environment variable (which defaults to "~/.config") specifies the parent directory of these and other configuration files, and will override their traditional locations (the home directory, "~/.emacs.d", etc.). Emacs will still look for init files in their traditional locations if -XDG_CONFIG_HOME/emacs does not exist, but ~/.emacs.d or ~/.emacs does -exist, so invoking Emacs with XDG_CONFIG_HOME='/nowhere' might be -useful if your new-location init files are scrambled, or if you want -to force Emacs to ignore files under XDG_CONFIG_HOME for some other -reason. +"$XDG_CONFIG_HOME/emacs" does not exist, but "~/.emacs.d" or +"~/.emacs" does exist, so invoking Emacs with XDG_CONFIG_HOME='/nowhere' +might be useful if your new-location init files are scrambled, or if +you want to force Emacs to ignore files under 'XDG_CONFIG_HOME' for +some other reason. -If neither XDG_CONFIG_HOME/emacs nor ~/.emacs.d exist, Emacs will now -default to XDG_CONFIG_HOME/emacs, and will create that directory and -set 'user-emacs-directory' to point to it. +If neither "$XDG_CONFIG_HOME/emacs" nor "~/.emacs.d" exist, Emacs will +now default to "$XDG_CONFIG_HOME/emacs", and will create that directory +and set 'user-emacs-directory' to point to it. +++ ** Emacs can now be configured using an early init file. -The file is called 'early-init.el', in 'user-emacs-directory'. It is +The file is called "early-init.el", in 'user-emacs-directory'. It is loaded very early in the startup process: before graphical elements such as the tool bar are initialized, and before the package manager is initialized. The primary purpose is to allow customizing how the @@ -283,7 +283,6 @@ The old function names are maintained as aliases for backward compatibility. ** emacsclient - +++ *** emacsclient now supports the 'EMACS_SOCKET_NAME' environment variable. The command-line argument '--socket-name' overrides it. @@ -468,7 +467,7 @@ This user option allows to specify the set of buffers that may be shown by 'switch-to-prev-buffer' and 'switch-to-next-buffer' more stringently than the now obsolete 'switch-to-visible-buffer'. -** New 'flex' completion style +** New 'flex' completion style. An implementation of popular "flex/fuzzy/scatter" completion which matches strings where the pattern appears as a subsequence. Put simply, makes "foo" complete to both "barfoo" and "frodo". Add 'flex' @@ -493,7 +492,6 @@ Consequently, a theme generally shouldn't specify this attribute unless it has a good reason to do so. ** Connection-local variables - +++ *** Connection-local variables are applied by default like file-local and directory-local variables. @@ -521,7 +519,6 @@ Emacs configured with Cairo drawing and linked with cairo >= 1.16.0. +++ ** Emacs now optionally displays a fill column indicator. - This is similar to what 'fill-column-indicator' package provides, but much faster and compatible with 'show-trailing-whitespace'. @@ -533,7 +530,7 @@ The indicator is not displayed at all in minibuffer windows and in tooltips, as it is not useful there. There are 2 new buffer local variables and 1 face to customize this -mode they are described in the manual "(emacs) Display". +mode, they are described in the manual "(emacs) Display". +++ ** 'progress-reporter-update' accepts a suffix string to display. @@ -547,7 +544,6 @@ It is used for displaying file sizes and disk space in some cases. +++ ** Emacs now interprets RGB triplets like HTML, SVG, and CSS do. - The X convention previously used differed slightly, particularly for RGB triplets with a single hexadecimal digit per component. @@ -555,8 +551,8 @@ RGB triplets with a single hexadecimal digit per component. ** The toolbar now shows the equivalent key binding in its tooltips. --- -** The File menu-bar menu was re-arranged: Print menu items moved to -submenu, and also added the new entries for tabs. +** The File menu-bar menu was re-arranged. +Print menu items moved to submenu, and also added the new entries for tabs. --- ** 'scroll-lock-mode' is now bound to the 'Scroll_Lock' key globally. @@ -734,6 +730,7 @@ network connection information (in addition to the host name). --- ** desktop + *** When called interactively with a prefix arg 'C-u', 'desktop-read' now prompts the user for the directory containing the desktop file. @@ -750,28 +747,34 @@ an offset to absolute line numbers. +++ ** winner + *** A new user option, 'winner-boring-buffers-regexp', has been added. ** table -** 'table-generate-source' and friends now support outputting wiki and + +*** 'table-generate-source' and friends now support outputting wiki and mediawiki format tables. --- ** telnet-mode + *** Reverting a buffer in 'telnet-mode' will restart a closed connection. ** goto-addr + *** A way to more conveniently specify what URI address schemes that should be ignored have been added via the 'goto-address-uri-schemes-ignored' variable. +++ ** tex-mode + *** 'latex-noindent-commands' controls indentation of certain commands. You can use this new user option to control indentation of arguments of \emph, \footnote, and similar commands. ** byte compiler + *** 'byte-compile-dynamic' is now obsolete. This is because on the one hand it suffers from misbehavior in corner cases that have plagued it for years, and on the other experiments indicated @@ -783,20 +786,24 @@ command that will recompile the file previously compiled with 'M-x byte-compile-file' and the like. ** compile.el + --- *** In 'compilation-error-regexp-alist', 'line' (and 'end-line') can be functions. + +++ *** 'compilation-context-lines' can now take the value t; this is like nil, but instead of scrolling the current line to the top of the screen when there is no left fringe, it inserts a visible arrow before column zero. + --- *** The new 'compilation-transform-file-match-alist' user option can be used to transform file name matches compilation output, and remove known false positives being recognized as warnings/errors. ** cl-lib.el + +++ *** 'cl-defstruct' has a new ':noinline' argument to prevent inlining its functions. @@ -808,13 +815,16 @@ its functions. *** 'cl-values-list' will now signal an error if its argument isn't a list. ** doc-view.el + *** New commands 'doc-view-presentation' and 'doc-view-fit-window-to-page'. -*** Added support for password-protected PDF files + +*** Added support for password-protected PDF files. *** A new user option 'doc-view-pdftotext-program-args' has been added to allow controlling how the conversion to text is done. ** Ido + *** New user option 'ido-big-directories' to mark directories whose names match certain regular expressions as big. Ido won't attempt to list the contents of such directories when completing file names. @@ -846,13 +856,13 @@ at the end of the active minibuffer. a character using the minibuffer by 'read-char-from-minibuffer'. ** map.el + *** Now also understands plists. *** Now defined via generic functions that can be extended via 'cl-defmethod'. *** Deprecate the 'map-put' macro in favor of a new 'map-put!' function. *** 'map-contains-key' now returns a boolean rather than the key. *** Deprecate the 'testfn' args of 'map-elt' and 'map-contains-key'. *** New generic function 'map-insert'. - +++ *** The 'type' arg can be a list '(hash-table :key1 VAL1 :key2 VAL2 ...)'. @@ -922,7 +932,6 @@ The mode is automatically enabled in files that start with the ** project.el *** New commands 'project-search' and 'project-query-replace-regexp'. - *** New user option 'project-read-file-name-function'. ** Etags @@ -1070,7 +1079,7 @@ by Hg. you invoke 'C-x v m' ('vc-merge'). --- -*** The Hg (Mercurial) back-end now use tags, branches and bookmarks +*** The Hg (Mercurial) back-end now uses tags, branches and bookmarks instead of revision numbers as completion candidates when it prompts for a revision. @@ -1122,6 +1131,7 @@ Emacs 24.1, but wasn't documented until now. *** New command 'diff-buffers' interactively diffs two buffers. ** Diff mode + +++ *** Hunks are now automatically refined by font-lock. To disable refinement, set the new user option 'diff-refine' to nil. @@ -1249,7 +1259,7 @@ included. Database passwords can now by stored in NETRC or JSON data files that may optionally be encrypted. When establishing an interactive session with the database via 'sql-connect' or a product specific function, -like 'sql-mysql' or 'my-postgres', the password wallet will be +like 'sql-mysql' or 'sql-postgres', the password wallet will be searched for the password. The 'sql-product', 'sql-server', 'sql-database', and the 'sql-username' will be used to identify the appropriate authorization. This eliminates the discouraged practice of @@ -1321,8 +1331,8 @@ package data. It is therefore recommended to keep this line. +++ *** Change of 'package-check-signature' for packages with multiple sigs. -In previous Emacsen, 't' checked that all signatures are valid. -Now 't' only checks that at least one signature is valid and the new 'all' +In previous Emacsen, t checked that all signatures are valid. +Now t only checks that at least one signature is valid and the new 'all' value needs to be used if you want to enforce that all signatures are valid. This only affects packages with multiple signatures. @@ -1402,9 +1412,9 @@ This command finds definitions of the identifier at the place of a mouse click event, and is intended to be bound to a mouse event. +++ -*** Changing 'xref-marker-ring-length' works after 'xref.el' is loaded. +*** Changing 'xref-marker-ring-length' works after xref.el is loaded. Previously, setting 'xref-marker-ring-length' would only take effect -if set before 'xref.el' was loaded. +if set before xref.el was loaded. --- *** 'xref-find-definitions' now sets the mark at the buffer position @@ -1423,8 +1433,7 @@ behavior and the display of results. *** Search results show the buffer even for one hit. The search-type Xref commands (e.g. 'xref-find-references' or 'project-find-regexp') now show the results buffer even when there is -only one hit. This can be altered by changing -'xref-show-xrefs-function'. +only one hit. This can be altered by changing 'xref-show-xrefs-function'. +++ *** Xref buffers support refreshing the search results. @@ -1446,7 +1455,7 @@ completion facilities. ** Ecomplete --- -*** The ecomplete sorting has changed to a decay-based algorithm. +*** The Ecomplete sorting has changed to a decay-based algorithm. This can be controlled by the new 'ecomplete-sort-predicate' user option. --- @@ -1471,14 +1480,14 @@ are marked with "." in the summary mode lines.) 'never' for never expunging messages, 'immediately' for immediately expunging deleted messages, and 'on-exit' to expunge deleted articles when exiting the group's summary buffer. Setting 'nnimap-expunge' to -'nil' or 't' is still supported but not recommended, since it may +nil or t is still supported but not recommended, since it may result in Gnus expunging all messages that have been flagged as deleted by any IMAP client (rather than just those that have been deleted by Gnus). +++ *** New user option 'gnus-use-atomic-windows' makes Gnus window layouts atomic. -See the "Atomic Windows" section of the Elisp manual for details. +See the "(elisp) Atomic Windows" node of the Elisp manual for details. +++ *** There's a new value for 'gnus-article-date-headers', @@ -1516,20 +1525,19 @@ See the concept index in the Gnus manual for the 'match-list' entry. *** nil is no longer an allowed value for 'mm-text-html-renderer'. +++ -The default value of 'mm-inline-large-images' has changed from nil to -'resize', which means that large images will be resized instead of +*** The default value of 'mm-inline-large-images' has changed from nil +to 'resize', which means that large images will be resized instead of displayed with an external program by default. +++ -*** A new Gnus summary mode command, 'S A' -('gnus-summary-attach-article') can be used to attach the current -article(s) to a pre-existing Message buffer, or create a new Message -buffer with the article(s) attached. +*** A new Gnus summary mode command, 'S A' ('gnus-summary-attach-article') +can be used to attach the current article(s) to a pre-existing Message +buffer, or create a new Message buffer with the article(s) attached. +++ -*** A new Gnus summary mode command, 'w' -('gnus-summary-browse-url') scans the article buffer for URLs, and -offers them to the user to open with 'browse-url'. +*** A new Gnus summary mode command, 'w' ('gnus-summary-browse-url') +scans the article buffer for URLs, and offers them to the user to open +with 'browse-url'. --- *** New user option 'nnir-notmuch-filter-group-names-function'. @@ -1550,8 +1558,7 @@ fail. *** New hook 'erc-insert-done-hook'. This hook is called after strings have been inserted into the buffer, and is free to alter point and window configurations, as it's not -called from inside a 'save-excursion', as opposed to -'erc-insert-post-hook'. +called from inside a 'save-excursion', as opposed to 'erc-insert-post-hook'. --- *** 'erc-button-google-url' has been renamed to 'erc-button-search-url' @@ -1637,14 +1644,14 @@ attempt when communicating with the SMTP server(s), the 'smtpmail-servers-requiring-authorization' user option can be used. +++ -*** smtpmail will now try resending mail when getting a transient 4xx +*** smtpmail will now try resending mail when getting a transient "4xx" error message from the SMTP server. The new 'smtpmail-retries' user option says how many times to retry. ** Footnote mode --- -*** Support Hebrew-style footnotes +*** Support Hebrew-style footnotes. --- *** Footnote text lines are now aligned. @@ -1738,7 +1745,7 @@ with a numeric argument. of matches in the Isearch prompt. User options 'lazy-count-prefix-format' and 'lazy-count-suffix-format' define the format of the current and the total number of matches in the prompt's -prefix and suffix respectively. +prefix and suffix, respectively. --- *** 'lazy-highlight-buffer' highlights matches in the full buffer. @@ -1751,7 +1758,6 @@ highlight in one iteration while processing the full buffer. +++ *** New isearch bindings. - 'C-M-z' invokes new function 'isearch-yank-until-char', which yanks everything from point up to but not including the specified character into the search string. This is especially useful for @@ -1768,13 +1774,13 @@ to the existing binding 'M-s h r' ('highlight-regexp') that highlights JUST the search string. +++ -*** New user option 'isearch-yank-on-move' provides options 't' and 'shift' +*** New user option 'isearch-yank-on-move' provides options t and 'shift' to extend the search string by yanking text that ends at the new position after moving point in the current buffer. 'shift' extends the search string by motion commands while holding down the shift key. +++ -*** 'isearch-allow-scroll' provides new option 'unlimited' to allow +*** 'isearch-allow-scroll' provides a new option 'unlimited' to allow scrolling any distance off screen. --- @@ -1799,7 +1805,7 @@ IOTA WITH OXIA". *** New char-folding options: 'char-fold-include' lets you add ad hoc foldings, 'char-fold-exclude' to remove foldings from default decomposition, and 'char-fold-symmetric' to search for any of an equivalence class of -characters. For example, with a 'nil' value of 'char-fold-symmetric' +characters. For example, with a nil value of 'char-fold-symmetric' you can search for "e" to find "é", but not vice versa. With a non-nil value you can search for either, for example, you can search for "é" to find "e". @@ -1913,7 +1919,7 @@ This is useful for games where lower scores are better, like time-based games. ** Filecache --- -*** Completing filenames in the minibuffer via 'C-TAB' now uses the +*** Completing file names in the minibuffer via 'C-TAB' now uses the styles as configured by the user option 'completion-styles'. ** New macros 'thunk-let' and 'thunk-let*'. @@ -2060,8 +2066,8 @@ Tramp for some look-alike remote file names. +++ *** For some connection methods, like "su" or "sudo", the host name in -ad-hoc multi-hop file names must match the previous hop. Default host -names are adjusted to the host name from the previous hop. +multi-hop file names must match the previous hop. Default host names +are adjusted to the host name from the previous hop. +++ *** For the connection methods "sudo" and "doas" there exists a @@ -2097,15 +2103,6 @@ Two new user options are provided for this: *** The return value of method 'register-val-describe' includes the names of buffers shown by the windows of a window configuration. ---- -** The options.el library has been removed. -It was obsolete since Emacs 22.1, replaced by customize. - ---- -** The tls.el and starttls.el libraries are now marked obsolete. -Use of built-in libgnutls based functionality (described in the Emacs -GnuTLS manual) is recommended instead. - ** Message --- @@ -2140,7 +2137,7 @@ are formatted as MIME digests. *** 'message-forward-included-headers' has changed its default to exclude most headers when forwarding. -*** 'mml-secure-openpgp-sign-with-sender' sets also "gpg --sender" +*** 'mml-secure-openpgp-sign-with-sender' sets also "gpg --sender". When 'mml-secure-openpgp-sign-with-sender' is non-nil message sender's email address (in addition to its old behavior) will also be used to set gpg's "--sender email@domain" option. @@ -2150,10 +2147,10 @@ The option is useful for two reasons when verifying the signature: 1. GnuPG's TOFU statistics are updated for the specific user id (email) only. See gpg(1) man page about "--sender". - 2. GnuPG's '--auto-key-retrieve' functionality can use WKD (web key + 2. GnuPG's "--auto-key-retrieve" functionality can use WKD (web key directory) method for finding the signer's key. You need GnuPG 2.2.17 to fully benefit from this feature. See gpg(1) man page for - '--auto-key-retrieve'. + "--auto-key-retrieve". --- ** EasyPG @@ -2171,9 +2168,9 @@ been removed. Use 'encode-coding-string', 'decode-coding-string', and --- *** 'epg-context' structure supports now 'sender' slot. The value of the new 'sender' slot (if a string) is used to set gpg's -'--sender' option. This feature is used by +"--sender" option. This feature is used by 'mml-secure-openpgp-sign-with-sender'. See gpg(1) manual page about -'--sender' for more information. +"--sender" for more information. --- ** Rmail @@ -2414,7 +2411,7 @@ of an idle Emacs, but may fail on some network file systems; set notification is not supported. The default value is nil. +++ -*** New variable 'buffer-auto-revert-by-notification' +*** New variable 'buffer-auto-revert-by-notification'. A major mode can declare that notification on the buffer's default directory is sufficient to know when updates are required, by setting the new variable 'buffer-auto-revert-by-notification' to a non-nil @@ -2551,6 +2548,7 @@ if you set 'time-stamp-format' or 'time-stamp-pattern' with a file-local variable, you may need to update the value. ** mode-local + --- *** Declare 'define-overload' and 'define-child-mode' as obsolete. @@ -2565,13 +2563,38 @@ To do this, use 'c-toggle-comment-style', if needed, to set the desired default comment style (block or line); then set the user option 'c-mark-wrong-style-of-comment' to non-nil. +** Mailcap + +--- +*** The new function 'mailcap-file-name-to-mime-type' has been added. +It's a simple convenience function for looking up MIME types based on +file name extensions. + +--- +*** The default way the list of possible external viewers for MIME +types is sorted and chosen has changed. Earlier, the most specific +viewer was chosen, even if there was a general override in "~/.mailcap". +For instance, if "/etc/mailcap" has an entry for "image/gif", that one +will be chosen even if you have an entry for "image/*" in your +"~/.mailcap" file. But with the new method, entries from "~/.mailcap" +overrides all system and Emacs-provided defaults. To get the old +method back, set 'mailcap-prefer-mailcap-viewers' to nil. + +** URL + +--- +*** The 'file:' handler no longer looks for "index.html" in +directories if you ask it for a "file:///dir" URL. Since this is a +low-level library, such decisions (if they are to be made at all) are +left to higher-level functions. + * New Modes and Packages in Emacs 27.1 ** Tab Bars +++ -*** Tab Bar mode. +*** Tab Bar mode The new command 'tab-bar-mode' enables the tab bar at the top of each frame, where you can use tabs to switch between named persistent window configurations. @@ -2754,43 +2777,48 @@ fixnum for such arguments. --- ** Some functions and variables obsolete since Emacs 22 have been removed: -archive-mouse-extract, assoc-ignore-case, assoc-ignore-representation, -backward-text-line, blink-cursor, bookmark-exit-hooks, -c-opt-op-identitier-prefix, comint-use-prompt-regexp-instead-of-fields, -compilation-finish-function, count-text-lines, cperl-vc-header-alist, -custom-face-save-command, cvs-display-full-path, cvs-fileinfo->full-path, -delete-frame-hook, derived-mode-class, describe-char-after, describe-project, -desktop-basefilename, desktop-buffer-handlers, desktop-buffer-misc-functions, -desktop-buffer-modes-to-save, desktop-enable, desktop-load-default, -dired-omit-files-p, disabled-command-hook, dungeon-mode-map, -electric-nroff-mode, electric-nroff-newline, electric-perl-terminator, -focus-frame, forward-text-line, generic-define-mswindows-modes, -generic-define-unix-modes, generic-font-lock-defaults, goto-address-at-mouse, -highlight-changes-colours, ibuffer-elide-long-columns, ibuffer-hooks, -ibuffer-mode-hooks, icalendar-convert-diary-to-ical, -icalendar-extract-ical-from-buffer, imenu-always-use-completion-buffer-p, -ipconfig-program, ipconfig-program-options, isearch-lazy-highlight-cleanup, -isearch-lazy-highlight-initial-delay, isearch-lazy-highlight-interval, -isearch-lazy-highlight-max-at-a-time, iswitchb-use-fonts, -latin1-char-displayable-p, mouse-wheel-click-button, mouse-wheel-down-button, -mouse-wheel-up-button, new-frame, pascal-outline, process-kill-without-query, -recentf-menu-append-commands-p, rmail-pop-password, -rmail-pop-password-required, savehist-load, set-default-font, -spam-list-of-processors, speedbar-add-ignored-path-regexp, -speedbar-buffers-line-path, speedbar-ignored-path-expressions, -speedbar-ignored-path-regexp, speedbar-line-path, speedbar-path-line, -timer-set-time-with-usecs, tooltip-gud-display, tooltip-gud-modes, -tooltip-gud-toggle-dereference, unfocus-frame, unload-hook-features-list, -update-autoloads-from-directories, vc-comment-ring, vc-comment-ring-index, -vc-comment-search-forward, vc-comment-search-reverse, vc-comment-to-change-log, -vc-diff-switches-list, vc-next-comment, vc-previous-comment, view-todo, -x-lost-selection-hooks, x-sent-selection-hooks. +'archive-mouse-extract', 'assoc-ignore-case', 'assoc-ignore-representation', +'backward-text-line', 'blink-cursor', 'bookmark-exit-hooks', +'c-opt-op-identitier-prefix', 'comint-use-prompt-regexp-instead-of-fields', +'compilation-finish-function', 'count-text-lines', 'cperl-vc-header-alist', +'custom-face-save-command', 'cvs-display-full-path', 'cvs-fileinfo->full-path', +'delete-frame-hook', 'derived-mode-class', 'describe-char-after', +'describe-project', 'desktop-basefilename', 'desktop-buffer-handlers', +'desktop-buffer-misc-functions', 'desktop-buffer-modes-to-save', +'desktop-enable', 'desktop-load-default', 'dired-omit-files-p', +'disabled-command-hook', 'dungeon-mode-map', 'electric-nroff-mode', +'electric-nroff-newline', 'electric-perl-terminator', 'focus-frame', +'forward-text-line', 'generic-define-mswindows-modes', +'generic-define-unix-modes', 'generic-font-lock-defaults', +'goto-address-at-mouse', 'highlight-changes-colours', +'ibuffer-elide-long-columns', 'ibuffer-hooks', 'ibuffer-mode-hooks', +'icalendar-convert-diary-to-ical', 'icalendar-extract-ical-from-buffer', +'imenu-always-use-completion-buffer-p', 'ipconfig-program', +'ipconfig-program-options', 'isearch-lazy-highlight-cleanup', +'isearch-lazy-highlight-initial-delay', 'isearch-lazy-highlight-interval', +'isearch-lazy-highlight-max-at-a-time', 'iswitchb-use-fonts', +'latin1-char-displayable-p', 'mouse-wheel-click-button', +'mouse-wheel-down-button', 'mouse-wheel-up-button', 'new-frame', +'pascal-outline', 'process-kill-without-query', +'recentf-menu-append-commands-p', 'rmail-pop-password', +'rmail-pop-password-required', 'savehist-load', 'set-default-font', +'spam-list-of-processors', 'speedbar-add-ignored-path-regexp', +'speedbar-buffers-line-path', 'speedbar-ignored-path-expressions', +'speedbar-ignored-path-regexp', 'speedbar-line-path', 'speedbar-path-line', +'timer-set-time-with-usecs', 'tooltip-gud-display', 'tooltip-gud-modes', +'tooltip-gud-toggle-dereference', 'unfocus-frame', 'unload-hook-features-list', +'update-autoloads-from-directories', 'vc-comment-ring', 'vc-comment-ring-index', +'vc-comment-search-forward', 'vc-comment-search-reverse', +'vc-comment-to-change-log', 'vc-diff-switches-list', 'vc-next-comment', +'vc-previous-comment', 'view-todo', 'x-lost-selection-hooks', +'x-sent-selection-hooks'. --- ** Further functions and variables obsolete since Emacs 24 have been removed: -default-directory-alist, dired-default-directory, -dired-default-directory-alist, dired-enable-local-variables, -dired-hack-local-variables, dired-local-variables-file, dired-omit-here-always. +'default-directory-alist', 'dired-default-directory', +'dired-default-directory-alist', 'dired-enable-local-variables', +'dired-hack-local-variables', 'dired-local-variables-file', +'dired-omit-here-always'. +++ ** Garbage collection no longer treats miscellaneous objects specially; @@ -2869,6 +2897,20 @@ where it scales the image under the mouse pointer. ** 'help-follow-symbol' now signals 'user-error' if point (or the position pointed to by the argument POS) is not in a symbol. +--- +** The options.el library has been removed. +It was obsolete since Emacs 22.1, replaced by customize. + +--- +** The tls.el and starttls.el libraries are now marked obsolete. +Use of built-in libgnutls based functionality (described in the Emacs +GnuTLS manual) is recommended instead. + +--- +** The url-ns.el library is now marked obsolete. +This library is used to open configuration files for the long defunct +web browser Netscape, and is no longer relevant. + * Lisp Changes in Emacs 27.1 @@ -3067,12 +3109,12 @@ informational messages that look pleasing during the Emacs build. --- ** New 'help-fns-describe-variable-functions' hook. -Makes it possible to add metadata information to 'describe-variable'. +It makes it possible to add metadata information to 'describe-variable'. ** i18n (internationalization) --- -*** ngettext can be used now to return the right plural form +*** 'ngettext' can be used now to return the right plural form according to the given numeric value. +++ @@ -3085,7 +3127,7 @@ according to the given numeric value. ** 'lookup-key' can take a list of keymaps as argument. +++ -** 'condition-case' now accepts 't' to match any error symbol. +** 'condition-case' now accepts t to match any error symbol. +++ ** New function 'proper-list-p'. @@ -3157,7 +3199,7 @@ are unaffected by these changes. In addition, a number of functions now allow the caller to detect what has changed since last redisplay: 'window-old-buffer' returns for any -window the buffer it showed at that time. ‘old-selected-window’ and +window the buffer it showed at that time. 'old-selected-window' and 'old-selected-frame' return the window and frame that were selected during last redisplay. 'window-old-pixel-width' (renamed from 'window-pixel-width-before-size-change'), 'window-old-pixel-height' @@ -3322,36 +3364,6 @@ If the new optional ALLOW-PARTIAL argument is passed, then the data that was decompressed successfully before failing will be inserted into the buffer. -** Mailcap - ---- -*** The new function 'mailcap-file-name-to-mime-type' has been added. -It's a simple convenience function for looking up MIME types based on -file name extensions. - ---- -*** The default way the list of possible external viewers for MIME -types is sorted and chosen has changed. Earlier, the most specific -viewer was chosen, even if there was a general override in "~/.mailcap". -For instance, if "/etc/mailcap" has an entry for "image/gif", that one -will be chosen even if you have an entry for "image/*" in your -"~/.mailcap" file. But with the new method, entries from "~/.mailcap" -overrides all system and Emacs-provided defaults. To get the old -method back, set 'mailcap-prefer-mailcap-viewers' to nil. - -** URL - ---- -*** The 'file:' handler no longer looks for "index.html" in -directories if you ask it for a "file:///dir" URL. Since this is a -low-level library, such decisions (if they are to be made at all) are -left to higher-level functions. - ---- -** The url-ns.el library is now marked obsolete. -This library is used to open configuration files for the long defunct -web browser Netscape, and is no longer relevant. - ** Image mode --- @@ -3470,7 +3482,7 @@ case. It is a convenient and readable way to specify a regexp that should not match anything, and is as fast as any such regexp can be. -++++ ++++ ** New functions to handle the URL variant of base-64 encoding. New functions 'base64url-encode-string' and 'base64url-encode-region' implement the url-variant of base-64 encoding as defined in RFC4648. @@ -3484,7 +3496,7 @@ encoding. The new third argument is a string put between the number and unit; it defaults to the empty string. The new fourth argument is a string representing the unit to use; it defaults to "B" when the second -argument is 'iec' and the empty string otherwise. We recomment a +argument is 'iec' and the empty string otherwise. We recommend a space or non-breaking space as third argument, and "B" as fourth argument, circumstances allowing. @@ -3543,7 +3555,7 @@ ordinary keys, function keys and mouse clicks. This allows using them in their standard macOS way for composing characters. ** The special handling of 'frame-title-format' on NS where setting it -to 't' would enable the macOS proxy icon has been replaced with a +to t would enable the macOS proxy icon has been replaced with a separate variable, 'ns-use-proxy-icon'. 'frame-title-format' will now work as on other platforms. From 6cd9ccb0a28ec03ffe180b7429e0378511b7d459 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 8 Jan 2020 18:21:53 +0200 Subject: [PATCH 13/13] Fix compression of directories in Dired This fixes comporession and uncompression of directories on MS-Windows, but also on other systems. The original code used ":" as the REGEXP of the directory entry in dired-compress-file-suffixes, which on Windows always matched any absolute file name, and can also match unusual file names on Posix hosts. This false match would cause dired-compress-file to act as if we are decompressing a directory, but use a command suitable for compression, which would fail in interesting ways. We now use a REGEXP that can never match any valid file name. * lisp/dired-aux.el (dired-compress-file-suffixes): Make the "compress directory" entry's REGEXP really fail to match any valid file name. (dired-compress-file): Adapt to the change in dired-compress-file-suffixes. (Bug#39024) (dired-compress): If the current file is a directory, or if the uncompressed file is a directory, don't remove the original from the listing, since it is left in the filesystem. --- lisp/dired-aux.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 59d389dc630..0069c1744dc 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -992,7 +992,14 @@ command with a prefix argument (the value does not matter)." (ignore-errors (dired-remove-entry new-file)) (goto-char start) ;; Now replace the current line with an entry for NEW-FILE. - (dired-update-file-line new-file) nil) + ;; But don't remove the current line if either FROM-FILE or + ;; NEW-FILE is a directory, because compressing/uncompressing + ;; directories doesn't remove the original. + (if (or (file-directory-p from-file) + (file-directory-p new-file)) + (dired-add-entry new-file nil t) + (dired-update-file-line new-file)) + nil) (dired-log (concat "Failed to (un)compress " from-file)) from-file))) @@ -1020,8 +1027,9 @@ command with a prefix argument (the value does not matter)." ("\\.7z\\'" "" "7z x -aoa -o%o %i") ;; This item controls naming for compression. ("\\.tar\\'" ".tgz" nil) - ;; This item controls the compression of directories - (":" ".tar.gz" "tar -cf - %i | gzip -c9 > %o")) + ;; This item controls the compression of directories. Its REGEXP + ;; element should never match any valid file name. + ("\000" ".tar.gz" "tar -cf - %i | gzip -c9 > %o")) "Control changes in file name suffixes for compression and uncompression. Each element specifies one transformation rule, and has the form: (REGEXP NEW-SUFFIX PROGRAM) @@ -1145,7 +1153,7 @@ Return nil if no change in files." (condition-case nil (if (file-directory-p file) (progn - (setq suffix (cdr (assoc ":" dired-compress-file-suffixes))) + (setq suffix (cdr (assoc "\000" dired-compress-file-suffixes))) (when suffix (let ((out-name (concat file (car suffix))) (default-directory (file-name-directory file)))