1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

1370 Commits

Author SHA1 Message Date
Glenn Morris
51bc5f8b73 Make set-visited-file-name reload local variables if needed.
* lisp/files.el (set-visited-file-name):
If the major-mode changed, reload the local variables.

Fixes: debbugs:9796
2011-10-26 23:38:32 -07:00
Chong Yidong
86c6068184 Make vc-toggle-read-only an alias for toggle-read-only.
It hasn't worked in a VC sense since 2008-05-02T07:12:59Z!esr@snark.thyrsus.com, though this was
not documented at the time (grr).

* lisp/vc/vc-hooks.el (vc-toggle-read-only): Make it an obsolete alias
for toggle-read-only.  Note that this hasn't called vc-next-action
since 2008-05-02, though it wasn't documented at the time.

* lisp/files.el (toggle-read-only): Remove obsolete comment about
version control.

* doc/emacs/buffers.texi (Misc Buffer): Don't mention vc-toggle-read-only.

* lisp/cedet/ede.el (ede-maybe-checkout): Function deleted;
vc-toggle-read-only does not do version control now.

* lisp/cedet/ede/project-am.el (project-remove-file, project-add-file)
(project-new-target): Don't call ede-maybe-checkout.

* lisp/cedet/ede/util.el (ede-make-buffer-writable): Don't use
vc-toggle-read-only.

* lisp/vc/ediff-init.el (ediff-toggle-read-only-function): Use
toggle-read-only.
2011-10-23 11:38:23 +08:00
Michael Albinus
28dbc92f2c Fix Bug#6019, Bug#9315.
* files.el (set-auto-mode): Call `file-name-sans-versions' for the
complete `buffer-file-name', the local file name part could look
remotely (for example on VMS).

* net/ange-ftp.el (ange-ftp-run-real-handler): Make it an alias of
`tramp-run-real-handler'.
(ange-ftp-fix-name-for-vms): Handle the case, where `name' is
already quoted by '"'.

* net/tramp.el (tramp-rfn-eshadow-update-overlay): Ignore errors.
Let `file-name-handler-alist' be nil, the local file name part
could look remotely (for example on VMS).
2011-10-12 20:32:35 +02:00
Michael Albinus
e74f1bb6f8 * files.el (copy-directory): Set directory attributes only in case
they could be retrieved from the source directory.  (Bug#9565)
2011-09-22 12:00:07 +02:00
Chong Yidong
3aace4e4b3 Allow visiting files with malformed prop-lines.
* files.el (inhibit-first-line-modes-regexps): Add image files.
(hack-local-variables-prop-line): Return nil for malformed prop-lines.

Fixes: debbugs:9044
2011-09-18 11:30:10 -04:00
Chong Yidong
64b5194776 * dired-aux.el (dired-mark-read-string): Don't use default value on empty input.
(dired-do-chxxx): Treat empty input for "touch" as no -t option.
Omit initial minibuffer contents.
(dired-do-chmod): Signal an error on empty input.
(dired-mark-read-string): Don't return default on empty input.

* files.el (file-modes-symbolic-to-number): Doc fix.

Fixes: debbugs:9361
2011-09-12 16:45:56 -04:00
Leo Liu
3d03de90fb Remove unused variable find-file-not-true-dirname-list
See http://debbugs.gnu.org/9422.
2011-09-03 09:41:27 +08:00
Chong Yidong
c33134511b Remove pop-to-buffer-same-window.
* lisp/window.el (pop-to-buffer-1, pop-to-buffer-same-window): Deleted.
(pop-to-buffer): Change interactive spec.  Pass second argument
directly to display-buffer.
(display-buffer): Fix interactive spec.  Use functionp to
distinguish between a function and a list of functions.

* lisp/abbrev.el (edit-abbrevs):
* lisp/arc-mode.el (archive-extract):
* lisp/autoinsert.el (auto-insert):
* lisp/bookmark.el (bookmark-bmenu-list):
* lisp/files.el (find-file):
* lisp/view.el (view-buffer):
* lisp/progmodes/compile.el (compilation-goto-locus):
* lisp/textmodes/bibtex.el (bibtex-initialize): Use switch-to-buffer.

* lisp/org/ob-ref.el (org-babel-ref-goto-headline-id):
* lisp/org/org.el (org-get-location, org-tree-to-indirect-buffer)
(org-mark-ring-goto, org-refile, org-add-log-note)
(org-revert-all-org-buffers, org-switchb)
(org-cycle-agenda-files, org-submit-bug-report)
(org-goto-marker-or-bmk):
* lisp/org/org-agenda.el (org-prepare-agenda, org-agenda-switch-to):
* lisp/org/org-capture.el (org-capture-goto-target)
(org-capture-fill-template):
* lisp/org/org-clock.el (org-clock-goto):
* lisp/org/org-ctags.el (org-ctags-visit-buffer-or-file):
* lisp/org/org-exp.el (org-export-as-org):
* lisp/org/org-feed.el (org-feed-show-raw-feed):
* lisp/org/org-html.el (org-export-htmlize-generate-css):
* lisp/org/org-id.el (org-id-goto):
* lisp/org/org-irc.el (org-irc-visit-erc):
* lisp/org/org-mobile.el (org-mobile-apply):
* lisp/org/org-publish.el (org-publish-org-to, org-publish-find-date):
* lisp/org/org-remember.el (org-go-to-remember-target):
* lisp/org/org-src.el (org-src-switch-to-buffer)
(org-edit-fixed-width-region): Use switch-to-buffer.

* lisp/org/org-compat.el (org-pop-to-buffer-same-window): Deleted.
2011-09-02 12:38:40 -04:00
Glenn Morris
8e999f70ab * lisp/files.el (hack-local-variables): Fully ignore case for "mode:". 2011-08-20 15:26:52 -07:00
Glenn Morris
9234ff7fcf files.el fix for bug#9331
* lisp/files.el (hack-local-variables-prop-line, hack-local-variables):
Downcase "Mode:".
2011-08-19 14:23:09 -04:00
Lars Magne Ingebrigtsen
3ee3a1b538 Make `buffer-offer-save' permanently local
Fixes: debbugs:6241
2011-07-16 22:01:37 +02:00
Lars Magne Ingebrigtsen
bd2fcc8d5c (make-directory): Clarify that an error will be raised if there's an error
Fixes: debbugs:6387
2011-07-14 00:22:08 +02:00
Lars Magne Ingebrigtsen
7152b011c2 Give better error messages when trying to load non-existent symlinks
* files.el (after-find-file): Give a better error message when
trying to find a symlink that points to a file that doesn't exist
(bug#4398).
2011-07-13 01:25:50 +02:00
Leo Liu
481a51b660 Only do the `C-x C-q' warning on VC backends where it makes sense.
Fixes: debbugs:2623
2011-07-11 15:56:49 +02:00
Stefan Monnier
c8af70e11e * lisp/files.el (find-file): Use pop-to-buffer-same-window.
* lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
Add switch-to-buffer.

Fixes: debbugs:8911
2011-07-04 12:08:16 -04:00
Lars Magne Ingebrigtsen
28fd8759b3 * files.el (file-expand-wildcards): Ignore non-readable
sub-directories while trying to find matches instead of signalling
an error (bug#6297).
2011-07-03 03:48:07 +02:00
Chong Yidong
658d8eb8fc Avoid calling customize-save-variable during startup (Bug#8720).
* lisp/cus-edit.el (customize-push-and-save): New function.

* lisp/files.el (hack-local-variables-confirm): Use it.

* lisp/custom.el (load-theme): New arg NO-CONFIRM.  Use
customize-push-and-save (Bug#8720).
(custom-enabled-themes): Doc fix.

* lisp/cus-theme.el (customize-create-theme)
(custom-theme-merge-theme): Callers to load-theme changed.
2011-06-29 21:39:52 -04:00
Glenn Morris
faf2a1741d * lisp/files.el (auto-mode-alist): Add .f03, .f08 for f90-mode. 2011-06-29 14:38:39 -04:00
Chong Yidong
56f9dcc930 Fix last change. 2011-06-19 14:59:58 -04:00
Chong Yidong
4ca009e5a8 * lisp/files.el (auto-mode-alist): Entry for m2-mode (Bug#8852). 2011-06-19 14:53:49 -04:00
Martin Rudalics
9397e56f74 Move/add window-buffer-related functions to window.el.
* buffer.c: New Lisp objects Qbuffer_list_update_hook and
Qclone_number.  Remove external declaration of Qdelete_window.
(Fbuffer_list): Rewrite doc-string.  Minor restructuring of
code.
(Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
Qbuffer_list_update_hook if allowed.
(Fother_buffer): Rewrite doc-string.  Major rewrite for new
buffer list implementation.
(other_buffer_safely): New function.
(Fkill_buffer): Replace call to replace_buffer_in_all_windows by
calls to replace_buffer_in_windows and
replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
if allowed.
(record_buffer): Inhibit quitting and rewrite using quittable
functions.  Run Qbuffer_list_update_hook if allowed.
(Frecord_buffer, Funrecord_buffer): New functions.
(switch_to_buffer_1, Fswitch_to_buffer): Remove.  Move
switch-to-buffer to window.el.
(bury-buffer): Move to window.el.
(Vbuffer_list_update_hook): New variable.

* lisp.h (other_buffer_safely): Add prototype in buffer.c
section.

* window.h (resize_frame_windows): Move up in code.
(Fwindow_frame): Remove EXFUN.
(replace_buffer_in_all_windows): Remove prototype.
(replace_buffer_in_windows_safely): Add prototype.

* window.c: Declare Qdelete_window static again.  Move down
declaration of select_count.
(Fnext_window, Fprevious_window): Rewrite doc-strings.
(Fother_window): Move to window.el.
(window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
(Fdelete_windows_on, Freplace_buffer_in_windows): Move to
window.el.
(replace_buffer_in_windows): Implement by calling
Qreplace_buffer_in_windows.
(replace_buffer_in_all_windows): Remove with some functionality
moved into replace_buffer_in_windows_safely.
(replace_buffer_in_windows_safely): New function.
(select_window_norecord, select_frame_norecord): Move in front
of run_window_configuration_change_hook.  Remove now obsolete
declarations.
(Fset_window_buffer): Rewrite doc-string.  Call
Qrecord_window_buffer.
(keys_of_window): Move binding for other-window to window.el.

* loadup.el (top-level): Load window before files for the sake
of replace-buffer-in-windows.

* files.el (read-buffer-to-switch)
(switch-to-buffer-other-window)
(switch-to-buffer-other-frame, display-buffer-other-frame): Move
to window.el.

* simple.el (get-next-valid-buffer, last-buffer, next-buffer)
(previous-buffer): Move to window.el.

* bindings.el (unbury-buffer): Move to window.el.

* window.el (delete-other-windows-vertically): Move after
definition of delete-other-windows.
(other-window, delete-windows-on, replace-buffer-in-windows):
Move here from window.c.
(record-window-buffer, unrecord-window-buffer)
(set-window-buffer-start-and-point, switch-to-prev-buffer)
(switch-to-next-buffer): New functions.
(get-next-valid-buffer, last-buffer, next-buffer): Move here
from simple.el.  Call switch-to-next-buffer.
(previous-buffer): Move here from simple.el.  Call
switch-to-prev-buffer.
(bury-buffer): Move here from buffer.c.  Switch to previous
buffer when window cannot be deleted.
(unbury-buffer): Move here from bindings.el.
(ctl-x-map): Move binding for other-window from window.c to
here.
(read-buffer-to-switch, switch-to-buffer-other-window)
(switch-to-buffer-other-frame): Move here from files.el.
(normalize-buffer-to-switch-to): New functions.
(switch-to-buffer): Move here from buffer.c.  Use
read-buffer-to-switch and normalize-buffer-to-switch-to.
2011-06-11 11:50:37 +02:00
Glenn Morris
f0da764a5c Allow/recommend explicit args for minor-modes in file local eval:s.
* lisp/files.el (hack-one-local-variable-eval-safep):
Allow minor-modes with explicit +/-1 arguments.

* doc/emacs/custom.texi (Specifying File Variables):
Recommend explicit arguments for minor modes.

* etc/NEWS: Likewise.

* lisp/doc-view.el, lisp/net/soap-client.el: Update file locals.
2011-06-09 16:22:06 -04:00
Alexander Klimov
254c37a51d Small fixes for dired-listing-switches usage.
Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg01000.html

* lisp/mail/sendmail.el (mail-recover-1, mail-recover):
* lisp/files.el (recover-file, recover-session):
Handle dired-listing-switches not being just a single short option.
2011-06-08 22:33:26 -07:00
Chong Yidong
5d344e883f Tweak auto-mode-alist to handle config.h.in (Bug#8547).
* lisp/files.el (auto-mode-alist): Move config rule after the
in-stripping one.
2011-05-28 15:26:25 -04:00
David Michael
7a6b1aef76 * lisp/files.el (interpreter-mode-alist): Add rbash.
Fixes: debbugs:8745
2011-05-27 16:33:48 -03:00
Glenn Morris
e145f1881a Make set-auto-mode respect mode: entries at the end of the file (bug#8586)
* lisp/files.el (set-auto-mode):
Also respect mode: entries at the end of the file.

* doc/lispref/modes.texi (Auto Major Mode):
Update for set-auto-mode changes.

* doc/emacs/custom.texi (Specifying File Variables):
Major modes no longer need come first.

* etc/NEWS: Mention this.
2011-05-26 21:00:53 -04:00
Glenn Morris
27b48e635a * lisp/files.el (hack-local-variables, hack-local-variables-apply): Doc fixes. 2011-05-26 00:35:47 -07:00
Glenn Morris
98f593b8d4 Downcase mode names in recent files.el changes.
* lisp/files.el (hack-local-variables-prop-line, hack-local-variables):
Downcase mode names, as seems to be traditional.
2011-05-26 00:23:11 -07:00
Stefan Monnier
4f91a8160f Don't quote lambda expressions with `quote'. 2011-05-23 14:57:17 -03:00
Glenn Morris
162d78a17e Further tweak previous files.el change.
* lisp/files.el (hack-local-variables): In the MODE-ONLY case, try to
ignore minor modes.
2011-05-21 18:18:49 -07:00
Glenn Morris
80614e5701 Tweak previous files.el change.
* lisp/files.el (hack-local-variables-prop-line)
(hack-local-variables): In the MODE-ONLY case, return the full mode
symbol, including "-mode".
2011-05-21 17:34:41 -07:00
Glenn Morris
88dfa7568a More small hack-local-variables tweaks for MODE-ONLY case.
* lisp/files.el (hack-local-variables-prop-line): Small simplifications.
(hack-local-variables, hack-local-variables-prop-line):
If MODE-ONLY, return the mode, rather than just `t'.
2011-05-21 17:04:49 -07:00
Glenn Morris
7e4ccca345 Small files.el hack-local changes for mode-only case.
* lisp/files.el (hack-local-variables-prop-line, hack-local-variables):
If only interested in the mode, don't bother doing the other stuff.
2011-05-21 15:33:12 -07:00
Nix
35fd0881e6 Small break-hardlink-on-save fix.
* files.el (basic-save-buffer-2):
Fix handling of break-hardlink-on-save with non-existent files.
2011-05-19 17:51:46 -07:00
Glenn Morris
b8f82dc15f Deprecate using "mode:" to enable minor modes (bug#8613)
* lisp/files.el (hack-one-local-variable-eval-safep):
Consider "eval: (foo-mode)" to be safe.

* doc/emacs/custom.texi (Specifying File Variables):
Deprecate using mode: for minor modes.

* etc/NEWS: Mention this.

* lisp/doc-view.el, lisp/net/soap-client.el:
Change "mode:" minor-mode file local variables to use "eval:".
2011-05-09 19:31:42 -07:00
Chong Yidong
c8d173eb1e * files.el (auto-mode-alist): Use js-mode for .json (Bug#8529). 2011-04-23 20:24:30 -04:00
Juanma Barranquero
06b605171f lisp/*.el: Lexical-binding cleanup. 2011-04-19 15:44:55 +02:00
Eli Zaretskii
04f33f1ed9 Produce more accurate results from file-size-human-readable.
lisp/files.el (file-size-human-readable): Produce one digit after
 decimal, like "ls -lh" does.
 lisp/ls-lisp.el (ls-lisp-format-file-size): Allow for 7 characters in
 the file size representation.
2011-04-09 09:59:26 +03:00
Eli Zaretskii
e3971c4440 New function file-size-human-readable.
lisp/files.el (file-size-human-readable): New function.
 lisp/ls-lisp.el (ls-lisp-format-file-size): Use it, instead of
 computing the representation inline.  Don't require `cl'.
2011-04-08 18:31:33 +03:00
Chong Yidong
7d668f2c18 Reimplement list-processes in Lisp.
* lisp/simple.el: Lisp reimplement of list-processes.  Based on an
earlier reimplementation by Leo Liu, but using tabulated-list.el.
(process-menu-mode): New major mode.
(list-processes--refresh, list-processes):
(process-menu-visit-buffer): New functions.

* lisp/files.el (save-buffers-kill-emacs): Don't assume any return
value of list-processes, which is undocumented anyway.
2011-04-06 17:13:17 -04:00
Juanma Barranquero
3e214b503e New variable `revert-buffer-in-progress-p'.
* lisp/files.el (after-find-file-from-revert-buffer): Remove variable.
  (after-find-file): Dont' bind it.
  (revert-buffer-in-progress-p): New variable.
  (revert-buffer): Bind it.
  Pass nil for `after-find-file-from-revert-buffer'.

* lisp/saveplace.el (save-place-find-file-hook): Use new variable
  `rever-buffer-in-progress-p', not `after-find-file-from-revert-buffer'.

* etc/NEWS: New variable `revert-buffer-in-progress-p'.
2011-04-06 21:38:46 +02:00
Glenn Morris
afa8e9f606 * lisp/files.el (save-some-buffers): Doc fix. 2011-04-02 11:12:21 -07:00
Stefan Monnier
cafdcef32d Merge from trunk 2011-03-21 12:42:16 -04:00
Glenn Morris
09d9db2c49 Merge from emacs-23; up to 2010-06-03T22:16:02Z!dann@ics.uci.edu 2011-03-12 11:19:47 -08:00
Eli Zaretskii
2920e68d73 Fix comparisons of file ownership on MS-Windows for the Administrator user.
lisp/files.el (file-ownership-preserved-p): Pass `integer' as an
 explicit 2nd argument to `file-attributes'.  If the file's owner
 is the Administrators group on Windows, and the current user is
 Administrator, consider that a match.
 lisp/server.el (server-ensure-safe-dir): Consider server directory
 safe on MS-Windows if its owner is the Administrators group while
 the current Emacs user is Administrator.  Use `=' to compare
 numerical UIDs, since they could be integers or floats.
2011-03-11 14:19:08 +02:00
Stefan Monnier
0d6459dfb5 Merge from trunk 2011-03-06 16:22:16 -05:00
Antoine Levitt
7e27ce9cdb Replace many instances of read-file-name with read-directory-name.
* lisp/files.el (delete-directory, copy-directory, list-directory): Use
read-directory-name.

* lisp/find-file.el (ff-find-the-other-file):
* lisp/net/ange-ftp.el (ange-ftp-make-directory):
* lisp/printing.el (pr-interactive-dir):
* lisp/progmodes/ada-prj.el (ada-prj-load-directory):
* lisp/progmodes/ebnf2ps.el (ebnf-print-directory)
(ebnf-spool-directory, ebnf-eps-directory)
(ebnf-syntax-directory):
* lisp/shell.el (shell):
* lisp/speedbar.el (speedbar-create-directory):
* lisp/vc/emerge.el (emerge-merge-directories):
* lisp/vc/vc-dir.el (vc-dir):
* lisp/vc/vc.el (vc-create-tag, vc-retrieve-tag): Likewise.

* lisp/gnus.el (gnus-interactive): Use read-directory-name.

* lisp/gnus-uu.el (gnus-uu-decode-uu-and-save)
(gnus-uu-decode-unshar-and-save, gnus-uu-decode-save)
(gnus-uu-decode-binhex, gnus-uu-decode-yenc)
(gnus-uu-decode-save-view, gnus-uu-decode-postscript-and-save):
Likewise.

* lisp/mh-funcs.el (mh-store-msg, mh-store-buffer):
* lisp/mh-mime.el (mh-mime-save-parts): Use read-directory-name.

* lisp/dired.el: Clarify comment.
2011-03-05 16:56:00 -05:00
Reuben Thomas
2de9cc1acd Handle git-style backup names in file-name-version-regexp (Bug#8159).
* files.el (file-name-version-regexp): Handle backup files of the
form `foo.js.~HEAD~1~' (Bug#8159).
2011-03-05 15:35:08 -05:00
David Engster
c5f09daf79 Make save-some-buffers message more informative (Bug#8134).
* files.el (save-some-buffers): Report the names of buffers saved
automatically due to buffer-save-without-query.
2011-03-05 14:37:46 -05:00
Eli Zaretskii
3ae59fff62 Fix bug #8177 with re-visiting image files.
files.el (find-file-noselect): Don't ask about re-visiting
 non-literally if the file is already visited in image-mode.
2011-03-05 10:48:52 +02:00