131 |
(make-temp-name |
(make-temp-name |
132 |
(expand-file-name (if (eq system-type 'ms-dos) "ar" "archive.tmp") |
(expand-file-name (if (eq system-type 'ms-dos) "ar" "archive.tmp") |
133 |
temporary-file-directory)) |
temporary-file-directory)) |
134 |
"Directory for temporary files made by arc-mode.el." |
"Directory for temporary files made by `arc-mode.el'." |
135 |
:type 'directory |
:type 'directory |
136 |
:group 'archive) |
:group 'archive) |
137 |
|
|
465 |
(intern (concat "archive-" (symbol-name archive-subtype) "-" suffix))) |
(intern (concat "archive-" (symbol-name archive-subtype) "-" suffix))) |
466 |
|
|
467 |
(defun archive-l-e (str &optional len) |
(defun archive-l-e (str &optional len) |
468 |
"Convert little endian string/vector to integer. |
"Convert little endian string/vector STR to integer. |
469 |
Alternatively, first argument may be a buffer position in the current buffer |
Alternatively, STR may be a buffer position in the current buffer |
470 |
in which case a second argument, length, should be supplied." |
in which case a second argument, length LEN, should be supplied." |
471 |
(if (stringp str) |
(if (stringp str) |
472 |
(setq len (length str)) |
(setq len (length str)) |
473 |
(setq str (buffer-substring str (+ str len)))) |
(setq str (buffer-substring str (+ str len)))) |
567 |
(format "%02d:%02d:%02d" hour minute second))) |
(format "%02d:%02d:%02d" hour minute second))) |
568 |
|
|
569 |
(defun archive-unixdate (low high) |
(defun archive-unixdate (low high) |
570 |
"Stringify unix (LOW HIGH) date." |
"Stringify Unix (LOW HIGH) date." |
571 |
(let ((str (current-time-string (cons high low)))) |
(let ((str (current-time-string (cons high low)))) |
572 |
(format "%s-%s-%s" |
(format "%s-%s-%s" |
573 |
(substring str 8 10) |
(substring str 8 10) |
575 |
(substring str 20 24)))) |
(substring str 20 24)))) |
576 |
|
|
577 |
(defun archive-unixtime (low high) |
(defun archive-unixtime (low high) |
578 |
"Stringify unix (LOW HIGH) time." |
"Stringify Unix (LOW HIGH) time." |
579 |
(let ((str (current-time-string (cons high low)))) |
(let ((str (current-time-string (cons high low)))) |
580 |
(substring str 11 19))) |
(substring str 11 19))) |
581 |
|
|
587 |
|
|
588 |
(defun archive-get-descr (&optional noerror) |
(defun archive-get-descr (&optional noerror) |
589 |
"Return the descriptor vector for file at point. |
"Return the descriptor vector for file at point. |
590 |
Does not signal an error if optional second argument NOERROR is non-nil." |
Does not signal an error if optional argument NOERROR is non-nil." |
591 |
(let ((no (archive-get-lineno))) |
(let ((no (archive-get-lineno))) |
592 |
(if (and (>= (point) archive-file-list-start) |
(if (and (>= (point) archive-file-list-start) |
593 |
(< no (length archive-files))) |
(< no (length archive-files))) |
761 |
|
|
762 |
(defun archive-alternate-display () |
(defun archive-alternate-display () |
763 |
"Toggle alternative display. |
"Toggle alternative display. |
764 |
To avoid very long lines some archive mode don't show all information. |
To avoid very long lines archive mode does not show all information. |
765 |
This function changes the set of information shown for each files." |
This function changes the set of information shown for each files." |
766 |
(interactive) |
(interactive) |
767 |
(setq archive-alternate-display (not archive-alternate-display)) |
(setq archive-alternate-display (not archive-alternate-display)) |
1159 |
"In archive mode, un-mark this member if it is marked to be deleted. |
"In archive mode, un-mark this member if it is marked to be deleted. |
1160 |
With a prefix argument, un-mark that many files forward." |
With a prefix argument, un-mark that many files forward." |
1161 |
(interactive "p") |
(interactive "p") |
1162 |
(archive-flag-deleted p ? )) |
(archive-flag-deleted p ?\s)) |
1163 |
|
|
1164 |
(defun archive-unflag-backwards (p) |
(defun archive-unflag-backwards (p) |
1165 |
"In archive mode, un-mark this member if it is marked to be deleted. |
"In archive mode, un-mark this member if it is marked to be deleted. |
1166 |
With a prefix argument, un-mark that many members backward." |
With a prefix argument, un-mark that many members backward." |
1167 |
(interactive "p") |
(interactive "p") |
1168 |
(archive-flag-deleted (- p) ? )) |
(archive-flag-deleted (- p) ?\s)) |
1169 |
|
|
1170 |
(defun archive-unmark-all-files () |
(defun archive-unmark-all-files () |
1171 |
"Remove all marks." |
"Remove all marks." |
1175 |
(save-excursion |
(save-excursion |
1176 |
(goto-char archive-file-list-start) |
(goto-char archive-file-list-start) |
1177 |
(while (< (point) archive-file-list-end) |
(while (< (point) archive-file-list-end) |
1178 |
(or (= (following-char) ? ) |
(or (= (following-char) ?\s) |
1179 |
(progn (delete-char 1) (insert ? ))) |
(progn (delete-char 1) (insert ?\s))) |
1180 |
(forward-line 1))) |
(forward-line 1))) |
1181 |
(restore-buffer-modified-p modified))) |
(restore-buffer-modified-p modified))) |
1182 |
|
|
1214 |
(defun archive-chmod-entry (new-mode) |
(defun archive-chmod-entry (new-mode) |
1215 |
"Change the protection bits associated with all marked or this member. |
"Change the protection bits associated with all marked or this member. |
1216 |
The new protection bits can either be specified as an octal number or |
The new protection bits can either be specified as an octal number or |
1217 |
as a relative change like \"g+rw\" as for chmod(2)" |
as a relative change like \"g+rw\" as for chmod(2)." |
1218 |
(interactive "sNew mode (octal or relative): ") |
(interactive "sNew mode (octal or relative): ") |
1219 |
(if archive-read-only (error "Archive is read-only")) |
(if archive-read-only (error "Archive is read-only")) |
1220 |
(let ((func (archive-name "chmod-entry"))) |
(let ((func (archive-name "chmod-entry"))) |