diff options
| author | Paul Eggert | 2011-04-14 13:16:48 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-14 13:16:48 -0700 |
| commit | 8bd7b8304a41da5dc0c8a11967c1a6005e9465d0 (patch) | |
| tree | 145588110166df723c31f3fceaa00c190b77aa8c /lisp | |
| parent | cd64ea1d0df393beb93d1bdf19bd3990e3378f85 (diff) | |
| parent | 9024ff7943e9529ec38a80aaaa0db43224c1e885 (diff) | |
| download | emacs-8bd7b8304a41da5dc0c8a11967c1a6005e9465d0.tar.gz emacs-8bd7b8304a41da5dc0c8a11967c1a6005e9465d0.zip | |
Merge from mainline.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 109 | ||||
| -rw-r--r-- | lisp/autorevert.el | 14 | ||||
| -rw-r--r-- | lisp/calendar/cal-hebrew.el | 9 | ||||
| -rw-r--r-- | lisp/calendar/cal-tex.el | 10 | ||||
| -rw-r--r-- | lisp/dframe.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/advice.el | 141 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 49 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 6 | ||||
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 35 | ||||
| -rw-r--r-- | lisp/gnus/gnus-start.el | 55 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/mm-url.el | 11 | ||||
| -rw-r--r-- | lisp/gnus/registry.el | 4 | ||||
| -rw-r--r-- | lisp/help-fns.el | 75 | ||||
| -rw-r--r-- | lisp/icomplete.el | 7 | ||||
| -rw-r--r-- | lisp/ido.el | 18 | ||||
| -rw-r--r-- | lisp/image-mode.el | 2 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 117 | ||||
| -rw-r--r-- | lisp/net/network-stream.el | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 23 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 2 |
21 files changed, 389 insertions, 308 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 51f8066077d..bde1f1174c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,80 @@ | |||
| 1 | 2011-04-14 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-sh.el (tramp-sh-handle-file-attributes): Handle the | ||
| 4 | case when the scripts fail. Use `tramp-do-file-attributes-with-ls' | ||
| 5 | then. | ||
| 6 | (tramp-do-copy-or-rename-file-out-of-band): Do not check any | ||
| 7 | longer, whether`executable-find' is bound. | ||
| 8 | |||
| 9 | * net/tramp-smb.el (tramp-smb-handle-copy-file): Fix docstring. | ||
| 10 | |||
| 11 | 2011-04-14 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 12 | |||
| 13 | * minibuffer.el (completion-in-region-mode-predicate) | ||
| 14 | (completion-in-region-mode--predicate): New vars. | ||
| 15 | (completion-in-region, completion-in-region--postch) | ||
| 16 | (completion-in-region-mode): Use them. | ||
| 17 | (completion--capf-wrapper): Also return the hook function. | ||
| 18 | (completion-at-point, completion-help-at-point): | ||
| 19 | Adjust and provide a predicate. | ||
| 20 | |||
| 21 | Preserve arg names for advice of subr and lexical functions (bug#8457). | ||
| 22 | * help-fns.el (help-function-arglist): Consolidate the subr and | ||
| 23 | new-byte-code cases. Add argument `preserve-names' to extract names | ||
| 24 | from the docstring when needed. | ||
| 25 | * emacs-lisp/advice.el (ad-define-subr-args, ad-undefine-subr-args) | ||
| 26 | (ad-subr-args-defined-p, ad-get-subr-args, ad-subr-arglist): Remove. | ||
| 27 | (ad-arglist): Use help-function-arglist's new arg. | ||
| 28 | (ad-definition-type): Use cond. | ||
| 29 | |||
| 30 | 2011-04-13 Juanma Barranquero <lekktu@gmail.com> | ||
| 31 | |||
| 32 | * autorevert.el (auto-revert-handler): | ||
| 33 | Bind `remote-file-name-inhibit-cache', not `tramp-cache-inhibit-cache', | ||
| 34 | which was removed in 2010-10-02T13:21:43Z!michael.albinus@gmx.de. | ||
| 35 | Don't quote lambda. | ||
| 36 | |||
| 37 | * image-mode.el (image-transform-set-scale): | ||
| 38 | Fix change in 2011-04-09T20:28:01Z!cyd@stupidchicken.com. | ||
| 39 | |||
| 40 | 2011-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 41 | |||
| 42 | * net/network-stream.el (network-stream-open-starttls): Only do | ||
| 43 | opportunistic STARTTLS upgrades if we have built-in gnutls support. | ||
| 44 | Upgrades via gnutls-cli are too slow to be done opportunistically. | ||
| 45 | |||
| 46 | 2011-04-12 Juanma Barranquero <lekktu@gmail.com> | ||
| 47 | |||
| 48 | * dframe.el (dframe-current-frame): Remove spurious quote. | ||
| 49 | |||
| 50 | 2011-04-12 Glenn Morris <rgm@gnu.org> | ||
| 51 | |||
| 52 | * calendar/cal-tex.el (cal-tex-end-document): | ||
| 53 | Try to automatically use latin1 input if needed. | ||
| 54 | |||
| 55 | * calendar/cal-hebrew.el (diary-hebrew-rosh-hodesh): | ||
| 56 | Don't try to cons a mark onto an empty element. | ||
| 57 | |||
| 58 | 2011-04-11 Leo Liu <sdl.web@gmail.com> | ||
| 59 | |||
| 60 | * ido.el (ido-buffer-internal): Allow method 'kill for virtual | ||
| 61 | buffers. | ||
| 62 | (ido-kill-buffer-at-head): Support killing virtual buffers. | ||
| 63 | |||
| 64 | 2011-04-10 Chong Yidong <cyd@stupidchicken.com> | ||
| 65 | |||
| 66 | * minibuffer.el (completion-show-inline-help): New var. | ||
| 67 | (completion--do-completion, minibuffer-complete) | ||
| 68 | (minibuffer-force-complete, minibuffer-complete-word): Inhibit | ||
| 69 | minibuffer messages if completion-show-inline-help is nil. | ||
| 70 | |||
| 71 | * icomplete.el (icomplete-mode): Bind completion-show-inline-help | ||
| 72 | to avoid interference from inline help (Bug#5849). | ||
| 73 | |||
| 1 | 2011-04-10 Leo Liu <sdl.web@gmail.com> | 74 | 2011-04-10 Leo Liu <sdl.web@gmail.com> |
| 2 | 75 | ||
| 3 | * emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Fix | 76 | * emacs-lisp/tabulated-list.el (tabulated-list-print-entry): |
| 4 | typo. | 77 | Fix typo. |
| 5 | 78 | ||
| 6 | 2011-04-09 Chong Yidong <cyd@stupidchicken.com> | 79 | 2011-04-09 Chong Yidong <cyd@stupidchicken.com> |
| 7 | 80 | ||
| @@ -14,14 +87,14 @@ | |||
| 14 | (image-transform-fit-to-width): Handle image-toggle-display-image | 87 | (image-transform-fit-to-width): Handle image-toggle-display-image |
| 15 | and image-transform-resize directly. | 88 | and image-transform-resize directly. |
| 16 | 89 | ||
| 17 | 2011-04-08 Sho Nakatani <lay.sakura@gmail.com> | 90 | 2011-04-08 Sho Nakatani <lay.sakura@gmail.com> |
| 18 | 91 | ||
| 19 | * doc-view.el (doc-view-fit-width-to-window) | 92 | * doc-view.el (doc-view-fit-width-to-window) |
| 20 | (doc-view-fit-height-to-window, doc-view-fit-page-to-window): New | 93 | (doc-view-fit-height-to-window, doc-view-fit-page-to-window): |
| 21 | functions for fitting the shown image to the Emacs window size. | 94 | New functions for fitting the shown image to the Emacs window size. |
| 22 | (doc-view-mode-map): Add bindings for the new functions. | 95 | (doc-view-mode-map): Add bindings for the new functions. |
| 23 | 96 | ||
| 24 | 2011-03-24 Juanma Barranquero <lekktu@gmail.com> | 97 | 2011-04-08 Juanma Barranquero <lekktu@gmail.com> |
| 25 | 98 | ||
| 26 | * vc-annotate.el (vc-annotate-show-log-revision-at-line): | 99 | * vc-annotate.el (vc-annotate-show-log-revision-at-line): |
| 27 | Fix typo in docstring. | 100 | Fix typo in docstring. |
| @@ -101,12 +174,12 @@ | |||
| 101 | (package-menu-refresh, list-packages): Use it. | 174 | (package-menu-refresh, list-packages): Use it. |
| 102 | (package-menu--print-info): Renamed from package-print-package. | 175 | (package-menu--print-info): Renamed from package-print-package. |
| 103 | Return insertion data instead of inserting it directly. | 176 | Return insertion data instead of inserting it directly. |
| 104 | (package-menu-describe-package, package-menu-execute): Use | 177 | (package-menu-describe-package, package-menu-execute): |
| 105 | tabulated-list-get-id. | 178 | Use tabulated-list-get-id. |
| 106 | (package-menu-mark-delete, package-menu-mark-install) | 179 | (package-menu-mark-delete, package-menu-mark-install) |
| 107 | (package-menu-mark-unmark, package-menu-backup-unmark) | 180 | (package-menu-mark-unmark, package-menu-backup-unmark) |
| 108 | (package-menu-mark-obsolete-for-deletion): Use | 181 | (package-menu-mark-obsolete-for-deletion): |
| 109 | tabulated-list-put-tag. | 182 | Use tabulated-list-put-tag. |
| 110 | (package--list-packages, package-menu-revert) | 183 | (package--list-packages, package-menu-revert) |
| 111 | (package-menu-get-package, package-menu-get-version) | 184 | (package-menu-get-package, package-menu-get-version) |
| 112 | (package-menu-sort-by-column): Functions deleted. | 185 | (package-menu-sort-by-column): Functions deleted. |
| @@ -223,11 +296,11 @@ | |||
| 223 | 296 | ||
| 224 | 2011-04-02 Chong Yidong <cyd@stupidchicken.com> | 297 | 2011-04-02 Chong Yidong <cyd@stupidchicken.com> |
| 225 | 298 | ||
| 226 | * emacs-lisp/package.el (package--with-work-buffer): Recognize | 299 | * emacs-lisp/package.el (package--with-work-buffer): |
| 227 | https URLs. | 300 | Recognize https URLs. |
| 228 | 301 | ||
| 229 | * net/network-stream.el: Move from gnus/proto-stream.el. Change | 302 | * net/network-stream.el: Move from gnus/proto-stream.el. |
| 230 | prefix to network-stream throughout. | 303 | Change prefix to network-stream throughout. |
| 231 | (open-protocol-stream): Merge into open-network-stream, leaving | 304 | (open-protocol-stream): Merge into open-network-stream, leaving |
| 232 | open-protocol-stream as an alias. Handle nil BUFFER args. | 305 | open-protocol-stream as an alias. Handle nil BUFFER args. |
| 233 | 306 | ||
| @@ -905,10 +978,10 @@ | |||
| 905 | 978 | ||
| 906 | 2011-03-11 Ken Manheimer <ken.manheimer@gmail.com> | 979 | 2011-03-11 Ken Manheimer <ken.manheimer@gmail.com> |
| 907 | 980 | ||
| 908 | * allout-widgets.el (allout-widgets-tally): Initialize | 981 | * allout-widgets.el (allout-widgets-tally): |
| 909 | allout-widgets-tally as a hash table rather than nil to prevent | 982 | Initialize allout-widgets-tally as a hash table rather than nil to |
| 910 | mode-line redisplay warnings. | 983 | prevent mode-line redisplay warnings. Also, clarify the module |
| 911 | Also, clarify the module description and fix a comment typo. | 984 | description and fix a comment typo. |
| 912 | 985 | ||
| 913 | 2011-03-11 Juanma Barranquero <lekktu@gmail.com> | 986 | 2011-03-11 Juanma Barranquero <lekktu@gmail.com> |
| 914 | 987 | ||
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 2bc7310d7e5..c67b6663bd0 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -434,9 +434,9 @@ This is an internal function used by Auto-Revert Mode." | |||
| 434 | (file-readable-p buffer-file-name) | 434 | (file-readable-p buffer-file-name) |
| 435 | (if auto-revert-tail-mode | 435 | (if auto-revert-tail-mode |
| 436 | ;; Tramp caches the file attributes. Setting | 436 | ;; Tramp caches the file attributes. Setting |
| 437 | ;; `tramp-cache-inhibit' forces Tramp to | 437 | ;; `remote-file-name-inhibit-cache' forces Tramp |
| 438 | ;; reread the values. | 438 | ;; to reread the values. |
| 439 | (let ((tramp-cache-inhibit-cache t)) | 439 | (let ((remote-file-name-inhibit-cache t)) |
| 440 | (/= auto-revert-tail-pos | 440 | (/= auto-revert-tail-pos |
| 441 | (setq size | 441 | (setq size |
| 442 | (nth 7 (file-attributes | 442 | (nth 7 (file-attributes |
| @@ -460,10 +460,10 @@ This is an internal function used by Auto-Revert Mode." | |||
| 460 | (when buffer-file-name | 460 | (when buffer-file-name |
| 461 | (setq eob (eobp)) | 461 | (setq eob (eobp)) |
| 462 | (walk-windows | 462 | (walk-windows |
| 463 | #'(lambda (window) | 463 | (lambda (window) |
| 464 | (and (eq (window-buffer window) buffer) | 464 | (and (eq (window-buffer window) buffer) |
| 465 | (= (window-point window) (point-max)) | 465 | (= (window-point window) (point-max)) |
| 466 | (push window eoblist))) | 466 | (push window eoblist))) |
| 467 | 'no-mini t)) | 467 | 'no-mini t)) |
| 468 | (if auto-revert-tail-mode | 468 | (if auto-revert-tail-mode |
| 469 | (auto-revert-tail-handler size) | 469 | (auto-revert-tail-handler size) |
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el index e5373a28756..44c3e62a7c2 100644 --- a/lisp/calendar/cal-hebrew.el +++ b/lisp/calendar/cal-hebrew.el | |||
| @@ -954,16 +954,17 @@ use when highlighting the day in the calendar." | |||
| 954 | (format "%s (second day)" this-month) | 954 | (format "%s (second day)" this-month) |
| 955 | this-month)))) | 955 | this-month)))) |
| 956 | (if (= (% d 7) 6) ; Saturday--check for Shabbat Mevarchim | 956 | (if (= (% d 7) 6) ; Saturday--check for Shabbat Mevarchim |
| 957 | (cons mark | 957 | (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day)) |
| 958 | (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day)) | 958 | (cons mark |
| 959 | (format "Mevarchim Rosh Hodesh %s (%s)" | 959 | (format "Mevarchim Rosh Hodesh %s (%s)" |
| 960 | (aref h-month-names | 960 | (aref h-month-names |
| 961 | (if (= h-month | 961 | (if (= h-month |
| 962 | (calendar-hebrew-last-month-of-year | 962 | (calendar-hebrew-last-month-of-year |
| 963 | h-year)) | 963 | h-year)) |
| 964 | 0 h-month)) | 964 | 0 h-month)) |
| 965 | (aref calendar-day-name-array (- 29 h-day)))) | 965 | (aref calendar-day-name-array (- 29 h-day))))) |
| 966 | ((and (< h-day 30) (> h-day 22) (= 30 last-day)) | 966 | ((and (< h-day 30) (> h-day 22) (= 30 last-day)) |
| 967 | (cons mark | ||
| 967 | (format "Mevarchim Rosh Hodesh %s (%s-%s)" | 968 | (format "Mevarchim Rosh Hodesh %s (%s-%s)" |
| 968 | (aref h-month-names h-month) | 969 | (aref h-month-names h-month) |
| 969 | (if (= h-day 29) | 970 | (if (= h-day 29) |
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index a3f71107854..2fc215c06c4 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el | |||
| @@ -1587,6 +1587,16 @@ FINAL-SEPARATOR is non-nil." | |||
| 1587 | Insert the trailer to LaTeX document, pop to LaTeX buffer, add | 1587 | Insert the trailer to LaTeX document, pop to LaTeX buffer, add |
| 1588 | informative header, and run HOOK." | 1588 | informative header, and run HOOK." |
| 1589 | (cal-tex-e-document) | 1589 | (cal-tex-e-document) |
| 1590 | (or (and cal-tex-preamble-extra | ||
| 1591 | (string-match "inputenc" cal-tex-preamble-extra)) | ||
| 1592 | (not (re-search-backward "[^[:ascii:]]" nil 'move)) | ||
| 1593 | (progn | ||
| 1594 | (goto-char (point-min)) | ||
| 1595 | (when (search-forward "documentclass" nil t) | ||
| 1596 | (forward-line 1) | ||
| 1597 | ;; Eg for some Bahai holidays. | ||
| 1598 | ;; FIXME latin1 might not always be right. | ||
| 1599 | (insert "\\usepackage[latin1]{inputenc}\n")))) | ||
| 1590 | (latex-mode) | 1600 | (latex-mode) |
| 1591 | (pop-to-buffer cal-tex-buffer) | 1601 | (pop-to-buffer cal-tex-buffer) |
| 1592 | (goto-char (point-min)) | 1602 | (goto-char (point-min)) |
diff --git a/lisp/dframe.el b/lisp/dframe.el index 312f49f6053..71773b1abf8 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el | |||
| @@ -632,7 +632,7 @@ selecting FRAME-VAR." | |||
| 632 | FRAME-VAR is the variable storing the currently active dedicated frame. | 632 | FRAME-VAR is the variable storing the currently active dedicated frame. |
| 633 | If the current frame's buffer uses DESIRED-MAJOR-MODE, then use that frame." | 633 | If the current frame's buffer uses DESIRED-MAJOR-MODE, then use that frame." |
| 634 | (if (not (eq (selected-frame) (symbol-value frame-var))) | 634 | (if (not (eq (selected-frame) (symbol-value frame-var))) |
| 635 | (if (and (eq major-mode 'desired-major-mode) | 635 | (if (and (eq major-mode desired-major-mode) |
| 636 | (get-buffer-window (current-buffer)) | 636 | (get-buffer-window (current-buffer)) |
| 637 | (window-frame (get-buffer-window (current-buffer)))) | 637 | (window-frame (get-buffer-window (current-buffer)))) |
| 638 | (window-frame (get-buffer-window (current-buffer))) | 638 | (window-frame (get-buffer-window (current-buffer))) |
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 39ea97aa98e..5934975e36a 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el | |||
| @@ -503,36 +503,6 @@ | |||
| 503 | ;; exact structure of the original argument list as long as the new argument | 503 | ;; exact structure of the original argument list as long as the new argument |
| 504 | ;; list takes a compatible number/magnitude of actual arguments. | 504 | ;; list takes a compatible number/magnitude of actual arguments. |
| 505 | 505 | ||
| 506 | ;; @@@ Definition of subr argument lists: | ||
| 507 | ;; ====================================== | ||
| 508 | ;; When advice constructs the advised definition of a function it has to | ||
| 509 | ;; know the argument list of the original function. For functions and macros | ||
| 510 | ;; the argument list can be determined from the actual definition, however, | ||
| 511 | ;; for subrs there is no such direct access available. In Lemacs and for some | ||
| 512 | ;; subrs in Emacs-19 the argument list of a subr can be determined from | ||
| 513 | ;; its documentation string, in a v18 Emacs even that is not possible. If | ||
| 514 | ;; advice cannot at all determine the argument list of a subr it uses | ||
| 515 | ;; `(&rest ad-subr-args)' which will always work but is inefficient because | ||
| 516 | ;; it conses up arguments. The macro `ad-define-subr-args' can be used by | ||
| 517 | ;; the advice programmer to explicitly tell advice about the argument list | ||
| 518 | ;; of a certain subr, for example, | ||
| 519 | ;; | ||
| 520 | ;; (ad-define-subr-args 'fset '(sym newdef)) | ||
| 521 | ;; | ||
| 522 | ;; is used by advice itself to tell a v18 Emacs about the arguments of `fset'. | ||
| 523 | ;; The following can be used to undo such a definition: | ||
| 524 | ;; | ||
| 525 | ;; (ad-undefine-subr-args 'fset) | ||
| 526 | ;; | ||
| 527 | ;; The argument list definition is stored on the property list of the subr | ||
| 528 | ;; name symbol. When an argument list could be determined from the | ||
| 529 | ;; documentation string it will be cached under that property. The general | ||
| 530 | ;; mechanism for looking up the argument list of a subr is the following: | ||
| 531 | ;; 1) look for a definition stored on the property list | ||
| 532 | ;; 2) if that failed try to infer it from the documentation string and | ||
| 533 | ;; if successful cache it on the property list | ||
| 534 | ;; 3) otherwise use `(&rest ad-subr-args)' | ||
| 535 | |||
| 536 | ;; @@ Activation and deactivation: | 506 | ;; @@ Activation and deactivation: |
| 537 | ;; =============================== | 507 | ;; =============================== |
| 538 | ;; The definition of an advised function does not change until all its advice | 508 | ;; The definition of an advised function does not change until all its advice |
| @@ -1654,41 +1624,6 @@ | |||
| 1654 | ;; (fii 3 2) | 1624 | ;; (fii 3 2) |
| 1655 | ;; 5 | 1625 | ;; 5 |
| 1656 | ;; | 1626 | ;; |
| 1657 | ;; @@ Specifying argument lists of subrs: | ||
| 1658 | ;; ====================================== | ||
| 1659 | ;; The argument lists of subrs cannot be determined directly from Lisp. | ||
| 1660 | ;; This means that Advice has to use `(&rest ad-subr-args)' as the | ||
| 1661 | ;; argument list of the advised subr which is not very efficient. In Lemacs | ||
| 1662 | ;; subr argument lists can be determined from their documentation string, in | ||
| 1663 | ;; Emacs-19 this is the case for some but not all subrs. To accommodate | ||
| 1664 | ;; for the cases where the argument lists cannot be determined (e.g., in a | ||
| 1665 | ;; v18 Emacs) Advice comes with a specification mechanism that allows the | ||
| 1666 | ;; advice programmer to tell advice what the argument list of a certain subr | ||
| 1667 | ;; really is. | ||
| 1668 | ;; | ||
| 1669 | ;; In a v18 Emacs the following will return the &rest idiom: | ||
| 1670 | ;; | ||
| 1671 | ;; (ad-arglist (symbol-function 'car)) | ||
| 1672 | ;; (&rest ad-subr-args) | ||
| 1673 | ;; | ||
| 1674 | ;; To tell advice what the argument list of `car' really is we | ||
| 1675 | ;; can do the following: | ||
| 1676 | ;; | ||
| 1677 | ;; (ad-define-subr-args 'car '(list)) | ||
| 1678 | ;; ((list)) | ||
| 1679 | ;; | ||
| 1680 | ;; Now `ad-arglist' will return the proper argument list (this method is | ||
| 1681 | ;; actually used by advice itself for the advised definition of `fset'): | ||
| 1682 | ;; | ||
| 1683 | ;; (ad-arglist (symbol-function 'car)) | ||
| 1684 | ;; (list) | ||
| 1685 | ;; | ||
| 1686 | ;; The defined argument list will be stored on the property list of the | ||
| 1687 | ;; subr name symbol. When advice looks for a subr argument list it first | ||
| 1688 | ;; checks for a definition on the property list, if that fails it tries | ||
| 1689 | ;; to infer it from the documentation string and caches it on the property | ||
| 1690 | ;; list if it was successful, otherwise `(&rest ad-subr-args)' will be used. | ||
| 1691 | ;; | ||
| 1692 | ;; @@ Advising interactive subrs: | 1627 | ;; @@ Advising interactive subrs: |
| 1693 | ;; ============================== | 1628 | ;; ============================== |
| 1694 | ;; For the most part there is no difference between advising functions and | 1629 | ;; For the most part there is no difference between advising functions and |
| @@ -2536,52 +2471,11 @@ See Info node `(elisp)Computed Advice' for detailed documentation." | |||
| 2536 | If DEFINITION could be from a subr then its NAME should be | 2471 | If DEFINITION could be from a subr then its NAME should be |
| 2537 | supplied to make subr arglist lookup more efficient." | 2472 | supplied to make subr arglist lookup more efficient." |
| 2538 | (require 'help-fns) | 2473 | (require 'help-fns) |
| 2539 | (cond | 2474 | (help-function-arglist |
| 2540 | ((or (ad-macro-p definition) (ad-advice-p definition)) | 2475 | (if (or (ad-macro-p definition) (ad-advice-p definition)) |
| 2541 | (help-function-arglist (cdr definition))) | 2476 | (cdr definition) |
| 2542 | (t (help-function-arglist definition)))) | 2477 | definition) |
| 2543 | 2478 | 'preserve-names)) | |
| 2544 | ;; Store subr-args as `((arg1 arg2 ...))' so I can distinguish | ||
| 2545 | ;; a defined empty arglist `(nil)' from an undefined arglist: | ||
| 2546 | (defmacro ad-define-subr-args (subr arglist) | ||
| 2547 | `(put ,subr 'ad-subr-arglist (list ,arglist))) | ||
| 2548 | (defmacro ad-undefine-subr-args (subr) | ||
| 2549 | `(put ,subr 'ad-subr-arglist nil)) | ||
| 2550 | (defmacro ad-subr-args-defined-p (subr) | ||
| 2551 | `(get ,subr 'ad-subr-arglist)) | ||
| 2552 | (defmacro ad-get-subr-args (subr) | ||
| 2553 | `(car (get ,subr 'ad-subr-arglist))) | ||
| 2554 | |||
| 2555 | (defun ad-subr-arglist (subr-name) | ||
| 2556 | "Retrieve arglist of the subr with SUBR-NAME. | ||
| 2557 | Either use the one stored under the `ad-subr-arglist' property, | ||
| 2558 | or try to retrieve it from the docstring and cache it under | ||
| 2559 | that property, or otherwise use `(&rest ad-subr-args)'." | ||
| 2560 | (if (ad-subr-args-defined-p subr-name) | ||
| 2561 | (ad-get-subr-args subr-name) | ||
| 2562 | ;; says jwz: Should use this for Lemacs 19.8 and above: | ||
| 2563 | ;;((fboundp 'subr-min-args) | ||
| 2564 | ;; ...) | ||
| 2565 | ;; says hans: I guess what Jamie means is that I should use the values | ||
| 2566 | ;; of `subr-min-args' and `subr-max-args' to construct the subr arglist | ||
| 2567 | ;; without having to look it up via parsing the docstring, e.g., | ||
| 2568 | ;; values 1 and 2 would suggest `(arg1 &optional arg2)' as an | ||
| 2569 | ;; argument list. However, that won't work because there is no | ||
| 2570 | ;; way to distinguish a subr with args `(a &optional b &rest c)' from | ||
| 2571 | ;; one with args `(a &rest c)' using that mechanism. Also, the argument | ||
| 2572 | ;; names from the docstring are more meaningful. Hence, I'll stick with | ||
| 2573 | ;; the old way of doing things. | ||
| 2574 | (let ((doc (or (ad-real-documentation subr-name t) ""))) | ||
| 2575 | (if (not (string-match "\n\n\\((.+)\\)\\'" doc)) | ||
| 2576 | ;; Signalling an error leads to bugs during bootstrapping because | ||
| 2577 | ;; the DOC file is not yet built (which is an error, BTW). | ||
| 2578 | ;; (error "The usage info is missing from the subr %s" subr-name) | ||
| 2579 | '(&rest ad-subr-args) | ||
| 2580 | (ad-define-subr-args | ||
| 2581 | subr-name | ||
| 2582 | (cdr (car (read-from-string | ||
| 2583 | (downcase (match-string 1 doc)))))) | ||
| 2584 | (ad-get-subr-args subr-name))))) | ||
| 2585 | 2479 | ||
| 2586 | (defun ad-docstring (definition) | 2480 | (defun ad-docstring (definition) |
| 2587 | "Return the unexpanded docstring of DEFINITION." | 2481 | "Return the unexpanded docstring of DEFINITION." |
| @@ -2629,17 +2523,16 @@ definition (see the code for `documentation')." | |||
| 2629 | 2523 | ||
| 2630 | (defun ad-definition-type (definition) | 2524 | (defun ad-definition-type (definition) |
| 2631 | "Return symbol that describes the type of DEFINITION." | 2525 | "Return symbol that describes the type of DEFINITION." |
| 2632 | (if (ad-macro-p definition) | 2526 | (cond |
| 2633 | 'macro | 2527 | ((ad-macro-p definition) 'macro) |
| 2634 | (if (ad-subr-p definition) | 2528 | ((ad-subr-p definition) |
| 2635 | (if (ad-special-form-p definition) | 2529 | (if (ad-special-form-p definition) |
| 2636 | 'special-form | 2530 | 'special-form |
| 2637 | 'subr) | 2531 | 'subr)) |
| 2638 | (if (or (ad-lambda-p definition) | 2532 | ((or (ad-lambda-p definition) |
| 2639 | (ad-compiled-p definition)) | 2533 | (ad-compiled-p definition)) |
| 2640 | 'function | 2534 | 'function) |
| 2641 | (if (ad-advice-p definition) | 2535 | ((ad-advice-p definition) 'advice))) |
| 2642 | 'advice))))) | ||
| 2643 | 2536 | ||
| 2644 | (defun ad-has-proper-definition (function) | 2537 | (defun ad-has-proper-definition (function) |
| 2645 | "True if FUNCTION is a symbol with a proper definition. | 2538 | "True if FUNCTION is a symbol with a proper definition. |
| @@ -3921,10 +3814,6 @@ undone on exit of this macro." | |||
| 3921 | ;; Use the advice mechanism to advise `documentation' to make it | 3814 | ;; Use the advice mechanism to advise `documentation' to make it |
| 3922 | ;; generate proper documentation strings for advised definitions: | 3815 | ;; generate proper documentation strings for advised definitions: |
| 3923 | 3816 | ||
| 3924 | ;; This makes sure we get the right arglist for `documentation' | ||
| 3925 | ;; during bootstrapping. | ||
| 3926 | (ad-define-subr-args 'documentation '(function &optional raw)) | ||
| 3927 | |||
| 3928 | ;; @@ Starting, stopping and recovering from the advice package magic: | 3817 | ;; @@ Starting, stopping and recovering from the advice package magic: |
| 3929 | ;; =================================================================== | 3818 | ;; =================================================================== |
| 3930 | 3819 | ||
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index baabe5f65b9..cc5156610be 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,52 @@ | |||
| 1 | 2011-04-14 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * gnus-registry.el: Updated gnus-registry docs. | ||
| 4 | |||
| 5 | 2011-04-12 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 6 | |||
| 7 | * gnus-registry.el (gnus-registry--split-fancy-with-parent-internal): | ||
| 8 | Fix logic bug. | ||
| 9 | (gnus-registry-post-process-groups): Fix logging of no results and | ||
| 10 | quote sender and subject. | ||
| 11 | |||
| 12 | 2011-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 13 | |||
| 14 | * gnus-start.el (gnus-get-unread-articles): Slight cleanup. | ||
| 15 | (gnus-read-active-for-groups): Don't try to finish getting stuff where | ||
| 16 | we had no early-data returned. | ||
| 17 | (gnus-get-unread-articles): Add a sanity check so that we don't issue | ||
| 18 | two async commands to the same server at the same time. | ||
| 19 | |||
| 20 | 2011-04-12 Stig Sandbeck Mathisen <ssm@fnord.no> (tiny change) | ||
| 21 | |||
| 22 | * gnus-sum.el (gnus-summary-select-article-buffer): Doc fix. | ||
| 23 | |||
| 24 | 2011-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 25 | |||
| 26 | * gnus-registry.el (gnus-registry-remake-db): Put the warning on a | ||
| 27 | "warning" level. | ||
| 28 | |||
| 29 | * mm-url.el (mm-url-package-name): Removed to ease third-party reuse. | ||
| 30 | (mm-url-insert-file-contents): Don't set the package names. | ||
| 31 | |||
| 32 | 2011-04-11 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 33 | |||
| 34 | * gnus-registry.el (gnus-registry-action): Remove properties and | ||
| 35 | simplify subject in `gnus-registry-handle-action'. | ||
| 36 | (gnus-registry-spool-action): Get subject and sender from message if | ||
| 37 | they are not passed in. | ||
| 38 | (gnus-registry-handle-action): Remove properties and simplify subject | ||
| 39 | consistently. | ||
| 40 | |||
| 41 | 2011-04-11 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 42 | |||
| 43 | * registry.el: Require CL before using defmacro*. | ||
| 44 | |||
| 45 | 2011-04-11 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 46 | |||
| 47 | * gnus-art.el (article-treat-date): Assume that | ||
| 48 | gnus-article-date-headers may be a group parameter. | ||
| 49 | |||
| 1 | 2011-04-07 Teodor Zlatanov <tzz@lifelogs.com> | 50 | 2011-04-07 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 51 | ||
| 3 | * gnus-registry.el (gnus-registry-handle-action): More debugging. | 52 | * gnus-registry.el (gnus-registry-handle-action): More debugging. |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 97677988f0a..e03c787d995 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -3407,7 +3407,11 @@ lines forward." | |||
| 3407 | (setq ended t))))) | 3407 | (setq ended t))))) |
| 3408 | 3408 | ||
| 3409 | (defun article-treat-date () | 3409 | (defun article-treat-date () |
| 3410 | (article-date-ut gnus-article-date-headers t)) | 3410 | (article-date-ut (if (gnus-buffer-live-p gnus-summary-buffer) |
| 3411 | (with-current-buffer gnus-summary-buffer | ||
| 3412 | gnus-article-date-headers) | ||
| 3413 | gnus-article-date-headers) | ||
| 3414 | t)) | ||
| 3411 | 3415 | ||
| 3412 | (defun article-date-ut (&optional type highlight date-position) | 3416 | (defun article-date-ut (&optional type highlight date-position) |
| 3413 | "Convert DATE date to TYPE in the current article. | 3417 | "Convert DATE date to TYPE in the current article. |
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 9824fc26f16..9f95ce756ab 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -33,9 +33,10 @@ | |||
| 33 | ;; you, submit a bug report and I'll be glad to fix it. It needs | 33 | ;; you, submit a bug report and I'll be glad to fix it. It needs |
| 34 | ;; documentation in the manual (also on my to-do list). | 34 | ;; documentation in the manual (also on my to-do list). |
| 35 | 35 | ||
| 36 | ;; Put this in your startup file (~/.gnus.el for instance) | 36 | ;; Put this in your startup file (~/.gnus.el for instance) or use Customize: |
| 37 | 37 | ||
| 38 | ;; (setq gnus-registry-max-entries 2500) | 38 | ;; (setq gnus-registry-max-entries 2500 |
| 39 | ;; gnus-registry-track-extra '(sender subject)) | ||
| 39 | 40 | ||
| 40 | ;; (gnus-registry-initialize) | 41 | ;; (gnus-registry-initialize) |
| 41 | 42 | ||
| @@ -258,7 +259,7 @@ the Bit Bucket." | |||
| 258 | This is not required after changing `gnus-registry-cache-file'." | 259 | This is not required after changing `gnus-registry-cache-file'." |
| 259 | (interactive (list (y-or-n-p "Remake and CLEAR the Gnus registry? "))) | 260 | (interactive (list (y-or-n-p "Remake and CLEAR the Gnus registry? "))) |
| 260 | (when forsure | 261 | (when forsure |
| 261 | (gnus-message 1 "Remaking the Gnus registry") | 262 | (gnus-message 4 "Remaking the Gnus registry") |
| 262 | (setq gnus-registry-db (gnus-registry-make-db)))) | 263 | (setq gnus-registry-db (gnus-registry-make-db)))) |
| 263 | 264 | ||
| 264 | (defun gnus-registry-read () | 265 | (defun gnus-registry-read () |
| @@ -294,11 +295,8 @@ This is not required after changing `gnus-registry-cache-file'." | |||
| 294 | ;; article move/copy/spool/delete actions | 295 | ;; article move/copy/spool/delete actions |
| 295 | (defun gnus-registry-action (action data-header from &optional to method) | 296 | (defun gnus-registry-action (action data-header from &optional to method) |
| 296 | (let* ((id (mail-header-id data-header)) | 297 | (let* ((id (mail-header-id data-header)) |
| 297 | (subject (gnus-string-remove-all-properties | 298 | (subject (mail-header-subject data-header)) |
| 298 | (gnus-registry-simplify-subject | 299 | (sender (mail-header-from data-header)) |
| 299 | (mail-header-subject data-header)))) | ||
| 300 | (sender (gnus-string-remove-all-properties | ||
| 301 | (mail-header-from data-header))) | ||
| 302 | (from (gnus-group-guess-full-name-from-command-method from)) | 300 | (from (gnus-group-guess-full-name-from-command-method from)) |
| 303 | (to (if to (gnus-group-guess-full-name-from-command-method to) nil)) | 301 | (to (if to (gnus-group-guess-full-name-from-command-method to) nil)) |
| 304 | (to-name (if to to "the Bit Bucket"))) | 302 | (to-name (if to to "the Bit Bucket"))) |
| @@ -312,7 +310,9 @@ This is not required after changing `gnus-registry-cache-file'." | |||
| 312 | to subject sender))) | 310 | to subject sender))) |
| 313 | 311 | ||
| 314 | (defun gnus-registry-spool-action (id group &optional subject sender) | 312 | (defun gnus-registry-spool-action (id group &optional subject sender) |
| 315 | (let ((to (gnus-group-guess-full-name-from-command-method group))) | 313 | (let ((to (gnus-group-guess-full-name-from-command-method group)) |
| 314 | (subject (or subject (message-fetch-field "subject"))) | ||
| 315 | (sender (or sender (message-fetch-field "from")))) | ||
| 316 | (when (and (stringp id) (string-match "\r$" id)) | 316 | (when (and (stringp id) (string-match "\r$" id)) |
| 317 | (setq id (substring id 0 -1))) | 317 | (setq id (substring id 0 -1))) |
| 318 | (gnus-message 7 "Gnus registry: article %s spooled to %s" | 318 | (gnus-message 7 "Gnus registry: article %s spooled to %s" |
| @@ -326,7 +326,10 @@ This is not required after changing `gnus-registry-cache-file'." | |||
| 326 | "gnus-registry-handle-action %S" (list id from to subject sender)) | 326 | "gnus-registry-handle-action %S" (list id from to subject sender)) |
| 327 | (let ((db gnus-registry-db) | 327 | (let ((db gnus-registry-db) |
| 328 | ;; safe if not found | 328 | ;; safe if not found |
| 329 | (entry (gnus-registry-get-or-make-entry id))) | 329 | (entry (gnus-registry-get-or-make-entry id)) |
| 330 | (subject (gnus-string-remove-all-properties | ||
| 331 | (gnus-registry-simplify-subject subject))) | ||
| 332 | (sender (gnus-string-remove-all-properties sender))) | ||
| 330 | 333 | ||
| 331 | ;; this could be done by calling `gnus-registry-set-id-key' | 334 | ;; this could be done by calling `gnus-registry-set-id-key' |
| 332 | ;; several times but it's better to bunch the transactions | 335 | ;; several times but it's better to bunch the transactions |
| @@ -426,9 +429,9 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." | |||
| 426 | (when (and (null found) | 429 | (when (and (null found) |
| 427 | (memq 'sender gnus-registry-track-extra) | 430 | (memq 'sender gnus-registry-track-extra) |
| 428 | sender | 431 | sender |
| 429 | (gnus-grep-in-list | 432 | (not (gnus-grep-in-list |
| 430 | sender | 433 | sender |
| 431 | gnus-registry-unfollowed-addresses)) | 434 | gnus-registry-unfollowed-addresses))) |
| 432 | (let ((groups (apply | 435 | (let ((groups (apply |
| 433 | 'append | 436 | 'append |
| 434 | (mapcar | 437 | (mapcar |
| @@ -562,12 +565,12 @@ possible. Uses `gnus-registry-split-strategy'." | |||
| 562 | ((null out) | 565 | ((null out) |
| 563 | (gnus-message | 566 | (gnus-message |
| 564 | 5 | 567 | 5 |
| 565 | "%s: no matches for %s %s." | 568 | "%s: no matches for %s '%s'." |
| 566 | log-agent out mode key) | 569 | log-agent mode key) |
| 567 | nil) | 570 | nil) |
| 568 | (t (gnus-message | 571 | (t (gnus-message |
| 569 | 5 | 572 | 5 |
| 570 | "%s: too many extra matches (%s) for %s %s. Returning none." | 573 | "%s: too many extra matches (%s) for %s '%s'. Returning none." |
| 571 | log-agent out mode key) | 574 | log-agent out mode key) |
| 572 | nil)))) | 575 | nil)))) |
| 573 | 576 | ||
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index d9d218c6cba..e3b0089cea9 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -1699,33 +1699,43 @@ If SCAN, request a scan of that group as well." | |||
| 1699 | (gnus-read-active-file-1 method nil)))) | 1699 | (gnus-read-active-file-1 method nil)))) |
| 1700 | 1700 | ||
| 1701 | ;; Start early async retrieval of data. | 1701 | ;; Start early async retrieval of data. |
| 1702 | (dolist (elem type-cache) | 1702 | (let ((done-methods nil) |
| 1703 | (destructuring-bind (method method-type infos dummy) elem | 1703 | sanity-spec) |
| 1704 | (when (and method infos | 1704 | (dolist (elem type-cache) |
| 1705 | (not (gnus-method-denied-p method))) | 1705 | (destructuring-bind (method method-type infos dummy) elem |
| 1706 | ;; If the open-server method doesn't exist, then the method | 1706 | (setq sanity-spec (list (car method) (cadr method))) |
| 1707 | ;; itself doesn't exist, so we ignore it. | 1707 | (when (and method infos |
| 1708 | (if (not (ignore-errors (gnus-get-function method 'open-server))) | 1708 | (not (gnus-method-denied-p method))) |
| 1709 | (setq type-cache (delq elem type-cache)) | 1709 | ;; If the open-server method doesn't exist, then the method |
| 1710 | (unless (gnus-server-opened method) | 1710 | ;; itself doesn't exist, so we ignore it. |
| 1711 | (gnus-open-server method)) | 1711 | (if (not (ignore-errors (gnus-get-function method 'open-server))) |
| 1712 | (when (and | 1712 | (setq type-cache (delq elem type-cache)) |
| 1713 | (gnus-server-opened method) | 1713 | (unless (gnus-server-opened method) |
| 1714 | (gnus-check-backend-function | 1714 | (gnus-open-server method)) |
| 1715 | 'retrieve-group-data-early (car method))) | 1715 | (when (and |
| 1716 | (when (gnus-check-backend-function 'request-scan (car method)) | 1716 | ;; This is a sanity check, so that we never |
| 1717 | (gnus-request-scan nil method)) | 1717 | ;; attempt to start two async requests to the |
| 1718 | ;; Store the token we get back from -early so that we | 1718 | ;; same server, because that will fail. This |
| 1719 | ;; can pass it to -finish later. | 1719 | ;; should never happen, since the methods should |
| 1720 | (setcar (nthcdr 3 elem) | 1720 | ;; be unique at this point, but apparently it |
| 1721 | (gnus-retrieve-group-data-early method infos))))))) | 1721 | ;; does happen in the wild with some setups. |
| 1722 | (not (member sanity-spec done-methods)) | ||
| 1723 | (gnus-server-opened method) | ||
| 1724 | (gnus-check-backend-function | ||
| 1725 | 'retrieve-group-data-early (car method))) | ||
| 1726 | (push sanity-spec done-methods) | ||
| 1727 | (when (gnus-check-backend-function 'request-scan (car method)) | ||
| 1728 | (gnus-request-scan nil method)) | ||
| 1729 | ;; Store the token we get back from -early so that we | ||
| 1730 | ;; can pass it to -finish later. | ||
| 1731 | (setcar (nthcdr 3 elem) | ||
| 1732 | (gnus-retrieve-group-data-early method infos)))))))) | ||
| 1722 | 1733 | ||
| 1723 | ;; Do the rest of the retrieval. | 1734 | ;; Do the rest of the retrieval. |
| 1724 | (dolist (elem type-cache) | 1735 | (dolist (elem type-cache) |
| 1725 | (destructuring-bind (method method-type infos early-data) elem | 1736 | (destructuring-bind (method method-type infos early-data) elem |
| 1726 | (when (and method infos | 1737 | (when (and method infos |
| 1727 | (not (eq (gnus-server-status method) | 1738 | (not (gnus-method-denied-p method))) |
| 1728 | 'denied))) | ||
| 1729 | (let ((updatep (gnus-check-backend-function | 1739 | (let ((updatep (gnus-check-backend-function |
| 1730 | 'request-update-info (car method)))) | 1740 | 'request-update-info (car method)))) |
| 1731 | ;; See if any of the groups from this method require updating. | 1741 | ;; See if any of the groups from this method require updating. |
| @@ -1763,6 +1773,7 @@ If SCAN, request a scan of that group as well." | |||
| 1763 | ;; Finish up getting the data from the methods that have -early | 1773 | ;; Finish up getting the data from the methods that have -early |
| 1764 | ;; methods. | 1774 | ;; methods. |
| 1765 | ((and | 1775 | ((and |
| 1776 | early-data | ||
| 1766 | (gnus-check-backend-function 'finish-retrieve-group-infos (car method)) | 1777 | (gnus-check-backend-function 'finish-retrieve-group-infos (car method)) |
| 1767 | (or (not (gnus-agent-method-p method)) | 1778 | (or (not (gnus-agent-method-p method)) |
| 1768 | (gnus-online method))) | 1779 | (gnus-online method))) |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index e3ae1d7f528..d023bc5bb63 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -7035,7 +7035,7 @@ displayed, no centering will be performed." | |||
| 7035 | 7035 | ||
| 7036 | (defun gnus-summary-select-article-buffer () | 7036 | (defun gnus-summary-select-article-buffer () |
| 7037 | "Reconfigure windows to show the article buffer. | 7037 | "Reconfigure windows to show the article buffer. |
| 7038 | If `gnus-widen-article-buffer' is set, show only the article | 7038 | If `gnus-widen-article-window' is set, show only the article |
| 7039 | buffer." | 7039 | buffer." |
| 7040 | (interactive) | 7040 | (interactive) |
| 7041 | (if (not (gnus-buffer-live-p gnus-article-buffer)) | 7041 | (if (not (gnus-buffer-live-p gnus-article-buffer)) |
diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el index 498d0612519..2ce3791ef3d 100644 --- a/lisp/gnus/mm-url.el +++ b/lisp/gnus/mm-url.el | |||
| @@ -83,13 +83,6 @@ Likely values are `wget', `w3m', `lynx' and `curl'." | |||
| 83 | 83 | ||
| 84 | ;;; Internal variables | 84 | ;;; Internal variables |
| 85 | 85 | ||
| 86 | (defvar mm-url-package-name | ||
| 87 | (gnus-replace-in-string | ||
| 88 | (gnus-replace-in-string gnus-version " v.*$" "") | ||
| 89 | " " "-")) | ||
| 90 | |||
| 91 | (defvar mm-url-package-version gnus-version-number) | ||
| 92 | |||
| 93 | ;; Stolen from w3. | 86 | ;; Stolen from w3. |
| 94 | (defvar mm-url-html-entities | 87 | (defvar mm-url-html-entities |
| 95 | '( | 88 | '( |
| @@ -298,10 +291,6 @@ If `mm-url-use-external' is non-nil, use `mm-url-program'." | |||
| 298 | (if (not (and (boundp 'url-version) | 291 | (if (not (and (boundp 'url-version) |
| 299 | (equal url-version "Emacs"))) | 292 | (equal url-version "Emacs"))) |
| 300 | (list (cons "Connection" "Close")))) | 293 | (list (cons "Connection" "Close")))) |
| 301 | (url-package-name (or mm-url-package-name | ||
| 302 | url-package-name)) | ||
| 303 | (url-package-version (or mm-url-package-version | ||
| 304 | url-package-version)) | ||
| 305 | result) | 294 | result) |
| 306 | (setq result (url-insert-file-contents url)) | 295 | (setq result (url-insert-file-contents url)) |
| 307 | (save-excursion | 296 | (save-excursion |
diff --git a/lisp/gnus/registry.el b/lisp/gnus/registry.el index 3c402cb361a..23e75815979 100644 --- a/lisp/gnus/registry.el +++ b/lisp/gnus/registry.el | |||
| @@ -77,14 +77,14 @@ | |||
| 77 | 77 | ||
| 78 | ;;; Code: | 78 | ;;; Code: |
| 79 | 79 | ||
| 80 | (eval-when-compile (require 'cl)) | ||
| 81 | |||
| 80 | (eval-when-compile | 82 | (eval-when-compile |
| 81 | (when (null (ignore-errors (require 'ert))) | 83 | (when (null (ignore-errors (require 'ert))) |
| 82 | (defmacro* ert-deftest (name () &body docstring-keys-and-body)))) | 84 | (defmacro* ert-deftest (name () &body docstring-keys-and-body)))) |
| 83 | 85 | ||
| 84 | (ignore-errors | 86 | (ignore-errors |
| 85 | (require 'ert)) | 87 | (require 'ert)) |
| 86 | |||
| 87 | (eval-when-compile (require 'cl)) | ||
| 88 | (eval-and-compile | 88 | (eval-and-compile |
| 89 | (or (ignore-errors (progn | 89 | (or (ignore-errors (progn |
| 90 | (require 'eieio) | 90 | (require 'eieio) |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 206a9af3a90..97ce7ca44ef 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -99,46 +99,55 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." | |||
| 99 | (format "%S" (help-make-usage 'fn arglist)))))) | 99 | (format "%S" (help-make-usage 'fn arglist)))))) |
| 100 | 100 | ||
| 101 | ;; FIXME: Move to subr.el? | 101 | ;; FIXME: Move to subr.el? |
| 102 | (defun help-function-arglist (def) | 102 | (defun help-function-arglist (def &optional preserve-names) |
| 103 | "Return a formal argument list for the function DEF. | ||
| 104 | IF PRESERVE-NAMES is non-nil, return a formal arglist that uses | ||
| 105 | the same names as used in the original source code, when possible." | ||
| 103 | ;; Handle symbols aliased to other symbols. | 106 | ;; Handle symbols aliased to other symbols. |
| 104 | (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def))) | 107 | (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def))) |
| 105 | ;; If definition is a macro, find the function inside it. | 108 | ;; If definition is a macro, find the function inside it. |
| 106 | (if (eq (car-safe def) 'macro) (setq def (cdr def))) | 109 | (if (eq (car-safe def) 'macro) (setq def (cdr def))) |
| 107 | (cond | 110 | (cond |
| 108 | ((and (byte-code-function-p def) (integerp (aref def 0))) | 111 | ((and (byte-code-function-p def) (listp (aref def 0))) (aref def 0)) |
| 109 | (let* ((args-desc (aref def 0)) | ||
| 110 | (max (lsh args-desc -8)) | ||
| 111 | (min (logand args-desc 127)) | ||
| 112 | (rest (logand args-desc 128)) | ||
| 113 | (arglist ())) | ||
| 114 | (dotimes (i min) | ||
| 115 | (push (intern (concat "arg" (number-to-string (1+ i)))) arglist)) | ||
| 116 | (when (> max min) | ||
| 117 | (push '&optional arglist) | ||
| 118 | (dotimes (i (- max min)) | ||
| 119 | (push (intern (concat "arg" (number-to-string (+ 1 i min)))) | ||
| 120 | arglist))) | ||
| 121 | (unless (zerop rest) (push '&rest arglist) (push 'rest arglist)) | ||
| 122 | (nreverse arglist))) | ||
| 123 | ((byte-code-function-p def) (aref def 0)) | ||
| 124 | ((eq (car-safe def) 'lambda) (nth 1 def)) | 112 | ((eq (car-safe def) 'lambda) (nth 1 def)) |
| 125 | ((eq (car-safe def) 'closure) (nth 2 def)) | 113 | ((eq (car-safe def) 'closure) (nth 2 def)) |
| 126 | ((subrp def) | 114 | ((or (and (byte-code-function-p def) (integerp (aref def 0))) |
| 127 | (let ((arity (subr-arity def)) | 115 | (subrp def)) |
| 128 | (arglist ())) | 116 | (or (when preserve-names |
| 129 | (dotimes (i (car arity)) | 117 | (let* ((doc (condition-case nil (documentation def) (error nil))) |
| 130 | (push (intern (concat "arg" (number-to-string (1+ i)))) arglist)) | 118 | (docargs (if doc (car (help-split-fundoc doc nil)))) |
| 131 | (cond | 119 | (arglist (if docargs |
| 132 | ((not (numberp (cdr arglist))) | 120 | (cdar (read-from-string (downcase docargs))))) |
| 133 | (push '&rest arglist) | 121 | (valid t)) |
| 134 | (push 'rest arglist)) | 122 | ;; Check validity. |
| 135 | ((< (car arity) (cdr arity)) | 123 | (dolist (arg arglist) |
| 136 | (push '&optional arglist) | 124 | (unless (and (symbolp arg) |
| 137 | (dotimes (i (- (cdr arity) (car arity))) | 125 | (let ((name (symbol-name arg))) |
| 138 | (push (intern (concat "arg" (number-to-string | 126 | (if (eq (aref name 0) ?&) |
| 139 | (+ 1 i (car arity))))) | 127 | (memq arg '(&rest &optional)) |
| 140 | arglist)))) | 128 | (not (string-match "\\." name))))) |
| 141 | (nreverse arglist))) | 129 | (setq valid nil))) |
| 130 | (when valid arglist))) | ||
| 131 | (let* ((args-desc (if (not (subrp def)) | ||
| 132 | (aref def 0) | ||
| 133 | (let ((a (subr-arity def))) | ||
| 134 | (logior (car a) | ||
| 135 | (if (numberp (cdr a)) | ||
| 136 | (lsh (cdr a) 8) | ||
| 137 | (lsh 1 7)))))) | ||
| 138 | (max (lsh args-desc -8)) | ||
| 139 | (min (logand args-desc 127)) | ||
| 140 | (rest (logand args-desc 128)) | ||
| 141 | (arglist ())) | ||
| 142 | (dotimes (i min) | ||
| 143 | (push (intern (concat "arg" (number-to-string (1+ i)))) arglist)) | ||
| 144 | (when (> max min) | ||
| 145 | (push '&optional arglist) | ||
| 146 | (dotimes (i (- max min)) | ||
| 147 | (push (intern (concat "arg" (number-to-string (+ 1 i min)))) | ||
| 148 | arglist))) | ||
| 149 | (unless (zerop rest) (push '&rest arglist) (push 'rest arglist)) | ||
| 150 | (nreverse arglist)))) | ||
| 142 | ((and (eq (car-safe def) 'autoload) (not (eq (nth 4 def) 'keymap))) | 151 | ((and (eq (car-safe def) 'autoload) (not (eq (nth 4 def) 'keymap))) |
| 143 | "[Arg list not available until function definition is loaded.]") | 152 | "[Arg list not available until function definition is loaded.]") |
| 144 | (t t))) | 153 | (t t))) |
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 490b2b2ebfc..ab67fcfcdfd 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -179,8 +179,11 @@ otherwise turn it off." | |||
| 179 | (if icomplete-mode | 179 | (if icomplete-mode |
| 180 | ;; The following is not really necessary after first time - | 180 | ;; The following is not really necessary after first time - |
| 181 | ;; no great loss. | 181 | ;; no great loss. |
| 182 | (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup) | 182 | (progn |
| 183 | (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup))) | 183 | (setq completion-show-inline-help nil) |
| 184 | (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup)) | ||
| 185 | (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup) | ||
| 186 | (setq completion-show-inline-help t))) | ||
| 184 | 187 | ||
| 185 | ;;;_ > icomplete-simple-completing-p () | 188 | ;;;_ > icomplete-simple-completing-p () |
| 186 | (defun icomplete-simple-completing-p () | 189 | (defun icomplete-simple-completing-p () |
diff --git a/lisp/ido.el b/lisp/ido.el index 0ce83d9b88c..9606879ce70 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -2176,9 +2176,7 @@ If cursor is not at the end of the user input, move to end of input." | |||
| 2176 | (ido-current-directory nil) | 2176 | (ido-current-directory nil) |
| 2177 | (ido-directory-nonreadable nil) | 2177 | (ido-directory-nonreadable nil) |
| 2178 | (ido-directory-too-big nil) | 2178 | (ido-directory-too-big nil) |
| 2179 | (ido-use-virtual-buffers (if (eq method 'kill) | 2179 | (ido-use-virtual-buffers ido-use-virtual-buffers) |
| 2180 | nil ;; Don't consider virtual buffers for killing | ||
| 2181 | ido-use-virtual-buffers)) | ||
| 2182 | (require-match (confirm-nonexistent-file-or-buffer)) | 2180 | (require-match (confirm-nonexistent-file-or-buffer)) |
| 2183 | (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default | 2181 | (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default |
| 2184 | require-match initial)) | 2182 | require-match initial)) |
| @@ -3917,10 +3915,10 @@ If cursor is not at the end of the user input, delete to end of input." | |||
| 3917 | (let ((enable-recursive-minibuffers t) | 3915 | (let ((enable-recursive-minibuffers t) |
| 3918 | (buf (ido-name (car ido-matches))) | 3916 | (buf (ido-name (car ido-matches))) |
| 3919 | (nextbuf (cadr ido-matches))) | 3917 | (nextbuf (cadr ido-matches))) |
| 3920 | (when (get-buffer buf) | 3918 | (cond |
| 3919 | ((get-buffer buf) | ||
| 3921 | ;; If next match names a buffer use the buffer object; buffer | 3920 | ;; If next match names a buffer use the buffer object; buffer |
| 3922 | ;; name may be changed by packages such as uniquify; mindful | 3921 | ;; name may be changed by packages such as uniquify. |
| 3923 | ;; of virtual buffers. | ||
| 3924 | (when (and nextbuf (get-buffer nextbuf)) | 3922 | (when (and nextbuf (get-buffer nextbuf)) |
| 3925 | (setq nextbuf (get-buffer nextbuf))) | 3923 | (setq nextbuf (get-buffer nextbuf))) |
| 3926 | (if (null (kill-buffer buf)) | 3924 | (if (null (kill-buffer buf)) |
| @@ -3934,7 +3932,13 @@ If cursor is not at the end of the user input, delete to end of input." | |||
| 3934 | (setq ido-default-item nextbuf | 3932 | (setq ido-default-item nextbuf |
| 3935 | ido-text-init ido-text | 3933 | ido-text-init ido-text |
| 3936 | ido-exit 'refresh) | 3934 | ido-exit 'refresh) |
| 3937 | (exit-minibuffer)))))) | 3935 | (exit-minibuffer))) |
| 3936 | ;; Handle virtual buffers | ||
| 3937 | ((assoc buf ido-virtual-buffers) | ||
| 3938 | (setq recentf-list | ||
| 3939 | (delete (cdr (assoc buf ido-virtual-buffers)) recentf-list)) | ||
| 3940 | (setq ido-cur-list (delete buf ido-cur-list)) | ||
| 3941 | (setq ido-rescan t)))))) | ||
| 3938 | 3942 | ||
| 3939 | ;;; DELETE CURRENT FILE | 3943 | ;;; DELETE CURRENT FILE |
| 3940 | (defun ido-delete-file-at-head () | 3944 | (defun ido-delete-file-at-head () |
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 96d874dbec6..c99689f33ad 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -610,7 +610,7 @@ takes effect only if Emacs is compiled with ImageMagick support." | |||
| 610 | This command has no effect unless Emacs is compiled with | 610 | This command has no effect unless Emacs is compiled with |
| 611 | ImageMagick support." | 611 | ImageMagick support." |
| 612 | (interactive "nScale: ") | 612 | (interactive "nScale: ") |
| 613 | (setq image-transform-resize resize) | 613 | (setq image-transform-resize scale) |
| 614 | (image-toggle-display-image)) | 614 | (image-toggle-display-image)) |
| 615 | 615 | ||
| 616 | (defun image-transform-fit-to-height () | 616 | (defun image-transform-fit-to-height () |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 19084aad5d6..0d26d6bdcf6 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -58,6 +58,10 @@ | |||
| 58 | 58 | ||
| 59 | ;;; Todo: | 59 | ;;; Todo: |
| 60 | 60 | ||
| 61 | ;; - completion-insert-complete-hook (called after inserting a complete | ||
| 62 | ;; completion), typically used for "complete-abbrev" where it would expand | ||
| 63 | ;; the abbrev. Tho we'd probably want to provide it from the | ||
| 64 | ;; completion-table. | ||
| 61 | ;; - extend `boundaries' to provide various other meta-data about the | 65 | ;; - extend `boundaries' to provide various other meta-data about the |
| 62 | ;; output of `all-completions': | 66 | ;; output of `all-completions': |
| 63 | ;; - preferred sorting order when displayed in *Completions*. | 67 | ;; - preferred sorting order when displayed in *Completions*. |
| @@ -381,6 +385,9 @@ If the current buffer is not a minibuffer, erase its entire contents." | |||
| 381 | ;; is on, the field doesn't cover the entire minibuffer contents. | 385 | ;; is on, the field doesn't cover the entire minibuffer contents. |
| 382 | (delete-region (minibuffer-prompt-end) (point-max))) | 386 | (delete-region (minibuffer-prompt-end) (point-max))) |
| 383 | 387 | ||
| 388 | (defvar completion-show-inline-help t | ||
| 389 | "If non-nil, print helpful inline messages during completion.") | ||
| 390 | |||
| 384 | (defcustom completion-auto-help t | 391 | (defcustom completion-auto-help t |
| 385 | "Non-nil means automatically provide help for invalid completion input. | 392 | "Non-nil means automatically provide help for invalid completion input. |
| 386 | If the value is t the *Completion* buffer is displayed whenever completion | 393 | If the value is t the *Completion* buffer is displayed whenever completion |
| @@ -568,8 +575,9 @@ E = after completion we now have an Exact match. | |||
| 568 | (cond | 575 | (cond |
| 569 | ((null comp) | 576 | ((null comp) |
| 570 | (minibuffer-hide-completions) | 577 | (minibuffer-hide-completions) |
| 571 | (unless completion-fail-discreetly | 578 | (when (and (not completion-fail-discreetly) completion-show-inline-help) |
| 572 | (ding) (minibuffer-message "No match")) | 579 | (ding) |
| 580 | (minibuffer-message "No match")) | ||
| 573 | (minibuffer--bitset nil nil nil)) | 581 | (minibuffer--bitset nil nil nil)) |
| 574 | ((eq t comp) | 582 | ((eq t comp) |
| 575 | (minibuffer-hide-completions) | 583 | (minibuffer-hide-completions) |
| @@ -639,9 +647,10 @@ E = after completion we now have an Exact match. | |||
| 639 | (minibuffer-hide-completions)) | 647 | (minibuffer-hide-completions)) |
| 640 | ;; Show the completion table, if requested. | 648 | ;; Show the completion table, if requested. |
| 641 | ((not exact) | 649 | ((not exact) |
| 642 | (if (case completion-auto-help | 650 | (if (cond ((null completion-show-inline-help) t) |
| 643 | (lazy (eq this-command last-command)) | 651 | ((eq completion-auto-help 'lazy) |
| 644 | (t completion-auto-help)) | 652 | (eq this-command last-command)) |
| 653 | (t completion-auto-help)) | ||
| 645 | (minibuffer-completion-help) | 654 | (minibuffer-completion-help) |
| 646 | (minibuffer-message "Next char not unique"))) | 655 | (minibuffer-message "Next char not unique"))) |
| 647 | ;; If the last exact completion and this one were the same, it | 656 | ;; If the last exact completion and this one were the same, it |
| @@ -683,9 +692,11 @@ scroll the window of possible completions." | |||
| 683 | t) | 692 | t) |
| 684 | (t (case (completion--do-completion) | 693 | (t (case (completion--do-completion) |
| 685 | (#b000 nil) | 694 | (#b000 nil) |
| 686 | (#b001 (minibuffer-message "Sole completion") | 695 | (#b001 (if completion-show-inline-help |
| 696 | (minibuffer-message "Sole completion")) | ||
| 687 | t) | 697 | t) |
| 688 | (#b011 (minibuffer-message "Complete, but not unique") | 698 | (#b011 (if completion-show-inline-help |
| 699 | (minibuffer-message "Complete, but not unique")) | ||
| 689 | t) | 700 | t) |
| 690 | (t t))))) | 701 | (t t))))) |
| 691 | 702 | ||
| @@ -743,7 +754,9 @@ Repeated uses step through the possible completions." | |||
| 743 | (end (field-end)) | 754 | (end (field-end)) |
| 744 | (all (completion-all-sorted-completions))) | 755 | (all (completion-all-sorted-completions))) |
| 745 | (if (not (consp all)) | 756 | (if (not (consp all)) |
| 746 | (minibuffer-message (if all "No more completions" "No completions")) | 757 | (if completion-show-inline-help |
| 758 | (minibuffer-message | ||
| 759 | (if all "No more completions" "No completions"))) | ||
| 747 | (setq completion-cycling t) | 760 | (setq completion-cycling t) |
| 748 | (goto-char end) | 761 | (goto-char end) |
| 749 | (insert (car all)) | 762 | (insert (car all)) |
| @@ -931,9 +944,11 @@ Return nil if there is no valid completion, else t." | |||
| 931 | (interactive) | 944 | (interactive) |
| 932 | (case (completion--do-completion 'completion--try-word-completion) | 945 | (case (completion--do-completion 'completion--try-word-completion) |
| 933 | (#b000 nil) | 946 | (#b000 nil) |
| 934 | (#b001 (minibuffer-message "Sole completion") | 947 | (#b001 (if completion-show-inline-help |
| 948 | (minibuffer-message "Sole completion")) | ||
| 935 | t) | 949 | t) |
| 936 | (#b011 (minibuffer-message "Complete, but not unique") | 950 | (#b011 (if completion-show-inline-help |
| 951 | (minibuffer-message "Complete, but not unique")) | ||
| 937 | t) | 952 | t) |
| 938 | (t t))) | 953 | (t t))) |
| 939 | 954 | ||
| @@ -1243,12 +1258,22 @@ and PREDICATE, either by calling NEXT-FUN or by doing it themselves.") | |||
| 1243 | 1258 | ||
| 1244 | (defvar completion-in-region--data nil) | 1259 | (defvar completion-in-region--data nil) |
| 1245 | 1260 | ||
| 1261 | (defvar completion-in-region-mode-predicate nil | ||
| 1262 | "Predicate to tell `completion-in-region-mode' when to exit. | ||
| 1263 | It is called with no argument and should return nil when | ||
| 1264 | `completion-in-region-mode' should exit (and hence pop down | ||
| 1265 | the *Completions* buffer).") | ||
| 1266 | |||
| 1267 | (defvar completion-in-region-mode--predicate nil | ||
| 1268 | "Copy of the value of `completion-in-region-mode-predicate'. | ||
| 1269 | This holds the value `completion-in-region-mode-predicate' had when | ||
| 1270 | we entered `completion-in-region-mode'.") | ||
| 1271 | |||
| 1246 | (defun completion-in-region (start end collection &optional predicate) | 1272 | (defun completion-in-region (start end collection &optional predicate) |
| 1247 | "Complete the text between START and END using COLLECTION. | 1273 | "Complete the text between START and END using COLLECTION. |
| 1248 | Return nil if there is no valid completion, else t. | 1274 | Return nil if there is no valid completion, else t. |
| 1249 | Point needs to be somewhere between START and END." | 1275 | Point needs to be somewhere between START and END." |
| 1250 | (assert (<= start (point)) (<= (point) end)) | 1276 | (assert (<= start (point)) (<= (point) end)) |
| 1251 | ;; FIXME: undisplay the *Completions* buffer once the completion is done. | ||
| 1252 | (with-wrapper-hook | 1277 | (with-wrapper-hook |
| 1253 | ;; FIXME: Maybe we should use this hook to provide a "display | 1278 | ;; FIXME: Maybe we should use this hook to provide a "display |
| 1254 | ;; completions" operation as well. | 1279 | ;; completions" operation as well. |
| @@ -1257,9 +1282,10 @@ Point needs to be somewhere between START and END." | |||
| 1257 | (minibuffer-completion-predicate predicate) | 1282 | (minibuffer-completion-predicate predicate) |
| 1258 | (ol (make-overlay start end nil nil t))) | 1283 | (ol (make-overlay start end nil nil t))) |
| 1259 | (overlay-put ol 'field 'completion) | 1284 | (overlay-put ol 'field 'completion) |
| 1260 | (completion-in-region-mode 1) | 1285 | (when completion-in-region-mode-predicate |
| 1261 | (setq completion-in-region--data | 1286 | (completion-in-region-mode 1) |
| 1262 | (list (current-buffer) start end collection)) | 1287 | (setq completion-in-region--data |
| 1288 | (list (current-buffer) start end collection))) | ||
| 1263 | (unwind-protect | 1289 | (unwind-protect |
| 1264 | (call-interactively 'minibuffer-complete) | 1290 | (call-interactively 'minibuffer-complete) |
| 1265 | (delete-overlay ol))))) | 1291 | (delete-overlay ol))))) |
| @@ -1288,13 +1314,8 @@ Point needs to be somewhere between START and END." | |||
| 1288 | (save-excursion | 1314 | (save-excursion |
| 1289 | (goto-char (nth 2 completion-in-region--data)) | 1315 | (goto-char (nth 2 completion-in-region--data)) |
| 1290 | (line-end-position))) | 1316 | (line-end-position))) |
| 1291 | (let ((comp-data (run-hook-wrapped | 1317 | (when completion-in-region-mode--predicate |
| 1292 | 'completion-at-point-functions | 1318 | (funcall completion-in-region-mode--predicate)))) |
| 1293 | ;; Only use the known-safe functions. | ||
| 1294 | #'completion--capf-wrapper 'safe))) | ||
| 1295 | (eq (car comp-data) | ||
| 1296 | ;; We're still in the same completion field. | ||
| 1297 | (nth 1 completion-in-region--data))))) | ||
| 1298 | (completion-in-region-mode -1))) | 1319 | (completion-in-region-mode -1))) |
| 1299 | 1320 | ||
| 1300 | ;; (defalias 'completion-in-region--prech 'completion-in-region--postch) | 1321 | ;; (defalias 'completion-in-region--prech 'completion-in-region--postch) |
| @@ -1309,9 +1330,12 @@ Point needs to be somewhere between START and END." | |||
| 1309 | (delq (assq 'completion-in-region-mode minor-mode-overriding-map-alist) | 1330 | (delq (assq 'completion-in-region-mode minor-mode-overriding-map-alist) |
| 1310 | minor-mode-overriding-map-alist)) | 1331 | minor-mode-overriding-map-alist)) |
| 1311 | (if (null completion-in-region-mode) | 1332 | (if (null completion-in-region-mode) |
| 1312 | (unless (equal "*Completions*" (buffer-name (window-buffer))) | 1333 | (unless (or (equal "*Completions*" (buffer-name (window-buffer))) |
| 1334 | (null completion-in-region-mode--predicate)) | ||
| 1313 | (minibuffer-hide-completions)) | 1335 | (minibuffer-hide-completions)) |
| 1314 | ;; (add-hook 'pre-command-hook #'completion-in-region--prech) | 1336 | ;; (add-hook 'pre-command-hook #'completion-in-region--prech) |
| 1337 | (set (make-local-variable 'completion-in-region-mode--predicate) | ||
| 1338 | completion-in-region-mode-predicate) | ||
| 1315 | (add-hook 'post-command-hook #'completion-in-region--postch) | 1339 | (add-hook 'post-command-hook #'completion-in-region--postch) |
| 1316 | (push `(completion-in-region-mode . ,completion-in-region-mode-map) | 1340 | (push `(completion-in-region-mode . ,completion-in-region-mode-map) |
| 1317 | minor-mode-overriding-map-alist))) | 1341 | minor-mode-overriding-map-alist))) |
| @@ -1355,7 +1379,7 @@ Currently supported properties are: | |||
| 1355 | (message | 1379 | (message |
| 1356 | "Completion function %S uses a deprecated calling convention" fun) | 1380 | "Completion function %S uses a deprecated calling convention" fun) |
| 1357 | (push fun completion--capf-misbehave-funs)))) | 1381 | (push fun completion--capf-misbehave-funs)))) |
| 1358 | res))) | 1382 | (if res (cons fun res))))) |
| 1359 | 1383 | ||
| 1360 | (defun completion-at-point () | 1384 | (defun completion-at-point () |
| 1361 | "Perform completion on the text around point. | 1385 | "Perform completion on the text around point. |
| @@ -1363,18 +1387,20 @@ The completion method is determined by `completion-at-point-functions'." | |||
| 1363 | (interactive) | 1387 | (interactive) |
| 1364 | (let ((res (run-hook-wrapped 'completion-at-point-functions | 1388 | (let ((res (run-hook-wrapped 'completion-at-point-functions |
| 1365 | #'completion--capf-wrapper 'all))) | 1389 | #'completion--capf-wrapper 'all))) |
| 1366 | (cond | 1390 | (pcase res |
| 1367 | ((functionp res) (funcall res)) | 1391 | (`(,_ . ,(and (pred functionp) f)) (funcall f)) |
| 1368 | ((consp res) | 1392 | (`(,hookfun . (,start ,end ,collection . ,plist)) |
| 1369 | (let* ((plist (nthcdr 3 res)) | 1393 | (let* ((completion-annotate-function |
| 1370 | (start (nth 0 res)) | ||
| 1371 | (end (nth 1 res)) | ||
| 1372 | (completion-annotate-function | ||
| 1373 | (or (plist-get plist :annotation-function) | 1394 | (or (plist-get plist :annotation-function) |
| 1374 | completion-annotate-function))) | 1395 | completion-annotate-function)) |
| 1375 | (completion-in-region start end (nth 2 res) | 1396 | (completion-in-region-mode-predicate |
| 1397 | (lambda () | ||
| 1398 | ;; We're still in the same completion field. | ||
| 1399 | (eq (car (funcall hookfun)) start)))) | ||
| 1400 | (completion-in-region start end collection | ||
| 1376 | (plist-get plist :predicate)))) | 1401 | (plist-get plist :predicate)))) |
| 1377 | (res)))) ;Maybe completion already happened and the function returned t. | 1402 | ;; Maybe completion already happened and the function returned t. |
| 1403 | (_ (cdr res))))) | ||
| 1378 | 1404 | ||
| 1379 | (defun completion-help-at-point () | 1405 | (defun completion-help-at-point () |
| 1380 | "Display the completions on the text around point. | 1406 | "Display the completions on the text around point. |
| @@ -1383,29 +1409,36 @@ The completion method is determined by `completion-at-point-functions'." | |||
| 1383 | (let ((res (run-hook-wrapped 'completion-at-point-functions | 1409 | (let ((res (run-hook-wrapped 'completion-at-point-functions |
| 1384 | ;; Ignore misbehaving functions. | 1410 | ;; Ignore misbehaving functions. |
| 1385 | #'completion--capf-wrapper 'optimist))) | 1411 | #'completion--capf-wrapper 'optimist))) |
| 1386 | (cond | 1412 | (pcase res |
| 1387 | ((functionp res) | 1413 | (`(,_ . ,(and (pred functionp) f)) |
| 1388 | (message "Don't know how to show completions for %S" res)) | 1414 | (message "Don't know how to show completions for %S" f)) |
| 1389 | ((consp res) | 1415 | (`(,hookfun . (,start ,end ,collection . ,plist)) |
| 1390 | (let* ((plist (nthcdr 3 res)) | 1416 | (let* ((minibuffer-completion-table collection) |
| 1391 | (minibuffer-completion-table (nth 2 res)) | ||
| 1392 | (minibuffer-completion-predicate (plist-get plist :predicate)) | 1417 | (minibuffer-completion-predicate (plist-get plist :predicate)) |
| 1393 | (completion-annotate-function | 1418 | (completion-annotate-function |
| 1394 | (or (plist-get plist :annotation-function) | 1419 | (or (plist-get plist :annotation-function) |
| 1395 | completion-annotate-function)) | 1420 | completion-annotate-function)) |
| 1396 | (ol (make-overlay (nth 0 res) (nth 1 res) nil nil t))) | 1421 | (completion-in-region-mode-predicate |
| 1422 | (lambda () | ||
| 1423 | ;; We're still in the same completion field. | ||
| 1424 | (eq (car (funcall hookfun)) start))) | ||
| 1425 | (ol (make-overlay start end nil nil t))) | ||
| 1397 | ;; FIXME: We should somehow (ab)use completion-in-region-function or | 1426 | ;; FIXME: We should somehow (ab)use completion-in-region-function or |
| 1398 | ;; introduce a corresponding hook (plus another for word-completion, | 1427 | ;; introduce a corresponding hook (plus another for word-completion, |
| 1399 | ;; and another for force-completion, maybe?). | 1428 | ;; and another for force-completion, maybe?). |
| 1400 | (overlay-put ol 'field 'completion) | 1429 | (overlay-put ol 'field 'completion) |
| 1430 | (completion-in-region-mode 1) | ||
| 1431 | (setq completion-in-region--data | ||
| 1432 | (list (current-buffer) start end collection)) | ||
| 1401 | (unwind-protect | 1433 | (unwind-protect |
| 1402 | (call-interactively 'minibuffer-completion-help) | 1434 | (call-interactively 'minibuffer-completion-help) |
| 1403 | (delete-overlay ol)))) | 1435 | (delete-overlay ol)))) |
| 1404 | (res | 1436 | (`(,hookfun . ,_) |
| 1405 | ;; The hook function already performed completion :-( | 1437 | ;; The hook function already performed completion :-( |
| 1406 | ;; Not much we can do at this point. | 1438 | ;; Not much we can do at this point. |
| 1439 | (message "%s already performed completion!" hookfun) | ||
| 1407 | nil) | 1440 | nil) |
| 1408 | (t (message "Nothing to complete at point"))))) | 1441 | (_ (message "Nothing to complete at point"))))) |
| 1409 | 1442 | ||
| 1410 | ;;; Key bindings. | 1443 | ;;; Key bindings. |
| 1411 | 1444 | ||
diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 070cd2641db..67bb7eae68e 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el | |||
| @@ -171,9 +171,11 @@ values: | |||
| 171 | (resulting-type 'plain) | 171 | (resulting-type 'plain) |
| 172 | starttls-command) | 172 | starttls-command) |
| 173 | 173 | ||
| 174 | ;; If we have STARTTLS support, try to upgrade the connection. | 174 | ;; If we have built-in STARTTLS support, try to upgrade the |
| 175 | ;; connection. | ||
| 175 | (when (and (or (fboundp 'open-gnutls-stream) | 176 | (when (and (or (fboundp 'open-gnutls-stream) |
| 176 | (executable-find "gnutls-cli")) | 177 | (and require-tls |
| 178 | (executable-find "gnutls-cli"))) | ||
| 177 | capabilities success-string starttls-function | 179 | capabilities success-string starttls-function |
| 178 | (setq starttls-command | 180 | (setq starttls-command |
| 179 | (funcall starttls-function capabilities))) | 181 | (funcall starttls-function capabilities))) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index ec5c46b2897..cb4aca12edb 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -1145,13 +1145,15 @@ target of the symlink differ." | |||
| 1145 | (save-excursion | 1145 | (save-excursion |
| 1146 | (tramp-convert-file-attributes | 1146 | (tramp-convert-file-attributes |
| 1147 | v | 1147 | v |
| 1148 | (cond | 1148 | (or |
| 1149 | ((tramp-get-remote-stat v) | 1149 | (cond |
| 1150 | (tramp-do-file-attributes-with-stat v localname id-format)) | 1150 | ((tramp-get-remote-stat v) |
| 1151 | ((tramp-get-remote-perl v) | 1151 | (tramp-do-file-attributes-with-stat v localname id-format)) |
| 1152 | (tramp-do-file-attributes-with-perl v localname id-format)) | 1152 | ((tramp-get-remote-perl v) |
| 1153 | (t | 1153 | (tramp-do-file-attributes-with-perl v localname id-format)) |
| 1154 | (tramp-do-file-attributes-with-ls v localname id-format))))))))) | 1154 | (t nil)) |
| 1155 | ;; The scripts could fail, for example with huge file size. | ||
| 1156 | (tramp-do-file-attributes-with-ls v localname id-format)))))))) | ||
| 1155 | 1157 | ||
| 1156 | (defun tramp-do-file-attributes-with-ls (vec localname &optional id-format) | 1158 | (defun tramp-do-file-attributes-with-ls (vec localname &optional id-format) |
| 1157 | "Implement `file-attributes' for Tramp files using the ls(1) command." | 1159 | "Implement `file-attributes' for Tramp files using the ls(1) command." |
| @@ -2296,10 +2298,9 @@ The method used must be an out-of-band method." | |||
| 2296 | (tramp-get-method-parameter method 'tramp-copy-env)))) | 2298 | (tramp-get-method-parameter method 'tramp-copy-env)))) |
| 2297 | 2299 | ||
| 2298 | ;; Check for program. | 2300 | ;; Check for program. |
| 2299 | (when (and (fboundp 'executable-find) | 2301 | (unless (let ((default-directory |
| 2300 | (not (let ((default-directory | 2302 | (tramp-compat-temporary-file-directory))) |
| 2301 | (tramp-compat-temporary-file-directory))) | 2303 | (executable-find copy-program)) |
| 2302 | (executable-find copy-program)))) | ||
| 2303 | (tramp-error | 2304 | (tramp-error |
| 2304 | v 'file-error "Cannot find copy program: %s" copy-program)) | 2305 | v 'file-error "Cannot find copy program: %s" copy-program)) |
| 2305 | 2306 | ||
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 7e1b0f5b8e9..36477f7b439 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -339,7 +339,7 @@ pass to the OPERATION." | |||
| 339 | preserve-uid-gid preserve-selinux-context) | 339 | preserve-uid-gid preserve-selinux-context) |
| 340 | "Like `copy-file' for Tramp files. | 340 | "Like `copy-file' for Tramp files. |
| 341 | KEEP-DATE is not handled in case NEWNAME resides on an SMB server. | 341 | KEEP-DATE is not handled in case NEWNAME resides on an SMB server. |
| 342 | PRESERVE-UID-GID is completely ignored." | 342 | PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored." |
| 343 | (setq filename (expand-file-name filename) | 343 | (setq filename (expand-file-name filename) |
| 344 | newname (expand-file-name newname)) | 344 | newname (expand-file-name newname)) |
| 345 | (with-progress-reporter | 345 | (with-progress-reporter |