Changeset 6704
- Timestamp:
- Jun 12, 2007, 12:46:41 PM (17 years ago)
- File:
-
- 1 edited
-
branches/ide-1.0/ccl/hemlock/src/lispmode.lisp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ide-1.0/ccl/hemlock/src/lispmode.lisp
r6661 r6704 1727 1727 1728 1728 1729 ;;;; Matching parenthesis display.1730 1731 (defhvar "Paren Pause Period"1732 "This is how long commands that deal with \"brackets\" shows the cursor at1733 the matching \"bracket\" for this number of seconds."1734 :value 0.5)1735 1736 (defcommand "Lisp Insert )" (p)1737 "Inserts a \")\" and briefly positions the cursor at the matching \"(\"."1738 "Inserts a \")\" and briefly positions the cursor at the matching \"(\"."1739 (declare (ignore p))1740 (let ((point (current-point)))1741 (insert-character point #\))1742 (pre-command-parse-check point)1743 (when (valid-spot point nil)1744 (with-mark ((m point))1745 (if (list-offset m -1)1746 (let ((pause (value paren-pause-period))1747 (win (current-window)))1748 (if pause1749 (unless (show-mark m win pause)1750 (clear-echo-area)1751 (message "~A" (line-string (mark-line m))))1752 (unless (displayed-p m (current-window))1753 (clear-echo-area)1754 (message "~A" (line-string (mark-line m))))))1755 (editor-error))))))1756 1757 ;;; Since we use paren highlighting in Lisp mode, we do not want paren1758 ;;; flashing too.1759 ;;;1760 (defhvar "Paren Pause Period"1761 "This is how long commands that deal with \"brackets\" shows the cursor at1762 the matching \"bracket\" for this number of seconds."1763 :value nil1764 :mode "Lisp")1765 ;;;1766 (defhvar "Highlight Open Parens"1767 "When non-nil, causes open parens to be displayed in a different font when1768 the cursor is directly to the right of the corresponding close paren."1769 :value t1770 :mode "Lisp")1771 1772 1773 (defhvar "Open Paren Finder Function"1774 "Should be a function that takes a mark for input and returns either NIL1775 if the mark is not after a close paren, or two (temporary) marks1776 surrounding the corresponding open paren."1777 :mode "Lisp"1778 :value 'lisp-open-paren-finder-function)1779 1780 (defun lisp-open-paren-finder-function (mark)1781 (when (eq (character-attribute :lisp-syntax (previous-character mark))1782 :close-paren)1783 (with-mark ((mark mark))1784 (pre-command-parse-check mark)1785 (if (not (and (valid-spot mark nil) (list-offset mark -1)))1786 (values nil nil)1787 (values mark (mark-after (copy-mark mark)))))))1788 1789 1790 1729 1791 1730 … … 1811 1750 :mode "Lisp") 1812 1751 1813 (defun string-to-arglist (string buffer )1752 (defun string-to-arglist (string buffer &optional quiet-if-unknown) 1814 1753 (let* ((name 1815 1754 (let* ((*package* (or … … 1818 1757 *package*))) 1819 1758 (read-from-string string)))) 1820 (when ( and (typep name 'symbol))1759 (when (typep name 'symbol) 1821 1760 (multiple-value-bind (arglist win) 1822 1761 (ccl::arglist-string name) 1823 (format nil "~S : ~A" name (if win (or arglist "()") "(unknown)")))))) 1762 (if (or win (not quiet-if-unknown)) 1763 (format nil "~S : ~A" name (if win (or arglist "()") "(unknown)"))))))) 1824 1764 1825 1765 (defcommand "Current Function Arglist" (p) … … 1854 1794 (let* ((fun-name (region-to-string (region mark1 mark2))) 1855 1795 (arglist-string 1856 (string-to-arglist fun-name (current-buffer) )))1796 (string-to-arglist fun-name (current-buffer) t))) 1857 1797 (when arglist-string 1858 1798 (message arglist-string))))
Note:
See TracChangeset
for help on using the changeset viewer.
