[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problems with rectangles

From: Mickey Ferguson
Subject: RE: Problems with rectangles
Date: Wed, 5 Dec 2001 21:46:57 -0800

I'm going to have to paste in my entire .emacs file.  (Well, my .emacs file
loads a file I created called MF-Init, and that's really what's here, but
it's the same thing.)  If I start up emacs with the -q switch (no init
file), then load rect.el as you describe, then go into picture mode and back
out, all works well.  If I then load MF-Init, go into an out of picture
mode, then the rectangle functions no longer work.  One key possibility
might be interaction with the rect-mark package.  Or it could be anything
else.  Anyway, I will include  my entire MF-Init.el, which may have a fair
amount of junk in it now, since it has evolved from emacs 18.54, to some of
the 19.x and 20.x versions, and now finally to 21.1, at the end of the

Here is my M-x view-lossage:

t h i s SPC i s SPC t i <backspace> e x t <return> 
C-p C-SPC C-f C-x r o C-x u M-x p i c t u r e - m o 
d SPC <return> C-c C-c C-SPC C-f C-x r o C-x C-g M-x 
v i e w - l o s SPC <return>

Here is my *Messages* text:

Loading MF-Init...
Loading time...
Loading image...done
Loading time...done
Loading paren...done
Loading hilit19...done
Loading font-lock...
Loading regexp-opt...done
Loading font-lock...done
Loading ispell4...done
Loading dired...done
Loading lib-complete...done
Loading picture...done
Loading view...done
Loading c:/emacs/.recentf...done
Loading bytecomp...done
Loading byte-opt...done
Loading generic...done
Loading mule-util...done
Loading MF-Init...done
Loading two-column...done
For information about the GNU Project and its goals, type C-h C-p.
Mark set

Type C-c C-c in this buffer to return it to Lisp Interaction mode.
Mark set
open-rectangle-line: Wrong number of arguments: #[(column) "Â Ã]Ä\"^Å )?"
[deactivate-mark column move-to-column 0 t hscroll-point-visible] 3], 2
Type C-x 1 to remove help window.  C-M-v to scroll the help.
Mark set [5 times]

;;; MF-Init.el:

;;; defintions sucked from _emacs
(put 'set-goal-column 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'eval-expression 'disabled nil)

  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(diary-mail-addr "address@hidden")
 '(max-specpdl-size 1000)
 '(which-windows-nt (quote (".com" ".exe" ".btm" ".cmd" ".bat")))
 '(next-line-add-newlines t))
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(font-lock-keyword-face ((((class color) (background light))
                            (:underline t :foreground "Purple")))))

;;; add 'which' command
(require 'which)

 '(diary-mail-addr "address@hidden")
 '(which-windows-nt (quote (".com" ".exe" ".btm" ".cmd" ".bat"))))
 '(font-lock-keyword-face ((((class color) (background light))
                            (:underline t :foreground "Purple")))))
(setq frame-title-format '(buffer-file-name "%f" "%b"))

(set-frame-width (selected-frame) 81)

;;; Use Stroustrup style, except use offset 2 instead of 4.
(setq-default c-basic-offset 2)
(add-hook 'c-mode-common-hook
          (function (lambda ()                                ; default
                      (c-set-style "stroustrup")              ; style
                      (setq c-basic-offset 2)
                      (c-set-offset 'substatement-open '0)    ; +
                      (c-set-offset 'label '--)               ; 2
                      ;; other local settings


;;; automatically allow both space and tab to perform full completion
(define-key minibuffer-local-must-match-map " " 'minibuffer-complete)
(define-key minibuffer-local-completion-map " " 'minibuffer-complete)

;;; change grep default arguments
(setq grep-command "grep -n -i ")

;;; automatically come up with display-time executed

;;; show column number
(column-number-mode 1)

(setq Info-default-directory-list '("~/info/"))

(defvar old-major-mode "text-mode")

;;; Clicking the mouse wheel is interpreted as a mouse-2 event, which is
;;; normally bound to mouse-yank-at-click (i.e., paste). Since it is easy to
;;; accidentally click the mouse wheel, you might find that you
;;; paste text as you scroll the wheel.
(global-unset-key [mouse-2])

;(menu-bar-mode -1) ;;; 'nil if you want to toggle, neg. for off, pos. for

(defun turn-on-indented-text-mode ()
  "Start indented-text-mode"
  (setq old-major-mode major-mode)

(defun turn-off-indented-text-mode ()
  "End indented-text-mode"
  (funcall old-major-mode))

;;; to prevent line wrapping (continuation) for a buffer,
;;; (set-variable truncate-lines nil)
;;; to scroll lines -- use C-x > to move right, C-x < to move left.

(setq default-truncate-lines nil)
(setq truncate-partial-width-windows nil)

(defun wrap-mode-on ()
  "Minor mode for making buffer not wrap long lines to next line."
  (setq truncate-lines nil))

(defun wrap-mode-off ()
  "Minor mode for making buffer wrap long lines to next line."
  (setq truncate-lines t))

(defun toggle-wrap-mode ()
  "Switch wrap mode from wrap to non-wrap, or vice-versa."
  (if (eq truncate-lines nil)

; only get full help with possible completions when asked
(setq completion-auto-help nil)

(put 'eval-expression 'disabled nil)

;;; default mode
(setq default-major-mode 'text-mode)
(setq default-fill-column 80)

(setq blink-matching-paren-distance 10000)

(setq backup-by-copying t)
(setq backup-by-copying-when-mismatch t)

(add-hook 'text-mode-hook 'turn-on-auto-fill)

(setq-default indent-tabs-mode nil)

(setq-default case-fold-search t)

(setq-default completion-ignore-case t)

(setq-default ls-lisp-ignore-case t)

;;; we want to use regions
(put 'narrow-to-region 'disabled nil)

;;; some extensions are not correctly lined up for autoloading
(setq auto-mode-alist (cons '("\\.c$" . c++-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist))

;;; show just the lines that will be left after #ifdef  M-x hide-ifdef-mode.
(autoload 'hide-ifdef-mode "hideif" nil t)

;;; Last shell command used to do a compilation; default for next
(setq compile-command "nmake")

(defun previous-window ()
  "Switch to previous window (same as C-u -1 other-window)"
  (other-window -1))

(defvar delete-whole-line nil
  "*If non-nil, `delete-line' with no arg at beginning of line deletes the
whole line.")

(defun delete-line (&optional arg)
  "Delete the rest of the current line; if no nonblanks there,
delete thru newline.
With prefix argument, delete that many lines from point.
Negative arguments delete lines backward.

When calling from a program, nil means \"no arg\",
a number counts as a prefix arg.

If `delete-whole-line' is non-nil, then delete the whole line
when given no argument at the beginning of a line."
  (interactive "P")
  (delete-region (point)
                 ;; This is adapted directly from kill-line in simple.el.
                   (if arg
                       (forward-line (prefix-numeric-value arg))
                     (if (eobp)
                         (signal 'end-of-buffer nil))
                     (if (or (looking-at "[ \t]*$")
                             (and delete-whole-line (bolp)))
                         (forward-line 1)

; Set tab width to every 2 columns
(setq-default tab-width 2)

(defun set-tab-width (arg)
  "Set the variable tab-width to the prefix given, or to 8 otherwise"
  (interactive "P")
  (setq tab-width (if (null arg) 8 (prefix-numeric-value arg)))
  (redraw-frame (selected-frame)))

(defun hilit-yank-pop-back (arg)
  "Move backward through the kill ring"
  (interactive "P")
  (hilit-yank-pop -1))

(global-set-key "\C-xt"         'set-tab-width)
(global-set-key "\C-xc"         'compare-windows)
(global-set-key "\C-xm"          nil)                ; don't need sendmail
(global-set-key "\C-xp"         'previous-window)
(global-set-key "\C-xw"         'toggle-wrap-mode)
(global-set-key "\C-x\C-l"      'goto-line)
(global-set-key "\C-x\C-p"      'picture-mode)
(global-set-key "\C-x\C-q"      'toggle-read-only)
(global-set-key "\M-\C-k"       'delete-line)
(global-set-key "\M-\C-y"       'hilit-yank-pop-back)

(global-set-key [C-enter]       'newline-and-indent)
(global-set-key [home]          'beginning-of-line)
(global-set-key [C-home]        'beginning-of-buffer)
(global-set-key [end]           'end-of-line)
(global-set-key [C-end]         'end-of-buffer)
(global-set-key [delete]        'delete-char)
(global-set-key [C-delete]      'kill-word)
(global-set-key [S-delete]      'kill-paragraph)
(global-set-key [C-left]        'backward-word)
(global-set-key [S-left]        'backward-sentence)
(global-set-key [C-right]       'forward-word)
(global-set-key [S-right]       'forward-sentence)
(global-set-key [C-up]          'backward-paragraph)
(global-set-key [C-down]        'forward-paragraph)

(setq w32-start-process-show-window nil)

(defun my-basename (string)
  "Return the basename of PATHNAME."
  (setq string (concat "/" string))
  (string-match ".*/\\([^/]+\\)$" string)
  (setq string (substring string (match-beginning 1) (match-end 1))))

;; Use PrFile32.exe to print plain text files to the default Windows printer
(setq lpr-command "c:\\Program Files\\PrintFile\\PrFile32.exe")
(setq lpr-switches '("/q"))
(setq printer-name nil)

;; if you just want to print plain with no special program, use the
;(setq printer-name "//orbison/AdminT2")

;; if you want to use PrFile32.exe in a fancy way (don't know if it works),
;(setq lpr-command "d:/utils/PrFile32.exe") ;; Use PrFile32 to print
;(setq lpr-destination '("/q"))  ; Option for PrFile32 print only
;(setq ps-print-use-gs nil)      ; do not use ghostscript
;(setq ps-paper-type 'ps-letter) ; the type of paper (if needed)
;(require  'print-nt)

;; very old stuff...
;(defun my-print ()
;  (interactive)
;  (setq w32-start-process-show-window nil)
;  (setq printer-name
;        (concat "~/lock/" (if (eq buffer-file-name nil)
;                              "Emacs.out"
;                            (my-basename buffer-file-name))))
;  (print-buffer)
;  (start-process-shell-command "Print" nil "PrFile32"
;                               (expand-file-name printer-name)))
;(require 'ps-print)
;(defun my-print-ps ()
;  (interactive)
;  (setq w32-start-process-show-window nil)
;  (ps-print-buffer "~/lock/print.ps")
;  (start-process-shell-command "Print" nil "PrFile32"
;                               (expand-file-name "~/lock/print.ps")))

;;;auto save stuff
;(load "auto-save")
;(setq auto-save-directory (expand-file-name "~/.autosaves/")
;      auto-save-directory-fallback auto-save-directory
;      auto-save-hash-p nil
;      ange-ftp-auto-save t
;      ange-ftp-auto-save-remotely nil
;      ;; now that we have auto-save-timeout, let's crank this up for
;      ;; better interactive response.
;      auto-save-interval 2000
;      auto-save-timeout  420
;      )

(require 'paren)

(defun my-recenter ()
  "Recenter, leaving cursor at 1/4 point"
  (recenter (/ (window-height) 4)))

(define-key global-map "\C-cl" 'my-recenter)

(load-library "hilit19")
;; Turn on hilit19 in some modes here
(load-library "font-lock")
(setq font-lock-maximum-size 1000000)

(setq hilit-mode-enable-list
(global-font-lock-mode t)
(substitute-key-definition 'hilit-recenter 'recenter
(global-set-key "\C-c\C-l" 'hilit-recenter)

;(This is a bug)

 ((eq window-system 'w32)
;    (load-library "term/w32-win")
;    (setq internal-doc-file-name "DOC-W32")
;    (setq internal-doc-file-name "DOC")

    (and window-system
          screen-width (x-display-pixel-width)
          screen-height (x-display-pixel-height)))

    (defun max-lines (arg)
      "Calculate maximum number of lines supported, based on number
pre-calculated, scaled to 800x600 display"
      (interactive "P")
      (if (eq screen-width 800)
        (+ 1 (/ (* screen-width arg) 800))))

    (defun normal-font-mode ()
      "Use normal font suitable for reading text"
; Code for home, use MsMail3 font.  For PEI (NT 4.0), use Lucida Console
;      "-*-MsMail3-normal-r-*-*-12-90-*-*-c-*-*-ansi-")
;      (set-frame-height (selected-frame) (max-lines 48)))
       "-*-Lucida Console-normal-r-*-*-11-81-96-96-c-*-iso8859-1")
      (set-frame-height (selected-frame) (max-lines 70)))

    (defun code-font-mode ()
      "Use smaller font suitable for reading lots of code on one page"
      (set-frame-height (selected-frame) (max-lines 70)))

    (defun big-code-font-mode ()
      "Use slightly smaller font suitable for reading code on one page"
       "-*-Lucida Console-normal-r-*-*-11-81-*-*-c-*-*-ansi-")
      (set-frame-height (selected-frame) (max-lines 70)))

;    (code-font-mode)

;Next command allows one to show exact setting to use to determine font
;string.  To execute this command, place the cursor at the end of the
;line and type C-x C-e.  It is especially effective if copied into the kill
;ring, change into a scratch buffer, and then use M-: to execute the
;inside eval-expression.  Use M-:, then yank the copied expression to the
;command line, select the font you want, and you'll see the font string to
;This command will call up the font dialog box and then print the
;x-style name of the selected font
;  (insert (prin1-to-string (w32-select-font)))

;  (set-face-foreground 'default "lightcyan")
;  (set-face-background 'default "midnightblue")
;  (set-face-foreground 'modeline "lightcyan")
;  (set-face-background 'modeline "red")

(require 'rect-mark)
;; Support for marking a rectangle of text with highlighting.
(define-key ctl-x-map "r\C-@" 'rm-set-mark)
(define-key ctl-x-map [?r ?\C-\ ] 'rm-set-mark)
(define-key ctl-x-map "r\C-x" 'rm-exchange-point-and-mark)
(define-key ctl-x-map "r\C-w" 'rm-kill-region)
(define-key ctl-x-map "r\M-w" 'rm-kill-ring-save)
(define-key global-map [S-down-mouse-1] 'rm-mouse-drag-region)
(autoload 'rm-set-mark "rect-mark" "Set mark for rectangle." t)
(autoload 'rm-exchange-point-and-mark "rect-mark"
  "Exchange point and mark for rectangle." t)
(autoload 'rm-kill-region "rect-mark"
  "Kill a rectangular region and save it in the kill ring." t)
(autoload 'rm-kill-ring-save "rect-mark"
  "Copy a rectangular region to the kill ring." t)
(autoload 'rm-mouse-drag-region "rect-mark"
  "Drag out a rectangular region with the mouse." t)

;; One vision of a better picture mode.
(add-hook 'picture-mode-hook 'rm-example-picture-mode-bindings)
(autoload 'rm-example-picture-mode-bindings "rect-mark"
  "Example rect-mark key and mouse bindings for picture mode.")

(require 'blinking-cursor)
(setq blinking-cursor-colors ["blue" "lightblue"])
(blinking-cursor-mode 0)
(blinking-cursor-mode 1)

;(load-library "iso-syntax")
;(standard-display-european 1)

(load-library "ispell4")
(setq text-mode-hook '(lambda ()
                        (local-set-key "\M-\t" 'ispell-complete-word)))
(setq tex-mode-hook '(lambda ()
                       (local-set-key "\M-\t" 'ispell-complete-word)))
(setq latex-mode-hook '(lambda ()
                         (local-set-key "\M-\t" 'ispell-complete-word)))

(load-library "dired-x")

(add-hook 'dired-load-hook
          (lambda ()
            (load "dired-x")
            ;; Set dired-x global variables here.  For example:
            ;; (setq dired-guess-shell-gnutar "gtar")
            ;; (setq dired-x-hands-off-my-keys nil)
            (setq dired-omit-files
                  (concat dired-omit-files "\\|^\\..+$"))
(add-hook 'dired-mode-hook
          (lambda ()
            ;; Set dired-x buffer-local variables here.  For example:
            (setq dired-omit-files-p t)

; want most recent files first in dired - well, Danno did...
; (setq dired-listing-switches "-alt")
(setq dired-listing-switches "-al")

(defun dired-quit ()
  "Quit out of DIRED."
  ;; Don't switch to the summary buffer even if it was recently visible.
  (let ((obuf (current-buffer)))
    (switch-to-buffer (other-buffer))
    (bury-buffer obuf)))

(defun dired-really-quit ()
  "Quit out of DIRED, killing buffer."
  (kill-buffer (current-buffer)))

(define-key dired-mode-map "q" 'dired-quit)
(define-key dired-mode-map "Q" 'dired-really-quit)
(define-key dired-mode-map "z" 'suspend-emacs)

(defun clean-backup-files ()
  "Get rid of those annoying '~' files."
  (dired ".")
;(global-set-key "\C-x~" 'clean-backup-files)

; Above function not that useful when we've got dired set to hide the ~
; But we can delete the current file's backup with this:
(defun clean-this-backup-file ()
  "Get rid of current buffer's annoying '~' file."
  (delete-file (concat buffer-file-name "~"))
  (message (concat buffer-file-name "~ deleted")))
(global-set-key "\C-x~" 'clean-this-backup-file)

;(autoload 'tar-mode "tar-mode")

(autoload 'visual-basic-mode "visual-basic-mode" "Visual Basic mode." t)
(setq auto-mode-alist (append '(("\\.\\(frm\\|bas\\|cls\\)$" .
                                 visual-basic-mode)) auto-mode-alist))
; to kill vb's auto untabify
(defun my-visual-basic-mode-hook ()
  (remove-hook 'write-file-hooks 'visual-basic-untabify))
(add-hook 'visual-basic-mode-hook 'my-visual-basic-mode-hook)
; to allow single line if statements
(setq-default visual-basic-allow-single-line-if t)

(load-library "lib-complete")

;(require 'gnuserv)

(load-library "picture")

;(load-library "man")

(load-library "view")

(require 'recentf)
(recentf-mode 1)

(require 'csdiff-setup)

(require 'table)
(add-hook 'text-mode-hook 'table-recognize)

(load-library "generic")
(require 'generic-x)

(require 'sql)
(add-hook 'sql-mode-hook
          (lambda ()
            (modify-syntax-entry ?\\ "." sql-mode-syntax-table)))


-----Original Message-----
From: Eli Zaretskii [mailto:address@hidden
Sent: Wednesday, December 05, 2001 10:49 AM
To: address@hidden
Subject: Re: Problems with rectangles

> From: Mickey Ferguson <address@hidden>
> Date: Wed, 5 Dec 2001 08:57:45 -0800 
> What I pasted above is from the *Messages* buffer.  But it's got some
> characters in there.  What it looks to me is:
>   open-rectangle-line: Wrong number of arguments: #[(column "^H^X?
> ?]-\"\210? )\207" [deactivate-mark column move-to-column 0 t
> hscroll-point-visible] 3], 2

That's byte-code, it's typical for a compiled function.  To get a
human-readable backtrace, say "M-x load-library RET rect.el RET" (note
the mandatory .el extension!), and then repeat whatever you need to do
to reproduce the problem.  You should now see a normal backtrace.
Please post that to gnu.emacs.bug.

-----Original Message-----
From: Richard Stallman [mailto:address@hidden
Sent: Wednesday, December 05, 2001 6:45 PM
To: address@hidden
Cc: address@hidden
Subject: Re: Problems with rectangles

Please provide a precise test case--tell us exactly what
to type in order to reproduce the problem.

Please read the Bugs section in the Emacs manual, which provides
guidelines on how to write a bug report to give us the
necessary information so we can fix the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]