diff options
| author | Kenichi Handa | 2012-11-18 20:29:54 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-11-18 20:29:54 +0900 |
| commit | e1d276cbf9e18f13101328f56bed1a1c0a66e63a (patch) | |
| tree | f1fdfc9550866b9e323da072ff2eb38821996246 /lisp | |
| parent | 00dc3ead070e2e8017629f4d60d8366ac00c32cb (diff) | |
| parent | dfa8939b2827d23e02f3d7f6622e3a619ec6fd90 (diff) | |
| download | emacs-e1d276cbf9e18f13101328f56bed1a1c0a66e63a.tar.gz emacs-e1d276cbf9e18f13101328f56bed1a1c0a66e63a.zip | |
merge trunk
Diffstat (limited to 'lisp')
51 files changed, 1060 insertions, 387 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 99bfabb8115..ca65e431964 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,233 @@ | |||
| 1 | 2012-11-18 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * filecache.el (file-cache--read-list): New function. | ||
| 4 | (file-cache-add-directory-list, file-cache-add-file-list) | ||
| 5 | (file-cache-delete-file-list, file-cache-delete-directory-list): | ||
| 6 | Use it to read a list of files or directories (Bug#12846). | ||
| 7 | (file-cache-add-file, file-cache-add-directory) | ||
| 8 | (file-cache-delete-file-list, file-cache-delete-file-regexp) | ||
| 9 | (file-cache-delete-directory): Print an message. | ||
| 10 | |||
| 11 | 2012-11-18 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 12 | |||
| 13 | * calc/calc-forms.el (math-date-to-dt): Use integer date when | ||
| 14 | calling `math-date-to-julian-dt' and 'math-date-to-gregorian-dt'. | ||
| 15 | |||
| 16 | 2012-11-18 Glenn Morris <rgm@gnu.org> | ||
| 17 | |||
| 18 | * image.el (insert-image, insert-sliced-image): Doc fix. | ||
| 19 | |||
| 20 | 2012-11-18 Chong Yidong <cyd@gnu.org> | ||
| 21 | |||
| 22 | * emacs-lisp/syntax.el (syntax-propertize-function): Doc fix | ||
| 23 | (Bug#12810). | ||
| 24 | |||
| 25 | 2012-11-18 OKAZAKI Tetsurou <okazaki.tetsurou@gmail.com> (tiny change) | ||
| 26 | |||
| 27 | * vc/vc-svn.el (vc-svn-merge-news): Properly parse the merge | ||
| 28 | response when the target file is in a subdirectory (Bug#12757). | ||
| 29 | |||
| 30 | 2012-11-18 Chong Yidong <cyd@gnu.org> | ||
| 31 | |||
| 32 | * filecache.el (file-cache-add-file-list): Doc fix (Bug#12694). | ||
| 33 | |||
| 34 | 2012-11-18 Glenn Morris <rgm@gnu.org> | ||
| 35 | |||
| 36 | * emacs-lisp/cl-lib.el (face-underline-p): | ||
| 37 | Use set-face-underline rather than the alias set-face-underline-p. | ||
| 38 | |||
| 39 | * window.el (with-temp-buffer-window): Doc fix. | ||
| 40 | * subr.el (with-output-to-temp-buffer): | ||
| 41 | Add doc xref to with-temp-buffer-window. | ||
| 42 | |||
| 43 | 2012-11-18 Juanma Barranquero <lekktu@gmail.com> | ||
| 44 | |||
| 45 | * woman.el (woman-non-underline-faces): Use `set-face-underline'. | ||
| 46 | * calc/calc.el (math-format-date-cache): Declare. | ||
| 47 | |||
| 48 | 2012-11-17 Paul Eggert <eggert@cs.ucla.edu> | ||
| 49 | |||
| 50 | * calc/calc-forms.el (math-julian-date-beginning) | ||
| 51 | (math-julian-date-beginning-int): Implement [new date numbering]. | ||
| 52 | |||
| 53 | 2012-11-17 Juanma Barranquero <lekktu@gmail.com> | ||
| 54 | |||
| 55 | * descr-text.el (quail-find-key): | ||
| 56 | * dired.el (desktop-file-name): | ||
| 57 | * dirtrack.el (shell-prefixed-directory-name, shell-process-cd): | ||
| 58 | * generic-x.el (comint-mode, comint-exec): | ||
| 59 | * image-dired.el (widget-forward): | ||
| 60 | * info.el (speedbar-add-expansion-list, speedbar-center-buffer-smartly) | ||
| 61 | (speedbar-change-expand-button-char) | ||
| 62 | (speedbar-change-initial-expansion-list, speedbar-delete-subblock) | ||
| 63 | (speedbar-make-specialized-keymap, speedbar-make-tag-line): | ||
| 64 | * printing.el (easy-menu-add-item, easy-menu-remove-item) | ||
| 65 | (widget-field-action, widget-value-set): | ||
| 66 | * speedbar.el (imenu--make-index-alist): | ||
| 67 | * term.el (ring-empty-p, ring-ref, ring-insert-at-beginning) | ||
| 68 | (ring-length, ring-insert): | ||
| 69 | * vcursor.el (compare-windows-skip-whitespace): | ||
| 70 | * woman.el (dired-get-filename): | ||
| 71 | Declare functions. | ||
| 72 | |||
| 73 | * term/w32-win.el (cygwin-convert-path-from-windows): Fix declaration. | ||
| 74 | |||
| 75 | 2012-11-17 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 76 | |||
| 77 | * calc/calc.el (calc-gregorian-switch): New variable. | ||
| 78 | |||
| 79 | * calc/calc-forms.el (math-day-in-year, math-dt-before-p) | ||
| 80 | (math-absolute-from-gregorian-dt, math-absolute-from-julian-dt) | ||
| 81 | (math-date-to-julian-dt, math-date-to-gregorian-dt): New functions. | ||
| 82 | (math-leap-year-p): Add option to distinguish between Julian | ||
| 83 | and Gregorian calendars. | ||
| 84 | (math-day-number): Use `math-day-in-year' to do the computations. | ||
| 85 | (math-absolute-from-dt): Rename from `math-absolute-from-date'. | ||
| 86 | Use `math-absolute-from-gregorian' and `math-absolute-from-julian' | ||
| 87 | to do the computations. | ||
| 88 | (math-date-to-dt): Use `math-date-to-julian-dt' and | ||
| 89 | `math-date-to-gregorian-dt' to do the computations. | ||
| 90 | (calcFunc-weekday, math-format-date-part): Use the new version of | ||
| 91 | the DATE to determine the weekday. | ||
| 92 | (calcFunc-newmonth, calcFunc-newyear): Use `calc-gregorian-switch' | ||
| 93 | when necessary. | ||
| 94 | |||
| 95 | 2012-11-17 Eli Zaretskii <eliz@gnu.org> | ||
| 96 | |||
| 97 | * term/w32-win.el (w32-handle-dropped-file): Use 'file://' only on | ||
| 98 | Cygwin; otherwise use 'file:'. (Bug#12914) | ||
| 99 | (cygwin-convert-path-from-windows): Declare, to avoid | ||
| 100 | byte-compiler warnings. | ||
| 101 | |||
| 102 | 2012-11-17 Andreas Politz <politza@fh-trier.de> | ||
| 103 | |||
| 104 | * ibuffer.el (ibuffer-mark-forward, ibuffer-unmark-forward) | ||
| 105 | (ibuffer-unmark-backward, ibuffer-mark-interactive): Support plain | ||
| 106 | prefix and negative numeric prefix args (Bug#12795). | ||
| 107 | |||
| 108 | 2012-11-17 Stephen Berman <stephen.berman@gmx.net> | ||
| 109 | |||
| 110 | * play/gamegrid.el (gamegrid-add-score-with-update-game-score-1): | ||
| 111 | Don't signal an error with a score that is too low to add to the | ||
| 112 | list of top scores. (Bug#12779) | ||
| 113 | |||
| 114 | 2012-11-17 Chong Yidong <cyd@gnu.org> | ||
| 115 | |||
| 116 | * help-mode.el (help-xref-interned): End on point-min (Bug#12737). | ||
| 117 | |||
| 118 | * filecache.el (file-cache-add-file): Handle relative file name in | ||
| 119 | the argument (Bug#12694). | ||
| 120 | |||
| 121 | 2012-11-16 Jürgen Hötzel <juergen@archlinux.org> (tiny change) | ||
| 122 | |||
| 123 | * eshell/em-unix.el (eshell/mkdir): Handle "--parents" (bug#12897). | ||
| 124 | |||
| 125 | 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 126 | |||
| 127 | * emacs-lisp/advice.el (ad-make-advised-definition): Improve last fix. | ||
| 128 | |||
| 129 | * emacs-lisp/cl-lib.el: Set more meaningful version number. | ||
| 130 | |||
| 131 | 2012-11-16 Martin Rudalics <rudalics@gmx.at> | ||
| 132 | |||
| 133 | * window.el (enlarge-window, shrink-window): Don't mention return | ||
| 134 | value in doc-string (Bug#12896). | ||
| 135 | (window--display-buffer): Don't resize frames - it won't work | ||
| 136 | with all window managers and defeat pop-up-frame-alist. | ||
| 137 | (display-buffer-alist): In doc-string explain that CONDITION can | ||
| 138 | be a function and which arguments are passed to it (Bug#12854). | ||
| 139 | (display-buffer-assq-regexp): New argument ACTION. Handle lambda | ||
| 140 | expressions (Bug#12854). | ||
| 141 | (display-buffer): Pass ACTION argument to | ||
| 142 | display-buffer-assq-regexp. | ||
| 143 | |||
| 144 | 2012-11-16 Glenn Morris <rgm@gnu.org> | ||
| 145 | |||
| 146 | * window.el (fit-frame-to-buffer-bottom-margin) | ||
| 147 | (fit-frame-to-buffer, fit-window-to-buffer): Doc fixes. | ||
| 148 | |||
| 149 | * faces.el (face-underline-p): Use face-attribute-specified-or. | ||
| 150 | |||
| 151 | 2012-11-16 Juanma Barranquero <lekktu@gmail.com> | ||
| 152 | |||
| 153 | * emacs-lisp/cl-macs.el (cl-loop, cl-do, cl-do*): Doc fixes. | ||
| 154 | |||
| 155 | 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 156 | |||
| 157 | * emacs-lisp/cl-macs.el (cl-flet, cl-flet*): Fix docstring (bug#12895). | ||
| 158 | |||
| 159 | 2012-11-16 Glenn Morris <rgm@gnu.org> | ||
| 160 | |||
| 161 | * eshell/em-cmpl.el (eshell-pcomplete): New command. (Bug#12838) | ||
| 162 | (eshell-cmpl-initialize): Bind eshell-pcomplete to TAB, C-i. | ||
| 163 | |||
| 164 | * faces.el (face-underline-p): Doc fix. Handle :underline being | ||
| 165 | things other than `t' (a string, a list). | ||
| 166 | (face-inverse-video-p): Doc fix. | ||
| 167 | (set-face-underline): Rename it back from set-face-underline-p. | ||
| 168 | Doc fix. Allow interactive input of values other than t. | ||
| 169 | (read-face-attribute): Apply formatting to :underline, | ||
| 170 | since like :box and :stipple it can take list values. | ||
| 171 | |||
| 172 | * term.el (ansi-term): Don't let C-x escape-char binding | ||
| 173 | clobber the more standard C-c binding. (Bug#12842) | ||
| 174 | |||
| 175 | * subr.el (set-temporary-overlay-map): Doc fix. | ||
| 176 | |||
| 177 | 2012-11-16 Martin Rudalics <rudalics@gmx.at> | ||
| 178 | |||
| 179 | * window.el (record-window-buffer) | ||
| 180 | (display-buffer-record-window): When copying the markers to | ||
| 181 | window-point preserve window-point-insertion-type. (Bug#12588) | ||
| 182 | |||
| 183 | 2012-11-16 Glenn Morris <rgm@gnu.org> | ||
| 184 | |||
| 185 | * emacs-lisp/eieio-datadebug.el (eieio-debug-methodinvoke): | ||
| 186 | * net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): | ||
| 187 | Use new names for hooks rather than obsolete aliases. | ||
| 188 | |||
| 189 | 2012-11-15 Daniel Colascione <dancol@dancol.org> | ||
| 190 | |||
| 191 | * term/w32-win.el (w32-handle-dropped-file): Use a "file://" | ||
| 192 | prefix instead of "file:" so that when FILE-NAME begins with "//", | ||
| 193 | as it does when the target file is on a network share, url-handler | ||
| 194 | isn't confused. | ||
| 195 | |||
| 196 | 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 197 | |||
| 198 | * emacs-lisp/advice.el (ad-definition-type): Make sure we don't use | ||
| 199 | a preactivated advice from an old advice.el; they're not compatible! | ||
| 200 | |||
| 201 | 2012-11-15 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 202 | |||
| 203 | * emacs-lisp/nadvice.el (advice--make-interactive-form): | ||
| 204 | Fix string-spec case. | ||
| 205 | |||
| 206 | * emacs-lisp/advice.el (ad-make-advised-definition): Fix undefined case. | ||
| 207 | |||
| 208 | 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 209 | |||
| 210 | * emacs-lisp/nadvice.el: Add buffer-local support to add-function. | ||
| 211 | (advice--buffer-local-function-sample): New var. | ||
| 212 | (advice--set-buffer-local, advice--buffer-local): New functions. | ||
| 213 | (add-function, remove-function): Use them. | ||
| 214 | |||
| 215 | 2012-11-15 Drew Adams <drew.adams@oracle.com> | ||
| 216 | |||
| 217 | * imenu.el (imenu--split-submenus): Use imenu--subalist-p (bug#12717). | ||
| 218 | |||
| 219 | 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 220 | |||
| 221 | * emacs-lisp/cl-macs.el (cl--transform-lambda): Defend against | ||
| 222 | potential binding of print-gensym to t, and prettify (back)quotes in | ||
| 223 | case they appear in args's default values (bug#12884). | ||
| 224 | |||
| 225 | 2012-11-14 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 226 | |||
| 227 | * emacs-lisp/nadvice.el: Add around advice for interactive specs. | ||
| 228 | (advice-eval-interactive-spec): New function. | ||
| 229 | (advice--make-interactive-form): Support around advice (bug#12844). | ||
| 230 | |||
| 1 | 2012-11-14 Dmitry Gutov <dgutov@yandex.ru> | 231 | 2012-11-14 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 232 | ||
| 3 | * progmodes/ruby-mode.el (ruby-expr-beg): Make heredoc detection | 233 | * progmodes/ruby-mode.el (ruby-expr-beg): Make heredoc detection |
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index cebd4302d0c..9fc91a242d2 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el | |||
| @@ -96,7 +96,7 @@ | |||
| 96 | ;; | 96 | ;; |
| 97 | ;; archive-mode-hook | 97 | ;; archive-mode-hook |
| 98 | ;; archive-foo-mode-hook | 98 | ;; archive-foo-mode-hook |
| 99 | ;; archive-extract-hooks | 99 | ;; archive-extract-hook |
| 100 | 100 | ||
| 101 | ;;; Code: | 101 | ;;; Code: |
| 102 | 102 | ||
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index bd748158d66..709250f9ba9 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el | |||
| @@ -369,17 +369,67 @@ | |||
| 369 | 369 | ||
| 370 | ;;; Some of these functions are adapted from Edward Reingold's "calendar.el". | 370 | ;;; Some of these functions are adapted from Edward Reingold's "calendar.el". |
| 371 | ;;; These versions are rewritten to use arbitrary-size integers. | 371 | ;;; These versions are rewritten to use arbitrary-size integers. |
| 372 | ;;; The Julian calendar is used up to 9/2/1752, after which the Gregorian | ||
| 373 | ;;; calendar is used; the first day after 9/2/1752 is 9/14/1752. | ||
| 374 | 372 | ||
| 375 | ;;; A numerical date is the number of days since midnight on | 373 | ;;; A numerical date is the number of days since midnight on |
| 376 | ;;; the morning of January 1, 1 A.D. If the date is a non-integer, | 374 | ;;; the morning of December 31, 1 B.C. Emacs's calendar refers to such |
| 377 | ;;; it represents a specific date and time. | 375 | ;;; a date as an absolute date, some function names also use that |
| 376 | ;;; terminology. If the date is a non-integer, it represents a specific date and time. | ||
| 378 | ;;; A "dt" is a list of the form, (year month day), corresponding to | 377 | ;;; A "dt" is a list of the form, (year month day), corresponding to |
| 379 | ;;; an integer code, or (year month day hour minute second), corresponding | 378 | ;;; an integer code, or (year month day hour minute second), corresponding |
| 380 | ;;; to a non-integer code. | 379 | ;;; to a non-integer code. |
| 381 | 380 | ||
| 381 | (defun math-date-to-gregorian-dt (date) | ||
| 382 | "Return the day (YEAR MONTH DAY) in the Gregorian calendar. | ||
| 383 | DATE is the number of days since December 31, -1 in the Gregorian calendar." | ||
| 384 | (let* ((month 1) | ||
| 385 | day | ||
| 386 | (year (math-quotient (math-add date (if (Math-lessp date 711859) | ||
| 387 | 365 ; for speed, we take | ||
| 388 | -108)) ; >1950 as a special case | ||
| 389 | (if (math-negp date) 366 365))) | ||
| 390 | ; this result may be an overestimate | ||
| 391 | temp) | ||
| 392 | (while (Math-lessp date (setq temp (math-absolute-from-gregorian-dt year 1 1))) | ||
| 393 | (setq year (math-add year -1))) | ||
| 394 | (if (eq year 0) (setq year -1)) | ||
| 395 | (setq date (1+ (math-sub date temp))) | ||
| 396 | (setq temp | ||
| 397 | (if (math-leap-year-p year) | ||
| 398 | [1 32 61 92 122 153 183 214 245 275 306 336 999] | ||
| 399 | [1 32 60 91 121 152 182 213 244 274 305 335 999])) | ||
| 400 | (while (>= date (aref temp month)) | ||
| 401 | (setq month (1+ month))) | ||
| 402 | (setq day (1+ (- date (aref temp (1- month))))) | ||
| 403 | (list year month day))) | ||
| 404 | |||
| 405 | (defun math-date-to-julian-dt (date) | ||
| 406 | "Return the day (YEAR MONTH DAY) in the Julian calendar. | ||
| 407 | DATE is the number of days since December 31, -1 in the Gregorian calendar." | ||
| 408 | (let* ((month 1) | ||
| 409 | day | ||
| 410 | (year (math-quotient (math-add date (if (Math-lessp date 711859) | ||
| 411 | 365 ; for speed, we take | ||
| 412 | -108)) ; >1950 as a special case | ||
| 413 | (if (math-negp date) 366 365))) | ||
| 414 | ; this result may be an overestimate | ||
| 415 | temp) | ||
| 416 | (while (Math-lessp date (setq temp (math-absolute-from-julian-dt year 1 1))) | ||
| 417 | (setq year (math-add year -1))) | ||
| 418 | (if (eq year 0) (setq year -1)) | ||
| 419 | (setq date (1+ (math-sub date temp))) | ||
| 420 | (setq temp | ||
| 421 | (if (math-leap-year-p year t) | ||
| 422 | [1 32 61 92 122 153 183 214 245 275 306 336 999] | ||
| 423 | [1 32 60 91 121 152 182 213 244 274 305 335 999])) | ||
| 424 | (while (>= date (aref temp month)) | ||
| 425 | (setq month (1+ month))) | ||
| 426 | (setq day (1+ (- date (aref temp (1- month))))) | ||
| 427 | (list year month day))) | ||
| 428 | |||
| 382 | (defun math-date-to-dt (value) | 429 | (defun math-date-to-dt (value) |
| 430 | "Return the day and time of VALUE. | ||
| 431 | The integer part of VALUE is the number of days since Dec 31, -1 | ||
| 432 | in the Gregorian calendar and the remaining part determines the time." | ||
| 383 | (if (eq (car-safe value) 'date) | 433 | (if (eq (car-safe value) 'date) |
| 384 | (setq value (nth 1 value))) | 434 | (setq value (nth 1 value))) |
| 385 | (or (math-realp value) | 435 | (or (math-realp value) |
| @@ -387,32 +437,21 @@ | |||
| 387 | (let* ((parts (math-date-parts value)) | 437 | (let* ((parts (math-date-parts value)) |
| 388 | (date (car parts)) | 438 | (date (car parts)) |
| 389 | (time (nth 1 parts)) | 439 | (time (nth 1 parts)) |
| 390 | (month 1) | 440 | (dt (if (and calc-gregorian-switch |
| 391 | day | 441 | (Math-lessp value |
| 392 | (year (math-quotient (math-add date (if (Math-lessp date 711859) | 442 | (or |
| 393 | 365 ; for speed, we take | 443 | (nth 3 calc-gregorian-switch) |
| 394 | -108)) ; >1950 as a special case | 444 | (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)) |
| 395 | (if (math-negp value) 366 365))) | 445 | )) |
| 396 | ; this result may be an overestimate | 446 | (math-date-to-julian-dt date) |
| 397 | temp) | 447 | (math-date-to-gregorian-dt date)))) |
| 398 | (while (Math-lessp date (setq temp (math-absolute-from-date year 1 1))) | ||
| 399 | (setq year (math-add year -1))) | ||
| 400 | (if (eq year 0) (setq year -1)) | ||
| 401 | (setq date (1+ (math-sub date temp))) | ||
| 402 | (and (eq year 1752) (>= date 247) | ||
| 403 | (setq date (+ date 11))) | ||
| 404 | (setq temp (if (math-leap-year-p year) | ||
| 405 | [1 32 61 92 122 153 183 214 245 275 306 336 999] | ||
| 406 | [1 32 60 91 121 152 182 213 244 274 305 335 999])) | ||
| 407 | (while (>= date (aref temp month)) | ||
| 408 | (setq month (1+ month))) | ||
| 409 | (setq day (1+ (- date (aref temp (1- month))))) | ||
| 410 | (if (math-integerp value) | 448 | (if (math-integerp value) |
| 411 | (list year month day) | 449 | dt |
| 412 | (list year month day | 450 | (append dt |
| 413 | (/ time 3600) | 451 | (list |
| 414 | (% (/ time 60) 60) | 452 | (/ time 3600) |
| 415 | (math-add (% time 60) (nth 2 parts)))))) | 453 | (% (/ time 60) 60) |
| 454 | (math-add (% time 60) (nth 2 parts))))))) | ||
| 416 | 455 | ||
| 417 | (defun math-dt-to-date (dt) | 456 | (defun math-dt-to-date (dt) |
| 418 | (or (integerp (nth 1 dt)) | 457 | (or (integerp (nth 1 dt)) |
| @@ -423,7 +462,7 @@ | |||
| 423 | (math-reject-arg (nth 2 dt) 'fixnump)) | 462 | (math-reject-arg (nth 2 dt) 'fixnump)) |
| 424 | (if (or (< (nth 2 dt) 1) (> (nth 2 dt) 31)) | 463 | (if (or (< (nth 2 dt) 1) (> (nth 2 dt) 31)) |
| 425 | (math-reject-arg (nth 2 dt) "Day value is out of range")) | 464 | (math-reject-arg (nth 2 dt) "Day value is out of range")) |
| 426 | (let ((date (math-absolute-from-date (car dt) (nth 1 dt) (nth 2 dt)))) | 465 | (let ((date (math-absolute-from-dt (car dt) (nth 1 dt) (nth 2 dt)))) |
| 427 | (if (nth 3 dt) | 466 | (if (nth 3 dt) |
| 428 | (math-add (math-float date) | 467 | (math-add (math-float date) |
| 429 | (math-div (math-add (+ (* (nth 3 dt) 3600) | 468 | (math-div (math-add (+ (* (nth 3 dt) 3600) |
| @@ -446,8 +485,12 @@ | |||
| 446 | (defun math-this-year () | 485 | (defun math-this-year () |
| 447 | (nth 5 (decode-time))) | 486 | (nth 5 (decode-time))) |
| 448 | 487 | ||
| 449 | (defun math-leap-year-p (year) | 488 | (defun math-leap-year-p (year &optional julian) |
| 450 | (if (Math-lessp year 1752) | 489 | "Non-nil if YEAR is a leap year. |
| 490 | If JULIAN is non-nil, then use the criterion for leap years | ||
| 491 | in the Julian calendar, otherwise use the criterion in the | ||
| 492 | Gregorian calendar." | ||
| 493 | (if julian | ||
| 451 | (if (math-negp year) | 494 | (if (math-negp year) |
| 452 | (= (math-imod (math-neg year) 4) 1) | 495 | (= (math-imod (math-neg year) 4) 1) |
| 453 | (= (math-imod year 4) 0)) | 496 | (= (math-imod year 4) 0)) |
| @@ -460,39 +503,104 @@ | |||
| 460 | 29 | 503 | 29 |
| 461 | (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) | 504 | (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) |
| 462 | 505 | ||
| 463 | (defun math-day-number (year month day) | 506 | (defun math-day-in-year (year month day &optional julian) |
| 507 | "Return the number of days of the year up to YEAR MONTH DAY. | ||
| 508 | The count includes the given date. | ||
| 509 | If JULIAN is non-nil, use the Julian calendar, otherwise | ||
| 510 | use the Gregorian calendar." | ||
| 464 | (let ((day-of-year (+ day (* 31 (1- month))))) | 511 | (let ((day-of-year (+ day (* 31 (1- month))))) |
| 465 | (if (> month 2) | 512 | (if (> month 2) |
| 466 | (progn | 513 | (progn |
| 467 | (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) | 514 | (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) |
| 468 | (if (math-leap-year-p year) | 515 | (if (math-leap-year-p year julian) |
| 469 | (setq day-of-year (1+ day-of-year))))) | 516 | (setq day-of-year (1+ day-of-year))))) |
| 470 | (and (eq year 1752) | ||
| 471 | (or (> month 9) | ||
| 472 | (and (= month 9) (>= day 14))) | ||
| 473 | (setq day-of-year (- day-of-year 11))) | ||
| 474 | day-of-year)) | 517 | day-of-year)) |
| 475 | 518 | ||
| 476 | (defun math-absolute-from-date (year month day) | 519 | (defun math-day-number (year month day) |
| 520 | "Return the number of days of the year up to YEAR MONTH DAY. | ||
| 521 | The count includes the given date." | ||
| 522 | (if calc-gregorian-switch | ||
| 523 | (cond ((eq year (nth 0 calc-gregorian-switch)) | ||
| 524 | (1+ | ||
| 525 | (- (math-absolute-from-dt year month day) | ||
| 526 | (math-absolute-from-dt year 1 1)))) | ||
| 527 | ((Math-lessp year (nth 0 calc-gregorian-switch)) | ||
| 528 | (math-day-in-year year month day t)) | ||
| 529 | (t | ||
| 530 | (math-day-in-year year month day))) | ||
| 531 | (math-day-in-year year month day))) | ||
| 532 | |||
| 533 | (defun math-dt-before-p (dt1 dt2) | ||
| 534 | "Non-nil if DT1 occurs before DT2. | ||
| 535 | A DT is a list of the form (YEAR MONTH DAY)." | ||
| 536 | (or (Math-lessp (nth 0 dt1) (nth 0 dt2)) | ||
| 537 | (and (equal (nth 0 dt1) (nth 0 dt2)) | ||
| 538 | (or (< (nth 1 dt1) (nth 1 dt2)) | ||
| 539 | (and (= (nth 1 dt1) (nth 1 dt2)) | ||
| 540 | (< (nth 2 dt1) (nth 2 dt2))))))) | ||
| 541 | |||
| 542 | (defun math-absolute-from-gregorian-dt (year month day) | ||
| 543 | "Return the DATE of the day given by the Gregorian day YEAR MONTH DAY. | ||
| 544 | Recall that DATE is the number of days since December 31, -1 | ||
| 545 | in the Gregorian calendar." | ||
| 477 | (if (eq year 0) (setq year -1)) | 546 | (if (eq year 0) (setq year -1)) |
| 478 | (let ((yearm1 (math-sub year 1))) | 547 | (let ((yearm1 (math-sub year 1))) |
| 479 | (math-sub (math-add (math-day-number year month day) | 548 | (math-sub |
| 480 | (math-add (math-mul 365 yearm1) | 549 | ;; Add the number of days of the year and the numbers of days |
| 481 | (if (math-posp year) | 550 | ;; in the previous years (leap year days to be added separately) |
| 482 | (math-quotient yearm1 4) | 551 | (math-add (math-day-in-year year month day) |
| 483 | (math-sub 365 | 552 | (math-add (math-mul 365 yearm1) |
| 484 | (math-quotient (math-sub 3 year) | 553 | ;; Add the number of Julian leap years |
| 485 | 4))))) | 554 | (if (math-posp year) |
| 486 | (if (or (Math-lessp year 1753) | 555 | (math-quotient yearm1 4) |
| 487 | (and (eq year 1752) (<= month 9))) | 556 | (math-sub 365 |
| 488 | 1 | 557 | (math-quotient (math-sub 3 year) |
| 489 | (let ((correction (math-mul (math-quotient yearm1 100) 3))) | 558 | 4))))) |
| 490 | (let ((res (math-idivmod correction 4))) | 559 | ;; Subtract the number of Julian leap years which are not |
| 491 | (math-add (if (= (cdr res) 0) | 560 | ;; Gregorian leap years. In C=4N+r centuries, there will |
| 492 | -1 | 561 | ;; be 3N+r of these days. The following will compute |
| 493 | 0) | 562 | ;; 3N+r. |
| 494 | (car res)))))))) | 563 | (let* ((correction (math-mul (math-quotient yearm1 100) 3)) |
| 495 | 564 | (res (math-idivmod correction 4))) | |
| 565 | (math-add (if (= (cdr res) 0) | ||
| 566 | 0 | ||
| 567 | 1) | ||
| 568 | (car res)))))) | ||
| 569 | |||
| 570 | (defun math-absolute-from-julian-dt (year month day) | ||
| 571 | "Return the DATE of the day given by the Julian day YEAR MONTH DAY. | ||
| 572 | Recall that DATE is the number of days since December 31, -1 | ||
| 573 | in the Gregorian calendar." | ||
| 574 | (if (eq year 0) (setq year -1)) | ||
| 575 | (let ((yearm1 (math-sub year 1))) | ||
| 576 | (math-sub | ||
| 577 | ;; Add the number of days of the year and the numbers of days | ||
| 578 | ;; in the previous years (leap year days to be added separately) | ||
| 579 | (math-add (math-day-in-year year month day) | ||
| 580 | (math-add (math-mul 365 yearm1) | ||
| 581 | ;; Add the number of Julian leap years | ||
| 582 | (if (math-posp year) | ||
| 583 | (math-quotient yearm1 4) | ||
| 584 | (math-sub 365 | ||
| 585 | (math-quotient (math-sub 3 year) | ||
| 586 | 4))))) | ||
| 587 | ;; Adjustment, since January 1, 1 (Julian) is absolute day -1 | ||
| 588 | 2))) | ||
| 589 | |||
| 590 | ;; calc-gregorian-switch is a customizable variable defined in calc.el | ||
| 591 | (defvar calc-gregorian-switch) | ||
| 592 | |||
| 593 | |||
| 594 | (defun math-absolute-from-dt (year month day) | ||
| 595 | "Return the DATE of the day given by the day YEAR MONTH DAY. | ||
| 596 | Recall that DATE is the number of days since December 31, -1 | ||
| 597 | in the Gregorian calendar." | ||
| 598 | (if (and calc-gregorian-switch | ||
| 599 | ;; The next few lines determine if the given date | ||
| 600 | ;; occurs before the switch to the Gregorian calendar. | ||
| 601 | (math-dt-before-p (list year month day) calc-gregorian-switch)) | ||
| 602 | (math-absolute-from-julian-dt year month day) | ||
| 603 | (math-absolute-from-gregorian-dt year month day))) | ||
| 496 | 604 | ||
| 497 | ;;; It is safe to redefine these in your init file to use a different | 605 | ;;; It is safe to redefine these in your init file to use a different |
| 498 | ;;; language. | 606 | ;;; language. |
| @@ -548,13 +656,13 @@ | |||
| 548 | (setcdr math-fd-dt nil)) | 656 | (setcdr math-fd-dt nil)) |
| 549 | fmt)))) | 657 | fmt)))) |
| 550 | 658 | ||
| 551 | (defconst math-julian-date-beginning '(float 17214235 -1) | 659 | (defconst math-julian-date-beginning '(float 17214225 -1) |
| 552 | "The beginning of the Julian calendar, | 660 | "The beginning of the Julian date calendar, |
| 553 | as measured in the number of days before January 1 of the year 1AD.") | 661 | as measured in the number of days before December 31, 1 BC (Gregorian).") |
| 554 | 662 | ||
| 555 | (defconst math-julian-date-beginning-int 1721424 | 663 | (defconst math-julian-date-beginning-int 1721423 |
| 556 | "The beginning of the Julian calendar, | 664 | "The beginning of the Julian date calendar, |
| 557 | as measured in the integer number of days before January 1 of the year 1AD.") | 665 | as measured in the integer number of days before December 31, 1 BC (Gregorian).") |
| 558 | 666 | ||
| 559 | (defun math-format-date-part (x) | 667 | (defun math-format-date-part (x) |
| 560 | (cond ((stringp x) | 668 | (cond ((stringp x) |
| @@ -585,8 +693,7 @@ as measured in the integer number of days before January 1 of the year 1AD.") | |||
| 585 | math-fd-year (car math-fd-dt) | 693 | math-fd-year (car math-fd-dt) |
| 586 | math-fd-month (nth 1 math-fd-dt) | 694 | math-fd-month (nth 1 math-fd-dt) |
| 587 | math-fd-day (nth 2 math-fd-dt) | 695 | math-fd-day (nth 2 math-fd-dt) |
| 588 | math-fd-weekday (math-mod | 696 | math-fd-weekday (math-mod (math-floor math-fd-date) 7) |
| 589 | (math-add (math-floor math-fd-date) 6) 7) | ||
| 590 | math-fd-hour (nth 3 math-fd-dt) | 697 | math-fd-hour (nth 3 math-fd-dt) |
| 591 | math-fd-minute (nth 4 math-fd-dt) | 698 | math-fd-minute (nth 4 math-fd-dt) |
| 592 | math-fd-second (nth 5 math-fd-dt)) | 699 | math-fd-second (nth 5 math-fd-dt)) |
| @@ -1098,7 +1205,7 @@ as measured in the integer number of days before January 1 of the year 1AD.") | |||
| 1098 | (setq date (nth 1 date))) | 1205 | (setq date (nth 1 date))) |
| 1099 | (or (math-realp date) | 1206 | (or (math-realp date) |
| 1100 | (math-reject-arg date 'datep)) | 1207 | (math-reject-arg date 'datep)) |
| 1101 | (math-mod (math-add (math-floor date) 6) 7)) | 1208 | (math-mod (math-floor date) 7)) |
| 1102 | 1209 | ||
| 1103 | (defun calcFunc-yearday (date) | 1210 | (defun calcFunc-yearday (date) |
| 1104 | (let ((dt (math-date-to-dt date))) | 1211 | (let ((dt (math-date-to-dt date))) |
| @@ -1298,7 +1405,7 @@ second, the number of seconds offset for daylight savings." | |||
| 1298 | 0))) | 1405 | 0))) |
| 1299 | (rounded-abs-date | 1406 | (rounded-abs-date |
| 1300 | (+ | 1407 | (+ |
| 1301 | (calendar-absolute-from-gregorian | 1408 | (calendar-absolute-from-gregorian |
| 1302 | (list (nth 1 dt) (nth 2 dt) (nth 0 dt))) | 1409 | (list (nth 1 dt) (nth 2 dt) (nth 0 dt))) |
| 1303 | (/ (round (* 60 time)) 60.0 24.0)))) | 1410 | (/ (round (* 60 time)) 60.0 24.0)))) |
| 1304 | (if (dst-in-effect rounded-abs-date) | 1411 | (if (dst-in-effect rounded-abs-date) |
| @@ -1434,28 +1541,100 @@ and ends on the last Sunday of October at 2 a.m." | |||
| 1434 | (and (math-messy-integerp day) (setq day (math-trunc day))) | 1541 | (and (math-messy-integerp day) (setq day (math-trunc day))) |
| 1435 | (or (integerp day) (math-reject-arg day 'fixnump)) | 1542 | (or (integerp day) (math-reject-arg day 'fixnump)) |
| 1436 | (and (or (< day 0) (> day 31)) (math-reject-arg day 'range)) | 1543 | (and (or (< day 0) (> day 31)) (math-reject-arg day 'range)) |
| 1437 | (let ((dt (math-date-to-dt date))) | 1544 | (let* ((dt (math-date-to-dt date)) |
| 1438 | (if (or (= day 0) (> day (math-days-in-month (car dt) (nth 1 dt)))) | 1545 | (dim (math-days-in-month (car dt) (nth 1 dt))) |
| 1439 | (setq day (math-days-in-month (car dt) (nth 1 dt)))) | 1546 | (julian (if calc-gregorian-switch |
| 1440 | (and (eq (car dt) 1752) (= (nth 1 dt) 9) | 1547 | (math-date-to-dt (math-sub |
| 1441 | (if (>= day 14) (setq day (- day 11)))) | 1548 | (or (nth 3 calc-gregorian-switch) |
| 1442 | (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) | 1549 | (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)) |
| 1443 | (1- day))))) | 1550 | 1))))) |
| 1551 | (if (or (= day 0) (> day dim)) | ||
| 1552 | (setq day (1- dim)) | ||
| 1553 | (setq day (1- day))) | ||
| 1554 | ;; Adjust if this occurs near the switch to the Gregorian calendar | ||
| 1555 | (if calc-gregorian-switch | ||
| 1556 | (cond | ||
| 1557 | ((and (math-dt-before-p (list (car dt) (nth 1 dt) 1) calc-gregorian-switch) | ||
| 1558 | (math-dt-before-p julian (list (car dt) (nth 1 dt) 1))) | ||
| 1559 | ;; In this case, CALC-GREGORIAN-SWITCH is the first day of the month | ||
| 1560 | (list 'date | ||
| 1561 | (math-dt-to-date (list (car calc-gregorian-switch) | ||
| 1562 | (nth 1 calc-gregorian-switch) | ||
| 1563 | (if (> (+ (nth 2 calc-gregorian-switch) day) dim) | ||
| 1564 | dim | ||
| 1565 | (+ (nth 2 calc-gregorian-switch) day)))))) | ||
| 1566 | ((and (eq (car dt) (car calc-gregorian-switch)) | ||
| 1567 | (= (nth 1 dt) (nth 1 calc-gregorian-switch))) | ||
| 1568 | ;; In this case, the switch to the Gregorian calendar occurs in the given month | ||
| 1569 | (if (< (+ (nth 2 julian) day) (nth 2 calc-gregorian-switch)) | ||
| 1570 | ;; If the DAYth day occurs before the switch, use it | ||
| 1571 | (list 'date (math-dt-to-date (list (car dt) (nth 1 dt) (1+ day)))) | ||
| 1572 | ;; Otherwise do some computations | ||
| 1573 | (let ((tm (+ day (- (nth 2 calc-gregorian-switch) (nth 2 julian))))) | ||
| 1574 | (list 'date (math-dt-to-date | ||
| 1575 | (list (car dt) | ||
| 1576 | (nth 1 dt) | ||
| 1577 | ;; | ||
| 1578 | (if (> tm dim) dim tm))))))) | ||
| 1579 | ((and (eq (car dt) (car julian)) | ||
| 1580 | (= (nth 1 dt) (nth 1 julian))) | ||
| 1581 | ;; In this case, the current month is truncated because of the switch | ||
| 1582 | ;; to the Gregorian calendar | ||
| 1583 | (list 'date (math-dt-to-date | ||
| 1584 | (list (car dt) | ||
| 1585 | (nth 1 dt) | ||
| 1586 | (if (>= day (nth 2 julian)) | ||
| 1587 | (nth 2 julian) | ||
| 1588 | (1+ day)))))) | ||
| 1589 | (t | ||
| 1590 | ;; The default | ||
| 1591 | (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) day)))) | ||
| 1592 | (list 'date (math-add (math-dt-to-date (list (car dt) (nth 1 dt) 1)) day))))) | ||
| 1444 | 1593 | ||
| 1445 | (defun calcFunc-newyear (date &optional day) | 1594 | (defun calcFunc-newyear (date &optional day) |
| 1595 | (if (eq (car-safe date) 'date) (setq date (nth 1 date))) | ||
| 1446 | (or day (setq day 1)) | 1596 | (or day (setq day 1)) |
| 1447 | (and (math-messy-integerp day) (setq day (math-trunc day))) | 1597 | (and (math-messy-integerp day) (setq day (math-trunc day))) |
| 1448 | (or (integerp day) (math-reject-arg day 'fixnump)) | 1598 | (or (integerp day) (math-reject-arg day 'fixnump)) |
| 1449 | (let ((dt (math-date-to-dt date))) | 1599 | (let* ((dt (math-date-to-dt date)) |
| 1600 | (gregbeg (if calc-gregorian-switch | ||
| 1601 | (or (nth 3 calc-gregorian-switch) | ||
| 1602 | (apply 'math-absolute-from-gregorian-dt calc-gregorian-switch)))) | ||
| 1603 | (julianend (if calc-gregorian-switch (math-sub gregbeg 1))) | ||
| 1604 | (julian (if calc-gregorian-switch | ||
| 1605 | (math-date-to-dt julianend)))) | ||
| 1450 | (if (and (>= day 0) (<= day 366)) | 1606 | (if (and (>= day 0) (<= day 366)) |
| 1451 | (let ((max (if (eq (car dt) 1752) 355 | 1607 | (let ((max (if (math-leap-year-p (car dt)) 366 365))) |
| 1452 | (if (math-leap-year-p (car dt)) 366 365)))) | ||
| 1453 | (if (or (= day 0) (> day max)) (setq day max)) | 1608 | (if (or (= day 0) (> day max)) (setq day max)) |
| 1454 | (list 'date (math-add (math-dt-to-date (list (car dt) 1 1)) | 1609 | (if calc-gregorian-switch |
| 1455 | (1- day)))) | 1610 | ;; Now to break this down into cases |
| 1611 | (cond | ||
| 1612 | ((and (math-dt-before-p (list (car dt) 1 1) calc-gregorian-switch) | ||
| 1613 | (math-dt-before-p julian (list (car dt) 1 1))) | ||
| 1614 | ;; In this case, CALC-GREGORIAN-SWITCH is the first day of the year | ||
| 1615 | (list 'date (math-min (math-add gregbeg (1- day)) | ||
| 1616 | (math-dt-to-date (list (car calc-gregorian-switch) 12 31))))) | ||
| 1617 | ((eq (car dt) (car julian)) | ||
| 1618 | ;; In this case, the switch to the Gregorian calendar occurs in the given year | ||
| 1619 | (if (Math-lessp (car julian) (car calc-gregorian-switch)) | ||
| 1620 | ;; Here, the last Julian day is the last day of the year. | ||
| 1621 | (list 'date (math-min (math-add (math-dt-to-date (list (car dt) 1 1)) (1- day)) | ||
| 1622 | julianend)) | ||
| 1623 | ;; Otherwise, just make sure the date doesn't go past the end of the year | ||
| 1624 | (list 'date (math-min (math-add (math-dt-to-date (list (car dt) 1 1)) (1- day)) | ||
| 1625 | (math-dt-to-date (list (car dt) 12 31)))))) | ||
| 1626 | (t | ||
| 1627 | (list 'date (math-add (math-dt-to-date (list (car dt) 1 1)) | ||
| 1628 | (1- day))))) | ||
| 1629 | (list 'date (math-add (math-dt-to-date (list (car dt) 1 1)) | ||
| 1630 | (1- day))))) | ||
| 1456 | (if (and (>= day -12) (<= day -1)) | 1631 | (if (and (>= day -12) (<= day -1)) |
| 1457 | (list 'date (math-dt-to-date (list (car dt) (- day) 1))) | 1632 | (if (and calc-gregorian-switch |
| 1458 | (math-reject-arg day 'range))))) | 1633 | (math-dt-before-p (list (car dt) (- day) 1) calc-gregorian-switch) |
| 1634 | (math-dt-before-p julian (list (car dt) (- day) 1))) | ||
| 1635 | (list 'date gregbeg) | ||
| 1636 | (list 'date (math-dt-to-date (list (car dt) (- day) 1)))) | ||
| 1637 | (math-reject-arg day 'range))))) | ||
| 1459 | 1638 | ||
| 1460 | (defun calcFunc-incmonth (date &optional step) | 1639 | (defun calcFunc-incmonth (date &optional step) |
| 1461 | (or step (setq step 1)) | 1640 | (or step (setq step 1)) |
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index f1643b10a76..aeca45ebf26 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -464,6 +464,52 @@ to be identified as that note." | |||
| 464 | :type 'string | 464 | :type 'string |
| 465 | :group 'calc) | 465 | :group 'calc) |
| 466 | 466 | ||
| 467 | (defvar math-format-date-cache) ; calc-forms.el | ||
| 468 | |||
| 469 | ;; Dates that are built-in options for `calc-gregorian-switch' should be | ||
| 470 | ;; (YEAR MONTH DAY math-date-from-gregorian-dt(YEAR MONTH DAY)) for speed. | ||
| 471 | (defcustom calc-gregorian-switch nil | ||
| 472 | "The first day the Gregorian calendar is used by Calc's date forms. | ||
| 473 | This is `nil' (the default) if the Gregorian calendar is the only one used. | ||
| 474 | Otherwise, it should be a list `(YEAR MONTH DAY)' when Calc begins to use | ||
| 475 | the Gregorian calendar; Calc will use the Julian calendar for earlier dates. | ||
| 476 | The dates in which different regions of the world began to use the | ||
| 477 | Gregorian calendar vary quite a bit, even within a single country. | ||
| 478 | If you want Calc's date forms to switch between the Julian and | ||
| 479 | Gregorian calendar, you can specify the date or choose from several | ||
| 480 | common choices. Some of these choices should be taken with a grain | ||
| 481 | of salt; for example different parts of France changed calendars at | ||
| 482 | different times, and Sweden's change to the Gregorian calendar was | ||
| 483 | complicated. Also, the boundaries of the countries were different at | ||
| 484 | the times of the calendar changes than they are now. | ||
| 485 | The Vatican decided that the Gregorian calendar should take effect | ||
| 486 | on 15 October 1582 (Gregorian), and many Catholic countries made | ||
| 487 | the change then. Great Britian and its colonies had the Gregorian | ||
| 488 | calendar take effect on 14 September 1752 (Gregorian); this includes | ||
| 489 | the United States." | ||
| 490 | :group 'calc | ||
| 491 | :version "24.4" | ||
| 492 | :type '(choice (const :tag "Always use the Gregorian calendar" nil) | ||
| 493 | (const :tag "Great Britian and the US (1752 9 14)" (1752 9 14 639797)) | ||
| 494 | (const :tag "Vatican (1582 10 15)" (1582 10 15 577736)) | ||
| 495 | (const :tag "Czechoslovakia (1584 1 17)" (1584 1 17 578195)) | ||
| 496 | (const :tag "Denmark (1700 3 1)" (1700 3 1 620607)) | ||
| 497 | (const :tag "France (1582 12 20)" (1582 12 20 577802)) | ||
| 498 | (const :tag "Hungary (1587 11 1)" (1587 11 1 579579)) | ||
| 499 | (const :tag "Luxemburg (1582 12 25)" (1582 12 25 577807)) | ||
| 500 | (const :tag "Romania (1919 4 14)" (1919 4 14 700638)) | ||
| 501 | (const :tag "Russia (1918 2 14)" (1918 2 14 700214)) | ||
| 502 | (const :tag "Sweden (1753 3 1)" (1753 3 1 639965)) | ||
| 503 | (const :tag "Switzerland (Catholic) (1584 1 22)" (1584 1 22 578200)) | ||
| 504 | (const :tag "Switzerland (Protestant) (1701 1 12)" (1701 1 12 620924)) | ||
| 505 | (list :tag "(YEAR MONTH DAY)" | ||
| 506 | (integer :tag "Year") | ||
| 507 | (integer :tag "Month (integer)") | ||
| 508 | (integer :tag "Day"))) | ||
| 509 | :set (lambda (symbol value) | ||
| 510 | (set-default symbol value) | ||
| 511 | (setq math-format-date-cache nil))) | ||
| 512 | |||
| 467 | (defface calc-nonselected-face | 513 | (defface calc-nonselected-face |
| 468 | '((t :inherit shadow | 514 | '((t :inherit shadow |
| 469 | :slant italic)) | 515 | :slant italic)) |
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 755f4c8159b..a01ce4c30a3 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog | |||
| @@ -1,3 +1,24 @@ | |||
| 1 | 2012-11-16 David Engster <deng@randomsample.de> | ||
| 2 | |||
| 3 | * semantic/symref/list.el (semantic-symref-symbol): Use | ||
| 4 | `semantic-complete-read-tag-project' instead of | ||
| 5 | `semantic-complete-read-tag-buffer-deep', since the latter is not | ||
| 6 | working correctly. | ||
| 7 | |||
| 8 | * semantic/symref.el (semantic-symref-result-get-tags): Use | ||
| 9 | `find-buffer-visiting' to follow symbolic links. | ||
| 10 | |||
| 11 | * semantic/fw.el (semantic-find-file-noselect): Always set | ||
| 12 | `enable-local-variables' to `:safe' when loading files. | ||
| 13 | |||
| 14 | 2012-11-16 Glenn Morris <rgm@gnu.org> | ||
| 15 | |||
| 16 | * semantic/lex-spp.el (semantic-lex-spp-lex-text-string): | ||
| 17 | * semantic/util.el (semantic-describe-buffer): | ||
| 18 | * semantic/bovine/c.el (semantic-c-parse-lexical-token) | ||
| 19 | (semantic-default-c-setup): | ||
| 20 | Use new names for hooks rather than obsolete aliases. | ||
| 21 | |||
| 1 | 2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca> | 22 | 2012-11-13 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 23 | ||
| 3 | * semantic/mru-bookmark.el (semantic-mru-bookmark-mode): | 24 | * semantic/mru-bookmark.el (semantic-mru-bookmark-mode): |
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index 02ad6e05d1a..a3d57108d1d 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el | |||
| @@ -931,8 +931,8 @@ the regular parser." | |||
| 931 | (setq semantic-new-buffer-fcn-was-run t) | 931 | (setq semantic-new-buffer-fcn-was-run t) |
| 932 | (semantic-lex-init) | 932 | (semantic-lex-init) |
| 933 | (semantic-clear-toplevel-cache) | 933 | (semantic-clear-toplevel-cache) |
| 934 | (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook | 934 | (remove-hook 'semantic-lex-reset-functions |
| 935 | t) | 935 | 'semantic-lex-spp-reset-hook t) |
| 936 | ) | 936 | ) |
| 937 | ;; Get the macro symbol table right. | 937 | ;; Get the macro symbol table right. |
| 938 | (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms) | 938 | (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms) |
| @@ -2073,7 +2073,7 @@ actually in their parent which is not accessible.") | |||
| 2073 | ) | 2073 | ) |
| 2074 | 2074 | ||
| 2075 | (setq semantic-lex-analyzer #'semantic-c-lexer) | 2075 | (setq semantic-lex-analyzer #'semantic-c-lexer) |
| 2076 | (add-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook nil t) | 2076 | (add-hook 'semantic-lex-reset-functions 'semantic-lex-spp-reset-hook nil t) |
| 2077 | (when (eq major-mode 'c++-mode) | 2077 | (when (eq major-mode 'c++-mode) |
| 2078 | (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("__cplusplus" . ""))) | 2078 | (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("__cplusplus" . ""))) |
| 2079 | ) | 2079 | ) |
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el index 5a12047eb76..14ffc808c44 100644 --- a/lisp/cedet/semantic/fw.el +++ b/lisp/cedet/semantic/fw.el | |||
| @@ -421,14 +421,7 @@ into `mode-local-init-hook'." file filename) | |||
| 421 | ;; Don't prompt to insert a template if we visit an empty file | 421 | ;; Don't prompt to insert a template if we visit an empty file |
| 422 | (auto-insert nil) | 422 | (auto-insert nil) |
| 423 | ;; We don't want emacs to query about unsafe local variables | 423 | ;; We don't want emacs to query about unsafe local variables |
| 424 | (enable-local-variables | 424 | (enable-local-variables :safe) |
| 425 | (if (featurep 'xemacs) | ||
| 426 | ;; XEmacs only has nil as an option? | ||
| 427 | nil | ||
| 428 | ;; Emacs 23 has the spiffy :safe option, nil otherwise. | ||
| 429 | (if (>= emacs-major-version 22) | ||
| 430 | nil | ||
| 431 | :safe))) | ||
| 432 | ;; ... or eval variables | 425 | ;; ... or eval variables |
| 433 | (enable-local-eval nil) | 426 | (enable-local-eval nil) |
| 434 | ) | 427 | ) |
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el index 406f2900563..ad366c2b94f 100644 --- a/lisp/cedet/semantic/lex-spp.el +++ b/lisp/cedet/semantic/lex-spp.el | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | ;; If you use SPP in your language, be sure to specify this in your | 30 | ;; If you use SPP in your language, be sure to specify this in your |
| 31 | ;; semantic language setup function: | 31 | ;; semantic language setup function: |
| 32 | ;; | 32 | ;; |
| 33 | ;; (add-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook nil t) | 33 | ;; (add-hook 'semantic-lex-reset-functions 'semantic-lex-spp-reset-hook nil t) |
| 34 | ;; | 34 | ;; |
| 35 | ;; | 35 | ;; |
| 36 | ;; Special Lexical Tokens: | 36 | ;; Special Lexical Tokens: |
| @@ -947,8 +947,8 @@ and variable state from the current buffer." | |||
| 947 | (setq semantic-new-buffer-fcn-was-run t) | 947 | (setq semantic-new-buffer-fcn-was-run t) |
| 948 | (semantic-lex-init) | 948 | (semantic-lex-init) |
| 949 | (semantic-clear-toplevel-cache) | 949 | (semantic-clear-toplevel-cache) |
| 950 | (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook | 950 | (remove-hook 'semantic-lex-reset-functions |
| 951 | t) | 951 | 'semantic-lex-spp-reset-hook t) |
| 952 | )) | 952 | )) |
| 953 | 953 | ||
| 954 | ;; Second Cheat: copy key variables regarding macro state from the | 954 | ;; Second Cheat: copy key variables regarding macro state from the |
diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el index 540c766cc94..ad897680d7f 100644 --- a/lisp/cedet/semantic/symref.el +++ b/lisp/cedet/semantic/symref.el | |||
| @@ -356,7 +356,7 @@ already." | |||
| 356 | (lambda (hit) | 356 | (lambda (hit) |
| 357 | (let* ((line (car hit)) | 357 | (let* ((line (car hit)) |
| 358 | (file (cdr hit)) | 358 | (file (cdr hit)) |
| 359 | (buff (get-file-buffer file)) | 359 | (buff (find-buffer-visiting file)) |
| 360 | (tag nil) | 360 | (tag nil) |
| 361 | ) | 361 | ) |
| 362 | (cond | 362 | (cond |
diff --git a/lisp/cedet/semantic/symref/list.el b/lisp/cedet/semantic/symref/list.el index 55ccf1c103f..729bd8e153c 100644 --- a/lisp/cedet/semantic/symref/list.el +++ b/lisp/cedet/semantic/symref/list.el | |||
| @@ -69,7 +69,7 @@ current project to find references to the input SYM. The | |||
| 69 | references are organized by file and the name of the function | 69 | references are organized by file and the name of the function |
| 70 | they are used in. | 70 | they are used in. |
| 71 | Display the references in `semantic-symref-results-mode'." | 71 | Display the references in `semantic-symref-results-mode'." |
| 72 | (interactive (list (semantic-tag-name (semantic-complete-read-tag-buffer-deep | 72 | (interactive (list (semantic-tag-name (semantic-complete-read-tag-project |
| 73 | "Symrefs for: ")))) | 73 | "Symrefs for: ")))) |
| 74 | (semantic-fetch-tags) | 74 | (semantic-fetch-tags) |
| 75 | (let ((res nil) | 75 | (let ((res nil) |
diff --git a/lisp/cedet/semantic/util.el b/lisp/cedet/semantic/util.el index 65201c4fd12..f3d30f6af5c 100644 --- a/lisp/cedet/semantic/util.el +++ b/lisp/cedet/semantic/util.el | |||
| @@ -280,7 +280,7 @@ If TAG is not specified, use the tag at point." | |||
| 280 | semantic-parser-name | 280 | semantic-parser-name |
| 281 | semantic-parse-tree-state | 281 | semantic-parse-tree-state |
| 282 | semantic-lex-analyzer | 282 | semantic-lex-analyzer |
| 283 | semantic-lex-reset-hooks | 283 | semantic-lex-reset-functions |
| 284 | semantic-lex-syntax-modifications | 284 | semantic-lex-syntax-modifications |
| 285 | ))) | 285 | ))) |
| 286 | (dolist (V vars) | 286 | (dolist (V vars) |
diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 0c7f82d516e..c384b96df86 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el | |||
| @@ -374,6 +374,8 @@ This function is semi-obsolete. Use `get-char-code-property'." | |||
| 374 | (format "%c:%s" x doc))) | 374 | (format "%c:%s" x doc))) |
| 375 | mnemonics ", "))))) | 375 | mnemonics ", "))))) |
| 376 | 376 | ||
| 377 | (declare-function quail-find-key "quail" (char)) | ||
| 378 | |||
| 377 | ;;;###autoload | 379 | ;;;###autoload |
| 378 | (defun describe-char (pos &optional buffer) | 380 | (defun describe-char (pos &optional buffer) |
| 379 | "Describe position POS (interactively, point) and the char after POS. | 381 | "Describe position POS (interactively, point) and the char after POS. |
diff --git a/lisp/dired.el b/lisp/dired.el index 5f7ee48a810..f6056e20d0a 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -3732,6 +3732,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." | |||
| 3732 | ;;;; Desktop support | 3732 | ;;;; Desktop support |
| 3733 | 3733 | ||
| 3734 | (eval-when-compile (require 'desktop)) | 3734 | (eval-when-compile (require 'desktop)) |
| 3735 | (declare-function desktop-file-name "desktop" (filename dirname)) | ||
| 3735 | 3736 | ||
| 3736 | (defun dired-desktop-buffer-misc-data (dirname) | 3737 | (defun dired-desktop-buffer-misc-data (dirname) |
| 3737 | "Auxiliary information to be saved in desktop file." | 3738 | "Auxiliary information to be saved in desktop file." |
diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el index 5e825032741..a66fc23dec1 100644 --- a/lisp/dirtrack.el +++ b/lisp/dirtrack.el | |||
| @@ -220,6 +220,9 @@ the mode if ARG is omitted or nil." | |||
| 220 | (goto-char (point-max)) | 220 | (goto-char (point-max)) |
| 221 | (insert msg1 msg2 "\n")))) | 221 | (insert msg1 msg2 "\n")))) |
| 222 | 222 | ||
| 223 | (declare-function shell-prefixed-directory-name "shell" (dir)) | ||
| 224 | (declare-function shell-process-cd "shell" (arg)) | ||
| 225 | |||
| 223 | ;;;###autoload | 226 | ;;;###autoload |
| 224 | (defun dirtrack (input) | 227 | (defun dirtrack (input) |
| 225 | "Determine the current directory from the process output for a prompt. | 228 | "Determine the current directory from the process output for a prompt. |
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index f9b4491e6e0..c2ebb3bbdc6 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el | |||
| @@ -2239,16 +2239,15 @@ definition (see the code for `documentation')." | |||
| 2239 | 2239 | ||
| 2240 | (defun ad-definition-type (definition) | 2240 | (defun ad-definition-type (definition) |
| 2241 | "Return symbol that describes the type of DEFINITION." | 2241 | "Return symbol that describes the type of DEFINITION." |
| 2242 | ;; These symbols are only ever used to check a cache entry's validity. | ||
| 2243 | ;; The suffix `2' reflects the fact that we're using version 2 of advice | ||
| 2244 | ;; representations, so cache entries preactivated with version | ||
| 2245 | ;; 1 can't be used. | ||
| 2242 | (cond | 2246 | (cond |
| 2243 | ((ad-macro-p definition) 'macro) | 2247 | ((ad-macro-p definition) 'macro2) |
| 2244 | ((ad-subr-p definition) | 2248 | ((ad-subr-p definition) 'subr2) |
| 2245 | (if (special-form-p definition) | 2249 | ((or (ad-lambda-p definition) (ad-compiled-p definition)) 'fun2) |
| 2246 | 'special-form | 2250 | ((ad-advice-p definition) 'advice2))) ;; FIXME: Can this ever happen? |
| 2247 | 'subr)) | ||
| 2248 | ((or (ad-lambda-p definition) | ||
| 2249 | (ad-compiled-p definition)) | ||
| 2250 | 'function) | ||
| 2251 | ((ad-advice-p definition) 'advice))) | ||
| 2252 | 2251 | ||
| 2253 | (defun ad-has-proper-definition (function) | 2252 | (defun ad-has-proper-definition (function) |
| 2254 | "True if FUNCTION is a symbol with a proper definition. | 2253 | "True if FUNCTION is a symbol with a proper definition. |
| @@ -2597,7 +2596,9 @@ in any of these classes." | |||
| 2597 | (ad-has-redefining-advice function)) | 2596 | (ad-has-redefining-advice function)) |
| 2598 | (let* ((origdef (ad-real-orig-definition function)) | 2597 | (let* ((origdef (ad-real-orig-definition function)) |
| 2599 | ;; Construct the individual pieces that we need for assembly: | 2598 | ;; Construct the individual pieces that we need for assembly: |
| 2600 | (orig-arglist (ad-arglist origdef)) | 2599 | (orig-arglist (let ((args (ad-arglist origdef))) |
| 2600 | ;; The arglist may still be unknown. | ||
| 2601 | (if (listp args) args '(&rest args)))) | ||
| 2601 | (advised-arglist (or (ad-advised-arglist function) | 2602 | (advised-arglist (or (ad-advised-arglist function) |
| 2602 | orig-arglist)) | 2603 | orig-arglist)) |
| 2603 | (interactive-form (ad-advised-interactive-form function)) | 2604 | (interactive-form (ad-advised-interactive-form function)) |
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index ffa42e97221..1cbed17cbab 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -124,7 +124,7 @@ | |||
| 124 | ;; Adding your own checks: | 124 | ;; Adding your own checks: |
| 125 | ;; | 125 | ;; |
| 126 | ;; You can experiment with adding your own checks by setting the | 126 | ;; You can experiment with adding your own checks by setting the |
| 127 | ;; hooks `checkdoc-style-functions' and `checkdoc-comment-style-hooks'. | 127 | ;; hooks `checkdoc-style-functions' and `checkdoc-comment-style-functions'. |
| 128 | ;; Return a string which is the error you wish to report. The cursor | 128 | ;; Return a string which is the error you wish to report. The cursor |
| 129 | ;; position should be preserved. | 129 | ;; position should be preserved. |
| 130 | ;; | 130 | ;; |
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index a9be08b1383..d5e5f4bbfbc 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1993, 2001-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Dave Gillespie <daveg@synaptics.com> | 5 | ;; Author: Dave Gillespie <daveg@synaptics.com> |
| 6 | ;; Version: 2.02 | 6 | ;; Version: 1.0 |
| 7 | ;; Keywords: extensions | 7 | ;; Keywords: extensions |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| @@ -661,7 +661,7 @@ If ALIST is non-nil, the new pairs are prepended to it." | |||
| 661 | (gv-define-setter face-foreground (x f &optional s) | 661 | (gv-define-setter face-foreground (x f &optional s) |
| 662 | `(set-face-foreground ,f ,x ,s)) | 662 | `(set-face-foreground ,f ,x ,s)) |
| 663 | (gv-define-setter face-underline-p (x f &optional s) | 663 | (gv-define-setter face-underline-p (x f &optional s) |
| 664 | `(set-face-underline-p ,f ,x ,s)) | 664 | `(set-face-underline ,f ,x ,s)) |
| 665 | (gv-define-simple-setter file-modes set-file-modes t) | 665 | (gv-define-simple-setter file-modes set-file-modes t) |
| 666 | (gv-define-simple-setter frame-height set-screen-height t) | 666 | (gv-define-simple-setter frame-height set-screen-height t) |
| 667 | (gv-define-simple-setter frame-parameters modify-frame-parameters t) | 667 | (gv-define-simple-setter frame-parameters modify-frame-parameters t) |
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index eb58d17c02e..69882e36f22 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'. | |||
| 267 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when | 267 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when |
| 268 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp | 268 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp |
| 269 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) | 269 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) |
| 270 | ;;;;;; "cl-macs" "cl-macs.el" "c7ad09a74a1d2969406e7e2aaf3812fc") | 270 | ;;;;;; "cl-macs" "cl-macs.el" "a7d9b56ea588b869813de8ed7ec1fbcd") |
| 271 | ;;; Generated autoloads from cl-macs.el | 271 | ;;; Generated autoloads from cl-macs.el |
| 272 | 272 | ||
| 273 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ | 273 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ |
| @@ -416,7 +416,7 @@ This is compatible with Common Lisp, but note that `defun' and | |||
| 416 | (put 'cl-return-from 'lisp-indent-function '1) | 416 | (put 'cl-return-from 'lisp-indent-function '1) |
| 417 | 417 | ||
| 418 | (autoload 'cl-loop "cl-macs" "\ | 418 | (autoload 'cl-loop "cl-macs" "\ |
| 419 | The Common Lisp `cl-loop' macro. | 419 | The Common Lisp `loop' macro. |
| 420 | Valid clauses are: | 420 | Valid clauses are: |
| 421 | for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM, | 421 | for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM, |
| 422 | for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR, | 422 | for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR, |
| @@ -432,14 +432,14 @@ Valid clauses are: | |||
| 432 | \(fn CLAUSE...)" nil t) | 432 | \(fn CLAUSE...)" nil t) |
| 433 | 433 | ||
| 434 | (autoload 'cl-do "cl-macs" "\ | 434 | (autoload 'cl-do "cl-macs" "\ |
| 435 | The Common Lisp `cl-do' loop. | 435 | The Common Lisp `do' loop. |
| 436 | 436 | ||
| 437 | \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil t) | 437 | \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil t) |
| 438 | 438 | ||
| 439 | (put 'cl-do 'lisp-indent-function '2) | 439 | (put 'cl-do 'lisp-indent-function '2) |
| 440 | 440 | ||
| 441 | (autoload 'cl-do* "cl-macs" "\ | 441 | (autoload 'cl-do* "cl-macs" "\ |
| 442 | The Common Lisp `cl-do*' loop. | 442 | The Common Lisp `do*' loop. |
| 443 | 443 | ||
| 444 | \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil t) | 444 | \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil t) |
| 445 | 445 | ||
| @@ -501,7 +501,7 @@ a `let' form, except that the list of symbols can be computed at run-time. | |||
| 501 | (put 'cl-progv 'lisp-indent-function '2) | 501 | (put 'cl-progv 'lisp-indent-function '2) |
| 502 | 502 | ||
| 503 | (autoload 'cl-flet "cl-macs" "\ | 503 | (autoload 'cl-flet "cl-macs" "\ |
| 504 | Make temporary function definitions. | 504 | Make local function definitions. |
| 505 | Like `cl-labels' but the definitions are not recursive. | 505 | Like `cl-labels' but the definitions are not recursive. |
| 506 | 506 | ||
| 507 | \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) | 507 | \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) |
| @@ -509,7 +509,7 @@ Like `cl-labels' but the definitions are not recursive. | |||
| 509 | (put 'cl-flet 'lisp-indent-function '1) | 509 | (put 'cl-flet 'lisp-indent-function '1) |
| 510 | 510 | ||
| 511 | (autoload 'cl-flet* "cl-macs" "\ | 511 | (autoload 'cl-flet* "cl-macs" "\ |
| 512 | Make temporary function definitions. | 512 | Make local function definitions. |
| 513 | Like `cl-flet' but the definitions can refer to previous ones. | 513 | Like `cl-flet' but the definitions can refer to previous ones. |
| 514 | 514 | ||
| 515 | \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) | 515 | \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 3c46c40242d..918e992512c 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -260,9 +260,11 @@ The name is made by appending a number to PREFIX, default \"G\"." | |||
| 260 | (require 'help-fns) | 260 | (require 'help-fns) |
| 261 | (cons (help-add-fundoc-usage | 261 | (cons (help-add-fundoc-usage |
| 262 | (if (stringp (car hdr)) (pop hdr)) | 262 | (if (stringp (car hdr)) (pop hdr)) |
| 263 | (format "%S" | 263 | ;; Be careful with make-symbol and (back)quote, |
| 264 | (cons 'fn | 264 | ;; see bug#12884. |
| 265 | (cl--make-usage-args orig-args)))) | 265 | (let ((print-gensym nil) (print-quoted t)) |
| 266 | (format "%S" (cons 'fn (cl--make-usage-args | ||
| 267 | orig-args))))) | ||
| 266 | hdr))) | 268 | hdr))) |
| 267 | (list `(let* ,cl--bind-lets | 269 | (list `(let* ,cl--bind-lets |
| 268 | ,@(nreverse cl--bind-forms) | 270 | ,@(nreverse cl--bind-forms) |
| @@ -756,7 +758,7 @@ This is compatible with Common Lisp, but note that `defun' and | |||
| 756 | 758 | ||
| 757 | ;;;###autoload | 759 | ;;;###autoload |
| 758 | (defmacro cl-loop (&rest loop-args) | 760 | (defmacro cl-loop (&rest loop-args) |
| 759 | "The Common Lisp `cl-loop' macro. | 761 | "The Common Lisp `loop' macro. |
| 760 | Valid clauses are: | 762 | Valid clauses are: |
| 761 | for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM, | 763 | for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM, |
| 762 | for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR, | 764 | for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR, |
| @@ -1501,7 +1503,7 @@ such that COMBO is equivalent to (and . CLAUSES)." | |||
| 1501 | 1503 | ||
| 1502 | ;;;###autoload | 1504 | ;;;###autoload |
| 1503 | (defmacro cl-do (steps endtest &rest body) | 1505 | (defmacro cl-do (steps endtest &rest body) |
| 1504 | "The Common Lisp `cl-do' loop. | 1506 | "The Common Lisp `do' loop. |
| 1505 | 1507 | ||
| 1506 | \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" | 1508 | \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" |
| 1507 | (declare (indent 2) | 1509 | (declare (indent 2) |
| @@ -1513,7 +1515,7 @@ such that COMBO is equivalent to (and . CLAUSES)." | |||
| 1513 | 1515 | ||
| 1514 | ;;;###autoload | 1516 | ;;;###autoload |
| 1515 | (defmacro cl-do* (steps endtest &rest body) | 1517 | (defmacro cl-do* (steps endtest &rest body) |
| 1516 | "The Common Lisp `cl-do*' loop. | 1518 | "The Common Lisp `do*' loop. |
| 1517 | 1519 | ||
| 1518 | \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" | 1520 | \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" |
| 1519 | (declare (indent 2) (debug cl-do)) | 1521 | (declare (indent 2) (debug cl-do)) |
| @@ -1648,7 +1650,7 @@ a `let' form, except that the list of symbols can be computed at run-time." | |||
| 1648 | 1650 | ||
| 1649 | ;;;###autoload | 1651 | ;;;###autoload |
| 1650 | (defmacro cl-flet (bindings &rest body) | 1652 | (defmacro cl-flet (bindings &rest body) |
| 1651 | "Make temporary function definitions. | 1653 | "Make local function definitions. |
| 1652 | Like `cl-labels' but the definitions are not recursive. | 1654 | Like `cl-labels' but the definitions are not recursive. |
| 1653 | 1655 | ||
| 1654 | \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" | 1656 | \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" |
| @@ -1672,7 +1674,7 @@ Like `cl-labels' but the definitions are not recursive. | |||
| 1672 | 1674 | ||
| 1673 | ;;;###autoload | 1675 | ;;;###autoload |
| 1674 | (defmacro cl-flet* (bindings &rest body) | 1676 | (defmacro cl-flet* (bindings &rest body) |
| 1675 | "Make temporary function definitions. | 1677 | "Make local function definitions. |
| 1676 | Like `cl-flet' but the definitions can refer to previous ones. | 1678 | Like `cl-flet' but the definitions can refer to previous ones. |
| 1677 | 1679 | ||
| 1678 | \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" | 1680 | \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" |
diff --git a/lisp/emacs-lisp/eieio-datadebug.el b/lisp/emacs-lisp/eieio-datadebug.el index ec470d21bf3..a1db1972b83 100644 --- a/lisp/emacs-lisp/eieio-datadebug.el +++ b/lisp/emacs-lisp/eieio-datadebug.el | |||
| @@ -131,7 +131,7 @@ PREBUTTONTEXT is some text between PREFIX and the object button." | |||
| 131 | (defun eieio-debug-methodinvoke (method class) | 131 | (defun eieio-debug-methodinvoke (method class) |
| 132 | "Show the method invocation order for METHOD with CLASS object." | 132 | "Show the method invocation order for METHOD with CLASS object." |
| 133 | (interactive "aMethod: \nXClass Expression: ") | 133 | (interactive "aMethod: \nXClass Expression: ") |
| 134 | (let* ((eieio-pre-method-execution-hooks | 134 | (let* ((eieio-pre-method-execution-functions |
| 135 | (lambda (l) (throw 'moose l) )) | 135 | (lambda (l) (throw 'moose l) )) |
| 136 | (data | 136 | (data |
| 137 | (catch 'moose (eieio-generic-call | 137 | (catch 'moose (eieio-generic-call |
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index ff30d9e7fa4..540e0166ec2 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el | |||
| @@ -109,18 +109,33 @@ Each element has the form (WHERE BYTECODE STACK) where: | |||
| 109 | (propertize "Advised function" | 109 | (propertize "Advised function" |
| 110 | 'dynamic-docstring-function #'advice--make-docstring)) ;; ) | 110 | 'dynamic-docstring-function #'advice--make-docstring)) ;; ) |
| 111 | 111 | ||
| 112 | (defun advice-eval-interactive-spec (spec) | ||
| 113 | "Evaluate the interactive spec SPEC." | ||
| 114 | (cond | ||
| 115 | ((stringp spec) | ||
| 116 | ;; There's no direct access to the C code (in call-interactively) that | ||
| 117 | ;; processes those specs, but that shouldn't stop us, should it? | ||
| 118 | ;; FIXME: Despite appearances, this is not faithful: SPEC and | ||
| 119 | ;; (advice-eval-interactive-spec SPEC) will behave subtly differently w.r.t | ||
| 120 | ;; command-history (and maybe a few other details). | ||
| 121 | (call-interactively `(lambda (&rest args) (interactive ,spec) args))) | ||
| 122 | ;; ((functionp spec) (funcall spec)) | ||
| 123 | (t (eval spec)))) | ||
| 124 | |||
| 112 | (defun advice--make-interactive-form (function main) | 125 | (defun advice--make-interactive-form (function main) |
| 113 | ;; TODO: Make it possible to do around-like advising on the | ||
| 114 | ;; interactive forms (bug#12844). | ||
| 115 | ;; TODO: make it so that interactive spec can be a constant which | 126 | ;; TODO: make it so that interactive spec can be a constant which |
| 116 | ;; dynamically checks the advice--car/cdr to do its job. | 127 | ;; dynamically checks the advice--car/cdr to do its job. |
| 117 | ;; TODO: Implement interactive-read-args: | 128 | ;; For that, advice-eval-interactive-spec needs to be more faithful. |
| 118 | ;;(when (or (commandp function) (commandp main)) | 129 | ;; FIXME: The calls to interactive-form below load autoloaded functions |
| 119 | ;; `(interactive-read-args | 130 | ;; too eagerly. |
| 120 | ;; (cadr (or (interactive-form function) (interactive-form main))))) | 131 | (let ((fspec (cadr (interactive-form function)))) |
| 121 | ;; FIXME: This loads autoloaded functions too eagerly. | 132 | (when (eq 'function (car-safe fspec)) ;; Macroexpanded lambda? |
| 133 | (setq fspec (nth 1 fspec))) | ||
| 134 | (if (functionp fspec) | ||
| 135 | `(funcall ',fspec | ||
| 136 | ',(cadr (interactive-form main))) | ||
| 122 | (cadr (or (interactive-form function) | 137 | (cadr (or (interactive-form function) |
| 123 | (interactive-form main)))) | 138 | (interactive-form main)))))) |
| 124 | 139 | ||
| 125 | (defsubst advice--make-1 (byte-code stack-depth function main props) | 140 | (defsubst advice--make-1 (byte-code stack-depth function main props) |
| 126 | "Build a function value that adds FUNCTION to MAIN." | 141 | "Build a function value that adds FUNCTION to MAIN." |
| @@ -167,17 +182,31 @@ WHERE is a symbol to select an entry in `advice--where-alist'." | |||
| 167 | (advice--make-1 (aref flist 1) (aref flist 3) | 182 | (advice--make-1 (aref flist 1) (aref flist 3) |
| 168 | first nrest props))))))) | 183 | first nrest props))))))) |
| 169 | 184 | ||
| 185 | (defvar advice--buffer-local-function-sample nil) | ||
| 186 | |||
| 187 | (defun advice--set-buffer-local (var val) | ||
| 188 | (if (function-equal val advice--buffer-local-function-sample) | ||
| 189 | (kill-local-variable var) | ||
| 190 | (set (make-local-variable var) val))) | ||
| 191 | |||
| 192 | ;;;###autoload | ||
| 193 | (defun advice--buffer-local (var) | ||
| 194 | "Buffer-local value of VAR, presumed to contain a function." | ||
| 195 | (declare (gv-setter advice--set-buffer-local)) | ||
| 196 | (if (local-variable-p var) (symbol-value var) | ||
| 197 | (setq advice--buffer-local-function-sample | ||
| 198 | (lambda (&rest args) (apply (default-value var) args))))) | ||
| 199 | |||
| 170 | ;;;###autoload | 200 | ;;;###autoload |
| 171 | (defmacro add-function (where place function &optional props) | 201 | (defmacro add-function (where place function &optional props) |
| 172 | ;; TODO: | 202 | ;; TODO: |
| 173 | ;; - provide something like `around' for interactive forms. | ||
| 174 | ;; - provide some kind of buffer-local functionality at least when `place' | ||
| 175 | ;; is a variable. | ||
| 176 | ;; - obsolete with-wrapper-hook (mostly requires buffer-local support). | 203 | ;; - obsolete with-wrapper-hook (mostly requires buffer-local support). |
| 177 | ;; - provide some kind of control over ordering. E.g. debug-on-entry, ELP | 204 | ;; - provide some kind of control over ordering. E.g. debug-on-entry, ELP |
| 178 | ;; and tracing want to stay first. | 205 | ;; and tracing want to stay first. |
| 179 | ;; - maybe also let `where' specify some kind of predicate and use it | 206 | ;; - maybe let `where' specify some kind of predicate and use it |
| 180 | ;; to implement things like mode-local or eieio-defmethod. | 207 | ;; to implement things like mode-local or eieio-defmethod. |
| 208 | ;; Of course, that only makes sense if the predicates of all advices can | ||
| 209 | ;; be combined and made more efficient. | ||
| 181 | ;; :before is like a normal add-hook on a normal hook. | 210 | ;; :before is like a normal add-hook on a normal hook. |
| 182 | ;; :before-while is like add-hook on run-hook-with-args-until-failure. | 211 | ;; :before-while is like add-hook on run-hook-with-args-until-failure. |
| 183 | ;; :before-until is like add-hook on run-hook-with-args-until-success. | 212 | ;; :before-until is like add-hook on run-hook-with-args-until-success. |
| @@ -197,8 +226,24 @@ call OLDFUN here: | |||
| 197 | If FUNCTION was already added, do nothing. | 226 | If FUNCTION was already added, do nothing. |
| 198 | PROPS is an alist of additional properties, among which the following have | 227 | PROPS is an alist of additional properties, among which the following have |
| 199 | a special meaning: | 228 | a special meaning: |
| 200 | - `name': a string or symbol. It can be used to refer to this piece of advice." | 229 | - `name': a string or symbol. It can be used to refer to this piece of advice. |
| 230 | |||
| 231 | PLACE cannot be a simple variable. Instead it should either be | ||
| 232 | \(default-value 'VAR) or (local 'VAR) depending on whether FUNCTION | ||
| 233 | should be applied to VAR buffer-locally or globally. | ||
| 234 | |||
| 235 | If one of FUNCTION or OLDFUN is interactive, then the resulting function | ||
| 236 | is also interactive. There are 3 cases: | ||
| 237 | - FUNCTION is not interactive: the interactive spec of OLDFUN is used. | ||
| 238 | - The interactive spec of FUNCTION is itself a function: it should take one | ||
| 239 | argument (the interactive spec of OLDFUN, which it can pass to | ||
| 240 | `advice-eval-interactive-spec') and return the list of arguments to use. | ||
| 241 | - Else, use the interactive spec of FUNCTION and ignore the one of OLDFUN." | ||
| 201 | (declare (debug t)) ;;(indent 2) | 242 | (declare (debug t)) ;;(indent 2) |
| 243 | (cond ((eq 'local (car-safe place)) | ||
| 244 | (setq place `(advice--buffer-local ,@(cdr place)))) | ||
| 245 | ((symbolp place) | ||
| 246 | (error "Use (default-value '%S) or (local '%S)" place place))) | ||
| 202 | `(advice--add-function ,where (gv-ref ,place) ,function ,props)) | 247 | `(advice--add-function ,where (gv-ref ,place) ,function ,props)) |
| 203 | 248 | ||
| 204 | ;;;###autoload | 249 | ;;;###autoload |
| @@ -213,6 +258,10 @@ If FUNCTION was not added to PLACE, do nothing. | |||
| 213 | Instead of FUNCTION being the actual function, it can also be the `name' | 258 | Instead of FUNCTION being the actual function, it can also be the `name' |
| 214 | of the piece of advice." | 259 | of the piece of advice." |
| 215 | (declare (debug t)) | 260 | (declare (debug t)) |
| 261 | (cond ((eq 'local (car-safe place)) | ||
| 262 | (setq place `(advice--buffer-local ,@(cdr place)))) | ||
| 263 | ((symbolp place) | ||
| 264 | (error "Use (default-value '%S) or (local '%S)" place place))) | ||
| 216 | (gv-letplace (getter setter) place | 265 | (gv-letplace (getter setter) place |
| 217 | (macroexp-let2 nil new `(advice--remove-function ,getter ,function) | 266 | (macroexp-let2 nil new `(advice--remove-function ,getter ,function) |
| 218 | `(unless (eq ,new ,getter) ,(funcall setter new))))) | 267 | `(unless (eq ,new ,getter) ,(funcall setter new))))) |
| @@ -285,28 +334,21 @@ is defined as a macro, alias, command, ..." | |||
| 285 | ;; - change all defadvice in lisp/**/*.el. | 334 | ;; - change all defadvice in lisp/**/*.el. |
| 286 | ;; - rewrite advice.el on top of this. | 335 | ;; - rewrite advice.el on top of this. |
| 287 | ;; - obsolete advice.el. | 336 | ;; - obsolete advice.el. |
| 288 | ;; To make advice.el and nadvice.el interoperate properly I see 2 different | ||
| 289 | ;; ways: | ||
| 290 | ;; - keep them separate: complete the defalias-fset-function setter with | ||
| 291 | ;; a matching accessor which both nadvice.el and advice.el will have to use | ||
| 292 | ;; in place of symbol-function. This can probably be made to work, but | ||
| 293 | ;; they have to agree on a "protocol". | ||
| 294 | ;; - layer advice.el on top of nadvice.el. I prefer this approach. the | ||
| 295 | ;; simplest way is to make advice.el build one ad-Advice-foo function for | ||
| 296 | ;; each advised function which is advice-added/removed whenever ad-activate | ||
| 297 | ;; ad-deactivate is called. | ||
| 298 | (let* ((f (and (fboundp symbol) (symbol-function symbol))) | 337 | (let* ((f (and (fboundp symbol) (symbol-function symbol))) |
| 299 | (nf (advice--normalize symbol f))) | 338 | (nf (advice--normalize symbol f))) |
| 300 | (unless (eq f nf) ;; Most importantly, if nf == nil! | 339 | (unless (eq f nf) ;; Most importantly, if nf == nil! |
| 301 | (fset symbol nf)) | 340 | (fset symbol nf)) |
| 302 | (add-function where (cond | 341 | (add-function where (cond |
| 303 | ((eq (car-safe nf) 'macro) (cdr nf)) | 342 | ((eq (car-safe nf) 'macro) (cdr nf)) |
| 304 | ;; If the function is not yet defined, we can't yet | 343 | ;; Reasons to delay installation of the advice: |
| 305 | ;; install the advice. | 344 | ;; - If the function is not yet defined, installing |
| 306 | ;; FIXME: If it's an autoloaded command, we also | 345 | ;; the advice would affect `fboundp'ness. |
| 307 | ;; have a problem because we need to load the | 346 | ;; - If it's an autoloaded command, |
| 308 | ;; command to build the interactive-form. | 347 | ;; advice--make-interactive-form would end up |
| 309 | ((or (not nf) (and (autoloadp nf))) ;; (commandp nf) | 348 | ;; loading the command eagerly. |
| 349 | ;; - `autoload' does nothing if the function is | ||
| 350 | ;; not an autoload or undefined. | ||
| 351 | ((or (not nf) (autoloadp nf)) | ||
| 310 | (get symbol 'advice--pending)) | 352 | (get symbol 'advice--pending)) |
| 311 | (t (symbol-function symbol))) | 353 | (t (symbol-function symbol))) |
| 312 | function props) | 354 | function props) |
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index c3d78b3444b..592cb1b0174 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el | |||
| @@ -55,12 +55,18 @@ | |||
| 55 | ;; have to flush that cache between each function, and we couldn't use | 55 | ;; have to flush that cache between each function, and we couldn't use |
| 56 | ;; syntax-ppss-flush-cache since that would not only flush the cache but also | 56 | ;; syntax-ppss-flush-cache since that would not only flush the cache but also |
| 57 | ;; reset syntax-propertize--done which should not be done in this case). | 57 | ;; reset syntax-propertize--done which should not be done in this case). |
| 58 | "Mode-specific function to apply the syntax-table properties. | 58 | "Mode-specific function to apply `syntax-table' text properties. |
| 59 | Called with two arguments: START and END. | 59 | The value of this variable is a function to be called by Font |
| 60 | This function can call `syntax-ppss' on any position before END, but it | 60 | Lock mode, prior to performing syntactic fontification on a |
| 61 | should not call `syntax-ppss-flush-cache', which means that it should not | 61 | stretch of text. It is given two arguments, START and END: the |
| 62 | call `syntax-ppss' on some position and later modify the buffer on some | 62 | start and end of the text to be fontified. Major modes can |
| 63 | earlier position.") | 63 | specify a custom function to apply `syntax-table' properties to |
| 64 | override the default syntax table in special cases. | ||
| 65 | |||
| 66 | The specified function may call `syntax-ppss' on any position | ||
| 67 | before END, but it should not call `syntax-ppss-flush-cache', | ||
| 68 | which means that it should not call `syntax-ppss' on some | ||
| 69 | position and later modify the buffer on some earlier position.") | ||
| 64 | 70 | ||
| 65 | (defvar syntax-propertize-chunk-size 500) | 71 | (defvar syntax-propertize-chunk-size 500) |
| 66 | 72 | ||
| @@ -118,7 +124,7 @@ The arg RULES can be of the same form as in `syntax-propertize-rules'. | |||
| 118 | The return value is an object that can be passed as a rule to | 124 | The return value is an object that can be passed as a rule to |
| 119 | `syntax-propertize-rules'. | 125 | `syntax-propertize-rules'. |
| 120 | I.e. this is useful only when you want to share rules among several | 126 | I.e. this is useful only when you want to share rules among several |
| 121 | syntax-propertize-functions." | 127 | `syntax-propertize-function's." |
| 122 | (declare (debug syntax-propertize-rules)) | 128 | (declare (debug syntax-propertize-rules)) |
| 123 | ;; Precompile? Yeah, right! | 129 | ;; Precompile? Yeah, right! |
| 124 | ;; Seriously, tho, this is a macro for 2 reasons: | 130 | ;; Seriously, tho, this is a macro for 2 reasons: |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 13dbba769a4..e0a88461dc9 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-11-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * erc.el (erc-modules): Add "notifications". Tweak "hecomplete" doc. | ||
| 4 | |||
| 1 | 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * erc-backend.el: Only require `erc' during compilation (bug#12740). | 7 | * erc-backend.el: Only require `erc' during compilation (bug#12740). |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 2e97131b603..7cb6fbb595b 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -1843,7 +1843,7 @@ removed from the list will be disabled." | |||
| 1843 | capab-identify) | 1843 | capab-identify) |
| 1844 | (const :tag "completion: Complete nicknames and commands (programmable)" | 1844 | (const :tag "completion: Complete nicknames and commands (programmable)" |
| 1845 | completion) | 1845 | completion) |
| 1846 | (const :tag "hecomplete: Complete nicknames and commands (old)" hecomplete) | 1846 | (const :tag "hecomplete: Complete nicknames and commands (obsolete, use \"completion\")" hecomplete) |
| 1847 | (const :tag "dcc: Provide Direct Client-to-Client support" dcc) | 1847 | (const :tag "dcc: Provide Direct Client-to-Client support" dcc) |
| 1848 | (const :tag "fill: Wrap long lines" fill) | 1848 | (const :tag "fill: Wrap long lines" fill) |
| 1849 | (const :tag "identd: Launch an identd server on port 8113" identd) | 1849 | (const :tag "identd: Launch an identd server on port 8113" identd) |
| @@ -1863,6 +1863,8 @@ removed from the list will be disabled." | |||
| 1863 | (const :tag | 1863 | (const :tag |
| 1864 | "notify: Notify when the online status of certain users changes" | 1864 | "notify: Notify when the online status of certain users changes" |
| 1865 | notify) | 1865 | notify) |
| 1866 | (const :tag "notifications: Send notifications on PRIVMSG or nickname mentions" | ||
| 1867 | notifications) | ||
| 1866 | (const :tag "page: Process CTCP PAGE requests from IRC" page) | 1868 | (const :tag "page: Process CTCP PAGE requests from IRC" page) |
| 1867 | (const :tag "readonly: Make displayed lines read-only" readonly) | 1869 | (const :tag "readonly: Make displayed lines read-only" readonly) |
| 1868 | (const :tag "replace: Replace text in messages" replace) | 1870 | (const :tag "replace: Replace text in messages" replace) |
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index a67861e83a9..aa8aae2d245 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el | |||
| @@ -295,8 +295,8 @@ to writing a completion function." | |||
| 295 | 'pcomplete-expand-and-complete) | 295 | 'pcomplete-expand-and-complete) |
| 296 | (define-key eshell-command-map [space] 'pcomplete-expand) | 296 | (define-key eshell-command-map [space] 'pcomplete-expand) |
| 297 | (define-key eshell-command-map [? ] 'pcomplete-expand) | 297 | (define-key eshell-command-map [? ] 'pcomplete-expand) |
| 298 | (define-key eshell-mode-map [tab] 'pcomplete) | 298 | (define-key eshell-mode-map [tab] 'eshell-pcomplete) |
| 299 | (define-key eshell-mode-map [(control ?i)] 'pcomplete) | 299 | (define-key eshell-mode-map [(control ?i)] 'eshell-pcomplete) |
| 300 | ;; jww (1999-10-19): Will this work on anything but X? | 300 | ;; jww (1999-10-19): Will this work on anything but X? |
| 301 | (if (featurep 'xemacs) | 301 | (if (featurep 'xemacs) |
| 302 | (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse) | 302 | (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse) |
| @@ -449,6 +449,13 @@ to writing a completion function." | |||
| 449 | (all-completions filename obarray 'functionp)) | 449 | (all-completions filename obarray 'functionp)) |
| 450 | completions))))))) | 450 | completions))))))) |
| 451 | 451 | ||
| 452 | (defun eshell-pcomplete () | ||
| 453 | "Eshell wrapper for `pcomplete'." | ||
| 454 | (interactive) | ||
| 455 | (if eshell-cmpl-ignore-case | ||
| 456 | (pcomplete-expand-and-complete) ; hack workaround for bug#12838 | ||
| 457 | (pcomplete))) | ||
| 458 | |||
| 452 | (provide 'em-cmpl) | 459 | (provide 'em-cmpl) |
| 453 | 460 | ||
| 454 | ;; Local Variables: | 461 | ;; Local Variables: |
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index d3ddab8af1b..32744c702a6 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -306,12 +306,13 @@ Remove (unlink) the FILE(s).") | |||
| 306 | (eshell-eval-using-options | 306 | (eshell-eval-using-options |
| 307 | "mkdir" args | 307 | "mkdir" args |
| 308 | '((?h "help" nil nil "show this usage screen") | 308 | '((?h "help" nil nil "show this usage screen") |
| 309 | (?p "parents" nil em-parents "make parent directories as needed") | ||
| 309 | :external "mkdir" | 310 | :external "mkdir" |
| 310 | :show-usage | 311 | :show-usage |
| 311 | :usage "[OPTION] DIRECTORY... | 312 | :usage "[OPTION] DIRECTORY... |
| 312 | Create the DIRECTORY(ies), if they do not already exist.") | 313 | Create the DIRECTORY(ies), if they do not already exist.") |
| 313 | (while args | 314 | (while args |
| 314 | (eshell-funcalln 'make-directory (car args)) | 315 | (eshell-funcalln 'make-directory (car args) em-parents) |
| 315 | (setq args (cdr args))) | 316 | (setq args (cdr args))) |
| 316 | nil)) | 317 | nil)) |
| 317 | 318 | ||
diff --git a/lisp/faces.el b/lisp/faces.el index f5ef88d08b0..9e0ca962499 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -487,16 +487,21 @@ with the `default' face (which is always completely specified)." | |||
| 487 | (defalias 'face-background-pixmap 'face-stipple) | 487 | (defalias 'face-background-pixmap 'face-stipple) |
| 488 | 488 | ||
| 489 | 489 | ||
| 490 | ;; FIXME all of these -p functions ignore inheritance (cf face-stipple). | ||
| 491 | ;; Ie, a face that inherits from an underlined face but does not | ||
| 492 | ;; specify :underline will return nil. | ||
| 493 | ;; So these functions don't actually tell you anything about how the | ||
| 494 | ;; face will _appear_. So not very useful IMO. | ||
| 490 | (defun face-underline-p (face &optional frame) | 495 | (defun face-underline-p (face &optional frame) |
| 491 | "Return non-nil if FACE is underlined. | 496 | "Return non-nil if FACE specifies a non-nil underlining. |
| 492 | If the optional argument FRAME is given, report on face FACE in that frame. | 497 | If the optional argument FRAME is given, report on face FACE in that frame. |
| 493 | If FRAME is t, report on the defaults for face FACE (for new frames). | 498 | If FRAME is t, report on the defaults for face FACE (for new frames). |
| 494 | If FRAME is omitted or nil, use the selected frame." | 499 | If FRAME is omitted or nil, use the selected frame." |
| 495 | (eq (face-attribute face :underline frame) t)) | 500 | (face-attribute-specified-or (face-attribute face :underline frame) nil)) |
| 496 | 501 | ||
| 497 | 502 | ||
| 498 | (defun face-inverse-video-p (face &optional frame) | 503 | (defun face-inverse-video-p (face &optional frame) |
| 499 | "Return non-nil if FACE is in inverse video on FRAME. | 504 | "Return non-nil if FACE specifies a non-nil inverse-video. |
| 500 | If the optional argument FRAME is given, report on face FACE in that frame. | 505 | If the optional argument FRAME is given, report on face FACE in that frame. |
| 501 | If FRAME is t, report on the defaults for face FACE (for new frames). | 506 | If FRAME is t, report on the defaults for face FACE (for new frames). |
| 502 | If FRAME is omitted or nil, use the selected frame." | 507 | If FRAME is omitted or nil, use the selected frame." |
| @@ -837,21 +842,24 @@ and DATA is a string, containing the raw bits of the bitmap." | |||
| 837 | (set-face-attribute face frame :stipple (or stipple 'unspecified))) | 842 | (set-face-attribute face frame :stipple (or stipple 'unspecified))) |
| 838 | 843 | ||
| 839 | 844 | ||
| 840 | (defun set-face-underline-p (face underline &optional frame) | 845 | (defun set-face-underline (face underline &optional frame) |
| 841 | "Specify whether face FACE is underlined. | 846 | "Specify whether face FACE is underlined. |
| 842 | UNDERLINE nil means FACE explicitly doesn't underline. | 847 | UNDERLINE nil means FACE explicitly doesn't underline. |
| 843 | UNDERLINE non-nil means FACE explicitly does underlining | 848 | UNDERLINE t means FACE underlines with its foreground color. |
| 844 | with the same of the foreground color. | 849 | If UNDERLINE is a string, underline with that color. |
| 845 | If UNDERLINE is a string, underline with the color named UNDERLINE. | 850 | |
| 851 | UNDERLINE may also be a list of the form (:color COLOR :style STYLE), | ||
| 852 | where COLOR is a string or `foreground-color', and STYLE is either | ||
| 853 | `line' or `wave'. :color may be omitted, which means to use the | ||
| 854 | foreground color. :style may be omitted, which means to use a line. | ||
| 855 | |||
| 846 | FRAME nil or not specified means change face on all frames. | 856 | FRAME nil or not specified means change face on all frames. |
| 847 | Use `set-face-attribute' to ``unspecify'' underlining." | 857 | Use `set-face-attribute' to ``unspecify'' underlining." |
| 848 | (interactive | 858 | (interactive (read-face-and-attribute :underline)) |
| 849 | (let ((list (read-face-and-attribute :underline))) | ||
| 850 | (list (car list) (eq (car (cdr list)) t)))) | ||
| 851 | (set-face-attribute face frame :underline underline)) | 859 | (set-face-attribute face frame :underline underline)) |
| 852 | 860 | ||
| 853 | (define-obsolete-function-alias 'set-face-underline | 861 | (define-obsolete-function-alias 'set-face-underline-p |
| 854 | 'set-face-underline-p "22.1") | 862 | 'set-face-underline "24.3") |
| 855 | 863 | ||
| 856 | 864 | ||
| 857 | (defun set-face-inverse-video-p (face inverse-video-p &optional frame) | 865 | (defun set-face-inverse-video-p (face inverse-video-p &optional frame) |
| @@ -866,6 +874,9 @@ Use `set-face-attribute' to ``unspecify'' the inverse video attribute." | |||
| 866 | (set-face-attribute face frame :inverse-video inverse-video-p)) | 874 | (set-face-attribute face frame :inverse-video inverse-video-p)) |
| 867 | 875 | ||
| 868 | 876 | ||
| 877 | ;; The -p suffix is a hostage to fortune. What if we want to extend | ||
| 878 | ;; this to allow more than boolean options? Exactly this happened | ||
| 879 | ;; to set-face-underline-p. | ||
| 869 | (defun set-face-bold-p (face bold-p &optional frame) | 880 | (defun set-face-bold-p (face bold-p &optional frame) |
| 870 | "Specify whether face FACE is bold. | 881 | "Specify whether face FACE is bold. |
| 871 | BOLD-P non-nil means FACE should explicitly display bold. | 882 | BOLD-P non-nil means FACE should explicitly display bold. |
| @@ -1114,6 +1125,9 @@ name of the attribute for prompting. Value is the new attribute value." | |||
| 1114 | (string-to-number new-value))))) | 1125 | (string-to-number new-value))))) |
| 1115 | 1126 | ||
| 1116 | 1127 | ||
| 1128 | ;; FIXME this does allow you to enter the list forms of :box, | ||
| 1129 | ;; :stipple, or :underline, because face-valid-attribute-values does | ||
| 1130 | ;; not return those forms. | ||
| 1117 | (defun read-face-attribute (face attribute &optional frame) | 1131 | (defun read-face-attribute (face attribute &optional frame) |
| 1118 | "Interactively read a new value for FACE's ATTRIBUTE. | 1132 | "Interactively read a new value for FACE's ATTRIBUTE. |
| 1119 | Optional argument FRAME nil or unspecified means read an attribute value | 1133 | Optional argument FRAME nil or unspecified means read an attribute value |
| @@ -1125,12 +1139,11 @@ of a global face. Value is the new attribute value." | |||
| 1125 | ;; Represent complex attribute values as strings by printing them | 1139 | ;; Represent complex attribute values as strings by printing them |
| 1126 | ;; out. Stipple can be a vector; (WIDTH HEIGHT DATA). Box can be | 1140 | ;; out. Stipple can be a vector; (WIDTH HEIGHT DATA). Box can be |
| 1127 | ;; a list `(:width WIDTH :color COLOR)' or `(:width WIDTH :shadow | 1141 | ;; a list `(:width WIDTH :color COLOR)' or `(:width WIDTH :shadow |
| 1128 | ;; SHADOW)'. | 1142 | ;; SHADOW)'. Underline can be `(:color COLOR :style STYLE)'. |
| 1129 | (when (and (or (eq attribute :stipple) | 1143 | (and (memq attribute '(:box :stipple :underline)) |
| 1130 | (eq attribute :box)) | 1144 | (or (consp old-value) |
| 1131 | (or (consp old-value) | 1145 | (vectorp old-value)) |
| 1132 | (vectorp old-value))) | 1146 | (setq old-value (prin1-to-string old-value))) |
| 1133 | (setq old-value (prin1-to-string old-value))) | ||
| 1134 | (cond ((listp valid) | 1147 | (cond ((listp valid) |
| 1135 | (let ((default | 1148 | (let ((default |
| 1136 | (or (car (rassoc old-value valid)) | 1149 | (or (car (rassoc old-value valid)) |
| @@ -1160,11 +1173,10 @@ of a global face. Value is the new attribute value." | |||
| 1160 | ;; Convert stipple and box value text we read back to a list or | 1173 | ;; Convert stipple and box value text we read back to a list or |
| 1161 | ;; vector if it looks like one. This makes the assumption that a | 1174 | ;; vector if it looks like one. This makes the assumption that a |
| 1162 | ;; pixmap file name won't start with an open-paren. | 1175 | ;; pixmap file name won't start with an open-paren. |
| 1163 | (when (and (or (eq attribute :stipple) | 1176 | (and (memq attribute '(:stipple :box :underline)) |
| 1164 | (eq attribute :box)) | 1177 | (stringp new-value) |
| 1165 | (stringp new-value) | 1178 | (string-match "^[[(]" new-value) |
| 1166 | (string-match "^[[(]" new-value)) | 1179 | (setq new-value (read new-value))) |
| 1167 | (setq new-value (read new-value))) | ||
| 1168 | new-value)) | 1180 | new-value)) |
| 1169 | 1181 | ||
| 1170 | (declare-function fontset-list "fontset.c" ()) | 1182 | (declare-function fontset-list "fontset.c" ()) |
diff --git a/lisp/filecache.el b/lisp/filecache.el index 2dd7c2673bf..bc77c24fe63 100644 --- a/lisp/filecache.el +++ b/lisp/filecache.el | |||
| @@ -267,42 +267,63 @@ files of names DIRNAME1/FILENAME, DIRNAME2/FILENAME, ...") | |||
| 267 | ;; Functions to add files to the cache | 267 | ;; Functions to add files to the cache |
| 268 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 268 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 269 | 269 | ||
| 270 | (defun file-cache--read-list (file op-prompt) | ||
| 271 | (let* ((fun (if file 'read-file-name 'read-directory-name)) | ||
| 272 | (type (if file "file" "directory")) | ||
| 273 | (prompt-1 (concat op-prompt " " type ": ")) | ||
| 274 | (prompt-2 (concat op-prompt " another " type "?")) | ||
| 275 | (continue t) | ||
| 276 | result) | ||
| 277 | (while continue | ||
| 278 | (push (funcall fun prompt-1 nil nil t) result) | ||
| 279 | (setq continue (y-or-n-p prompt-2))) | ||
| 280 | (nreverse result))) | ||
| 281 | |||
| 270 | ;;;###autoload | 282 | ;;;###autoload |
| 271 | (defun file-cache-add-directory (directory &optional regexp) | 283 | (defun file-cache-add-directory (directory &optional regexp) |
| 272 | "Add DIRECTORY to the file cache. | 284 | "Add all files in DIRECTORY to the file cache. |
| 273 | If the optional REGEXP argument is non-nil, only files which match it will | 285 | If called from Lisp with a non-nil REGEXP argument is non-nil, |
| 274 | be added to the cache." | 286 | only add files whose names match REGEXP." |
| 275 | (interactive "DAdd files from directory: ") | 287 | (interactive (list (read-directory-name "Add files from directory: " |
| 288 | nil nil t) | ||
| 289 | nil)) | ||
| 276 | ;; Not an error, because otherwise we can't use load-paths that | 290 | ;; Not an error, because otherwise we can't use load-paths that |
| 277 | ;; contain non-existent directories. | 291 | ;; contain non-existent directories. |
| 278 | (if (not (file-accessible-directory-p directory)) | 292 | (when (file-accessible-directory-p directory) |
| 279 | (message "Directory %s does not exist" directory) | ||
| 280 | (let* ((dir (expand-file-name directory)) | 293 | (let* ((dir (expand-file-name directory)) |
| 281 | (dir-files (directory-files dir t regexp))) | 294 | (dir-files (directory-files dir t regexp))) |
| 282 | ;; Filter out files we don't want to see | 295 | ;; Filter out files we don't want to see |
| 283 | (dolist (file dir-files) | 296 | (dolist (file dir-files) |
| 284 | (if (file-directory-p file) | 297 | (if (file-directory-p file) |
| 285 | (setq dir-files (delq file dir-files)) | 298 | (setq dir-files (delq file dir-files)) |
| 286 | (dolist (regexp file-cache-filter-regexps) | 299 | (dolist (regexp file-cache-filter-regexps) |
| 287 | (if (string-match regexp file) | 300 | (if (string-match regexp file) |
| 288 | (setq dir-files (delq file dir-files)))))) | 301 | (setq dir-files (delq file dir-files)))))) |
| 289 | (file-cache-add-file-list dir-files)))) | 302 | (file-cache-add-file-list dir-files)))) |
| 290 | 303 | ||
| 291 | ;;;###autoload | 304 | ;;;###autoload |
| 292 | (defun file-cache-add-directory-list (directory-list &optional regexp) | 305 | (defun file-cache-add-directory-list (directories &optional regexp) |
| 293 | "Add DIRECTORY-LIST (a list of directory names) to the file cache. | 306 | "Add DIRECTORIES (a list of directory names) to the file cache. |
| 307 | If called interactively, read the directory names one by one. | ||
| 294 | If the optional REGEXP argument is non-nil, only files which match it | 308 | If the optional REGEXP argument is non-nil, only files which match it |
| 295 | will be added to the cache. Note that the REGEXP is applied to the | 309 | will be added to the cache. Note that the REGEXP is applied to the |
| 296 | files in each directory, not to the directory list itself." | 310 | files in each directory, not to the directory list itself." |
| 297 | (interactive "XAdd files from directory list: ") | 311 | (interactive (list (file-cache--read-list nil "Add"))) |
| 298 | (mapcar | 312 | (dolist (dir directories) |
| 299 | (lambda (dir) (file-cache-add-directory dir regexp)) | 313 | (file-cache-add-directory dir regexp)) |
| 300 | directory-list)) | 314 | (let ((n (length directories))) |
| 301 | 315 | (message "Filecache: cached file names from %d director%s." | |
| 302 | (defun file-cache-add-file-list (file-list) | 316 | n (if (= n 1) "y" "ies")))) |
| 303 | "Add FILE-LIST (a list of files names) to the file cache." | 317 | |
| 304 | (interactive "XFile List: ") | 318 | (defun file-cache-add-file-list (files) |
| 305 | (mapcar 'file-cache-add-file file-list)) | 319 | "Add FILES (a list of file names) to the file cache. |
| 320 | If called interactively, read the file names one by one." | ||
| 321 | (interactive (list (file-cache--read-list t "Add"))) | ||
| 322 | (dolist (f files) | ||
| 323 | (file-cache-add-file f)) | ||
| 324 | (let ((n (length files))) | ||
| 325 | (message "Filecache: cached %d file name%s." | ||
| 326 | n (if (= n 1) "" "s")))) | ||
| 306 | 327 | ||
| 307 | ;; Workhorse function | 328 | ;; Workhorse function |
| 308 | 329 | ||
| @@ -310,23 +331,25 @@ files in each directory, not to the directory list itself." | |||
| 310 | (defun file-cache-add-file (file) | 331 | (defun file-cache-add-file (file) |
| 311 | "Add FILE to the file cache." | 332 | "Add FILE to the file cache." |
| 312 | (interactive "fAdd File: ") | 333 | (interactive "fAdd File: ") |
| 313 | (if (not (file-exists-p file)) | 334 | (setq file (file-truename file)) |
| 314 | (message "Filecache: file %s does not exist" file) | 335 | (unless (file-exists-p file) |
| 315 | (let* ((file-name (file-name-nondirectory file)) | 336 | (error "Filecache: file %s does not exist" file)) |
| 316 | (dir-name (file-name-directory file)) | 337 | (let* ((file-name (file-name-nondirectory file)) |
| 317 | (the-entry (assoc-string | 338 | (dir-name (file-name-directory file)) |
| 318 | file-name file-cache-alist | 339 | (the-entry (assoc-string file-name file-cache-alist |
| 319 | file-cache-ignore-case))) | 340 | file-cache-ignore-case))) |
| 320 | ;; Does the entry exist already? | 341 | (cond ((null the-entry) |
| 321 | (if the-entry | 342 | ;; If the entry wasn't in the cache, add it. |
| 322 | (if (or (and (stringp (cdr the-entry)) | 343 | (push (list file-name dir-name) file-cache-alist) |
| 323 | (string= dir-name (cdr the-entry))) | 344 | (if (called-interactively-p 'interactive) |
| 324 | (and (listp (cdr the-entry)) | 345 | (message "Filecache: cached file name %s." file))) |
| 325 | (member dir-name (cdr the-entry)))) | 346 | ((not (member dir-name (cdr the-entry))) |
| 326 | nil | 347 | (setcdr the-entry (cons dir-name (cdr the-entry))) |
| 327 | (setcdr the-entry (cons dir-name (cdr the-entry)))) | 348 | (if (called-interactively-p 'interactive) |
| 328 | ;; If not, add it to the cache | 349 | (message "Filecache: cached file name %s." file))) |
| 329 | (push (list file-name dir-name) file-cache-alist))))) | 350 | (t |
| 351 | (if (called-interactively-p 'interactive) | ||
| 352 | (message "Filecache: %s is already cached." file)))))) | ||
| 330 | 353 | ||
| 331 | ;;;###autoload | 354 | ;;;###autoload |
| 332 | (defun file-cache-add-directory-using-find (directory) | 355 | (defun file-cache-add-directory-using-find (directory) |
| @@ -412,17 +435,26 @@ or the optional REGEXP argument." | |||
| 412 | 435 | ||
| 413 | ;; This clears *all* files with the given name | 436 | ;; This clears *all* files with the given name |
| 414 | (defun file-cache-delete-file (file) | 437 | (defun file-cache-delete-file (file) |
| 415 | "Delete FILE from the file cache." | 438 | "Delete FILE (a relative file name) from the file cache. |
| 439 | Return nil if FILE was not in the file cache, non-nil otherwise." | ||
| 416 | (interactive | 440 | (interactive |
| 417 | (list (completing-read "Delete file from cache: " file-cache-alist))) | 441 | (list (completing-read "Delete file from cache: " file-cache-alist))) |
| 418 | (setq file-cache-alist | 442 | (let ((elt (assoc-string file file-cache-alist file-cache-ignore-case))) |
| 419 | (delq (assoc-string file file-cache-alist file-cache-ignore-case) | 443 | (setq file-cache-alist (delq elt file-cache-alist)) |
| 420 | file-cache-alist))) | 444 | elt)) |
| 421 | 445 | ||
| 422 | (defun file-cache-delete-file-list (file-list) | 446 | (defun file-cache-delete-file-list (files &optional message) |
| 423 | "Delete FILE-LIST (a list of files) from the file cache." | 447 | "Delete FILES (a list of files) from the file cache. |
| 424 | (interactive "XFile List: ") | 448 | If called interactively, read the file names one by one. |
| 425 | (mapcar 'file-cache-delete-file file-list)) | 449 | If MESSAGE is non-nil, or if called interactively, print a |
| 450 | message reporting the number of file names deleted." | ||
| 451 | (interactive (list (file-cache--read-list t "Uncache") t)) | ||
| 452 | (let ((n 0)) | ||
| 453 | (dolist (f files) | ||
| 454 | (if (file-cache-delete-file f) | ||
| 455 | (setq n (1+ n)))) | ||
| 456 | (message "Filecache: uncached %d file name%s." | ||
| 457 | n (if (= n 1) "" "s")))) | ||
| 426 | 458 | ||
| 427 | (defun file-cache-delete-file-regexp (regexp) | 459 | (defun file-cache-delete-file-regexp (regexp) |
| 428 | "Delete files matching REGEXP from the file cache." | 460 | "Delete files matching REGEXP from the file cache." |
| @@ -431,21 +463,18 @@ or the optional REGEXP argument." | |||
| 431 | (dolist (elt file-cache-alist) | 463 | (dolist (elt file-cache-alist) |
| 432 | (and (string-match regexp (car elt)) | 464 | (and (string-match regexp (car elt)) |
| 433 | (push (car elt) delete-list))) | 465 | (push (car elt) delete-list))) |
| 434 | (file-cache-delete-file-list delete-list) | 466 | (file-cache-delete-file-list delete-list))) |
| 435 | (message "Filecache: deleted %d files from file cache" | ||
| 436 | (length delete-list)))) | ||
| 437 | 467 | ||
| 438 | (defun file-cache-delete-directory (directory) | 468 | (defun file-cache-delete-directory (directory) |
| 439 | "Delete DIRECTORY from the file cache." | 469 | "Delete DIRECTORY from the file cache." |
| 440 | (interactive "DDelete directory from file cache: ") | 470 | (interactive "DDelete directory from file cache: ") |
| 441 | (let ((dir (expand-file-name directory)) | 471 | (let ((dir (expand-file-name directory)) |
| 442 | (result 0)) | 472 | (n 0)) |
| 443 | (dolist (entry file-cache-alist) | 473 | (dolist (entry file-cache-alist) |
| 444 | (if (file-cache-do-delete-directory dir entry) | 474 | (if (file-cache-do-delete-directory dir entry) |
| 445 | (setq result (1+ result)))) | 475 | (setq n (1+ n)))) |
| 446 | (if (zerop result) | 476 | (message "Filecache: uncached %d file name%s." |
| 447 | (error "Filecache: no entries containing %s found in cache" directory) | 477 | n (if (= n 1) "" "s")))) |
| 448 | (message "Filecache: deleted %d entries" result)))) | ||
| 449 | 478 | ||
| 450 | (defun file-cache-do-delete-directory (dir entry) | 479 | (defun file-cache-do-delete-directory (dir entry) |
| 451 | (let ((directory-list (cdr entry)) | 480 | (let ((directory-list (cdr entry)) |
| @@ -456,10 +485,12 @@ or the optional REGEXP argument." | |||
| 456 | (delq entry file-cache-alist)) | 485 | (delq entry file-cache-alist)) |
| 457 | (setcdr entry (delete directory directory-list)))))) | 486 | (setcdr entry (delete directory directory-list)))))) |
| 458 | 487 | ||
| 459 | (defun file-cache-delete-directory-list (directory-list) | 488 | (defun file-cache-delete-directory-list (directories) |
| 460 | "Delete DIRECTORY-LIST (a list of directories) from the file cache." | 489 | "Delete DIRECTORIES (a list of directory names) from the file cache. |
| 461 | (interactive "XDirectory List: ") | 490 | If called interactively, read the directory names one by one." |
| 462 | (mapcar 'file-cache-delete-directory directory-list)) | 491 | (interactive (list (file-cache--read-list nil "Uncache"))) |
| 492 | (dolist (d directories) | ||
| 493 | (file-cache-delete-directory d))) | ||
| 463 | 494 | ||
| 464 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 495 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 465 | ;; Utility functions | 496 | ;; Utility functions |
diff --git a/lisp/generic-x.el b/lisp/generic-x.el index 878021ec5c5..e2533c1f12b 100644 --- a/lisp/generic-x.el +++ b/lisp/generic-x.el | |||
| @@ -549,6 +549,9 @@ like an INI file. You can add this hook to `find-file-hook'." | |||
| 549 | (concat (w32-shell-name) " -c " (buffer-file-name))))) | 549 | (concat (w32-shell-name) " -c " (buffer-file-name))))) |
| 550 | 550 | ||
| 551 | (eval-when-compile (require 'comint)) | 551 | (eval-when-compile (require 'comint)) |
| 552 | (declare-function comint-mode "comint" ()) | ||
| 553 | (declare-function comint-exec "comint" (buffer name command startfile switches)) | ||
| 554 | |||
| 552 | (defun bat-generic-mode-run-as-comint () | 555 | (defun bat-generic-mode-run-as-comint () |
| 553 | "Run the current BAT file in a comint buffer." | 556 | "Run the current BAT file in a comint buffer." |
| 554 | (interactive) | 557 | (interactive) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5f635e59cdf..dd493d383a3 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2012-11-16 Jan Tatarik <jan.tatarik@gmail.com> | ||
| 2 | |||
| 3 | * gnus-score.el (gnus-score-body): | ||
| 4 | * gnus-logic.el (gnus-advanced-body): Don't score by headers when | ||
| 5 | scoring by body. | ||
| 6 | |||
| 7 | 2012-11-16 Glenn Morris <rgm@gnu.org> | ||
| 8 | |||
| 9 | * gnus-diary.el (nndiary-request-create-group-functions) | ||
| 10 | (nndiary-request-update-info-functions) | ||
| 11 | (gnus-subscribe-newsgroup-functions) | ||
| 12 | (nndiary-request-accept-article-functions): | ||
| 13 | Use new names for hooks rather than obsolete aliases. | ||
| 14 | |||
| 1 | 2012-11-08 Katsumi Yamaoka <yamaoka@jpl.org> | 15 | 2012-11-08 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 16 | ||
| 3 | * gnus-art.el (gnus-article-browse-html-parts): Always replace charset | 17 | * gnus-art.el (gnus-article-browse-html-parts): Always replace charset |
diff --git a/lisp/gnus/gnus-diary.el b/lisp/gnus/gnus-diary.el index 854af2f5d76..bca307b19b6 100644 --- a/lisp/gnus/gnus-diary.el +++ b/lisp/gnus/gnus-diary.el | |||
| @@ -277,18 +277,18 @@ Optional prefix (or REVERSE argument) means sort in reverse order." | |||
| 277 | 277 | ||
| 278 | ;; Called when a group is subscribed. This is needed because groups created | 278 | ;; Called when a group is subscribed. This is needed because groups created |
| 279 | ;; because of mail splitting are *not* created with the back end function. | 279 | ;; because of mail splitting are *not* created with the back end function. |
| 280 | ;; Thus, `nndiary-request-create-group-hooks' is inoperative. | 280 | ;; Thus, `nndiary-request-create-group-functions' is inoperative. |
| 281 | (defun gnus-diary-maybe-update-group-parameters (group) | 281 | (defun gnus-diary-maybe-update-group-parameters (group) |
| 282 | (when (eq (car (gnus-find-method-for-group group)) 'nndiary) | 282 | (when (eq (car (gnus-find-method-for-group group)) 'nndiary) |
| 283 | (gnus-diary-update-group-parameters group))) | 283 | (gnus-diary-update-group-parameters group))) |
| 284 | 284 | ||
| 285 | (add-hook 'nndiary-request-create-group-hooks | 285 | (add-hook 'nndiary-request-create-group-functions |
| 286 | 'gnus-diary-update-group-parameters) | 286 | 'gnus-diary-update-group-parameters) |
| 287 | ;; Now that we have `gnus-subscribe-newsgroup-hooks', this is not needed | 287 | ;; Now that we have `gnus-subscribe-newsgroup-functions', this is not needed |
| 288 | ;; anymore. Maybe I should remove this completely. | 288 | ;; anymore. Maybe I should remove this completely. |
| 289 | (add-hook 'nndiary-request-update-info-hooks | 289 | (add-hook 'nndiary-request-update-info-functions |
| 290 | 'gnus-diary-update-group-parameters) | 290 | 'gnus-diary-update-group-parameters) |
| 291 | (add-hook 'gnus-subscribe-newsgroup-hooks | 291 | (add-hook 'gnus-subscribe-newsgroup-functions |
| 292 | 'gnus-diary-maybe-update-group-parameters) | 292 | 'gnus-diary-maybe-update-group-parameters) |
| 293 | 293 | ||
| 294 | 294 | ||
| @@ -384,7 +384,7 @@ If ARG (or prefix) is non-nil, force prompting for all fields." | |||
| 384 | nndiary-headers) | 384 | nndiary-headers) |
| 385 | )) | 385 | )) |
| 386 | 386 | ||
| 387 | (add-hook 'nndiary-request-accept-article-hooks | 387 | (add-hook 'nndiary-request-accept-article-functions |
| 388 | (lambda () (gnus-diary-check-message nil))) | 388 | (lambda () (gnus-diary-check-message nil))) |
| 389 | 389 | ||
| 390 | (define-key message-mode-map "\C-c\C-fd" 'gnus-diary-check-message) | 390 | (define-key message-mode-map "\C-c\C-fd" 'gnus-diary-check-message) |
diff --git a/lisp/gnus/gnus-logic.el b/lisp/gnus/gnus-logic.el index a440b779930..60d7b31713b 100644 --- a/lisp/gnus/gnus-logic.el +++ b/lisp/gnus/gnus-logic.el | |||
| @@ -181,17 +181,18 @@ | |||
| 181 | (with-current-buffer nntp-server-buffer | 181 | (with-current-buffer nntp-server-buffer |
| 182 | (let* ((request-func (cond ((string= "head" header) | 182 | (let* ((request-func (cond ((string= "head" header) |
| 183 | 'gnus-request-head) | 183 | 'gnus-request-head) |
| 184 | ;; We need to peek at the headers to detect the | ||
| 185 | ;; content encoding | ||
| 186 | ((string= "body" header) | 184 | ((string= "body" header) |
| 187 | 'gnus-request-article) | 185 | 'gnus-request-body) |
| 188 | (t 'gnus-request-article))) | 186 | (t 'gnus-request-article))) |
| 189 | ofunc article handles) | 187 | ofunc article handles) |
| 190 | ;; Not all backends support partial fetching. In that case, we | 188 | ;; Not all backends support partial fetching. In that case, we |
| 191 | ;; just fetch the entire article. | 189 | ;; just fetch the entire article. |
| 192 | (unless (gnus-check-backend-function | 190 | ;; When scoring by body, we need to peek at the headers to detect the |
| 193 | (intern (concat "request-" header)) | 191 | ;; content encoding |
| 194 | gnus-newsgroup-name) | 192 | (unless (or (gnus-check-backend-function |
| 193 | (intern (concat "request-" header)) | ||
| 194 | gnus-newsgroup-name) | ||
| 195 | (string= "body" header)) | ||
| 195 | (setq ofunc request-func) | 196 | (setq ofunc request-func) |
| 196 | (setq request-func 'gnus-request-article)) | 197 | (setq request-func 'gnus-request-article)) |
| 197 | (setq article (mail-header-number gnus-advanced-headers)) | 198 | (setq article (mail-header-number gnus-advanced-headers)) |
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index f215b845514..b7061960839 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el | |||
| @@ -1762,21 +1762,22 @@ score in `gnus-newsgroup-scored' by SCORE." | |||
| 1762 | (all-scores scores) | 1762 | (all-scores scores) |
| 1763 | (request-func (cond ((string= "head" header) | 1763 | (request-func (cond ((string= "head" header) |
| 1764 | 'gnus-request-head) | 1764 | 'gnus-request-head) |
| 1765 | ;; We need to peek at the headers to detect | ||
| 1766 | ;; the content encoding | ||
| 1767 | ((string= "body" header) | 1765 | ((string= "body" header) |
| 1768 | 'gnus-request-article) | 1766 | 'gnus-request-body) |
| 1769 | (t 'gnus-request-article))) | 1767 | (t 'gnus-request-article))) |
| 1770 | entries alist ofunc article last) | 1768 | entries alist ofunc article last) |
| 1771 | (when articles | 1769 | (when articles |
| 1772 | (setq last (mail-header-number (caar (last articles)))) | 1770 | (setq last (mail-header-number (caar (last articles)))) |
| 1773 | ;; Not all backends support partial fetching. In that case, | 1771 | ;; Not all backends support partial fetching. In that case, |
| 1774 | ;; we just fetch the entire article. | 1772 | ;; we just fetch the entire article. |
| 1775 | (unless (gnus-check-backend-function | 1773 | ;; When scoring by body, we need to peek at the headers to detect |
| 1776 | (and (string-match "^gnus-" (symbol-name request-func)) | 1774 | ;; the content encoding |
| 1777 | (intern (substring (symbol-name request-func) | 1775 | (unless (or (gnus-check-backend-function |
| 1778 | (match-end 0)))) | 1776 | (and (string-match "^gnus-" (symbol-name request-func)) |
| 1779 | gnus-newsgroup-name) | 1777 | (intern (substring (symbol-name request-func) |
| 1778 | (match-end 0)))) | ||
| 1779 | gnus-newsgroup-name) | ||
| 1780 | (string= "body" header)) | ||
| 1780 | (setq ofunc request-func) | 1781 | (setq ofunc request-func) |
| 1781 | (setq request-func 'gnus-request-article)) | 1782 | (setq request-func 'gnus-request-article)) |
| 1782 | (while articles | 1783 | (while articles |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index c1ce5a521be..48c5849d301 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -677,7 +677,8 @@ help buffer." | |||
| 677 | " is also a " "face." "\n\n" facedoc)) | 677 | " is also a " "face." "\n\n" facedoc)) |
| 678 | ;; Don't record the `describe-function' item in the stack. | 678 | ;; Don't record the `describe-function' item in the stack. |
| 679 | (setq help-xref-stack-item nil) | 679 | (setq help-xref-stack-item nil) |
| 680 | (help-setup-xref (list #'help-xref-interned symbol) nil))))))) | 680 | (help-setup-xref (list #'help-xref-interned symbol) nil)))) |
| 681 | (goto-char (point-min))))) | ||
| 681 | 682 | ||
| 682 | 683 | ||
| 683 | ;; Navigation/hyperlinking with xrefs | 684 | ;; Navigation/hyperlinking with xrefs |
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 72ca189e9d5..4e0ac1a4856 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -1362,24 +1362,27 @@ group." | |||
| 1362 | (defun ibuffer-mark-forward (arg) | 1362 | (defun ibuffer-mark-forward (arg) |
| 1363 | "Mark the buffer on this line, and move forward ARG lines. | 1363 | "Mark the buffer on this line, and move forward ARG lines. |
| 1364 | If point is on a group name, this function operates on that group." | 1364 | If point is on a group name, this function operates on that group." |
| 1365 | (interactive "P") | 1365 | (interactive "p") |
| 1366 | (ibuffer-mark-interactive arg ibuffer-marked-char 1)) | 1366 | (ibuffer-mark-interactive arg ibuffer-marked-char)) |
| 1367 | 1367 | ||
| 1368 | (defun ibuffer-unmark-forward (arg) | 1368 | (defun ibuffer-unmark-forward (arg) |
| 1369 | "Unmark the buffer on this line, and move forward ARG lines. | 1369 | "Unmark the buffer on this line, and move forward ARG lines. |
| 1370 | If point is on a group name, this function operates on that group." | 1370 | If point is on a group name, this function operates on that group." |
| 1371 | (interactive "P") | 1371 | (interactive "p") |
| 1372 | (ibuffer-mark-interactive arg ?\s 1)) | 1372 | (ibuffer-mark-interactive arg ?\s)) |
| 1373 | 1373 | ||
| 1374 | (defun ibuffer-unmark-backward (arg) | 1374 | (defun ibuffer-unmark-backward (arg) |
| 1375 | "Unmark the buffer on this line, and move backward ARG lines. | 1375 | "Unmark the buffer on this line, and move backward ARG lines. |
| 1376 | If point is on a group name, this function operates on that group." | 1376 | If point is on a group name, this function operates on that group." |
| 1377 | (interactive "P") | 1377 | (interactive "p") |
| 1378 | (ibuffer-mark-interactive arg ?\s -1)) | 1378 | (ibuffer-unmark-forward (- arg))) |
| 1379 | 1379 | ||
| 1380 | (defun ibuffer-mark-interactive (arg mark movement) | 1380 | (defun ibuffer-mark-interactive (arg mark &optional movement) |
| 1381 | (ibuffer-assert-ibuffer-mode) | 1381 | (ibuffer-assert-ibuffer-mode) |
| 1382 | (or arg (setq arg 1)) | 1382 | (or arg (setq arg 1)) |
| 1383 | ;; deprecated movement argument | ||
| 1384 | (when (and movement (< movement 0)) | ||
| 1385 | (setq arg (- arg))) | ||
| 1383 | (ibuffer-forward-line 0) | 1386 | (ibuffer-forward-line 0) |
| 1384 | (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name) | 1387 | (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name) |
| 1385 | (progn | 1388 | (progn |
| @@ -1389,8 +1392,12 @@ If point is on a group name, this function operates on that group." | |||
| 1389 | (let ((inhibit-read-only t)) | 1392 | (let ((inhibit-read-only t)) |
| 1390 | (while (> arg 0) | 1393 | (while (> arg 0) |
| 1391 | (ibuffer-set-mark mark) | 1394 | (ibuffer-set-mark mark) |
| 1392 | (ibuffer-forward-line movement t) | 1395 | (ibuffer-forward-line 1 t) |
| 1393 | (setq arg (1- arg)))))) | 1396 | (setq arg (1- arg))) |
| 1397 | (while (< arg 0) | ||
| 1398 | (ibuffer-forward-line -1 t) | ||
| 1399 | (ibuffer-set-mark mark) | ||
| 1400 | (setq arg (1+ arg)))))) | ||
| 1394 | 1401 | ||
| 1395 | (defun ibuffer-set-mark (mark) | 1402 | (defun ibuffer-set-mark (mark) |
| 1396 | (ibuffer-assert-ibuffer-mode) | 1403 | (ibuffer-assert-ibuffer-mode) |
diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 3659894f08d..77c968b21ae 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el | |||
| @@ -2454,6 +2454,8 @@ when using per-directory thumbnail file storage")) | |||
| 2454 | (defvar image-dired-widget-list nil | 2454 | (defvar image-dired-widget-list nil |
| 2455 | "List to keep track of meta data in edit buffer.") | 2455 | "List to keep track of meta data in edit buffer.") |
| 2456 | 2456 | ||
| 2457 | (declare-function widget-forward "wid-edit" (arg)) | ||
| 2458 | |||
| 2457 | ;;;###autoload | 2459 | ;;;###autoload |
| 2458 | (defun image-dired-dired-edit-comment-and-tags () | 2460 | (defun image-dired-dired-edit-comment-and-tags () |
| 2459 | "Edit comment and tags of current or marked image files. | 2461 | "Edit comment and tags of current or marked image files. |
diff --git a/lisp/image.el b/lisp/image.el index bd2f5c3a3ca..27bbc2c08d6 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -429,7 +429,7 @@ means display it in the right marginal area." | |||
| 429 | "Insert IMAGE into current buffer at point. | 429 | "Insert IMAGE into current buffer at point. |
| 430 | IMAGE is displayed by inserting STRING into the current buffer | 430 | IMAGE is displayed by inserting STRING into the current buffer |
| 431 | with a `display' property whose value is the image. STRING | 431 | with a `display' property whose value is the image. STRING |
| 432 | defaults to the empty string if you omit it. | 432 | defaults to a single space if you omit it. |
| 433 | AREA is where to display the image. AREA nil or omitted means | 433 | AREA is where to display the image. AREA nil or omitted means |
| 434 | display it in the text area, a value of `left-margin' means | 434 | display it in the text area, a value of `left-margin' means |
| 435 | display it in the left marginal area, a value of `right-margin' | 435 | display it in the left marginal area, a value of `right-margin' |
| @@ -467,8 +467,8 @@ height of the image; integer values are taken as pixel values." | |||
| 467 | (defun insert-sliced-image (image &optional string area rows cols) | 467 | (defun insert-sliced-image (image &optional string area rows cols) |
| 468 | "Insert IMAGE into current buffer at point. | 468 | "Insert IMAGE into current buffer at point. |
| 469 | IMAGE is displayed by inserting STRING into the current buffer | 469 | IMAGE is displayed by inserting STRING into the current buffer |
| 470 | with a `display' property whose value is the image. STRING is | 470 | with a `display' property whose value is the image. The default |
| 471 | defaulted if you omit it. | 471 | STRING is a single space. |
| 472 | AREA is where to display the image. AREA nil or omitted means | 472 | AREA is where to display the image. AREA nil or omitted means |
| 473 | display it in the text area, a value of `left-margin' means | 473 | display it in the text area, a value of `left-margin' means |
| 474 | display it in the left marginal area, a value of `right-margin' | 474 | display it in the left marginal area, a value of `right-margin' |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 4686d1cf538..1d3da2db15b 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -546,9 +546,7 @@ The returned alist DOES NOT share structure with MENULIST." | |||
| 546 | Return a split and sorted copy of ALIST. The returned alist DOES | 546 | Return a split and sorted copy of ALIST. The returned alist DOES |
| 547 | NOT share structure with ALIST." | 547 | NOT share structure with ALIST." |
| 548 | (mapcar (lambda (elt) | 548 | (mapcar (lambda (elt) |
| 549 | (if (and (consp elt) | 549 | (if (imenu--subalist-p elt) |
| 550 | (stringp (car elt)) | ||
| 551 | (listp (cdr elt))) | ||
| 552 | (imenu--split-menu (cdr elt) (car elt)) | 550 | (imenu--split-menu (cdr elt) (car elt)) |
| 553 | elt)) | 551 | elt)) |
| 554 | alist)) | 552 | alist)) |
diff --git a/lisp/info.el b/lisp/info.el index 36ffa806f04..b0ef5c6bc4d 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -4836,6 +4836,17 @@ first line or header line, and for breadcrumb links.") | |||
| 4836 | ;; current Info node. | 4836 | ;; current Info node. |
| 4837 | (eval-when-compile (require 'speedbar)) | 4837 | (eval-when-compile (require 'speedbar)) |
| 4838 | 4838 | ||
| 4839 | (declare-function speedbar-add-expansion-list "speedbar" (new-list)) | ||
| 4840 | (declare-function speedbar-center-buffer-smartly "speedbar" ()) | ||
| 4841 | (declare-function speedbar-change-expand-button-char "speedbar" (char)) | ||
| 4842 | (declare-function speedbar-change-initial-expansion-list "speedbar" (new-default)) | ||
| 4843 | (declare-function speedbar-delete-subblock "speedbar" (indent)) | ||
| 4844 | (declare-function speedbar-make-specialized-keymap "speedbar" ()) | ||
| 4845 | (declare-function speedbar-make-tag-line "speedbar" | ||
| 4846 | (exp-button-type exp-button-char exp-button-function | ||
| 4847 | exp-button-data tag-button tag-button-function | ||
| 4848 | tag-button-data tag-button-face depth)) | ||
| 4849 | |||
| 4839 | (defvar Info-speedbar-key-map nil | 4850 | (defvar Info-speedbar-key-map nil |
| 4840 | "Keymap used when in the Info display mode.") | 4851 | "Keymap used when in the Info display mode.") |
| 4841 | 4852 | ||
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 60b39606d86..0aa1b8957ac 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -521,12 +521,12 @@ It is needed when D-Bus signals or errors arrive, because there | |||
| 521 | is no information where to trace the message.") | 521 | is no information where to trace the message.") |
| 522 | 522 | ||
| 523 | (defun tramp-gvfs-dbus-event-error (event err) | 523 | (defun tramp-gvfs-dbus-event-error (event err) |
| 524 | "Called when a D-Bus error message arrives, see `dbus-event-error-hooks'." | 524 | "Called when a D-Bus error message arrives, see `dbus-event-error-functions'." |
| 525 | (when tramp-gvfs-dbus-event-vector | 525 | (when tramp-gvfs-dbus-event-vector |
| 526 | (tramp-message tramp-gvfs-dbus-event-vector 10 "%S" event) | 526 | (tramp-message tramp-gvfs-dbus-event-vector 10 "%S" event) |
| 527 | (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err)))) | 527 | (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err)))) |
| 528 | 528 | ||
| 529 | (add-hook 'dbus-event-error-hooks 'tramp-gvfs-dbus-event-error) | 529 | (add-hook 'dbus-event-error-functions 'tramp-gvfs-dbus-event-error) |
| 530 | 530 | ||
| 531 | 531 | ||
| 532 | ;; File name primitives. | 532 | ;; File name primitives. |
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index f3e277e338c..a3ea4af4651 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el | |||
| @@ -560,7 +560,7 @@ FILE is created there." | |||
| 560 | (goto-char (point-min)) | 560 | (goto-char (point-min)) |
| 561 | (search-forward (concat (int-to-string score) | 561 | (search-forward (concat (int-to-string score) |
| 562 | " " (user-login-name) " " | 562 | " " (user-login-name) " " |
| 563 | marker-string)) | 563 | marker-string) nil t) |
| 564 | (beginning-of-line))))) | 564 | (beginning-of-line))))) |
| 565 | 565 | ||
| 566 | (defun gamegrid-add-score-insecure (file score &optional directory) | 566 | (defun gamegrid-add-score-insecure (file score &optional directory) |
diff --git a/lisp/printing.el b/lisp/printing.el index 02b2fb0139c..26a7648f68e 100644 --- a/lisp/printing.el +++ b/lisp/printing.el | |||
| @@ -1383,6 +1383,10 @@ Used by `pr-menu-bind' and `pr-update-menus'.") | |||
| 1383 | (eval-when-compile | 1383 | (eval-when-compile |
| 1384 | (require 'easymenu)) ; to avoid compilation gripes | 1384 | (require 'easymenu)) ; to avoid compilation gripes |
| 1385 | 1385 | ||
| 1386 | (declare-function easy-menu-add-item "easymenu" | ||
| 1387 | (map path item &optional before)) | ||
| 1388 | (declare-function easy-menu-remove-item "easymenu" (map path name)) | ||
| 1389 | |||
| 1386 | (eval-and-compile | 1390 | (eval-and-compile |
| 1387 | (defun pr-global-menubar (pr-menu-spec) | 1391 | (defun pr-global-menubar (pr-menu-spec) |
| 1388 | (require 'easymenu) | 1392 | (require 'easymenu) |
| @@ -6079,6 +6083,8 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." | |||
| 6079 | (and pr-i-region ; let region activated | 6083 | (and pr-i-region ; let region activated |
| 6080 | (pr-keep-region-active))) | 6084 | (pr-keep-region-active))) |
| 6081 | 6085 | ||
| 6086 | (declare-function widget-field-action "wid-edit" (widget &optional _event)) | ||
| 6087 | (declare-function widget-value-set "wid-edit" (widget value)) | ||
| 6082 | 6088 | ||
| 6083 | (defun pr-insert-section-1 () | 6089 | (defun pr-insert-section-1 () |
| 6084 | ;; 1. Print: | 6090 | ;; 1. Print: |
diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 25a6fbfd998..dd104d436b5 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el | |||
| @@ -3608,6 +3608,7 @@ functions to do caching and flushing if appropriate." | |||
| 3608 | nil | 3608 | nil |
| 3609 | 3609 | ||
| 3610 | (eval-when-compile (condition-case nil (require 'imenu) (error nil))) | 3610 | (eval-when-compile (condition-case nil (require 'imenu) (error nil))) |
| 3611 | (declare-function imenu--make-index-alist "imenu" (&optional no-error)) | ||
| 3611 | 3612 | ||
| 3612 | (defun speedbar-fetch-dynamic-imenu (file) | 3613 | (defun speedbar-fetch-dynamic-imenu (file) |
| 3613 | "Load FILE into a buffer, and generate tags using Imenu. | 3614 | "Load FILE into a buffer, and generate tags using Imenu. |
diff --git a/lisp/subr.el b/lisp/subr.el index b0ac2dd2106..8410897fd6f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -3189,6 +3189,7 @@ in which case `save-window-excursion' cannot help." | |||
| 3189 | ;; Return nil. | 3189 | ;; Return nil. |
| 3190 | nil) | 3190 | nil) |
| 3191 | 3191 | ||
| 3192 | ;; Doc is very similar to with-temp-buffer-window. | ||
| 3192 | (defmacro with-output-to-temp-buffer (bufname &rest body) | 3193 | (defmacro with-output-to-temp-buffer (bufname &rest body) |
| 3193 | "Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer. | 3194 | "Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer. |
| 3194 | 3195 | ||
| @@ -3214,7 +3215,9 @@ with the buffer BUFNAME temporarily current. It runs the hook | |||
| 3214 | `temp-buffer-show-hook' after displaying buffer BUFNAME, with that | 3215 | `temp-buffer-show-hook' after displaying buffer BUFNAME, with that |
| 3215 | buffer temporarily current, and the window that was used to display it | 3216 | buffer temporarily current, and the window that was used to display it |
| 3216 | temporarily selected. But it doesn't run `temp-buffer-show-hook' | 3217 | temporarily selected. But it doesn't run `temp-buffer-show-hook' |
| 3217 | if it uses `temp-buffer-show-function'." | 3218 | if it uses `temp-buffer-show-function'. |
| 3219 | |||
| 3220 | See the related form `with-temp-buffer-window'." | ||
| 3218 | (declare (debug t)) | 3221 | (declare (debug t)) |
| 3219 | (let ((old-dir (make-symbol "old-dir")) | 3222 | (let ((old-dir (make-symbol "old-dir")) |
| 3220 | (buf (make-symbol "buf"))) | 3223 | (buf (make-symbol "buf"))) |
| @@ -3961,11 +3964,16 @@ The properties used on SYMBOL are `composefunc', `sendfunc', | |||
| 3961 | (put symbol 'hookvar (or hookvar 'mail-send-hook))) | 3964 | (put symbol 'hookvar (or hookvar 'mail-send-hook))) |
| 3962 | 3965 | ||
| 3963 | (defun set-temporary-overlay-map (map &optional keep-pred) | 3966 | (defun set-temporary-overlay-map (map &optional keep-pred) |
| 3964 | "Set MAP as a temporary overlay map. | 3967 | "Set MAP as a temporary keymap taking precedence over most other keymaps. |
| 3965 | When KEEP-PRED is `t', using a key from the temporary keymap | 3968 | Note that this does NOT take precedence over the \"overriding\" maps |
| 3966 | leaves this keymap activated. KEEP-PRED can also be a function, | 3969 | `overriding-terminal-local-map' and `overriding-local-map' (or the |
| 3967 | which will have the same effect when it returns `t'. | 3970 | `keymap' text property). Unlike those maps, if no match for a key is |
| 3968 | When KEEP-PRED is nil, the temporary keymap is used only once." | 3971 | found in MAP, the normal key lookup sequence then continues. |
| 3972 | |||
| 3973 | Normally, MAP is used only once. If the optional argument | ||
| 3974 | KEEP-PRED is t, MAP stays active if a key from MAP is used. | ||
| 3975 | KEEP-PRED can also be a function of no arguments: if it returns | ||
| 3976 | non-nil then MAP stays active." | ||
| 3969 | (let* ((clearfunsym (make-symbol "clear-temporary-overlay-map")) | 3977 | (let* ((clearfunsym (make-symbol "clear-temporary-overlay-map")) |
| 3970 | (overlaysym (make-symbol "t")) | 3978 | (overlaysym (make-symbol "t")) |
| 3971 | (alist (list (cons overlaysym map))) | 3979 | (alist (list (cons overlaysym map))) |
diff --git a/lisp/term.el b/lisp/term.el index e6466b8fa95..a7c50d65562 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -397,6 +397,12 @@ | |||
| 397 | (require 'ring) | 397 | (require 'ring) |
| 398 | (require 'ehelp) | 398 | (require 'ehelp) |
| 399 | 399 | ||
| 400 | (declare-function ring-empty-p "ring" (ring)) | ||
| 401 | (declare-function ring-ref "ring" (ring index)) | ||
| 402 | (declare-function ring-insert-at-beginning "ring" (ring item)) | ||
| 403 | (declare-function ring-length "ring" (ring)) | ||
| 404 | (declare-function ring-insert "ring" (ring item)) | ||
| 405 | |||
| 400 | (defgroup term nil | 406 | (defgroup term nil |
| 401 | "General command interpreter in a window." | 407 | "General command interpreter in a window." |
| 402 | :group 'processes) | 408 | :group 'processes) |
| @@ -4178,11 +4184,16 @@ the process. Any more args are arguments to PROGRAM." | |||
| 4178 | (term-mode) | 4184 | (term-mode) |
| 4179 | (term-char-mode) | 4185 | (term-char-mode) |
| 4180 | 4186 | ||
| 4181 | ;; I wanna have find-file on C-x C-f -mm | 4187 | ;; Historical baggage. A call to term-set-escape-char used to not |
| 4182 | ;; your mileage may definitely vary, maybe it's better to put this in your | 4188 | ;; undo any previous call to t-s-e-c. Because of this, ansi-term |
| 4183 | ;; .emacs ... | 4189 | ;; ended up with both C-x and C-c as escape chars. Who knows what |
| 4184 | 4190 | ;; the original intention was, but people could have become used to | |
| 4185 | (term-set-escape-char ?\C-x) | 4191 | ;; either. (Bug#12842) |
| 4192 | (let (term-escape-char) | ||
| 4193 | ;; I wanna have find-file on C-x C-f -mm | ||
| 4194 | ;; your mileage may definitely vary, maybe it's better to put this in your | ||
| 4195 | ;; .emacs ... | ||
| 4196 | (term-set-escape-char ?\C-x)) | ||
| 4186 | 4197 | ||
| 4187 | (switch-to-buffer term-ansi-buffer-name)) | 4198 | (switch-to-buffer term-ansi-buffer-name)) |
| 4188 | 4199 | ||
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index ad6e1125027..42e09b65750 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el | |||
| @@ -91,6 +91,9 @@ | |||
| 91 | (declare-function w32-send-sys-command "w32fns.c") | 91 | (declare-function w32-send-sys-command "w32fns.c") |
| 92 | (declare-function set-message-beep "w32fns.c") | 92 | (declare-function set-message-beep "w32fns.c") |
| 93 | 93 | ||
| 94 | (declare-function cygwin-convert-path-from-windows "cygw32.c" | ||
| 95 | (path &optional absolute_p)) | ||
| 96 | |||
| 94 | ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles | 97 | ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles |
| 95 | (if (fboundp 'new-fontset) | 98 | (if (fboundp 'new-fontset) |
| 96 | (require 'fontset)) | 99 | (require 'fontset)) |
| @@ -116,7 +119,11 @@ | |||
| 116 | "/") | 119 | "/") |
| 117 | "/"))) | 120 | "/"))) |
| 118 | (dnd-handle-one-url window 'private | 121 | (dnd-handle-one-url window 'private |
| 119 | (concat "file:" file-name))) | 122 | (concat |
| 123 | (if (eq system-type 'cygwin) | ||
| 124 | "file://" | ||
| 125 | "file:") | ||
| 126 | file-name))) | ||
| 120 | 127 | ||
| 121 | (defun w32-drag-n-drop (event &optional new-frame) | 128 | (defun w32-drag-n-drop (event &optional new-frame) |
| 122 | "Edit the files listed in the drag-n-drop EVENT. | 129 | "Edit the files listed in the drag-n-drop EVENT. |
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el index cb61a021251..2efabed5cd8 100644 --- a/lisp/url/url-parse.el +++ b/lisp/url/url-parse.el | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | 48 | ||
| 49 | (defun url-path-and-query (urlobj) | 49 | (defun url-path-and-query (urlobj) |
| 50 | "Return the path and query components of URLOBJ. | 50 | "Return the path and query components of URLOBJ. |
| 51 | These two components are store together in the FILENAME slot of | 51 | These two components are stored together in the FILENAME slot of |
| 52 | the object. The return value of this function is (PATH . QUERY), | 52 | the object. The return value of this function is (PATH . QUERY), |
| 53 | where each of PATH and QUERY are strings or nil." | 53 | where each of PATH and QUERY are strings or nil." |
| 54 | (let ((name (url-filename urlobj)) | 54 | (let ((name (url-filename urlobj)) |
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 3becd8950f1..370cd0a9dca 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el | |||
| @@ -414,7 +414,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." | |||
| 414 | ;; We also used to match the filename in column 0 without any | 414 | ;; We also used to match the filename in column 0 without any |
| 415 | ;; meta-info before it, but I believe this can never happen. | 415 | ;; meta-info before it, but I believe this can never happen. |
| 416 | (concat "^\\(\\([ACGDU]\\)\\(.[B ]\\)? \\)" | 416 | (concat "^\\(\\([ACGDU]\\)\\(.[B ]\\)? \\)" |
| 417 | (regexp-quote (file-name-nondirectory file))) | 417 | (regexp-quote (file-relative-name file))) |
| 418 | nil t) | 418 | nil t) |
| 419 | (cond | 419 | (cond |
| 420 | ;; Merge successful, we are in sync with repository now | 420 | ;; Merge successful, we are in sync with repository now |
diff --git a/lisp/vcursor.el b/lisp/vcursor.el index 19cb7a9df8d..a277abcad9b 100644 --- a/lisp/vcursor.el +++ b/lisp/vcursor.el | |||
| @@ -881,6 +881,8 @@ ALL-FRAMES is also used to decide whether to split the window." | |||
| 881 | (vcursor-disable -1)))) | 881 | (vcursor-disable -1)))) |
| 882 | ) | 882 | ) |
| 883 | 883 | ||
| 884 | (declare-function compare-windows-skip-whitespace "compare-w" (start)) | ||
| 885 | |||
| 884 | ;; vcursor-compare-windows is copied from compare-w.el with only | 886 | ;; vcursor-compare-windows is copied from compare-w.el with only |
| 885 | ;; minor modifications; these are too bound up with the function | 887 | ;; minor modifications; these are too bound up with the function |
| 886 | ;; to make it really useful to call compare-windows itself. | 888 | ;; to make it really useful to call compare-windows itself. |
diff --git a/lisp/window.el b/lisp/window.el index 30ee622cfe6..d378ea5ff14 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -142,41 +142,46 @@ to `display-buffer'." | |||
| 142 | ;; Return the window. | 142 | ;; Return the window. |
| 143 | window)))) | 143 | window)))) |
| 144 | 144 | ||
| 145 | ;; Doc is very similar to with-output-to-temp-buffer. | ||
| 145 | (defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body) | 146 | (defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body) |
| 146 | "Evaluate BODY and display the buffer specified by BUFFER-OR-NAME. | 147 | "Bind `standard-output' to BUFFER-OR-NAME, eval BODY, show the buffer. |
| 147 | BUFFER-OR-NAME must specify either a live buffer, or the name of a | 148 | BUFFER-OR-NAME must specify either a live buffer, or the name of a |
| 148 | buffer (if it does not exist, this macro creates it). | 149 | buffer (if it does not exist, this macro creates it). |
| 149 | 150 | ||
| 150 | Make sure the specified buffer is empty before evaluating BODY. | 151 | This construct makes buffer BUFFER-OR-NAME empty before running BODY. |
| 151 | Do not make that buffer current for BODY. Instead, bind | 152 | It does not make the buffer current for BODY. |
| 152 | `standard-output' to that buffer, so that output generated with | 153 | Instead it binds `standard-output' to that buffer, so that output |
| 153 | `prin1' and similar functions in BODY goes into that buffer. | 154 | generated with `prin1' and similar functions in BODY goes into |
| 155 | the buffer. | ||
| 154 | 156 | ||
| 155 | After evaluating BODY, this marks the specified buffer unmodified and | 157 | At the end of BODY, this marks the specified buffer unmodified and |
| 156 | read-only, and displays it in a window via `display-buffer', passing | 158 | read-only, and displays it in a window (but does not select it, or make |
| 157 | ACTION as the action argument to `display-buffer'. It automatically | 159 | the buffer current). The display happens by calling `display-buffer' |
| 158 | shrinks the relevant window if `temp-buffer-resize-mode' is enabled. | 160 | with the ACTION argument. If `temp-buffer-resize-mode' is enabled, |
| 161 | the relevant window shrinks automatically. | ||
| 159 | 162 | ||
| 160 | Returns the value returned by BODY, unless QUIT-FUNCTION specifies | 163 | This returns the value returned by BODY, unless QUIT-FUNCTION specifies |
| 161 | a function. In that case, runs the function with two arguments - | 164 | a function. In that case, it runs the function with two arguments - |
| 162 | the window showing the specified buffer and the value returned by | 165 | the window showing the specified buffer and the value returned by |
| 163 | BODY - and returns the value returned by that function. | 166 | BODY - and returns the value returned by that function. |
| 164 | 167 | ||
| 165 | If the buffer is displayed on a new frame, the window manager may | 168 | If the buffer is displayed on a new frame, the window manager may |
| 166 | decide to select that frame. In that case, it's usually a good | 169 | decide to select that frame. In that case, it's usually a good |
| 167 | strategy if the function specified by QUIT-FUNCTION selects the | 170 | strategy if QUIT-FUNCTION selects the window showing the buffer |
| 168 | window showing the buffer before reading a value from the | 171 | before reading any value from the minibuffer; for example, when |
| 169 | minibuffer; for example, when asking a `yes-or-no-p' question. | 172 | asking a `yes-or-no-p' question. |
| 170 | 173 | ||
| 171 | This construct is similar to `with-output-to-temp-buffer', but does | 174 | This runs the hook `temp-buffer-window-setup-hook' before BODY, |
| 172 | not put the buffer in help mode, or call `temp-buffer-show-function'. | 175 | with the specified buffer temporarily current. It runs the |
| 173 | It also runs different hooks, namely `temp-buffer-window-setup-hook' | 176 | hook `temp-buffer-window-show-hook' after displaying the buffer, |
| 174 | \(with the specified buffer current) and `temp-buffer-window-show-hook' | 177 | with that buffer temporarily current, and the window that was used to |
| 175 | \(with the specified buffer current and the window showing it selected). | 178 | display it temporarily selected. |
| 176 | 179 | ||
| 177 | Since this macro calls `display-buffer', the window displaying | 180 | This construct is similar to `with-output-to-temp-buffer', but |
| 178 | the buffer is usually not selected and the specified buffer | 181 | runs different hooks. In particular, it does not run |
| 179 | usually not made current. QUIT-FUNCTION can override that." | 182 | `temp-buffer-setup-hook', which usually puts the buffer in Help mode. |
| 183 | Also, it does not call `temp-buffer-show-function' (the ACTION | ||
| 184 | argument replaces this)." | ||
| 180 | (declare (debug t)) | 185 | (declare (debug t)) |
| 181 | (let ((buffer (make-symbol "buffer")) | 186 | (let ((buffer (make-symbol "buffer")) |
| 182 | (window (make-symbol "window")) | 187 | (window (make-symbol "window")) |
| @@ -2571,8 +2576,7 @@ move it as far as possible in the desired direction." | |||
| 2571 | Interactively, if no argument is given, make the selected window | 2576 | Interactively, if no argument is given, make the selected window |
| 2572 | one line taller. If optional argument HORIZONTAL is non-nil, | 2577 | one line taller. If optional argument HORIZONTAL is non-nil, |
| 2573 | make selected window wider by DELTA columns. If DELTA is | 2578 | make selected window wider by DELTA columns. If DELTA is |
| 2574 | negative, shrink selected window by -DELTA lines or columns. | 2579 | negative, shrink selected window by -DELTA lines or columns." |
| 2575 | Return nil." | ||
| 2576 | (interactive "p") | 2580 | (interactive "p") |
| 2577 | (let ((minibuffer-window (minibuffer-window))) | 2581 | (let ((minibuffer-window (minibuffer-window))) |
| 2578 | (cond | 2582 | (cond |
| @@ -2605,8 +2609,7 @@ Interactively, if no argument is given, make the selected window | |||
| 2605 | one line smaller. If optional argument HORIZONTAL is non-nil, | 2609 | one line smaller. If optional argument HORIZONTAL is non-nil, |
| 2606 | make selected window narrower by DELTA columns. If DELTA is | 2610 | make selected window narrower by DELTA columns. If DELTA is |
| 2607 | negative, enlarge selected window by -DELTA lines or columns. | 2611 | negative, enlarge selected window by -DELTA lines or columns. |
| 2608 | Also see the `window-min-height' variable. | 2612 | Also see the `window-min-height' variable." |
| 2609 | Return nil." | ||
| 2610 | (interactive "p") | 2613 | (interactive "p") |
| 2611 | (let ((minibuffer-window (minibuffer-window))) | 2614 | (let ((minibuffer-window (minibuffer-window))) |
| 2612 | (cond | 2615 | (cond |
| @@ -3049,8 +3052,10 @@ WINDOW must be a live window and defaults to the selected one." | |||
| 3049 | (set-marker (nth 2 entry) point)) | 3052 | (set-marker (nth 2 entry) point)) |
| 3050 | ;; Make new markers. | 3053 | ;; Make new markers. |
| 3051 | (list (copy-marker start) | 3054 | (list (copy-marker start) |
| 3052 | (copy-marker point))))) | 3055 | (copy-marker |
| 3053 | 3056 | ;; Preserve window-point-insertion-type | |
| 3057 | ;; (Bug#12588). | ||
| 3058 | point window-point-insertion-type))))) | ||
| 3054 | (set-window-prev-buffers | 3059 | (set-window-prev-buffers |
| 3055 | window (cons entry (window-prev-buffers window)))))))) | 3060 | window (cons entry (window-prev-buffers window)))))))) |
| 3056 | 3061 | ||
| @@ -4555,13 +4560,17 @@ element is BUFFER." | |||
| 4555 | ;; If WINDOW has a quit-restore parameter, reset its car. | 4560 | ;; If WINDOW has a quit-restore parameter, reset its car. |
| 4556 | (setcar (window-parameter window 'quit-restore) 'same)) | 4561 | (setcar (window-parameter window 'quit-restore) 'same)) |
| 4557 | ;; WINDOW shows another buffer. | 4562 | ;; WINDOW shows another buffer. |
| 4558 | (set-window-parameter | 4563 | (with-current-buffer (window-buffer window) |
| 4559 | window 'quit-restore | 4564 | (set-window-parameter |
| 4560 | (list 'other | 4565 | window 'quit-restore |
| 4561 | ;; A quadruple of WINDOW's buffer, start, point and height. | 4566 | (list 'other |
| 4562 | (list (window-buffer window) (window-start window) | 4567 | ;; A quadruple of WINDOW's buffer, start, point and height. |
| 4563 | (window-point window) (window-total-size window)) | 4568 | (list (current-buffer) (window-start window) |
| 4564 | (selected-window) buffer)))) | 4569 | ;; Preserve window-point-insertion-type (Bug#12588). |
| 4570 | (copy-marker | ||
| 4571 | (window-point window) window-point-insertion-type) | ||
| 4572 | (window-total-size window)) | ||
| 4573 | (selected-window) buffer))))) | ||
| 4565 | ((eq type 'window) | 4574 | ((eq type 'window) |
| 4566 | ;; WINDOW has been created on an existing frame. | 4575 | ;; WINDOW has been created on an existing frame. |
| 4567 | (set-window-parameter | 4576 | (set-window-parameter |
| @@ -5170,11 +5179,12 @@ is higher than WINDOW." | |||
| 5170 | (error nil)))) | 5179 | (error nil)))) |
| 5171 | 5180 | ||
| 5172 | (defun window--display-buffer (buffer window type &optional alist dedicated) | 5181 | (defun window--display-buffer (buffer window type &optional alist dedicated) |
| 5173 | "Display BUFFER in WINDOW and make its frame visible. | 5182 | "Display BUFFER in WINDOW. |
| 5174 | TYPE must be one of the symbols `reuse', `window' or `frame' and | 5183 | TYPE must be one of the symbols `reuse', `window' or `frame' and |
| 5175 | is passed unaltered to `display-buffer-record-window'. Set | 5184 | is passed unaltered to `display-buffer-record-window'. ALIST is |
| 5176 | `window-dedicated-p' to DEDICATED if non-nil. Return WINDOW if | 5185 | the alist argument of `display-buffer'. Set `window-dedicated-p' |
| 5177 | BUFFER and WINDOW are live." | 5186 | to DEDICATED if non-nil. Return WINDOW if BUFFER and WINDOW are |
| 5187 | live." | ||
| 5178 | (when (and (buffer-live-p buffer) (window-live-p window)) | 5188 | (when (and (buffer-live-p buffer) (window-live-p window)) |
| 5179 | (display-buffer-record-window type window buffer) | 5189 | (display-buffer-record-window type window buffer) |
| 5180 | (unless (eq buffer (window-buffer window)) | 5190 | (unless (eq buffer (window-buffer window)) |
| @@ -5187,10 +5197,10 @@ BUFFER and WINDOW are live." | |||
| 5187 | (let ((parameter (window-parameter window 'quit-restore)) | 5197 | (let ((parameter (window-parameter window 'quit-restore)) |
| 5188 | (height (cdr (assq 'window-height alist))) | 5198 | (height (cdr (assq 'window-height alist))) |
| 5189 | (width (cdr (assq 'window-width alist)))) | 5199 | (width (cdr (assq 'window-width alist)))) |
| 5190 | (when (or (memq type '(window frame)) | 5200 | (when (or (eq type 'window) |
| 5191 | (and (eq (car parameter) 'same) | 5201 | (and (eq (car parameter) 'same) |
| 5192 | (memq (nth 1 parameter) '(window frame)))) | 5202 | (eq (nth 1 parameter) 'window))) |
| 5193 | ;; Adjust height of new window or frame. | 5203 | ;; Adjust height of window if asked for. |
| 5194 | (cond | 5204 | (cond |
| 5195 | ((not height)) | 5205 | ((not height)) |
| 5196 | ((numberp height) | 5206 | ((numberp height) |
| @@ -5201,19 +5211,12 @@ BUFFER and WINDOW are live." | |||
| 5201 | (* (window-total-size (frame-root-window window)) | 5211 | (* (window-total-size (frame-root-window window)) |
| 5202 | height)))) | 5212 | height)))) |
| 5203 | (delta (- new-height (window-total-size window)))) | 5213 | (delta (- new-height (window-total-size window)))) |
| 5204 | (cond | 5214 | (when (and (window--resizable-p window delta nil 'safe) |
| 5205 | ((and (window--resizable-p window delta nil 'safe) | 5215 | (window-combined-p window)) |
| 5206 | (window-combined-p window)) | 5216 | (window-resize window delta nil 'safe)))) |
| 5207 | (window-resize window delta nil 'safe)) | ||
| 5208 | ((or (eq type 'frame) | ||
| 5209 | (and (eq (car parameter) 'same) | ||
| 5210 | (eq (nth 1 parameter) 'frame))) | ||
| 5211 | (set-frame-height | ||
| 5212 | (window-frame window) | ||
| 5213 | (+ (frame-height (window-frame window)) delta)))))) | ||
| 5214 | ((functionp height) | 5217 | ((functionp height) |
| 5215 | (ignore-errors (funcall height window)))) | 5218 | (ignore-errors (funcall height window)))) |
| 5216 | ;; Adjust width of a window or frame. | 5219 | ;; Adjust width of window if asked for. |
| 5217 | (cond | 5220 | (cond |
| 5218 | ((not width)) | 5221 | ((not width)) |
| 5219 | ((numberp width) | 5222 | ((numberp width) |
| @@ -5224,18 +5227,12 @@ BUFFER and WINDOW are live." | |||
| 5224 | (* (window-total-size (frame-root-window window) t) | 5227 | (* (window-total-size (frame-root-window window) t) |
| 5225 | width)))) | 5228 | width)))) |
| 5226 | (delta (- new-width (window-total-size window t)))) | 5229 | (delta (- new-width (window-total-size window t)))) |
| 5227 | (cond | 5230 | (when (and (window--resizable-p window delta t 'safe) |
| 5228 | ((and (window--resizable-p window delta t 'safe) | 5231 | (window-combined-p window t)) |
| 5229 | (window-combined-p window t)) | 5232 | (window-resize window delta t 'safe)))) |
| 5230 | (window-resize window delta t 'safe)) | ||
| 5231 | ((or (eq type 'frame) | ||
| 5232 | (and (eq (car parameter) 'same) | ||
| 5233 | (eq (nth 1 parameter) 'frame))) | ||
| 5234 | (set-frame-width | ||
| 5235 | (window-frame window) | ||
| 5236 | (+ (frame-width (window-frame window)) delta)))))) | ||
| 5237 | ((functionp width) | 5233 | ((functionp width) |
| 5238 | (ignore-errors (funcall width window)))))) | 5234 | (ignore-errors (funcall width window)))))) |
| 5235 | |||
| 5239 | window)) | 5236 | window)) |
| 5240 | 5237 | ||
| 5241 | (defun window--maybe-raise-frame (frame) | 5238 | (defun window--maybe-raise-frame (frame) |
| @@ -5295,13 +5292,19 @@ See `display-buffer' for details.") | |||
| 5295 | "Alist of conditional actions for `display-buffer'. | 5292 | "Alist of conditional actions for `display-buffer'. |
| 5296 | This is a list of elements (CONDITION . ACTION), where: | 5293 | This is a list of elements (CONDITION . ACTION), where: |
| 5297 | 5294 | ||
| 5298 | CONDITION is either a regexp matching buffer names, or a function | 5295 | CONDITION is either a regexp matching buffer names, or a |
| 5299 | that takes a buffer and returns a boolean. | 5296 | function that takes two arguments - a buffer name and the |
| 5297 | ACTION argument of `display-buffer' - and returns a boolean. | ||
| 5300 | 5298 | ||
| 5301 | ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a | 5299 | ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a |
| 5302 | function or a list of functions. Each such function should | 5300 | function or a list of functions. Each such function should |
| 5303 | accept two arguments: a buffer to display and an alist of the | 5301 | accept two arguments: a buffer to display and an alist of the |
| 5304 | same form as ALIST. See `display-buffer' for details." | 5302 | same form as ALIST. See `display-buffer' for details. |
| 5303 | |||
| 5304 | `display-buffer' scans this alist until it either finds a | ||
| 5305 | matching regular expression or the function specified by a | ||
| 5306 | condition returns non-nil. In any of these cases, it adds the | ||
| 5307 | associated action to the list of actions it will try." | ||
| 5305 | :type `(alist :key-type | 5308 | :type `(alist :key-type |
| 5306 | (choice :tag "Condition" | 5309 | (choice :tag "Condition" |
| 5307 | regexp | 5310 | regexp |
| @@ -5335,15 +5338,16 @@ specified, e.g. by the user options `display-buffer-alist' or | |||
| 5335 | `display-buffer-base-action'. See `display-buffer'.") | 5338 | `display-buffer-base-action'. See `display-buffer'.") |
| 5336 | (put 'display-buffer-fallback-action 'risky-local-variable t) | 5339 | (put 'display-buffer-fallback-action 'risky-local-variable t) |
| 5337 | 5340 | ||
| 5338 | (defun display-buffer-assq-regexp (buffer-name alist) | 5341 | (defun display-buffer-assq-regexp (buffer-name alist action) |
| 5339 | "Retrieve ALIST entry corresponding to BUFFER-NAME." | 5342 | "Retrieve ALIST entry corresponding to BUFFER-NAME. |
| 5343 | ACTION is the action argument passed to `display-buffer'." | ||
| 5340 | (catch 'match | 5344 | (catch 'match |
| 5341 | (dolist (entry alist) | 5345 | (dolist (entry alist) |
| 5342 | (let ((key (car entry))) | 5346 | (let ((key (car entry))) |
| 5343 | (when (or (and (stringp key) | 5347 | (when (or (and (stringp key) |
| 5344 | (string-match-p key buffer-name)) | 5348 | (string-match-p key buffer-name)) |
| 5345 | (and (symbolp key) (functionp key) | 5349 | (and (functionp key) |
| 5346 | (funcall key buffer-name alist))) | 5350 | (funcall key buffer-name action))) |
| 5347 | (throw 'match (cdr entry))))))) | 5351 | (throw 'match (cdr entry))))))) |
| 5348 | 5352 | ||
| 5349 | (defvar display-buffer--same-window-action | 5353 | (defvar display-buffer--same-window-action |
| @@ -5453,8 +5457,8 @@ argument, ACTION is t." | |||
| 5453 | (funcall display-buffer-function buffer inhibit-same-window) | 5457 | (funcall display-buffer-function buffer inhibit-same-window) |
| 5454 | ;; Otherwise, use the defined actions. | 5458 | ;; Otherwise, use the defined actions. |
| 5455 | (let* ((user-action | 5459 | (let* ((user-action |
| 5456 | (display-buffer-assq-regexp (buffer-name buffer) | 5460 | (display-buffer-assq-regexp |
| 5457 | display-buffer-alist)) | 5461 | (buffer-name buffer) display-buffer-alist action)) |
| 5458 | (special-action (display-buffer--special-action buffer)) | 5462 | (special-action (display-buffer--special-action buffer)) |
| 5459 | ;; Extra actions from the arguments to this function: | 5463 | ;; Extra actions from the arguments to this function: |
| 5460 | (extra-action | 5464 | (extra-action |
| @@ -6068,22 +6072,26 @@ of `fit-frame-to-buffer-max-height' and `window-min-height'." | |||
| 6068 | :group 'help) | 6072 | :group 'help) |
| 6069 | 6073 | ||
| 6070 | (defcustom fit-frame-to-buffer-bottom-margin 4 | 6074 | (defcustom fit-frame-to-buffer-bottom-margin 4 |
| 6071 | "Bottom margin for `fit-frame-to-buffer'. | 6075 | "Bottom margin for the command `fit-frame-to-buffer'. |
| 6072 | This is the number of lines `fit-frame-to-buffer' leaves free at the | 6076 | This is the number of lines that function leaves free at the bottom of |
| 6073 | bottom of the display in order to not obscure the system task bar." | 6077 | the display, in order to not obscure any system task bar or panel. |
| 6078 | If you do not have one (or if it is vertical) you might want to | ||
| 6079 | reduce this. If it is thicker, you might want to increase this." | ||
| 6080 | ;; If you set this too small, fit-frame-to-buffer can shift the | ||
| 6081 | ;; frame up to avoid the panel. | ||
| 6074 | :type 'integer | 6082 | :type 'integer |
| 6075 | :version "24.3" | 6083 | :version "24.3" |
| 6076 | :group 'windows) | 6084 | :group 'windows) |
| 6077 | 6085 | ||
| 6078 | (defun fit-frame-to-buffer (&optional frame max-height min-height) | 6086 | (defun fit-frame-to-buffer (&optional frame max-height min-height) |
| 6079 | "Adjust height of FRAME to display its buffer's contents exactly. | 6087 | "Adjust height of FRAME to display its buffer contents exactly. |
| 6080 | FRAME can be any live frame and defaults to the selected one. | 6088 | FRAME can be any live frame and defaults to the selected one. |
| 6081 | 6089 | ||
| 6082 | Optional argument MAX-HEIGHT specifies the maximum height of | 6090 | Optional argument MAX-HEIGHT specifies the maximum height of FRAME. |
| 6083 | FRAME and defaults to the height of the display below the current | 6091 | It defaults to the height of the display below the current |
| 6084 | top line of FRAME minus FIT-FRAME-TO-BUFFER-BOTTOM-MARGIN. | 6092 | top line of FRAME, minus `fit-frame-to-buffer-bottom-margin'. |
| 6085 | Optional argument MIN-HEIGHT specifies the minimum height of | 6093 | Optional argument MIN-HEIGHT specifies the minimum height of FRAME. |
| 6086 | FRAME." | 6094 | The default corresponds to `window-min-height'." |
| 6087 | (interactive) | 6095 | (interactive) |
| 6088 | (setq frame (window-normalize-frame frame)) | 6096 | (setq frame (window-normalize-frame frame)) |
| 6089 | (let* ((root (frame-root-window frame)) | 6097 | (let* ((root (frame-root-window frame)) |
| @@ -6160,6 +6168,10 @@ defaults to `window-min-height'. Both MAX-HEIGHT and MIN-HEIGHT | |||
| 6160 | are specified in lines and include the mode line and header line, | 6168 | are specified in lines and include the mode line and header line, |
| 6161 | if any. | 6169 | if any. |
| 6162 | 6170 | ||
| 6171 | If WINDOW is a full height window, then if the option | ||
| 6172 | `fit-frame-to-buffer' is non-nil, this calls the function | ||
| 6173 | `fit-frame-to-buffer' to adjust the frame height. | ||
| 6174 | |||
| 6163 | Return the number of lines by which WINDOW was enlarged or | 6175 | Return the number of lines by which WINDOW was enlarged or |
| 6164 | shrunk. If an error occurs during resizing, return nil but don't | 6176 | shrunk. If an error occurs during resizing, return nil but don't |
| 6165 | signal an error. | 6177 | signal an error. |
diff --git a/lisp/woman.el b/lisp/woman.el index 46b6b680440..1410a8971ad 100644 --- a/lisp/woman.el +++ b/lisp/woman.el | |||
| @@ -1550,11 +1550,13 @@ Also make each path-info component into a list. | |||
| 1550 | (woman-dired-define-keys) | 1550 | (woman-dired-define-keys) |
| 1551 | (add-hook 'dired-mode-hook 'woman-dired-define-keys)) | 1551 | (add-hook 'dired-mode-hook 'woman-dired-define-keys)) |
| 1552 | 1552 | ||
| 1553 | (declare-function dired-get-filename "dired" | ||
| 1554 | (&optional localp no-error-if-not-filep)) | ||
| 1555 | |||
| 1553 | ;;;###autoload | 1556 | ;;;###autoload |
| 1554 | (defun woman-dired-find-file () | 1557 | (defun woman-dired-find-file () |
| 1555 | "In dired, run the WoMan man-page browser on this file." | 1558 | "In dired, run the WoMan man-page browser on this file." |
| 1556 | (interactive) | 1559 | (interactive) |
| 1557 | ;; dired-get-filename is defined in dired.el | ||
| 1558 | (woman-find-file (dired-get-filename))) | 1560 | (woman-find-file (dired-get-filename))) |
| 1559 | 1561 | ||
| 1560 | 1562 | ||
| @@ -1947,6 +1949,9 @@ Optional argument REDRAW, if non-nil, forces mode line to be updated." | |||
| 1947 | (message "Woman fill column set to %s." | 1949 | (message "Woman fill column set to %s." |
| 1948 | (if woman-fill-frame "frame width" woman-fill-column))) | 1950 | (if woman-fill-frame "frame width" woman-fill-column))) |
| 1949 | 1951 | ||
| 1952 | (declare-function apropos-print "apropos" | ||
| 1953 | (do-keys spacing &optional text nosubst)) | ||
| 1954 | |||
| 1950 | (defun woman-mini-help () | 1955 | (defun woman-mini-help () |
| 1951 | "Display WoMan commands and user options in an `apropos' buffer." | 1956 | "Display WoMan commands and user options in an `apropos' buffer." |
| 1952 | ;; Based on apropos-command in apropos.el | 1957 | ;; Based on apropos-command in apropos.el |
| @@ -2191,7 +2196,7 @@ To be called on original buffer and any .so insertions." | |||
| 2191 | (face-underline-p face)) | 2196 | (face-underline-p face)) |
| 2192 | (let ((face-no-ul (intern (concat face-name "-no-ul")))) | 2197 | (let ((face-no-ul (intern (concat face-name "-no-ul")))) |
| 2193 | (copy-face face face-no-ul) | 2198 | (copy-face face face-no-ul) |
| 2194 | (set-face-underline-p face-no-ul nil))))))) | 2199 | (set-face-underline face-no-ul nil))))))) |
| 2195 | 2200 | ||
| 2196 | ;; Preprocessors | 2201 | ;; Preprocessors |
| 2197 | ;; ============= | 2202 | ;; ============= |