/usr/share/emacs/site-lisp/riece/riece-foolproof.el is in riece 9.0.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | ;;; riece-foolproof.el --- prevent miss-operation in the command buffer -*- lexical-binding: t -*-
;; Copyright (C) 2004 TAKAHASHI Kaoru
;; Author: TAKAHASHI Kaoru <kaoru@kaisei.org>
;; Keywords: IRC, riece
;; This file is part of Riece.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; NOTE: This is an add-on module for Riece.
;;; Code:
(eval-when-compile
(require 'riece-identity)
(require 'riece-display))
(defconst riece-foolproof-description
"Prevent miss-operation in the command buffer.")
(defun riece-foolproof-get-channel-window (identity)
(get-buffer-window
(cdr (riece-identity-assoc
identity riece-channel-buffer-alist))))
(defun riece-foolproof-command-send-message-function ()
(when (get 'riece-foolproof 'riece-addon-enabled)
(unless (or (not riece-channel-buffer-mode)
(riece-foolproof-get-channel-window
riece-current-channel))
(error "Channel %s is not displayed"
(riece-identity-prefix riece-current-channel)))
(when (text-property-not-all
(riece-line-beginning-position) (riece-line-end-position)
'invisible nil)
(error "Invisible text included: %s"
(buffer-substring-no-properties
(riece-line-beginning-position)
(riece-line-end-position))))
(when executing-kbd-macro
(error "%s" "Forbidden to run keyboard macro"))))
(defun riece-foolproof-insinuate ()
(add-hook 'riece-command-send-message-hook
'riece-foolproof-command-send-message-function))
(defun riece-foolproof-uninstall ()
(remove-hook 'riece-command-send-message-hook
'riece-foolproof-command-send-message-function))
(provide 'riece-foolproof)
;;; riece-foolproof.el ends here
|