From 027a4b6b3fd229f8aea323f59cb246d99deb8a75 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 16 May 2005 11:34:49 +0000 Subject: Replace `string-to-int' by `string-to-number'. --- lisp/ChangeLog | 79 ++++++ lisp/align.el | 4 +- lisp/ansi-color.el | 2 +- lisp/array.el | 10 +- lisp/calendar/appt.el | 4 +- lisp/calendar/cal-bahai.el | 8 +- lisp/calendar/cal-hebrew.el | 8 +- lisp/calendar/cal-islam.el | 8 +- lisp/calendar/calendar.el | 4 +- lisp/calendar/diary-lib.el | 20 +- lisp/calendar/solar.el | 2 +- lisp/dired-aux.el | 2 +- lisp/dired-x.el | 16 +- lisp/ediff-diff.el | 20 +- lisp/edmacro.el | 4 +- lisp/emacs-lisp/lisp-mnt.el | 2 +- lisp/emacs-lisp/re-builder.el | 2 +- lisp/emerge.el | 20 +- lisp/emulation/edt.el | 8 +- lisp/emulation/tpu-extras.el | 8 +- lisp/emulation/vip.el | 6 +- lisp/emulation/viper-ex.el | 8 +- lisp/faces.el | 2 +- lisp/files.el | 4 +- lisp/hexl.el | 2 +- lisp/international/fontset.el | 2 +- lisp/mail/feedmail.el | 2 +- lisp/mail/mailalias.el | 2 +- lisp/mail/rmail.el | 2 +- lisp/mail/rmailsum.el | 24 +- lisp/mail/smtpmail.el | 2 +- lisp/net/ange-ftp.el | 4 +- lisp/play/gametree.el | 6 +- lisp/progmodes/ada-xref.el | 6 +- lisp/progmodes/cperl-mode.el | 2 +- lisp/progmodes/ebrowse.el | 12 +- lisp/progmodes/etags.el | 16 +- lisp/progmodes/flymake.el | 2 +- lisp/progmodes/idlw-shell.el | 612 ++++++++++++++++++++--------------------- lisp/progmodes/ps-mode.el | 2 +- lisp/progmodes/vhdl-mode.el | 8 +- lisp/server.el | 6 +- lisp/shell.el | 2 +- lisp/startup.el | 6 +- lisp/term.el | 2 +- lisp/term/mac-win.el | 2 +- lisp/term/sun-mouse.el | 2 +- lisp/term/w32-win.el | 2 +- lisp/term/x-win.el | 2 +- lisp/textmodes/ispell.el | 4 +- lisp/textmodes/nroff-mode.el | 2 +- lisp/textmodes/reftex-cite.el | 10 +- lisp/textmodes/reftex-parse.el | 4 +- lisp/textmodes/texinfmt.el | 2 +- lisp/time-stamp.el | 10 +- lisp/time.el | 2 +- lisp/timezone.el | 16 +- lisp/vms-patch.el | 2 +- 58 files changed, 556 insertions(+), 477 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bc460f52430..bfbeac70942 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,84 @@ 2005-05-16 Juanma Barranquero + * align.el (align-regexp): + * ansi-color.el (ansi-color-get-face): + * array.el (array-reconfigure-rows, array-init-max-row) + (array-init-max-column, array-init-columns-per-line) + (array-init-field-width): + * dired-aux.el (dired-trample-file-versions): + * dired-x.el (dired-mark-sexp): + * ediff-diff.el (ediff-extract-diffs, ediff-get-diff3-group): + * edmacro.el (edmacro-finish-edit, edmacro-parse-keys): + * emerge.el (emerge-extract-diffs, emerge-get-diff3-group): + * faces.el (face-read-integer): + * files.el (backup-extract-version, insert-directory): + * hexl.el (hexl-insert-decimal-char): + * server.el (server-process-filter): + * shell.el (shell-extract-num): + * startup.el (command-line-1): + * term.el (term-command-hook): + * time-stamp.el (time-stamp, time-stamp-string-preprocess) + (time-stamp-do-number): + * time.el (display-time-update): + * timezone.el (timezone-parse-date, timezone-zone-to-minute) + (timezone-fix-time): + * vms-patch.el (vms-suspend-resume-hook): + * calendar/appt.el (appt-convert-time): + * calendar/cal-bahai.el (mark-bahai-diary-entries): + * calendar/cal-hebrew.el (mark-hebrew-diary-entries): + * calendar/cal-islam.el (mark-islamic-diary-entries): + * calendar/calendar.el (calendar-cursor-to-date) + (calendar-star-date): + * calendar/diary-lib.el (diary-attrtype-convert) + (mark-diary-entries, diary-entry-time): + * calendar/solar.el (solar-get-number): + * emacs-lisp/lisp-mnt.el (lm-last-modified-date): + * emacs-lisp/re-builder.el (reb-display-subexp): + * emulation/edt.el (edt-set-scroll-margins): + * emulation/tpu-extras.el (tpu-set-scroll-margins): + * emulation/vip.el (vip-get-ex-token, vip-get-ex-buffer) + (vip-get-ex-count): + * emulation/viper-ex.el (viper-get-ex-token) + (viper-get-ex-buffer, viper-get-ex-count, ex-next): + * international/fontset.el (fontset-plain-name): + * mail/feedmail.el (feedmail-look-at-queue-directory): + * mail/mailalias.el (mail-get-names): + * mail/rmail.el (rmail-convert-to-babyl-format): + * mail/rmailsum.el (rmail-make-basic-summary-line) + (rmail-summary-next-same-subject, rmail-summary-rmail-update) + (rmail-summary-goto-msg): + * mail/smtpmail.el (smtpmail-read-response): + * net/ange-ftp.el (ange-ftp-guess-hash-mark-size) + (ange-ftp-vms-add-file-entry): + * play/gametree.el (gametree-looking-at-ply) + (gametree-current-branch-score): + * progmodes/ada-xref.el (ada-prj-find-prj-file) + (ada-xref-find-in-modified-ali, ada-find-in-src-path): + * progmodes/cperl-mode.el (condition-case): + * progmodes/ebrowse.el (ebrowse-set-tree-indentation) + (ebrowse-set-member-buffer-column-width) + (ebrowse-select-1st-to-9nth): + * progmodes/etags.el (etags-snarf-tag): + * progmodes/flymake.el (flymake-parse-line): + * progmodes/idlw-shell.el (idlwave-shell-parse-line) + (idlwave-shell-filter-bp, idlwave-shell-goto-next-error) + (idlwave-shell-menu-def): + * progmodes/ps-mode.el (ps-run-goto-error): + * progmodes/vhdl-mode.el (vhdl-read-offset, vhdl-load-cache) + (vhdl-speedbar-contract-level): + * term/mac-win.el (x-handle-numeric-switch): + * term/sun-mouse.el (sun-get-frame-data): + * term/w32-win.el (x-handle-numeric-switch): + * term/x-win.el (x-handle-numeric-switch): + * textmodes/ispell.el (ispell-parse-output): + * textmodes/nroff-mode.el (nroff-outline-level): + * textmodes/reftex-cite.el (reftex-bib-sort-year) + (reftex-bib-sort-year-reverse, reftex-format-citation): + * textmodes/reftex-parse.el (reftex-init-section-numbers) + (reftex-section-number): + * textmodes/texinfmt.el (texinfo-paragraphindent): Replace + `string-to-int' by `string-to-number'. + * international/latexenc.el: Add page marker to force the "Local Variables:" string out of the last page. diff --git a/lisp/align.el b/lisp/align.el index 5238a75807d..563e839f5fe 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -938,10 +938,10 @@ region, call `align-regexp' and type in that regular expression." (if current-prefix-arg (list (read-string "Complex align using regexp: " "\\(\\s-*\\)") - (string-to-int + (string-to-number (read-string "Parenthesis group to modify (justify if negative): " "1")) - (string-to-int + (string-to-number (read-string "Amount of spacing (or column if negative): " (number-to-string align-default-spacing))) (y-or-n-p "Repeat throughout line? ")) diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index e505f91e901..9b36a403b5d 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -619,7 +619,7 @@ ESCAPE-SEQ is a SGR control sequences such as \\033[34m. The parameter (while (string-match ansi-color-r escape-seq i) (setq i (match-end 0) val (ansi-color-get-face-1 - (string-to-int (match-string 0 escape-seq) 10))) + (string-to-number (match-string 0 escape-seq) 10))) (cond ((not val)) ((eq val 'default) (setq f (list val))) diff --git a/lisp/array.el b/lisp/array.el index 3aa5d4bd319..56ef9b264de 100644 --- a/lisp/array.el +++ b/lisp/array.el @@ -647,7 +647,7 @@ of array-rows-numbered." (<= new-columns-per-line array-max-column)) (setq check nil) (setq new-columns-per-line - (string-to-int + (string-to-number (read-input (format "Columns per line (1 - %d): " array-max-column))))))) ;; Check on new-rows-numbered. It has to be done this way @@ -927,22 +927,22 @@ Entering array mode calls the function `array-mode-hook'." (defun array-init-max-row (&optional arg) "Initialize the value of `array-max-row'." (setq array-max-row - (or arg (string-to-int (read-input "Number of array rows: "))))) + (or arg (string-to-number (read-input "Number of array rows: "))))) (defun array-init-max-column (&optional arg) "Initialize the value of `array-max-column'." (setq array-max-column - (or arg (string-to-int (read-input "Number of array columns: "))))) + (or arg (string-to-number (read-input "Number of array columns: "))))) (defun array-init-columns-per-line (&optional arg) "Initialize the value of `array-columns-per-line'." (setq array-columns-per-line - (or arg (string-to-int (read-input "Array columns per line: "))))) + (or arg (string-to-number (read-input "Array columns per line: "))))) (defun array-init-field-width (&optional arg) "Initialize the value of `array-field-width'." (setq array-field-width - (or arg (string-to-int (read-input "Field width: "))))) + (or arg (string-to-number (read-input "Field width: "))))) (defun array-init-rows-numbered (&optional arg) "Initialize the value of `array-rows-numbered'." diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index d007e5b4546..c3f29e3d371 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -633,11 +633,11 @@ hour and minute parts." (min 0)) (string-match "[:.]\\([0-9][0-9]\\)" time2conv) - (setq min (string-to-int + (setq min (string-to-number (match-string 1 time2conv))) (string-match "[0-9]?[0-9][:.]" time2conv) - (setq hr (string-to-int + (setq hr (string-to-number (match-string 0 time2conv))) ;; convert the time appointment time into 24 hour time diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el index 2bcfaf648ec..7e6149d8e94 100644 --- a/lisp/calendar/cal-bahai.el +++ b/lisp/calendar/cal-bahai.el @@ -340,13 +340,13 @@ nongregorian-diary-marking-hook." (buffer-substring (match-beginning m-name-pos) (match-end m-name-pos)))) - (mm (string-to-int + (mm (string-to-number (if m-pos (buffer-substring (match-beginning m-pos) (match-end m-pos)) ""))) - (dd (string-to-int + (dd (string-to-number (if d-pos (buffer-substring (match-beginning d-pos) @@ -365,14 +365,14 @@ nongregorian-diary-marking-hook." (calendar-bahai-from-absolute (calendar-absolute-from-gregorian (calendar-current-date))))) - (y (+ (string-to-int y-str) + (y (+ (string-to-number y-str) (* 100 (/ current-y 100))))) (if (> (- y current-y) 50) (- y 100) (if (> (- current-y y) 50) (+ y 100) y))) - (string-to-int y-str))))) + (string-to-number y-str))))) (if dd-name (mark-calendar-days-named (cdr (assoc-string (substring dd-name 0 3) diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el index f66b4966e57..8f9f7723d5d 100644 --- a/lisp/calendar/cal-hebrew.el +++ b/lisp/calendar/cal-hebrew.el @@ -718,13 +718,13 @@ is provided for use as part of the nongregorian-diary-marking-hook." (buffer-substring (match-beginning m-name-pos) (match-end m-name-pos)))) - (mm (string-to-int + (mm (string-to-number (if m-pos (buffer-substring (match-beginning m-pos) (match-end m-pos)) ""))) - (dd (string-to-int + (dd (string-to-number (if d-pos (buffer-substring (match-beginning d-pos) @@ -743,14 +743,14 @@ is provided for use as part of the nongregorian-diary-marking-hook." (calendar-hebrew-from-absolute (calendar-absolute-from-gregorian (calendar-current-date))))) - (y (+ (string-to-int y-str) + (y (+ (string-to-number y-str) (* 100 (/ current-y 100))))) (if (> (- y current-y) 50) (- y 100) (if (> (- current-y y) 50) (+ y 100) y))) - (string-to-int y-str))))) + (string-to-number y-str))))) (if dd-name (mark-calendar-days-named (cdr (assoc-string dd-name diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el index 1ac6f0677b1..786c71f24ce 100644 --- a/lisp/calendar/cal-islam.el +++ b/lisp/calendar/cal-islam.el @@ -337,13 +337,13 @@ provided for use as part of the nongregorian-diary-marking-hook." (buffer-substring (match-beginning m-name-pos) (match-end m-name-pos)))) - (mm (string-to-int + (mm (string-to-number (if m-pos (buffer-substring (match-beginning m-pos) (match-end m-pos)) ""))) - (dd (string-to-int + (dd (string-to-number (if d-pos (buffer-substring (match-beginning d-pos) @@ -362,14 +362,14 @@ provided for use as part of the nongregorian-diary-marking-hook." (calendar-islamic-from-absolute (calendar-absolute-from-gregorian (calendar-current-date))))) - (y (+ (string-to-int y-str) + (y (+ (string-to-number y-str) (* 100 (/ current-y 100))))) (if (> (- y current-y) 50) (- y 100) (if (> (- current-y y) 50) (+ y 100) y))) - (string-to-int y-str))))) + (string-to-number y-str))))) (if dd-name (mark-calendar-days-named (cdr (assoc-string dd-name diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 305ecc1e9bc..45754110319 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -2574,7 +2574,7 @@ ERROR is t, otherwise just returns nil." (if (not (looking-at " ")) (re-search-backward "[^0-9]")) (list month - (string-to-int (buffer-substring (1+ (point)) (+ 4 (point)))) + (string-to-number (buffer-substring (1+ (point)) (+ 4 (point)))) year)) (if (looking-at "\\*") (save-excursion @@ -2964,7 +2964,7 @@ calendar window has been prepared." (make-local-variable 'calendar-starred-day) (forward-char 1) (setq calendar-starred-day - (string-to-int + (string-to-number (buffer-substring (point) (- (point) 2)))) (delete-char -2) (insert "**") diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 1832e0cd0fb..312b8841cf9 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -205,7 +205,7 @@ Valid TYPEs are: string, symbol, int, stringtnil, tnil." (let (ret) (setq ret (cond ((eq type 'string) attrvalue) ((eq type 'symbol) (read attrvalue)) - ((eq type 'int) (string-to-int attrvalue)) + ((eq type 'int) (string-to-number attrvalue)) ((eq type 'stringtnil) (cond ((string= "t" attrvalue) t) ((string= "nil" attrvalue) nil) @@ -908,13 +908,13 @@ diary entries." (buffer-substring-no-properties (match-beginning m-name-pos) (match-end m-name-pos)))) - (mm (string-to-int + (mm (string-to-number (if m-pos (buffer-substring-no-properties (match-beginning m-pos) (match-end m-pos)) ""))) - (dd (string-to-int + (dd (string-to-number (if d-pos (buffer-substring-no-properties (match-beginning d-pos) @@ -931,7 +931,7 @@ diary entries." (let* ((current-y (extract-calendar-year (calendar-current-date))) - (y (+ (string-to-int y-str) + (y (+ (string-to-number y-str) (* 100 (/ current-y 100))))) (if (> (- y current-y) 50) @@ -939,7 +939,7 @@ diary entries." (if (> (- current-y y) 50) (+ y 100) y))) - (string-to-int y-str)))) + (string-to-number y-str)))) (save-excursion (setq entry (buffer-substring-no-properties (point) (line-end-position)) @@ -1149,22 +1149,22 @@ be used instead of a colon (:) to separate the hour and minute parts." (cond ((string-match ; Military time "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s) - (+ (* 100 (string-to-int + (+ (* 100 (string-to-number (substring s (match-beginning 1) (match-end 1)))) - (string-to-int (substring s (match-beginning 2) (match-end 2))))) + (string-to-number (substring s (match-beginning 2) (match-end 2))))) ((string-match ; Hour only XXam or XXpm "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s) - (+ (* 100 (% (string-to-int + (+ (* 100 (% (string-to-number (substring s (match-beginning 1) (match-end 1))) 12)) (if (equal ?a (downcase (aref s (match-beginning 2)))) 0 1200))) ((string-match ; Hour and minute XX:XXam or XX:XXpm "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]\\([0-9][0-9]\\)\\([ap]\\)m\\>" s) - (+ (* 100 (% (string-to-int + (+ (* 100 (% (string-to-number (substring s (match-beginning 1) (match-end 1))) 12)) - (string-to-int (substring s (match-beginning 2) (match-end 2))) + (string-to-number (substring s (match-beginning 2) (match-end 2))) (if (equal ?a (downcase (aref s (match-beginning 3)))) 0 1200))) (t diary-unknown-time)))) ; Unrecognizable diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index e1c4950b24b..8401aeb9bfd 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el @@ -227,7 +227,7 @@ Needed for polar areas, in order to know whether the day lasts 0 or 24 hours.") Returns nil if nothing was entered." (let ((x (read-string prompt ""))) (if (not (string-equal x "")) - (string-to-int x)))) + (string-to-number x)))) ;; The condition-case stuff is needed to catch bogus arithmetic ;; exceptions that occur on some machines (like Sparcs) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 0ce006af241..66150968e61 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -428,7 +428,7 @@ with a prefix argument." (setq base-version-list ; there was a base version to which (assoc (substring fn 0 start-vn) ; this looks like a dired-file-version-alist)) ; subversion - (not (memq (string-to-int (substring fn (+ 2 start-vn))) + (not (memq (string-to-number (substring fn (+ 2 start-vn))) base-version-list)) ; this one doesn't make the cut (progn (beginning-of-line) (delete-char 1) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 6b44b73b170..86c955650e8 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1501,10 +1501,10 @@ to mark all zero length files." (if (looking-at dired-re-inode-size) (progn (goto-char (match-end 0)) - (setq inode (string-to-int (buffer-substring (match-beginning 1) - (match-end 1))) - s (string-to-int (buffer-substring (match-beginning 2) - (match-end 2))))) + (setq inode (string-to-number (buffer-substring (match-beginning 1) + (match-end 1))) + s (string-to-number (buffer-substring (match-beginning 2) + (match-end 2))))) (setq inode nil s nil)) (setq mode (buffer-substring (point) (+ mode-len (point)))) @@ -1516,10 +1516,10 @@ to mark all zero length files." (re-search-forward dired-move-to-filename-regexp) (goto-char (match-beginning 1)) (forward-char -1) - (setq size (string-to-int (buffer-substring (save-excursion - (backward-word 1) - (setq pos (point))) - (point)))) + (setq size (string-to-number (buffer-substring (save-excursion + (backward-word 1) + (setq pos (point))) + (point)))) (goto-char pos) (backward-word 1) ;; if no gid is displayed, gid will be set to uid diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el index c41d733aaca..4c13e6fc0e1 100644 --- a/lisp/ediff-diff.el +++ b/lisp/ediff-diff.el @@ -393,20 +393,20 @@ one optional arguments, diff-number to refine.") (ediff-with-current-buffer diff-buffer (goto-char (point-min)) (while (re-search-forward ediff-match-diff-line nil t) - (let* ((a-begin (string-to-int (buffer-substring (match-beginning 1) - (match-end 1)))) + (let* ((a-begin (string-to-number (buffer-substring (match-beginning 1) + (match-end 1)))) (a-end (let ((b (match-beginning 3)) (e (match-end 3))) (if b - (string-to-int (buffer-substring b e)) + (string-to-number (buffer-substring b e)) a-begin))) (diff-type (buffer-substring (match-beginning 4) (match-end 4))) - (b-begin (string-to-int (buffer-substring (match-beginning 5) - (match-end 5)))) + (b-begin (string-to-number (buffer-substring (match-beginning 5) + (match-end 5)))) (b-end (let ((b (match-beginning 7)) (e (match-end 7))) (if b - (string-to-int (buffer-substring b e)) + (string-to-number (buffer-substring b e)) b-begin))) a-begin-pt a-end-pt b-begin-pt b-end-pt c-begin c-end c-begin-pt c-end-pt) @@ -934,16 +934,16 @@ delimiter regions")) ;; it is a "c" group (if (match-beginning 2) ;; it has two numbers - (list (string-to-int + (list (string-to-number (buffer-substring (match-beginning 1) (match-end 1))) - (1+ (string-to-int + (1+ (string-to-number (buffer-substring (match-beginning 3) (match-end 3))))) ;; it has one number - (let ((x (string-to-int + (let ((x (string-to-number (buffer-substring (match-beginning 1) (match-end 1))))) (list x (1+ x)))) ;; it is an "a" group - (let ((x (1+ (string-to-int + (let ((x (1+ (string-to-number (buffer-substring (match-beginning 1) (match-end 1)))))) (list x x))))) diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 67be9f34a15..939e275f1b9 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -280,7 +280,7 @@ or nil, use a compact 80-column format." (let ((str (buffer-substring (match-beginning 1) (match-end 1)))) (unless (equal str "") - (setq mac-counter (string-to-int str)))) + (setq mac-counter (string-to-number str)))) t) ((looking-at "Format:[ \t]*\"\\([^\n]*\\)\"[ \t]*$") (when edmacro-store-hook @@ -698,7 +698,7 @@ This function assumes that the events can be stored in a string." (times 1)) (setq pos (match-end 0)) (when (string-match "\\([0-9]+\\)\\*." word) - (setq times (string-to-int (substring word 0 (match-end 1)))) + (setq times (string-to-number (substring word 0 (match-end 1)))) (setq word (substring word (1+ (match-end 1))))) (cond ((string-match "^<<.+>>$" word) (setq key (vconcat (if (eq (key-binding [?\M-x]) diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 701da1c4dec..a385a32935e 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -418,7 +418,7 @@ ISO-DATE non-nil means return the date in ISO 8601 format." (format "%s-%s-%s" yyyy mm dd) (format "%s %s %s" dd - (nth (string-to-int mm) + (nth (string-to-number mm) '("" "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) yyyy)))))) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 1c8d12fef0e..a2aed39d00a 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -557,7 +557,7 @@ optional fourth argument FORCE is non-nil." (interactive) (setq reb-subexp-displayed - (or subexp (string-to-int (format "%c" last-command-char)))) + (or subexp (string-to-number (format "%c" last-command-char)))) (reb-update-modestring) (reb-do-update reb-subexp-displayed)) diff --git a/lisp/emerge.el b/lisp/emerge.el index f9821111e71..1f105163f46 100644 --- a/lisp/emerge.el +++ b/lisp/emerge.el @@ -657,20 +657,20 @@ This is *not* a user option, since Emerge uses it for its own processing.") diff-buffer (goto-char (point-min)) (while (re-search-forward emerge-match-diff-line nil t) - (let* ((a-begin (string-to-int (buffer-substring (match-beginning 1) - (match-end 1)))) + (let* ((a-begin (string-to-number (buffer-substring (match-beginning 1) + (match-end 1)))) (a-end (let ((b (match-beginning 3)) (e (match-end 3))) (if b - (string-to-int (buffer-substring b e)) + (string-to-number (buffer-substring b e)) a-begin))) (diff-type (buffer-substring (match-beginning 4) (match-end 4))) - (b-begin (string-to-int (buffer-substring (match-beginning 5) - (match-end 5)))) + (b-begin (string-to-number (buffer-substring (match-beginning 5) + (match-end 5)))) (b-end (let ((b (match-beginning 7)) (e (match-end 7))) (if b - (string-to-int (buffer-substring b e)) + (string-to-number (buffer-substring b e)) b-begin)))) ;; fix the beginning and end numbers, because diff is somewhat ;; strange about how it numbers lines @@ -862,16 +862,16 @@ This is *not* a user option, since Emerge uses it for its own processing.") ;; it is a "c" group (if (match-beginning 2) ;; it has two numbers - (list (string-to-int + (list (string-to-number (buffer-substring (match-beginning 1) (match-end 1))) - (1+ (string-to-int + (1+ (string-to-number (buffer-substring (match-beginning 3) (match-end 3))))) ;; it has one number - (let ((x (string-to-int + (let ((x (string-to-number (buffer-substring (match-beginning 1) (match-end 1))))) (list x (1+ x)))) ;; it is an "a" group - (let ((x (1+ (string-to-int + (let ((x (1+ (string-to-number (buffer-substring (match-beginning 1) (match-end 1)))))) (list x x))))) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index ff0298e9a17..01f0af6f307 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -1256,16 +1256,16 @@ Argument BOTTOM is the bottom margin in number of lines or percent of window." ;; set top scroll margin (or (string= top "") (if (string= "%" (substring top -1)) - (setq edt-top-scroll-margin (string-to-int top)) + (setq edt-top-scroll-margin (string-to-number top)) (setq edt-top-scroll-margin - (/ (1- (+ (* (string-to-int top) 100) (window-height))) + (/ (1- (+ (* (string-to-number top) 100) (window-height))) (window-height))))) ;; set bottom scroll margin (or (string= bottom "") (if (string= "%" (substring bottom -1)) - (setq edt-bottom-scroll-margin (string-to-int bottom)) + (setq edt-bottom-scroll-margin (string-to-number bottom)) (setq edt-bottom-scroll-margin - (/ (1- (+ (* (string-to-int bottom) 100) (window-height))) + (/ (1- (+ (* (string-to-number bottom) 100) (window-height))) (window-height))))) ;; report scroll margin settings if running interactively (and (interactive-p) diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el index ced88ff3fdf..9c417dd3a40 100644 --- a/lisp/emulation/tpu-extras.el +++ b/lisp/emulation/tpu-extras.el @@ -440,16 +440,16 @@ version that respects the bottom scroll margin." ;; set top scroll margin (or (string= top "") (if (string= "%" (substring top -1)) - (setq tpu-top-scroll-margin (string-to-int top)) + (setq tpu-top-scroll-margin (string-to-number top)) (setq tpu-top-scroll-margin - (/ (1- (+ (* (string-to-int top) 100) (window-height))) + (/ (1- (+ (* (string-to-number top) 100) (window-height))) (window-height))))) ;; set bottom scroll margin (or (string= bottom "") (if (string= "%" (substring bottom -1)) - (setq tpu-bottom-scroll-margin (string-to-int bottom)) + (setq tpu-bottom-scroll-margin (string-to-number bottom)) (setq tpu-bottom-scroll-margin - (/ (1- (+ (* (string-to-int bottom) 100) (window-height))) + (/ (1- (+ (* (string-to-number bottom) 100) (window-height))) (window-height))))) ;; report scroll margin settings if running interactively (and (interactive-p) diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el index af878085ba8..19f08d54989 100644 --- a/lisp/emulation/vip.el +++ b/lisp/emulation/vip.el @@ -2177,7 +2177,7 @@ a token has type \(command, address, end-mark\) and value." (cond ((string= ex-token-type "plus") "add-number") ((string= ex-token-type "minus") "sub-number") (t "abs-number"))) - (setq ex-token (string-to-int (buffer-substring (point) (mark))))) + (setq ex-token (string-to-number (buffer-substring (point) (mark))))) ((looking-at "\\$") (forward-char 1) (setq ex-token-type "end")) @@ -2471,7 +2471,7 @@ a token has type \(command, address, end-mark\) and value." (progn (set-mark (point)) (re-search-forward "[0-9][0-9]*") - (setq ex-count (string-to-int (buffer-substring (point) (mark)))) + (setq ex-count (string-to-number (buffer-substring (point) (mark)))) (skip-chars-forward " \t"))) (if (looking-at "[pl#]") (progn @@ -2496,7 +2496,7 @@ a token has type \(command, address, end-mark\) and value." (progn (set-mark (point)) (re-search-forward "[0-9][0-9]*") - (setq ex-count (string-to-int (buffer-substring (point) (mark)))) + (setq ex-count (string-to-number (buffer-substring (point) (mark)))) (skip-chars-forward " \t"))) (if (looking-at "[pl#]") (progn diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index 90b006ffb65..9f33bdbad53 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -434,7 +434,7 @@ reversed." ((eq ex-token-type 'minus) 'sub-number) (t 'abs-number))) (setq ex-token - (string-to-int (buffer-substring (point) (mark t))))) + (string-to-number (buffer-substring (point) (mark t))))) ((looking-at "\\$") (forward-char 1) (setq ex-token-type 'end)) @@ -912,7 +912,7 @@ reversed." (progn (set-mark (point)) (re-search-forward "[0-9][0-9]*") - (setq ex-count (string-to-int (buffer-substring (point) (mark t)))) + (setq ex-count (string-to-number (buffer-substring (point) (mark t)))) (skip-chars-forward " \t"))) (if (looking-at "[pl#]") (progn @@ -938,7 +938,7 @@ reversed." (progn (set-mark (point)) (re-search-forward "[0-9][0-9]*") - (setq ex-count (string-to-int (buffer-substring (point) (mark t)))) + (setq ex-count (string-to-number (buffer-substring (point) (mark t)))) (skip-chars-forward " \t"))) (if (looking-at "[pl#]") (progn @@ -1490,7 +1490,7 @@ reversed." (progn (ex-edit t) (throw 'ex-edit nil)) - (setq count (string-to-int ex-file)) + (setq count (string-to-number ex-file)) (if (= count 0) (setq count 1)) (if (< count 0) (error "Usage: `next ' (count >= 0)")))) (setq count 1)) diff --git a/lisp/faces.el b/lisp/faces.el index 6b3811a3d26..6f8f3336450 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1014,7 +1014,7 @@ name of the attribute for prompting. Value is the new attribute value." ((member new-value '("unspecified-fg" "unspecified-bg")) new-value) (t - (string-to-int new-value))))) + (string-to-number new-value))))) (defun read-face-attribute (face attribute &optional frame) diff --git a/lisp/files.el b/lisp/files.el index 5cfb49307a5..d519f041152 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2988,7 +2988,7 @@ Uses the free variable `backup-extract-version-start', whose value should be the index in the name where the version number begins." (if (and (string-match "[0-9]+~$" fn backup-extract-version-start) (= (match-beginning 0) backup-extract-version-start)) - (string-to-int (substring fn backup-extract-version-start -1)) + (string-to-number (substring fn backup-extract-version-start -1)) 0)) ;; I believe there is no need to alter this behavior for VMS; @@ -4552,7 +4552,7 @@ normally equivalent short `-D' option is just passed on to (if (string-match "ls (.*utils) \\([0-9.]*\\)$" version-out) (let* ((version (match-string 1 version-out)) (split (split-string version "[.]")) - (numbers (mapcar 'string-to-int split)) + (numbers (mapcar 'string-to-number split)) (min '(5 2 1)) comparison) (while (and (not comparison) (or numbers min)) diff --git a/lisp/hexl.el b/lisp/hexl.el index 99bbda91c6c..35674e1d10a 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -874,7 +874,7 @@ Embedded whitespace, dashes, and periods in the string are ignored." (defun hexl-insert-decimal-char (arg) "Insert a character given by its decimal code ARG times at point." (interactive "p") - (let ((num (string-to-int (read-string "Decimal Number: ")))) + (let ((num (string-to-number (read-string "Decimal Number: ")))) (if (< num 0) (error "Decimal number out of range") (hexl-insert-multibyte-char num arg)))) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index c67030ac067..863cc99c4db 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -492,7 +492,7 @@ with \"fontset\" in ` field." name) (if (not (string= "fontset" charset)) fontset - (if (> (string-to-int size) 0) + (if (> (string-to-number size) 0) (setq name (format "%s: %s-dot" nickname size)) (setq name nickname)) (cond ((string-match "^medium$" weight) diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 3d1b1951421..7c7265ac8c9 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -1835,7 +1835,7 @@ the counts." (setq blobbet (file-name-nondirectory blobby)) (if (string-match "^[0-9][0-9][0-9]-" blobbet) (let ((water-mark)) - (setq water-mark (string-to-int (substring blobbet 0 3))) + (setq water-mark (string-to-number (substring blobbet 0 3))) (if (> water-mark high-water) (setq high-water water-mark)))) (setq q-cnt (1+ q-cnt))) (t (setq q-oth (1+ q-oth))) diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index b520841db3d..88f166707c3 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -449,7 +449,7 @@ PATTERN is the string we want to complete." (add-to-list 'mail-local-names (cons (match-string 1) (user-full-name - (string-to-int (match-string 2)))))) + (string-to-number (match-string 2)))))) (beginning-of-line 2)) (kill-buffer (current-buffer)))) (if (or (eq mail-names t) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 8ba9408a76f..c68bb80d80f 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -1990,7 +1990,7 @@ is non-nil if the user has supplied the password interactively. header-end t) (let ((beg (point)) (eol (progn (end-of-line) (point)))) - (string-to-int (buffer-substring beg eol))))))) + (string-to-number (buffer-substring beg eol))))))) (and size (if (and (natnump size) (<= (+ header-end size) (point-max)) diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index a49b47453d8..f551239907d 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -375,17 +375,17 @@ Setting this variable has an effect only before reading a mail." (cond ((re-search-forward "\\([^0-9:]\\)\\([0-3]?[0-9]\\)\\([- \t_]+\\)\\([adfjmnos][aceopu][bcglnprtvy]\\)" (save-excursion (end-of-line) (point)) t) (format "%2d-%3s" - (string-to-int (buffer-substring - (match-beginning 2) - (match-end 2))) + (string-to-number (buffer-substring + (match-beginning 2) + (match-end 2))) (buffer-substring (match-beginning 4) (match-end 4)))) ((re-search-forward "\\([^a-z]\\)\\([adfjmnos][acepou][bcglnprtvy]\\)\\([-a-z \t_]*\\)\\([0-9][0-9]?\\)" (save-excursion (end-of-line) (point)) t) (format "%2d-%3s" - (string-to-int (buffer-substring - (match-beginning 4) - (match-end 4))) + (string-to-number (buffer-substring + (match-beginning 4) + (match-end 4))) (buffer-substring (match-beginning 2) (match-end 2)))) ((re-search-forward "\\(19\\|20\\)\\([0-9][0-9]\\)-\\([01][0-9]\\)-\\([0-3][0-9]\\)" @@ -580,7 +580,7 @@ If N is negative, go backwards." ;; Advance thru summary. (forward-line (if forward 1 -1)) ;; Get msg number of this line. - (setq i (string-to-int + (setq i (string-to-number (buffer-substring (point) (min (point-max) (+ 6 (point)))))) ;; See if that msg has desired subject. @@ -791,10 +791,10 @@ Search, the `unseen' attribute is restored.") (forward-line -1)) (beginning-of-line) (skip-chars-forward " ") - (let ((msg-num (string-to-int (buffer-substring - (point) - (progn (skip-chars-forward "0-9") - (point)))))) + (let ((msg-num (string-to-number (buffer-substring + (point) + (progn (skip-chars-forward "0-9") + (point)))))) ;; Always leave `unseen' removed ;; if we get out of isearch mode. ;; Don't let a subsequent isearch restore that `unseen'. @@ -1061,7 +1061,7 @@ If SKIP-RMAIL, don't do anything to the Rmail buffer." (buf rmail-buffer) (cur (point)) message-not-found - (curmsg (string-to-int + (curmsg (string-to-number (buffer-substring (point) (min (point-max) (+ 6 (point)))))) (total (save-excursion (set-buffer buf) rmail-total-messages))) diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 605af6cdbe7..3cf17f8968d 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -822,7 +822,7 @@ This is relative to `smtpmail-queue-dir'.") nil (setq response-continue nil) (setq return-value - (cons (string-to-int + (cons (string-to-number (buffer-substring begin end)) (nreverse response-strings))))) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 8b4ed89e7b0..98e1bbf68f2 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -2109,7 +2109,7 @@ suffix of the form #PORT to specify a non-default port" (line (cdr status))) (save-match-data (if (string-match ange-ftp-hash-mark-msgs line) - (let ((size (string-to-int (match-string 1 line)))) + (let ((size (string-to-number (match-string 1 line)))) (setq ange-ftp-ascii-hash-mark-size size ange-ftp-hash-mark-unit (ash size -4)) @@ -5082,7 +5082,7 @@ Other orders of $ and _ seem to all work just fine.") (and (string-match regexp name) (setq version (max version - (string-to-int (match-string 1 name)))))) + (string-to-number (match-string 1 name)))))) files) (setq version (1+ version)) (puthash diff --git a/lisp/play/gametree.el b/lisp/play/gametree.el index f79ded4955e..abab58d6018 100644 --- a/lisp/play/gametree.el +++ b/lisp/play/gametree.el @@ -204,12 +204,12 @@ should be no leading white space." gametree-half-ply-regexp "\\)")) (limit (save-excursion (beginning-of-line 1) (point)))) (if (looking-at boundary) - (+ (* 2 (string-to-int (match-string 1))) + (+ (* 2 (string-to-number (match-string 1))) (if (string-match gametree-half-ply-regexp (match-string 2)) 1 0)) (save-excursion (re-search-backward boundary limit) (skip-chars-backward "0123456789") - (1+ (* 2 (string-to-int + (1+ (* 2 (string-to-number (buffer-substring (point) (match-end 1)))))))))) (defun gametree-current-branch-ply () @@ -345,7 +345,7 @@ This value is simply the outline heading level of the current line." "Return score of current variation according to its score tag. When no score tag is present, use the value of `gametree-default-score'." (if (looking-at gametree-score-regexp) - (string-to-int (match-string 3)) + (string-to-number (match-string 3)) gametree-default-score)) (defun gametree-compute-reduced-score () diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index e7eb0657eac..8dba21afe9b 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -672,7 +672,7 @@ file. If none is set, return nil." (not (integerp choice)) (< choice 1) (> choice (length prj-files))) - (setq choice (string-to-int + (setq choice (string-to-number (read-from-minibuffer "Enter No. of your choice: ")))) (set 'selected (nth (1- choice) prj-files)))) @@ -1800,7 +1800,7 @@ This function is disabled for operators, and only works for identifiers." (< choice 1) (> choice len)) (setq choice - (string-to-int + (string-to-number (read-from-minibuffer "Enter No. of your choice: ")))) ) (set-buffer ali-buffer) @@ -1988,7 +1988,7 @@ is using." (< choice 1) (> choice (length list))) (setq choice - (string-to-int + (string-to-number (read-from-minibuffer "Enter No. of your choice: ")))) ) (set 'choice (1- choice)) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index e32a43ede9e..436bc04d044 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -120,7 +120,7 @@ ;; Probably will not work due to some save-excursion??? ;; Or save-file-position? ;; (message "Did I get to line %s?" (elt (, elt) 1)) - `(goto-line (string-to-int (elt ,elt 1)))) + `(goto-line (string-to-number (elt ,elt 1)))) ;;) (defmacro cperl-etags-goto-tag-location (elt) `(etags-goto-tag-location ,elt)))) diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 457c00d9008..6dd15897e7b 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -1448,10 +1448,10 @@ Pop to member buffer if no prefix ARG, to tree buffer otherwise." (defun ebrowse-set-tree-indentation () "Set the indentation width of the tree display." (interactive) - (let ((width (string-to-int (read-from-minibuffer - (concat "Indentation (" - (int-to-string ebrowse--indentation) - "): "))))) + (let ((width (string-to-number (read-from-minibuffer + (concat "Indentation (" + (int-to-string ebrowse--indentation) + "): "))))) (when (plusp width) (setf ebrowse--indentation width) (ebrowse-redraw-tree)))) @@ -2329,7 +2329,7 @@ With prefix ARG, switch to the tree buffer else pop to it." "Set the column width of the member display. The new width is read from the minibuffer." (interactive) - (let ((width (string-to-int + (let ((width (string-to-number (read-from-minibuffer (concat "Column width (" (int-to-string (if ebrowse--long-display-flag @@ -4313,7 +4313,7 @@ NUMBER-OF-STATIC-VARIABLES:" "Select the nth entry in the list by the keys 1..9." (interactive) (let* ((maxlin (count-lines (point-min) (point-max))) - (n (min maxlin (+ 2 (string-to-int (this-command-keys)))))) + (n (min maxlin (+ 2 (string-to-number (this-command-keys)))))) (goto-line n) (throw 'electric-buffer-menu-select (point)))) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 0569d26db61..32ede0e1474 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1283,16 +1283,16 @@ where they were found." (if (looking-at "[0-9]") - (setq line (string-to-int (buffer-substring - (point) - (progn (skip-chars-forward "0-9") - (point)))))) + (setq line (string-to-number (buffer-substring + (point) + (progn (skip-chars-forward "0-9") + (point)))))) (search-forward ",") (if (looking-at "[0-9]") - (setq startpos (string-to-int (buffer-substring - (point) - (progn (skip-chars-forward "0-9") - (point))))))) + (setq startpos (string-to-number (buffer-substring + (point) + (progn (skip-chars-forward "0-9") + (point))))))) ;; Leave point on the next line of the tags file. (forward-line 1) (cons tag-text (cons line startpos)))) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index a2fa660bff0..5463ee3ffa9 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1004,7 +1004,7 @@ Return its components if so, nil if no." (line-idx (nth 2 (car patterns)))) (setq raw-file-name (if file-idx (match-string file-idx line) nil)) - (setq line-no (if line-idx (string-to-int (match-string line-idx line)) 0)) + (setq line-no (if line-idx (string-to-number (match-string line-idx line)) 0)) (setq err-text (if (> (length (car patterns)) 4) (match-string (nth 4 (car patterns)) line) (flymake-patch-err-text (substring line (match-end 0))))) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 221a6f4aebb..77244819f1b 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -45,7 +45,7 @@ ;; ;; INSTALLATION: ;; ============= -;; +;; ;; Follow the instructions in the INSTALL file of the distribution. ;; In short, put this file on your load path and add the following ;; lines to your .emacs file: @@ -58,9 +58,9 @@ ;; ;; The newest version of this file can be found on the maintainers ;; web site. -;; +;; ;; http://idlwave.org -;; +;; ;; DOCUMENTATION ;; ============= ;; @@ -77,7 +77,7 @@ ;; it is a bug in XEmacs. ;; The Debug menu in source buffers *does* display the bindings correctly. ;; -;; +;; ;; CUSTOMIZATION VARIABLES ;; ======================= ;; @@ -101,12 +101,12 @@ (condition-case () (require 'custom) (error nil)) (if (and (featurep 'custom) (fboundp 'custom-declare-variable) - (fboundp 'defface)) + (fboundp 'defface)) ;; We've got what we needed (setq idlwave-shell-have-new-custom t) ;; We have the old or no custom-library, hack around it! (defmacro defgroup (&rest args) nil) - (defmacro defcustom (var value doc &rest args) + (defmacro defcustom (var value doc &rest args) `(defvar ,var ,value ,doc)))) ;;; Customizations: idlwave-shell group @@ -118,10 +118,10 @@ :group 'idlwave) (defcustom idlwave-shell-prompt-pattern "^ ?IDL> " - "*Regexp to match IDL prompt at beginning of a line. -For example, \"^IDL> \" or \"^WAVE> \". + "*Regexp to match IDL prompt at beginning of a line. +For example, \"^IDL> \" or \"^WAVE> \". The \"^\" means beginning of line, and is required. -This variable is used to initialize `comint-prompt-regexp' in the +This variable is used to initialize `comint-prompt-regexp' in the process buffer. This is a fine thing to set in your `.emacs' file." @@ -210,7 +210,7 @@ So by default setting a breakpoint will be on C-c C-d C-b." :type 'boolean) (defcustom idlwave-shell-automatic-electric-debug 'breakpoint - "Enter the electric-debug minor mode automatically. + "Enter the electric-debug minor mode automatically. This occurs at a breakpoint or any other halt. The mode is exited upon return to the main level. Can be set to 'breakpoint to enter electric debug mode only when breakpoints are tripped." @@ -295,7 +295,7 @@ The history is only saved if the variable `idlwave-shell-save-command-history' is non-nil." :group 'idlwave-shell-command-setup :type 'file) - + (defcustom idlwave-shell-show-commands '(run misc breakpoint) "*A list of command types to show output from in the shell. @@ -306,12 +306,12 @@ the copious shell traffic to be displayed." :type '(choice (const everything) (set :tag "Checklist" :greedy t - (const :tag "All .run and .compile commands" run) + (const :tag "All .run and .compile commands" run) (const :tag "All breakpoint commands" breakpoint) (const :tag "All debug and stepping commands" debug) (const :tag "Close, window, retall, etc. commands" misc)))) -(defcustom idlwave-shell-examine-alist +(defcustom idlwave-shell-examine-alist '(("Print" . "print,___") ("Help" . "help,___") ("Structure Help" . "help,___,/STRUCTURE") @@ -322,14 +322,14 @@ the copious shell traffic to be displayed." ("Ptr Valid" . "print,ptr_valid(___)") ("Widget Valid" . "print,widget_info(___,/VALID)") ("Widget Geometry" . "help,widget_info(___,/GEOMETRY)")) - "Alist of special examine commands for popup selection. + "Alist of special examine commands for popup selection. The keys are used in the selection popup created by `idlwave-shell-examine-select', and the corresponding value is sent as a command to the shell, with special sequence `___' replaced by the expression being examined." :group 'idlwave-shell-command-setup :type '(repeat - (cons + (cons (string :tag "Label ") (string :tag "Command")))) @@ -340,7 +340,7 @@ expression being examined." "*Non-nil mean, put output of examine commands in their own buffer." :group 'idlwave-shell-command-setup :type 'boolean) - + (defcustom idlwave-shell-comint-settings '((comint-scroll-to-bottom-on-input . t) (comint-scroll-to-bottom-on-output . t) @@ -403,7 +403,7 @@ strings. Here is some example code which makes use of the default spells. answer = GET_KBRD(1) Since the IDLWAVE shell defines the system variable `!IDLWAVE_VERSION', -you could actually check if you are running under Emacs before printing +you could actually check if you are running under Emacs before printing the magic strings. Here is a procedure which uses this. Usage: @@ -420,7 +420,7 @@ pro idlwave_char_input,on=on,off=off if keyword_set(on) then print,'' $ else if keyword_set(off) then print,'' $ else print,'' - endif + endif end" :group 'idlwave-shell-command-setup :type '(list @@ -478,10 +478,10 @@ line where IDL is stopped. See also `idlwave-shell-mark-stop-line'." :group 'idlwave-shell-highlighting-and-faces :type 'string) -(defcustom idlwave-shell-electric-stop-line-face +(defcustom idlwave-shell-electric-stop-line-face (prog1 (copy-face 'modeline 'idlwave-shell-electric-stop-line-face) - (set-face-background 'idlwave-shell-electric-stop-line-face + (set-face-background 'idlwave-shell-electric-stop-line-face idlwave-shell-electric-stop-color) (condition-case nil (set-face-foreground 'idlwave-shell-electric-stop-line-face nil) @@ -527,7 +527,7 @@ lines which have a breakpoint. See also `idlwave-shell-mark-breakpoints'." ;; Just copy the underline face to be on the safe side. (copy-face 'underline 'idlwave-shell-bp-face)) -(defcustom idlwave-shell-disabled-breakpoint-face +(defcustom idlwave-shell-disabled-breakpoint-face 'idlwave-shell-disabled-bp-face "*The face for disabled breakpoint lines in the source code. Allows you to choose the font, color and other properties for @@ -580,18 +580,18 @@ before use by the shell.") TYPE is either 'pro' or 'rinfo', and `idlwave-shell-temp-pro-file' or `idlwave-shell-temp-rinfo-save-file' is set (respectively)." - (cond + (cond ((eq type 'rinfo) - (or idlwave-shell-temp-rinfo-save-file - (setq idlwave-shell-temp-rinfo-save-file + (or idlwave-shell-temp-rinfo-save-file + (setq idlwave-shell-temp-rinfo-save-file (idlwave-shell-make-temp-file idlwave-shell-temp-pro-prefix)))) ((eq type 'pro) (or idlwave-shell-temp-pro-file - (setq idlwave-shell-temp-pro-file + (setq idlwave-shell-temp-pro-file (idlwave-shell-make-temp-file idlwave-shell-temp-pro-prefix)))) - (t (error "Wrong argument (idlwave-shell-temp-file): %s" + (t (error "Wrong argument (idlwave-shell-temp-file): %s" (symbol-name type))))) - + (defun idlwave-shell-make-temp-file (prefix) "Create a temporary file." @@ -619,7 +619,7 @@ TYPE is either 'pro' or 'rinfo', and `idlwave-shell-temp-pro-file' or (defvar idlwave-shell-dirstack-query "cd,current=___cur & print,___cur" - "Command used by `idlwave-shell-resync-dirs' to query IDL for + "Command used by `idlwave-shell-resync-dirs' to query IDL for the directory stack.") (defvar idlwave-shell-path-query "print,'PATH:<'+transpose(expand_path(!PATH,/ARRAY))+'>' & print,'SYSDIR:<'+!dir+'>'" @@ -627,7 +627,7 @@ the directory stack.") "The command which gets !PATH and !DIR info from the shell.") (defvar idlwave-shell-mode-line-info nil - "Additional info displayed in the mode line") + "Additional info displayed in the mode line") (defvar idlwave-shell-default-directory nil "The default directory in the idlwave-shell buffer, of outside use.") @@ -678,7 +678,7 @@ the directory stack.") window-system) ; Window systems always (progn (setq idlwave-shell-stop-line-overlay (make-overlay 1 1)) - (overlay-put idlwave-shell-stop-line-overlay + (overlay-put idlwave-shell-stop-line-overlay 'face idlwave-shell-stop-line-face)))) (t @@ -686,7 +686,7 @@ the directory stack.") (if window-system (progn (setq idlwave-shell-stop-line-overlay (make-overlay 1 1)) - (overlay-put idlwave-shell-stop-line-overlay + (overlay-put idlwave-shell-stop-line-overlay 'face idlwave-shell-stop-line-face))))) ;; Now the expression and output overlays @@ -747,7 +747,7 @@ with `*'s." ;;; The following are the types of messages we attempt to catch to ;;; resync our idea of where IDL execution currently is. -;;; +;;; (defvar idlwave-shell-halt-frame nil "The frame associated with halt/breakpoint messages.") @@ -791,7 +791,7 @@ IDL has currently stepped.") (defconst idlwave-shell-electric-debug-help " ==> IDLWAVE Electric Debug Mode Help <== - + Break Point Setting and Clearing: b Set breakpoint ([C-u b] for conditional, [C-n b] nth hit, etc.). d Clear nearby breakpoint. @@ -817,7 +817,7 @@ IDL has currently stepped.") Examining Expressions (with prefix for examining the region): p Print expression near point or in region ([C-u p]). ? Help on expression near point or in region ([C-u ?]). - x Examine expression near point or in region ([C-u x]) with + x Examine expression near point or in region ([C-u x]) with letter completion of the examine type. Miscellaneous: @@ -871,18 +871,18 @@ IDL has currently stepped.") `\\[idlwave-routine-info]' displays information about an IDL routine near point, just like in `idlwave-mode'. The module used is the one at point or the one whose argument list is being edited. - To update IDLWAVE's knowledge about compiled or edited modules, use + To update IDLWAVE's knowledge about compiled or edited modules, use \\[idlwave-update-routine-info]. \\[idlwave-find-module] find the source of a module. \\[idlwave-resolve] tells IDL to compile an unresolved module. \\[idlwave-context-help] shows the online help on the item at point, if online help has been installed. - + 4. Debugging --------- A complete set of commands for compiling and debugging IDL programs - is available from the menu. Also keybindings starting with a + is available from the menu. Also keybindings starting with a `C-c C-d' prefix are available for most commands in the *idl* buffer and also in source buffers. The best place to learn about the keybindings is again the menu. @@ -974,8 +974,8 @@ IDL has currently stepped.") (idlwave-shell-display-line nil) (setq idlwave-shell-calling-stack-index 0) (setq idlwave-shell-only-prompt-pattern - (concat "\\`[ \t\n]*" - (substring idlwave-shell-prompt-pattern 1) + (concat "\\`[ \t\n]*" + (substring idlwave-shell-prompt-pattern 1) "[ \t\n]*\\'")) (when idlwave-shell-query-for-class @@ -1010,14 +1010,14 @@ IDL has currently stepped.") (while (setq entry (pop list)) (set (make-local-variable (car entry)) (cdr entry))))) - - (unless (memq 'comint-carriage-motion + + (unless (memq 'comint-carriage-motion (default-value 'comint-output-filter-functions)) ;; Strip those pesky ctrl-m's. (add-hook 'comint-output-filter-functions (lambda (string) (when (string-match "\r" string) - (let ((pmark (process-mark (get-buffer-process + (let ((pmark (process-mark (get-buffer-process (current-buffer))))) (save-excursion ;; bare CR -> delete preceding line @@ -1059,8 +1059,8 @@ IDL has currently stepped.") (idlwave-shell-send-command idlwave-shell-initial-commands nil 'hide) ;; Turn off IDL's ^d interpreting, and define a system ;; variable which knows the version of IDLWAVE - (idlwave-shell-send-command - (format "defsysv,'!idlwave_version','%s',1" + (idlwave-shell-send-command + (format "defsysv,'!idlwave_version','%s',1" idlwave-mode-version) nil 'hide) ;; Get the paths if they weren't read in from file @@ -1081,7 +1081,7 @@ IDL has currently stepped.") (setq idlwave-system-directory sysdir) (put 'idlwave-system-directory 'from-shell t)) ;; Preserve any existing flags - (setq idlwave-path-alist + (setq idlwave-path-alist (mapcar (lambda (x) (let ((old-entry (assoc x old-path-alist))) (if old-entry @@ -1089,7 +1089,7 @@ IDL has currently stepped.") (list x)))) dirs)) (put 'idlwave-path-alist 'from-shell t) - (if idlwave-path-alist + (if idlwave-path-alist (if (and idlwave-auto-write-paths (not idlwave-library-path) (not no-write) ) @@ -1125,8 +1125,8 @@ IDL has currently stepped.") (frame (selected-frame))) (catch 'exit (while flist - (if (not (eq (car flist) - idlwave-shell-idl-wframe)) + (if (not (eq (car flist) + idlwave-shell-idl-wframe)) (throw 'exit (car flist)) (setq flist (cdr flist)))))) (make-frame)) @@ -1144,9 +1144,9 @@ IDL has currently stepped.") ;; We do not have a source frame, so we use this one. (setq idlwave-shell-display-wframe (selected-frame))) ;; Return a new frame - (setq idlwave-shell-idl-wframe + (setq idlwave-shell-idl-wframe (make-frame idlwave-shell-frame-parameters))))) - + ;;;###autoload (defun idlwave-shell (&optional arg quick) "Run an inferior IDL, with I/O through buffer `(idlwave-shell-buffer)'. @@ -1173,14 +1173,14 @@ See also the variable `idlwave-shell-prompt-pattern'. (delete-other-windows)) (and idlwave-shell-use-dedicated-frame (setq idlwave-shell-idl-wframe (selected-frame))) - (add-hook 'idlwave-shell-sentinel-hook + (add-hook 'idlwave-shell-sentinel-hook 'save-buffers-kill-emacs t)) ;; A non-nil arg means, we want a dedicated frame. This will last ;; for the current editing session. (if arg (setq idlwave-shell-use-dedicated-frame t)) (if (equal arg '(16)) (setq idlwave-shell-use-dedicated-frame nil)) - + ;; Check if the process still exists. If not, create it. (unless (comint-check-proc (idlwave-shell-buffer)) (let* ((prg (or idlwave-shell-explicit-file-name "idl")) @@ -1207,9 +1207,9 @@ See also the variable `idlwave-shell-prompt-pattern'. (if (eq (selected-frame) (window-frame window)) (select-window window)))) ;; Save the paths at the end - (add-hook 'idlwave-shell-sentinel-hook + (add-hook 'idlwave-shell-sentinel-hook (lambda () - (if (and + (if (and idlwave-auto-write-paths idlwave-path-alist (not idlwave-library-path) @@ -1240,7 +1240,7 @@ Return either nil or 'hide." (setq idlwave-shell-show-commands (list type)))) -(defun idlwave-shell-send-command (&optional cmd pcmd hide preempt +(defun idlwave-shell-send-command (&optional cmd pcmd hide preempt show-if-error) "Send a command to IDL process. @@ -1261,18 +1261,18 @@ If optional fourth argument PREEMPT is non-nil CMD is put at front of `idlwave-shell-pending-commands'. If PREEMPT is 'wait, wait for all output to complete and the next prompt to arrive before returning \(useful if you need an answer now\). IDL is considered ready if the -prompt is present and if `idlwave-shell-ready' is non-nil. +prompt is present and if `idlwave-shell-ready' is non-nil. If SHOW-IF-ERROR is non-nil, show the output it it contains an error message, independent of what HIDE is set to." ; (setq hide nil) ; FIXME: turn this on for debugging only -; (if (null cmd) +; (if (null cmd) ; (progn -; (message "SENDING Pending commands: %s" +; (message "SENDING Pending commands: %s" ; (prin1-to-string idlwave-shell-pending-commands))) ; (message "SENDING %s|||%s" cmd pcmd)) - (if (and (symbolp idlwave-shell-show-commands) + (if (and (symbolp idlwave-shell-show-commands) (eq idlwave-shell-show-commands 'everything)) (setq hide nil)) (let ((save-buffer (current-buffer)) @@ -1300,7 +1300,7 @@ message, independent of what HIDE is set to." (append (list (list cmd pcmd hide show-if-error)) idlwave-shell-pending-commands) ;; Put at end. - (append idlwave-shell-pending-commands + (append idlwave-shell-pending-commands (list (list cmd pcmd hide show-if-error)))))) ;; Check if IDL ready (let ((save-point (point-marker))) @@ -1349,7 +1349,7 @@ message, independent of what HIDE is set to." (if (or (not (setq buf (get-buffer (idlwave-shell-buffer)))) (not (setq proc (get-buffer-process buf)))) (funcall errf "Shell is not running")) - (if (equal c ?\C-g) + (if (equal c ?\C-g) (funcall errf "Abort") (comint-send-string proc (char-to-string c))))) @@ -1390,7 +1390,7 @@ when the IDL prompt gets displayed again after the current IDL command." (if idlwave-shell-ready (funcall errf "No IDL program seems to be waiting for input")) - ;; OK, start the loop + ;; OK, start the loop (message "Character mode on: Sending single chars (`C-g' to exit)") (message (catch 'exit @@ -1470,14 +1470,14 @@ error messages, etc." (setq output (substring output (string-match "\n" output))) (while (string-match "\\(\n\\|\\`\\)%.*\\(\n .*\\)*" output) (setq output (replace-match "" nil t output))) - (unless + (unless (string-match idlwave-shell-only-prompt-pattern output) output)) (defvar idlwave-shell-hidden-output-buffer " *idlwave-shell-hidden-output*" "Buffer containing hidden output from IDL commands.") (defvar idlwave-shell-current-state nil) - + (defun idlwave-shell-filter (proc string) "Watch for IDL prompt and filter incoming text. When the IDL prompt is received executes `idlwave-shell-post-command-hook' @@ -1509,20 +1509,20 @@ and then calls `idlwave-shell-send-command' for any pending commands." (idlwave-shell-input-mode-magic (concat idlwave-shell-accumulation string))) (setq idlwave-shell-accumulation - (substring string - (progn (string-match "\\(.*[\n\r]+\\)*" + (substring string + (progn (string-match "\\(.*[\n\r]+\\)*" string) (match-end 0))))) (setq idlwave-shell-accumulation (concat idlwave-shell-accumulation string))) - - + + ;;; Test/Debug code ; (save-excursion (set-buffer ; (get-buffer-create "*idlwave-shell-output*")) ; (goto-char (point-max)) ; (insert "\nSTRING===>\n" string "\n<====\n")) - + ;; Check for prompt in current accumulating output (if (setq idlwave-shell-ready (string-match idlwave-shell-prompt-pattern @@ -1558,16 +1558,16 @@ and then calls `idlwave-shell-send-command' for any pending commands." (if (and idlwave-shell-show-if-error (eq idlwave-shell-current-state 'error)) (idlwave-shell-comint-filter proc full-output) - ;; If it's only *mostly* hidden, filter % lines, + ;; If it's only *mostly* hidden, filter % lines, ;; and show anything that remains (if (eq idlwave-shell-hide-output 'mostly) (let ((filtered - (idlwave-shell-filter-hidden-output + (idlwave-shell-filter-hidden-output full-output))) - (if filtered - (idlwave-shell-comint-filter + (if filtered + (idlwave-shell-comint-filter proc filtered)))))) - + ;; Call the post-command hook (if (listp idlwave-shell-post-command-hook) (progn @@ -1612,7 +1612,7 @@ and then calls `idlwave-shell-send-command' for any pending commands." (condition-case nil (comint-write-input-ring) (error nil))))) - + (when (and (> (length (frame-list)) 1) (frame-live-p idlwave-shell-idl-wframe)) (delete-frame idlwave-shell-idl-wframe) @@ -1636,8 +1636,8 @@ and then calls `idlwave-shell-send-command' for any pending commands." ;; in module and file names. I am not sure if it will be necessary to ;; change this. Currently it seems to work the way it is. (defvar idlwave-shell-syntax-error - "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" - "A regular expression to match an IDL syntax error. + "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" + "A regular expression to match an IDL syntax error. The 1st pair matches the file name, the second pair matches the line number.") @@ -1645,16 +1645,16 @@ number.") "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" "A regular expression to match any IDL error.") -(defvar idlwave-shell-halting-error +(defvar idlwave-shell-halting-error "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+\\s-*.*\\)\n" "A regular expression to match errors which halt execution.") -(defvar idlwave-shell-cant-continue-error +(defvar idlwave-shell-cant-continue-error "^% Can't continue from this point.\n" "A regular expression to match errors stepping errors.") (defvar idlwave-shell-file-line-message - (concat + (concat "\\(" ; program name group (1) "\\$MAIN\\$\\|" ; main level routine "\\<[a-zA-Z][a-zA-Z0-9_$:]*" ; start with a letter followed by [..] @@ -1672,7 +1672,7 @@ number.") "\\)" ; end line number group (5) ) "*A regular expression to parse out the file name and line number. -The 1st group should match the subroutine name. +The 1st group should match the subroutine name. The 3rd group is the line number. The 5th group is the file name. All parts may contain linebreaks surrounded by spaces. This is important @@ -1691,9 +1691,9 @@ the above." (cond ;; Make sure we have output ((not idlwave-shell-command-output)) - + ;; First Priority: Syntax and other errors - ((or + ((or (string-match idlwave-shell-syntax-error idlwave-shell-command-output) (string-match idlwave-shell-other-error @@ -1707,19 +1707,19 @@ the above." (setq idlwave-shell-error-last (point))) (setq idlwave-shell-current-state 'error) (idlwave-shell-goto-next-error)) - + ;; Second Priority: Halting errors ((string-match idlwave-shell-halting-error idlwave-shell-command-output) ;; Grab the file and line state info. (setq idlwave-shell-calling-stack-index 0) (setq idlwave-shell-halt-frame - (idlwave-shell-parse-line - (substring idlwave-shell-command-output + (idlwave-shell-parse-line + (substring idlwave-shell-command-output (match-beginning 2))) idlwave-shell-current-state 'error) (idlwave-shell-display-line (idlwave-shell-pc-frame))) - + ;; Third Priority: Various types of innocuous HALT and ;; TRACEBACK messages. ((or (setq trace (string-match idlwave-shell-trace-message-re @@ -1729,25 +1729,25 @@ the above." ;; Grab the file and line state info. (setq idlwave-shell-calling-stack-index 0) (setq idlwave-shell-halt-frame - (idlwave-shell-parse-line + (idlwave-shell-parse-line (substring idlwave-shell-command-output (match-end 0)))) (setq idlwave-shell-current-state 'halt) ;; Don't debug trace messages (idlwave-shell-display-line (idlwave-shell-pc-frame) nil (if trace 'no-debug))) - - ;; Fourth Priority: Breakpoints + + ;; Fourth Priority: Breakpoints ((string-match idlwave-shell-break-message idlwave-shell-command-output) (setq idlwave-shell-calling-stack-index 0) - (setq idlwave-shell-halt-frame - (idlwave-shell-parse-line + (setq idlwave-shell-halt-frame + (idlwave-shell-parse-line (substring idlwave-shell-command-output (match-end 0)))) ;; We used to count hits on breakpoints ;; this is no longer supported since IDL breakpoints ;; have learned counting. ;; Do breakpoint command processing - (let ((bp (assoc + (let ((bp (assoc (list (nth 0 idlwave-shell-halt-frame) (nth 1 idlwave-shell-halt-frame)) @@ -1760,9 +1760,9 @@ the above." ;; A breakpoint that we did not know about - perhaps it was ;; set by the user... Let's update our list. (idlwave-shell-bp-query))) - (setq idlwave-shell-current-state 'breakpoint) + (setq idlwave-shell-current-state 'breakpoint) (idlwave-shell-display-line (idlwave-shell-pc-frame))) - + ;; Last Priority: Can't Step errors ((string-match idlwave-shell-cant-continue-error idlwave-shell-command-output) @@ -1777,7 +1777,7 @@ We need to work hard here to remove the stupid line breaks inserted by IDL5. These line breaks can be right in the middle of procedure or file names. It is very difficult to come up with a robust solution. This one seems -to be pretty good though. +to be pretty good though. Here is in what ways it improves over the previous solution: @@ -1802,7 +1802,7 @@ statements." (setq procedure (match-string 1 string) number (match-string 3 string) file (match-string 5 string)) - + ;; Repair the strings (setq procedure (idlwave-shell-repair-string procedure)) (setq number (idlwave-shell-repair-string number)) @@ -1811,7 +1811,7 @@ statements." ;; If we have a file, return the frame list (if file (list (idlwave-shell-file-name file) - (string-to-int number) + (string-to-number number) procedure) ;; No success finding a file nil)))) @@ -1828,7 +1828,7 @@ The last line of STRING may be garbage - we check which one makes a valid file name." (let ((file1 "") (file2 "") (start 0)) ;; We scan no further than to the next "^%" line - (if (string-match "^%" file) + (if (string-match "^%" file) (setq file (substring file 0 (match-beginning 0)))) ;; Take out the line breaks (while (string-match "[ \t]*\n[ \t]*" file start) @@ -1883,7 +1883,7 @@ file name." The size is given by `idlwave-shell-graphics-window-size'." (interactive "P") (let ((n (if n (prefix-numeric-value n) 0))) - (idlwave-shell-send-command + (idlwave-shell-send-command (apply 'format "window,%d,xs=%d,ys=%d" n idlwave-shell-graphics-window-size) nil (idlwave-shell-hide-p 'misc) nil t))) @@ -1903,16 +1903,16 @@ directory." Also get rid of widget events in the queue." (interactive "P") (save-selected-window - ;;if (widget_info(/MANAGED))[0] gt 0 then for i=0,n_elements(widget_info(/MANAGED))-1 do widget_control,(widget_info(/MANAGED))[i],/clear_events & - (idlwave-shell-send-command "retall" nil - (if (idlwave-shell-hide-p 'misc) 'mostly) + ;;if (widget_info(/MANAGED))[0] gt 0 then for i=0,n_elements(widget_info(/MANAGED))-1 do widget_control,(widget_info(/MANAGED))[i],/clear_events & + (idlwave-shell-send-command "retall" nil + (if (idlwave-shell-hide-p 'misc) 'mostly) nil t) (idlwave-shell-display-line nil))) (defun idlwave-shell-closeall (&optional arg) "Close all open files." (interactive "P") - (idlwave-shell-send-command "close,/all" nil + (idlwave-shell-send-command "close,/all" nil (idlwave-shell-hide-p 'misc) nil t)) (defun idlwave-shell-quit (&optional arg) @@ -1928,7 +1928,7 @@ With prefix ARG, exit without confirmation." (defun idlwave-shell-reset (&optional hidden) "Reset IDL. Return to main level and destroy the leftover variables. -This issues the following commands: +This issues the following commands: RETALL WIDGET_CONTROL,/RESET CLOSE, /ALL @@ -1978,14 +1978,14 @@ HEAP_GC, /VERBOSE" ;; Set dummy values and kill the text (setq sep "@" sep-re "@ *" text "") (if idlwave-idlwave_routine_info-compiled - (message - "Routine Info warning: No match for BEGIN line in \n>>>\n%s\n<<<\n" + (message + "Routine Info warning: No match for BEGIN line in \n>>>\n%s\n<<<\n" idlwave-shell-command-output))) (if (string-match "^>>>END OF IDLWAVE ROUTINE INFO.*" text) (setq text (substring text 0 (match-beginning 0))) (if idlwave-idlwave_routine_info-compiled - (message - "Routine Info warning: No match for END line in \n>>>\n%s\n<<<\n" + (message + "Routine Info warning: No match for END line in \n>>>\n%s\n<<<\n" idlwave-shell-command-output))) (if (string-match "\\S-" text) ;; Obviously, the pro worked. Make a note that we have it now. @@ -2003,59 +2003,59 @@ HEAP_GC, /VERBOSE" key (nth 4 specs) keys (if (and (stringp key) (not (string-match "\\` *\\'" key))) - (mapcar 'list + (mapcar 'list (delete "" (idlwave-split-string key " +"))))) (setq name (idlwave-sintern-routine-or-method name class t) class (idlwave-sintern-class class t) file (if (equal file "") nil file) - keys (mapcar (lambda (x) + keys (mapcar (lambda (x) (list (idlwave-sintern-keyword (car x) t))) keys)) - + ;; In the following ignore routines already defined in buffers, ;; assuming that if the buffer stuff differs, it is a "new" ;; version, not yet compiled, and should take precedence. ;; We could do the same for the library to avoid duplicates - ;; but I think frequently a user might have several versions of - ;; the same function in different programs, and in this case the + ;; the same function in different programs, and in this case the ;; compiled one will be the best guess of all versions. ;; Therefore, we leave duplicates of library routines in. (cond ((string= name "$MAIN$")) ; ignore this one ((and (string= type "PRO") ;; FIXME: is it OK to make the buffer routines dominate? (or t (null file) - (not (idlwave-rinfo-assq name 'pro class + (not (idlwave-rinfo-assq name 'pro class idlwave-buffer-routines))) ;; FIXME: is it OK to make the library routines dominate? - ;;(not (idlwave-rinfo-assq name 'pro class + ;;(not (idlwave-rinfo-assq name 'pro class ;; idlwave-library-routines)) ) - (setq entry (list name 'pro class - (cons 'compiled + (setq entry (list name 'pro class + (cons 'compiled (if file (list (file-name-nondirectory file) - (idlwave-sintern-dir + (idlwave-sintern-dir (file-name-directory file))))) cs (cons nil keys))) - (if file + (if file (push entry idlwave-compiled-routines) (push entry idlwave-unresolved-routines))) - + ((and (string= type "FUN") ;; FIXME: is it OK to make the buffer routines dominate? (or t (not file) - (not (idlwave-rinfo-assq name 'fun class + (not (idlwave-rinfo-assq name 'fun class idlwave-buffer-routines))) ;; FIXME: is it OK to make the library routines dominate? - ;; (not (idlwave-rinfo-assq name 'fun class + ;; (not (idlwave-rinfo-assq name 'fun class ;; idlwave-library-routines)) ) - (setq entry (list name 'fun class + (setq entry (list name 'fun class (cons 'compiled (if file (list (file-name-nondirectory file) - (idlwave-sintern-dir + (idlwave-sintern-dir (file-name-directory file))))) cs (cons nil keys))) (if file @@ -2072,7 +2072,7 @@ Change the default directory for the process buffer to concur." (set-buffer (idlwave-shell-buffer)) (if (string-match ",___cur[\n\r]\\(\\S-*\\) *[\n\r]" idlwave-shell-command-output) - (let ((dir (substring idlwave-shell-command-output + (let ((dir (substring idlwave-shell-command-output (match-beginning 1) (match-end 1)))) ; (message "Setting Emacs working dir to %s" dir) (setq idlwave-shell-default-directory dir) @@ -2086,10 +2086,10 @@ Change the default directory for the process buffer to concur." expression) (save-excursion (goto-char apos) - (setq expression (buffer-substring + (setq expression (buffer-substring (catch 'exit (while t - (if (not (re-search-backward + (if (not (re-search-backward "[^][.A-Za-z0-9_() ]" bos t)) (throw 'exit bos)) ;ran into bos (if (not (idlwave-is-pointer-dereference bol)) @@ -2117,7 +2117,7 @@ Change the default directory for the process buffer to concur." idlwave-shell-command-output)) (string-match (concat match "\\([A-Za-z_0-9]+\\)") idlwave-shell-command-output)) - (setq idlwave-shell-get-object-class + (setq idlwave-shell-get-object-class (match-string 1 idlwave-shell-command-output))))) (defvar idlwave-sint-sysvars nil) @@ -2131,7 +2131,7 @@ keywords." (interactive "P") (let (exec-cmd) (cond - ((and + ((and (setq exec-cmd (idlwave-shell-executive-command)) (cdr exec-cmd) (member (upcase (cdr exec-cmd)) @@ -2141,7 +2141,7 @@ keywords." (idlwave-shell-complete-filename)) ((car-safe exec-cmd) - (setq idlwave-completion-help-info + (setq idlwave-completion-help-info '(idlwave-shell-complete-execcomm-help)) (idlwave-complete-in-buffer 'execcomm 'execcomm idlwave-executive-commands-alist nil @@ -2160,7 +2160,7 @@ keywords." (let ((case-fold-search t)) (not (looking-at ".*obj_new"))))) (idlwave-shell-complete-filename)) - + (t ;; Default completion of modules and keywords (idlwave-complete arg))))) @@ -2182,7 +2182,7 @@ keywords." We assume that we are after a file name when completing one of the args of an executive .run, .rnew or .compile." ;; CWD might have changed, resync, to set default directory - (idlwave-shell-resync-dirs) + (idlwave-shell-resync-dirs) (let ((comint-file-name-chars idlwave-shell-file-name-chars)) (comint-dynamic-complete-as-filename))) @@ -2223,7 +2223,7 @@ args of an executive .run, .rnew or .compile." (defun idlwave-shell-redisplay (&optional hide) "Tries to resync the display with where execution has stopped. -Issues a \"help,/trace\" command followed by a call to +Issues a \"help,/trace\" command followed by a call to `idlwave-shell-display-line'. Also updates the breakpoint overlays." (interactive) @@ -2236,7 +2236,7 @@ overlays." (idlwave-shell-bp-query)) (defun idlwave-shell-display-level-in-calling-stack (&optional hide) - (idlwave-shell-send-command + (idlwave-shell-send-command "help,/trace" `(progn ;; scanning for the state will reset the stack level - restore it @@ -2267,14 +2267,14 @@ overlays." (setq idlwave-shell-calling-stack-index nmin message (format "%d is the current calling stack level - can't go further down" (- nmin))))) - (setq idlwave-shell-calling-stack-routine + (setq idlwave-shell-calling-stack-routine (nth 2 (nth idlwave-shell-calling-stack-index stack))) ;; only edebug if in that mode already - (idlwave-shell-display-line + (idlwave-shell-display-line (nth idlwave-shell-calling-stack-index stack) nil - (unless idlwave-shell-electric-debug-mode 'no-debug)) - (message (or message + (unless idlwave-shell-electric-debug-mode 'no-debug)) + (message (or message (format "In routine %s (stack level %d)" idlwave-shell-calling-stack-routine (- idlwave-shell-calling-stack-index)))))) @@ -2305,7 +2305,7 @@ used. Does nothing if the resulting frame is nil." (defun idlwave-shell-pc-frame () "Returns the frame for IDL execution." (and idlwave-shell-halt-frame - (list (nth 0 idlwave-shell-halt-frame) + (list (nth 0 idlwave-shell-halt-frame) (nth 1 idlwave-shell-halt-frame) (nth 2 idlwave-shell-halt-frame)))) @@ -2323,7 +2323,7 @@ column in the line. If NO-DEBUG is non-nil, do *not* toggle the electric debug mode." (if (not frame) ;; Remove stop-line overlay from old position - (progn + (progn (setq overlay-arrow-string nil) (setq idlwave-shell-mode-line-info nil) (setq idlwave-shell-is-stopped nil) @@ -2340,10 +2340,10 @@ debug mode." ;;; ;;; buffer : the buffer to display a line in. ;;; select-shell: current buffer is the shell. -;;; +;;; (setq idlwave-shell-mode-line-info (if (nth 2 frame) - (format "[%d:%s]" + (format "[%d:%s]" (- idlwave-shell-calling-stack-index) (nth 2 frame)))) (let* ((buffer (idlwave-find-file-noselect (car frame) 'shell)) @@ -2367,7 +2367,7 @@ debug mode." (forward-line 0) (setq pos (point)) (setq idlwave-shell-is-stopped t) - + (if idlwave-shell-stop-line-overlay ;; Move overlay (move-overlay idlwave-shell-stop-line-overlay @@ -2389,12 +2389,12 @@ debug mode." ;; If we have the column of the error, move the cursor there. (if col (move-to-column col)) (setq pos (point)) - + ;; Enter electric debug mode, if not prohibited and not in ;; it already - (when (and (or + (when (and (or (eq idlwave-shell-automatic-electric-debug t) - (and + (and (eq idlwave-shell-automatic-electric-debug 'breakpoint) (not (eq idlwave-shell-current-state 'error)))) (not no-debug) @@ -2402,14 +2402,14 @@ debug mode." (not idlwave-shell-electric-debug-mode)) (idlwave-shell-electric-debug-mode) (setq electric t))) - + ;; Make sure pos is really displayed in the window. (set-window-point window pos) - - ;; If we came from the shell, go back there. Otherwise select + + ;; If we came from the shell, go back there. Otherwise select ;; the window where the error is displayed. (if (or (and idlwave-shell-electric-zap-to-file electric) - (and (equal (buffer-name) (idlwave-shell-buffer)) + (and (equal (buffer-name) (idlwave-shell-buffer)) (not select-shell))) (select-window window)))))) @@ -2419,35 +2419,35 @@ debug mode." (interactive "p") (or (not arg) (< arg 1) (setq arg 1)) - (idlwave-shell-send-command + (idlwave-shell-send-command (concat ".s " (if (integerp arg) (int-to-string arg) arg)) nil (if (idlwave-shell-hide-p 'debug) 'mostly) nil t)) (defun idlwave-shell-stepover (arg) "Stepover one source line. -If given prefix argument ARG, step ARG source lines. +If given prefix argument ARG, step ARG source lines. Uses IDL's stepover executive command which does not enter called functions." (interactive "p") (or (not arg) (< arg 1) (setq arg 1)) - (idlwave-shell-send-command + (idlwave-shell-send-command (concat ".so " (if (integerp arg) (int-to-string arg) arg)) nil (if (idlwave-shell-hide-p 'debug) 'mostly) nil t)) (defun idlwave-shell-break-here (&optional count cmd condition no-show) - "Set breakpoint at current line. + "Set breakpoint at current line. If Count is nil then an ordinary breakpoint is set. We treat a count of 1 as a temporary breakpoint using the ONCE keyword. Counts greater than 1 use the IDL AFTER=count keyword to break only after reaching the statement count times. -Optional argument CMD is a list or function to evaluate upon reaching +Optional argument CMD is a list or function to evaluate upon reaching the breakpoint." - + (interactive "P") (when (listp count) - (if (equal (car count) 4) + (if (equal (car count) 4) (setq condition (read-string "Break Condition: "))) (setq count nil)) (idlwave-shell-set-bp @@ -2470,7 +2470,7 @@ the problem with not being able to set the breakpoint." (progn (if (progn (beep) - (y-or-n-p + (y-or-n-p (concat "Okay to recompile file " (idlwave-shell-bp-get bp 'file) " "))) ;; Recompile @@ -2478,7 +2478,7 @@ the problem with not being able to set the breakpoint." ;; Clean up before retrying (idlwave-shell-command-failure) (idlwave-shell-send-command - (concat ".run " (idlwave-shell-bp-get bp 'file)) nil + (concat ".run " (idlwave-shell-bp-get bp 'file)) nil (if (idlwave-shell-hide-p 'run) 'mostly) nil t) ;; Try setting breakpoint again (idlwave-shell-set-bp bp)) @@ -2502,9 +2502,9 @@ breakpoint can not be set." (defun idlwave-shell-cont (&optional no-show) "Continue executing." (interactive) - (idlwave-shell-send-command ".c" (unless no-show + (idlwave-shell-send-command ".c" (unless no-show '(idlwave-shell-redisplay 'hide)) - (if (idlwave-shell-hide-p 'debug) 'mostly) + (if (idlwave-shell-hide-p 'debug) 'mostly) nil t)) (defun idlwave-shell-go () @@ -2585,7 +2585,7 @@ at a breakpoint." ((eq force 'enable) (setq disabled t))) (when bp (setf (nth 3 (cdr (cdr bp))) (not disabled)) - (idlwave-shell-send-command + (idlwave-shell-send-command (concat "breakpoint," (if disabled "/enable," "/disable,") (int-to-string (idlwave-shell-bp-get bp))) @@ -2599,13 +2599,13 @@ If ENABLE is non-nil, enable them instead." (while bpl (setq disabled (idlwave-shell-bp-get (car bpl) 'disabled)) (when (idlwave-xor (not disabled) (eq enable 'enable)) - (idlwave-shell-toggle-enable-current-bp + (idlwave-shell-toggle-enable-current-bp (car bpl) (if (eq enable 'enable) 'enable 'disable) no-update) (push (car bpl) modified)) (setq bpl (cdr bpl))) (unless no-update (idlwave-shell-bp-query)) modified)) - + (defun idlwave-shell-to-here () "Set a breakpoint with count 1 then continue." (interactive) @@ -2643,7 +2643,7 @@ in the current routine." (defun idlwave-shell-set-bp-in-module (module) "Set breakpoint in module. Assumes that `idlwave-shell-sources-alist' contains an entry for that module." - (let ((source-file (car-safe + (let ((source-file (car-safe (cdr-safe (assoc (upcase module) idlwave-shell-sources-alist)))) @@ -2662,7 +2662,7 @@ contains an entry for that module." (save-excursion (goto-char (point-min)) (let ((case-fold-search t)) - (if (re-search-forward + (if (re-search-forward (concat "^[ \t]*\\(pro\\|function\\)[ \t]+" (downcase module) "[ \t\n,]") nil t) @@ -2704,7 +2704,7 @@ Sets a breakpoint with count 1 at end of block, then continues." "Attempt to run until this procedure exits. Runs to the last statement and then steps 1 statement. Use the .out command." (interactive) - (idlwave-shell-send-command ".o" nil + (idlwave-shell-send-command ".o" nil (if (idlwave-shell-hide-p 'debug) 'mostly) nil t)) @@ -2751,7 +2751,7 @@ Runs to the last statement and then steps 1 statement. Use the .out command." (interactive "e") (let ((transient-mark-mode t) (zmacs-regions t) - (tracker (if (featurep 'xemacs) + (tracker (if (featurep 'xemacs) (if (fboundp 'default-mouse-track-event-is-with-button) 'idlwave-xemacs-hack-mouse-track 'mouse-track) @@ -2769,7 +2769,7 @@ Runs to the last statement and then steps 1 statement. Use the .out command." (let ((oldfunc (symbol-function 'default-mouse-track-event-is-with-button))) (unwind-protect (progn - (fset 'default-mouse-track-event-is-with-button + (fset 'default-mouse-track-event-is-with-button 'idlwave-default-mouse-track-event-is-with-button) (mouse-track event)) (fset 'default-mouse-track-event-is-with-button oldfunc)))) @@ -2801,7 +2801,7 @@ Runs to the last statement and then steps 1 statement. Use the .out command." (defvar idlwave-shell-examine-completion-list nil) (defun idlwave-shell-print (arg &optional help ev complete-help-type) - "Print current expression. + "Print current expression. With HELP non-nil, show help on expression. If HELP is a string, the expression will be put in place of ___, e.g.: @@ -2834,11 +2834,11 @@ idlw-shell-examine-alist via mini-buffer shortcut key." (save-excursion (let* ((process (get-buffer-process (current-buffer))) (process-mark (if process (process-mark process))) - (stack-label + (stack-label (if (and (integerp idlwave-shell-calling-stack-index) (> idlwave-shell-calling-stack-index 0)) - (format " [-%d:%s]" - idlwave-shell-calling-stack-index + (format " [-%d:%s]" + idlwave-shell-calling-stack-index idlwave-shell-calling-stack-routine))) expr beg end cmd examine-hook) (cond @@ -2868,7 +2868,7 @@ idlw-shell-examine-alist via mini-buffer shortcut key." ;; an array (forward-sexp)) (setq end (point))))) - + ;; Get expression, but first move the begin mark if a ;; process-mark is inside the region, to keep the overlay from ;; wandering in the Shell. @@ -2879,17 +2879,17 @@ idlw-shell-examine-alist via mini-buffer shortcut key." ;; Show the overlay(s) and attach any necessary hooks and filters (when (and beg end idlwave-shell-expression-overlay) - (move-overlay idlwave-shell-expression-overlay beg end + (move-overlay idlwave-shell-expression-overlay beg end (current-buffer)) - (add-hook 'pre-command-hook + (add-hook 'pre-command-hook 'idlwave-shell-delete-expression-overlay)) - (setq examine-hook + (setq examine-hook (if idlwave-shell-separate-examine-output 'idlwave-shell-examine-display 'idlwave-shell-examine-highlight)) (add-hook 'pre-command-hook 'idlwave-shell-delete-output-overlay) - + ;; Remove empty or comment-only lines (while (string-match "\n[ \t]*\\(;.*\\)?\r*\n" expr) (setq expr (replace-match "\n" t t expr))) @@ -2899,41 +2899,41 @@ idlw-shell-examine-alist via mini-buffer shortcut key." ;; Remove final newline (if (string-match "\n[ \t\r]*\\'" expr) (setq expr (replace-match "" t t expr))) - + (catch 'exit ;; Pop-up or complete on the examine selection list, if appropriate (if (or complete-help-type (and ev idlwave-shell-examine-alist) (consp help)) - (let ((help-cons + (let ((help-cons (if (consp help) help - (assoc + (assoc ;; A cons from either a pop-up or mini-buffer completion (if complete-help-type (idlwave-one-key-select 'idlwave-shell-examine-alist "Examine with: " 1.5) ;; (idlwave-completing-read -;; "Examine with: " +;; "Examine with: " ;; idlwave-shell-examine-alist nil nil nil ;; 'idlwave-shell-examine-completion-list ;; "Print") - (idlwave-popup-select - ev - (mapcar 'car idlwave-shell-examine-alist) + (idlwave-popup-select + ev + (mapcar 'car idlwave-shell-examine-alist) "Examine with")) idlwave-shell-examine-alist)))) (setq help (cdr help-cons)) (if (null help) (throw 'exit nil)) (if idlwave-shell-separate-examine-output - (setq idlwave-shell-examine-label - (concat + (setq idlwave-shell-examine-label + (concat (format "==>%s<==\n%s:" expr (car help-cons)) stack-label "\n")))) ;; The regular help label (no popups, cons cells, etc.) (setq idlwave-shell-examine-label (concat - (format "==>%s<==\n%s:" expr + (format "==>%s<==\n%s:" expr (cond ((null help) "print") ((stringp help) help) (t (symbol-name help)))) @@ -2946,9 +2946,9 @@ idlw-shell-examine-alist via mini-buffer shortcut key." idlwave-shell-calling-stack-index))) (setq cmd (idlwave-shell-help-statement help expr)) ;;(idlwave-shell-recenter-shell-window) - (idlwave-shell-send-command - cmd - examine-hook + (idlwave-shell-send-command + cmd + examine-hook (if idlwave-shell-separate-examine-output 'hide)))))) (defvar idlwave-shell-examine-window-alist nil @@ -2975,9 +2975,9 @@ idlw-shell-examine-alist via mini-buffer shortcut key." (let* ((end (or (re-search-backward idlwave-shell-prompt-pattern nil t) (point-max))) - (beg (progn + (beg (progn (goto-char - (or (progn (if (re-search-backward + (or (progn (if (re-search-backward idlwave-shell-prompt-pattern nil t) (match-end 0))) (point-min))) @@ -2994,21 +2994,21 @@ idlw-shell-examine-alist via mini-buffer shortcut key." (setq buffer-read-only t) (move-overlay idlwave-shell-output-overlay cur-beg cur-end (current-buffer)) - + ;; Look for the examine buffer in all windows. If one is ;; found in a frame all by itself, use that, otherwise, switch ;; to or create an examine window in this frame, and resize if ;; it's a newly created window (let* ((winlist (get-buffer-window-list "*Examine*" nil 'visible))) - (setq win (idlwave-display-buffer - "*Examine*" + (setq win (idlwave-display-buffer + "*Examine*" nil (let ((list winlist) thiswin) (catch 'exit (save-selected-window (while (setq thiswin (pop list)) (select-window thiswin) - (if (one-window-p) + (if (one-window-p) (throw 'exit (window-frame thiswin))))))))) (set-window-start win (point-min)) ; Ensure the point is visible. (save-selected-window @@ -3029,7 +3029,7 @@ idlw-shell-examine-alist via mini-buffer shortcut key." ;; And add the new value. (if (setq elt (assoc win idlwave-shell-examine-window-alist)) (setcdr elt (window-height)) - (add-to-list 'idlwave-shell-examine-window-alist + (add-to-list 'idlwave-shell-examine-window-alist (cons win (window-height))))))))) ;; Recenter for maximum output, after widened (save-selected-window @@ -3047,7 +3047,7 @@ idlw-shell-examine-alist via mini-buffer shortcut key." (defun idlwave-shell-examine-display-clear () (interactive) - (save-excursion + (save-excursion (let ((buf (get-buffer "*Examine*"))) (when (bufferp buf) (set-buffer buf) @@ -3075,7 +3075,7 @@ versions of IDL." ;; break. We will look for identifiers and exclude cases where we ;; know it is not a variable. To distinguish array references from ;; function calls, we require that arrays use [] instead of () - + (while (string-match "\\(\\`\\|[^a-zA-Z0-9$_][ \t]*\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)\\([ \t]*[^a-zA-Z0-9$_]\\|\\'\\)" expr start) (setq var (match-string 2 expr) @@ -3091,7 +3091,7 @@ versions of IDL." ((string-match "->[ \t]*\\'" pre)) ;; a method ((string-match "\\.\\'" pre)) ;; structure member ((and (string-match "\\([\"\']\\)[^\1]*$" pre) - (string-match (concat "^[^" (match-string 1 pre) "]*" + (string-match (concat "^[^" (match-string 1 pre) "]*" (match-string 1 pre)) post))) (t ;; seems to be a variable - replace its name in the ;; expression with the fetch. @@ -3109,13 +3109,13 @@ to insert expression in place of the marker ___, e.g.: print, size(___,/DIMENSIONS)" (cond ((null help) (concat "print, " expr)) - ((stringp help) + ((stringp help) (if (string-match "\\(^\\|[^_]\\)\\(___\\)\\([^_]\\|$\\)" help) (concat (substring help 0 (match-beginning 2)) expr (substring help (match-end 2))))) (t (concat "help, " expr)))) - + (defun idlwave-shell-examine-highlight () "Highlight the most recent IDL output." @@ -3123,7 +3123,7 @@ size(___,/DIMENSIONS)" (process (get-buffer-process buffer)) (process-mark (if process (process-mark process))) output-begin output-end) - (save-excursion + (save-excursion (set-buffer buffer) (goto-char process-mark) (beginning-of-line) @@ -3131,12 +3131,12 @@ size(___,/DIMENSIONS)" (re-search-backward idlwave-shell-prompt-pattern nil t) (beginning-of-line 2) (setq output-begin (point))) - + ;; First make sure the shell window is visible (idlwave-display-buffer (idlwave-shell-buffer) nil (idlwave-shell-shell-frame)) (if (and idlwave-shell-output-overlay process-mark) - (move-overlay idlwave-shell-output-overlay + (move-overlay idlwave-shell-output-overlay output-begin output-end buffer)))) (defun idlwave-shell-delete-output-overlay () @@ -3147,7 +3147,7 @@ size(___,/DIMENSIONS)" (delete-overlay idlwave-shell-output-overlay)) (error nil)) (remove-hook 'pre-command-hook 'idlwave-shell-delete-output-overlay))) - + (defun idlwave-shell-delete-expression-overlay () (unless (or (eq this-command 'idlwave-shell-mouse-nop) (eq this-command 'handle-switch-frame)) @@ -3176,7 +3176,7 @@ contains four items: count - number of times to execute breakpoint. When count reaches 0 the breakpoint is cleared and removed from the alist. -command - command to execute when breakpoint is reached, either a +command - command to execute when breakpoint is reached, either a lisp function to be called with `funcall' with no arguments or a list to be evaluated with `eval'. @@ -3209,11 +3209,11 @@ If there is a prefix argument, display IDL process." (insert "\nend\n")) (save-buffer 0))) (idlwave-shell-send-command (concat ".run " idlwave-shell-temp-pro-file) - nil + nil (if (idlwave-shell-hide-p 'run) 'mostly) nil t) (if n - (idlwave-display-buffer (idlwave-shell-buffer) + (idlwave-display-buffer (idlwave-shell-buffer) nil (idlwave-shell-shell-frame)))) (defun idlwave-shell-evaluate-region (beg end &optional n) @@ -3224,7 +3224,7 @@ Does not work for a region with multiline blocks - use (interactive "r\nP") (idlwave-shell-send-command (buffer-substring beg end)) (if n - (idlwave-display-buffer (idlwave-shell-buffer) + (idlwave-display-buffer (idlwave-shell-buffer) nil (idlwave-shell-shell-frame)))) (defun idlwave-shell-delete-temp-files () @@ -3279,7 +3279,7 @@ Queries IDL using the string in `idlwave-shell-bp-query'." 'hide)) (defun idlwave-shell-bp-get (bp &optional item) - "Get a value for a breakpoint. + "Get a value for a breakpoint. BP has the form of elements in idlwave-shell-bp-alist. Optional second arg ITEM is the particular value to retrieve. ITEM can be 'file, 'line, 'index, 'module, 'count, 'cmd, 'condition, 'disabled or @@ -3314,8 +3314,8 @@ breakpoint overlays." ;; Searching the breakpoints ;; In IDL 5.5, the breakpoint reporting format changed. (bp-re54 "^[ \t]*\\([0-9]+\\)[ \t]+\\(\\S-+\\)?[ \t]+\\([0-9]+\\)[ \t]+\\(\\S-+\\)") - (bp-re55 - (concat + (bp-re55 + (concat "^\\s-*\\([0-9]+\\)" ; 1 index "\\s-+\\([0-9]+\\)" ; 2 line number "\\s-+\\(Uncompiled\\|" ; 3-6 either uncompiled or routine name @@ -3330,27 +3330,27 @@ breakpoint overlays." bp-re indmap) (setq idlwave-shell-bp-alist (list nil)) ;; Search for either header type, and set the correct regexp - (when (or + (when (or (if (re-search-forward "^\\s-*Index.*\n\\s-*-" nil t) - (setq bp-re bp-re54 ; versions <= 5.4 + (setq bp-re bp-re54 ; versions <= 5.4 indmap '(1 2 3 4))) ;index module line file - (if (re-search-forward + (if (re-search-forward "^\\s-*Index\\s-*Line\\s-*Attributes\\s-*File" nil t) (setq bp-re bp-re55 ; versions >= 5.5 indmap '(1 6 2 16)))) ; index module line file ;; There seems to be a breakpoint listing here, parse breakpoint lines. (while (re-search-forward bp-re nil t) - (setq index (string-to-int (match-string (nth 0 indmap))) + (setq index (string-to-number (match-string (nth 0 indmap))) module (match-string (nth 1 indmap)) - line (string-to-int (match-string (nth 2 indmap))) + line (string-to-number (match-string (nth 2 indmap))) file (idlwave-shell-file-name (match-string (nth 3 indmap)))) (if (eq bp-re bp-re55) - (setq count (if (match-string 10) 1 + (setq count (if (match-string 10) 1 (if (match-string 8) - (string-to-int (match-string 8)))) + (string-to-number (match-string 8)))) condition (match-string 13) disabled (not (null (match-string 15))))) - + ;; Add the breakpoint info to the list (nconc idlwave-shell-bp-alist (list (cons (list file line) @@ -3360,7 +3360,7 @@ breakpoint overlays." count nil condition disabled)))))) (setq idlwave-shell-bp-alist (cdr idlwave-shell-bp-alist)) ;; Update breakpoint data - (if (eq bp-re bp-re54) + (if (eq bp-re bp-re54) (mapcar 'idlwave-shell-update-bp old-bp-alist) (mapcar 'idlwave-shell-update-bp-command-only old-bp-alist)))) ;; Update the breakpoint overlays @@ -3375,8 +3375,8 @@ breakpoint overlays." "Update BP data in breakpoint list. If BP frame is in `idlwave-shell-bp-alist' updates the breakpoint data." (let ((match (assoc (car bp) idlwave-shell-bp-alist))) - (if match - (if command-only + (if match + (if command-only (setf (nth 1 (cdr (cdr match))) (nth 1 (cdr (cdr match)))) (setcdr (cdr match) (cdr (cdr bp))))))) @@ -3401,7 +3401,7 @@ Otherwise return the filename in bp." (let* ((bp-file (idlwave-shell-bp-get bp 'file)) (bp-module (idlwave-shell-bp-get bp 'module)) - (internal-file-list + (internal-file-list (cdr (assoc bp-module idlwave-shell-sources-alist)))) (if (and internal-file-list (equal bp-file (nth 0 internal-file-list))) @@ -3409,14 +3409,14 @@ Otherwise return the filename in bp." bp-file))) (defun idlwave-shell-set-bp (bp &optional no-show) - "Try to set a breakpoint BP. + "Try to set a breakpoint BP. The breakpoint will be placed at the beginning of the statement on the line specified by BP or at the next IDL statement if that line is not a statement. Determines IDL's internal representation for the breakpoint, which may have occurred at a different line than specified. If NO-SHOW is non-nil, don't do any updating." ;; Get and save the old breakpoints - (idlwave-shell-send-command + (idlwave-shell-send-command idlwave-shell-bp-query `(progn (idlwave-shell-filter-bp (quote ,no-show)) @@ -3434,7 +3434,7 @@ specified. If NO-SHOW is non-nil, don't do any updating." (defun idlwave-shell-set-bp2 (bp &optional no-show) "Use results of breakpoint and sources query to set bp. Use the count argument with IDLs breakpoint command. -We treat a count of 1 as a temporary breakpoint. +We treat a count of 1 as a temporary breakpoint. Counts greater than 1 use the IDL AFTER=count keyword to break only after reaching the statement count times." (let* @@ -3446,11 +3446,11 @@ only after reaching the statement count times." ((> arg 1) (format ",after=%d" arg)))) (condition (idlwave-shell-bp-get bp 'condition)) - (key (concat key + (key (concat key (if condition (concat ",CONDITION=\"" condition "\"")))) (line (idlwave-shell-bp-get bp 'line))) (idlwave-shell-send-command - (concat "breakpoint,'" + (concat "breakpoint,'" (idlwave-shell-sources-bp bp) "'," (if (integerp line) (setq line (int-to-string line))) key) @@ -3534,14 +3534,14 @@ Existing overlays are recycled, in order to minimize consumption." ov ov-list bp buf old-buffers win) ;; Delete the old overlays from their buffers - (if ov-alist + (if ov-alist (while (setq ov-list (pop ov-alist)) (while (setq ov (pop (cdr ov-list))) (add-to-list 'old-buffers (overlay-buffer ov)) (delete-overlay ov)))) - + (setq ov-alist idlwave-shell-bp-overlays - idlwave-shell-bp-overlays + idlwave-shell-bp-overlays (if idlwave-shell-bp-glyph (mapcar 'list (mapcar 'car idlwave-shell-bp-glyph)) (list (list 'bp)))) @@ -3565,7 +3565,7 @@ Existing overlays are recycled, in order to minimize consumption." (t 'bp-n))) (t 'bp)) 'bp)) - (help-list + (help-list (delq nil (list (if count @@ -3573,7 +3573,7 @@ Existing overlays are recycled, in order to minimize consumption." (if condition (concat "condition: " condition)) (if disabled "disabled")))) - (help-text (if help-list + (help-text (if help-list (mapconcat 'identity help-list ","))) (full-type (if disabled (intern (concat (symbol-name type) @@ -3582,7 +3582,7 @@ Existing overlays are recycled, in order to minimize consumption." (ov-existing (assq full-type ov-alist)) (ov (or (and (cdr ov-existing) (pop (cdr ov-existing))) - (idlwave-shell-make-new-bp-overlay + (idlwave-shell-make-new-bp-overlay type disabled help-text))) match) (move-overlay ov beg end) @@ -3592,7 +3592,7 @@ Existing overlays are recycled, in order to minimize consumption." (list (list full-type ov))))) ;; Take care of margins if using a glyph (when use-glyph - (if old-buffers + (if old-buffers (setq old-buffers (delq (current-buffer) old-buffers))) (if (fboundp 'set-specifier) ;; XEmacs (set-specifier left-margin-width (cons (current-buffer) 2)) @@ -3610,7 +3610,7 @@ Existing overlays are recycled, in order to minimize consumption." (defun idlwave-shell-make-new-bp-overlay (&optional type disabled help) - "Make a new overlay for highlighting breakpoints. + "Make a new overlay for highlighting breakpoints. This stuff is strongly dependant upon the version of Emacs. If TYPE is passed, make an overlay of that type ('bp or 'bp-cond, currently @@ -3620,17 +3620,17 @@ text popup." (use-glyph (and (memq idlwave-shell-mark-breakpoints '(t glyph)) idlwave-shell-bp-glyph)) (type (or type 'bp)) - (face (if disabled + (face (if disabled idlwave-shell-disabled-breakpoint-face idlwave-shell-breakpoint-face))) (if (featurep 'xemacs) ;; This is XEmacs (progn - (cond + (cond ;; tty's cannot display glyphs ((eq (console-type) 'tty) (set-extent-property ov 'face face)) - + ;; use the glyph (use-glyph (let ((glyph (cdr (assq type idlwave-shell-bp-glyph)))) @@ -3651,13 +3651,13 @@ text popup." (if use-glyph (let ((image-props (cdr (assq type idlwave-shell-bp-glyph))) string) - + (if disabled (setq image-props - (append image-props + (append image-props (list :conversion 'disabled)))) - (setq string - (propertize "@" - 'display + (setq string + (propertize "@" + 'display (list (list 'margin 'left-margin) image-props) 'mouse-face 'highlight @@ -3685,14 +3685,14 @@ text popup." Also with prefix arg, ask for the command. You can also use the command `idlwave-shell-edit-default-command-line' to edit the line." (interactive "P") - (cond + (cond ((equal arg '(16)) (setq idlwave-shell-command-line-to-execute nil)) ((equal arg '(4)) - (setq idlwave-shell-command-line-to-execute + (setq idlwave-shell-command-line-to-execute (read-string "IDL> " idlwave-shell-command-line-to-execute)))) (idlwave-shell-reset 'hidden) - (idlwave-shell-send-command + (idlwave-shell-send-command (or idlwave-shell-command-line-to-execute (with-current-buffer (idlwave-shell-buffer) (ring-ref comint-input-ring 0))) @@ -3702,7 +3702,7 @@ Also with prefix arg, ask for the command. You can also use the command "Save file and run it in IDL. Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL. When called from the shell buffer, re-run the file which was last handled by -one of the save-and-.. commands." +one of the save-and-.. commands." (interactive) (idlwave-shell-save-and-action 'run)) @@ -3718,7 +3718,7 @@ one of the save-and-.. commands." "Save file and batch it in IDL. Runs `save-buffer' and sends a '@file' command for the associated file to IDL. When called from the shell buffer, re-batch the file which was last handled by -one of the save-and-.. commands." +one of the save-and-.. commands." (interactive) (idlwave-shell-save-and-action 'batch)) @@ -3758,7 +3758,7 @@ handled by this command." 'idlwave-shell-maybe-update-routine-info (if (idlwave-shell-hide-p 'run) 'mostly) nil t) (idlwave-shell-bp-query)) - (let ((msg (format "No such file %s" + (let ((msg (format "No such file %s" idlwave-shell-last-save-and-action-file))) (setq idlwave-shell-last-save-and-action-file nil) (error msg)))) @@ -3791,7 +3791,7 @@ Queries IDL using the string in `idlwave-shell-sources-query'." (defun idlwave-shell-sources-filter () "Get source files from `idlwave-shell-sources-query' output. -Create `idlwave-shell-sources-alist' consisting of +Create `idlwave-shell-sources-alist' consisting of list elements of the form: (module name . (source-file-truename idlwave-internal-filename))." (save-excursion @@ -3876,9 +3876,9 @@ list elements of the form: (list (save-match-data (idlwave-shell-file-name - (buffer-substring (match-beginning 1 ) + (buffer-substring (match-beginning 1 ) (match-end 1)))) - (string-to-int + (string-to-number (buffer-substring (match-beginning 2) (match-end 2))))) ;; Try to find the column of the error @@ -3943,13 +3943,13 @@ Otherwise, just expand the file name." ;; The mouse bindings for PRINT and HELP (idlwave-shell-define-key-both - (if (featurep 'xemacs) - [(shift button2)] + (if (featurep 'xemacs) + [(shift button2)] [(shift down-mouse-2)]) 'idlwave-shell-mouse-print) (idlwave-shell-define-key-both - (if (featurep 'xemacs) - [(control meta button2)] + (if (featurep 'xemacs) + [(control meta button2)] [(control meta down-mouse-2)]) 'idlwave-shell-mouse-help) (idlwave-shell-define-key-both @@ -3958,14 +3958,14 @@ Otherwise, just expand the file name." [(control shift down-mouse-2)]) 'idlwave-shell-examine-select) ;; Add this one from the idlwave-mode-map -(define-key idlwave-shell-mode-map +(define-key idlwave-shell-mode-map (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)]) 'idlwave-mouse-context-help) ;; For Emacs, we need to turn off the button release events. -(defun idlwave-shell-mouse-nop (event) +(defun idlwave-shell-mouse-nop (event) (interactive "e")) (unless (featurep 'xemacs) (idlwave-shell-define-key-both @@ -3975,7 +3975,7 @@ Otherwise, just expand the file name." (idlwave-shell-define-key-both [(control meta mouse-2)] 'idlwave-shell-mouse-nop)) - + ;; The following set of bindings is used to bind the debugging keys. ;; If `idlwave-shell-activate-prefix-keybindings' is non-nil, the ;; first key in the list gets bound the C-c C-d prefix map. If @@ -3984,10 +3984,10 @@ Otherwise, just expand the file name." ;; `idlwave-mode-map' and `idlwave-shell-mode-map'. The next list ;; item, if non-nil, means to bind this as a single key in the ;; electric-debug-mode-map. -;; +;; ;; [C-c C-d]-binding debug-modifier-key command bind-electric-debug buf-only -;; Used keys: abcdef hijklmnopqrstuvwxyz -;; Unused keys: g +;; Used keys: abcdef hijklmnopqrstuvwxyz +;; Unused keys: g (let* ((specs '(([(control ?b)] ?b idlwave-shell-break-here t t) ([(control ?i)] ?i idlwave-shell-break-in t t) @@ -4037,10 +4037,10 @@ Otherwise, just expand the file name." electric (nth 3 s) only-buffer (nth 4 s) cannotshift (and shift (char-valid-p c2) (eq c2 (upcase c2)))) - + ;; The regular prefix keymap. (when (and idlwave-shell-activate-prefix-keybindings k1) - (unless only-buffer + (unless only-buffer (define-key idlwave-shell-mode-prefix-map k1 cmd)) (define-key idlwave-mode-prefix-map k1 cmd)) ;; The debug modifier map @@ -4054,24 +4054,24 @@ Otherwise, just expand the file name." (unless only-buffer (define-key idlwave-shell-mode-map k2 cmd)))) ;; The electric debug single-keystroke map (if (and electric (char-or-string-p c2)) - (define-key idlwave-shell-electric-debug-mode-map (char-to-string c2) + (define-key idlwave-shell-electric-debug-mode-map (char-to-string c2) cmd)))) ;; A few extras in the electric debug map (define-key idlwave-shell-electric-debug-mode-map " " 'idlwave-shell-step) (define-key idlwave-shell-electric-debug-mode-map "+" 'idlwave-shell-stack-up) (define-key idlwave-shell-electric-debug-mode-map "=" 'idlwave-shell-stack-up) -(define-key idlwave-shell-electric-debug-mode-map "-" +(define-key idlwave-shell-electric-debug-mode-map "-" 'idlwave-shell-stack-down) -(define-key idlwave-shell-electric-debug-mode-map "_" +(define-key idlwave-shell-electric-debug-mode-map "_" 'idlwave-shell-stack-down) (define-key idlwave-shell-electric-debug-mode-map "q" 'idlwave-shell-retall) -(define-key idlwave-shell-electric-debug-mode-map "t" +(define-key idlwave-shell-electric-debug-mode-map "t" '(lambda () (interactive) (idlwave-shell-send-command "help,/TRACE"))) (define-key idlwave-shell-electric-debug-mode-map [(control ??)] 'idlwave-shell-electric-debug-help) -(define-key idlwave-shell-electric-debug-mode-map "x" - '(lambda (arg) (interactive "P") +(define-key idlwave-shell-electric-debug-mode-map "x" + '(lambda (arg) (interactive "P") (idlwave-shell-print arg nil nil t))) @@ -4092,12 +4092,12 @@ Otherwise, just expand the file name." (setq idlwave-shell-suppress-electric-debug nil)) (idlwave-shell-electric-debug-mode)) -(defvar idlwave-shell-electric-debug-read-only) +(defvar idlwave-shell-electric-debug-read-only) (defvar idlwave-shell-electric-debug-buffers nil) (easy-mmode-define-minor-mode idlwave-shell-electric-debug-mode "Toggle Electric Debug mode. -With no argument, this command toggles the mode. +With no argument, this command toggles the mode. Non-null prefix argument turns on the mode. Null prefix argument turns off the mode. @@ -4107,7 +4107,7 @@ nil " *Debugging*" idlwave-shell-electric-debug-mode-map) -(add-hook +(add-hook 'idlwave-shell-electric-debug-mode-on-hook (lambda () (set (make-local-variable 'idlwave-shell-electric-debug-read-only) @@ -4115,13 +4115,13 @@ idlwave-shell-electric-debug-mode-map) (setq buffer-read-only t) (add-to-list 'idlwave-shell-electric-debug-buffers (current-buffer)) (if idlwave-shell-stop-line-overlay - (overlay-put idlwave-shell-stop-line-overlay 'face + (overlay-put idlwave-shell-stop-line-overlay 'face idlwave-shell-electric-stop-line-face)) (if (facep 'fringe) (set-face-foreground 'fringe idlwave-shell-electric-stop-color (selected-frame))))) -(add-hook +(add-hook 'idlwave-shell-electric-debug-mode-off-hook (lambda () ;; Return to previous read-only state @@ -4130,7 +4130,7 @@ idlwave-shell-electric-debug-mode-map) (setq idlwave-shell-electric-debug-buffers (delq (current-buffer) idlwave-shell-electric-debug-buffers)) (if idlwave-shell-stop-line-overlay - (overlay-put idlwave-shell-stop-line-overlay 'face + (overlay-put idlwave-shell-stop-line-overlay 'face idlwave-shell-stop-line-face) (if (facep 'fringe) (set-face-foreground 'fringe (face-foreground 'default)))))) @@ -4161,7 +4161,7 @@ idlwave-shell-electric-debug-mode-map) ;; Show the help text (defun idlwave-shell-electric-debug-help () (interactive) - (with-output-to-temp-buffer "*IDLWAVE Electric Debug Help*" + (with-output-to-temp-buffer "*IDLWAVE Electric Debug Help*" (princ idlwave-shell-electric-debug-help)) (let* ((current-window (selected-window)) (window (get-buffer-window "*IDLWAVE Electric Debug Help*")) @@ -4176,7 +4176,7 @@ idlwave-shell-electric-debug-mode-map) `("Debug" ["Electric Debug Mode" idlwave-shell-electric-debug-mode - :style toggle :selected idlwave-shell-electric-debug-mode + :style toggle :selected idlwave-shell-electric-debug-mode :included (eq major-mode 'idlwave-mode) :keys "C-c C-d C-v"] "--" ("Compile & Run" @@ -4192,35 +4192,35 @@ idlwave-shell-electric-debug-mode-map) "--" ["Goto Next Error" idlwave-shell-goto-next-error t] "--" - ["Compile and Run Region" idlwave-shell-run-region + ["Compile and Run Region" idlwave-shell-run-region (eq major-mode 'idlwave-mode)] - ["Evaluate Region" idlwave-shell-evaluate-region + ["Evaluate Region" idlwave-shell-evaluate-region (eq major-mode 'idlwave-mode)] "--" ["Execute Default Cmd" idlwave-shell-execute-default-command-line t] ["Edit Default Cmd" idlwave-shell-edit-default-command-line t]) ("Breakpoints" - ["Set Breakpoint" idlwave-shell-break-here + ["Set Breakpoint" idlwave-shell-break-here :keys "C-c C-d C-c" :active (eq major-mode 'idlwave-mode)] ("Set Special Breakpoint" ["Set After Count Breakpoint" (progn - (let ((count (string-to-int (read-string "Break after count: ")))) + (let ((count (string-to-number (read-string "Break after count: ")))) (if (integerp count) (idlwave-shell-break-here count)))) :active (eq major-mode 'idlwave-mode)] ["Set Condition Breakpoint" (idlwave-shell-break-here '(4)) :active (eq major-mode 'idlwave-mode)]) - ["Break in Module" idlwave-shell-break-in + ["Break in Module" idlwave-shell-break-in :keys "C-c C-d C-i" :active (eq major-mode 'idlwave-mode)] ["Break in this Module" idlwave-shell-break-this-module :keys "C-c C-d C-j" :active (eq major-mode 'idlwave-mode)] ["Clear Breakpoint" idlwave-shell-clear-current-bp t] ["Clear All Breakpoints" idlwave-shell-clear-all-bp t] ["Disable/Enable Breakpoint" idlwave-shell-toggle-enable-current-bp t] - ["Goto Previous Breakpoint" idlwave-shell-goto-previous-bp + ["Goto Previous Breakpoint" idlwave-shell-goto-previous-bp :keys "C-c C-d [" :active (eq major-mode 'idlwave-mode)] - ["Goto Next Breakpoint" idlwave-shell-goto-next-bp + ["Goto Next Breakpoint" idlwave-shell-goto-next-bp :keys "C-c C-d ]" :active (eq major-mode 'idlwave-mode)] ["List All Breakpoints" idlwave-shell-list-all-bp t] ["Resync Breakpoints" idlwave-shell-bp-query t]) @@ -4252,38 +4252,38 @@ idlwave-shell-electric-debug-mode-map) ["Redisplay and Sync" idlwave-shell-redisplay t]) ("Show Commands" ["Everything" (if (eq idlwave-shell-show-commands 'everything) - (progn + (progn (setq idlwave-shell-show-commands (get 'idlwave-shell-show-commands 'last-val)) (put 'idlwave-shell-show-commands 'last-val nil)) - (put 'idlwave-shell-show-commands 'last-val + (put 'idlwave-shell-show-commands 'last-val idlwave-shell-show-commands) (setq idlwave-shell-show-commands 'everything)) :style toggle :selected (and (not (listp idlwave-shell-show-commands)) - (eq idlwave-shell-show-commands + (eq idlwave-shell-show-commands 'everything))] "--" ["Compiling Commands" (idlwave-shell-add-or-remove-show 'run) - :style toggle - :selected (not (idlwave-shell-hide-p + :style toggle + :selected (not (idlwave-shell-hide-p 'run (get 'idlwave-shell-show-commands 'last-val))) :active (not (eq idlwave-shell-show-commands 'everything))] ["Breakpoint Commands" (idlwave-shell-add-or-remove-show 'breakpoint) - :style toggle - :selected (not (idlwave-shell-hide-p + :style toggle + :selected (not (idlwave-shell-hide-p 'breakpoint (get 'idlwave-shell-show-commands 'last-val))) :active (not (eq idlwave-shell-show-commands 'everything))] ["Debug Commands" (idlwave-shell-add-or-remove-show 'debug) - :style toggle - :selected (not (idlwave-shell-hide-p + :style toggle + :selected (not (idlwave-shell-hide-p 'debug (get 'idlwave-shell-show-commands 'last-val))) :active (not (eq idlwave-shell-show-commands 'everything))] ["Miscellaneous Commands" (idlwave-shell-add-or-remove-show 'misc) - :style toggle - :selected (not (idlwave-shell-hide-p + :style toggle + :selected (not (idlwave-shell-hide-p 'misc (get 'idlwave-shell-show-commands 'last-val))) :active (not (eq idlwave-shell-show-commands 'everything))]) @@ -4297,7 +4297,7 @@ idlwave-shell-electric-debug-mode-map) :style toggle :selected idlwave-shell-use-input-mode-magic]) "--" ["Update Working Dir" idlwave-shell-resync-dirs t] - ["Save Path Info" + ["Save Path Info" (idlwave-shell-send-command idlwave-shell-path-query 'idlwave-shell-get-path-info 'hide) @@ -4309,7 +4309,7 @@ idlwave-shell-electric-debug-mode-map) (if (or (featurep 'easymenu) (load "easymenu" t)) (progn - (easy-menu-define + (easy-menu-define idlwave-mode-debug-menu idlwave-mode-map "IDL debugging menus" idlwave-shell-menu-def) (easy-menu-define @@ -4329,7 +4329,7 @@ idlwave-shell-electric-debug-mode-map) (defvar idlwave-shell-bp-glyph nil "The glyphs to mark breakpoint lines in the source code.") -(let ((image-alist +(let ((image-alist '((bp . "/* XPM */ static char * file[] = { \"14 12 3 1\", @@ -4462,7 +4462,7 @@ static char * file[] = { \" .XXXX. \", \" .... \", \" \"};"))) im-cons im) - + (while (setq im-cons (pop image-alist)) (setq im (cond ((and (featurep 'xemacs) (featurep 'xpm)) @@ -4475,7 +4475,7 @@ static char * file[] = { ((and (not (featurep 'xemacs)) (fboundp 'image-type-available-p) (image-type-available-p 'xpm)) - (list 'image :type 'xpm :data (cdr im-cons) + (list 'image :type 'xpm :data (cdr im-cons) :ascent 'center)) (t nil))) (if im (push (cons (car im-cons) im) idlwave-shell-bp-glyph)))) @@ -4485,7 +4485,7 @@ static char * file[] = { ;;; Load the toolbar when wanted by the user. -(autoload 'idlwave-toolbar-toggle "idlw-toolbar" +(autoload 'idlwave-toolbar-toggle "idlw-toolbar" "Toggle the IDLWAVE toolbar") (autoload 'idlwave-toolbar-add-everywhere "idlw-toolbar" "Add IDLWAVE toolbar") diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el index b3495c74491..2d8f1d80aae 100644 --- a/lisp/progmodes/ps-mode.el +++ b/lisp/progmodes/ps-mode.el @@ -1173,7 +1173,7 @@ Use line numbers if `ps-run-error-line-numbers' is not nil" (let (i) (setq i - (string-to-int + (string-to-number (buffer-substring (match-beginning 0) (match-end 0)))) (goto-char p) (pop-to-buffer ps-run-parent) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 9f0e63e80a6..12f04895f98 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -5082,7 +5082,7 @@ Return a valid value only." ((string-equal "++" input) '++) ((string-equal "--" input) '--) ((string-match "^-?[0-9]+$" input) - (string-to-int input)) + (string-to-number input)) ((fboundp (setq interned (intern input))) interned) ((boundp interned) interned) @@ -13701,10 +13701,10 @@ entity ENT-KEY." (condition-case () (progn (load-file file-dir-name) (string< (mapconcat - (lambda (a) (format "%3d" (string-to-int a))) + (lambda (a) (format "%3d" (string-to-number a))) (split-string "3.31.14" "\\.") "") (mapconcat - (lambda (a) (format "%3d" (string-to-int a))) + (lambda (a) (format "%3d" (string-to-number a))) (split-string vhdl-cache-version "\\.") ""))) (error (progn (vhdl-warning (format "ERROR: Corrupted cache file: \"%s\"" file-dir-name)) nil)))))) @@ -14075,7 +14075,7 @@ otherwise use cached data." (beginning-of-line) (looking-at "^\\([0-9]+\\):")) (re-search-backward (format "^[0-%d]:\\s-*[[{<]-" - (max (1- (string-to-int (match-string 1))) 0)) nil t))) + (max (1- (string-to-number (match-string 1))) 0)) nil t))) (goto-char (match-end 0)) (speedbar-do-function-pointer) (speedbar-center-buffer-smartly))) diff --git a/lisp/server.el b/lisp/server.el index a0f41e59ff8..0a5fc942206 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -325,11 +325,11 @@ PROC is the server process. Format of STRING is \"PATH PATH PATH... \\n\"." (setq request ""))))) ;; ARG is a line number option. ((string-match "\\`\\+[0-9]+\\'" arg) - (setq lineno (string-to-int (substring arg 1)))) + (setq lineno (string-to-number (substring arg 1)))) ;; ARG is line number:column option. ((string-match "\\`+\\([0-9]+\\):\\([0-9]+\\)\\'" arg) - (setq lineno (string-to-int (match-string 1 arg)) - columnno (string-to-int (match-string 2 arg)))) + (setq lineno (string-to-number (match-string 1 arg)) + columnno (string-to-number (match-string 2 arg)))) (t ;; Undo the quoting that emacsclient does ;; for certain special characters. diff --git a/lisp/shell.el b/lisp/shell.el index 354ed88f80f..fd5e6c25032 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -759,7 +759,7 @@ Environment variables are expanded, see function `substitute-in-file-name'." ;; If STR is of the form +n, for n>0, return n. Otherwise, nil. (defun shell-extract-num (str) (and (string-match "^\\+[1-9][0-9]*$" str) - (string-to-int str))) + (string-to-number str))) (defun shell-dirtrack-mode () diff --git a/lisp/startup.el b/lisp/startup.el index c9f8d5e26e7..b7d1a1d34df 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1631,11 +1631,11 @@ normal otherwise." (kill-emacs t)) ((string-match "^\\+[0-9]+\\'" argi) - (setq line (string-to-int argi))) + (setq line (string-to-number argi))) ((string-match "^\\+\\([0-9]+\\):\\([0-9]+\\)\\'" argi) - (setq line (string-to-int (match-string 1 argi)) - column (string-to-int (match-string 2 argi)))) + (setq line (string-to-number (match-string 1 argi)) + column (string-to-number (match-string 2 argi)))) ((setq tem (assoc argi command-line-x-option-alist)) ;; Ignore X-windows options and their args if not using X. diff --git a/lisp/term.el b/lisp/term.el index 473fafd558a..2b89b83fb04 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3339,7 +3339,7 @@ The top-most line is line 0." (second-colon (string-match ":" string (1+ first-colon))) (filename (substring string 1 first-colon)) - (fileline (string-to-int + (fileline (string-to-number (substring string (1+ first-colon) second-colon)))) (setq term-pending-frame (cons filename fileline)))) ((= (aref string 0) ?/) diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 366668c66f3..a27a4c6395c 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -106,7 +106,7 @@ (let ((param (nth 3 aelt))) (setq default-frame-alist (cons (cons param - (string-to-int (car x-invocation-args))) + (string-to-number (car x-invocation-args))) default-frame-alist) x-invocation-args (cdr x-invocation-args)))))) diff --git a/lisp/term/sun-mouse.el b/lisp/term/sun-mouse.el index 8d9bfb67cf7..cee02919a66 100644 --- a/lisp/term/sun-mouse.el +++ b/lisp/term/sun-mouse.el @@ -615,7 +615,7 @@ CODE values: 13 = Tool-Position, 14 = Size-in-Pixels, 18 = Size-in-Chars." (setq str (substring str (match-end 0))) (string-match ";[0-9]*" str) (setq x (substring str (1+ (match-beginning 0)) (match-end 0))) - (cons (string-to-int y) (string-to-int x)))) + (cons (string-to-number y) (string-to-number x)))) (defun sm::font-size () "Returns font size in pixels: (cons Ysize Xsize)" diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index f99eff9ef1a..76644fc2d63 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -146,7 +146,7 @@ the last file dropped is selected." "Handle SWITCH of the form \"-switch n\"." (let ((aelt (assoc switch command-line-x-option-alist))) (if aelt - (push (cons (nth 3 aelt) (string-to-int (pop x-invocation-args))) + (push (cons (nth 3 aelt) (string-to-number (pop x-invocation-args))) default-frame-alist)))) ;; Handle options that apply to initial frame only diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index c37c98f6781..5b4ff6d2f7c 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -105,7 +105,7 @@ (let ((param (nth 3 aelt))) (setq default-frame-alist (cons (cons param - (string-to-int (car x-invocation-args))) + (string-to-number (car x-invocation-args))) default-frame-alist) x-invocation-args (cdr x-invocation-args)))))) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c8926776400..1de27265b08 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2296,9 +2296,9 @@ Optional third arg SHIFT is an offset to apply based on previous corrections." (setq output (substring output (match-end 0))) ; skip over misspelling (if (eq type ?#) (setq count 0) ; no misses for type # - (setq count (string-to-int output) ; get number of misses. + (setq count (string-to-number output) ; get number of misses. output (substring output (1+ (string-match " " output 1))))) - (setq offset (string-to-int output)) + (setq offset (string-to-number output)) (if (eq type ?#) ; No miss or guess list. (setq output nil) (setq output (substring output (1+ (string-match " " output 1))))) diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el index c0638804ffa..9c5addb85fa 100644 --- a/lisp/textmodes/nroff-mode.el +++ b/lisp/textmodes/nroff-mode.el @@ -134,7 +134,7 @@ closing requests for requests that are used in matched pairs." (save-excursion (looking-at outline-regexp) (skip-chars-forward ".H ") - (string-to-int (buffer-substring (point) (+ 1 (point)))))) + (string-to-number (buffer-substring (point) (+ 1 (point)))))) ;;; Compute how much to indent a comment in nroff/troff source. ;;; By mit-erl!gildea April 86 diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index f12d01716fe..3f61e9c94ec 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el @@ -312,12 +312,12 @@ (not (stringp (car al1)))))) (defun reftex-bib-sort-year (e1 e2) - (< (string-to-int (or (cdr (assoc "year" e1)) "0")) - (string-to-int (or (cdr (assoc "year" e2)) "0")))) + (< (string-to-number (or (cdr (assoc "year" e1)) "0")) + (string-to-number (or (cdr (assoc "year" e2)) "0")))) (defun reftex-bib-sort-year-reverse (e1 e2) - (> (string-to-int (or (cdr (assoc "year" e1)) "0")) - (string-to-int (or (cdr (assoc "year" e2)) "0")))) + (> (string-to-number (or (cdr (assoc "year" e1)) "0")) + (string-to-number (or (cdr (assoc "year" e2)) "0")))) (defun reftex-get-crossref-alist (entry) ;; return the alist from a crossref entry @@ -988,7 +988,7 @@ While entering the regexp, completion on knows citation keys is possible. (while (string-match "\\(\\`\\|[^%]\\)\\(\\(%\\([0-9]*\\)\\([a-zA-Z]\\)\\)[.,;: ]*\\)" format) - (let ((n (string-to-int (match-string 4 format))) + (let ((n (string-to-number (match-string 4 format))) (l (string-to-char (match-string 5 format))) rpl b e) (save-match-data diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index ce1e3d77d72..3f1ff00494f 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -999,7 +999,7 @@ of master file." (if (string-match "\\`[A-Z]\\'" number-string) (aset reftex-section-numbers i (- (string-to-char number-string) ?A -1)) - (aset reftex-section-numbers i (string-to-int number-string))) + (aset reftex-section-numbers i (string-to-number number-string))) (pop numbers)) (decf i))) (put 'reftex-section-numbers 'appendix appendix)) @@ -1045,7 +1045,7 @@ of master file." (setq string (concat (char-to-string - (1- (+ ?A (string-to-int (match-string 0 string))))) + (1- (+ ?A (string-to-number (match-string 0 string))))) (substring string (match-end 0)))))) (if star (concat (make-string (1- (length string)) ?\ ) "*") diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index e478169c250..ad029266f3b 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -2807,7 +2807,7 @@ Default is to leave the number of spaces as is." (let ((arg (texinfo-parse-arg-discard))) (if (string= "asis" arg) (setq texinfo-paragraph-indent "asis") - (setq texinfo-paragraph-indent (string-to-int arg))))) + (setq texinfo-paragraph-indent (string-to-number arg))))) (put 'refill 'texinfo-format 'texinfo-format-refill) (defun texinfo-format-refill () diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index f574144f4b0..4cba3b5f456 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -270,7 +270,7 @@ template." (string-match "\\`\\(\\(-?[0-9]+\\)/\\)?\\([^%]+\\)?\\(\\(%[-.,:@+_ #^()0-9]*[A-Za-z%][^%]*\\)*%[-.,:@+_ #^()0-9]*[A-Za-z%]\\)?\\([^%]+\\)?\\'" time-stamp-pattern) (and (match-beginning 2) (setq line-limit - (string-to-int (match-string 2 time-stamp-pattern)))) + (string-to-number (match-string 2 time-stamp-pattern)))) (and (match-beginning 3) (setq ts-start (match-string 3 time-stamp-pattern))) (and (match-beginning 4) @@ -558,9 +558,9 @@ and all `time-stamp-format' compatibility." ((eq cur-char ?y) ;year (or alt-form (not (string-equal field-width "")) (time-stamp-conv-warn "%y" "%:y")) - (string-to-int (format-time-string "%Y" time))) + (string-to-number (format-time-string "%Y" time))) ((eq cur-char ?Y) ;4-digit year, new style - (string-to-int (format-time-string "%Y" time))) + (string-to-number (format-time-string "%Y" time))) ((eq cur-char ?z) ;time zone lower case (if change-case "" ;discourage %z variations @@ -597,7 +597,7 @@ and all `time-stamp-format' compatibility." (let* ((initial-length (length padded-result)) (desired-length (if (string-equal field-width "") initial-length - (string-to-int field-width)))) + (string-to-number field-width)))) (if (> initial-length desired-length) ;; truncate strings on right, years on left (if (stringp field-result) @@ -621,7 +621,7 @@ width specification or \"\". TIME is the time to convert." (format "%%:%c" format-char))) (if (and alt-form (not (string-equal field-width ""))) "" ;discourage "%:2d" and the like - (string-to-int (format-time-string format-string time))))) + (string-to-number (format-time-string format-string time))))) (defvar time-stamp-conversion-warn t "Warn about soon-to-be-unsupported forms in `time-stamp-format'. diff --git a/lisp/time.el b/lisp/time.el index 850843402ca..ddf0d932733 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -331,7 +331,7 @@ update which can wait for the next redisplay." ;; Record that mail file is accessible. (setq display-time-server-down-time nil))))))) (24-hours (substring time 11 13)) - (hour (string-to-int 24-hours)) + (hour (string-to-number 24-hours)) (12-hours (int-to-string (1+ (% (+ hour 11) 12)))) (am-pm (if (>= hour 12) "pm" "am")) (minutes (substring time 14 16)) diff --git a/lisp/timezone.el b/lisp/timezone.el index bad269d9cbc..62c8f86f79b 100644 --- a/lisp/timezone.el +++ b/lisp/timezone.el @@ -205,7 +205,7 @@ Understands the following styles: ;; Unix Epoch, so are 2000+. Three-digit years are assumed to ;; be relative to 1900. (if (< (length year) 4) - (let ((y (string-to-int year))) + (let ((y (string-to-number year))) (if (< y 69) (setq y (+ y 100))) (setq year (int-to-string (+ 1900 y))))) @@ -271,7 +271,7 @@ or an integer of the form +-HHMM, or a time zone name." ;; +900 timezone)) (if (stringp timezone) - (setq timezone (string-to-int timezone))) + (setq timezone (string-to-number timezone))) ;; Taking account of minute in timezone. ;; HHMM -> MM (let* ((abszone (abs timezone)) @@ -314,7 +314,7 @@ Gregorian date Sunday, December 31, 1 BC." If LOCAL is nil, it is assumed to be GMT. If TIMEZONE is nil, use the local time zone." (let* ((date (timezone-parse-date date)) - (year (string-to-int (aref date 0))) + (year (string-to-number (aref date 0))) (year (cond ((< year 69) (+ year 2000)) ((< year 100) @@ -322,12 +322,12 @@ If TIMEZONE is nil, use the local time zone." ((< year 1000) ; possible 3-digit years. (+ year 1900)) (t year))) - (month (string-to-int (aref date 1))) - (day (string-to-int (aref date 2))) + (month (string-to-number (aref date 1))) + (day (string-to-number (aref date 2))) (time (timezone-parse-time (aref date 3))) - (hour (string-to-int (aref time 0))) - (minute (string-to-int (aref time 1))) - (second (string-to-int (aref time 2))) + (hour (string-to-number (aref time 0))) + (minute (string-to-number (aref time 1))) + (second (string-to-number (aref time 2))) (local (or (aref date 4) local)) ;Use original if defined (timezone (or timezone diff --git a/lisp/vms-patch.el b/lisp/vms-patch.el index 48174f41237..60033dc7f20 100644 --- a/lisp/vms-patch.el +++ b/lisp/vms-patch.el @@ -93,7 +93,7 @@ If the logical name `EMACS_FILE_NAME' is defined, `find-file' that file." (if (not args) (if file (progn (find-file file) - (if line (goto-line (string-to-int line))))) + (if line (goto-line (string-to-number line))))) (cd (file-name-directory file)) (vms-command-line-again)))) -- cgit v1.2.1