From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeremy Bryant via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67153: [PATCH 2/2] Add 5 docstrings to abbrev.el Date: Mon, 13 Nov 2023 22:38:39 +0000 Message-ID: <87bkbx8ef0.fsf@jeremybryant.net> Reply-To: Jeremy Bryant Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2635"; mail-complaints-to="usenet@ciao.gmane.io" To: 67153@debbugs.gnu.org, rms@gnu.org, gerd@gnu.org, monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 13 23:42:32 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r2fdX-0000Q4-TU for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Nov 2023 23:42:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2fdN-00069l-Tj; Mon, 13 Nov 2023 17:42:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2fdM-00069d-MY for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2023 17:42:20 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2fdM-0003lj-E3 for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2023 17:42:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r2fe1-0005oh-UC for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2023 17:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jeremy Bryant Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Nov 2023 22:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67153 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, Richard Stallman , Gerd =?UTF-8?Q?M=C3=B6llmann?= , Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.169991533222295 (code B ref -1); Mon, 13 Nov 2023 22:43:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Nov 2023 22:42:12 +0000 Original-Received: from localhost ([127.0.0.1]:59461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2fdE-0005nX-BM for submit@debbugs.gnu.org; Mon, 13 Nov 2023 17:42:12 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:40788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2fdC-0005nC-MJ for submit@debbugs.gnu.org; Mon, 13 Nov 2023 17:42:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2fcR-0005nx-GL for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2023 17:41:23 -0500 Original-Received: from out-171.mta1.migadu.com ([2001:41d0:203:375::ab]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2fcJ-0003g1-Id for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2023 17:41:23 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeremybryant.net; s=key1; t=1699915271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=t4XdEwbiWHdRESvVO/MmzlcL7DiyvBkV7kHKCKjJwO4=; b=laaBkJl8m+mUFal1n44zXYC04QGkv3783e+EDlZEouPT3FlfGiqkcnFicCRvT579jQb+iF uGnUW4PZVVPUR+9Ns8eDzOst0Emx0CP8MGP+G3w5UTyAa1CcPjKQx79c8jXxpxYPib7le4 UxOqoyyxcQhWrAp9gI6ExCFxFg6vekgsFIegtQW8LfN8OY25+EhJRaEinSTMVNlKVf30F4 IgnSTcWu2uL85GowXXb0GBeuCGGaiLP8QkJLu9KmJHrGap/5Kqjydly6xADXR61PB5cEuG ntx6j7LhrIIW4WUHjqSPdB7LnRXds91o3nJS3MvLwCMtial2bsmPcdi7ZUlvEA== X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::ab; envelope-from=jb@jeremybryant.net; helo=out-171.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274288 Archived-At: --=-=-= Content-Type: text/plain Tags: patch This patch adds 5 docstrings to abbrev.el where there were none before. This now completes all docstrings in this Lisp file. The patch is a documentation patch based on emacs-29. Please let me know if this is ready to install or if changes are needed. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0002-Add-5-docstrings-to-abbrev.el.patch >From fbe88f6dd4717ae07883dfdf8e87053008293753 Mon Sep 17 00:00:00 2001 From: Jeremy Bryant Date: Mon, 13 Nov 2023 22:24:36 +0000 Subject: [PATCH 2/2] Add 5 docstrings to abbrev.el * lisp/abbrev.el (prepare-abbrev-list-buffer) (add-abbrev) (inverse-add-abbrev) (abbrev--describe) (abbrev--possibly-save): Add docstrings. --- lisp/abbrev.el | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index e1311dbc83b..70c79c1380f 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -122,6 +122,10 @@ abbrev-table-name found)) (defun prepare-abbrev-list-buffer (&optional local) + "Return *Abbrevs* buffer for the caller to select or display. + +LOCAL is a flag, if non-nil display only local abbrevs. +" (let ((local-table local-abbrev-table)) (with-current-buffer (get-buffer-create "*Abbrevs*") (erase-buffer) @@ -333,6 +337,22 @@ add-global-abbrev (add-abbrev global-abbrev-table "Global" arg)) (defun add-abbrev (table type arg) + "Define an abbrev in abbrev TABLE whose expansion is last word before point. +If there's an active region, use that as the expansion. + +ARG says how many words before point to use for the expansion; +zero means the entire region is the expansion. + +A negative ARG means to undefine the specified abbrev. + +TYPE of abbrev includes \"Global\", \"Mode\". + +This command reads the abbreviation from the minibuffer. + +See `add-global-abbrev', `add-mode-abbrev' for caller examples. +See `inverse-add-abbrev' for the opposite task. + +Don't use this function in a Lisp program; use `define-abbrev' instead." (let ((exp (cond ((or (and (null arg) (use-region-p)) @@ -393,6 +413,18 @@ inverse-add-global-abbrev (inverse-add-abbrev global-abbrev-table "Global" n)) (defun inverse-add-abbrev (table type arg) + "Define the word before point as as an abbrev in TABLE. + +ARG means use the ARG-th word before point as the +abbreviation. Negative ARG means use the ARG-th word after point. + +This command reads the expansion from the minibuffer, defines the +abbrev, and then expands the abbreviation in the current buffer. + +TYPE of abbrev can be \"Global\", \"Mode\". + +See `inverse-add-global-n', `inverse-add-mode-abbrev' for caller examples. +See also `add-abbrev', which performs the opposite task." (let (name exp start end) (save-excursion (forward-word (1+ (- arg))) @@ -406,7 +438,7 @@ inverse-add-abbrev nil nil nil t)) (when (or (not (abbrev-expansion name table)) (y-or-n-p (format "%s expands into \"%s\"; redefine? " - name (abbrev-expansion name table)))) + name (abbrev-expansion name table)))) (define-abbrev table (downcase name) exp) (save-excursion (goto-char end) @@ -1102,6 +1134,8 @@ abbrev--write (insert ")\n")) (defun abbrev--describe (sym) + "Describe abbrev SYM. +Used to generate a table by `insert-abbrev-table-description'." (when (symbol-value sym) (prin1 (symbol-name sym)) (if (null (abbrev-get sym :system)) @@ -1243,6 +1277,8 @@ edit-abbrevs-mode (setq font-lock-multiline nil)) (defun abbrev--possibly-save (query &optional arg) + "Hook function for use by `save-some-buffer-functions'. +Associated meaning for QUERY and ARG." ;; Query mode. (if (eq query 'query) (and save-abbrevs abbrevs-changed) -- 2.40.1 --=-=-=--