unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
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: Wed, 30 Dec 2015 11:52:38 +0530	[thread overview]
Message-ID: <CABG-yt16+5X5FVD0Kx5-W-HQWE8wwwenCkxXuFEQTJ+X4t0yog@mail.gmail.com> (raw)
In-Reply-To: <u9ad3h4zyji.fsf@paradicsom.nyc.corp.google.com>

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

Hi,

I have received the docstrings for the three functions from the
author, Robert Brown, and I am re-submitting the patch.

SK

--
Shakthi Kannan
http://www.shakthimaan.com

[-- Attachment #2: 0001-Document-Lisp-mode-fontification-for-strings-after-d.patch --]
[-- Type: text/x-patch, Size: 2436 bytes --]

From 28a9a0390ec8e05c732410f0b0678466a7280b16 Mon Sep 17 00:00:00 2001
From: Shakthi Kannan <author@shakthimaan.com>
Date: Wed, 30 Dec 2015 11:50:20 +0530
Subject: [PATCH] Document Lisp mode fontification for strings after
 documentation

---
 etc/NEWS                     | 5 +++++
 lisp/emacs-lisp/lisp-mode.el | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 2788f5c..2f33cdb 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..231b33f 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -486,6 +486,9 @@ lisp-cl-font-lock-keywords
   "Default expressions to highlight in Lisp modes.")
 
 (defun lisp-string-in-doc-position-p (listbeg startpos)
+   "Return true if STARTPOS is a position inside a list where a
+docstring may occur.  LISTBEG is the position of the start of the
+innermost list containing STARTPOS."
   (let* ((firstsym (and listbeg
                         (save-excursion
                           (goto-char listbeg)
@@ -516,6 +519,9 @@ lisp-string-in-doc-position-p
                 (= (point) startpos))))))
 
 (defun lisp-string-after-doc-keyword-p (listbeg startpos)
+  "Return true if STARTPOS is a position inside a list right
+after a :documentation symbol.  LISTBEG is the position of the
+start of the innermost list containing STARTPOS."
   (and listbeg                          ; We are inside a Lisp form.
        (save-excursion
          (goto-char startpos)
@@ -524,6 +530,8 @@ lisp-string-after-doc-keyword-p
                   (looking-at ":documentation\\_>"))))))
 
 (defun lisp-font-lock-syntactic-face-function (state)
+  "Return the Lisp font lock syntactic face function for the
+position represented by STATE, a `parse-partial-sexp' state."
   (if (nth 3 state)
       ;; This might be a (doc)string or a |...| symbol.
       (let ((startpos (nth 8 state)))
-- 
2.1.4


  parent reply	other threads:[~2015-12-30  6:22 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
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 [this message]
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-yt16+5X5FVD0Kx5-W-HQWE8wwwenCkxXuFEQTJ+X4t0yog@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).