Skip to content

Commit

Permalink
22.04: Adding .emacs and other emacspeak fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Dec 8, 2022
1 parent 07a9cf8 commit a478e24
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 1 deletion.
1 change: 1 addition & 0 deletions ubuntu/22.04/dist/opt/luwrain-utils/lwr-default-user
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ trap exit_handler EXIT HUP INT QUIT PIPE TERM

mount $PART /mnt
chroot /mnt usermod -l "$NEW_USER" luwrain
chroot /mnt groupmod -n "$NEW_USER" luwrain
chroot /mnt usermod -d "/home/$NEW_USER" "$NEW_USER"
mv /mnt/home/luwrain "/mnt/home/$NEW_USER"
echo "$NEW_USER" > /mnt/etc/luwrain/default-user
Expand Down
23 changes: 22 additions & 1 deletion ubuntu/22.04/dist/opt/luwrain-utils/lwr-emacspeak
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
#!/bin/bash -e
# Copyright 2022 Michael Pozhidaev <[email protected]>

TERM=dumb apt-get -y install emacspeak w3m-el
cat <<EOF | debconf-set-selections
emacspeak shared/emacspeak/database select
emacspeak shared/emacspeak/program string dtk-mv
emacspeak shared/emacspeak/fake select
emacspeak shared/emacspeak/rootgroup error
emacspeak shared/emacspeak/device select DECtalk 3
emacspeak shared/emacspeak/invaliduser error
emacspeak shared/emacspeak/port string none
emacspeak shared/emacspeak/tcl string tcl
emacspeak shared/emacspeak/groupies string
emacspeak shared/emacspeak/invalidport error
EOF

TERM=dumb apt-get -y install emacs-gtk emacspeak w3m-el
cd /usr/share/emacs/site-lisp/emacspeak/lisp
rm -f *.elc ../debian_compiled_version
patch -p1 < /opt/luwrain-utils/emacspeak-cyril.diff
/usr/lib/emacsen-common/packages/install/emacspeak emacs

cat <<EOF > /etc/emacspeak.conf
# emacspeak configuration
export DTK_PROGRAM=/usr/bin/voiceman-emacspeak
export DTK_TCL=tcl
export DTK_PORT=none
export DTK_DEVICE="espeak"
EOF
108 changes: 108 additions & 0 deletions ubuntu/22.04/dist/profile/.emacs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@

(setq user-mail-address "[email protected]")
(setq user-full-name "The LUWRAIN user")

(global-set-key [f2] 'save-buffer)
(global-set-key [f3] 'find-file)
(global-set-key [f4] 'kill-buffer)
(global-set-key [f5] 'other-window)
(global-set-key [f6] 'calendar)
(global-set-key [f7] 'gnus)
(global-set-key [f8] 'w3m-browse-url)
(global-set-key [f9] 'compile)
(global-set-key [f10] 'switch-to-buffer)
(global-set-key [f11] 'delete-other-windows)
(global-set-key [S-f3] 'shell-command)
(global-set-key [S-f4] 'shell)

(global-set-key (kbd "M-а") 'forward-word)
(global-set-key (kbd "M-и") 'backward-word)
(global-set-key (kbd "C-ц") 'kill-region)
(global-set-key (kbd "M-ц") 'kill-ring-save)
(global-set-key (kbd "C-н") 'yank)

;;Open shell in the current window
(push (cons "\\*shell\\*" display-buffer--same-window-action) display-buffer-alist)

(setq make-backup-files nil)
(setq inhibit-startup-screen t)
(setq line-move-visual nil)
(setq emacspeak-gnus-punctuation-mode 'all)
(setq emacspeak-message-punctuation-mode 'all)
(setq dtk-unicode-untouched-charsets '(ascii cyrillic-iso8859-5 latin-iso8859-1))
(setq kill-buffer-query-functions nil)
(setq emacspeak-play-emacspeak-startup-icon nil)

(require 'message)
(setq mm-coding-system-priorities '(koi8-r))
(add-to-list 'mm-body-charset-encoding-alist '(koi8-r . 8bit))
(setq message-cite-function 'message-cite-original-without-signature)
(setq smtpmail-default-smtp-server "localhost")
(setq send-mail-function 'smtpmail-send-it)
(require 'smtpmail)

(require 'w3m)
(setq mm-text-html-renderer 'w3m-standalone)
(remove-hook 'w3m-after-cursor-move-hook 'w3m-print-this-url)
(remove-hook 'w3m-after-cursor-move-hook 'w3m-show-form-hint)

(remove-hook 'w3m-after-cursor-move-hook 'w3m-highlight-current-anchor)
(remove-hook 'w3m-after-cursor-move-hook 'w3m-auto-show)

(setq browse-url-browser-function 'w3m-browse-url)
(setq w3m-search-engine-alist
'(
("google" "http:https://www.google.ru/search?q=%s&hl=ru&ie=koi8-r" koi8-r)
))
(setq w3m-search-default-engine "google")
(setq w3m-use-cookies t)

(require 'dired-x)
(add-hook 'dired-mode-hook
(lambda ()
(setq dired-omit-files-p t)
(setq dired-omit-extensions '("~" ".o" ".a" ".la" ".toc" ".aux" ".log"))
(setq dired-omit-files "^\\.")
))

;;java
(require 'cc-mode)
(add-hook 'java-mode-hook (lambda ()
(setq c-basic-offset 4)
(c-set-offset 'substatement-open 0)
(c-set-offset 'statement-cont 0)
))

(defun emacspeak-speak-shell-command-output (&optional output)
(emacspeak-auditory-icon 'task-done)
(cond
((or (stringp output) (bufferp output)) nil)
((not output)
(let ((buffer (get-buffer "*Shell Command Output*")))
(when buffer
(with-current-buffer buffer
(if (= (point-min) (point-max))
(dtk-speak (current-message))
(emacspeak-speak-region (point-min) (min (point-max) 8192))
(when (> (point-max) 8192)
(emacspeak-queue-auditory-icon 'ellipses)))))))
(:else
(if (= (point) (mark 'force))
(dtk-speak "Empty output")
(emacspeak-speak-region (point) (min (mark 'force) (+ (point) 8192)))
(when (> (mark 'force) (+ (point) 8192))
(emacspeak-queue-auditory-icon 'ellipses))))))

(defadvice shell-command (around emacspeak activate)
(let ((emacspeak-speak-messages nil))
ad-do-it)
(when (called-interactively-p 'interactive)
(emacspeak-speak-shell-command-output (ad-get-arg 1))))

(defadvice dired-do-shell-command (around emacspeak activate)
(let ((emacspeak-speak-messages nil))
ad-do-it)
(when (called-interactively-p 'interactive)
(emacspeak-speak-shell-command-output)))


0 comments on commit a478e24

Please sign in to comment.