emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/calc/calc-frac.el


From: Colin Walters
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-frac.el
Date: Mon, 19 Nov 2001 02:33:48 -0500

Index: emacs/lisp/calc/calc-frac.el
diff -u emacs/lisp/calc/calc-frac.el:1.2 emacs/lisp/calc/calc-frac.el:1.3
--- emacs/lisp/calc/calc-frac.el:1.2    Wed Nov 14 04:04:13 2001
+++ emacs/lisp/calc/calc-frac.el        Mon Nov 19 02:33:48 2001
@@ -1,8 +1,9 @@
-;; Calculator for GNU Emacs, part II [calc-frac.el]
+;;; calc-frac.el --- fraction functions for Calc
+
 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
-;; Written by Dave Gillespie, address@hidden
 
-;; This file is part of GNU Emacs.
+;; Author: David Gillespie <address@hidden>
+;; Maintainer: Colin Walters <address@hidden>
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY.  No author or distributor
@@ -19,7 +20,9 @@
 ;; file named COPYING.  Among other things, the copyright notice
 ;; and this notice must be preserved on all copies.
 
+;;; Commentary:
 
+;;; Code:
 
 ;; This file is autoloaded from calc-ext.el.
 (require 'calc-ext)
@@ -28,7 +31,6 @@
 
 (defun calc-Need-calc-frac () nil)
 
-
 (defun calc-fdiv (arg)
   (interactive "P")
   (calc-slow-wrapper
@@ -49,7 +51,12 @@
 
 
 (defun calc-over-notation (fmt)
-  (interactive "sFraction separator (:, ::, /, //, :/): ")
+  (interactive
+   (list
+    (completing-read "Fraction separator: " (mapcar (lambda (s)
+                                                     (cons s 0))
+                                                   '(":" "::" "/" "//" ":/"))
+                    nil t)))
   (calc-wrapper
    (if (string-match "\\`\\([^ 0-9][^ 0-9]?\\)[0-9]*\\'" fmt)
        (let ((n nil))
@@ -58,7 +65,7 @@
                   fmt (math-match-substring fmt 1)))
         (if (eq n 0) (error "Bad denominator"))
         (calc-change-mode 'calc-frac-format (list fmt n) t))
-     (error "Bad fraction separator format."))))
+     (error "Bad fraction separator format"))))
 
 (defun calc-slash-notation (n)
   (interactive "P")
@@ -71,13 +78,10 @@
   (calc-wrapper
    (calc-change-mode 'calc-prefer-frac n nil t)
    (message (if calc-prefer-frac
-               "Integer division will now generate fractions."
-             "Integer division will now generate floating-point results."))))
-
-
+               "Integer division will now generate fractions"
+             "Integer division will now generate floating-point results"))))
 
 
-
 ;;;; Fractions.
 
 ;;; Build a normalized fraction.  [R I I]
@@ -128,8 +132,6 @@
                        (math-mul (nth 2 a) b)))
     (math-make-frac (math-mul a (nth 2 b))
                    (nth 1 b))))
-
-
 
 
 ;;; Convert a real value to fractional form.  [T R I; T R F] [Public]



reply via email to

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