[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 240/352: Mainostetaan funktiota wcheck-marked-text-at julkiseen
From: |
Stefan Monnier |
Subject: |
[elpa] 240/352: Mainostetaan funktiota wcheck-marked-text-at julkiseen käyttöön |
Date: |
Mon, 07 Jul 2014 14:04:33 +0000 |
monnier pushed a commit to branch master
in repository elpa.
commit b1411c75e4055cb0c7678112bae435b42d69b22e
Author: Teemu Likonen <address@hidden>
Date: Sat May 28 10:37:09 2011 +0000
Mainostetaan funktiota wcheck-marked-text-at julkiseen käyttöön
---
wcheck-mode.el | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/wcheck-mode.el b/wcheck-mode.el
index f6701d0..aa9d0de 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -839,7 +839,12 @@ languages. Command `wcheck-spelling-suggestions' gives
spelling
suggestions for marked text at point (also accessible through the
right-click mouse menu). Commands `wcheck-jump-forward' and
`wcheck-jump-backward' move point to next/previous marked text
-area."
+area.
+
+A note for Emacs Lisp programmers: Emacs Lisp Function
+`wcheck-marked-text-at' returns information about marked text at
+a buffer position. Function `wcheck-query-language-data' can be
+used for querying effective configuration data for a language."
:init-value nil
:lighter (" W:" (:eval (wcheck-mode-line-lang)))
@@ -1520,18 +1525,23 @@ text."
(defun wcheck-marked-text-at (pos)
"Return information about marked text at POS.
-POS is a buffer position. The return value is a vector of three
-items: (1) the marked text string, (2) marker at the beginning of
-the text and (3) marker at the end of the text."
+
+POS is a buffer position. The return value is a vector of five
+items: (1) the marked text string, (2) buffer position at the
+beginning of the text, (3) position at the end of the text, (4)
+the overlay object which marks the text and (5) the current
+language as a string."
(let ((overlay (catch 'my-overlay
(dolist (ol (overlays-at pos))
(when (overlay-get ol 'wcheck-mode)
(throw 'my-overlay ol))))))
(when overlay
- (let ((start (copy-marker (overlay-start overlay)))
- (end (copy-marker (overlay-end overlay))))
+ (let ((start (overlay-start overlay))
+ (end (overlay-end overlay)))
(vector (buffer-substring-no-properties start end)
- start end)))))
+ start end overlay
+ (wcheck-buffer-data-get
+ :buffer (current-buffer) :language))))))
;;;###autoload
@@ -1564,8 +1574,8 @@ was replaced."
(if (not overlay-data)
(signal 'wcheck-suggestion-error "There is no marked text here")
(let* ((text (aref overlay-data 0))
- (start (aref overlay-data 1))
- (end (aref overlay-data 2))
+ (start (copy-marker (aref overlay-data 1)))
+ (end (copy-marker (aref overlay-data 2)))
(suggestions (wcheck-get-suggestions wcheck-language text))
(choice (if (and (display-popup-menus-p) event)
(wcheck-choose-suggestion-popup
@@ -1885,9 +1895,10 @@ expression will return a boolean."
(defun wcheck-query-language-data (language key)
"Query `wcheck-mode' language data.
Return LANGUAGE's value for KEY as defined in variable
-`wcheck-language-data'. If it does not define a (valid) value for
-the KEY then query the value from `wcheck-language-data-defaults'
-or `wcheck-language-data-defaults-hard-coded'."
+`wcheck-language-data'. If that variable does not define
+a (valid) value for KEY then query the value from
+`wcheck-language-data-defaults' or
+`wcheck-language-data-defaults-hard-coded'."
(when (wcheck-language-exists-p language)
(let* ((data
- [elpa] 232/352: Yksinkertaisempi silmukka: -read-strings ja -paint-strings, (continued)
- [elpa] 232/352: Yksinkertaisempi silmukka: -read-strings ja -paint-strings, Stefan Monnier, 2014/07/07
- [elpa] 234/352: Uusi funktio: wcheck-process-running-p, Stefan Monnier, 2014/07/07
- [elpa] 228/352: Monipuolisempi read-or-skip-faces, Stefan Monnier, 2014/07/07
- [elpa] 226/352: Poistetaan maininta vanhasta muuttujasta wcheck-read-or-skip-faces, Stefan Monnier, 2014/07/07
- [elpa] 225/352: Käsitellään hyppytoiminnossa myös puskurin alku ja loppu, Stefan Monnier, 2014/07/07
- [elpa] 231/352: Versio 2011.01.09, Stefan Monnier, 2014/07/07
- [elpa] 237/352: Makron wcheck-with-language-data muuttujille paremmat nimet, Stefan Monnier, 2014/07/07
- [elpa] 236/352: Lisätään makroihin sisennysasetukset: (declare (indent ...)), Stefan Monnier, 2014/07/07
- [elpa] 238/352: Poistetaan turha #' lambda-rakenteiden edestä, Stefan Monnier, 2014/07/07
- [elpa] 245/352: Correction in wcheck-language-data doc: "variable" -> "value", Stefan Monnier, 2014/07/07
- [elpa] 240/352: Mainostetaan funktiota wcheck-marked-text-at julkiseen käyttöön,
Stefan Monnier <=
- [elpa] 246/352: Fix type in doc: "wcheck-parse-" "wcheck-parser-", Stefan Monnier, 2014/07/07
- [elpa] 235/352: Wcheck-versionumero: 2011.02.20, Stefan Monnier, 2014/07/07
- [elpa] 233/352: Uusi ominaisuus: tarkistusohjelman tulosteen jäsennysfunktio, Stefan Monnier, 2014/07/07
- [elpa] 251/352: Clarify the use of regexp-start, -body and -end, Stefan Monnier, 2014/07/07
- [elpa] 241/352: Korjataan wcheck-jump-backward -bugi, Stefan Monnier, 2014/07/07
- [elpa] 239/352: Tyylillistä hienosäätöä funktioon wcheck-make-overlay, Stefan Monnier, 2014/07/07
- [elpa] 243/352: Add README file, Stefan Monnier, 2014/07/07
- [elpa] 250/352: Improve wcheck-language-data doc, Stefan Monnier, 2014/07/07
- [elpa] 244/352: Copy Emacs wiki page's content to new README file, Stefan Monnier, 2014/07/07
- [elpa] 249/352: Fix a typo in wcheck-language-data doc string, Stefan Monnier, 2014/07/07