view src/indent.h @ 92055:373b00a4775c

Merge from Dave Love's 2008-01-20 version. Require sym-comp. Add Python buffer to same-window-buffer-names. Fixup whitespaces. (python-font-lock-keywords): Add highlighting for Python builtins. (python-font-lock-syntactic-keywords): Rewrite. (python-quote-syntax): Use syntax-ppss-context instead of parsing ppss directly. (python-mode-map): Add binding for python-find-function. (python-calculate-indentation): Clean up the logic. (python-beginning-of-defun): Explicitly set return value. (python-beginning-of-statement): Stop looping if we get stuck going backwards. (python-next-statement): Stop looping if we somehow end up inside a string while advancing. (python-preoutput-continuation, python-version-checked): New vars. (python-check-version): New function. (run-python): Set default command to python-command instead of python-python-command. (run-python): Use python-check-version. Give PYTHONPATH precedence over data-directory in the process environment. Load function definitions in python process after. (python-check-comint-prompt): New function. (python-send-command, python-send-receive): Use it. (python-complete-symbol, python-try-complete): Functions deleted. Use symbol-complete instead of python-complete-symbol throughout. (python-fill-paragraph): Further refine the fenced-string regexp. (def-python-skeleton): Expand to the original abbrev instead if in a comment or string. Tweak skeletons for `if', `while', `for', `try/except', `try/finally', `name'. (python-pea-hook, python-abbrev-pc-hook): New functions. (python-abbrev-syntax-table): New var. (python-mode): Add python-pea-hook to pre-abbrev-expand-hook. Use symbol-completion-try-complete for hippie expansion. Turn on font lock unconditionally. (python-mode-hook): Defcustom it. No need to use make-local variable on indent-tabs-mode in "Turn off Indent Tabs mode" option, since it's buffer-local.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 21 Feb 2008 17:03:47 +0000
parents 107ccd98fa12
children 606f2d163a64 29adfc9354e7
line wrap: on
line source

/* Definitions for interface to indent.c
   Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004,
                 2005, 2006, 2007, 2008  Free Software Foundation, Inc.

This file is part of GNU Emacs.

GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING.  If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.  */

/* We introduce new member `tab_offset'.  We need it because of the
   existence of wide-column characters.  There is a case that the
   line-break occurs at a wide-column character and the number of
   colums of the line gets less than width.

   Example (where W_ stands for a wide-column character):
	     ----------
	     abcdefgh\\
	     W_
	     ----------

   To handle this case, we should not calculate the tab offset by
  	tab_offset += width;

   Instead, we must remember tab_offset of the line.

 */

struct position
  {
    EMACS_INT bufpos;
    EMACS_INT bytepos;
    EMACS_INT hpos;
    EMACS_INT vpos;
    EMACS_INT prevhpos;
    EMACS_INT contin;
    /* Number of characters we have already handled
       from the before and after strings at this position.  */
    EMACS_INT ovstring_chars_done;
    EMACS_INT tab_offset;
  };

struct position *compute_motion P_ ((EMACS_INT from, EMACS_INT fromvpos,
				     EMACS_INT fromhpos, int did_motion,
				     EMACS_INT to, EMACS_INT tovpos,
				     EMACS_INT tohpos,
				     EMACS_INT width, EMACS_INT hscroll,
				     EMACS_INT tab_offset, struct window *));
struct position *vmotion P_ ((EMACS_INT from, EMACS_INT vtarget,
			      struct window *));
EMACS_INT skip_invisible P_ ((EMACS_INT pos, EMACS_INT *next_boundary_p,
			      EMACS_INT to, Lisp_Object window));

/* Value of point when current_column was called */
extern EMACS_INT last_known_column_point;

/* Functions for dealing with the column cache.  */

/* Return true if the display table DISPTAB specifies the same widths
   for characters as WIDTHTAB.  We use this to decide when to
   invalidate the buffer's column_cache.  */
int disptab_matches_widthtab P_ ((struct Lisp_Char_Table *disptab,
				  struct Lisp_Vector *widthtab));

/* Recompute BUF's width table, using the display table DISPTAB.  */
void recompute_width_table P_ ((struct buffer *buf,
				struct Lisp_Char_Table *disptab));


/* arch-tag: f9feb373-5bff-4f4f-9198-94805d00cfd7
   (do not change this comment) */