view src/paths.h.in @ 5776:65d65b52d608

Pass character count from coding systems to buffer insertion code. src/ChangeLog addition: 2014-01-16 Aidan Kehoe <kehoea@parhasard.net> Pass character count information from the no-conversion and unicode coding systems to the buffer insertion code, making #'find-file on large buffers a little snappier (if ERROR_CHECK_TEXT is not defined). * file-coding.c: * file-coding.c (coding_character_tell): New. * file-coding.c (conversion_coding_stream_description): New. * file-coding.c (no_conversion_convert): Update characters_seen when decoding. * file-coding.c (no_conversion_character_tell): New. * file-coding.c (lstream_type_create_file_coding): Create the no_conversion type with data. * file-coding.c (coding_system_type_create): Make the character_tell method available here. * file-coding.h: * file-coding.h (struct coding_system_methods): Add a new character_tell() method, passing charcount information from the coding systems to the buffer code, avoiding duplicate bytecount-to-charcount work especially with large buffers. * fileio.c (Finsert_file_contents_internal): Update this to pass charcount information to buffer_insert_string_1(), if that is available from the lstream code. * insdel.c: * insdel.c (buffer_insert_string_1): Add a new CCLEN argument, giving the character count of the string to insert. It can be -1 to indicate that te function should work it out itself using bytecount_to_charcount(), as it used to. * insdel.c (buffer_insert_raw_string_1): * insdel.c (buffer_insert_lisp_string_1): * insdel.c (buffer_insert_ascstring_1): * insdel.c (buffer_insert_emacs_char_1): * insdel.c (buffer_insert_from_buffer_1): * insdel.c (buffer_replace_char): Update these functions to use the new calling convention. * insdel.h: * insdel.h (buffer_insert_string): Update this header to reflect the new buffer_insert_string_1() argument. * lstream.c (Lstream_character_tell): New. Return the number of characters *read* and seen by the consumer so far, taking into account the unget buffer, and buffered reading. * lstream.c (Lstream_unread): Update unget_character_count here as appropriate. * lstream.c (Lstream_rewind): Reset unget_character_count here too. * lstream.h: * lstream.h (struct lstream): Provide the character_tell method, add a new field, unget_character_count, giving the number of characters ever passed to Lstream_unread(). Declare Lstream_character_tell(). Make Lstream_ungetc(), which happens to be unused, an inline function rather than a macro, in the course of updating it to modify unget_character_count. * print.c (output_string): Use the new argument to buffer_insert_string_1(). * tests.c: * tests.c (Ftest_character_tell): New test function. * tests.c (syms_of_tests): Make it available. * unicode.c: * unicode.c (struct unicode_coding_stream): * unicode.c (unicode_character_tell): New method. * unicode.c (unicode_convert): Update the character counter as appropriate. * unicode.c (coding_system_type_create_unicode): Make the character_tell method available.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 16 Jan 2014 16:27:52 +0000
parents 15139dbf89f4
children
line wrap: on
line source

/* Hey Emacs, this is -*- C -*- code! */

/* Synched up with: Not synched with FSF. */

/* Think twice before editing this file.  Generated automatically by configure.

 The file startup.el guesses at reasonable values for load-path, exec-path,
 and lock-directory.  This means that if you move emacs and its associated
 sub-tree to a different place in the filesystem, or to a different machine,
 you won't have to do anything for it to work.

 If you define the paths in this file then they will take precedence over
 any value generated by the heuristic in startup.el.  The hardcoded paths
 will be checked to see if they are valid, in which case they will be used.
 Otherwise the editor will attempt to make its normal guess.

 See the NEWS file for a description of the heuristic used to locate the lisp
 and exec directories at startup time.  If you are looking at this file
 because you are having trouble, then you would be much better off arranging
 for those heuristics to succeed than defining the paths in this file.

   **  Let me say that again.  If you're editing this file, you're making
   **  a mistake.  Re-read the section on installation in ../etc/NEWS.

 If it defines anything, this file should define some subset of the following:

   PATH_PROGNAME        The name of the Emacs variant that's running.

   PATH_VERSION         The version id of the Emacs variant that's running.

   PATH_EXEC_PREFIX	The value of --exec-prefix.

   PATH_PREFIX		The value of --prefix.

   PATH_LOADSEARCH	The default value of `load-path'.

   PATH_MODULESEARCH	The default value of `module-load-path'.

   PATH_EARLY_PACKAGE_DIRECTORIES The value of `--with-early-packages'.
   PATH_LATE_PACKAGE_DIRECTORIES  The value of `--with-late-packages'.
   PATH_EARLY_PACKAGE_DIRECTORIES The value of `--with-last-packages'.

   PATH_PACKAGEPATH     The default value of `package-path'.

   PATH_SITE            The default location of site-specific Lisp files.

   PATH_SITE_MODULES	The default location of site-specific modules.

   PATH_EXEC		The default value of `exec-directory' and `exec-path'.
			(exec-path also contains the value of whatever is in
			the PATH environment variable.)

   PATH_DATA		The default value of `data-directory'.  This
			is where architecture-independent files are
			searched for.

   PATH_INFO		This is where the info documentation is installed.

   PATH_INFOPATH	The default value of `Info-directory-list'.
			These are additional places info files are searched
			for. */

#define PATH_PROGNAME "@PROGNAME@"

#define PATH_VERSION "@version@"

#ifdef EXEC_PREFIX_USER_DEFINED
#define PATH_EXEC_PREFIX "@EXEC_PREFIX@"
#endif

#ifdef PREFIX_USER_DEFINED
#define PATH_PREFIX "@PREFIX@"
#endif

#ifdef LISPDIR_USER_DEFINED
#define  PATH_LOADSEARCH "@LISPDIR@"
#endif

#ifdef MODULEDIR_USER_DEFINED
#define  PATH_MODULESEARCH "@MODULEDIR@"
#endif

#ifdef SITELISPDIR_USER_DEFINED
#define  PATH_SITE "@SITELISPDIR@"
#endif

#ifdef SITEMODULEDIR_USER_DEFINED
#define  PATH_SITE_MODULES "@SITEMODULEDIR@"
#endif

#ifdef EARLY_PACKAGE_DIRECTORIES_USER_DEFINED
#define PATH_EARLY_PACKAGE_DIRECTORIES "@EARLY_PACKAGE_DIRECTORIES@"
#endif

#ifdef LATE_PACKAGE_DIRECTORIES_USER_DEFINED
#define PATH_LATE_PACKAGE_DIRECTORIES "@LATE_PACKAGE_DIRECTORIES@"
#endif

#ifdef LAST_PACKAGE_DIRECTORIES_USER_DEFINED
#define PATH_LAST_PACKAGE_DIRECTORIES "@LAST_PACKAGE_DIRECTORIES@"
#endif

#ifdef PACKAGE_PATH_USER_DEFINED
#define PATH_PACKAGEPATH "@PACKAGE_PATH@"
#endif

#ifdef ARCHLIBDIR_USER_DEFINED
#define PATH_EXEC "@ARCHLIBDIR@"
#endif

#ifdef ETCDIR_USER_DEFINED
#define PATH_DATA "@ETCDIR@"
#endif

#ifdef DOCDIR_USER_DEFINED
#define PATH_DOC "@DOCDIR@"
#endif

#ifdef INFODIR_USER_DEFINED
#define PATH_INFO "@INFODIR@"
#endif

#ifdef INFOPATH_USER_DEFINED
#define PATH_INFOPATH "@INFOPATH@"
#endif