From: Shakthi Kannan <shakthimaan@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 9130@debbugs.gnu.org
Subject: bug#9130: Document Lisp mode fontification for strings after :documentation
Date: Thu, 17 Dec 2015 22:29:27 +0530 [thread overview]
Message-ID: <CABG-yt01poteuLA12ohmBWn9k-og3dR4LpzY6YC2bLgkpdZiYA@mail.gmail.com> (raw)
In-Reply-To: <83si32z0hh.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 181 bytes --]
Hi,
Attached patch with updated manual, NEWS and docstrings:
* doc/emacs/display.texi
* etc/NEWS
* lisp/emacs-lisp/lisp-mode.el
SK
--
Shakthi Kannan
http://www.shakthimaan.com
[-- Attachment #2: 0001-Document-Lisp-mode-fontification-for-strings-after-d.patch --]
[-- Type: text/x-patch, Size: 2994 bytes --]
From fa87c4cf8a62d37b71e62f4b007d8a8cc43895cf Mon Sep 17 00:00:00 2001
From: Shakthi Kannan <author@shakthimaan.com>
Date: Thu, 17 Dec 2015 22:25:14 +0530
Subject: [PATCH] Document Lisp mode fontification for strings after
documentation
---
doc/emacs/display.texi | 5 +++++
etc/NEWS | 5 +++++
lisp/emacs-lisp/lisp-mode.el | 3 +++
3 files changed, 13 insertions(+)
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index a722ec4..73a5112 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -867,6 +867,11 @@ any string or comment. Therefore, you should avoid placing an
open-parenthesis or open-brace in the leftmost column, if it is inside
a string or comment. @xref{Left Margin Paren}, for details.
+@findex lisp-mode
+ Documentation of the form (:documentation ``the doc string'') now
+support fontification in Lisp mode. These forms are used in Common
+Lisp code for CLOS class and slot documentation.
+
@findex font-lock-add-keywords
Font Lock highlighting patterns already exist for most modes, but
you may want to fontify additional patterns. You can use the function
diff --git a/etc/NEWS b/etc/NEWS
index 2788f5c..2e0ea44 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -631,7 +631,12 @@ respectively, `show-paren-when-point-inside-paren' or
`show-paren-when-point-in-periphery'.
** Lisp mode
+
++++
*** Strings after `:documentation' are highlighted as docstrings.
+This enhances Lisp mode fontification to handle documentation of the
+form (:documentation "the doc string") used in Common Lisp code for
+CLOS class and slot documentation.
** Rectangle editing
*** Rectangle Mark mode can have corners past EOL or in the middle of a TAB.
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 9ce0dfd..446afb5 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -486,6 +486,7 @@ This will generate compile-time constants from BINDINGS."
"Default expressions to highlight in Lisp modes.")
(defun lisp-string-in-doc-position-p (listbeg startpos)
+ "Returns true if Lisp string is in docstring position"
(let* ((firstsym (and listbeg
(save-excursion
(goto-char listbeg)
@@ -516,6 +517,7 @@ This will generate compile-time constants from BINDINGS."
(= (point) startpos))))))
(defun lisp-string-after-doc-keyword-p (listbeg startpos)
+ "Returns true if Lisp string contains :documentation"
(and listbeg ; We are inside a Lisp form.
(save-excursion
(goto-char startpos)
@@ -524,6 +526,7 @@ This will generate compile-time constants from BINDINGS."
(looking-at ":documentation\\_>"))))))
(defun lisp-font-lock-syntactic-face-function (state)
+ "Font lock a string after :documentation"
(if (nth 3 state)
;; This might be a (doc)string or a |...| symbol.
(let ((startpos (nth 8 state)))
--
2.1.4
next prev parent reply other threads:[~2015-12-17 16:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-20 16:50 bug#9130: 23.3; Lisp mode doc string enhancment Robert Brown
2011-08-02 20:01 ` Stefan Monnier
2014-03-25 17:54 ` Robert Brown
2014-06-19 14:04 ` bug#9130: 23.3; Lisp mode doc string enhancement Stefan Monnier
2015-12-16 17:10 ` bug#9130: Document Lisp mode fontification for strings after :documentation Shakthi Kannan
2015-12-16 17:53 ` Eli Zaretskii
2015-12-16 18:07 ` Shakthi Kannan
2015-12-16 18:47 ` Eli Zaretskii
2015-12-16 18:54 ` Shakthi Kannan
2015-12-16 18:56 ` Eli Zaretskii
2015-12-17 16:59 ` Shakthi Kannan [this message]
2015-12-18 15:35 ` Eli Zaretskii
2015-12-18 15:58 ` Shakthi Kannan
2015-12-18 16:10 ` Eli Zaretskii
2015-12-30 6:22 ` Shakthi Kannan
2015-12-30 18:02 ` Eli Zaretskii
2015-12-31 0:09 ` Xue Fuqiao
2015-12-31 5:32 ` Shakthi Kannan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABG-yt01poteuLA12ohmBWn9k-og3dR4LpzY6YC2bLgkpdZiYA@mail.gmail.com \
--to=shakthimaan@gmail.com \
--cc=9130@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).