\f
* Changes in Emacs 22.1
+** The commands copy-file, rename-file, make-symbolic-link and
+add-name-to-file, when given a directory as the "new name" argument,
+convert it to a file name by merging in the within-directory part of
+the existing file's name. (This is the same convention that shell
+commands cp, mv, and ln follow.) Thus, M-x copy-file RET ~/foo RET
+/tmp RET copies ~/foo to /tmp/foo.
+
** C-u M-x goto-line now switches to the most recent previous buffer,
and goes to the specified line in that buffer.
to save their changes. If the user says yes, show them
in a Custom buffer using customize-customized.
+** Emacs Lisp mode could put an overlay on the defun for every
+ function that has advice. The overlay could have `after-text' like "
+ [Function has advice]". It might look like
+ (defun foo [Function has advice] (x y)
+ The overlay could also be a button that you could use to view the advice.
+
** ange-ftp
*** understand sftp
*** Use MLS for ange-ftp-insert-directory if a list of files is specified.
+2005-03-14 Kim F. Storm <storm@cua.dk>
+
+ * simple.el (next-line, previous-line): Add optional try-vscroll
+ arg to recognize interactive use. Pass it on to line-move.
+ (line-move): Don't perform auto-window-vscroll when defining or
+ executing keyboard macro to ensure consistent behaviour.
+
+2005-03-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * pcvs-util.el (cvs-string->strings): Strip trailing whitespace.
+
+2005-03-13 Lute Kamstra <lute@gnu.org>
+
+ * emacs-lisp/debug.el (debug): Set debug-on-exit before calling
+ debugger-setup-buffer so that backtrace marks the frames set to
+ debug-on-exit and we don't have to do it manually. Set an extra
+ debug-on-exit for macro's.
+ (debugger-setup-buffer): Don't mark the top frame manually.
+
+2005-03-12 Lute Kamstra <lute@gnu.org>
+
+ * emacs-lisp/byte-run.el: Replace lisp-indent-hook with
+ lisp-indent-function throughout.
+ (with-no-warnings): Set lisp-indent-function property.
+
+2005-03-12 Thien-Thi Nguyen <ttn@gnu.org>
+
+ * progmodes/dcl-mode.el (dcl-mode-syntax-table):
+ Add entry for backslash.
+
+2005-03-12 Juri Linkov <juri@jurta.org>
+
+ * info.el (Info-search): Four fixes for backward search.
+
+2005-03-11 Jay Belanger <belanger@truman.edu>
+
+ * calc/calc.el (calc-language-alist): New variable.
+ * calc/calc-embed.el (calc-embedded-language-alist): Remove.
+ (calc-embedded-find-modes): Use calc-language-alist instead of
+ calc-embedded-language-alist.
+
+2005-03-11 Glenn Morris <gmorris@ast.cam.ac.uk>
+
+ * calendar/calendar.el (calendar-redrawing): New internal
+ variable.
+ (redraw-calendar): Remove bogus save-excursion from previous
+ change. Bind calendar-redrawing to t for mark-diary-entries.
+ * calendar/diary-lib.el (mark-diary-entries): No need to redraw
+ calendar if that is why we were called.
+
+2005-03-11 Kenichi Handa <handa@m17n.org>
+
+ * international/mule.el (make-coding-system): Set property
+ 'coding-system-define-form to nil.
+ (define-coding-system-alias): Likewise.
+
+2005-03-11 Kenichi Handa <handa@m17n.org>
+
+ These changes are suggested by Dave Love <fx@gnu.org>.
+
+ * textmodes/fill.el: Change encoding to iso-2022-7bit and add
+ coding: tag.
+ (adaptive-fill-regexp): Add more bullets.
+ (fill-french-nobreak-p): Add Latin-1 and Latin-9 guillemets in
+ regexps.
+
2005-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
* help.el (describe-mode): Properly handle non-trivial lighters.
(setq calc-embedded-globals (cons t modes))
(goto-char save-pt)))
-(defvar calc-embedded-language-alist
- '((latex-mode . latex)
- (tex-mode . tex)
- (plain-tex-mode . tex)
- (context-mode . tex)
- (nroff-mode . eqn)
- (pascal-mode . pascal)
- (c-mode . c)
- (c++-mode . c)
- (fortran-mode . fortran)
- (f90-mode . fortran)))
-
(defun calc-embedded-find-modes ()
(let ((case-fold-search nil)
(save-pt (point))
(backward-char 6))
(goto-char save-pt)
(unless (assq 'the-language modes)
- (let ((lang (assoc major-mode calc-embedded-language-alist)))
+ (let ((lang (assoc major-mode calc-language-alist)))
(if lang
(setq modes (cons (cons 'the-language (cdr lang))
modes)))))
(defvar var-gamma '(special-const (math-gamma-const)))
(defvar var-Modes '(special-const (math-get-modes-vec)))
+(defvar calc-language-alist
+ '((latex-mode . latex)
+ (tex-mode . tex)
+ (plain-tex-mode . tex)
+ (context-mode . tex)
+ (nroff-mode . eqn)
+ (pascal-mode . pascal)
+ (c-mode . c)
+ (c++-mode . c)
+ (fortran-mode . fortran)
+ (f90-mode . fortran))
+ "Alist of major modes with appropriate Calc languages.")
+
+
(mapcar (lambda (v) (or (boundp v) (set v nil)))
calc-local-var-list)
(forward-line 1))))
t)
+(defvar calendar-redrawing nil
+ "Internal calendar variable, non-nil if inside redraw-calendar.")
+
(defun redraw-calendar ()
"Redraw the calendar display, if `calendar-buffer' is live."
(interactive)
(if (get-buffer calendar-buffer)
- (save-excursion
- (with-current-buffer calendar-buffer
- (let ((cursor-date (calendar-cursor-to-nearest-date)))
- (generate-calendar-window displayed-month displayed-year)
- (calendar-cursor-to-visible-date cursor-date))))))
+ (with-current-buffer calendar-buffer
+ (let ((cursor-date (calendar-cursor-to-nearest-date))
+ (calendar-redrawing t))
+ (generate-calendar-window displayed-month displayed-year)
+ (calendar-cursor-to-visible-date cursor-date)))))
;;;###autoload
(defcustom calendar-week-start-day 0
(save-excursion
(set-buffer calendar-buffer)
(calendar-cursor-to-visible-date date)
- (let ((mark (or (and (stringp mark) (= (length mark) 1) mark) ; single-char
- (and (listp mark) (> (length mark) 0) mark) ; attr list
- (and (facep mark) mark) ; face-name
- diary-entry-marker)))
- (if (facep mark)
- (progn ; face or an attr-list that contained a face
- (overlay-put
- (make-overlay (1- (point)) (1+ (point))) 'face mark))
- (if (and (stringp mark)
- (= (length mark) 1)) ; single-char
- (let ((buffer-read-only nil))
- (forward-char 1)
- (delete-char 1)
- (insert mark)
- (forward-char -2))
- (let ; attr list
- ((temp-face
- (make-symbol (apply 'concat "temp-face-"
- (mapcar '(lambda (sym)
+ (let ((mark (or (and (stringp mark) (= (length mark) 1) mark) ; single-char
+ (and (listp mark) (> (length mark) 0) mark) ; attr list
+ (and (facep mark) mark) ; face-name
+ diary-entry-marker)))
+ (if (facep mark)
+ (progn ; face or an attr-list that contained a face
+ (overlay-put
+ (make-overlay (1- (point)) (1+ (point))) 'face mark))
+ (if (and (stringp mark)
+ (= (length mark) 1)) ; single-char
+ (let ((buffer-read-only nil))
+ (forward-char 1)
+ (delete-char 1)
+ (insert mark)
+ (forward-char -2))
+ (let ; attr list
+ ((temp-face
+ (make-symbol (apply 'concat "temp-face-"
+ (mapcar '(lambda (sym)
(cond ((symbolp sym) (symbol-name sym))
((numberp sym) (int-to-string sym))
(t sym))) mark))))
(faceinfo mark))
- (make-face temp-face)
- ;; Remove :face info from the mark, copy the face info into temp-face
- (while (setq faceinfo (memq :face faceinfo))
- (copy-face (read (nth 1 faceinfo)) temp-face)
- (setcar faceinfo nil)
- (setcar (cdr faceinfo) nil))
- (setq mark (delq nil mark))
- ;; Apply the font aspects
- (apply 'set-face-attribute temp-face nil mark)
- (overlay-put
- (make-overlay (1- (point)) (1+ (point))) 'face temp-face))))))))
+ (make-face temp-face)
+ ;; Remove :face info from the mark, copy the face info into temp-face
+ (while (setq faceinfo (memq :face faceinfo))
+ (copy-face (read (nth 1 faceinfo)) temp-face)
+ (setcar faceinfo nil)
+ (setcar (cdr faceinfo) nil))
+ (setq mark (delq nil mark))
+ ;; Apply the font aspects
+ (apply 'set-face-attribute temp-face nil mark)
+ (overlay-put
+ (make-overlay (1- (point)) (1+ (point))) 'face temp-face))))))))
(defun calendar-star-date ()
"Replace the date under the cursor in the calendar window with asterisks.
;; Avoid redrawing when called recursively, eg through
;; mark-diary-entries-hook for #include's, else only get
;; the last set of diary marks.
- (not marking-diary-entries))
+ (not marking-diary-entries)
+ ;; If called from redraw-calendar, the calendar has been
+ ;; erased, so no need to unmark the diary entries.
+ (not calendar-redrawing))
(setq mark-diary-entries-in-calendar nil)
(redraw-calendar))
(let ((marking-diary-entries t)
;;; byte-run.el --- byte-compiler support for inlining
-;; Copyright (C) 1992, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2004, 2005 Free Software Foundation, Inc.
;; Author: Jamie Zawinski <jwz@lucid.com>
;; Hallvard Furuseth <hbf@ulrik.uio.no>
;; Redefined in byte-optimize.el.
;; This is not documented--it's not clear that we should promote it.
(fset 'inline 'progn)
-(put 'inline 'lisp-indent-hook 0)
+(put 'inline 'lisp-indent-function 0)
;;; Interface to inline functions.
(put variable 'byte-obsolete-variable (cons new when))
variable)
-(put 'dont-compile 'lisp-indent-hook 0)
+(put 'dont-compile 'lisp-indent-function 0)
(defmacro dont-compile (&rest body)
"Like `progn', but the body always runs interpreted (not compiled).
If you think you need this, you're probably making a mistake somewhere."
;;; definition in the file overrides the magic definitions on the
;;; byte-compile-macro-environment.
-(put 'eval-when-compile 'lisp-indent-hook 0)
+(put 'eval-when-compile 'lisp-indent-function 0)
(defmacro eval-when-compile (&rest body)
"Like `progn', but evaluates the body at compile time.
The result of the body appears to the compiler as a quoted constant."
;; (list 'quote (eval (cons 'progn body)))
(cons 'progn body))
-(put 'eval-and-compile 'lisp-indent-hook 0)
+(put 'eval-and-compile 'lisp-indent-function 0)
(defmacro eval-and-compile (&rest body)
"Like `progn', but evaluates the body at compile time and at load time."
(declare (debug t))
;; Remember, it's magic.
(cons 'progn body))
+(put 'with-no-warnings 'lisp-indent-function 0)
(defun with-no-warnings (&rest body)
"Like `progn', but prevents compiler warnings in the body."
;; The implementation for the interpreter is basically trivial.
;;; There is hardly any reason to change these parameters, anyway.
;;; --rms.
-;; (put 'byte-compiler-options 'lisp-indent-hook 0)
+;; (put 'byte-compiler-options 'lisp-indent-function 0)
;; (defmacro byte-compiler-options (&rest args)
;; "Set some compilation-parameters for this file. This will affect only the
;; file in which it appears; this does nothing when evaluated, and when loaded
(save-excursion
(save-window-excursion
(with-no-warnings
- (setq unread-command-char -1))
+ (setq unread-command-char -1))
+ (when (eq (car debugger-args) 'debug)
+ ;; Skip the frames for backtrace-debug, byte-code,
+ ;; and implement-debug-on-entry.
+ (backtrace-debug 4 t)
+ ;; Place an extra debug-on-exit for macro's.
+ (when (eq 'lambda (car-safe (cadr (backtrace-frame 4))))
+ (backtrace-debug 5 t)))
(pop-to-buffer debugger-buffer)
(debugger-mode)
(debugger-setup-buffer debugger-args)
(goto-char (point-min))
(message "%s" (buffer-string))
(kill-emacs))
- (if (eq (car debugger-args) 'debug)
- ;; Skip the frames for backtrace-debug, byte-code,
- ;; and implement-debug-on-entry.
- (backtrace-debug 4 t))
(message "")
(let ((standard-output nil)
(buffer-read-only t))
(setq last-command debugger-outer-last-command)
(setq this-command debugger-outer-this-command)
(with-no-warnings
- (setq unread-command-char debugger-outer-unread-command-char))
+ (setq unread-command-char debugger-outer-unread-command-char))
(setq unread-command-events debugger-outer-unread-command-events)
(setq unread-post-input-method-events
debugger-outer-unread-post-input-method-events)
;; lambda is for debug-on-call when a function call is next.
;; debug is for debug-on-entry function called.
(cond ((memq (car debugger-args) '(lambda debug))
- (insert "--entering a function:\n")
- (if (eq (car debugger-args) 'debug)
- (progn
- (delete-char 1)
- (insert ?*)
- (beginning-of-line))))
+ (insert "--entering a function:\n"))
;; Exiting a function.
((eq (car debugger-args) 'exit)
(insert "--returning value: ")
(unwind-protect
(progn
(with-no-warnings
- (setq unread-command-char debugger-outer-unread-command-char))
+ (setq unread-command-char debugger-outer-unread-command-char))
(prog1 (progn ,@body)
(with-no-warnings
- (setq debugger-outer-unread-command-char unread-command-char))))
+ (setq debugger-outer-unread-command-char unread-command-char))))
(with-no-warnings
- (setq unread-command-char save-ucc))))
+ (setq unread-command-char save-ucc))))
(setq debugger-outer-match-data (match-data))
(setq debugger-outer-load-read-function load-read-function)
(setq debugger-outer-overriding-terminal-local-map
;; Skip node header line
(and (save-excursion (forward-line -1)
(looking-at "\^_"))
- (forward-line 1))
+ (forward-line (if backward -1 1)))
;; Skip Tag Table node
(save-excursion
(and (search-backward "\^_" nil t)
(search-forward (concat "\n" osubfile ": "))
;; Skip that one.
(forward-line (if backward 0 1))
+ (if backward (forward-char -1))
;; Make a list of all following subfiles.
;; Each elt has the form (VIRT-POSITION . SUBFILENAME).
(while (not (if backward (bobp) (eobp)))
;; Skip node header line
(and (save-excursion (forward-line -1)
(looking-at "\^_"))
- (forward-line 1))
+ (forward-line (if backward -1 1)))
;; Skip Tag Table node
(save-excursion
(and (search-backward "\^_" nil t)
;; Use string-equal, not equal, to ignore text props.
(or (and (string-equal onode Info-current-node)
(equal ofile Info-current-file))
- (and isearch-mode isearch-wrapped (eq opoint opoint-min))
+ (and isearch-mode isearch-wrapped
+ (eq opoint (if isearch-forward opoint-min opoint-max)))
(setq Info-history (cons (list ofile onode opoint)
Info-history))))))
;;; pcvs-util.el --- utility functions for PCL-CVS -*- byte-compile-dynamic: t -*-
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;; 2000, 2001, 2004 Free Software Foundation, Inc.
+;; 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@cs.yale.edu>
;; Keywords: pcl-cvs
The SEPARATOR regexp defaults to \"\\s-+\"."
(let ((sep (or separator "\\s-+"))
(i (string-match "[\"]" string)))
- (if (null i) (split-string string sep) ; no quoting: easy
- (append (unless (eq i 0) (split-string (substring string 0 i) sep))
+ (if (null i) (split-string string sep t) ; no quoting: easy
+ (append (unless (eq i 0) (split-string (substring string 0 i) sep t))
(let ((rfs (read-from-string string i)))
(cons (car rfs)
(cvs-string->strings (substring string (cdr rfs))
(defvar dcl-mode-syntax-table nil
"Syntax table used in DCL-buffers.")
-(if dcl-mode-syntax-table
- ()
+(unless dcl-mode-syntax-table
(setq dcl-mode-syntax-table (make-syntax-table))
(modify-syntax-entry ?! "<" dcl-mode-syntax-table) ; comment start
(modify-syntax-entry ?\n ">" dcl-mode-syntax-table) ; comment end
(modify-syntax-entry ?< "(>" dcl-mode-syntax-table) ; < and ...
(modify-syntax-entry ?> ")<" dcl-mode-syntax-table) ; > is a matching pair
+ (modify-syntax-entry ?\\ "_" dcl-mode-syntax-table) ; not an escape
)
:version "21.1"
:group 'editing-basics)
-(defun next-line (&optional arg)
+(defun next-line (&optional arg try-vscroll)
"Move cursor vertically down ARG lines.
+Interactively, vscroll tall lines if `auto-window-vscroll' is enabled.
If there is no character in the target line exactly under the current column,
the cursor is positioned after the character in that line which spans this
column, or at the end of the line if it is not long enough.
If you are thinking of using this in a Lisp program, consider
using `forward-line' instead. It is usually easier to use
and more reliable (no dependence on goal column, etc.)."
- (interactive "p")
+ (interactive "p\np")
(or arg (setq arg 1))
(if (and next-line-add-newlines (= arg 1))
(if (save-excursion (end-of-line) (eobp))
(let ((abbrev-mode nil))
(end-of-line)
(insert "\n"))
- (line-move arg nil nil t))
+ (line-move arg nil nil try-vscroll))
(if (interactive-p)
(condition-case nil
- (line-move arg nil nil t)
+ (line-move arg nil nil try-vscroll)
((beginning-of-buffer end-of-buffer) (ding)))
- (line-move arg nil nil t)))
+ (line-move arg nil nil try-vscroll)))
nil)
-(defun previous-line (&optional arg)
+(defun previous-line (&optional arg try-vscroll)
"Move cursor vertically up ARG lines.
+Interactively, vscroll tall lines if `auto-window-vscroll' is enabled.
If there is no character in the target line exactly over the current column,
the cursor is positioned after the character in that line which spans this
column, or at the end of the line if it is not long enough.
If you are thinking of using this in a Lisp program, consider using
`forward-line' with a negative argument instead. It is usually easier
to use and more reliable (no dependence on goal column, etc.)."
- (interactive "p")
+ (interactive "p\np")
(or arg (setq arg 1))
(if (interactive-p)
(condition-case nil
- (line-move (- arg) nil nil t)
+ (line-move (- arg) nil nil try-vscroll)
((beginning-of-buffer end-of-buffer) (ding)))
- (line-move (- arg) nil nil t))
+ (line-move (- arg) nil nil try-vscroll))
nil)
(defcustom track-eol nil
(assq prop buffer-invisibility-spec)))))
;; Perform vertical scrolling of tall images if necessary.
+;; Don't vscroll in a keyboard macro.
(defun line-move (arg &optional noerror to-end try-vscroll)
- (if (and auto-window-vscroll try-vscroll)
+ (if (and auto-window-vscroll try-vscroll
+ (not defining-kbd-macro)
+ (not executing-kbd-macro))
(let ((forward (> arg 0))
(part (nth 2 (pos-visible-in-window-p (point) nil t))))
(if (and (consp part)
-;;; fill.el --- fill commands for Emacs
+;;; fill.el --- fill commands for Emacs -*- coding: iso-2022-7bit -*-
;; Copyright (C) 1985,86,92,94,95,96,97,1999,2001,02,03,2004
;; Free Software Foundation, Inc.
(defcustom adaptive-fill-regexp
;; Added `!' for doxygen comments starting with `//!' or `/*!'.
;; Added `%' for TeX comments.
- (purecopy "[ \t]*\\([-!|#%;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*")
+ (purecopy "[ \t]*\\([-!|#%;>*\e,A7\e$,1s"s#sC\e$,2"F\e(B]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*")
"*Regexp to match text at start of line that constitutes indentation.
If Adaptive Fill mode is enabled, a prefix matching this pattern
on the first and second lines of a paragraph is used as the
mark such as `?' or `:'. It is common in French writing to put a space
at such places, which would normally allow breaking the line at those
places."
- (or (looking-at "[ \t]*[])}»?!;:-]")
+ (or (looking-at "[ \t]*[])}\e,A;\e,b;\e(B?!;:-]")
(save-excursion
(skip-chars-backward " \t")
(unless (bolp)
(backward-char 1)
- (or (looking-at "[([{«]")
+ (or (looking-at "[([{\e,A+\e,b+\e(B]")
;; Don't cut right after a single-letter word.
(and (memq (preceding-char) '(?\t ?\ ))
(eq (char-syntax (following-char)) ?w)))))))
+2005-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xlwmenuP.h:
+ * xlwmenu.h: Add missing copyright and license notice.
+
2004-12-27 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
* xlwmenu.c (xlwMenuActionsList): Install MenuGadgetEscape as an
2004-08-30 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
- * lwlib.h (_widget_value): Added lname and lkey.
+ * lwlib.h (_widget_value): Add lname and lkey.
2004-01-12 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
- * xlwmenuP.h (_XlwMenu_part): Added top_depth.
+ * xlwmenuP.h (_XlwMenu_part): Add top_depth.
* xlwmenu.h: Removed declaration of pop_up_menu
* lwlib-Xlw.c: Include lisp.h, not ../src/lisp.h.
(lw_lucid_widget_p): Remove unused `mw'.
- (xlw_update_one_widget, xlw_pop_instance) [PROTOTYPES]: Provide
- ISO C arglists.
+ (xlw_update_one_widget, xlw_pop_instance) [PROTOTYPES]:
+ Provide ISO C arglists.
2003-04-30 Lute Kamstra <lute@gnu.org>
2002-11-20 Dave Love <fx@gnu.org>
* lwlib.c: Remove obsolete USE_OLIT code.
- [PROTOTYPES]: Provide ISO C arglists for functions with Boolean
- args.
+ [PROTOTYPES]: Provide ISO C arglists for functions with Boolean args.
(lwlib_memset): Declare length arg as size_t.
(malloc_widget_value): Cast arg of lwlib_memset.
* lwlib-Xm.c (make_menu_in_widget): Add an XmNpopdownCallback
instead of an XmNunmapCallback.
- (xm_unmap_callback): Removed.
+ (xm_unmap_callback): Remove.
* lwlib-Xm.c (make_menubar): Take out code in #if 0.
+/* Interface of a lightweight menubar widget.
+ Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
+
+This file is part of the Lucid Widget Library.
+
+The Lucid Widget Library 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 2, or (at your option)
+any later version.
+
+The Lucid Widget Library 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., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
#ifndef _XlwMenu_h
#define _XlwMenu_h
+/* Internals of a lightweight menubar widget.
+ Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+
+This file is part of the Lucid Widget Library.
+
+The Lucid Widget Library 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 2, or (at your option)
+any later version.
+
+The Lucid Widget Library 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., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
#ifndef _XlwMenuP_h
#define _XlwMenuP_h
+2005-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xmenu.c (ENCODE_MENU_STRING): Explicitly use string_make_unibyte.
+ (list_of_panes, list_of_items, Fx_popup_menu): Use XCAR/XCDR.
+ (digest_single_submenu, xmenu_show): Use ENCODE_MENU_STRING.
+
+ * xfns.c (xic_defaut_fontset): New constant.
+ (xic_create_fontsetname): New function.
+ Extracted from create_frame_xic. Try to generate a slightly
+ better fontset.
+ (xic_create_xfontset): Use it.
+ (create_frame_xic): Simplify.
+
+2005-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (Fmake_symbolic_link): Fix last change.
+
+2005-03-11 Richard M. Stallman <rms@gnu.org>
+
+ * fileio.c (Frename_file, Fadd_name_to_file)
+ (Fmake_symbolic_link): If NEWNAME or LINKNAME is a directory,
+ expand the basename of FILE relative to it.
+
+2005-03-11 Kenichi Handa <handa@m17n.org>
+
+ * fileio.c (Finsert_file_contents): Call Fcheck_coding_system
+ before calling setup_coding_system so that autoloading of a coding
+ system work.
+
2005-03-10 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
* xfns.c (hourglass_started): New function.
available font is found.
* fontset.c (set_default_ascii_font): New function.
- (syms_of_fontset): Don't set FONTSET_ASCII (Vdefault_fontset)
- here.
+ (syms_of_fontset): Don't set FONTSET_ASCII (Vdefault_fontset) here.
* fontset.h (set_default_ascii_font): Extern it.
* emacs.c (main): Change `#ifdef HAVE_CARBON' to `#if
defined (MAC_OSX) && defined (HAVE_CARBON)'.
- * image.c [!MAC_OSX && TARGET_API_MAC_CARBON]: Include
- QuickTime.h.
+ * image.c [!MAC_OSX && TARGET_API_MAC_CARBON]: Include QuickTime.h.
* mac.c [!MAC_OSX && HAVE_CARBON]: Include Carbon.h.
[!MAC_OSX] (select) [TARGET_API_MAC_CARBON]: Use ReceiveNextEvent.
- (posix_pathname_to_fsspec, fsspec_to_posix_pathname): New
- functions.
+ (posix_pathname_to_fsspec, fsspec_to_posix_pathname): New functions.
(mac_clear_font_name_table): Move extern to macterm.h.
* macfns.c (install_window_handler): Move extern to macterm.h.
valid. Don't check !NILP (dir) because it is already checked with
CHECK_STRING.
(Fx_file_dialog) [!MAC_OSX]: Use FSSpec instead of FSRef for
- specifying the default location and obtaining the selected
- filename.
+ specifying the default location and obtaining the selected filename.
* macgui.h [!MAC_OSX && HAVE_CARBON]: Include Carbon.h.
* macmenu.c [TARGET_API_MAC_CARBON]: Don't include headers that
are included via Carbon.h.
- * macterm.c [TARGET_API_MAC_CARBON && !MAC_OSX]: Define
- USE_CARBON_EVENTS to 1.
+ * macterm.c [TARGET_API_MAC_CARBON && !MAC_OSX]:
+ Define USE_CARBON_EVENTS to 1.
(qd) [__MRC__ && TARGET_API_MAC_CARBON]: Don't declare.
(x_free_frame_resources): Call remove_window_handler for
non-tooltip windows.
(install_window_handler) [TARGET_API_MAC_CARBON]: Create UPPs for
drag-and-drop handler functions and register them.
(remove_window_handler): New function.
- (do_ae_open_documents, mac_do_receive_drag) [!MAC_OSX]: Use
- fsspec_to_posix_pathname.
+ (do_ae_open_documents, mac_do_receive_drag) [!MAC_OSX]:
+ Use fsspec_to_posix_pathname.
(main): Change #if !TARGET_API_MAC_CARBON to #ifdef MAC_OS8.
(XTread_socket) [!MAC_OSX]: Don't pass keyboard events to TSM.
- [MAC_OS8] (make_mac_terminal_frame) [TARGET_API_MAC_CARBON]: Set
- default cursors.
+ [MAC_OS8] (make_mac_terminal_frame) [TARGET_API_MAC_CARBON]:
+ Set default cursors.
(mac_initialize) [USE_CARBON_EVENTS && !MAC_OSX] : Don't call
init_service_handler or init_quit_char_handler.
(mac_initialize) [!MAC_OSX]: Don't call MakeMeTheFrontProcess.
/* File IO for GNU Emacs.
Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Emacs.
CHECK_STRING (file);
CHECK_STRING (newname);
file = Fexpand_file_name (file, Qnil);
- newname = Fexpand_file_name (newname, Qnil);
+
+ if (!NILP (Ffile_directory_p (newname)))
+ newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname);
+ else
+ newname = Fexpand_file_name (newname, Qnil);
/* If the file name has special constructs in it,
call the corresponding file handler. */
CHECK_STRING (file);
CHECK_STRING (newname);
file = Fexpand_file_name (file, Qnil);
- newname = Fexpand_file_name (newname, Qnil);
+
+ if (!NILP (Ffile_directory_p (newname)))
+ newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname);
+ else
+ newname = Fexpand_file_name (newname, Qnil);
/* If the file name has special constructs in it,
call the corresponding file handler. */
we want to permit links to relative file names. */
if (SREF (filename, 0) == '~')
filename = Fexpand_file_name (filename, Qnil);
- linkname = Fexpand_file_name (linkname, Qnil);
+
+ if (!NILP (Ffile_directory_p (linkname)))
+ linkname = Fexpand_file_name (Ffile_name_nondirectory (filename), linkname);
+ else
+ linkname = Fexpand_file_name (linkname, Qnil);
/* If the file name has special constructs in it,
call the corresponding file handler. */
if (CONSP (coding_system))
coding_system = XCAR (coding_system);
}
-
unbind_to (count, Qnil);
inserted = Z_BYTE - BEG_BYTE;
}
/* Create an X fontset on frame F with base font name BASE_FONTNAME. */
+char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
+
+char *
+xic_create_fontsetname (base_fontname)
+ char *base_fontname;
+{
+ /* Make a fontset name from the base font name. */
+ if (xic_defaut_fontset == base_fontname)
+ /* There is no base font name, use the default. */
+ return base_fontname;
+ else
+ {
+ /* Make a fontset name from the base font name.
+ The font set will be made of the following elements:
+ - the base font.
+ - the base font where the charset spec is replaced by -*-*.
+ - the same but with the family also replaced with -*-*-. */
+ char *p = base_fontname;
+ char *fontsetname;
+ int i;
+
+ for (i = 0; *p; p++)
+ if (*p == '-') i++;
+ if (i != 14)
+ { /* As the font name doesn't conform to XLFD, we can't
+ modify it to generalize it to allcs and allfamilies.
+ Use the specified font plus the default. */
+ int len = strlen (base_fontname) + strlen (xic_defaut_fontset) + 2;
+ fontsetname = xmalloc (len);
+ bzero (fontsetname, len);
+ strcpy (fontsetname, base_fontname);
+ strcat (fontsetname, ",");
+ strcat (fontsetname, xic_defaut_fontset);
+ }
+ else
+ {
+ int len;
+ char *p1 = NULL;
+ char *font_allcs = NULL;
+ char *font_allfamilies = NULL;
+ char *allcs = "*-*-*-*-*-*-*";
+ char *allfamilies = "-*-*-";
+
+ for (i = 0, p = base_fontname; i < 8; p++)
+ {
+ if (*p == '-')
+ {
+ i++;
+ if (i == 3)
+ p1 = p + 1;
+ }
+ }
+ /* Build the font spec that matches all charsets. */
+ len = p - base_fontname + strlen (allcs) + 1;
+ font_allcs = (char *) alloca (len);
+ bzero (font_allcs, len);
+ bcopy (base_fontname, font_allcs, p - base_fontname);
+ strcat (font_allcs, allcs);
+
+ /* Build the font spec that matches all families. */
+ len = p - p1 + strlen (allcs) + strlen (allfamilies) + 1;
+ font_allfamilies = (char *) alloca (len);
+ bzero (font_allfamilies, len);
+ strcpy (font_allfamilies, allfamilies);
+ bcopy (p1, font_allfamilies + (strlen (allfamilies)), p - p1);
+ strcat (font_allfamilies, allcs);
+
+ /* Build the actual font set name. */
+ len = strlen (base_fontname) + strlen (font_allcs)
+ + strlen (font_allfamilies) + 3;
+ fontsetname = xmalloc (len);
+ bzero (fontsetname, len);
+ strcpy (fontsetname, base_fontname);
+ strcat (fontsetname, ",");
+ strcat (fontsetname, font_allcs);
+ strcat (fontsetname, ",");
+ strcat (fontsetname, font_allfamilies);
+ }
+ return fontsetname;
+ }
+}
+
static XFontSet
xic_create_xfontset (f, base_fontname)
struct frame *f;
char *def_string;
Lisp_Object rest, frame;
+ if (!base_fontname)
+ base_fontname = xic_defaut_fontset;
+
/* See if there is another frame already using same fontset. */
FOR_EACH_FRAME (rest, frame)
{
if (!xfs)
{
+ char *fontsetname = xic_create_fontsetname (base_fontname);
+
/* New fontset. */
xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
- base_fontname, &missing_list,
+ fontsetname, &missing_list,
&missing_count, &def_string);
if (missing_list)
XFreeStringList (missing_list);
+ if (fontsetname != base_fontname)
+ xfree (fontsetname);
}
if (FRAME_XIC_BASE_FONTNAME (f))
if (FRAME_XIC (f))
return;
+ /* Create X fontset. */
+ xfs = xic_create_xfontset
+ (f, (FRAME_FONTSET (f) < 0) ? NULL
+ : (char *) SDATA (fontset_ascii (FRAME_FONTSET (f))));
+
xim = FRAME_X_XIM (f);
if (xim)
{
XPoint spot;
XVaNestedList preedit_attr;
XVaNestedList status_attr;
- char *base_fontname;
- int fontset;
s_area.x = 0; s_area.y = 0; s_area.width = 1; s_area.height = 1;
spot.x = 0; spot.y = 1;
- /* Create X fontset. */
- fontset = FRAME_FONTSET (f);
- if (fontset < 0)
- base_fontname = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
- else
- {
- /* Determine the base fontname from the ASCII font name of
- FONTSET. */
- char *ascii_font = (char *) SDATA (fontset_ascii (fontset));
- char *p = ascii_font;
- int i;
-
- for (i = 0; *p; p++)
- if (*p == '-') i++;
- if (i != 14)
- /* As the font name doesn't conform to XLFD, we can't
- modify it to get a suitable base fontname for the
- frame. */
- base_fontname = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
- else
- {
- int len = strlen (ascii_font) + 1;
- char *p1 = NULL;
-
- for (i = 0, p = ascii_font; i < 8; p++)
- {
- if (*p == '-')
- {
- i++;
- if (i == 3)
- p1 = p + 1;
- }
- }
- base_fontname = (char *) alloca (len);
- bzero (base_fontname, len);
- strcpy (base_fontname, "-*-*-");
- bcopy (p1, base_fontname + 5, p - p1);
- strcat (base_fontname, "*-*-*-*-*-*-*");
- }
- }
- xfs = xic_create_xfontset (f, base_fontname);
/* Determine XIC style. */
if (xic_style == 0)
/* X Communication module for terminals which understand the X protocol.
- Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004
- Free Software Foundation, Inc.
+ Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004,
+ 2005 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* gtk just uses utf-8. */
# define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str)
#else
-/* I'm not convinced ENCODE_SYSTEM is defined correctly, or maybe
- something else should be used here. Except under MS-Windows it
- just converts to unibyte, but encoding with `locale-coding-system'
- seems better -- X may actually display the result correctly, and
- it's not necessarily equivalent to the unibyte text. -- fx */
-# define ENCODE_MENU_STRING(str) ENCODE_SYSTEM (str)
+# define ENCODE_MENU_STRING(str) string_make_unibyte (str)
#endif
static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
init_menu_items ();
- for (tail = menu; !NILP (tail); tail = Fcdr (tail))
+ for (tail = menu; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object elt, pane_name, pane_data;
- elt = Fcar (tail);
+ elt = XCAR (tail);
pane_name = Fcar (elt);
CHECK_STRING (pane_name);
push_menu_pane (ENCODE_MENU_STRING (pane_name), Qnil);
{
Lisp_Object tail, item, item1;
- for (tail = pane; !NILP (tail); tail = Fcdr (tail))
+ for (tail = pane; CONSP (tail); tail = XCDR (tail))
{
- item = Fcar (tail);
+ item = XCAR (tail);
if (STRINGP (item))
push_menu_item (ENCODE_MENU_STRING (item), Qnil, Qnil, Qt,
Qnil, Qnil, Qnil, Qnil);
- else if (NILP (item))
- push_left_right_boundary ();
- else
+ else if (CONSP (item))
{
- CHECK_CONS (item);
- item1 = Fcar (item);
+ item1 = XCAR (item);
CHECK_STRING (item1);
- push_menu_item (ENCODE_MENU_STRING (item1), Qt, Fcdr (item),
+ push_menu_item (ENCODE_MENU_STRING (item1), Qt, XCDR (item),
Qt, Qnil, Qnil, Qnil, Qnil);
}
+ else
+ push_left_right_boundary ();
+
}
}
\f
if (CONSP (tem))
{
window = Fcar (Fcdr (position));
- x = Fcar (tem);
- y = Fcar (Fcdr (tem));
+ x = XCAR (tem);
+ y = Fcar (XCDR (tem));
}
else
{
/* The first keymap that has a prompt string
supplies the menu title. */
- for (tem = menu, i = 0; CONSP (tem); tem = Fcdr (tem))
+ for (tem = menu, i = 0; CONSP (tem); tem = XCDR (tem))
{
Lisp_Object prompt;
- maps[i++] = keymap = get_keymap (Fcar (tem), 1, 0);
+ maps[i++] = keymap = get_keymap (XCAR (tem), 1, 0);
prompt = Fkeymap_prompt (keymap);
if (NILP (title) && !NILP (prompt))
#ifndef HAVE_MULTILINGUAL_MENU
if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name))
{
- pane_name = ENCODE_SYSTEM (pane_name);
+ pane_name = ENCODE_MENU_STRING (pane_name);
AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name;
}
#endif
#ifndef HAVE_MULTILINGUAL_MENU
if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name))
{
- pane_name = ENCODE_SYSTEM (pane_name);
+ pane_name = ENCODE_MENU_STRING (pane_name);
AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name;
}
#endif