Commit 28cf9318 authored by Troels Henriksen's avatar Troels Henriksen
Browse files

A few small fixes.

parent 3c81b95a
......@@ -145,14 +145,13 @@ otherwise it is case-sensitive."
;;;
;;; Character case
(defun downcase-word (mark &optional (n 1))
(defun downcase-word (mark syntax &optional (n 1))
"Convert the next N words to lowercase, leaving mark after the last word."
(let ((syntax (syntax (buffer mark))))
(loop repeat n
do (forward-to-word-boundary mark syntax)
(let ((offset (offset mark)))
(forward-word mark syntax 1 nil)
(downcase-region offset mark)))))
(loop repeat n
do (forward-to-word-boundary mark syntax)
(let ((offset (offset mark)))
(forward-word mark syntax 1 nil)
(downcase-region offset mark))))
(defun upcase-word (mark syntax &optional (n 1))
"Convert the next N words to uppercase, leaving mark after the last word."
......@@ -162,14 +161,13 @@ otherwise it is case-sensitive."
(forward-word mark syntax 1 nil)
(upcase-region offset mark))))
(defun capitalize-word (mark &optional (n 1))
(defun capitalize-word (mark syntax &optional (n 1))
"Capitalize the next N words, leaving mark after the last word."
(let ((syntax (syntax (buffer mark))))
(loop repeat n
do (forward-to-word-boundary mark syntax)
(let ((offset (offset mark)))
(forward-word mark syntax 1 nil)
(capitalize-region offset mark)))))
(loop repeat n
do (forward-to-word-boundary mark syntax)
(let ((offset (offset mark)))
(forward-word mark syntax 1 nil)
(capitalize-region offset mark))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
......@@ -693,7 +691,7 @@ to overwrite."
(error () (progn (beep)
(display-message "Invalid answer")
(return-from frame-exit nil)))))
do (save-buffer buffer))
do (save-buffer buffer frame))
(when (or (notany #'(lambda (buffer) (and (needs-saving buffer) (filepath buffer)))
(buffers frame))
(handler-case (accept 'boolean :prompt "Modified buffers exist. Quit anyway?")
......
......@@ -203,7 +203,8 @@ Leave point at the word end."
(define-command (com-downcase-word :name t :command-table case-table) ()
"Convert the characters from point until the next word end to lower case.
Leave point at the word end."
(downcase-word (point (current-window))))
(downcase-word (point (current-window))
(syntax (buffer (current-window)))))
(set-key 'com-downcase-word
'case-table
......@@ -217,7 +218,8 @@ If point is before the start of a word, convert the first character
of that word to upper case and the rest of the letters to lower case.
Leave point at the word end."
(capitalize-word (point (current-window))))
(capitalize-word (point (current-window))
(syntax (buffer (current-window)))))
(set-key 'com-capitalize-word
'case-table
......
......@@ -772,7 +772,7 @@ internal state of the parser. Do not alter it!"
'(#\Newline #\Page)))
(defgeneric paragraph-delimiter (syntax)
(:documentation "Return the object used as a paragraph
(:documentation "Return the object sequence used as a paragraph
deliminter in `syntax'.")
(:method (syntax)
'(#\Newline #\Newline)))
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment