* [gentoo-commits] gentoo-x86 commit in app-emacs/teco/files: 50teco-gentoo.el teco-7-minibuffer-prompt.patch
@ 2011-11-24 17:54 Ulrich Mueller (ulm)
0 siblings, 0 replies; only message in thread
From: Ulrich Mueller (ulm) @ 2011-11-24 17:54 UTC (permalink / raw
To: gentoo-commits
ulm 11/11/24 17:54:57
Added: 50teco-gentoo.el teco-7-minibuffer-prompt.patch
Log:
Initial import, from Emacs overlay. Ebuild contributed by me.
(Portage version: 2.1.10.37/cvs/Linux x86_64)
Revision Changes Path
1.1 app-emacs/teco/files/50teco-gentoo.el
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emacs/teco/files/50teco-gentoo.el?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emacs/teco/files/50teco-gentoo.el?rev=1.1&content-type=text/plain
Index: 50teco-gentoo.el
===================================================================
(add-to-list 'load-path "@SITELISP@")
(autoload 'teco:command "teco" "Read and execute a Teco command string." t)
(autoload 'teco "teco" "Read and execute a Teco command string." t)
(autoload 'teco:copy-to-q-reg "teco" "Copy region into Teco q-reg REG." t)
1.1 app-emacs/teco/files/teco-7-minibuffer-prompt.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emacs/teco/files/teco-7-minibuffer-prompt.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emacs/teco/files/teco-7-minibuffer-prompt.patch?rev=1.1&content-type=text/plain
Index: teco-7-minibuffer-prompt.patch
===================================================================
--- teco.el
+++ teco.el
@@ -2213,9 +2213,11 @@
(define-key teco:command-keymap "/" 'teco:command-slash)
(define-key teco:command-keymap "*" 'teco:command-star)
-(defvar teco:command-escapes nil
- "Records where ESCs are, since they are represented in the command buffer
-by $.")
+(defvar teco:command-display-table
+ (let ((table (make-display-table)))
+ (aset table ?\e [?$])
+ table)
+ "Display table used while reading teco commands.")
(defun teco:copy-to-q-reg (char start end)
"Copy region into Teco q-reg REG.
@@ -2244,15 +2246,11 @@
(defun teco:read-command ()
"Read a teco command string from the user."
- (let* ((teco:command-escapes nil)
- (command (catch 'teco:command-quit
- (read-from-minibuffer teco:prompt nil
- teco:command-keymap))))
- (if command
- (while teco:command-escapes
- (aset command (car teco:command-escapes) ?\e)
- (setq teco:command-escapes (cdr teco:command-escapes))))
- command))
+ (minibuffer-with-setup-hook
+ (lambda ()
+ (setq buffer-display-table teco:command-display-table))
+ (catch 'teco:command-quit
+ (read-from-minibuffer teco:prompt nil teco:command-keymap))))
(defun teco:command-self-insert ()
(interactive)
@@ -2276,16 +2274,13 @@
(interactive)
;; Two ESCs in a row terminate the command string
(if (eq last-command 'teco:command-escape)
- (throw 'teco:command-quit (buffer-string)))
+ (throw 'teco:command-quit (minibuffer-contents-no-properties)))
(teco:command-insert-character last-command-char))
(defun teco:command-ctrl-u ()
(interactive)
;; delete the characters
(kill-line 0)
- ;; forget that they were ESCs
- (while (and teco:command-escapes (<= (point) (car teco:command-escapes)))
- (setq teco:command-escapes (cdr teco:command-escapes)))
;; decide whether to shrink the window
(while (let ((a (insert ?\n))
(b (pos-visible-in-window-p))
@@ -2297,9 +2292,6 @@
(interactive)
;; delete the character
(backward-delete-char 1)
- ;; forget that it was an ESC
- (if (and teco:command-escapes (= (1- (point)) (car teco:command-escapes)))
- (setq teco:command-escapes (cdr teco:command-escapes)))
;; decide whether to shrink the window
(insert ?\n)
(if (prog1 (pos-visible-in-window-p)
@@ -2362,9 +2354,6 @@
;; Insert a single command character
(defun teco:command-insert-character (c)
- (if (eq c ?\e)
- (setq teco:command-escapes (cons (1- (point)) teco:command-escapes)
- c ?$))
(insert c)
(if (not (pos-visible-in-window-p))
(enlarge-window 1)))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-11-24 17:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-24 17:54 [gentoo-commits] gentoo-x86 commit in app-emacs/teco/files: 50teco-gentoo.el teco-7-minibuffer-prompt.patch Ulrich Mueller (ulm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox