[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed d998d4d 12/16: Checkdoc fixes
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/objed d998d4d 12/16: Checkdoc fixes |
Date: |
Fri, 15 Mar 2019 12:57:42 -0400 (EDT) |
branch: externals/objed
commit d998d4d19104469615bc0ed48817d5694d8e1cda
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Checkdoc fixes
---
objed-objects.el | 17 +++++++++++----
objed.el | 63 ++++++++++++++++++++++++++++++++++++++-----------------
test/make-lint.el | 26 ++++++++++++-----------
3 files changed, 71 insertions(+), 35 deletions(-)
diff --git a/objed-objects.el b/objed-objects.el
index 4ed7697..b3f6f7e 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -140,7 +140,7 @@ Usage:
PACKAGE is the name of the package the object should be loaded
for. If nil you are defining a default object and need to add a
-binding in `objed-object-map' for the object command.
+binding in variable `objed-object-map' for the object command.
NAME is a symbol which defines the name which will be used to
refer to this object. ARGS is a list of keyword arguments and
@@ -216,7 +216,7 @@ is not skipped before search for the next one via :try-next.
:commands (optional)
If given the value should be a list of commands for which objed
-should activate (when `objed-mode' is on) with the object beeing
+should activate (when variable `objed-mode' is on) with the object beeing
defined."
(declare (indent 2))
(let* ((mode (plist-get args :mode))
@@ -563,6 +563,7 @@ and the current window."
(setq posns (nreverse posns))))
(defun objed--no-skipper-p ()
+ "If current object should be skipped."
(get (objed--name2func objed--object)
'objed-no-skip))
@@ -1077,6 +1078,9 @@ object."
(defun objed-goto-prev-identifier (arg)
+ "Switch to nth previous identifier.
+
+nth is given by ARG."
(interactive "P")
(unless (eq objed--object 'identifier)
(objed--switch-to 'identifier))
@@ -1215,7 +1219,10 @@ position POS, otherwise just return POS."
(defun objed--in-string-p (&optional syn ignore-atp)
"Return non-nil if point is inside or at string.
-If SYN is given use it instead of syntax at point."
+If SYN is given use it instead of syntax at point.
+
+If IGNORE-ATP is non-nil dont test if point is at a string
+only if its withing one."
(let ((syn (or syn (syntax-ppss))))
(if (and (nth 3 syn)
(nth 8 syn))
@@ -1328,7 +1335,8 @@ If SYN is given use it instead of syntax at point."
(defun objed--skip-ws (&optional back limit)
"Skip whitspace.
-Defaults to forward, if BACK is non-nil skip backwards."
+Defaults to forward, if BACK is non-nil skip backwards.
+Skips until LIMIT."
(if back
(skip-chars-backward " \r\n\t" limit)
(skip-chars-forward " \r\n\t" limit)))
@@ -2055,6 +2063,7 @@ non-nil the indentation block can contain empty lines."
(run-at-time 0 nil (apply-partially #'message "First
one!")))))))))
(defun objed--get-ident-format ()
+ "Get format string for identifier."
(let ((sym (or (symbol-at-point)
(and (re-search-forward "\\_<" nil t)
(symbol-at-point)))))
diff --git a/objed.el b/objed.el
index 888afb6..6717feb 100644
--- a/objed.el
+++ b/objed.el
@@ -591,14 +591,20 @@ BEFORE and AFTER are forms to execute before/after
calling the command."
(defun objed--forward-word ()
- (interactive)
- (if (and (eq last-command 'objed-extend)
- (eq objed--object 'word)
- (looking-at "\\<"))
- (objed-exchange-point-and-mark)
- (call-interactively 'forward-word)))
+ "Forward word.
+
+Accommodate for `objed-extend'."
+ (interactive)
+ (if (and (eq last-command 'objed-extend)
+ (eq objed--object 'word)
+ (looking-at "\\<"))
+ (objed-exchange-point-and-mark)
+ (call-interactively 'forward-word)))
(defun objed--backward-word ()
+ "Backward word.
+
+Accommodate for `objed-extend'."
(interactive)
(if (and (eq last-command 'objed-extend)
(eq objed--object 'word)
@@ -607,6 +613,10 @@ BEFORE and AFTER are forms to execute before/after calling
the command."
(call-interactively 'backward-word)))
(defun objed-quit-window (&optional kill window)
+ "Quit window for objed.
+
+if KILL is non-nil kill the buffer. WINDOW defaults
+to the selected one."
(interactive "P")
(let* ((overriding-terminal-local-map nil)
(nc (key-binding "q" nil t)))
@@ -867,6 +877,7 @@ Other single character keys are bound to `objed-undefined'."
To define new operations see `objed-define-op'.")
(defun objed-repeat ()
+ "Repeat last command for objed."
(interactive)
(call-interactively 'repeat)
(setq real-this-command 'repeat)
@@ -968,6 +979,7 @@ Use `objed-define-dispatch' to define a dispatch command.")
(defun objed--forward-sexp ()
+ "Forward a sexp."
(interactive)
(let ((stringp nil))
(while (and (not (eobp))
@@ -987,6 +999,7 @@ Use `objed-define-dispatch' to define a dispatch command.")
(defun objed--backward-sexp ()
+ "Backward a sexp."
(interactive)
(let ((stringp nil))
(while (and (not (bobp))
@@ -1028,6 +1041,7 @@ Use `objed-define-dispatch' to define a dispatch
command.")
(message "Marked %s %ss in %s." n objed--object name)))))))
(defun objed--ace-switch-object (name)
+ "Switch to objed NAME using avy."
(let ((objed--object name))
(objed-ace)))
@@ -1703,6 +1717,7 @@ to an object containing the current one."
(objed--switch-to 'line 'inner))))))
(defun objed-backward-until-context ()
+ "Goto object inner beginning and activate part moved over."
(interactive)
(when (save-excursion (objed-context-object)
(objed-toggle-state))
@@ -1710,6 +1725,7 @@ to an object containing the current one."
(goto-char (objed--beg))))
(defun objed-forward-until-context ()
+ "Goto object inner end and activate part moved over."
(interactive)
(when (save-excursion (objed-context-object)
(objed-toggle-state))
@@ -1833,11 +1849,10 @@ Object is choosen based on context."
(defun objed-activate (&optional obj)
"Activate objed.
-Uses associated `objed-cmd-alist' for `last-command' as initial
-object. Falls back to `objed-initial-object' if no match found.
-
-If called from code decide for activation with char object using
-`objed--activate'."
+When called non interactively activate with object OBJ which
+defaults to char object. Otherwise uses associated
+`objed-cmd-alist' for `last-command' as initial object. Falls
+back to `objed-initial-object' if no match found."
(interactive)
(if (called-interactively-p 'any)
(objed--init
@@ -2417,7 +2432,7 @@ ARG is passed to `yank'. On repreat `yank-pop'."
(defun objed--indent (f &optional arg)
"Execute indent function F.
-If arg is given pass it on to the indent function. Switches
+If ARG is given pass it on to the indent function. Switches
temporary to `objed--indent-map'"
;; init
(unless (memq last-command
@@ -2463,7 +2478,9 @@ Moves point over any whitespace afterwards."
(objed--indent #'indent-rigidly-right-to-tab-stop))
(defun objed-indent-rigidly (_beg _end &optional arg)
- "Similar to `indent-rigidly' but work on current object lines."
+ "Similar to `indent-rigidly' but work on current object lines.
+
+Indent by ARG lines."
(interactive "r\nP")
(if arg
(objed--indent #'indent-rigidly (prefix-numeric-value arg))
@@ -2818,6 +2835,7 @@ c: capitalize."
(call-interactively 'query-replace-regexp)))))))
(defun objed--replace-ident (beg end)
+ "Replace text between BEG and END for object(s)."
(let ((str (objed--with-allow-input
(read-string "Replace with: "
nil nil (buffer-substring beg end)))))
@@ -2827,6 +2845,7 @@ c: capitalize."
(objed--replace-action str beg end))))
(defun objed--replace-action (str beg end)
+ "Replace region BEG, END with STR."
(save-excursion
(goto-char beg)
(delete-region beg end)
@@ -2922,7 +2941,7 @@ Returns cons cell with cmd as car and possible arguemtns
as cdr."
(defun objed--ipipe-to-string (cmdline str)
- "Pipe string STR through CMD-ARGS.
+ "Pipe string STR through CMDLINE.
Return restult if any or nil."
(let* ((parsed (objed--ipipe-parse cmdline))
@@ -2995,7 +3014,7 @@ Completes shell and region commands."
;; ** Entry command
(defun objed-ipipe (beg end)
- "Pipe region between BED END through commands.
+ "Pipe region between BEG, END through commands.
Commands can be shell commands or region commands."
(interactive "r")
@@ -3094,13 +3113,13 @@ Commands can be shell commands or region commands."
(defvar objed-use-ielm-for-eval-p nil
"Whether to use ielm for `objed-run-or-eval' for Elisp.
-If nil eval-region is used instead.")
+If nil ‘eval-region’ is used instead.")
(defun objed-run-or-eval (beg end)
- "Evalate region between beg and end using `eval-in-repl'."
+ "Evalate region between BEG and END using `eval-in-repl'."
(interactive "r")
(if (not (require 'eval-in-repl nil t))
- (error "eval-in-repl not found")
+ (error "The library eval-in-repl couldn't be found")
(let* ((name (symbol-name (cdr (assq major-mode objed--eir-alist))))
(lib (intern (concat "eval-in-repl-" name)))
(cmd (intern (concat "eir-eval-in-" name))))
@@ -3128,7 +3147,7 @@ multiple ones."
OP is the operation (ignored for now). If TEXT is given it
carries the textual content of the object the operation acted
-on."
+on and RANGE hold the object position data."
;; TODO: improve exit behaviour for default operations
(let ((exitf (cdr (assq op objed--exit-alist))))
;; (objed--update-current-object)
@@ -3164,6 +3183,9 @@ on."
(objed--exit-objed))
(defun objed--check-buffer ()
+ "Check if current buffer is still the `objed-buffer'.
+
+Resets objed if appropriate."
(unless objed--with-allow-input
(when (not (eq (current-buffer) objed--buffer))
(objed--reset--objed-buffer)
@@ -3171,6 +3193,7 @@ on."
(objed--init (or objed--object 'char)))))
(defun objed--reset--objed-buffer ()
+ "Reset `objed--buffer'."
;; things that need to be reset in objed buffer
(when (buffer-live-p objed--buffer)
(with-current-buffer objed--buffer
@@ -3238,6 +3261,7 @@ NAME is the symbol used for current op and defaults to
(objed--do-object action name)))))
(defun objed--do-object (action name)
+ "Apply ACTION for op named NAME on current object."
(let ((range (objed--current)))
(when range
(let ((text (apply #'buffer-substring range))
@@ -3247,6 +3271,7 @@ NAME is the symbol used for current op and defaults to
(objed-exit-op name text range)))))
(defun objed--do-objects (action name)
+ "Apply ACTION for op named NAME on marked objects."
(let ((ovs objed--marked-ovs)
(appendp (memq action '(kill-region copy-region-as-kill))))
(save-excursion
diff --git a/test/make-lint.el b/test/make-lint.el
index 353a257..99270ef 100644
--- a/test/make-lint.el
+++ b/test/make-lint.el
@@ -1,18 +1,20 @@
;;; -*- lexical-binding: t; -*-
;; checkdoc tests
-;; (require 'checkdoc)
-;; (let ((guess-checkdoc-error-buffer-name "*Warnings*"))
-;; ;; This buffer name is hard-coded in checkdoc and it may change
-;; (ignore-errors
-;; (kill-buffer guess-checkdoc-error-buffer-name))
-;; (mapc (lambda (f)
-;; (checkdoc-file f))
-;; (file-expand-wildcards "*.el"))
-;; (when-let ((buf (get-buffer guess-checkdoc-error-buffer-name)))
-;; (with-current-buffer buf
-;; (unless (= 0 (buffer-size))
-;; (kill-emacs 1)))))
+(require 'subr-x)
+(require 'checkdoc)
+(let ((guess-checkdoc-error-buffer-name "*Warnings*")
+ (sentence-end-double-space nil))
+ ;; This buffer name is hard-coded in checkdoc and it may change
+ (ignore-errors
+ (kill-buffer guess-checkdoc-error-buffer-name))
+ (mapc (lambda (f)
+ (checkdoc-file f))
+ (file-expand-wildcards "*.el"))
+ (when-let ((buf (get-buffer guess-checkdoc-error-buffer-name)))
+ (with-current-buffer buf
+ (unless (= 0 (buffer-size))
+ (kill-emacs 1)))))
;; ;; package lint
- [elpa] externals/objed e852343 15/16: Version bump, (continued)
- [elpa] externals/objed e852343 15/16: Version bump, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed aa8f32d 16/16: Add lint as phony target, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed 3d98612 04/16: Don't bind uppercase keys to undefined by default, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed 8fd55ba 06/16: Change objed-narrow semantics, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed c19dae3 07/16: Don't reset objed when input in minibuffer allowed, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed 04b079e 11/16: Mark some vars which don't follow emacs naming conventions obsolete, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed 98f12d3 13/16: Add lint target to test, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed 5ef921f 08/16: Rewrite objed-replace to work with multiple objects, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed 65f520c 14/16: Remove opsolete var suffixes, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed ea0be40 10/16: More work on lint tests, Clemens Radermacher, 2019/03/15
- [elpa] externals/objed d998d4d 12/16: Checkdoc fixes,
Clemens Radermacher <=