commit 209d85fe5691a9334e14bc63b0c836880831a054 (HEAD, refs/remotes/origin/master) Author: Mark Oteiza Date: Mon Nov 21 04:19:51 2016 -0500 Add further consideration to string-width (Bug#24972) * lisp/ibuffer.el (ibuffer-compile-make-eliding-form): (ibuffer-compile-make-substring-form): Use truncate-string-to-width. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 8c64179..faadb67 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1558,18 +1558,17 @@ If point is on a group name, this function operates on that group." ,(if from-end-p `(concat ,ellipsis (substring ,strvar - (length ibuffer-eliding-string))) - `(concat - (substring ,strvar 0 (- strlen ,(length ellipsis))) + (string-width ibuffer-eliding-string))) + `(truncate-string-to-width + ,strvar strlen nil nil ,ellipsis)) ,strvar) strvar))) (defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p) (if from-end-p - `(substring str - (- strlen ,maxvar)) - `(substring ,strvar 0 ,maxvar))) + `(truncate-string-to-width str (string-width str) (- strlen ,maxvar)) + `(truncate-string-to-width ,strvar ,maxvar))) (defun ibuffer-compile-make-format-form (strvar widthform alignment) (let* ((left `(make-string tmp2 ?\s)) commit b13d6f2c397419688374f95c99a55d077312ca94 Author: Katsumi Yamaoka Date: Mon Nov 21 08:21:27 2016 +0000 Don't collect strings existing out of ... * lisp/net/shr.el (shr-collect-extra-strings-in-table): Don't collect strings existing out of ... to avoid duplication with what `shr-tag-table' renders. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index f1b0087..75e5580 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1899,20 +1899,21 @@ The preference is a float determined from `shr-prefer-media-type'." (when (zerop shr-table-depth) (save-excursion (shr-expand-alignments start (point))) - (save-restriction - (narrow-to-region (point) (point)) - (insert (mapconcat #'identity - (shr-collect-extra-strings-in-table dom) - "\n")) - (shr-fill-lines (point-min) (point-max)))))) + (let ((strings (shr-collect-extra-strings-in-table dom))) + (when strings + (save-restriction + (narrow-to-region (point) (point)) + (insert (mapconcat #'identity strings "\n")) + (shr-fill-lines (point-min) (point-max)))))))) (defun shr-collect-extra-strings-in-table (dom &optional flags) "Return extra strings in DOM of which the root is a table clause. Render s and s, and strings and child s of which -the parent is not
or as well. FLAGS is a cons of two -boolean flags that control whether to collect or render objects." - ;; As for strings and child s, it runs recursively and - ;; collects or renders those objects if the cdr of FLAGS is nil. +the parent
or is lacking. FLAGS is a cons of two boolean +flags that control whether to collect or render objects." + ;; This function runs recursively and collects strings if the cdr of + ;; FLAGS is nil and the car is not nil, and it renders also child + ;; s if the cdr is nil. Note: FLAGS may be nil, not a cons. ;; FLAGS becomes (t . nil) if a clause is found in the children ;; of DOM, and becomes (t . t) if a
or a clause is found ;; and the car is t then. When a clause is found, FLAGS @@ -1921,7 +1922,7 @@ boolean flags that control whether to collect or render objects." (cl-loop for child in (dom-children dom) with recurse with tag do (setq recurse nil) if (stringp child) - unless (cdr flags) + unless (or (not (car flags)) (cdr flags)) when (string-match "\\(?:[^\t\n\r ]+[\t\n\r ]+\\)*[^\t\n\r ]+" child) collect (match-string 0 child) commit 5be4b9ff9edae9d36954ef004f2faa7630711179 Author: Katsumi Yamaoka Date: Mon Nov 21 06:40:01 2016 +0000 * lisp/gnus/gnus-mh.el (gnus-summary-save-in-folder): Slightly change the last commit. diff --git a/lisp/gnus/gnus-mh.el b/lisp/gnus/gnus-mh.el index 84c90be..b33402f 100644 --- a/lisp/gnus/gnus-mh.el +++ b/lisp/gnus/gnus-mh.el @@ -85,11 +85,9 @@ Optional argument FOLDER specifies folder name." (widen) (unwind-protect (apply - 'call-process-region - (append - (list (point-min) (point-max) "rcvstore" nil errbuf nil - folder) - gnus-rcvstore-options)) + #'call-process-region + (point-min) (point-max) "rcvstore" nil errbuf nil folder + gnus-rcvstore-options) (set-buffer errbuf) (if (zerop (buffer-size)) (message "Article saved in folder: %s" folder) commit f332833e21a32709c4c12f794384b5ef6a719735 Author: Mike Kupfer Date: Mon Nov 21 06:10:13 2016 +0000 Add a variable to pass additional options to rcvstore * lisp/gnus/gnus-mh.el (gnus-rcvstore-options): New variable. (gnus-summary-save-in-folder): Include gnus-rcvstore-options in the arguments that are passed to rcvstore. cf. and followups, i.e., ding mailing list. diff --git a/etc/GNUS-NEWS b/etc/GNUS-NEWS index 06badc1..c5fb0fe 100644 --- a/etc/GNUS-NEWS +++ b/etc/GNUS-NEWS @@ -266,6 +266,9 @@ on your Emacs version. * Miscellaneous changes +** New user option 'gnus-rcvstore-options' provides a way to +specify additional options when saving messages to an MH folder. + ** Having edited the select-method for the foreign server in the server buffer is immediately reflected to the subscription of the groups which use the server in question. For instance, if you change diff --git a/lisp/gnus/gnus-mh.el b/lisp/gnus/gnus-mh.el index f01811b..84c90be 100644 --- a/lisp/gnus/gnus-mh.el +++ b/lisp/gnus/gnus-mh.el @@ -40,6 +40,13 @@ (defvar mh-lib-progs) +(defcustom gnus-rcvstore-options nil + "Options that are passed to rcvstore, or nil. +These are used when saving articles to an MH folder." + :version "26.1" + :group 'gnus-article + :type '(repeat string)) + (defun gnus-summary-save-article-folder (&optional arg) "Append the current article to an mh folder. If N is a positive number, save the N next articles. @@ -77,8 +84,12 @@ Optional argument FOLDER specifies folder name." (save-restriction (widen) (unwind-protect - (call-process-region - (point-min) (point-max) "rcvstore" nil errbuf nil folder) + (apply + 'call-process-region + (append + (list (point-min) (point-max) "rcvstore" nil errbuf nil + folder) + gnus-rcvstore-options)) (set-buffer errbuf) (if (zerop (buffer-size)) (message "Article saved in folder: %s" folder) commit cdd056519da9ef058e28b5f198357af52228e9b6 Author: Paul Eggert Date: Sun Nov 20 20:55:35 2016 -0800 Fix undefined refs on some GNU/Linux hosts Problem reported by Ken Raeburn in: http://lists.gnu.org/archive/html/emacs-devel/2016-11/msg00463.html * src/emacs.c (heap_bss_diff) [CANNOT_DUMP]: Remove, as this is not needed in the CANNOT_UNDUMP case. All uses removed. This removes unwanted references to my_endbss and my_endbss_static, which are not optimized away on some platforms. diff --git a/src/emacs.c b/src/emacs.c index ac9b649..48df533 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -161,7 +161,7 @@ bool display_arg; Tells GC how to save a copy of the stack. */ char *stack_bottom; -#ifdef GNU_LINUX +#if defined GNU_LINUX && !defined CANNOT_DUMP /* The gap between BSS end and heap start as far as we can tell. */ static uprintmax_t heap_bss_diff; #endif @@ -716,14 +716,14 @@ main (int argc, char **argv) #ifndef CANNOT_DUMP might_dump = !initialized; -#endif -#ifdef GNU_LINUX +# ifdef GNU_LINUX if (!initialized) { char *heap_start = my_heap_start (); heap_bss_diff = heap_start - max (my_endbss, my_endbss_static); } +# endif #endif #if defined WINDOWSNT || defined HAVE_NTGUI @@ -2126,7 +2126,7 @@ You must run Emacs in batch mode in order to dump it. */) if (!might_dump) error ("Emacs can be dumped only once"); -#ifdef GNU_LINUX +#if defined GNU_LINUX && !defined CANNOT_DUMP /* Warn if the gap between BSS end and heap start is larger than this. */ # define MAX_HEAP_BSS_DIFF (1024*1024) commit 0b187fd2bfb797e113626df1b3740edbda8b698a Author: Paul Eggert Date: Sun Nov 20 16:57:17 2016 -0800 Make CANNOT_DUMP work better on GNU/Linux Clean up some of the bitrot affecting the CANNOT_DUMP code. This lets the build succeed again, and fixes the testing framework so that most test cases now pass. About twenty test cases still fail, though, and we still have Bug#24974. * configure.ac (CANNOT_DUMP): Now empty if CANNOT_DUMP. (SYSTEM_MALLOC): Now true if CANNOT_DUMP. There should no longer be any point to messing with a private memory allocator unless Emacs is dumping. * src/alloc.c (alloc_unexec_pre, alloc_unexec_post, check_pure_size): * src/image.c (reset_image_types): * src/lastfile.c (my_endbss, _my_endbss, my_endbss_static): Do not define if CANNOT_DUMP. * src/emacs.c (might_dump) [CANNOT_DUMP]: Now always false and local. (daemon_pipe) [!WINDOWSNT]: Now static. * test/Makefile.in (mostlyclean): Remove *.tmp files. (make-test-deps.mk): Elide CANNOT_DUMP chatter. diff --git a/configure.ac b/configure.ac index c9759e1..2d116de 100644 --- a/configure.ac +++ b/configure.ac @@ -1366,6 +1366,7 @@ case "$opsys" in UNEXEC_OBJ=unexsol.o ;; esac +test "$CANNOT_DUMP" = "yes" && UNEXEC_OBJ= LD_SWITCH_SYSTEM= case "$opsys" in @@ -2154,6 +2155,7 @@ doug_lea_malloc=$emacs_cv_var_doug_lea_malloc hybrid_malloc= system_malloc=yes +test "$CANNOT_DUMP" = yes || case "$opsys" in ## darwin ld insists on the use of malloc routines in the System framework. darwin | mingw32 | nacl | sol2-10) ;; diff --git a/src/alloc.c b/src/alloc.c index 90c6f94..175dcab 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -173,31 +173,34 @@ voidfuncptr __MALLOC_HOOK_VOLATILE __malloc_initialize_hook EXTERNALLY_VISIBLE #endif +#if defined DOUG_LEA_MALLOC || !defined CANNOT_DUMP + /* Allocator-related actions to do just before and after unexec. */ void alloc_unexec_pre (void) { -#ifdef DOUG_LEA_MALLOC +# ifdef DOUG_LEA_MALLOC malloc_state_ptr = malloc_get_state (); if (!malloc_state_ptr) fatal ("malloc_get_state: %s", strerror (errno)); -#endif -#ifdef HYBRID_MALLOC +# endif +# ifdef HYBRID_MALLOC bss_sbrk_did_unexec = true; -#endif +# endif } void alloc_unexec_post (void) { -#ifdef DOUG_LEA_MALLOC +# ifdef DOUG_LEA_MALLOC free (malloc_state_ptr); -#endif -#ifdef HYBRID_MALLOC +# endif +# ifdef HYBRID_MALLOC bss_sbrk_did_unexec = false; -#endif +# endif } +#endif /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer to a struct Lisp_String. */ @@ -5216,6 +5219,8 @@ pure_alloc (size_t size, int type) } +#ifndef CANNOT_DUMP + /* Print a warning if PURESIZE is too small. */ void @@ -5226,6 +5231,7 @@ check_pure_size (void) " bytes needed)"), pure_bytes_used + pure_bytes_used_before_overflow); } +#endif /* Find the byte sequence {DATA[0], ..., DATA[NBYTES-1], '\0'} from diff --git a/src/emacs.c b/src/emacs.c index efd4fa3..ac9b649 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -130,11 +130,15 @@ Lisp_Object Vlibrary_cache; on subsequent starts. */ bool initialized; +#ifdef CANNOT_DUMP +enum { might_dump = false }; +#else /* Set to true if this instance of Emacs might dump. */ -#ifndef DOUG_LEA_MALLOC +# ifndef DOUG_LEA_MALLOC static -#endif +# endif bool might_dump; +#endif #ifdef DARWIN_OS extern void unexec_init_emacs_zone (void); @@ -196,7 +200,7 @@ int daemon_type; #ifndef WINDOWSNT /* Pipe used to send exit notification to the background daemon parent at startup. On Windows, we use a kernel event instead. */ -int daemon_pipe[2]; +static int daemon_pipe[2]; #else HANDLE w32_daemon_event; #endif diff --git a/src/image.c b/src/image.c index d82fedb..5614f39 100644 --- a/src/image.c +++ b/src/image.c @@ -9776,6 +9776,8 @@ lookup_image_type (Lisp_Object type) return NULL; } +#if !defined CANNOT_DUMP && defined HAVE_WINDOW_SYSTEM + /* Reset image_types before dumping. Called from Fdump_emacs. */ @@ -9789,6 +9791,7 @@ reset_image_types (void) image_types = next; } } +#endif void syms_of_image (void) diff --git a/src/lastfile.c b/src/lastfile.c index 9d70b00..27602bd 100644 --- a/src/lastfile.c +++ b/src/lastfile.c @@ -43,6 +43,8 @@ along with GNU Emacs. If not, see . */ char my_edata[] = "End of Emacs initialized data"; #endif +#ifndef CANNOT_DUMP + /* Help unexec locate the end of the .bss area used by Emacs (which isn't always a separate section in NT executables). */ char my_endbss[1]; @@ -52,3 +54,5 @@ char my_endbss[1]; of the bss area used by Emacs. */ static char _my_endbss[1]; char * my_endbss_static = _my_endbss; + +#endif diff --git a/test/Makefile.in b/test/Makefile.in index 33e625f..f2f2763 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -190,6 +190,7 @@ check-doit: ${LOGFILES} mostlyclean: -@for f in ${LOGFILES}; do test ! -f $$f || mv $$f $$f~; done + rm -f *.tmp clean: -rm -f ${LOGFILES} ${LOGSAVEFILES} @@ -206,5 +207,7 @@ maintainer-clean: distclean bootstrap-clean make-test-deps.mk: $(ELFILES) make-test-deps.emacs-lisp $(EMACS) --batch -l $(srcdir)/make-test-deps.emacs-lisp \ --eval "(make-test-deps \"$(srcdir)\")" \ - 2> $@ -# Makefile ends here. + 2> $@.tmp + # Hack to elide any CANNOT_DUMP=yes chatter. + sed '/\.log: /!d' $@.tmp >$@ + rm -f $@.tmp commit ebe2e69c8fb14dfa169e0497cd868ade79d4c9d8 Author: Paul Eggert Date: Sun Nov 20 16:33:40 2016 -0800 * src/xdisp.c (block_buffer_flips, unblock_buffer_flips): Now static. diff --git a/src/dispextern.h b/src/dispextern.h index f272799..4acf336 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3356,9 +3356,7 @@ void x_cr_init_fringe (struct redisplay_interface *); extern unsigned row_hash (struct glyph_row *); -extern void block_buffer_flips(void); -extern void unblock_buffer_flips(void); -extern bool buffer_flipping_blocked_p(void); +extern bool buffer_flipping_blocked_p (void); /* Defined in image.c */ diff --git a/src/xdisp.c b/src/xdisp.c index 1420a4a..2acdfa9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -818,6 +818,8 @@ static void iterate_out_of_display_property (struct it *); static void pop_it (struct it *); static void redisplay_internal (void); static void echo_area_display (bool); +static void block_buffer_flips (void); +static void unblock_buffer_flips (void); static void redisplay_windows (Lisp_Object); static void redisplay_window (Lisp_Object, bool); static Lisp_Object redisplay_window_error (Lisp_Object); @@ -14477,15 +14479,15 @@ disp_char_vector (struct Lisp_Char_Table *dp, int c) static int buffer_flip_blocked_depth; -void -block_buffer_flips(void) +static void +block_buffer_flips (void) { eassert (buffer_flip_blocked_depth >= 0); buffer_flip_blocked_depth++; } -void -unblock_buffer_flips(void) +static void +unblock_buffer_flips (void) { eassert (buffer_flip_blocked_depth > 0); if (--buffer_flip_blocked_depth == 0) commit 8a147fb24681cd5b89b99376c95baf785dd5126f Author: Paul Eggert Date: Sun Nov 20 13:24:53 2016 -0800 Pacify --enable-gcc-warnings CANNOT_DUMP=yes * src/editfns.c (dump_tz_string) [CANNOT_DUMP || !HAVE_TZSET]: Do not define. If defining, do it in a smaller scope. diff --git a/src/editfns.c b/src/editfns.c index 72c7a9c..6ea8cba 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -87,10 +87,6 @@ static timezone_t local_tz; static timezone_t wall_clock_tz; static timezone_t const utc_tz = 0; -/* A valid but unlikely setting for the TZ environment variable. - It is OK (though a bit slower) if the user chooses this value. */ -static char dump_tz_string[] = "TZ=UtC0"; - /* The cached value of Vsystem_name. This is used only to compare it to Vsystem_name, so it need not be visible to the GC. */ static Lisp_Object cached_system_name; @@ -230,6 +226,12 @@ tzlookup (Lisp_Object zone, bool settz) void init_editfns (bool dumping) { +#if !defined CANNOT_DUMP && defined HAVE_TZSET + /* A valid but unlikely setting for the TZ environment variable. + It is OK (though a bit slower) if the user chooses this value. */ + static char dump_tz_string[] = "TZ=UtC0"; +#endif + const char *user_name; register char *p; struct passwd *pw; /* password entry for the current user */ commit 7e2a8b17aea197f2b2609878180d281ac2dfe0d4 Author: Mark Oteiza Date: Sun Nov 20 13:55:28 2016 -0500 * lisp/ibuffer.el (ibuffer-compile-format): Use string-width instead of length diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 8d7ec59..8c64179 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1638,7 +1638,7 @@ If point is on a group name, this function operates on that group." max 'max) from-end-p)) - (setq strlen (length str)) + (setq strlen (string-width str)) (setq str ,(ibuffer-compile-make-eliding-form 'str elide from-end-p))))) @@ -1696,7 +1696,7 @@ If point is on a group name, this function operates on that group." outforms) (push `(setq str ,callform ,@(when strlen-used - `(strlen (length str)))) + `(strlen (string-width str)))) outforms) (setq outforms (append outforms commit 56a47981cc921369dd124cc023ca1469225b1fa7 Author: Eli Zaretskii Date: Sun Nov 20 19:28:37 2016 +0200 Fix redrawing non-selected frame after resize on MS-Windows * src/xdisp.c (redisplay_internal): If all the frames were successfully updated, reset the "garbaged" flag of each frame, to make sure it doesn't stay set. * src/w32term.c (w32_read_socket): Don't clear the frame if it's "garbaged", since expose_frame won't redraw the foreground then. (Bug#24642) diff --git a/src/w32term.c b/src/w32term.c index e8d66c9..ae0f741 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -4628,11 +4628,18 @@ w32_read_socket (struct terminal *terminal, } else { - HDC hdc = get_frame_dc (f); + /* Erase background again for safety. But don't do + that if the frame's 'garbaged' flag is set, since + in that case expose_frame will do nothing, and if + the various redisplay flags happen to be unset, + we are left with a blank frame. */ + if (!FRAME_GARBAGED_P (f)) + { + HDC hdc = get_frame_dc (f); - /* Erase background again for safety. */ - w32_clear_rect (f, hdc, &msg.rect); - release_frame_dc (f, hdc); + w32_clear_rect (f, hdc, &msg.rect); + release_frame_dc (f, hdc); + } expose_frame (f, msg.rect.left, msg.rect.top, diff --git a/src/xdisp.c b/src/xdisp.c index c045ced..1420a4a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -14116,6 +14116,7 @@ redisplay_internal (void) if (f->updated_p) { f->redisplay = false; + f->garbaged = false; mark_window_display_accurate (f->root_window, true); if (FRAME_TERMINAL (f)->frame_up_to_date_hook) FRAME_TERMINAL (f)->frame_up_to_date_hook (f); commit 22946702b4296c0e42e4baf6221e205b52d05cbf Author: Michael Albinus Date: Sun Nov 20 16:29:47 2016 +0100 Add file-local-name * doc/lispref/files.texi (Magic File Names): Add `file-local-name'. (Unique File Names): Use it. * etc/NEWS: Mention `file-local-name'. * lisp/files.el (file-local-name): New defun. (file-expand-wildcards): * lisp/eshell/em-tramp.el (eshell/su, eshell/sudo): * lisp/eshell/esh-ext.el (eshell-remote-command): * lisp/eshell/esh-proc.el (eshell-gather-process-output): * lisp/org/ob-core.el (org-babel-local-file-name): * lisp/progmodes/gud.el (gud-common-init, gud-format-command): * lisp/progmodes/python.el (python-shell-send-file): * lisp/shell.el (shell): * lisp/vc/ediff-diff.el (ediff-same-file-contents): * lisp/vc/vc-git.el (vc-git-checkin): Use it. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index e189da9..d9e366b 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -2546,14 +2546,7 @@ that remote host. If such a directory does not exist, or @end defun In order to extract the local part of the path name from a temporary -file, the following code could be used: - -@example -@group -(let ((tmpfile (make-nearby-temp-file "foo"))) - (or (file-remote-p tmpfile 'localname) tmpfile)) -@end group -@end example +file, @code{file-local-name} could be used. @node File Name Completion @subsection File Name Completion @@ -3233,6 +3226,13 @@ non-magic directory to serve as its current directory, and this function is a good way to come up with one. @end defun +@defun file-local-name filename +This function returns the local part of file @var{filename}. For a +remote @var{filename}, it returns a file name which could be used +directly as argument of a remote process. If @var{filename} is local, +this function returns the file name. +@end defun + @defopt remote-file-name-inhibit-cache The attributes of remote files can be cached for better performance. If they are changed outside of Emacs's control, the cached values become diff --git a/etc/NEWS b/etc/NEWS index 21cda7c..619d56b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -700,6 +700,10 @@ collection). can be used for creation of temporary files of remote or mounted directories. +++ +** The new function 'file-local-name' can be used to specify arguments +of remote processes. + ++++ ** The new error 'file-missing', a subcategory of 'file-error', is now signaled instead of 'file-error' if a file operation acts on a file that does not exist. diff --git a/lisp/eshell/em-tramp.el b/lisp/eshell/em-tramp.el index 9105c48..3eff20d 100644 --- a/lisp/eshell/em-tramp.el +++ b/lisp/eshell/em-tramp.el @@ -72,8 +72,7 @@ Become another USER during a login session.") (let ((user "root") (host (or (file-remote-p default-directory 'host) "localhost")) - (dir (or (file-remote-p default-directory 'localname) - (expand-file-name default-directory))) + (dir (file-local-name (expand-file-name default-directory))) (prefix (file-remote-p default-directory))) (dolist (arg args) (if (string-equal arg "-") (setq login t) (setq user arg))) @@ -111,8 +110,7 @@ Execute a COMMAND as the superuser or another USER.") (let ((user (or user "root")) (host (or (file-remote-p default-directory 'host) "localhost")) - (dir (or (file-remote-p default-directory 'localname) - (expand-file-name default-directory))) + (dir (file-local-name (expand-file-name default-directory))) (prefix (file-remote-p default-directory))) ;; `eshell-eval-using-options' reads options of COMMAND. (while (and (stringp (car orig-args)) diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index ca62d0c..4d658cd 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -203,7 +203,7 @@ all the output from the remote command, and sends it all at once, causing the user to wonder if anything's really going on..." (let ((outbuf (generate-new-buffer " *eshell remote output*")) (errbuf (generate-new-buffer " *eshell remote error*")) - (command (or (file-remote-p command 'localname) command)) + (command (file-local-name command)) (exitcode 1)) (unwind-protect (progn diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index 8c6bad0..21680df 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -279,7 +279,7 @@ See `eshell-needs-pipe'." (let ((process-connection-type (unless (eshell-needs-pipe-p command) process-connection-type)) - (command (or (file-remote-p command 'localname) command))) + (command (file-local-name command))) (apply 'start-file-process (file-name-nondirectory command) nil ;; `start-process' can't deal with relative filenames. diff --git a/lisp/files.el b/lisp/files.el index c50e6aa..7c56f54 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1128,6 +1128,12 @@ consecutive checks. For example: :format "Do not use file name cache older then %v seconds" :value 10))) +(defun file-local-name (file) + "Return the local name component of FILE. +It returns a file name which can be used directly as argument of +`process-file', `start-file-process', or `shell-command'." + (or (file-remote-p file 'localname) file)) + (defun file-local-copy (file) "Copy the file FILE into a temporary file on this machine. Returns the name of the local copy, or nil, if FILE is directly @@ -6212,9 +6218,7 @@ default directory. However, if FULL is non-nil, they are absolute." ;; This can be more than one dir ;; if DIRPART contains wildcards. (dirs (if (and dirpart - (string-match "[[*?]" - (or (file-remote-p dirpart 'localname) - dirpart))) + (string-match "[[*?]" (file-local-name dirpart))) (mapcar 'file-name-as-directory (file-expand-wildcards (directory-file-name dirpart))) (list dirpart))) diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index e3d778f..c76d276 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -2680,9 +2680,12 @@ Fixes a bug in `tramp-handle-call-process-region'." (apply org-babel-call-process-region-original start end program delete buffer display args))) -(defun org-babel-local-file-name (file) - "Return the local name component of FILE." - (or (file-remote-p file 'localname) file)) +(defalias 'org-babel-local-file-name + (if (fboundp 'file-local-name) + 'file-local-name + (lambda (file) + "Return the local name component of FILE." + (or (file-remote-p file 'localname) file)))) (defun org-babel-process-file-name (name &optional no-quote-p) "Prepare NAME to be used in an external process. diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 9052aa4..0bdafdb 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2621,12 +2621,8 @@ comint mode, which see." (let ((w args)) (while (and w (not (eq (car w) t))) (setq w (cdr w))) - (if w - (setcar w - (if (file-remote-p file) - ;; Tramp has already been loaded if we are here. - (setq file (file-remote-p file 'localname)) - file)))) + ;; Tramp has already been loaded if we are here. + (if w (setcar w (setq file (file-local-name file))))) (apply 'make-comint (concat "gud" filepart) program nil (if massage-args (funcall massage-args file args) args)) ;; Since comint clobbered the mode, we don't set it until now. @@ -2854,8 +2850,7 @@ Obeying it means displaying in another window the specified file and line." (frame (or gud-last-frame gud-last-last-frame)) (buffer-file-name-localized (and (buffer-file-name) - (or (file-remote-p (buffer-file-name) 'localname) - (buffer-file-name)))) + (file-local-name (buffer-file-name)))) result) (while (and str (let ((case-fold-search nil)) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index be96ac3..af8b791 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3150,13 +3150,10 @@ t when called interactively." (insert-file-contents (or temp-file-name file-name)) (python-info-encoding))) - (file-name (expand-file-name - (or (file-remote-p file-name 'localname) - file-name))) + (file-name (expand-file-name (file-local-name file-name))) (temp-file-name (when temp-file-name (expand-file-name - (or (file-remote-p temp-file-name 'localname) - temp-file-name))))) + (file-local-name temp-file-name))))) (python-shell-send-string (format (concat diff --git a/lisp/shell.el b/lisp/shell.el index 34bd772..d1b2e87 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -714,12 +714,11 @@ Otherwise, one argument `-i' is passed to the shell. (null (getenv "ESHELL"))) (with-current-buffer buffer (set (make-local-variable 'explicit-shell-file-name) - (file-remote-p - (expand-file-name + (expand-file-name + (file-local-name (read-file-name "Remote shell path: " default-directory shell-file-name - t shell-file-name)) - 'localname)))) + t shell-file-name)))))) ;; The buffer's window must be correctly set when we call comint (so ;; that comint sets the COLUMNS env var properly). diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el index b1ac32d..56bfebb 100644 --- a/lisp/vc/ediff-diff.el +++ b/lisp/vc/ediff-diff.el @@ -1347,10 +1347,8 @@ arguments to `skip-chars-forward'." ;; located on the same remote host. (apply 'process-file ediff-cmp-program nil nil nil (append ediff-cmp-options - (list (or (file-remote-p f1 'localname) - (expand-file-name f1)) - (or (file-remote-p f2 'localname) - (expand-file-name f2))))) + (list (expand-file-name (file-local-name f1)) + (expand-file-name (file-local-name f2))))) )) (and (numberp res) (eq res 0))) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 9df581d..ec0e081 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -704,13 +704,10 @@ It is based on `log-edit-mode', and has Git-specific extensions.") ;; file, to work around the limitation that command-line ;; arguments must be in the system codepage, and therefore ;; might not support the non-ASCII characters in the log - ;; message. + ;; message. Handle also remote files. (if (eq system-type 'windows-nt) - (if (file-remote-p file1) - (let ((default-directory (file-name-directory file1))) - (file-remote-p - (make-nearby-temp-file "git-msg") 'localname)) - (make-temp-file "git-msg"))))) + (let ((default-directory (file-name-directory file1))) + (file-local-name (make-nearby-temp-file "git-msg")))))) (cl-flet ((boolean-arg-fn (argument) (lambda (value) (when (equal value "yes") (list argument))))) commit 26c45889259682af0fbf05bccf7f084408860125 Author: Tino Calancha Date: Sun Nov 20 23:03:36 2016 +0900 * lisp/ibuffer.el (ibuffer-formats): Mention locked column in doc string. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index b33c2e3..8d7ec59 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -91,7 +91,7 @@ Each element in `ibuffer-formats' should be a list containing COLUMN specifiers. A COLUMN can be any of the following: SYMBOL - A symbol naming the column. Predefined columns are: - mark modified read-only name size mode process filename + mark modified read-only locked name size mode process filename When you define your own columns using `define-ibuffer-column', just use their name like the predefined columns here. This entry can also be a function of two arguments, which should return a string.