]> code.delx.au - gnu-emacs/commitdiff
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-25
authorMiles Bader <miles@gnu.org>
Mon, 14 Mar 2005 05:27:53 +0000 (05:27 +0000)
committerMiles Bader <miles@gnu.org>
Mon, 14 Mar 2005 05:27:53 +0000 (05:27 +0000)
Merge from emacs--cvs-trunk--0

Patches applied:

 * emacs--cvs-trunk--0  (patch 173-179)

   - Update from CVS

21 files changed:
etc/NEWS
etc/TODO
lisp/ChangeLog
lisp/calc/calc-embed.el
lisp/calc/calc.el
lisp/calendar/calendar.el
lisp/calendar/diary-lib.el
lisp/emacs-lisp/byte-run.el
lisp/emacs-lisp/debug.el
lisp/info.el
lisp/pcvs-util.el
lisp/progmodes/dcl-mode.el
lisp/simple.el
lisp/textmodes/fill.el
lwlib/ChangeLog
lwlib/xlwmenu.h
lwlib/xlwmenuP.h
src/ChangeLog
src/fileio.c
src/xfns.c
src/xmenu.c

index 34a05ff49f82595478c46040358856f104a61494..0e7e4e84736a75bc308006a595ae8f3a25f30d64 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -178,6 +178,13 @@ types any more.  Add -DUSE_LISP_UNION_TYPE if you want union types.
 \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.
 
index 6f6f402206d5b2b623da592d937160406878f0ba..a587edf1f93cd3ddf56eff067263bbd0f3f00639 100644 (file)
--- a/etc/TODO
+++ b/etc/TODO
@@ -82,6 +82,12 @@ to the FSF.
   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.
index b2bd4a197b93ec3b68bfb70269d4408e0addae9c..5901c35c2e9a31ae56ef42c80841272ba41a99d3 100644 (file)
@@ -1,3 +1,69 @@
+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.
index 3ad42037b507a278e9ea82a56cfdc959cde82b00..f1a273f7cf33427052b12d648865519586a02291 100644 (file)
@@ -677,18 +677,6 @@ The command \\[yank] can retrieve it from there."
     (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))
@@ -737,7 +725,7 @@ The command \\[yank] can retrieve it from there."
       (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)))))
index 99857ce05a0339512b5492788d71e7a6cb78d7c2..24336ad93338769b780eff3be45a489478cf9708 100644 (file)
@@ -717,6 +717,20 @@ If nil, selections displayed but ignored.")
 (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)
 
index 7c6aad07d374a120a6f4d6fa2f9825bae5968c94..8c78d9540bfa29c193f1fa6826e0187e7b5790d5 100644 (file)
@@ -2150,15 +2150,18 @@ the inserted text.  Value is always t."
          (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
@@ -2918,40 +2921,40 @@ MARK defaults to `diary-entry-marker'."
       (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.
index d682a3f1cc5a165986b27b7a953c29659aca8122..124b29c3fe76ded14028dde9de2692ff2a8a9df4 100644 (file)
@@ -846,7 +846,10 @@ After the entries are marked, the hooks `nongregorian-diary-marking-hook' and
              ;; 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)
index 2cd0896c835645ded2368d4494312829d64e065e..ef426494b68ea07630f239fd254d984b7f2ad1a7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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>
@@ -34,7 +34,7 @@
 ;; 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.
@@ -105,7 +105,7 @@ was first made obsolete, for example a date or a release number."
   (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."
@@ -118,7 +118,7 @@ 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."
@@ -127,13 +127,14 @@ 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.
@@ -147,7 +148,7 @@ The result of the body appears to the compiler as a quoted constant."
 ;;; 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
index 668157fc52ac29c4d7d61dd77663e0be076046ad..2be217a41c6711c7a564f0095ffb5fadc7efdf4a 100644 (file)
@@ -170,7 +170,14 @@ first will be printed into the backtrace buffer."
            (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)
@@ -190,10 +197,6 @@ first will be printed into the backtrace buffer."
                  (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))
@@ -225,7 +228,7 @@ first will be printed into the backtrace buffer."
       (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)
@@ -263,12 +266,7 @@ That buffer should be current already."
   ;; 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: ")
@@ -508,12 +506,12 @@ Applies to the frame whose line point is on in the backtrace."
            (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
index fcc423959674194efa38c5f51e78ddcb82e56100..87ddfa6a55beb2114b282e17860681b43926bb9d 100644 (file)
@@ -1502,7 +1502,7 @@ If DIRECTION is `backward', search in the reverse direction."
                            ;; 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)
@@ -1540,6 +1540,7 @@ If DIRECTION is `backward', search in the reverse direction."
                  (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)))
@@ -1578,7 +1579,7 @@ If DIRECTION is `backward', search in the reverse direction."
                                  ;; 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)
@@ -1615,7 +1616,8 @@ If DIRECTION is `backward', search in the reverse direction."
       ;; 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))))))
 
index a4eda95e23e5e4c244fa6eab8da3fa662ed6516a..2cbb00b324ca9338cd06b7d1522f5f0ce9063881 100644 (file)
@@ -1,7 +1,7 @@
 ;;; 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
@@ -205,8 +205,8 @@ It understands elisp style quoting within STRING such that
 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))
index 861c3bbb8c6e3ed6f80c0d7447457c77a8a78a45..81ed7780a64eef67197b2841c87a9af000df998a 100644 (file)
@@ -284,13 +284,13 @@ See `imenu-generic-expression' for details."
 
 (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
 )
 
 
index 60fb6c33b8dd5543a06d741defc24230254dcd64..c69f8d6cf281b6221e0f33c087c1474d9e1f20df 100644 (file)
@@ -3177,8 +3177,9 @@ commands which are sensitive to the Transient Mark mode."
   :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.
@@ -3197,7 +3198,7 @@ when there is no goal column.
 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))
@@ -3205,16 +3206,17 @@ and more reliable (no dependence on goal column, etc.)."
          (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.
@@ -3229,13 +3231,13 @@ when there is no goal column.
 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
@@ -3274,8 +3276,11 @@ Outline mode sets this."
          (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)
index dfd471a87c4f96edaad814b00a28410bd1731ecd..ccd7f21f502688971f14b41bb3b78ff36682ddcd 100644 (file)
@@ -1,4 +1,4 @@
-;;; 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.
@@ -87,7 +87,7 @@ reinserts the fill prefix in each resulting line."
 (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
@@ -304,12 +304,12 @@ after an opening paren or just before a closing paren or a punctuation
 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)))))))
index 487c842f6f232efb0ca3a54be0efae94b6aafce2..0160265e60f18cb90a6609a56aa87c61600d9df3 100644 (file)
@@ -1,3 +1,8 @@
+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
 
@@ -56,8 +61,8 @@
 
        * 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>
 
@@ -84,8 +89,7 @@
 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.
 
index c1f37b5617b70ef128c283a24be4a67d50584893..5ba052f1285f7bc5ef7c558c33be249908705bb2 100644 (file)
@@ -1,3 +1,23 @@
+/* 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
 
index f6aa0f4a58c8a3e48c8fe21cc41e9762e0fc1be8..38bce796941e4285ea267e1067d9a0e3eb829014 100644 (file)
@@ -1,3 +1,23 @@
+/* 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
 
index 24db3a9c55afdf1fdde1d53fba9bdc9345589fb3..b09d6ccdad9a676ff9cb926f7a0d6d6cbb5b488d 100644 (file)
@@ -1,3 +1,32 @@
+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.
@@ -20,8 +49,7 @@
        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.
index db511aad8876da0c72a730ce5d8935ac6f80fe51..c62c1e88042bbba2271377984a315fe26907546c 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -2696,7 +2696,11 @@ This is what happens in interactive use with M-x.  */)
   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.  */
@@ -2779,7 +2783,11 @@ This is what happens in interactive use with M-x.  */)
   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.  */
@@ -2846,7 +2854,11 @@ This happens for interactive use with M-x.  */)
      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.  */
@@ -4508,7 +4520,6 @@ actually used.  */)
              if (CONSP (coding_system))
                coding_system = XCAR (coding_system);
            }
-
          unbind_to (count, Qnil);
          inserted = Z_BYTE - BEG_BYTE;
        }
index c45845e00ce94edf1834e51f4ad6deb4d63742d7..0522fc4137e029604adb4885486f7e2be1f9606f 100644 (file)
@@ -1939,6 +1939,88 @@ static XIMStyle supported_xim_styles[] =
 
 /* 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;
@@ -1950,6 +2032,9 @@ xic_create_xfontset (f, base_fontname)
   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)
     {
@@ -1966,12 +2051,16 @@ xic_create_xfontset (f, base_fontname)
 
   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))
@@ -2053,6 +2142,11 @@ create_frame_xic (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)
     {
@@ -2060,52 +2154,9 @@ create_frame_xic (f)
       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)
index e98ee7534a42bbd2d9d298b8ae2c91d5985be0e3..07d6fe3d73036e12551f08489b7d97563734a418 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -138,12 +138,7 @@ static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **));
 /* 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,
@@ -645,10 +640,10 @@ list_of_panes (menu)
 
   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);
@@ -668,22 +663,22 @@ list_of_items (pane)
 {
   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
@@ -802,8 +797,8 @@ cached information about equivalent key sequences.  */)
          if (CONSP (tem))
            {
              window = Fcar (Fcdr (position));
-             x = Fcar (tem);
-             y = Fcar (Fcdr (tem));
+             x = XCAR (tem);
+             y = Fcar (XCDR (tem));
            }
          else
            {
@@ -931,11 +926,11 @@ cached information about equivalent key sequences.  */)
 
       /* 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))
@@ -1750,7 +1745,7 @@ digest_single_submenu (start, end, top_level_items)
 #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
@@ -2695,7 +2690,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
 #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