Now on revision 111442. ------------------------------------------------------------ revno: 111442 committer: Bastien Guerry branch nick: trunk timestamp: Tue 2013-01-08 08:14:51 +0100 message: etc/NEWS: Document the change wrt `apropos-user-option' and `apropos-variable' diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-01-02 16:13:04 +0000 +++ etc/NEWS 2013-01-08 07:14:51 +0000 @@ -32,6 +32,13 @@ * Changes in Emacs 24.4 +++ +** `apropos-variable' is now `apropos-user-option' +`apropos-user-option' shows all user options while `apropos-variable' +shows all variables. When called with a universal prefix argument, +the two commands swap their behaviors. When `apropos-do-all' is +non-nil, they output the same results. + ++++ ** `eval-defun' on an already defined defcustom calls the :set function, if there is one. ------------------------------------------------------------ revno: 111441 committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-01-07 21:07:19 -0800 message: Merge from gnulib (comment change only). diff: === modified file 'lib/strftime.c' --- lib/strftime.c 2013-01-04 02:17:49 +0000 +++ lib/strftime.c 2013-01-08 05:07:19 +0000 @@ -208,7 +208,14 @@ else if (to_uppcase) \ fwrite_uppcase (p, (s), _n); \ else \ - fwrite (s, _n, 1, p); \ + { \ + /* Ignore the value of fwrite. The caller can determine whether \ + an error occured by inspecting ferror (P). All known fwrite \ + implementations set the stream's error indicator when they \ + fail due to ENOMEM etc., even though C11 and POSIX.1-2008 do \ + not require this. */ \ + fwrite (s, _n, 1, p); \ + } \ } \ while (0) \ ) ------------------------------------------------------------ revno: 111440 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-01-07 20:40:09 -0800 message: Add some :version tags * gnus/mml-smime.el (mml-smime-sign-with-sender): Add :version. * net/tramp.el (tramp-default-host-alist): Add :version. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-08 00:28:55 +0000 +++ lisp/ChangeLog 2013-01-08 04:40:09 +0000 @@ -1,3 +1,7 @@ +2013-01-08 Glenn Morris + + * net/tramp.el (tramp-default-host-alist): Add :version. + 2013-01-08 Juri Linkov * info.el (Info-read-node-name-2): Don't duplicate suffixes for === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-01-07 03:59:02 +0000 +++ lisp/gnus/ChangeLog 2013-01-08 04:40:09 +0000 @@ -1,3 +1,7 @@ +2013-01-08 Glenn Morris + + * mml-smime.el (mml-smime-sign-with-sender): Add :version. + 2013-01-07 Daiki Ueno * mml-smime.el: Support signing by sender. === modified file 'lisp/gnus/mml-smime.el' --- lisp/gnus/mml-smime.el 2013-01-07 03:59:02 +0000 +++ lisp/gnus/mml-smime.el 2013-01-08 04:40:09 +0000 @@ -77,6 +77,7 @@ (defcustom mml-smime-sign-with-sender nil "If t, use message sender so find a key to sign with." :group 'mime-security + :version "24.4" :type 'boolean) (defun mml-smime-sign (cont) === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2013-01-07 09:25:34 +0000 +++ lisp/net/tramp.el 2013-01-08 04:40:09 +0000 @@ -393,6 +393,7 @@ If the file name does not specify the method, lookup is done using the empty string for the method name." :group 'tramp + :version "24.4" :type '(repeat (list (choice :tag "Method regexp" regexp sexp) (choice :tag " User regexp" regexp sexp) (choice :tag " Host name" string (const nil))))) ------------------------------------------------------------ revno: 111439 fixes bug: http://debbugs.gnu.org/12456 committer: Juri Linkov branch nick: trunk timestamp: Tue 2013-01-08 02:28:55 +0200 message: * lisp/info.el (Info-read-node-name-2): Don't duplicate suffixes for single completion. (info--manual-names): Expand node completions into an explicit list before appending it to another list. Filter out internal buffers with the leading space in the buffer name. (Bug#10771) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-08 00:11:51 +0000 +++ lisp/ChangeLog 2013-01-08 00:28:55 +0000 @@ -1,5 +1,13 @@ 2013-01-08 Juri Linkov + * info.el (Info-read-node-name-2): Don't duplicate suffixes for + single completion. (Bug#12456) + (info--manual-names): Expand node completions into an explicit list + before appending it to another list. Filter out internal buffers + with the leading space in the buffer name. (Bug#10771) + +2013-01-08 Juri Linkov + * info.el (Info-read-node-name-1): Allow empty node name in (FILENAME) that defaults to the Top node. (Info-goto-node, Info-read-node-name): Doc fix to mention that === modified file 'lisp/info.el' --- lisp/info.el 2013-01-08 00:11:51 +0000 +++ lisp/info.el 2013-01-08 00:28:55 +0000 @@ -1742,6 +1742,7 @@ (when (file-name-absolute-p string) (setq dirs (list (file-name-directory string)))) (let ((names nil) + (names-sans-suffix nil) (suffix (concat (regexp-opt suffixes t) "\\'")) (string-dir (file-name-directory string))) (dolist (dir dirs) @@ -1764,7 +1765,14 @@ ;; add the unsuffixed name as a completion option. (when (string-match suffix file) (setq file (substring file 0 (match-beginning 0))) - (push (if string-dir (concat string-dir file) file) names))))) + (push (if string-dir (concat string-dir file) file) + names-sans-suffix))))) + ;; If there is just one file, don't duplicate it with suffixes, + ;; so `Info-read-node-name-1' will be able to complete a single + ;; candidate and to add the terminating ")". + (if (and (= (length names) 1) (= (length names-sans-suffix) 1)) + (setq names names-sans-suffix) + (setq names (append names-sans-suffix names))) (complete-with-action action names string pred))) (defun Info-read-node-name-1 (string predicate code) @@ -5174,13 +5182,16 @@ (with-current-buffer buffer (and (eq major-mode 'Info-mode) (stringp Info-current-file) + (not (string= (substring (buffer-name) 0 1) " ")) (push (file-name-sans-extension (file-name-nondirectory Info-current-file)) names)))) (delete-dups (append (nreverse names) - (apply-partially 'Info-read-node-name-2 - Info-directory-list - (mapcar 'car Info-suffix-list)))))) + (all-completions + "" + (apply-partially 'Info-read-node-name-2 + Info-directory-list + (mapcar 'car Info-suffix-list))))))) (provide 'info) ------------------------------------------------------------ revno: 111438 fixes bug: http://debbugs.gnu.org/13365 committer: Juri Linkov branch nick: trunk timestamp: Tue 2013-01-08 02:11:51 +0200 message: * lisp/info.el (Info-read-node-name-1): Allow empty node name in (FILENAME) that defaults to the Top node. (Info-goto-node, Info-read-node-name): Doc fix to mention that the short format (FILENAME) goes to the Top node. (Info-build-node-completions): Rename arg `file' to `filename'. * doc/misc/info.texi (Go to node): Mention the abbreviated format `(FILENAME)' equal to `(FILENAME)Top'. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-01-06 20:34:54 +0000 +++ doc/misc/ChangeLog 2013-01-08 00:11:51 +0000 @@ -1,3 +1,8 @@ +2013-01-08 Juri Linkov + + * info.texi (Go to node): Mention the abbreviated format + `(FILENAME)' equal to `(FILENAME)Top'. (Bug#13365) + 2013-01-06 Andreas Schwab * autotype.texi: Remove undefined command @subtitlefont. === modified file 'doc/misc/info.texi' --- doc/misc/info.texi 2013-01-01 09:11:05 +0000 +++ doc/misc/info.texi 2013-01-08 00:11:51 +0000 @@ -1079,7 +1079,8 @@ node name by putting it at the front, in parentheses. Thus, @kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is the node @samp{Top} in the Info file @file{dir}. Likewise, -@kbd{g(emacs)Top@key{RET}} goes to the top node of the Emacs manual. +@kbd{g(emacs)Top@key{RET}} (or just @kbd{g(emacs)@key{RET}}) goes to the +top node of the Emacs manual. The node name @samp{*} specifies the whole file. So you can look at all of the current file by typing @kbd{g*@key{RET}} or all of any === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-07 22:00:55 +0000 +++ lisp/ChangeLog 2013-01-08 00:11:51 +0000 @@ -1,3 +1,12 @@ +2013-01-08 Juri Linkov + + * info.el (Info-read-node-name-1): Allow empty node name in (FILENAME) + that defaults to the Top node. + (Info-goto-node, Info-read-node-name): Doc fix to mention that + the short format (FILENAME) goes to the Top node. + (Info-build-node-completions): Rename arg `file' to `filename'. + (Bug#13365) + 2013-01-07 Bastien Guerry * menu-bar.el (menu-bar-search-documentation-menu): Use === modified file 'lisp/info.el' --- lisp/info.el 2013-01-02 16:13:04 +0000 +++ lisp/info.el 2013-01-08 00:11:51 +0000 @@ -1703,7 +1703,9 @@ If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file FILENAME; otherwise, NODENAME should be in the current Info file (or one of its sub-files). -Completion is available, but only for node names in the current Info file. +Completion is available for node names in the current Info file as well as +in the Info file FILENAME after the closing parenthesis in (FILENAME). +Empty NODENAME in (FILENAME) defaults to the Top node. If FORK is non-nil (interactively with a prefix arg), show the node in a new Info buffer. If FORK is a string, it is the name to use for the new buffer." @@ -1784,16 +1786,19 @@ ((string-match "\\`(\\([^)]+\\))" string) (let ((file0 (match-string 0 string)) (file1 (match-string 1 string)) - (node (substring string (match-end 0)))) - (completion-table-with-context - file0 - (apply-partially - (lambda (string pred action) - (complete-with-action - action - (Info-build-node-completions (Info-find-file file1)) - string pred))) - node predicate code))) + (nodename (substring string (match-end 0)))) + (if (and (equal nodename "") (eq code 'lambda)) + ;; Empty node name is permitted that means "Top". + t + (completion-table-with-context + file0 + (apply-partially + (lambda (string pred action) + (complete-with-action + action + (Info-build-node-completions (Info-find-file file1)) + string pred))) + nodename predicate code)))) ;; Otherwise use Info-read-node-completion-table. (t (complete-with-action code Info-read-node-completion-table string predicate)))) @@ -1802,7 +1807,9 @@ (defun Info-read-node-name (prompt) "Read an Info node name with completion, prompting with PROMPT. A node name can have the form \"NODENAME\", referring to a node -in the current Info file, or \"(FILENAME)NODENAME\"." +in the current Info file, or \"(FILENAME)NODENAME\", referring to +a node in FILENAME. \"(FILENAME)\" is a short format to go to +the Top node in FILENAME." (let* ((completion-ignore-case t) (Info-read-node-completion-table (Info-build-node-completions)) (nodename (completing-read prompt 'Info-read-node-name-1 nil t))) @@ -1810,14 +1817,14 @@ (Info-read-node-name prompt) nodename))) -(defun Info-build-node-completions (&optional file) - (if file - (or (cdr (assoc file Info-file-completions)) +(defun Info-build-node-completions (&optional filename) + (if filename + (or (cdr (assoc filename Info-file-completions)) (with-temp-buffer (Info-mode) - (Info-goto-node (format "(%s)Top" file)) + (Info-goto-node (format "(%s)Top" filename)) (Info-build-node-completions-1) - (push (cons file Info-current-file-completions) Info-file-completions) + (push (cons filename Info-current-file-completions) Info-file-completions) Info-current-file-completions)) (or Info-current-file-completions (Info-build-node-completions-1)))) ------------------------------------------------------------ revno: 111437 committer: Bastien Guerry branch nick: trunk timestamp: Mon 2013-01-07 23:00:55 +0100 message: Introduce `apropos-user-option' and update `apropos-variable'. (Bug#13276) diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-01-05 21:18:01 +0000 +++ doc/emacs/ChangeLog 2013-01-07 22:00:55 +0000 @@ -1,3 +1,8 @@ +2013-01-07 Bastien Guerry + + * help.texi (Apropos): Document `apropos-user-option' and update + the doc for `apropos-variable'. + 2013-01-05 Glenn Morris * text.texi (HTML Mode): Remove deleted nxml C-RET binding. === modified file 'doc/emacs/help.texi' --- doc/emacs/help.texi 2013-01-01 09:11:05 +0000 +++ doc/emacs/help.texi 2013-01-07 22:00:55 +0000 @@ -295,10 +295,15 @@ Search for functions and variables. Both interactive functions (commands) and noninteractive functions can be found by this. +@item M-x apropos-user-option +@findex apropos-user-option +Search for user-customizable variables. With a prefix argument, +search for non-customizable variables too. + @item M-x apropos-variable @findex apropos-variable -Search for user-customizable variables. With a prefix argument, -search for non-customizable variables too. +Search for variables. With a prefix argument, search for +customizable variables only. @item M-x apropos-value @findex apropos-value === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-07 19:44:48 +0000 +++ lisp/ChangeLog 2013-01-07 22:00:55 +0000 @@ -1,3 +1,18 @@ +2013-01-07 Bastien Guerry + + * menu-bar.el (menu-bar-search-documentation-menu): Use + `apropos-user-option' and fix the help message. + +2013-01-07 Bastien Guerry + + * apropos.el (apropos-do-all): Update docstring. + (apropos-user-option-button): New face. + (apropos-user-option): Rename from `apropos-variable' and update + docstring. + (apropos-variable): Rewrite, now show all variables by default. + (apropos-print): Mention "User option" instead of "Variable" when + printing doc for user options. (Bug#13276) + 2013-01-07 Jürgen Hötzel * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): === modified file 'lisp/apropos.el' --- lisp/apropos.el 2013-01-01 09:11:05 +0000 +++ lisp/apropos.el 2013-01-07 22:00:55 +0000 @@ -69,7 +69,7 @@ "Non nil means apropos commands will search more extensively. This may be slower. This option affects the following commands: -`apropos-variable' will search all variables, not just user variables. +`apropos-user-option' will search all variables, not just user options. `apropos-command' will also search non-interactive functions. `apropos' will search all symbols, not just functions, variables, faces, and those with property lists. @@ -115,6 +115,12 @@ :group 'apropos :version "24.3") +(defface apropos-user-option-button + '((t (:inherit (font-lock-variable-name-face button)))) + "Button face indicating a user option in Apropos." + :group 'apropos + :version "24.4") + (defface apropos-misc-button '((t (:inherit (font-lock-constant-face button)))) "Button face indicating a miscellaneous object type in Apropos." @@ -261,6 +267,15 @@ 'action (lambda (button) (describe-variable (button-get button 'apropos-symbol)))) +(define-button-type 'apropos-user-option + 'apropos-label "User option" + 'apropos-short-label "o" + 'face 'apropos-user-option-button + 'help-echo "mouse-2, RET: Display more help on this user option" + 'follow-link t + 'action (lambda (button) + (describe-variable (button-get button 'apropos-symbol)))) + (define-button-type 'apropos-face 'apropos-label "Face" 'apropos-short-label "F" @@ -461,15 +476,15 @@ This is used to decide whether to print the result's type or not.") ;;;###autoload -(defun apropos-variable (pattern &optional do-all) - "Show user variables that match PATTERN. +(defun apropos-user-option (pattern &optional do-all) + "Show user options that match PATTERN. PATTERN can be a word, a list of words (separated by spaces), or a regexp (using some regexp special characters). If it is a word, search for matches for that word as a substring. If it is a list of words, search for matches for any two (or more) of those words. With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, also show -normal variables." +variables, not just user options." (interactive (list (apropos-read-pattern (if (or current-prefix-arg apropos-do-all) "variable" "user option")) @@ -481,6 +496,17 @@ (get symbol 'variable-documentation))) 'custom-variable-p))) +;;;###autoload +(defun apropos-variable (pattern &optional do-not-all) + "Show variables that match PATTERN. +When DO-NOT-ALL is not-nil, show user options only, i.e. behave +like `apropos-user-option'." + (interactive (list (apropos-read-pattern + (if current-prefix-arg "user option" "variable")) + current-prefix-arg)) + (let ((apropos-do-all (if do-not-all nil t))) + (apropos-user-option pattern))) + ;; For auld lang syne: ;;;###autoload (defalias 'command-apropos 'apropos-command) @@ -1099,7 +1125,11 @@ 'apropos-macro 'apropos-function)) (not nosubst)) - (apropos-print-doc 3 'apropos-variable (not nosubst)) + (apropos-print-doc 3 + (if (custom-variable-p symbol) + 'apropos-user-option + 'apropos-variable) + (not nosubst)) (apropos-print-doc 7 'apropos-group t) (apropos-print-doc 6 'apropos-face t) (apropos-print-doc 5 'apropos-widget t) === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2013-01-01 09:11:05 +0000 +++ lisp/menu-bar.el 2013-01-07 22:00:55 +0000 @@ -1637,8 +1637,8 @@ '(menu-item "Find Options by Value..." apropos-value :help "Find variables whose values match a regexp")) (bindings--define-key menu [find-options-by-name] - '(menu-item "Find Options by Name..." apropos-variable - :help "Find variables whose names match a regexp")) + '(menu-item "Find Options by Name..." apropos-user-option + :help "Find user options whose names match a regexp")) (bindings--define-key menu [find-commands-by-name] '(menu-item "Find Commands by Name..." apropos-command :help "Find commands whose names match a regexp")) ------------------------------------------------------------ revno: 111436 author: Jürgen Hötzel committer: Michael Albinus branch nick: trunk timestamp: Mon 2013-01-07 20:44:48 +0100 message: * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): Handle filename correctly, when parsing "source -> target" symlink output. (tramp-adb-handle-set-file-times): New defun. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-07 18:03:01 +0000 +++ lisp/ChangeLog 2013-01-07 19:44:48 +0000 @@ -1,3 +1,10 @@ +2013-01-07 Jürgen Hötzel + + * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): + Handle filename correctly, when parsing "source -> target" symlink + output. + (tramp-adb-handle-set-file-times): New defun. + 2013-01-07 Stefan Monnier * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the === modified file 'lisp/net/tramp-adb.el' --- lisp/net/tramp-adb.el 2013-01-07 09:25:34 +0000 +++ lisp/net/tramp-adb.el 2013-01-07 19:44:48 +0000 @@ -123,7 +123,7 @@ (vc-registered . ignore) ;no vc control files on Android devices (write-region . tramp-adb-handle-write-region) (set-file-modes . tramp-adb-handle-set-file-modes) - (set-file-times . ignore) + (set-file-times . tramp-adb-handle-set-file-times) (copy-file . tramp-adb-handle-copy-file) (rename-file . tramp-adb-handle-rename-file) (process-file . tramp-adb-handle-process-file) @@ -311,7 +311,9 @@ (and is-symlink (cadr (split-string name "\\( -> \\|\n\\)"))))) (push (list - name + (if is-symlink + (car (split-string name "\\( -> \\|\n\\)")) + name) (or is-dir symlink-target) 1 ;link-count ;; no way to handle numeric ids in Androids ash @@ -615,6 +617,19 @@ v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname) "Error while changing file's mode %s" filename))) +(defun tramp-adb-handle-set-file-times (filename &optional time) + "Like `set-file-times' for Tramp files." + (with-parsed-tramp-file-name filename nil + (tramp-flush-file-property v localname) + (let ((time (if (or (null time) (equal time '(0 0))) + (current-time) + time))) + (tramp-adb-command-exit-status + ;; use shell arithmetic because of Emacs integer size limit + v (format "touch -t $(( %d * 65536 + %d )) %s" + (car time) (cadr time) + (tramp-shell-quote-argument localname)))))) + (defun tramp-adb-handle-copy-file (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes) ------------------------------------------------------------ revno: 111435 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2013-01-07 13:03:01 -0500 message: * lisp/emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the advice list when the interactive-spec of ad-Advice-* changes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-07 11:24:35 +0000 +++ lisp/ChangeLog 2013-01-07 18:03:01 +0000 @@ -1,3 +1,8 @@ +2013-01-07 Stefan Monnier + + * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the + advice list when the interactive-spec of ad-Advice-* changes. + 2013-01-07 Katsumi Yamaoka * wid-edit.el (widget-default-get): Work for inlined elements. @@ -7,7 +12,7 @@ * net/tramp.el (tramp-default-host-alist): New defcustom. (tramp-find-host): Use it. - (tramp-eshell-directory-change): Moved from tramp-sh.el. Add to + (tramp-eshell-directory-change): Move from tramp-sh.el. Add to `eshell-directory-change-hook'. * net/tramp-adb.el (top): Add adb specific entry in @@ -26,8 +31,8 @@ * net/tramp-adb.el (tramp-adb-ls-toolbox-regexp): The file size can consist of more than one digit. - (tramp-adb-file-name-handler-alist): Use - `tramp-handle-file-exists-p' consistently. + (tramp-adb-file-name-handler-alist): + Use `tramp-handle-file-exists-p' consistently. (tramp-adb-file-name-handler): Don't tweak `tramp-default-host'. (tramp-adb-handle-file-exists-p): Remove function. (tramp-adb-file-name-host): New defun. @@ -161,8 +166,8 @@ (tramp-do-copy-or-rename-file): Ignore errors when calling `set-file-extended-attributes'. - * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add - handler for `file-acl'. + * net/tramp-smb.el (tramp-smb-file-name-handler-alist): + Add handler for `file-acl'. (tramp-smb-handle-file-acl): New defun. 2013-01-02 Jay Belanger === modified file 'lisp/emacs-lisp/advice.el' --- lisp/emacs-lisp/advice.el 2013-01-02 16:13:04 +0000 +++ lisp/emacs-lisp/advice.el 2013-01-07 18:03:01 +0000 @@ -2917,13 +2917,18 @@ "Redefine FUNCTION with its advised definition from cache or scratch. The resulting FUNCTION will be compiled if `ad-should-compile' returns t. The current definition and its cache-id will be put into the cache." - (let ((verified-cached-definition - (if (ad-verify-cache-id function) - (ad-get-cache-definition function))) - (advicefunname (ad-get-advice-info-field function 'advicefunname))) + (let* ((verified-cached-definition + (if (ad-verify-cache-id function) + (ad-get-cache-definition function))) + (advicefunname (ad-get-advice-info-field function 'advicefunname)) + (old-ispec (interactive-form advicefunname))) (fset advicefunname (or verified-cached-definition (ad-make-advised-definition function))) + (unless (equal (interactive-form advicefunname) old-ispec) + ;; If the interactive-spec of advicefunname has changed, force nadvice to + ;; refresh its copy. + (advice-remove function advicefunname)) (advice-add function :around advicefunname) (if (ad-should-compile function compile) (ad-compile-function function)) === modified file 'test/automated/advice-tests.el' --- test/automated/advice-tests.el 2013-01-02 16:30:50 +0000 +++ test/automated/advice-tests.el 2013-01-07 18:03:01 +0000 @@ -107,6 +107,12 @@ (lambda (f &rest args) (cons (cons 2 (called-interactively-p)) (apply f args)))) (should (equal (call-interactively 'sm-test7) '((2 . t) (1 . t) 11))) + + ;; Check handling of interactive spec. + (defun sm-test8 (a) (interactive "p") a) + (defadvice sm-test8 (before adv1 activate) nil) + (defadvice sm-test8 (before adv2 activate) (interactive "P") nil) + (should (equal (interactive-form 'sm-test8) '(interactive "P"))) )) ;; Local Variables: ------------------------------------------------------------ revno: 111434 committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2013-01-07 11:24:35 +0000 message: wid-edit.el (widget-default-get): Work for inlined elements (Bug#12670) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-07 09:25:34 +0000 +++ lisp/ChangeLog 2013-01-07 11:24:35 +0000 @@ -1,3 +1,8 @@ +2013-01-07 Katsumi Yamaoka + + * wid-edit.el (widget-default-get): Work for inlined elements. + (Bug#12670) + 2013-01-07 Michael Albinus * net/tramp.el (tramp-default-host-alist): New defcustom. @@ -11,7 +16,7 @@ (tramp-adb-execute-adb-command, tramp-adb-maybe-open-connection): Use `tramp-file-name-host' instead of `tramp-adb-file-name-host'. - * net/tramp-sh.el : Move eshell integration code to tramp.el. + * net/tramp-sh.el: Move eshell integration code to tramp.el. 2013-01-06 Jürgen Hötzel === modified file 'lisp/wid-edit.el' --- lisp/wid-edit.el 2013-01-01 09:11:05 +0000 +++ lisp/wid-edit.el 2013-01-07 11:24:35 +0000 @@ -526,7 +526,16 @@ "Extract the default external value of WIDGET." (widget-apply widget :value-to-external (or (widget-get widget :value) - (widget-apply widget :default-get)))) + (progn + (when (widget-get widget :args) + (let (args) + (dolist (arg (widget-get widget :args)) + (setq args (append args + (if (widget-get arg :inline) + (widget-get arg :args) + (list arg))))) + (widget-put widget :args args))) + (widget-apply widget :default-get))))) (defun widget-match-inline (widget vals) "In WIDGET, match the start of VALS." ------------------------------------------------------------ revno: 111433 committer: Michael Albinus + + * net/tramp.el (tramp-default-host-alist): New defcustom. + (tramp-find-host): Use it. + (tramp-eshell-directory-change): Moved from tramp-sh.el. Add to + `eshell-directory-change-hook'. + + * net/tramp-adb.el (top): Add adb specific entry in + `tramp-default-host-alist'. + (tramp-adb-file-name-host): Remove function. + (tramp-adb-execute-adb-command, tramp-adb-maybe-open-connection): + Use `tramp-file-name-host' instead of `tramp-adb-file-name-host'. + + * net/tramp-sh.el : Move eshell integration code to tramp.el. + 2013-01-06 Jürgen Hötzel * net/tramp-adb.el (tramp-methods): Add `tramp-tmpdir' entry. @@ -5,7 +20,7 @@ 2013-01-06 Michael Albinus * net/tramp-adb.el (tramp-adb-ls-toolbox-regexp): The file size can - consist of mor than one digit. + consist of more than one digit. (tramp-adb-file-name-handler-alist): Use `tramp-handle-file-exists-p' consistently. (tramp-adb-file-name-handler): Don't tweak `tramp-default-host'. === modified file 'lisp/net/tramp-adb.el' --- lisp/net/tramp-adb.el 2013-01-06 21:25:27 +0000 +++ lisp/net/tramp-adb.el 2013-01-07 09:25:34 +0000 @@ -66,8 +66,12 @@ "[[:space:]]+\\(.*\\)$")) ; \6 filename ;;;###tramp-autoload -(add-to-list 'tramp-methods `(,tramp-adb-method - (tramp-tmpdir "/data/local/tmp"))) +(add-to-list 'tramp-methods + `(,tramp-adb-method + (tramp-tmpdir "/data/local/tmp"))) + +;;;###tramp-autoload +(add-to-list 'tramp-default-host-alist `(,tramp-adb-method nil "")) ;;;###tramp-autoload (eval-after-load 'tramp @@ -937,17 +941,10 @@ ;; Helper functions. -(defun tramp-adb-file-name-host (vec) - "Return host component of VEC. -If it is equal to the default value of `tramp-default-host', `nil' is returned." - (let ((host (tramp-file-name-host vec))) - (unless (equal host (eval (car (get 'tramp-default-host 'standard-value)))) - host))) - (defun tramp-adb-execute-adb-command (vec &rest args) "Returns nil on success error-output on failure." - (when (tramp-adb-file-name-host vec) - (setq args (append (list "-s" (tramp-adb-file-name-host vec)) args))) + (when (> (length (tramp-file-name-host vec)) 0) + (setq args (append (list "-s" (tramp-file-name-host vec)) args))) (with-temp-buffer (prog1 (unless (zerop (apply 'call-process (tramp-adb-program) nil t nil args)) @@ -1048,6 +1045,7 @@ connection if a previous connection has died for some reason." (let* ((buf (tramp-get-connection-buffer vec)) (p (get-buffer-process buf)) + (host (tramp-file-name-host vec)) (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) (unless (and p (processp p) (memq (process-status p) '(run open))) @@ -1055,21 +1053,17 @@ (when (and p (processp p)) (delete-process p)) (if (not devices) (tramp-error vec 'file-error "No device connected")) - (if (and (tramp-adb-file-name-host vec) - (not (member (tramp-adb-file-name-host vec) devices))) - (tramp-error - vec 'file-error - "Device %s not connected" (tramp-adb-file-name-host vec))) - (if (and (not (eq (length devices) 1)) - (not (tramp-adb-file-name-host vec))) + (if (and (> (length host) 0) (not (member host devices))) + (tramp-error vec 'file-error "Device %s not connected" host)) + (if (and (> (length devices) 1) (zerop (length host))) (tramp-error vec 'file-error "Multiple Devices connected: No Host/Device specified")) (with-tramp-progress-reporter vec 3 "Opening adb shell connection" (let* ((coding-system-for-read 'utf-8-dos) ;is this correct? (process-connection-type tramp-process-connection-type) - (args (if (tramp-adb-file-name-host vec) - (list "-s" (tramp-adb-file-name-host vec) "shell") + (args (if (> (length host) 0) + (list "-s" host "shell") (list "shell"))) (p (let ((default-directory (tramp-compat-temporary-file-directory))) === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-01-04 19:22:37 +0000 +++ lisp/net/tramp-sh.el 2013-01-07 09:25:34 +0000 @@ -5181,34 +5181,6 @@ (t (format "%s <%%s" coding))))))) -;;; Integration of eshell.el: - -(eval-when-compile - (defvar eshell-path-env)) - -;; eshell.el keeps the path in `eshell-path-env'. We must change it -;; when `default-directory' points to another host. -(defun tramp-eshell-directory-change () - "Set `eshell-path-env' to $PATH of the host related to `default-directory'." - (setq eshell-path-env - (if (file-remote-p default-directory) - (with-parsed-tramp-file-name default-directory nil - (mapconcat - 'identity - (tramp-get-remote-path v) - ":")) - (getenv "PATH")))) - -(eval-after-load "esh-util" - '(progn - (tramp-eshell-directory-change) - (add-hook 'eshell-directory-change-hook - 'tramp-eshell-directory-change) - (add-hook 'tramp-unload-hook - (lambda () - (remove-hook 'eshell-directory-change-hook - 'tramp-eshell-directory-change))))) - (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-sh 'force))) === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2013-01-02 16:13:04 +0000 +++ lisp/net/tramp.el 2013-01-07 09:25:34 +0000 @@ -381,6 +381,22 @@ :group 'tramp :type 'string) +;;;###tramp-autoload +(defcustom tramp-default-host-alist nil + "Default host to use for specific method/user pairs. +This is an alist of items (METHOD USER HOST). The first matching item +specifies the host to use for a file name which does not specify a +host. METHOD and HOST are regular expressions or nil, which is +interpreted as a regular expression which always matches. If no entry +matches, the variable `tramp-default-host' takes effect. + +If the file name does not specify the method, lookup is done using the +empty string for the method name." + :group 'tramp + :type '(repeat (list (choice :tag "Method regexp" regexp sexp) + (choice :tag " User regexp" regexp sexp) + (choice :tag " Host name" string (const nil))))) + (defcustom tramp-default-proxies-alist nil "Route to be followed for specific host/user pairs. This is an alist of items (HOST USER PROXY). The first matching @@ -918,7 +934,7 @@ This regexp should match partial Tramp file names only. Please note that the entry in `file-name-handler-alist' is made when -this file (tramp.el) is loaded. This means that this variable must be set +this file \(tramp.el\) is loaded. This means that this variable must be set before loading tramp.el. Alternatively, `file-name-handler-alist' can be updated after changing this variable. @@ -1163,6 +1179,15 @@ "Return the right host string to use. This is HOST, if non-nil. Otherwise, it is `tramp-default-host'." (or (and (> (length host) 0) host) + (let ((choices tramp-default-host-alist) + lhost item) + (while choices + (setq item (pop choices)) + (when (and (string-match (or (nth 0 item) "") (or method "")) + (string-match (or (nth 1 item) "") (or user ""))) + (setq lhost (nth 2 item)) + (setq choices nil))) + lhost) tramp-default-host)) (defun tramp-dissect-file-name (name &optional nodefault) @@ -3861,6 +3886,34 @@ t t result))) result)))) +;;; Integration of eshell.el: + +(eval-when-compile + (defvar eshell-path-env)) + +;; eshell.el keeps the path in `eshell-path-env'. We must change it +;; when `default-directory' points to another host. +(defun tramp-eshell-directory-change () + "Set `eshell-path-env' to $PATH of the host related to `default-directory'." + (setq eshell-path-env + (if (file-remote-p default-directory) + (with-parsed-tramp-file-name default-directory nil + (mapconcat + 'identity + (tramp-get-connection-property v "remote-path" nil) + ":")) + (getenv "PATH")))) + +(eval-after-load "esh-util" + '(progn + (tramp-eshell-directory-change) + (add-hook 'eshell-directory-change-hook + 'tramp-eshell-directory-change) + (add-hook 'tramp-unload-hook + (lambda () + (remove-hook 'eshell-directory-change-hook + 'tramp-eshell-directory-change))))) + ;; Checklist for `tramp-unload-hook' ;; - Unload all `tramp-*' packages ;; - Reset `file-name-handler-alist' ------------------------------------------------------------ revno: 111432 committer: Daiki Ueno branch nick: trunk timestamp: Mon 2013-01-07 12:59:02 +0900 message: lisp/gnus/mml-smime.el: Support signing by sender. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-01-02 16:13:04 +0000 +++ lisp/gnus/ChangeLog 2013-01-07 03:59:02 +0000 @@ -1,3 +1,13 @@ +2013-01-07 Daiki Ueno + + * mml-smime.el: Support signing by sender. + Requested by Uwe Brauer. + (mml-smime-sign-with-sender): New user option analogous + to mml2015-sign-with-sender. + (mml-smime-epg-sign): Respect mml-smime-sign-with-sender. + (mml-smime-epg-find-usable-secret-key): New helper function copied from + mml2015.el. + 2012-12-31 Lars Magne Ingebrigtsen * gnus-msg.el (gnus-inews-insert-gcc): Don't insert Gcc headers if Gnus === modified file 'lisp/gnus/mml-smime.el' --- lisp/gnus/mml-smime.el 2013-01-01 09:11:05 +0000 +++ lisp/gnus/mml-smime.el 2013-01-07 03:59:02 +0000 @@ -74,6 +74,11 @@ :group 'mime-security :type '(repeat (string :tag "Key ID"))) +(defcustom mml-smime-sign-with-sender nil + "If t, use message sender so find a key to sign with." + :group 'mime-security + :type 'boolean) + (defun mml-smime-sign (cont) (let ((func (nth 1 (assq mml-smime-use mml-smime-function-alist)))) (if func @@ -366,6 +371,24 @@ (setq pointer (cdr pointer)))) (setq keys (cdr keys))))) +;; XXX: since gpg --list-secret-keys does not return validity of each +;; key, `mml-smime-epg-find-usable-key' defined above is not enough for +;; secret keys. The function `mml-smime-epg-find-usable-secret-key' +;; below looks at appropriate public keys to check usability. +(defun mml-smime-epg-find-usable-secret-key (context name usage) + (let ((secret-keys (epg-list-keys context name t)) + secret-key) + (while (and (not secret-key) secret-keys) + (if (mml-smime-epg-find-usable-key + (epg-list-keys context (epg-sub-key-fingerprint + (car (epg-key-sub-key-list + (car secret-keys))))) + usage) + (setq secret-key (car secret-keys) + secret-keys nil) + (setq secret-keys (cdr secret-keys)))) + secret-key)) + (autoload 'mml-compute-boundary "mml") ;; We require mm-decode, which requires mm-bodies, which autoloads @@ -376,29 +399,36 @@ (let* ((inhibit-redisplay t) (context (epg-make-context 'CMS)) (boundary (mml-compute-boundary cont)) + (sender (message-options-get 'message-sender)) + (signer-names (or mml-smime-signers + (if (and mml-smime-sign-with-sender sender) + (list (concat "<" sender ">"))))) signer-key (signers (or (message-options-get 'mml-smime-epg-signers) (message-options-set - 'mml-smime-epg-signers - (if (eq mm-sign-option 'guided) - (epa-select-keys context "\ + 'mml-smime-epg-signers + (if (eq mm-sign-option 'guided) + (epa-select-keys context "\ Select keys for signing. If no one is selected, default secret key is used. " - mml-smime-signers t) - (if mml-smime-signers - (mapcar - (lambda (signer) - (setq signer-key (mml-smime-epg-find-usable-key - (epg-list-keys context signer t) - 'sign)) - (unless (or signer-key - (y-or-n-p - (format "No secret key for %s; skip it? " + signer-names + t) + (if (or sender mml-smime-signers) + (delq nil + (mapcar + (lambda (signer) + (setq signer-key + (mml-smime-epg-find-usable-secret-key + context signer 'sign)) + (unless (or signer-key + (y-or-n-p + (format + "No secret key for %s; skip it? " signer))) - (error "No secret key for %s" signer)) - signer-key) - mml-smime-signers)))))) + (error "No secret key for %s" signer)) + signer-key) + signer-names))))))) signature micalg) (epg-context-set-signers context signers) (if mml-smime-cache-passphrase