Now on revision 111988. ------------------------------------------------------------ revno: 111988 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-03-09 18:18:49 -0800 message: * admin/admin.el (add-release-logs): Use UTC for release date. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-03-09 20:22:27 +0000 +++ admin/ChangeLog 2013-03-10 02:18:49 +0000 @@ -1,3 +1,7 @@ +2013-03-10 Glenn Morris + + * admin.el (add-release-logs): Use UTC for release date. + 2013-03-09 Glenn Morris * admin.el (add-release-logs): Provide interactive defaults. === modified file 'admin/admin.el' --- admin/admin.el 2013-03-09 20:22:27 +0000 +++ admin/admin.el 2013-03-10 02:18:49 +0000 @@ -42,12 +42,14 @@ emacs-minor-version)) (read-string "Release date: " (progn (require 'add-log) - (funcall add-log-time-format))))) + (let ((add-log-time-zone-rule t)) + (funcall add-log-time-format)))))) (setq root (expand-file-name root)) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) (error "%s doesn't seem to be the root of an Emacs source tree" root)) (require 'add-log) - (or date (setq date (funcall add-log-time-format))) + (or date (setq date (let ((add-log-time-zone-rule t)) + (funcall add-log-time-format)))) (let* ((logs (process-lines "find" root "-name" "ChangeLog")) (entry (format "%s %s <%s>\n\n\t* Version %s released.\n\n" date ------------------------------------------------------------ revno: 111987 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-03-09 18:15:08 -0800 message: Fix typo in previous diff: === modified file 'admin/make-tarball.txt' --- admin/make-tarball.txt 2013-03-10 02:14:29 +0000 +++ admin/make-tarball.txt 2013-03-10 02:15:08 +0000 @@ -55,7 +55,7 @@ from now when you intend to make the release. Use M-x add-release-logs to add the ChangeLog entries for that date to the tar file (but not yet to the repository). Name the tar file as - emacs-XX-Y-rc1.tar. If all goes well in the following week, you + emacs-XX.Y-rc1.tar. If all goes well in the following week, you can simply rename the file and use it for the actual release. 5. autoreconf -i -I m4 --force ------------------------------------------------------------ revno: 111986 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-03-09 18:14:29 -0800 message: Add note about release candidate diff: === modified file 'admin/make-tarball.txt' --- admin/make-tarball.txt 2013-03-07 07:03:18 +0000 +++ admin/make-tarball.txt 2013-03-10 02:14:29 +0000 @@ -50,6 +50,14 @@ For a pretest, start at version .90. After .99, use .990 (so that it sorts). + The final pretest should be a release candidate. Set the version + number to that of the actual release. Pick a date about a week + from now when you intend to make the release. Use M-x add-release-logs + to add the ChangeLog entries for that date to the tar file (but + not yet to the repository). Name the tar file as + emacs-XX-Y-rc1.tar. If all goes well in the following week, you + can simply rename the file and use it for the actual release. + 5. autoreconf -i -I m4 --force make bootstrap ------------------------------------------------------------ revno: 111985 committer: Jay Belanger branch nick: trunk timestamp: Sat 2013-03-09 17:36:02 -0600 message: * doc/misc/calc.texi (Basic Operations on Units): Streamline some descriptions. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-03-08 08:37:59 +0000 +++ doc/misc/ChangeLog 2013-03-09 23:36:02 +0000 @@ -1,3 +1,8 @@ +2013-03-09 Jay Belanger + + * calc.texi (Basic Operations on Units): Streamline some + descriptions. + 2013-03-08 Glenn Morris * faq.texi (Top): Don't say this was updated @today. === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2013-03-08 02:11:25 +0000 +++ doc/misc/calc.texi 2013-03-09 23:36:02 +0000 @@ -27859,7 +27859,8 @@ If the units you request are inconsistent with the original units, the number will be converted into your units times whatever ``remainder'' -units are left over. For example, converting @samp{55 mph} into acres +units are left over. (This can be disabled; @pxref{Customizing Calc}.) +For example, converting @samp{55 mph} into acres produces @samp{6.08e-3 acre / m s}. (Recall that multiplication binds more strongly than division in Calc formulas, so the units here are acres per meter-second.) Remainder units are expressed in terms of @@ -27875,12 +27876,6 @@ The ``remainder unit'' @samp{cm} is left alone rather than being changed to the base unit @samp{m}. -If you want to disallow using inconsistent units, you can set the -customizable variable @code{calc-ensure-consistent-units} to @code{t} -(@pxref{Customizing Calc}). In this case, if you request units which -are inconsistent with the original units, you will be warned about it -and no conversion will occur. - You can use explicit unit conversion instead of the @kbd{u s} command to gain more control over the units of the result of an expression. For example, given @samp{5 m + 23 mm}, you can type @kbd{u c m} or @@ -27916,13 +27911,11 @@ to have, then for the new units. (If the value on the stack can be simplified so that it doesn't contain any units, like @samp{ft/in} can be simplified to 12, then @kbd{u c} will still prompt for both old -units and new units. You can ignore the prompt for old units with -@key{RET}, or turn off the prompt by setting the customizable variable -@code{calc-allow-units-as-numbers} to @code{nil}; -@pxref{Customizing Calc}.) Assuming the old and new units you give are -consistent with each other, the result also will not contain any -units. For example, @kbd{@w{u c} cm @key{RET} in @key{RET}} converts -the number 2 on the stack to 5.08. +units and new units. This can be disabled; @pxref{Customizing Calc}.) +Assuming the old and new units you give are consistent with each +other, the result also will not contain any units. For example, +@kbd{@w{u c} cm @key{RET} in @key{RET}} converts the number 2 on the +stack to 5.08. @kindex u b @pindex calc-base-units ------------------------------------------------------------ revno: 111984 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-03-09 12:22:27 -0800 message: * admin.el: Comment Add missing ChangeLog portion for previous change. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-03-09 20:19:41 +0000 +++ admin/ChangeLog 2013-03-09 20:22:27 +0000 @@ -1,7 +1,7 @@ 2013-03-09 Glenn Morris * admin.el (add-release-logs): Provide interactive defaults. - Allow specification of the release date. + Allow specification of the release date. Don't exclude gnus/. 2013-03-05 Paul Eggert === modified file 'admin/admin.el' --- admin/admin.el 2013-03-09 20:19:41 +0000 +++ admin/admin.el 2013-03-09 20:22:27 +0000 @@ -28,6 +28,10 @@ (defvar add-log-time-format) ; in add-log +;; Does this information need to be in every ChangeLog, as opposed to +;; just the top-level one? Only if you allow changes the same +;; day as the release. +;; http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00161.html (defun add-release-logs (root version &optional date) "Add \"Version VERSION released.\" change log entries in ROOT. Root must be the root of an Emacs source tree. ------------------------------------------------------------ revno: 111983 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-03-09 12:19:41 -0800 message: * admin/admin.el (add-release-logs): Provide interactive defaults. Allow specification of the release date. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-03-05 17:55:41 +0000 +++ admin/ChangeLog 2013-03-09 20:19:41 +0000 @@ -1,3 +1,8 @@ +2013-03-09 Glenn Morris + + * admin.el (add-release-logs): Provide interactive defaults. + Allow specification of the release date. + 2013-03-05 Paul Eggert * notes/unicode: Add notes about Emacs source file encoding. === modified file 'admin/admin.el' --- admin/admin.el 2013-01-02 16:13:04 +0000 +++ admin/admin.el 2013-03-09 20:19:41 +0000 @@ -28,25 +28,32 @@ (defvar add-log-time-format) ; in add-log -(defun add-release-logs (root version) +(defun add-release-logs (root version &optional date) "Add \"Version VERSION released.\" change log entries in ROOT. -Root must be the root of an Emacs source tree." - (interactive "DEmacs root directory: \nNVersion number: ") +Root must be the root of an Emacs source tree. +Optional argument DATE is the release date, default today." + (interactive (list (read-directory-name "Emacs root directory: ") + (read-string "Version number: " + (format "%s.%s" emacs-major-version + emacs-minor-version)) + (read-string "Release date: " + (progn (require 'add-log) + (funcall add-log-time-format))))) (setq root (expand-file-name root)) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) (error "%s doesn't seem to be the root of an Emacs source tree" root)) (require 'add-log) + (or date (setq date (funcall add-log-time-format))) (let* ((logs (process-lines "find" root "-name" "ChangeLog")) (entry (format "%s %s <%s>\n\n\t* Version %s released.\n\n" - (funcall add-log-time-format) + date (or add-log-full-name (user-full-name)) (or add-log-mailing-address user-mail-address) version))) (dolist (log logs) - (unless (string-match "/gnus/" log) - (find-file log) - (goto-char (point-min)) - (insert entry))))) + (find-file log) + (goto-char (point-min)) + (insert entry)))) (defun set-version-in-file (root file version rx) (find-file (expand-file-name file root)) ------------------------------------------------------------ revno: 111982 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-03-09 20:09:33 +0200 message: coding.c (to_unicode): Fix a typo in a comment. diff: === modified file 'src/coding.c' --- src/coding.c 2013-03-06 11:26:30 +0000 +++ src/coding.c 2013-03-09 18:09:33 +0000 @@ -7970,7 +7970,7 @@ to_unicode (Lisp_Object str, Lisp_Object *buf) { *buf = code_convert_string_norecord (str, Qutf_16le, 1); - /* We need to make a another copy (in addition to the one made by + /* We need to make another copy (in addition to the one made by code_convert_string_norecord) to ensure that the final string is _doubly_ zero terminated --- that is, that the string is terminated by two zero bytes and one utf-16le null character. ------------------------------------------------------------ revno: 111981 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2013-03-09 12:14:24 -0500 message: * lisp/mouse.el (mouse-drag-track): Remove left-over debugging code. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-09 11:06:23 +0000 +++ lisp/ChangeLog 2013-03-09 17:14:24 +0000 @@ -1,3 +1,7 @@ +2013-03-09 Stefan Monnier + + * mouse.el (mouse-drag-track): Remove left-over debugging code. + 2013-03-09 Michael Albinus Major rewrite due to changed D-Bus interface of GVFS 1.14. @@ -6,9 +10,9 @@ (tramp-gvfs-methods-mounttracker, tramp-gvfs-listmounts) (tramp-gvfs-mountlocation, tramp-gvfs-mountlocation-signature): New defconst. - (tramp-gvfs-file-name-handler-alist) [directory-files]: - [directory-files-and-attributes, file-exists-p, file-modes]: Use - Tramp default handler. + (tramp-gvfs-file-name-handler-alist) [directory-files] + [directory-files-and-attributes, file-exists-p, file-modes]: + Use Tramp default handler. [file-acl, file-selinux-context, process-file, set-file-acl]: [set-file-modes, set-file-selinux-context, shell-command]: [start-file-process ]: Remove handler. === modified file 'lisp/mouse.el' --- lisp/mouse.el 2013-03-09 04:15:53 +0000 +++ lisp/mouse.el 2013-03-09 17:14:24 +0000 @@ -850,7 +850,6 @@ (track-mouse (while (progn (setq event (read-event)) - (trace-values event) (or (mouse-movement-p event) (memq (car-safe event) '(switch-frame select-window)))) (unless (memq (car-safe event) '(switch-frame select-window)) ------------------------------------------------------------ revno: 111980 committer: Michael Albinus branch nick: trunk timestamp: Sat 2013-03-09 12:06:23 +0100 message: Major rewrite due to changed D-Bus interface of GVFS 1.14. * net/tramp-gvfs.el (top): Extend check for gvfs availability. (tramp-gvfs-methods-mounttracker, tramp-gvfs-listmounts) (tramp-gvfs-mountlocation, tramp-gvfs-mountlocation-signature): New defconst. (tramp-gvfs-file-name-handler-alist) [directory-files]: [directory-files-and-attributes, file-exists-p, file-modes]: Use Tramp default handler. [file-acl, file-selinux-context, process-file, set-file-acl]: [set-file-modes, set-file-selinux-context, shell-command]: [start-file-process ]: Remove handler. [verify-visited-file-modtime]: New handler. (tramp-gvfs-dbus-string-to-byte-array) (tramp-gvfs-dbus-byte-array-to-string): New defuns. Replace all calls of `dbus-string-to-byte-array' and `tramp-gvfs-dbus-byte-array-to-string'. (tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-delete-directory) (tramp-gvfs-handle-delete-file, tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-directory-p) (tramp-gvfs-handle-file-executable-p) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-file-writable-p) (tramp-gvfs-handle-insert-directory) (tramp-gvfs-handle-insert-file-contents) (tramp-gvfs-handle-make-directory, tramp-gvfs-handle-rename-file) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-handle-write-region): Rewrite. (tramp-gvfs-handle-file-acl) (tramp-gvfs-handle-file-selinux-context) (tramp-gvfs-handle-process-file, tramp-gvfs-handle-set-file-acl) (tramp-gvfs-handle-set-file-modes) (tramp-gvfs-handle-set-file-selinux-context) (tramp-gvfs-handle-shell-command) (tramp-gvfs-handle-start-file-process) (tramp-gvfs-handle-verify-visited-file-modtime): Remove defuns. (tramp-gvfs-url-file-name): Do not use `file-truename', we work over the symlinks. Fix user handling. (top, tramp-gvfs-handler-mounted-unmounted): Handle different names of the D-Bus signals. (tramp-gvfs-connection-mounted-p): Handle different names of the D-Bus methods. (tramp-gvfs-mount-spec-entry): New defun. (tramp-gvfs-mount-spec): Use it. (tramp-gvfs-maybe-open-connection): Check, that in case of "smb" there is a share name. Handle different names of the D-Bus signals and methods. (tramp-gvfs-maybe-open-connection): Set connection properties needed for `tramp-check-cached-permissions'. (tramp-gvfs-send-command): Apply `tramp-gvfs-maybe-open-connection'. Return t or nil. * net/tramp.el (tramp-backtrace): Move up. (tramp-error): Apply a backtrace into the debug buffer when `tramp-verbose > 9. (tramp-file-mode-type-map, tramp-file-mode-from-int) (tramp-file-mode-permissions, tramp-get-local-uid) (tramp-get-local-gid, tramp-check-cached-permissions): Move from tramp-sh.el. * net/tramp-sh.el (tramp-file-mode-type-map) (tramp-check-cached-permissions, tramp-file-mode-from-int) (tramp-file-mode-permissions, tramp-get-local-uid) (tramp-get-local-gid): Move to tramp.el. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-09 04:15:53 +0000 +++ lisp/ChangeLog 2013-03-09 11:06:23 +0000 @@ -1,3 +1,72 @@ +2013-03-09 Michael Albinus + + Major rewrite due to changed D-Bus interface of GVFS 1.14. + + * net/tramp-gvfs.el (top): Extend check for gvfs availability. + (tramp-gvfs-methods-mounttracker, tramp-gvfs-listmounts) + (tramp-gvfs-mountlocation, tramp-gvfs-mountlocation-signature): + New defconst. + (tramp-gvfs-file-name-handler-alist) [directory-files]: + [directory-files-and-attributes, file-exists-p, file-modes]: Use + Tramp default handler. + [file-acl, file-selinux-context, process-file, set-file-acl]: + [set-file-modes, set-file-selinux-context, shell-command]: + [start-file-process ]: Remove handler. + [verify-visited-file-modtime]: New handler. + (tramp-gvfs-dbus-string-to-byte-array) + (tramp-gvfs-dbus-byte-array-to-string): New defuns. Replace all + calls of `dbus-string-to-byte-array' and + `tramp-gvfs-dbus-byte-array-to-string'. + (tramp-gvfs-handle-copy-file) + (tramp-gvfs-handle-delete-directory) + (tramp-gvfs-handle-delete-file, tramp-gvfs-handle-file-attributes) + (tramp-gvfs-handle-file-directory-p) + (tramp-gvfs-handle-file-executable-p) + (tramp-gvfs-handle-file-name-all-completions) + (tramp-gvfs-handle-file-readable-p) + (tramp-gvfs-handle-file-writable-p) + (tramp-gvfs-handle-insert-directory) + (tramp-gvfs-handle-insert-file-contents) + (tramp-gvfs-handle-make-directory, tramp-gvfs-handle-rename-file) + (tramp-gvfs-handle-set-visited-file-modtime) + (tramp-gvfs-handle-write-region): Rewrite. + (tramp-gvfs-handle-file-acl) + (tramp-gvfs-handle-file-selinux-context) + (tramp-gvfs-handle-process-file, tramp-gvfs-handle-set-file-acl) + (tramp-gvfs-handle-set-file-modes) + (tramp-gvfs-handle-set-file-selinux-context) + (tramp-gvfs-handle-shell-command) + (tramp-gvfs-handle-start-file-process) + (tramp-gvfs-handle-verify-visited-file-modtime): Remove defuns. + (tramp-gvfs-url-file-name): Do not use `file-truename', we work + over the symlinks. Fix user handling. + (top, tramp-gvfs-handler-mounted-unmounted): Handle different names + of the D-Bus signals. + (tramp-gvfs-connection-mounted-p): Handle different names of the + D-Bus methods. + (tramp-gvfs-mount-spec-entry): New defun. + (tramp-gvfs-mount-spec): Use it. + (tramp-gvfs-maybe-open-connection): Check, that in case of "smb" + there is a share name. Handle different names of the D-Bus + signals and methods. + (tramp-gvfs-maybe-open-connection): Set connection properties + needed for `tramp-check-cached-permissions'. + (tramp-gvfs-send-command): Apply `tramp-gvfs-maybe-open-connection'. + Return t or nil. + + * net/tramp.el (tramp-backtrace): Move up. + (tramp-error): Apply a backtrace into the debug buffer when + `tramp-verbose > 9. + (tramp-file-mode-type-map, tramp-file-mode-from-int) + (tramp-file-mode-permissions, tramp-get-local-uid) + (tramp-get-local-gid, tramp-check-cached-permissions): Move from + tramp-sh.el. + + * net/tramp-sh.el (tramp-file-mode-type-map) + (tramp-check-cached-permissions, tramp-file-mode-from-int) + (tramp-file-mode-permissions, tramp-get-local-uid) + (tramp-get-local-gid): Move to tramp.el. + 2013-03-09 Stefan Monnier Separate mouse-1-click-follows-link from mouse-drag-region. === modified file 'lisp/net/tramp-gvfs.el' --- lisp/net/tramp-gvfs.el 2013-01-02 16:13:04 +0000 +++ lisp/net/tramp-gvfs.el 2013-03-09 11:06:23 +0000 @@ -24,24 +24,28 @@ ;;; Commentary: ;; Access functions for the GVFS daemon from Tramp. Tested with GVFS -;; 1.0.2 (Ubuntu 8.10, Gnome 2.24). It has been reported also to run +;; 1.0 (Ubuntu 8.10, Gnome 2.24). It has been reported also to run ;; with GVFS 0.2.5 (Ubuntu 8.04, Gnome 2.22), but there is an ;; incompatibility with the mount_info structure, which has been ;; worked around. -;; It has also been tested with GVFS 1.6.2 (Ubuntu 10.04, Gnome 2.30), +;; It has also been tested with GVFS 1.6 (Ubuntu 10.04, Gnome 2.30), ;; where the default_location has been added to mount_info (see ;; . +;; With GVFS 1.14 (Ubuntu 12.10, Gnome 3.6) the interfaces have been +;; changed, again. So we must introspect the D-Bus interfaces. + ;; All actions to mount a remote location, and to retrieve mount ;; information, are performed by D-Bus messages. File operations ;; themselves are performed via the mounted filesystem in ~/.gvfs. ;; Consequently, GNU Emacs 23.1 with enabled D-Bus bindings is a ;; precondition. -;; The GVFS D-Bus interface is said to be unstable. There are even no -;; introspection data. The interface, as discovered during -;; development time, is given in respective comments. +;; The GVFS D-Bus interface is said to be unstable. There were even +;; no introspection data before GVFS 1.14. The interface, as +;; discovered during development time, is given in respective +;; comments. ;; The customer option `tramp-gvfs-methods' contains the list of ;; supported connection methods. Per default, these are "dav", @@ -147,7 +151,8 @@ ;; Emacs 23 on some system types. We don't call `dbus-ping', because ;; this would load dbus.el. (unless (and (tramp-compat-funcall 'dbus-get-unique-name :session) - (tramp-compat-process-running-p "gvfs-fuse-daemon")) + (or (tramp-compat-process-running-p "gvfs-fuse-daemon") + (tramp-compat-process-running-p "gvfsd-fuse"))) (error "Package `tramp-gvfs' not supported")) (defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker" @@ -156,6 +161,35 @@ (defconst tramp-gvfs-interface-mounttracker "org.gtk.vfs.MountTracker" "The mount tracking interface in the GVFS daemon.") +;; Introspection data exist since GVFS 1.14. If there are no such +;; data, we expect an earlier interface. +(defconst tramp-gvfs-methods-mounttracker + (dbus-introspect-get-method-names + :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker + tramp-gvfs-interface-mounttracker) + "The list of supported methods of the mount tracking interface.") + +(defconst tramp-gvfs-listmounts + (if (member "ListMounts" tramp-gvfs-methods-mounttracker) + "ListMounts" + "listMounts") + "The name of the \"listMounts\" method. +It has been changed in GVFS 1.14.") + +(defconst tramp-gvfs-mountlocation + (if (member "MountLocation" tramp-gvfs-methods-mounttracker) + "MountLocation" + "mountLocation") + "The name of the \"mountLocation\" method. +It has been changed in GVFS 1.14.") + +(defconst tramp-gvfs-mountlocation-signature + (dbus-introspect-get-signature + :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker + tramp-gvfs-interface-mounttracker tramp-gvfs-mountlocation) + "The D-Bus signature of the \"mountLocation\" method. +It has been changed in GVFS 1.14.") + ;; ;; ;; (logand (lsh mode -9) 4) 0)) - (sgid (> (logand (lsh mode -9) 2) 0)) - (sticky (> (logand (lsh mode -9) 1) 0))) - (setq user (tramp-file-mode-permissions user suid "s")) - (setq group (tramp-file-mode-permissions group sgid "s")) - (setq other (tramp-file-mode-permissions other sticky "t")) - (concat type user group other))) - -(defun tramp-file-mode-permissions (perm suid suid-text) - "Convert a permission bitset into a string. -This is used internally by `tramp-file-mode-from-int'." - (let ((r (> (logand perm 4) 0)) - (w (> (logand perm 2) 0)) - (x (> (logand perm 1) 0))) - (concat (or (and r "r") "-") - (or (and w "w") "-") - (or (and suid x suid-text) ; suid, execute - (and suid (upcase suid-text)) ; suid, !execute - (and x "x") "-")))) ; !suid - (defun tramp-shell-case-fold (string) "Converts STRING to shell glob pattern which ignores case." (mapconcat @@ -4992,14 +4903,6 @@ ;; The command might not always return a number. (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) -(defun tramp-get-local-uid (id-format) - (if (equal id-format 'integer) (user-uid) (user-login-name))) - -(defun tramp-get-local-gid (id-format) - (if (and (fboundp 'group-gid) (equal id-format 'integer)) - (tramp-compat-funcall 'group-gid) - (nth 3 (tramp-compat-file-attributes "~/" id-format)))) - ;; Some predefined connection properties. (defun tramp-get-inline-compress (vec prop size) "Return the compress command related to PROP. === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2013-03-01 08:13:53 +0000 +++ lisp/net/tramp.el 2013-03-09 11:06:23 +0000 @@ -1505,12 +1505,18 @@ (concat (format "(%d) # " level) fmt-string) args))))))) +(defsubst tramp-backtrace (vec-or-proc) + "Dump a backtrace into the debug buffer. +This function is meant for debugging purposes." + (tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace)))) + (defsubst tramp-error (vec-or-proc signal fmt-string &rest args) "Emit an error. VEC-OR-PROC identifies the connection to use, SIGNAL is the signal identifier to be raised, remaining args passed to `tramp-message'. Finally, signal SIGNAL is raised." (let (tramp-message-show-message) + (tramp-backtrace vec-or-proc) (tramp-message vec-or-proc 1 "%s" (error-message-string @@ -1543,11 +1549,6 @@ "`M-x tramp-cleanup-this-connection'")) (sit-for 30)))))) -(defsubst tramp-backtrace (vec-or-proc) - "Dump a backtrace into the debug buffer. -This function is meant for debugging purposes." - (tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace)))) - (defmacro with-parsed-tramp-file-name (filename var &rest body) "Parse a Tramp filename and make components available in the body. @@ -3660,6 +3661,107 @@ (t (error "Tenth char `%c' must be one of `xtT-'" other-execute-or-sticky))))))) +(defconst tramp-file-mode-type-map + '((0 . "-") ; Normal file (SVID-v2 and XPG2) + (1 . "p") ; fifo + (2 . "c") ; character device + (3 . "m") ; multiplexed character device (v7) + (4 . "d") ; directory + (5 . "?") ; Named special file (XENIX) + (6 . "b") ; block device + (7 . "?") ; multiplexed block device (v7) + (8 . "-") ; regular file + (9 . "n") ; network special file (HP-UX) + (10 . "l") ; symlink + (11 . "?") ; ACL shadow inode (Solaris, not userspace) + (12 . "s") ; socket + (13 . "D") ; door special (Solaris) + (14 . "w")) ; whiteout (BSD) + "A list of file types returned from the `stat' system call. +This is used to map a mode number to a permission string.") + +;;;###tramp-autoload +(defun tramp-file-mode-from-int (mode) + "Turn an integer representing a file mode into an ls(1)-like string." + (let ((type (cdr + (assoc (logand (lsh mode -12) 15) tramp-file-mode-type-map))) + (user (logand (lsh mode -6) 7)) + (group (logand (lsh mode -3) 7)) + (other (logand (lsh mode -0) 7)) + (suid (> (logand (lsh mode -9) 4) 0)) + (sgid (> (logand (lsh mode -9) 2) 0)) + (sticky (> (logand (lsh mode -9) 1) 0))) + (setq user (tramp-file-mode-permissions user suid "s")) + (setq group (tramp-file-mode-permissions group sgid "s")) + (setq other (tramp-file-mode-permissions other sticky "t")) + (concat type user group other))) + +(defun tramp-file-mode-permissions (perm suid suid-text) + "Convert a permission bitset into a string. +This is used internally by `tramp-file-mode-from-int'." + (let ((r (> (logand perm 4) 0)) + (w (> (logand perm 2) 0)) + (x (> (logand perm 1) 0))) + (concat (or (and r "r") "-") + (or (and w "w") "-") + (or (and suid x suid-text) ; suid, execute + (and suid (upcase suid-text)) ; suid, !execute + (and x "x") "-")))) ; !suid + +;;;###tramp-autoload +(defun tramp-get-local-uid (id-format) + (if (equal id-format 'integer) (user-uid) (user-login-name))) + +;;;###tramp-autoload +(defun tramp-get-local-gid (id-format) + (if (and (fboundp 'group-gid) (equal id-format 'integer)) + (tramp-compat-funcall 'group-gid) + (nth 3 (tramp-compat-file-attributes "~/" id-format)))) + +;;;###tramp-autoload +(defun tramp-check-cached-permissions (vec access) + "Check `file-attributes' caches for VEC. +Return t if according to the cache access type ACCESS is known to +be granted." + (let ((result nil) + (offset (cond + ((eq ?r access) 1) + ((eq ?w access) 2) + ((eq ?x access) 3)))) + (dolist (suffix '("string" "integer") result) + (setq + result + (or + result + (let ((file-attr + (tramp-get-file-property + vec (tramp-file-name-localname vec) + (concat "file-attributes-" suffix) nil)) + (remote-uid + (tramp-get-connection-property + vec (concat "uid-" suffix) nil)) + (remote-gid + (tramp-get-connection-property + vec (concat "gid-" suffix) nil))) + (and + file-attr + (or + ;; Not a symlink + (eq t (car file-attr)) + (null (car file-attr))) + (or + ;; World accessible. + (eq access (aref (nth 8 file-attr) (+ offset 6))) + ;; User accessible and owned by user. + (and + (eq access (aref (nth 8 file-attr) offset)) + (equal remote-uid (nth 2 file-attr))) + ;; Group accessible and owned by user's + ;; principal group. + (and + (eq access (aref (nth 8 file-attr) (+ offset 3))) + (equal remote-gid (nth 3 file-attr))))))))))) + ;;;###tramp-autoload (defun tramp-local-host-p (vec) "Return t if this points to the local host, nil otherwise." ------------------------------------------------------------ revno: 111979 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-03-08 23:15:53 -0500 message: Separate mouse-1-click-follows-link from mouse-drag-region. * lisp/mouse.el (mouse--down-1-maybe-follows-link): New function. (key-translation-map): Use it to implement mouse-1-click-follows-link. (mouse-drag-line, mouse-drag-track): Remove mouse-1-click-follows-link code. (mouse--remap-link-click-p): Remove. * src/keyboard.c (access_keymap_keyremap): Accept nil return value from functions to mean "no change". * src/keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN) (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come from Elisp via unread-command-events. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-08 08:11:28 +0000 +++ lisp/ChangeLog 2013-03-09 04:15:53 +0000 @@ -1,10 +1,19 @@ +2013-03-09 Stefan Monnier + + Separate mouse-1-click-follows-link from mouse-drag-region. + * mouse.el (mouse--down-1-maybe-follows-link): New function. + (key-translation-map): Use it to implement mouse-1-click-follows-link. + (mouse-drag-line, mouse-drag-track): + Remove mouse-1-click-follows-link code. + (mouse--remap-link-click-p): Remove. + 2013-03-08 Jambunathan K * hi-lock.el (hi-lock-read-regexp-defaults-function): New var. (hi-lock-read-regexp-defaults): New defun. (hi-lock-line-face-buffer, hi-lock-face-buffer) - (hi-lock-face-phrase-buffer): Propagate above change. Update - docstring (bug#13892). + (hi-lock-face-phrase-buffer): Propagate above change. + Update docstring (bug#13892). * subr.el (find-tag-default-as-regexp): New defun. * replace.el (read-regexp): Propagate above change. @@ -45,13 +54,13 @@ 2013-03-07 Dmitry Gutov - * progmodes/js.el (js--multi-line-declaration-indentation): Merge - from js2-mode (https://github.com/mooz/js2-mode/issues/89). + * progmodes/js.el (js--multi-line-declaration-indentation): + Merge from js2-mode (https://github.com/mooz/js2-mode/issues/89). 2013-03-06 Dmitry Gutov - * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Only - propertize regexp when not inside a string (Bug#13885). + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): + Only propertize regexp when not inside a string (Bug#13885). 2013-03-06 Alan Mackenzie @@ -62,8 +71,8 @@ 2013-03-05 Michael Albinus - * net/tramp-compat.el (tramp-compat-delete-directory): Implement - TRASH argument. + * net/tramp-compat.el (tramp-compat-delete-directory): + Implement TRASH argument. 2013-03-05 Dmitry Gutov === modified file 'lisp/mouse.el' --- lisp/mouse.el 2013-02-07 01:54:50 +0000 +++ lisp/mouse.el 2013-03-09 04:15:53 +0000 @@ -93,6 +93,49 @@ :version "22.1" :group 'mouse) +(defun mouse--down-1-maybe-follows-link (&optional _prompt) + "Turn `mouse-1' events into `mouse-2' events if follows-link. +Expects to be bound to `down-mouse-1' in `key-translation-map'." + (if (or (null mouse-1-click-follows-link) + (not (eq (if (eq mouse-1-click-follows-link 'double) + 'double-down-mouse-1 'down-mouse-1) + (car-safe last-input-event))) + (not (mouse-on-link-p (event-start last-input-event))) + (and (not mouse-1-click-in-non-selected-windows) + (not (eq (selected-window) + (posn-window (event-start last-input-event)))))) + nil + (let ((this-event last-input-event) + (timedout + (sit-for (if (numberp mouse-1-click-follows-link) + (/ (abs mouse-1-click-follows-link) 1000.0) + 0)))) + (if (if (and (numberp mouse-1-click-follows-link) + (>= mouse-1-click-follows-link 0)) + timedout (not timedout)) + nil + + (let ((event (read-event))) + (if (eq (car-safe event) (if (eq mouse-1-click-follows-link 'double) + 'double-mouse-1 'mouse-1)) + ;; Turn the mouse-1 into a mouse-2 to follow links. + (let ((newup (if (eq mouse-1-click-follows-link 'double) + 'double-mouse-2 'mouse-2)) + (newdown (if (eq mouse-1-click-follows-link 'double) + 'double-down-mouse-2 'down-mouse-2))) + ;; If mouse-2 has never been done by the user, it doesn't have + ;; the necessary property to be interpreted correctly. + (put newup 'event-kind (get (car event) 'event-kind)) + (put newdown 'event-kind (get (car this-event) 'event-kind)) + (push (cons newup (cdr event)) unread-command-events) + (vector (cons newdown (cdr this-event)))) + (push event unread-command-events) + nil)))))) + +(define-key key-translation-map [down-mouse-1] + #'mouse--down-1-maybe-follows-link) +(define-key key-translation-map [double-down-mouse-1] + #'mouse--down-1-maybe-follows-link) ;; Provide a mode-specific menu on a mouse button. @@ -418,8 +461,6 @@ (window (posn-window start)) (frame (window-frame window)) (minibuffer-window (minibuffer-window frame)) - (on-link (and mouse-1-click-follows-link - (mouse-on-link-p start))) (side (and (eq line 'vertical) (or (cdr (assq 'vertical-scroll-bars (frame-parameters frame))) @@ -507,12 +548,6 @@ (- growth))))))) ;; Process the terminating event. (unless dragged - (when (and (mouse-event-p event) on-link - (mouse--remap-link-click-p start-event event)) - ;; If mouse-2 has never been done by the user, it doesn't have - ;; the necessary property to be interpreted correctly. - (put 'mouse-2 'event-kind 'mouse-click) - (setcar event 'mouse-2)) (push event unread-command-events)))) (defun mouse-drag-mode-line (start-event) @@ -770,7 +805,6 @@ (setq mouse-selection-click-count-buffer (current-buffer)) (deactivate-mark) (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541). - (original-window (selected-window)) ;; We've recorded what we needed from the current buffer and ;; window, now let's jump to the place of the event, where things ;; are happening. @@ -788,15 +822,7 @@ (nth 3 bounds) ;; Don't count the mode line. (1- (nth 3 bounds)))) - (on-link (and mouse-1-click-follows-link - ;; Use start-point before the intangibility - ;; treatment, in case we click on a link inside - ;; intangible text. - (mouse-on-link-p start-posn))) (click-count (1- (event-click-count start-event))) - (remap-double-click (and on-link - (eq mouse-1-click-follows-link 'double) - (= click-count 1))) ;; Suppress automatic hscrolling, because that is a nuisance ;; when setting point near the right fringe (but see below). (auto-hscroll-mode-saved auto-hscroll-mode) @@ -809,8 +835,6 @@ (if (< (point) start-point) (goto-char start-point)) (setq start-point (point)) - (if remap-double-click - (setq click-count 0)) ;; Activate the region, using `mouse-start-end' to determine where ;; to put point and mark (e.g., double-click will select a word). @@ -826,6 +850,7 @@ (track-mouse (while (progn (setq event (read-event)) + (trace-values event) (or (mouse-movement-p event) (memq (car-safe event) '(switch-frame select-window)))) (unless (memq (car-safe event) '(switch-frame select-window)) @@ -900,21 +925,6 @@ (or end-point (= (window-start start-window) start-window-start))) - (when (and on-link - (= start-point (point)) - (mouse--remap-link-click-p start-event event)) - ;; If we rebind to mouse-2, reselect previous selected - ;; window, so that the mouse-2 event runs in the same - ;; situation as if user had clicked it directly. Fixes - ;; the bug reported by juri@jurta.org on 2005-12-27. - (if (or (vectorp on-link) (stringp on-link)) - (setq event (aref on-link 0)) - (select-window original-window) - (setcar event 'mouse-2) - ;; If this mouse click has never been done by the - ;; user, it doesn't have the necessary property to be - ;; interpreted correctly. - (put 'mouse-2 'event-kind 'mouse-click))) (push event unread-command-events))))))) (defun mouse--drag-set-mark-and-point (start click click-count) @@ -932,22 +942,6 @@ (set-mark beg) (goto-char end))))) -(defun mouse--remap-link-click-p (start-event end-event) - (or (and (eq mouse-1-click-follows-link 'double) - (= (event-click-count start-event) 2)) - (and - (not (eq mouse-1-click-follows-link 'double)) - (= (event-click-count start-event) 1) - (= (event-click-count end-event) 1) - (or (not (integerp mouse-1-click-follows-link)) - (let ((t0 (posn-timestamp (event-start start-event))) - (t1 (posn-timestamp (event-end end-event)))) - (and (integerp t0) (integerp t1) - (if (> mouse-1-click-follows-link 0) - (<= (- t1 t0) mouse-1-click-follows-link) - (< (- t0 t1) mouse-1-click-follows-link)))))))) - - ;; Commands to handle xterm-style multiple clicks. (defun mouse-skip-word (dir) "Skip over word, over whitespace, or over identical punctuation. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-08 21:37:41 +0000 +++ src/ChangeLog 2013-03-09 04:15:53 +0000 @@ -1,3 +1,12 @@ +2013-03-09 Stefan Monnier + + * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN) + (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come + from Elisp via unread-command-events. + + * keyboard.c (access_keymap_keyremap): Accept nil return value from + functions to mean "no change". + 2013-03-08 Paul Eggert region-cache.c, scroll.c, search.c: Use bool for booleans. @@ -19,8 +28,8 @@ * lisp.h (find_newline, find_newline_no_quit): Adjust prototype. * bidi.c (bidi_find_paragraph_start): Pass byte position to find_newline_no_quit, thus eliminating CHAR_TO_BYTE. - * editfns.c (Fconstrain_to_field): Break long line. Adjust - call to find_newline. + * editfns.c (Fconstrain_to_field): Break long line. + Adjust call to find_newline. * indent.c (vmotion): Adjust calls to find_newline_no_quit. Use DEC_BOTH to start next search from the previous buffer position, where appropriate. @@ -270,8 +279,8 @@ 2013-03-02 Eli Zaretskii - * textprop.c (Fadd_text_properties, Fremove_text_properties): If - the interval tree changes as a side effect of calling + * textprop.c (Fadd_text_properties, Fremove_text_properties): + If the interval tree changes as a side effect of calling modify_region, re-do processing starting from the call to validate_interval_range. (Bug#13743) @@ -347,8 +356,8 @@ * textprop.c (Fadd_text_properties, Fremove_text_properties) (Fremove_list_of_text_properties): Skip all of the intervals in the region between START and END that already have resp. don't - have the requested properties, not just the first one. Add - assertions that the loop afterwards always modifies the + have the requested properties, not just the first one. + Add assertions that the loop afterwards always modifies the properties. (Bug#13743) 2013-02-25 Stefan Monnier === modified file 'src/keyboard.c' --- src/keyboard.c 2013-03-07 03:01:17 +0000 +++ src/keyboard.c 2013-03-09 04:15:53 +0000 @@ -8699,7 +8699,7 @@ barf--don't ignore it. (To ignore it safely, we would need to gcpro a bunch of other variables.) */ - if (! (VECTORP (next) || STRINGP (next))) + if (! (NILP (next) || VECTORP (next) || STRINGP (next))) error ("Function %s returns invalid key sequence", SSDATA (SYMBOL_NAME (tem))); } === modified file 'src/keyboard.h' --- src/keyboard.h 2013-02-11 19:21:23 +0000 +++ src/keyboard.h 2013-03-09 04:15:53 +0000 @@ -421,18 +421,18 @@ (EVENT_HAS_PARAMETERS (event) ? XCAR (event) : (event)) /* Extract the starting and ending positions from a composite event. */ -#define EVENT_START(event) (XCAR (XCDR (event))) -#define EVENT_END(event) (XCAR (XCDR (XCDR (event)))) +#define EVENT_START(event) (CAR_SAFE (CDR_SAFE (event))) +#define EVENT_END(event) (CAR_SAFE (CDR_SAFE (CDR_SAFE (event)))) /* Extract the click count from a multi-click event. */ #define EVENT_CLICK_COUNT(event) (Fnth (make_number (2), (event))) /* Extract the fields of a position. */ -#define POSN_WINDOW(posn) (XCAR (posn)) -#define POSN_POSN(posn) (XCAR (XCDR (posn))) +#define POSN_WINDOW(posn) (CAR_SAFE (posn)) +#define POSN_POSN(posn) (CAR_SAFE (CDR_SAFE (posn))) #define POSN_SET_POSN(posn,x) (XSETCAR (XCDR (posn), (x))) -#define POSN_WINDOW_POSN(posn) (XCAR (XCDR (XCDR (posn)))) -#define POSN_TIMESTAMP(posn) (XCAR (XCDR (XCDR (XCDR (posn))))) +#define POSN_WINDOW_POSN(posn) (CAR_SAFE (CDR_SAFE (CDR_SAFE (posn)))) +#define POSN_TIMESTAMP(posn) (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (posn))))) #define POSN_SCROLLBAR_PART(posn) (Fnth (make_number (4), (posn))) /* A cons (STRING . STRING-CHARPOS), or nil in mouse-click events.