Commit f12f551b authored by Paul Eggert's avatar Paul Eggert
Browse files

Merge from mainline.

parents 942f733f 203784cc
2011-02-19 Glenn Morris <rgm@gnu.org>
* dired-x.texi (Technical Details): No longer redefines dired-add-entry,
or dired-initial-position.
2011-02-18 Glenn Morris <rgm@gnu.org>
* dired-x.texi (Optional Installation File At Point): Simplify.
2011-02-17 Teodor Zlatanov <tzz@lifelogs.com>
* auth.texi (Help for users): Use :port instead of :protocol for all
......
......@@ -185,19 +185,14 @@ from @file{dired.el}
@code{dired-clean-up-after-deletion}
@item
@code{dired-find-buffer-nocreate}
@item
@code{dired-initial-position}
@end itemize
@noindent
and the following functions from @file{dired-aux.el}
@itemize @bullet
@item
@code{dired-add-entry}
@item
@code{dired-read-shell-command}
@end itemize
and from @file{dired-aux.el} the function @code{dired-read-shell-command}.
In addition, once @file{dired.el} is loaded, @code{dired-add-entry}
obeys Dired Omit mode (@pxref{Omitting Files in Dired}), if it is active.
Similarly, @code{dired-initial-position} obeys @code{dired-find-subdir}
(@pxref{Miscellaneous Commands}).
@node Installation, Omitting Files in Dired, Introduction, Top
@chapter Installation
......@@ -264,22 +259,9 @@ for these functions. In your @file{.emacs} file put
@cindex Binding @code{dired-x-find-file}
If you choose to have @file{dired-x.el} bind @code{dired-x-find-file} over
@code{find-file} (@pxref{Find File At Point}), then you will need to set
@code{dired-x-hands-off-my-keys} and make a call to the function
@code{dired-x-bind-find-file} in the @code{dired-load-hook}:
@example
(add-hook 'dired-load-hook
(lambda ()
(load "dired-x")
;; Bind dired-x-find-file.
(setq dired-x-hands-off-my-keys nil)
;; Make sure our binding preference is invoked.
(dired-x-bind-find-file)
))
@end example
Alternatively, you can set the variable @emph{before} @file{dired-x.el} is
loaded
@code{dired-x-hands-off-my-keys}. To do this, either set it
@emph{before} @file{dired-x.el} is loaded, or use @kbd{M-x customize-variable},
or call @code{dired-x-bind-find-file} after changing the value.
@example
(add-hook 'dired-load-hook
......
This diff is collapsed.
......@@ -1708,10 +1708,21 @@ main (int argc, char **argv)
fsync (1);
/* Now, wait for an answer and print any messages. */
while (exit_status == EXIT_SUCCESS
&& (rl = recv (emacs_socket, string, BUFSIZ, 0)) > 0)
while (exit_status == EXIT_SUCCESS)
{
char *p;
do
{
errno = 0;
rl = recv (emacs_socket, string, BUFSIZ, 0);
}
/* If we receive a signal (e.g. SIGWINCH, which we pass
through to Emacs), on some OSes we get EINTR and must retry. */
while (rl < 0 && errno == EINTR);
if (rl <= 0)
break;
string[rl] = '\0';
p = string + strlen (string) - 1;
......
2011-02-19 Glenn Morris <rgm@gnu.org>
* dired-x.el (dired-initial-position): Merge into dired.el's version.
* dired.el (dired-initial-position): Merge dired-x's version here.
(dired-find-subdir): Declare.
* dired-x.el (dired-omit-new-add-entry): Merge into dired-add-entry.
* dired-aux.el (dired-add-entry): Give it a doc-string.
Merge dired-x's dired-omit handling here.
(dired-omit-mode, dired-omit-regexp, dired-omit-localp): Declare.
* international/mule-diag.el (list-input-methods-1):
Indent all lines of multi-line doc-strings. (Bug#8066)
2011-02-18 Chong Yidong <cyd@stupidchicken.com>
Fix 2011-02-02 changes.
* apropos.el (apropos-print): Call apropos-mode before setting up
buffer variables. Use inhibit-read-only.
* emacs-lisp/package.el (package--list-packages): Call
package-menu-mode before setting up buffer variables.
* play/solitaire.el (solitaire): Call solitaire-mode before
setting up buffer variables. Use inhibit-read-only.
2011-02-18 Lawrence Mitchell <wence@gmx.li>
* progmodes/sh-script.el (sh-syntax-propertize-here-doc): (bug#8053)
Bind case-fold-search to nil when looking for end of here-doc.
2011-02-18 Eli Zaretskii <eliz@gnu.org>
* image-mode.el (image-toggle-display-image):
Set find-file-literally non-nil in buffers visiting binary image
files. (Bug#8047)
2011-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
* files.el (cd): Make completion obey cd-path (bug#7924).
2011-02-18 Glenn Morris <rgm@gnu.org>
* progmodes/prolog.el: Don't require compile when compiling.
(compilation-shell-minor-mode, compilation-error-regexp-alist)
(compilation-forget-errors, compilation-fake-loc)
(compilation-parse-errors-function, compilation-error-list): Declare.
(prolog-inferior-mode): Require 'compile.
* emulation/cua-base.el (pc-selection-mode): Declare.
* emacs-lisp/eieio-custom.el: Set generated-autoload-file.
(customize-object): Add autoload cookie.
* emacs-lisp/eieio-opt.el: Set generated-autoload-file.
(eieio-browse, describe-class, eieio-describe-class)
(eieio-describe-constructor, describe-generic, eieio-describe-generic)
(eieio-help-mode-augmentation-maybee): Add autoload cookies.
* emacs-lisp/eieio.el: Regenerate with automatic autoloads.
* Makefile.in (autoloads): Make eieio.el writable.
* dired-x.el (dired-clean-up-after-deletion, dired-do-relsymlink)
(dired-do-relsymlink-regexp, dired-find-buffer-nocreate): Use #'.
(dired-hack-local-variables): Use inhibit-read-only.
(dired-guess-default): Simplify.
(dired-make-relative-symlink): Use dotimes.
(dired-simultaneous-find-file): Use dolist.
(dired-mark-sexp): Remove unneeded `if'. Use line-end-position.
(dired-x-hands-off-my-keys): Doc fix.
(dired-x-bind-find-file): Doc fix. Use remapping.
(after-init-hook): No need to add dired-x-bind-find-file.
(dired-x-find-file, dired-x-find-file-other-window): Doc fixes.
No need to call expand-file-name.
(dired-filename-at-point): Remove unused locals `end', `filename'.
2011-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
 
* emacs-lisp/pcase.el (pcase--u1): Understand non-linear patterns.
......@@ -68,8 +143,8 @@
allout-abbreviate-flattened-numbering.
(allout-mode-p): Include among autoloads, for use by other modes
with impunity.
(allout-listify-exposed): Use
allout-flattened-numbering-abbreviation.
(allout-listify-exposed):
Use allout-flattened-numbering-abbreviation.
(allout-encrypt-string): Use set-buffer-multibyte directly.
(allout-set-buffer-multibyte): Remove.
 
......@@ -146,8 +221,8 @@
 
* vc/vc-bzr.el (vc-bzr-log-view-mode): Truncate lines in root log.
 
* vc/log-view.el (log-view-mode-menu): Add
log-view-toggle-entry-display.
* vc/log-view.el (log-view-mode-menu):
Add log-view-toggle-entry-display.
 
2011-02-14 Glenn Morris <rgm@gnu.org>
 
......@@ -172,8 +247,8 @@
* progmodes/cc-fonts.el (c-font-lock-declarations): Remove a
narrow-to-region call that cuts context off the end (Bug#7722).
 
* progmodes/cc-engine.el (c-forward-<>-arglist-recur): Refactor
nested if-forms with a simple cond.
* progmodes/cc-engine.el (c-forward-<>-arglist-recur):
Refactor nested if-forms with a simple cond.
(c-forward-<>-arglist): Revert 2011-01-31 change.
 
2011-02-13 Chong Yidong <cyd@stupidchicken.com>
......
......@@ -147,7 +147,8 @@ finder-data: doit
autoloads: $(LOADDEFS) doit
chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
$(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
$(lisp)/dired.el $(lisp)/ibuffer.el $(lisp)/htmlfontify.el
$(lisp)/dired.el $(lisp)/ibuffer.el $(lisp)/htmlfontify.el \
$(lisp)/emacs-lisp/eieio.el
cd $(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
......
......@@ -972,8 +972,10 @@ If non-nil TEXT is a string that will be printed as a heading."
(with-output-to-temp-buffer "*Apropos*"
(let ((p apropos-accumulator)
(old-buffer (current-buffer))
(inhibit-read-only t)
symbol item)
(set-buffer standard-output)
(apropos-mode)
(if (display-mouse-p)
(insert
"If moving the mouse over text changes the text's color, "
......@@ -1064,8 +1066,7 @@ If non-nil TEXT is a string that will be printed as a heading."
(apropos-print-doc 5 'apropos-widget t)
(apropos-print-doc 4 'apropos-plist nil))
(set (make-local-variable 'truncate-partial-width-windows) t)
(set (make-local-variable 'truncate-lines) t)
(apropos-mode))))
(set (make-local-variable 'truncate-lines) t))))
(prog1 apropos-accumulator
(setq apropos-accumulator ()))) ; permit gc
......
......@@ -1039,92 +1039,124 @@ See Info node `(emacs)Subdir switches' for more details."
(file-name-directory filename) (file-name-nondirectory filename)
(function dired-add-entry) filename marker-char))
(defvar dired-omit-mode)
(declare-function dired-omit-regexp "dired-x" ())
(defvar dired-omit-localp)
(defun dired-add-entry (filename &optional marker-char relative)
;; Add a new entry for FILENAME, optionally marking it
;; with MARKER-CHAR (a character, else dired-marker-char is used).
;; Note that this adds the entry `out of order' if files sorted by
;; time, etc.
;; At least this version inserts in the right subdirectory (if present).
;; And it skips "." or ".." (see `dired-trivial-filenames').
;; Hidden subdirs are exposed if a file is added there.
(setq filename (directory-file-name filename))
;; Entry is always for files, even if they happen to also be directories
(let* ((opoint (point))
(cur-dir (dired-current-directory))
(orig-file-name filename)
(directory (if relative cur-dir (file-name-directory filename)))
reason)
(setq filename
(if relative
(file-relative-name filename directory)
(file-name-nondirectory filename))
reason
(catch 'not-found
(if (string= directory cur-dir)
(progn
(skip-chars-forward "^\r\n")
(if (eq (following-char) ?\r)
(dired-unhide-subdir))
;; We are already where we should be, except when
;; point is before the subdir line or its total line.
(let ((p (dired-after-subdir-garbage cur-dir)))
(if (< (point) p)
(goto-char p))))
;; else try to find correct place to insert
(if (dired-goto-subdir directory)
(progn ;; unhide if necessary
(if (looking-at "\r") ;; point is at end of subdir line
(dired-unhide-subdir))
;; found - skip subdir and `total' line
;; and uninteresting files like . and ..
;; This better not moves into the next subdir!
(dired-goto-next-nontrivial-file))
;; not found
(throw 'not-found "Subdir not found")))
(let (buffer-read-only opoint)
(beginning-of-line)
(setq opoint (point))
;; Don't expand `.'. Show just the file name within directory.
(let ((default-directory directory))
(dired-insert-directory directory
(concat dired-actual-switches " -d")
(list filename)))
(goto-char opoint)
;; Put in desired marker char.
(when marker-char
(let ((dired-marker-char
(if (integerp marker-char) marker-char dired-marker-char)))
(dired-mark nil)))
;; Compensate for a bug in ange-ftp.
;; It inserts the file's absolute name, rather than
;; the relative one. That may be hard to fix since it
;; is probably controlled by something in ftp.
(goto-char opoint)
(let ((inserted-name (dired-get-filename 'verbatim)))
(if (file-name-directory inserted-name)
(let (props)
(end-of-line)
(forward-char (- (length inserted-name)))
(setq props (text-properties-at (point)))
(delete-char (length inserted-name))
(let ((pt (point)))
(insert filename)
(set-text-properties pt (point) props))
(forward-char 1))
(forward-line 1)))
(forward-line -1)
(if dired-after-readin-hook ;; the subdir-alist is not affected...
(save-excursion ;; ...so we can run it right now:
(save-restriction
(beginning-of-line)
(narrow-to-region (point) (line-beginning-position 2))
(run-hooks 'dired-after-readin-hook))))
(dired-move-to-filename))
;; return nil if all went well
nil))
(if reason ; don't move away on failure
(goto-char opoint))
(not reason))) ; return t on success, nil else
"Add a new dired entry for FILENAME.
Optionally mark it with MARKER-CHAR (a character, else uses
`dired-marker-char'). Note that this adds the entry `out of order'
if files are sorted by time, etc.
Skips files that match `dired-trivial-filenames'.
Exposes hidden subdirectories if a file is added there.
If `dired-x' is loaded and `dired-omit-mode' is enabled, skips
files matching `dired-omit-regexp'."
(if (or (not (featurep 'dired-x))
(not dired-omit-mode)
;; Avoid calling ls for files that are going to be omitted anyway.
(let ((omit-re (dired-omit-regexp)))
(or (string= omit-re "")
(not (string-match omit-re
(cond
((eq 'no-dir dired-omit-localp)
filename)
((eq t dired-omit-localp)
(dired-make-relative filename))
(t
(dired-make-absolute
filename
(file-name-directory filename)))))))))
;; Do it!
(progn
(setq filename (directory-file-name filename))
;; Entry is always for files, even if they happen to also be directories
(let* ((opoint (point))
(cur-dir (dired-current-directory))
(orig-file-name filename)
(directory (if relative cur-dir (file-name-directory filename)))
reason)
(setq filename
(if relative
(file-relative-name filename directory)
(file-name-nondirectory filename))
reason
(catch 'not-found
(if (string= directory cur-dir)
(progn
(skip-chars-forward "^\r\n")
(if (eq (following-char) ?\r)
(dired-unhide-subdir))
;; We are already where we should be, except when
;; point is before the subdir line or its total line.
(let ((p (dired-after-subdir-garbage cur-dir)))
(if (< (point) p)
(goto-char p))))
;; else try to find correct place to insert
(if (dired-goto-subdir directory)
(progn ;; unhide if necessary
(if (looking-at "\r")
;; Point is at end of subdir line.
(dired-unhide-subdir))
;; found - skip subdir and `total' line
;; and uninteresting files like . and ..
;; This better not move into the next subdir!
(dired-goto-next-nontrivial-file))
;; not found
(throw 'not-found "Subdir not found")))
(let (buffer-read-only opoint)
(beginning-of-line)
(setq opoint (point))
;; Don't expand `.'.
;; Show just the file name within directory.
(let ((default-directory directory))
(dired-insert-directory
directory
(concat dired-actual-switches " -d")
(list filename)))
(goto-char opoint)
;; Put in desired marker char.
(when marker-char
(let ((dired-marker-char
(if (integerp marker-char) marker-char
dired-marker-char)))
(dired-mark nil)))
;; Compensate for a bug in ange-ftp.
;; It inserts the file's absolute name, rather than
;; the relative one. That may be hard to fix since it
;; is probably controlled by something in ftp.
(goto-char opoint)
(let ((inserted-name (dired-get-filename 'verbatim)))
(if (file-name-directory inserted-name)
(let (props)
(end-of-line)
(forward-char (- (length inserted-name)))
(setq props (text-properties-at (point)))
(delete-char (length inserted-name))
(let ((pt (point)))
(insert filename)
(set-text-properties pt (point) props))
(forward-char 1))
(forward-line 1)))
(forward-line -1)
(if dired-after-readin-hook
;; The subdir-alist is not affected...
(save-excursion ; ...so we can run it right now:
(save-restriction
(beginning-of-line)
(narrow-to-region (point)
(line-beginning-position 2))
(run-hooks 'dired-after-readin-hook))))
(dired-move-to-filename))
;; return nil if all went well
nil))
(if reason ; don't move away on failure
(goto-char opoint))
(not reason))) ; return t on success, nil else
;; Don't do it (dired-omit-mode).
;; Return t for success (perhaps we should return file-exists-p).
t))
(defun dired-after-subdir-garbage (dir)
;; Return pos of first file line of DIR, skipping header and total
......
This diff is collapsed.
......@@ -2544,11 +2544,15 @@ instead of `dired-actual-switches'."
;; return value of point (i.e., FOUND):
(goto-char found))))
(defvar dired-find-subdir)
;; FIXME document whatever dired-x is doing.
(defun dired-initial-position (dirname)
;; Where point should go in a new listing of DIRNAME.
;; Point assumed at beginning of new subdir line.
;; You may redefine this function as you wish, e.g. like in dired-x.el.
"Where point should go in a new listing of DIRNAME.
Point assumed at beginning of new subdir line."
(end-of-line)
(and (featurep 'dired-x) dired-find-subdir
(dired-goto-subdir dirname))
(if dired-trivial-filenames (dired-goto-next-nontrivial-file)))
;; These are hooks which make tree dired work.
......
......@@ -326,6 +326,7 @@ User made commands should also call this method when applying changes.
Argument OBJ is the object that has been customized."
nil)
;;;###autoload
(defun customize-object (obj &optional group)
"Customize OBJ in a custom buffer.
Optional argument GROUP is the sub-group of slots to display."
......@@ -460,4 +461,8 @@ Return the symbol for the group, or nil"
(provide 'eieio-custom)
;; Local variables:
;; generated-autoload-file: "eieio.el"
;; End:
;;; eieio-custom.el ends here
......@@ -32,6 +32,7 @@
(require 'eieio)
;;; Code:
;;;###autoload
(defun eieio-browse (&optional root-class)
"Create an object browser window to show all objects.
If optional ROOT-CLASS, then start with that, otherwise start with
......@@ -71,8 +72,10 @@ Argument CH-PREFIX is another character prefix to display."
;;; CLASS COMPLETION / DOCUMENTATION
;;;###autoload
(defalias 'describe-class 'eieio-describe-class)
;;;###autoload
(defun eieio-describe-class (class &optional headerfcn)
"Describe a CLASS defined by a string or symbol.
If CLASS is actually an object, then also display current values of that object.
......@@ -238,6 +241,7 @@ Outputs to the standard output."
prot (cdr prot)
i (1+ i)))))
;;;###autoload
(defun eieio-describe-constructor (fcn)
"Describe the constructor function FCN.
Uses `eieio-describe-class' to describe the class being constructed."
......@@ -301,9 +305,11 @@ are not abstract."
;;; METHOD COMPLETION / DOC
(defalias 'describe-method 'eieio-describe-generic)
;;;###autoload
(defalias 'describe-generic 'eieio-describe-generic)
(defalias 'eieio-describe-method 'eieio-describe-generic)
;;;###autoload
(defun eieio-describe-generic (generic)
"Describe the generic function GENERIC.
Also extracts information about all methods specific to this generic."
......@@ -550,6 +556,7 @@ Optional argument HISTORYVAR is the variable to use as history."
;;; HELP AUGMENTATION
;;
;;;###autoload
(defun eieio-help-mode-augmentation-maybee (&rest unused)
"For buffers thrown into help mode, augment for EIEIO.
Arguments UNUSED are not used."
......@@ -693,4 +700,8 @@ INDENT is the current indentation level."
(provide 'eieio-opt)
;; Local variables:
;; generated-autoload-file: "eieio.el"
;; End:
;;; eieio-opt.el ends here
......@@ -2943,15 +2943,65 @@ Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate."
;;; Autoloading some external symbols, and hooking into the help system
;;
(autoload 'eieio-help-mode-augmentation-maybee "eieio-opt" "For buffers thrown into help mode, augment for EIEIO.")
(autoload 'eieio-browse "eieio-opt" "Create an object browser window." t)
(autoload 'eieio-describe-class "eieio-opt" "Describe CLASS defined by a string or symbol" t)
(autoload 'eieio-describe-constructor "eieio-opt" "Describe the constructor function FCN." t)
(autoload 'describe-class "eieio-opt" "Describe CLASS defined by a string or symbol." t)
(autoload 'eieio-describe-generic "eieio-opt" "Describe GENERIC defined by a string or symbol." t)
(autoload 'describe-generic "eieio-opt" "Describe GENERIC defined by a string or symbol." t)
(autoload 'customize-object "eieio-custom" "Create a custom buffer editing OBJ.")
;;; Start of automatically extracted autoloads.
;;;### (autoloads (customize-object) "eieio-custom" "eieio-custom.el"
;;;;;; "cf1bd64c76a6e6406545e8c5a5530d43")
;;; Generated autoloads from eieio-custom.el
(autoload 'customize-object "eieio-custom" "\
Customize OBJ in a custom buffer.
Optional argument GROUP is the sub-group of slots to display.
\(fn OBJ &optional GROUP)" nil nil)
;;;***
;;;### (autoloads (eieio-help-mode-augmentation-maybee eieio-describe-generic
;;;;;; eieio-describe-constructor eieio-describe-class eieio-browse)
;;;;;; "eieio-opt" "eieio-opt.el" "1bed0a56310f402683419139ebc18d7f")
;;; Generated autoloads from eieio-opt.el
(autoload 'eieio-browse "eieio-opt" "\
Create an object browser window to show all objects.
If optional ROOT-CLASS, then start with that, otherwise start with
variable `eieio-default-superclass'.
\(fn &optional ROOT-CLASS)" t nil)
(defalias 'describe-class 'eieio-describe-class)
(autoload 'eieio-describe-class "eieio-opt" "\
Describe a CLASS defined by a string or symbol.
If CLASS is actually an object, then also display current values of that object.
Optional HEADERFCN should be called to insert a few bits of info first.
\(fn CLASS &optional HEADERFCN)" t nil)
(autoload 'eieio-describe-constructor "eieio-opt" "\
Describe the constructor function FCN.
Uses `eieio-describe-class' to describe the class being constructed.
\(fn FCN)" t nil)
(defalias 'describe-generic 'eieio-describe-generic)
(autoload 'eieio-describe-generic "eieio-opt" "\
Describe the generic function GENERIC.
Also extracts information about all methods specific to this generic.
\(fn GENERIC)" t nil)
(autoload 'eieio-help-mode-augmentation-maybee "eieio-opt" "\
For buffers thrown into help mode, augment for EIEIO.
Arguments UNUSED are not used.
\(fn &rest UNUSED)" nil nil)
;;;***
;;; End of automatically extracted autoloads.
(provide 'eieio)
......
......@@ -1657,10 +1657,10 @@ list; the default is to display everything in `package-alist'."
(require 'finder-inf nil t)
(let ((buf (get-buffer-create "*Packages*")))
(with-current-buffer buf
(package-menu-mode)
(set (make-local-variable 'package-menu-package-list) packages)
(set (make-local-variable 'package-menu-sort-key) nil)
(package--generate-package-list)
(package-menu-mode))
(package--generate-package-list))
;; The package menu buffer has keybindings. If the user types
;; `M-x list-packages', that suggests it should become current.
(switch-to-buffer buf)))
......