Herramientas de usuario

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
ecce.c [2023/07/28 20:20] peronecce.c [2026/04/21 16:06] (actual) – editor externo 127.0.0.1
Línea 1: Línea 1:
-<code c> +<file c ecce.c>
-/* This file is http://ecce.sourceforge.net/ecce.c +
-   It is written in reasonably portable C and should +
-   be easy to compile with any C compiler, eg on Linux: +
-   cc -o ecce -DWANT_UTF8 ecce.c +
- +
-   You may need to do: export LC_ALL=en_US.UTF-8 +
- +
-   Although it's reasonable portable C, there are now +
-   a couple of places where linux filenames are used - +
-   you may need to make some small changes if compiling +
-   for Windows or other non-unix systems.  Look for *SYS* +
-   in the source below.  Feedback portability improvements +
-   to gtoal@gtoal.com please.  Note that we assume that +
-   even a linux system is single-user.  The use of +
-   tmpnam() for saving in an emergency is potentially +
-   unsafe in a multi-user environment if there are +
-   bad actors. +
- +
-   Version 2.10a adds support for more robust embedding +
-   of ecce in Emacs, by making a version of the "-command" +
-   parameter (-hex-command) accept a hex string in order +
-   to pass the ecce command as a parameter while avoiding +
-   problems such as the use of " characters in the ecce command. +
- +
- +
-*SYS* +
-Add this to your ~/.emacs file (or some equivalent for Windows): +
- +
-;; hex encoding needed below. Came from https://github.com/jwiegley/emacs-release/blob/master/lisp/hex-util.el +
-(eval-when-compile +
-  (defmacro num-to-hex-char (num) +
-    `(aref "0123456789abcdef" ,num)) +
-  ) +
- +
-(defun encode-hex-string (string) +
-  "Encode octet STRING to hexadecimal string." +
-  (let* ((len (length string)) +
-         (dst (make-string (* len 2) 0)) +
-         (idx 0)(pos 0)) +
-    (while (< pos len) +
-      (aset dst idx (num-to-hex-char (/ (aref string pos) 16))) +
-      (setq idx (1+ idx)) +
-      (aset dst idx (num-to-hex-char (% (aref string pos) 16))) +
-      (setq idx (1+ idx) pos (1+ pos))) +
-    dst)) +
- +
-;; Embedded ECCE support +
- +
-(defun e (ecce_command) +
-  (interactive "sEcce") +
-  (let (oldpoint (point)) +
-    (setq oldpoint (point)) +
-    (call-process-region (point-min) (point-max) +
-                         "/bin/bash" +
-                         t t nil +
-                         "-c" +
-                         (concat "ecce - - -hex-command " +
-                                 (concat (encode-hex-string (concat (concat (format "(r,m)%d(l,m-r0)?\n" (point)) ecce_command) +
-                                                                    (format "\ni/%%EMACS%dCURSOR%%/\n%%c" (+ 495620 oldpoint)) +
-                                                                    ) +
-                         ) " 2> ~/.ecce-emacs.err")) +
-    ) +
-    (goto-char (point-min)) +
-    (search-forward (format "%%EMACS%dCURSOR%%" (+ 495620 oldpoint))) +
-    (replace-match "" nil nil) +
-  ) +
-+
- +
-(global-set-key "\C-e" 'e) +
- +
- */ +
 #define VERSION "V2.10b" /* %V */ #define VERSION "V2.10b" /* %V */
  static const char *RCS_Version = "$Revision: 1.4 $"; /* only relevant to my home linux /usr/local/src/ecce */  static const char *RCS_Version = "$Revision: 1.4 $"; /* only relevant to my home linux /usr/local/src/ecce */
Línea 103: Línea 31:
 /*                                                */ /*                                                */
 /*                                                */ /*                                                */
-/*     ECCE was designed by Hamish Dewar, now     */ +/*     ECCE fue diseñado por Hamish Dewar, ahora  */ 
-/* retired.  This implementation is by Graham     */ +/* retirado.  Esta implementación es de Graham    */ 
-/* Toal, of the Edinburgh Computer History        */ +/* Toal, del Proyecto de Historia del Cómputo     */ 
-/* Project                                      */+/* de Edimburgo                                 */
 /*                                                */ /*                                                */
-/* This source is released into the public domain */ +/* Este código fuente fue lanzado al dominio      */ 
-/* by the authorwithout restriction.            */+/* público por su autorsin restricciones        */
 /*                                                */ /*                                                */
 /* (c) Graham Toal, 1984. (Original BCPL version, */ /* (c) Graham Toal, 1984. (Original BCPL version, */
Línea 2047: Línea 1975:
    return (ok = FALSE);    return (ok = FALSE);
 } }
-</code>+</file>

Este sitio web utiliza cookies para guardar datos esenciales de su actividad, como su autenticación. Al entrar acepta el uso de cookies.

Más información