Commit graph

4605 commits

Author SHA1 Message Date
Glenn Morris
b7d5033c39 * lisp/emacs-lisp/check-declare.el (check-declare-warn):
Don't print filename twice (it's in the prefix now).
2015-06-16 20:45:35 -04:00
Glenn Morris
d3b779fa79 * lisp/emacs-lisp/pcase.el (pcase--u1): Revert earlier workaround.
No longer needed.
2015-06-16 20:44:57 -04:00
Glenn Morris
c07e67aaaf Address a compilation warning.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
Replace 't' with '_' in pcase.
2015-06-16 20:44:23 -04:00
Glenn Morris
55b41a82cd Address some compilation warnings.
* lisp/face-remap.el (text-scale-adjust):
* lisp/menu-bar.el (popup-menu-normalize-position):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
* lisp/emacs-lisp/generator.el (cps--transform-1):
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
* lisp/obsolete/vc-arch.el (vc-arch-mode-line-string):
* lisp/progmodes/octave.el (octave-goto-function-definition)
(octave-find-definition-default-filename):
Replace 't' with '_' in pcase.
2015-06-16 20:04:35 -04:00
Glenn Morris
cf94a3e0c4 * lisp/emacs-lisp/pcase.el (pcase--u1):
Paper-over today's bootstrap failure.
2015-06-16 18:27:02 -04:00
Nicolas Petton
70a567971a * lisp/emacs-lisp/seq.el: Fix a byte-compiler warnings related to pcase. 2015-06-16 23:49:35 +02:00
Nicolas Petton
7d5c120fed * lisp/emacs-lisp/map.el (map-into): Fix a byte-compiler warning. 2015-06-16 23:04:03 +02:00
Stefan Monnier
3ef311678b * lisp/emacs-lisp/pcase.el: Improve docs and error handling
(pcase--self-quoting-p): Floats aren't self-quoting.
(pcase): Tweak docstring.
(pcase--u1): Deprecate the t pattern.  Improve error detection for
the nil pattern.
(\`): Tweak docstring.  Signal an error for unrecognized cases.

(bug#20784)
2015-06-16 12:37:33 -04:00
Glenn Morris
4c4a329cf4 ; * lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
Fix recent change.
2015-06-15 18:02:33 -04:00
Paul Eggert
e58a815339 Fix quoting when making derived mode docstring
* lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
Nest regexp-quote inside format, not the reverse.
Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-06/msg00206.html
2015-06-15 12:41:01 -07:00
Nicolas Petton
c8dc4d6804 * lisp/emacs-lisp/map.el (map-let): Better docstring. 2015-06-15 12:43:09 +02:00
Artur Malabarba
3881af45bf * lisp/emacs-lisp/package.el (package--with-work-buffer-async):
Catch errors that happen before going async.  (Bug#20809)
2015-06-14 22:48:18 +01:00
Artur Malabarba
57e7666477 * lisp/emacs-lisp/tabulated-list.el (tabulated-list-print):
Don't assume that `tabulated-list-printer' will leave point at the
end of the buffer.  (Bug#20810)
2015-06-14 14:40:48 +01:00
Glenn Morris
1fabab62f8 Ensure early startup warnings are visible at the end. (Bug#20792)
* lisp/emacs-lisp/warnings.el (display-warning):
If startup isn't complete, delay the warning.

* lisp/startup.el (normal-top-level, command-line):
Let display-warning automatically handle the needed delays.
Run delayed-warnings-hook.
2015-06-12 19:26:21 -07:00
Paul Eggert
b220562637 Fix quoting of help for functions with odd names
While investigating Bug#20759, I discovered other quoting problems:
C-h f mishandled characters like backslash and quote in function names.
This fix changes the behavior so that 'C-h f pcase RET' now
generates "... (\` QPAT) ..." instead of "... (` QPAT) ...",
because '(format "%S" '(` FOO))' returns "(\\` FOO)".  A comment
in src/lread.c's read1 function says that the backslash will be
needed starting in Emacs 25, which implies that 'format' is
correct and the old pcase documention was wrong to omit the backslash.
* lisp/emacs-lisp/nadvice.el (advice--make-docstring):
* lisp/help-fns.el (help-fns--signature):
* lisp/help.el (help-add-fundoc-usage):
* lisp/progmodes/elisp-mode.el (elisp-function-argstring):
Use help--make-usage-docstring rather than formatting
help-make-usage.
* lisp/emacs-lisp/pcase.el (pcase--make-docstring):
Return raw docstring.
* lisp/help-fns.el (help-fns--signature): New arg RAW, to return
raw docstring.  Take more care to distinguish raw from cooked dstrings.
(describe-function-1): Let help-fns--signature substitute
command keys.
* lisp/help.el (help--docstring-quote): New function.
(help-split-fundoc): Use it, to quote funny characters more
systematically.
(help--make-usage): Rename from help-make-usage, since this
should be private.  Leave an obsolete alias for the old name.
(help--make-usage-docstring): New function.
* test/automated/help-fns.el (help-fns-test-funny-names): New test.
2015-06-11 10:24:38 -07:00
Glenn Morris
7c24a2c210 * lisp/emacs-lisp/checkdoc.el (checkdoc-get-keywords):
Move requiring of finder from here...
(checkdoc-package-keywords): ... to here.
2015-06-10 17:06:02 -04:00
Stefan Monnier
a0f0f08a52 * lisp/emacs-lisp/checkdoc.el: Use lexical-binding
(finder-known-keywords): Silence byte-compiler.
2015-06-10 09:11:20 -04:00
Oleh Krehel
20de61c833 Add new command checkdoc-package-keywords
* lisp/emacs-lisp/checkdoc.el (checkdoc-package-keywords-flag): New
  defcustom.
(checkdoc-list-of-strings-p): Add doc.
(checkdoc-current-buffer): When `checkdoc-package-keywords-flag' is
non-nil, call `checkdoc-package-keywords'.
(checkdoc-get-keywords): New defun.
(checkdoc-package-keywords): New command. Warns if the current file
has package.el-style keywords that aren't in `finder-known-keywords'.

* etc/NEWS: Add entry.
2015-06-08 16:54:51 +02:00
Artur Malabarba
f1aa40f47d * lisp/emacs-lisp/package.el (package-delete): Make interactive 2015-06-08 10:50:43 +01:00
Oleh Krehel
c941d47932 checkdoc.el (checkdoc-file): New function
* lisp/emacs-lisp/checkdoc.el (checkdoc-error): When
  `checkdoc-diagnostic-buffer' is set to "*warn*", print the warning
  to the standard output.

(bug#20754)
2015-06-08 08:33:21 +02:00
Nicolas Petton
30e518379e * lisp/emacs-lisp/map.el (map-let): Better docstring. 2015-06-06 01:54:11 +02:00
Nicolas Petton
2a54e8dfff Better syntax for the map pcase pattern
* lisp/emacs-lisp/map.el: Improves the map pcase pattern to take
bindings of the form (KEY PAT) or SYMBOL. KEY is not quoted.
2015-06-06 01:50:32 +02:00
Nicolas Petton
cd22663b85 * lisp/emacs-lisp/map.el (map--dispatch): Better docstring. 2015-06-06 01:26:25 +02:00
Nicolas Petton
431fca48a8 ; * lisp/emacs-lisp/map.el: Fix formatting. 2015-06-06 01:26:25 +02:00
Nicolas Petton
8fe836abbd Fix a byte-compiler error in map-put and map-delete
* lisp/emacs-lisp/map.el (map-put, map-delete): Ensure that `setq' is
called with a symbol.
2015-06-06 01:26:25 +02:00
Glenn Morris
b0eb66823f * lisp/emacs-lisp/map.el (map--dispatch): Move before use.
(map--delete-array): Fix typo.
2015-06-05 16:30:39 -04:00
Paul Eggert
1ba0149572 Fix curved quotes in a few places
* lisp/calc/calc-misc.el (calc-help): Fix quoting.
The strings in question are not doc strings, so this partially
undoes the recent change that assumed they were doc strings.
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/info.el (Info-finder-find-node):
Use curved quotes.
* lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
Also allow curved quotes in doc strings.
2015-06-04 23:54:49 -07:00
Dmitry Gutov
f6fc446d93 Handle new-style advice in find-funct
* lisp/emacs-lisp/find-func.el (find-function-advised-original):
Handle new-style advice.  Return the symbol's function definition.
(Bug#20718)
(find-function-library): Update accordingly.
2015-06-05 01:34:40 +03:00
Nicolas Petton
d4aca72ead Merge branch 'map' 2015-06-04 22:30:29 +02:00
Nicolas Petton
cfb35800a8 * lisp/emacs-lisp/map.el: Better docstring for the map pcase macro. 2015-06-04 22:26:22 +02:00
Nicolas Petton
988d721186 Add a pcase pattern for maps and `map-let' based on it
* lisp/emacs-lisp/map.el (map-let): New macro.
(map--make-pcase-bindings, map--make-pcase-patterns): New functions.
* test/automated/map-tests.el: New test for `map-let'.
2015-06-02 22:19:48 +02:00
Paul Eggert
a158324abd Generate curved quotes in ert doc
* lisp/emacs-lisp/ert.el (ert--print-test-for-ewoc)
(ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
Quote ‘like this’, not `like this', when generating doc strings
and the like.
* test/automated/ert-x-tests.el (ert-test-describe-test):
Allow quoting ‘like this’.
2015-06-02 07:33:14 -07:00
Artur Malabarba
56af96e54e * lisp/emacs-lisp/package.el: Don't load from parent dir
(package-load-all-descriptors): Don't load descriptors from
directories above the package directories.
2015-05-29 21:41:53 +01:00
Glenn Morris
192fb202d9 ; Auto-commit of loaddefs files. 2015-05-28 06:21:55 -04:00
Paul Eggert
4643f6c21a A few more doc string fixes (Bug#20385) 2015-05-28 00:45:00 -07:00
Paul Eggert
dfc2ef11a8 Fix minor quoting problems in doc strings
Most of these fixes involve escaping grave accents that are
actually intended to be grave accents, not left quotes.
(Bug#20385)
2015-05-28 00:22:03 -07:00
Paul Eggert
0fd5e6593a Support curved quotes in doc strings
Emacs's traditional doc string style has been to quote symbols
`like this'.  This worked well on now-obsolete terminals where
` and ' were symmetric quotes, but nowadays curved quotes
‘like this’ look better.  Support quoting the new way too.
(Bug#20385)
* doc/lispref/tips.texi (Documentation Tips): Symbols can be quoted
‘like-this’ as well as `like-this'.
* etc/NEWS: Mention this.
* lisp/cedet/mode-local.el (overload-docstring-extension)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cus-theme.el (describe-theme-1):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-class)
(eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/faces.el (describe-face):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode, help-fns--obsolete):
(help-fns--interactive-only, describe-function-1):
(describe-variable):
* lisp/help.el (describe-mode):
* lisp/international/mule-cmds.el (describe-input-method)
(describe-language-environment):
* lisp/international/mule-diag.el (describe-character-set)
(print-coding-system-briefly, list-input-methods)
(list-input-methods-1):
Insert curved quotes rather than grave accent and apostrophe.
* lisp/cedet/srecode/texi.el (srecode-texi-texify-docstring):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-proper-noun-region-engine):
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2)
(lisp-cl-font-lock-keywords-2):
* lisp/finder.el (finder-font-lock-keywords):
* lisp/gnus/gnus-art.el (gnus-button-alist):
* lisp/help-fns.el (help-do-arg-highlight)
(describe-function-1, describe-variable):
* lisp/help-mode.el (help-xref-symbol-regexp)
(help-xref-info-regexp, help-xref-url-regexp):
* lisp/help.el (describe-mode):
* lisp/international/mule-cmds.el (help-xref-mule-regexp-template):
* lisp/wid-edit.el (widget-documentation-link-regexp):
Parse symbols quoted ‘like-this’ as well as `like-this'.
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
Add "‘" and "’" to electric-pair-text-pairs.
(elisp--form-quoted-p): Also allow "‘" as a quoting char.
(elisp-completion-at-point, elisp--preceding-sexp):
Also treat "‘" and "’" as quoting chars.
2015-05-28 00:22:02 -07:00
Artur Malabarba
1f7abd04bc * lisp/emacs-lisp/package.el: Don't erase tags on refresh
(package-menu--post-refresh): Call `tabulated-list-print' with the
UPDATE argument.  This only affects the refresh action, the revert
action still erases tags.
(package-menu-get-status): Change `assq' to `assoc'.
(package-menu--mark-upgrades-1): New function.
(package-menu--mark-upgrades-pending): New variable.
(package-menu-mark-upgrades): Use them to delay marking until
after refresh is done.
(package-menu--post-refresh): Call mark-upgrades-1 if
mark-upgrades-pending is non-nil.
2015-05-27 20:42:29 +01:00
Artur Malabarba
45c92ddd99 * lisp/emacs-lisp/tabulated-list.el: Don't sort without sorter
(tabulated-list-print): Don't sort if sorter is nil
2015-05-26 09:32:45 +01:00
Stefan Monnier
9b995d55c5 (cl-generic-define-method): Side effects are evil (bug#20644)
* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Don't reuse
cons-cells that might be used as keys in an `equal' hash-table.
2015-05-25 10:53:52 -04:00
Stefan Monnier
b15c63952f * lisp/emacs-lisp/cl-macs.el (cl-tagbody): Scope cl--tagbody-alist
Fixes: debbugs:20639
2015-05-25 09:39:35 -04:00
Stefan Monnier
dde09cdbce * lisp/emacs-lisp/pcase.el: Use PAT rather than UPAT in docstring
(pcase-let): Document the behavior in case the pattern doesn't match.
2015-05-24 22:38:05 -04:00
Artur Malabarba
c205098b6a * lisp/emacs-lisp/tabulated-list.el: New optional print method
(tabulated-list-print): New optional argument, UPDATE.  If
non-nil, the list is printed by only adding and deleting the
changed entries, instead of erasing the whole buffer.  This method
is much faster when few or no entries have changed.

* doc/lispref/modes.texi (Tabulated List Mode): Document it.

* etc/NEWS: Document it.
2015-05-24 23:45:46 +01:00
Artur Malabarba
d38350984e * lisp/emacs-lisp/tabulated-list.el: Improve printing
(tabulated-list--get-sorter): New function.
(tabulated-list-print): Restore window-line when remember-pos is
passed and optimize away the `nreverse'.
2015-05-24 23:45:46 +01:00
Stefan Monnier
919281ddb2 Replace gui-method macros with cl-generic with &context
* lisp/frame.el (gui-method--name, gui-method, gui-method-define)
(gui-method-declare, gui-call): Remove.
(frame-creation-function): Use cl-defgeneric.
(make-frame): Adjust callers.

* lisp/menu-bar.el (menu-bar-edit-menu):
Use gui-backend-selection-exists-p.

* lisp/select.el (x-get-clipboard): Use gui-backend-get-selection.
(gui-backend-get-selection): New cl-generic to replace
gui-get-selection method.
(gui-backend-set-selection): New cl-generic to replace
gui-set-selection method.
(gui-selection-owner-p): New cl-generic to replace
gui-selection-owner-p method.
(gui-backend-selection-exists-p): New cl-generic to replace
gui-selection-exists-p method.  Adjust all callers.

* lisp/server.el (server-create-window-system-frame): Don't ignore
window-system spec even when unsupported.

* lisp/simple.el (deactivate-mark): Use new gui-backend-* functions.

* lisp/startup.el (handle-args-function, window-system-initialization):
Use cl-defgeneric.
(command-line): Adjust calls accordingly.

* lisp/term/ns-win.el (ns-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.

* lisp/term/pc-win.el (w16-get-selection-value): Turn into
a gui-backend-get-selection method.
(gui-selection-exists-p, gui-selection-owner-p, gui-set-selection):
Use cl-defmethod on the new functions instead.
(msdos-window-system-initialization): Turn into
a window-system-initialization method.
(frame-creation-function, handle-args-function): Use cl-defmethod.

* lisp/term/w32-win.el (w32-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.

* lisp/term/x-win.el (x-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.

* lisp/term/xterm.el (xterm--set-selection): Turn into
a gui-backend-set-selection method.

* src/nsselect.m (Fns_selection_exists_p): Remove unused arg `terminal'.
(Fns_selection_owner_p): Remove unused arg `terminal'.
(Fns_get_selection): Remove unused args `time_stamp' and `terminal'.
2015-05-23 11:32:29 -04:00
Artur Malabarba
7ac84a2570 * lisp/emacs-lisp/package.el: Always update selected-packages
(package--update-selected-packages): New function.
(package-menu-execute): Use it before starting the transaction,
this way the list of selected packages is updated even when the
transaction fails.
(package-menu--perform-transaction): Don't edit selected-packages.
2015-05-23 10:21:27 +01:00
Artur Malabarba
c2ef2adff1 * lisp/emacs-lisp/package.el (package-selected-packages): Fix doc 2015-05-22 11:00:28 +01:00
Stefan Monnier
ea92591983 Change defgeneric so it doesn't completely redefine the function
* lisp/emacs-lisp/cl-generic.el (cl-generic-define): Don't throw away
previously defined methods.
(cl-generic-define-method): Let-bind purify-flag instead of using `fset'.
(cl--generic-prefill-dispatchers): Only define during compilation.
(cl-method-qualifiers): Remove redundant alias.
(help-fns-short-filename): Silence byte-compiler.
* test/automated/cl-generic-tests.el: Adjust to new defgeneric semantics.
2015-05-21 23:46:10 -04:00
Artur Malabarba
f590fc2760 (package-menu-execute): Remove reference to remove-dups 2015-05-21 21:27:22 +01:00
Paul Eggert
96794d2f97 Don't quote nil and t in doc strings
This is as per "Tips for Documentation Strings" in the elisp manual.
For consistency, do the same in diagnostics and comments.
2015-05-21 10:06:44 -07:00