commit 3c586e182c0694896dda670f5fc663b46c9bac63 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Thu Sep 15 09:24:07 2016 +0200 Rework fixing Bug#24432 * lisp/net/tramp.el (tramp-get-buffer): Set connection property "process-buffer" in order to mark connection as active. * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-set-connection-property) (tramp-dump-connection-properties): Do not use "active" property. (tramp-list-connections): Use "process-buffer" property. * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Flush process properties prior deletion of process. diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 43b3ba0..531044f 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -99,8 +99,7 @@ matching entries of `tramp-connection-properties'." (or (nth 0 elt) "") (tramp-make-tramp-file-name (aref key 0) (aref key 1) (aref key 2) nil)) - (tramp-set-connection-property key (nth 1 elt) (nth 2 elt)))) - (tramp-set-connection-property key "active" 'undef)) + (tramp-set-connection-property key (nth 1 elt) (nth 2 elt))))) hash))) ;;;###tramp-autoload @@ -263,7 +262,6 @@ KEY is a vector." (aset key 3 nil) (aset key 4 nil)) (let ((hash (tramp-get-hash-table key))) - (puthash "active" t hash) (puthash property value hash) (setq tramp-cache-data-changed t) (tramp-message key 7 "%s %s" property value) @@ -333,11 +331,11 @@ properties of the local machine." ;;;###tramp-autoload (defun tramp-list-connections () "Return a list of all known connection vectors according to `tramp-cache'." - (let (result) + (let (result tramp-verbose) (maphash (lambda (key _value) (when (and (vectorp key) (null (aref key 3)) - (tramp-connection-property-p key "active")) + (tramp-connection-property-p key "process-buffer")) (add-to-list 'result key))) tramp-cache-data) result)) @@ -362,7 +360,6 @@ properties of the local machine." (not (tramp-file-name-localname key)) (not (gethash "login-as" value))) (progn - (remhash "active" value) (remhash "process-name" value) (remhash "process-buffer" value) (remhash "first-password-request" value)) @@ -430,8 +427,7 @@ for all methods. Resulting data are derived from connection history." ;; `tramp-connection-properties'. The cache is ;; initialized properly by side effect. (unless (tramp-connection-property-p key (car item)) - (tramp-set-connection-property key (pop item) (car item)))) - (tramp-set-connection-property key "active" 'undef))) + (tramp-set-connection-property key (pop item) (car item)))))) (setq tramp-cache-data-changed nil)) (file-error ;; Most likely because the file doesn't exist yet. No message. diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 45f3004..d0c4915 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -101,8 +101,8 @@ When called interactively, a Tramp connection has to be selected." ;; Flush connection cache. (when (processp (tramp-get-connection-process vec)) - (delete-process (tramp-get-connection-process vec)) - (tramp-flush-connection-property (tramp-get-connection-process vec))) + (tramp-flush-connection-property (tramp-get-connection-process vec)) + (delete-process (tramp-get-connection-process vec))) (tramp-flush-connection-property vec) ;; Remove buffers. @@ -384,10 +384,12 @@ please ensure that the buffers are attached to your email.\n\n")) ;;; TODO: ;; * Clean up unused *tramp/foo* buffers after a while. (Pete Forman) +;; ;; * WIBNI there was an interactive command prompting for Tramp ;; method, hostname, username and filename and translates the user ;; input into the correct filename syntax (depending on the Emacs ;; flavor) (Reiner Steib) +;; ;; * Let the user edit the connection properties interactively. ;; Something like `gnus-server-edit-server' in Gnus' *Server* buffer. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ad00f31..0dade73 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1314,6 +1314,7 @@ necessary only. This function will be used in file name completion." "Get the connection buffer to be used for VEC." (or (get-buffer (tramp-buffer-name vec)) (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) + (tramp-set-connection-property vec "process-buffer" nil) (setq buffer-undo-list t) (setq default-directory (tramp-make-tramp-file-name @@ -4306,30 +4307,40 @@ Only works for Bourne-like shells." ;; * In Emacs 21, `insert-directory' shows total number of bytes used ;; by the files in that directory. Add this here. +;; ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) +;; ;; * Better error checking. At least whenever we see something ;; strange when doing zerop, we should kill the process and start ;; again. (Greg Stark) -;; * Username and hostname completion. -;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode-p'. -;; * Make `tramp-default-user' obsolete. +;; ;; * Implement a general server-local-variable mechanism, as there are ;; probably other variables that need different values for different ;; servers too. The user could then configure a variable (such as ;; tramp-server-local-variable-alist) to define any such variables ;; that they need to, which would then be let bound as appropriate ;; in tramp functions. (Jason Rumney) +;; ;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846) +;; ;; * I was wondering if it would be possible to use tramp even if I'm ;; actually using sshfs. But when I launch a command I would like ;; to get it executed on the remote machine where the files really ;; are. (Andrea Crotti) +;; ;; * Run emerge on two remote files. Bug is described here: ;; . ;; (Bug#6850) +;; ;; * Use also port to distinguish connections. This is needed for ;; different hosts sitting behind a single router (distinguished by ;; different port numbers). (Tzvi Edelman) +;; +;; * Refactor code from different handlers. Start with +;; *-process-file. One idea is to generalize `tramp-send-command' +;; and friends, for most of the handlers this is the major +;; difference between the different backends. Other handlers but +;; *-process-file would profit from this as well. ;;; tramp.el ends here commit 5b6066d942d8463f8944f687a9dca1f61061ef3a Author: Johan Bockgård Date: Wed Sep 14 21:50:31 2016 +0200 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix debug spec (Bug#24430). diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 9a59939..f5b7b82 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2578,16 +2578,16 @@ non-nil value, that slot cannot be set via `setf'. [&or symbolp (gate symbolp &rest - (&or [":conc-name" symbolp] - [":constructor" symbolp &optional cl-lambda-list] - [":copier" symbolp] - [":predicate" symbolp] - [":include" symbolp &rest sexp] ;; Not finished. - ;; The following are not supported. - ;; [":print-function" ...] - ;; [":type" ...] - ;; [":initial-offset" ...] - ))] + [&or symbolp + (&or [":conc-name" symbolp] + [":constructor" symbolp &optional cl-lambda-list] + [":copier" symbolp] + [":predicate" symbolp] + [":include" symbolp &rest sexp] ;; Not finished. + [":print-function" sexp] + [":type" symbolp] + [":named"] + [":initial-offset" natnump])])] [&optional stringp] ;; All the above is for the following def-form. &rest &or symbolp (symbolp def-form commit 0eb85a50918c0586e102357643c04ef8e657a617 Author: Johan Bockgård Date: Wed Sep 14 21:01:08 2016 +0200 * lisp/emacs-lisp/edebug.el (defun): Fix debug spec. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index c283c16..1a00c45 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1933,6 +1933,7 @@ expressions; a `progn' form will be returned enclosing these forms." (def-edebug-spec defun (&define name lambda-list [&optional stringp] + [&optional ("declare" &rest sexp)] [&optional ("interactive" interactive)] def-body)) (def-edebug-spec defmacro commit fc77d04659f0be28041da9f924ec3525f1c3cdeb Author: Eli Zaretskii Date: Wed Sep 14 20:46:59 2016 +0300 Avoid compiler warning on MS-Windows due to clone_file * src/fileio.c (clone_file): Condition on !WINDOWSNT, since the call to it is not compiled in that build, and having it defined causes compiler warnings. diff --git a/src/fileio.c b/src/fileio.c index b4316b3..5fe0411 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1834,6 +1834,7 @@ barf_or_query_if_file_exists (Lisp_Object absname, bool known_to_exist, } } +#ifndef WINDOWSNT /* Copy data to DEST from SOURCE if possible. Return true if OK. */ static bool clone_file (int dest, int source) @@ -1843,6 +1844,7 @@ clone_file (int dest, int source) #endif return false; } +#endif DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6, "fCopy file: \nGCopy %s to file: \np\nP", commit 5ad238bf28f67304b942f03d3d5fc8d14d1268a8 Author: Eli Zaretskii Date: Wed Sep 14 20:41:04 2016 +0300 Avoid aborts in GC due to abort_on_gc * src/lisp.h: * src/print.c (Fprin1_to_string): * src/eval.c (signal_or_quit): * src/alloc.c (garbage_collect_1): Remove declarations, setting, and testing the value of abort_on_gc. It is no longer needed, and using it causes rare aborts in GC for no good reason. (Bug#23912) diff --git a/src/alloc.c b/src/alloc.c index 5bbd5e5..1092a34 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -231,12 +231,6 @@ EMACS_INT memory_full_cons_threshold; bool gc_in_progress; -/* True means abort if try to GC. - This is for code which is written on the assumption that - no GC will happen, so as to verify that assumption. */ - -bool abort_on_gc; - /* Number of live and free conses etc. */ static EMACS_INT total_conses, total_markers, total_symbols, total_buffers; @@ -5675,9 +5669,6 @@ garbage_collect_1 (void *end) Lisp_Object retval = Qnil; size_t tot_before = 0; - if (abort_on_gc) - emacs_abort (); - /* Can't GC if pure storage overflowed because we can't determine if something is a pure object or not. */ if (pure_bytes_used_before_overflow) diff --git a/src/eval.c b/src/eval.c index f681ef7..e08a25a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1497,7 +1497,6 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit) struct handler *h; immediate_quit = 0; - abort_on_gc = 0; if (gc_in_progress || waiting_for_input) emacs_abort (); diff --git a/src/lisp.h b/src/lisp.h index 29ed9fe..d333186 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3729,7 +3729,6 @@ extern struct Lisp_Vector *allocate_pseudovector (int, int, int, VECSIZE (type), tag)) extern bool gc_in_progress; -extern bool abort_on_gc; extern Lisp_Object make_float (double); extern void display_malloc_warning (void); extern ptrdiff_t inhibit_garbage_collection (void); diff --git a/src/print.c b/src/print.c index d54a7c9..f3db674 100644 --- a/src/print.c +++ b/src/print.c @@ -664,8 +664,6 @@ A printed representation of an object is text which describes that object. */) but we don't want to deactivate the mark just for that. No need for specbind, since errors deactivate the mark. */ Lisp_Object save_deactivate_mark = Vdeactivate_mark; - bool prev_abort_on_gc = abort_on_gc; - abort_on_gc = true; Lisp_Object printcharfun = Vprin1_to_string_buffer; PRINTPREPARE; @@ -687,7 +685,6 @@ A printed representation of an object is text which describes that object. */) Vdeactivate_mark = save_deactivate_mark; - abort_on_gc = prev_abort_on_gc; return unbind_to (count, object); } commit def4f1ec992880de599d36a0f94536249d95d7c4 Author: Michael Albinus Date: Wed Sep 14 14:52:54 2016 +0200 ; Complete fixing Bug#24432 diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 2578815..43b3ba0 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -430,7 +430,8 @@ for all methods. Resulting data are derived from connection history." ;; `tramp-connection-properties'. The cache is ;; initialized properly by side effect. (unless (tramp-connection-property-p key (car item)) - (tramp-set-connection-property key (pop item) (car item)))))) + (tramp-set-connection-property key (pop item) (car item)))) + (tramp-set-connection-property key "active" 'undef))) (setq tramp-cache-data-changed nil)) (file-error ;; Most likely because the file doesn't exist yet. No message. commit 8af1763d1f88ad7017eb0deee5e87d2f9fb43fbb Author: Michael Albinus Date: Wed Sep 14 11:49:56 2016 +0200 Fix Bug#24432 * lisp/net/tramp-cache.el (tramp-get-hash-table): Initialize a connection as inactive. (tramp-set-connection-property): Make the connection active. (tramp-dump-connection-properties): Don't save "active" property. (tramp-list-connections): List only active connections. (Bug#24432) diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 9a2ff0b..2578815 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -99,7 +99,8 @@ matching entries of `tramp-connection-properties'." (or (nth 0 elt) "") (tramp-make-tramp-file-name (aref key 0) (aref key 1) (aref key 2) nil)) - (tramp-set-connection-property key (nth 1 elt) (nth 2 elt))))) + (tramp-set-connection-property key (nth 1 elt) (nth 2 elt)))) + (tramp-set-connection-property key "active" 'undef)) hash))) ;;;###tramp-autoload @@ -262,6 +263,7 @@ KEY is a vector." (aset key 3 nil) (aset key 4 nil)) (let ((hash (tramp-get-hash-table key))) + (puthash "active" t hash) (puthash property value hash) (setq tramp-cache-data-changed t) (tramp-message key 7 "%s %s" property value) @@ -334,14 +336,15 @@ properties of the local machine." (let (result) (maphash (lambda (key _value) - (when (and (vectorp key) (null (aref key 3))) + (when (and (vectorp key) (null (aref key 3)) + (tramp-connection-property-p key "active")) (add-to-list 'result key))) tramp-cache-data) result)) (defun tramp-dump-connection-properties () "Write persistent connection properties into file `tramp-persistency-file-name'." - ;; We shouldn't fail, otherwise (X)Emacs might not be able to be closed. + ;; We shouldn't fail, otherwise Emacs might not be able to be closed. (ignore-errors (when (and (hash-table-p tramp-cache-data) (not (zerop (hash-table-count tramp-cache-data))) @@ -359,6 +362,7 @@ properties of the local machine." (not (tramp-file-name-localname key)) (not (gethash "login-as" value))) (progn + (remhash "active" value) (remhash "process-name" value) (remhash "process-buffer" value) (remhash "first-password-request" value)) @@ -368,7 +372,7 @@ properties of the local machine." (with-temp-file tramp-persistency-file-name (insert ";; -*- emacs-lisp -*-" - ;; `time-stamp-string' might not exist in all (X)Emacs flavors. + ;; `time-stamp-string' might not exist in all Emacs flavors. (condition-case nil (progn (format commit 9345e638f1f1b520aef234f88b2bb16f2323ed88 Author: Lars Ingebrigtsen Date: Wed Sep 14 11:11:17 2016 +0200 Don't bug out on all-whitespace URLs * lisp/net/shr.el (shr-expand-url): Don't bug out on degenerate all-whitespace URLs. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 07009d0..a3cc807 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -788,11 +788,12 @@ size, and full-buffer size." ;; Strip leading whitespace (and url (string-match "\\`\\s-+" url) (setq url (substring url (match-end 0)))) - (cond ((or (not url) - (not base) + (cond ((zerop (length url)) + (nth 3 base)) + ((or (not base) (string-match "\\`[a-z]*:" url)) ;; Absolute or empty URI - (or url (nth 3 base))) + url) ((eq (aref url 0) ?/) (if (and (> (length url) 1) (eq (aref url 1) ?/))