;; -*- mode: emacs-lisp; coding: hebrew-iso-8bit-unix -*- ;; ekregister.el --- modified register commands for Emacs at Simon & Wiesel. ;; Copyright (C) 2001-2001 Ehud karni ;; This file is NOT part of GNU Emacs, distribution conditions below. ;; ;; EHUD KARNI ינרק דוהא ;; Ben Gurion st' 14 ןוירוג ןב 'חר ;; Kfar - Sava 44 257 אבס - רפכ ;; =================================== ;; 972-(0)9-7659599 ;; =================================== ;; RCS: $Id: ekregister.el,v 1.103 2000/03/05 13:47:49 ehud Exp ehud $ ;; ;; LOG: $Log: ekregister.el,v $ ;; 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 of the License, 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 this program; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (defvar extract-no-properties nil "*If non-nil, `buffer-substring' is really `buffer-substring-no-properties' See help for both") (defvar extract-no-properties-original-buffer-substring nil "Holder of the original `buffer-substring' function, DO NOT TOUCH !!!") (defun ek-buffer-substring (START END) "Hacked version of `buffer-substring' that uses `extract-no-properties' When it is nil works as the original `buffer-substring', when non-nil works as `buffer-substring-no-properties'. Original help of `buffer-substring': Return the contents of part of the current buffer as a string. The two arguments START and END are character positions; they can be in either order. The string returned is multibyte if the buffer is multibyte. This function copies the text properties of that part of the buffer into the result string; if you don't want the text properties, use `buffer-substring-no-properties' instead." (if extract-no-properties (buffer-substring-no-properties START END) (funcall extract-no-properties-original-buffer-substring START END))) (and (null extract-no-properties-original-buffer-substring) (setq extract-no-properties-original-buffer-substring (symbol-function 'buffer-substring)) (fset 'buffer-substring 'ek-buffer-substring)) ;; ========================= end of ek-buffer-sub.el =========================