sxemacs
3 years agoSXEmacs v22.1.17 is released! v22.1.17
Steve Youngs [Wed, 2 Sep 2020 01:58:29 +0000 (11:58 +1000)]
SXEmacs v22.1.17 is released!

* autogen.sh: Bump version / codename

* INSTALL: Some minor updates and re-wordings.

* PROBLEMS (Packages): Update.

* etc/NEWS: 22.1.17 news items

* info/sppm.texi: Bump versions.

* info/sxemacs/sxemacs.texi: Ditto.

* lisp/package-get.el (package-get-download-sites): Our packages
download site is HTTPS.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
3 years agoUpdates to my about.el bio.
Steve Youngs [Mon, 31 Aug 2020 02:02:48 +0000 (12:02 +1000)]
Updates to my about.el bio.

* lisp/about.el (sxemacs-hackers): Add Jay.
(about-url-alist): Remove my EMchat and Google Plus URLs.
Remove sxemacs-shop URL.
Update my init files URL.
Add SY Writing URL.
(about-personal-info): Update my bio and links.

* etc/photos/steve.png: Update.
* etc/photos/stevem.png: Update.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
3 years agoPKG-Related tweaks / improvements
Steve Youngs [Sat, 4 Jul 2020 03:12:57 +0000 (13:12 +1000)]
PKG-Related tweaks / improvements

Just a couple of small changes related to packaging.  The index file
has been renamed (it isn't signed so giving it a 'gpg' extension was
just silly). Also, the FTP site hasn't existed for years so removed
that from the list of download sites.

* etc/Makefile.am (dist_etc_DATA): 'package-index.LATEST.gpg' ->
'package-index'

* lisp/package-get.el (package-get-base-filename): Rename to
'package-index'
(package-get-download-sites): Comment out the FTP site.

* etc/package-index.LATEST.gpg: Removed.

* etc/package-index: New.  Replaces above.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoAutotools updates and fix FFI detection
Steve Youngs [Tue, 21 Apr 2020 05:28:33 +0000 (15:28 +1000)]
Autotools updates and fix FFI detection

Our config.{guess,sub} haven't been updated in decades... Until
today. This set of changes also brings a fix for FFI detection so now
if your libffi has a pkg-config file installed we should be able to
find your headers.

* ffi-autoconf:
  Update configgmp.{guess,sub} from GMP v6.2.0
  Build Fix -- FFI auto-detection via pkg-config

4 years agoUpdate configgmp.{guess,sub} from GMP v6.2.0
Steve Youngs [Tue, 21 Apr 2020 05:27:44 +0000 (15:27 +1000)]
Update configgmp.{guess,sub} from GMP v6.2.0

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoBuild Fix -- FFI auto-detection via pkg-config
Steve Youngs [Mon, 20 Apr 2020 11:39:00 +0000 (21:39 +1000)]
Build Fix -- FFI auto-detection via pkg-config

* m4/sxe-emodffi.m4 (SXE_FFI_TRY_PKGCONFIG): Save the results of
SXE_PC_CHECK_CPPFLAGS into FFI_CPPFLAGS _before_ checking for
headers.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoImprovements to #'directory-files, #'directory-files-recur
Steve Youngs [Sun, 19 Apr 2020 06:07:56 +0000 (16:07 +1000)]
Improvements to #'directory-files, #'directory-files-recur

This set of changes also fixes a bug that was causing an invalid
byte-code error from #'describe-function.

* merges: (Via Nelson Ferreira)
  Improve directory-files{,-recur} options
  Remove SYMLINK-IS-FILE argument
  Provide full pathname in docstrings for loaded modules
  Address failure to file of alias definition after it changes

4 years agoImprove directory-files{,-recur} options
Nelson Ferreira [Sat, 18 Apr 2020 22:51:53 +0000 (18:51 -0400)]
Improve directory-files{,-recur} options

Add the following FILES-ONLY options:
- dirs  to return only directories and symlinks to directories
- files  to return only files -- but *NOT* symlinks to files
- symlinks  to return only symlinks -- but *NOT* real files
          or directories.
Change the following FILES-ONLY options:
- t  to return only files and symlinks to files
- subdir  to return only subdirectories -- but *NOT* symlinks to
  directories, nor the current or parent directories

This means the behaviour with the following tree:
tmp/
tmp/bar -> foo
tmp/baz/
tmp/baz/baz/
tmp/baz/baz/foo/
tmp/baz/baz/boz -> boz
tmp/baz/fool -> ../baz/
tmp/baz/biz
tmp/baz/booze -> baz/
tmp/baz/boz -> biz
tmp/foz -> baz/
tmp/foo

The following will yield:
(directory-files "tmp" nil nil nil t)
=> ("bar" "foo" "foz")

(directory-files "tmp" nil nil nil nil)
=> ("." ".." "bar" "baz" "foo" "foz")

(directory-files "tmp" nil nil nil 'files)
=> ("foo")

(directory-files "tmp" nil nil nil 'dirs)
("." ".." "baz")

(directory-files "tmp" nil nil nil 'symlinks)
=> ("bar" "foz")

(directory-files "tmp" nil nil nil 'subdir)
=> ("baz")

(directory-files-recur "~/tmp" nil nil nil t 10 nil)
=> ("bar" "baz/baz/boz" "baz/biz" "baz/boz" "baz/fool" "foo")

(directory-files-recur "~/tmp" nil nil nil t 10 t)
        => ("bar" "baz/baz/boz" "baz/biz" "baz/booze" "baz/boz"
    "baz/fool" "foo" "foz")

(directory-files-recur "~/tmp" nil nil nil nil 10 nil)
        => ("bar" "baz" "baz/baz" "baz/baz/boz" "baz/baz/foo" "baz/biz"
    "baz/booze" "baz/boz" "baz/fool" "foo" "foz")

(directory-files-recur "~/tmp" nil nil nil nil 10 t)
=> ("bar" "baz" "baz/baz" "baz/baz/boz" "baz/baz/foo" "baz/biz"
    "baz/booze" "baz/boz" "baz/fool" "foo" "foz")

(directory-files-recur "~/tmp" nil nil nil 'files 10 nil)
=> ("baz/biz" "foo")

(directory-files-recur "~/tmp" nil nil nil 'dirs 10 t)
=> ("baz" "baz/baz" "baz/baz/foo")

(directory-files-recur "~/tmp" nil nil nil 'symlinks 10 nil)
=> ("bar" "baz/baz/boz" "baz/booze" "baz/boz" "baz/fool" "foz")

(directory-files-recur "~/tmp" nil nil nil 'subdir 10 t)
=> ("baz" "baz/baz" "baz/baz/foo")

* dired.c (TRIVIAL_DIRECTORY_ENTRY): Reorder the strcmp arguments.
* dired.c: Remove Qsymlink, Qalive_symlink, Qdead_symlink unused
symbols.  Add new symbols Qsubdir, Qsymlinks, Qfiles, Qdirs to be
used in directory-files.
* dired.c (dfr_inner): Determine separately whether a file is a
symlink or a directory.  If it is a symlink further determine if
the linked file is a directory.  Include the result according to the
new options and changed meanings under FILES-ONLY symbol.  Determine
recursion separately of whether file is directory.  Always avoid
recursion of the current and parent directories.
* dired.c (Fdirectory_files): Update DOCSTRING
* dired.c (Fdirectory_files_recur): Update DOCSTRING
* dired.c (syms_of_dired): Add new symbols Qsubdir, Qsymlinks,
Qfiles, Qdirs

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoRemove SYMLINK-IS-FILE argument
Nelson Ferreira [Sat, 18 Apr 2020 18:50:41 +0000 (14:50 -0400)]
Remove SYMLINK-IS-FILE argument

Realized this argument does not actually make sense in the context
of a single directory, nor does bloom-filter.  Removing the arguments.

* dired.c (Fdirectory_files): Keep previous setting
i.e. symlink_file_p = 0.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoProvide full pathname in docstrings for loaded modules
Nelson Ferreira [Sat, 18 Apr 2020 18:17:49 +0000 (14:17 -0400)]
Provide full pathname in docstrings for loaded modules

* lread.c (Fload_internal): Use Ffile_truename to get the full
path of the located file and use it in the readevalloop.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoAddress failure to file of alias definition after it changes
Nelson Ferreira [Sat, 18 Apr 2020 15:57:47 +0000 (11:57 -0400)]
Address failure to file of alias definition after it changes

If the symbol of an alias changes, describe-function would fail with
   Invalid byte code: "Object file name not stored in doc file"

* help.el (describe-function-1): When trying to find the filename
of an alias find the filename of the symbol-function not the
alias.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoTurn off PDF support in ffi-wand.
Steve Youngs [Sat, 18 Apr 2020 10:40:41 +0000 (20:40 +1000)]
Turn off PDF support in ffi-wand.

Some versions of libWand struggled with PDF so easier just to turn it
off here.

* lisp/ffi/ffi-wand.el (Wand-file-supported-for-read-p): Don't do
PDF.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoCouple of small updates from Nelson
Steve Youngs [Sat, 11 Apr 2020 12:52:12 +0000 (22:52 +1000)]
Couple of small updates from Nelson

* merges:
  Handle not bound allow-remote-paths in file-remote-p
  Report the pkg-dir not writable
  Fixup the other developers repos list in SPPM

4 years agoHandle not bound allow-remote-paths in file-remote-p
Nelson Ferreira [Fri, 10 Apr 2020 22:35:40 +0000 (18:35 -0400)]
Handle not bound allow-remote-paths in file-remote-p

* lisp/files.el(file-remote-p): Use when-boundp instead of
declared-boundp, as it will derefence the variable anyway.

4 years agoReport the pkg-dir not writable
Nelson Ferreira [Fri, 10 Apr 2020 22:33:18 +0000 (18:33 -0400)]
Report the pkg-dir not writable

* lisp/package-admin(package-admin-get-install-dir): Add pkg-dir
to message asking to use local directory

4 years agoFixup the other developers repos list in SPPM
Nelson Ferreira [Fri, 10 Apr 2020 22:27:06 +0000 (18:27 -0400)]
Fixup the other developers repos list in SPPM

4 years agoFix -- #'directory-files{,-recur} MATCH arg handling [From Nelson]
Steve Youngs [Sat, 4 Apr 2020 00:08:50 +0000 (10:08 +1000)]
Fix -- #'directory-files{,-recur} MATCH arg handling [From Nelson]

With these changes the docs for #'directory-files and its recursive
big brother, #'directory-files-recur are no longer telling fibs.  The
MATCH arg will indeed accept and use a predicate function.

Plus, #'directory-files now has SYMLINK_IS_FILE and BLOOM_FILTER args,
same as #'directory-files-recur.

* merges:
  Fix some long lines in dired.c
  Add match-full option to directory-files{,-recur}
  Add to directory-files SYMLINK_IS_FILE and BLOOM_FILTER args
  Fix directory-files{,-recur} detection of symlinks to dirs
  Use 'subdir as per (directory-files) documentation
  Remove #if 0 varargs
  Update directory-files{,-recur} argument checking
  Remove unused #ifdef USE_MATCH_ARG
  Allow pathname_matches_p to be called if match is predicate

4 years agoFix some long lines in dired.c
Nelson Ferreira [Fri, 3 Apr 2020 12:35:41 +0000 (08:35 -0400)]
Fix some long lines in dired.c

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoAdd match-full option to directory-files{,-recur}
Nelson Ferreira [Fri, 3 Apr 2020 12:32:45 +0000 (08:32 -0400)]
Add match-full option to directory-files{,-recur}

    This option fixes the oddity that when matching the file either
    with regex or with predicate one could only use the actual
    filename, and could not consider the full path.  This add
    'match-full to the FULL option, and in this case the regex and
    the predicate will receive the full path not just the filename

    * src/dired.c(directory-files): Add match-full support
      (directory-files-recur): Add match-full support

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoAdd to directory-files SYMLINK_IS_FILE and BLOOM_FILTER args
Nelson Ferreira [Fri, 3 Apr 2020 12:23:53 +0000 (08:23 -0400)]
Add to directory-files SYMLINK_IS_FILE and BLOOM_FILTER args

    * src/dired.c(Fdirectory_files): There is no good reason to
    exclude these options existing in directory-files-recur from
    directory-files

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoFix directory-files{,-recur} detection of symlinks to dirs
Nelson Ferreira [Fri, 3 Apr 2020 12:11:49 +0000 (08:11 -0400)]
Fix directory-files{,-recur} detection of symlinks to dirs

    * src/dired.c(dfr_inner): For the systems without d_type in
      dirent, the code did not try to detect symlinks to directories,
      preventing 'subdir from working.  Added same logic for that
      branch as in the case where d_type is present.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoUse 'subdir as per (directory-files) documentation
Nelson Ferreira [Fri, 3 Apr 2020 12:06:59 +0000 (08:06 -0400)]
Use 'subdir as per (directory-files) documentation

    * lisp/loadup.el(really-early-error-handler): Use 'subdir instead
      of 'dirs-only

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoRemove #if 0 varargs
Nelson Ferreira [Fri, 3 Apr 2020 12:05:47 +0000 (08:05 -0400)]
Remove #if 0 varargs

       * src/dired.c(Fdirectory_files_recur): Remove #if 0 for vargars
         definition.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoUpdate directory-files{,-recur} argument checking
Nelson Ferreira [Thu, 2 Apr 2020 17:20:06 +0000 (13:20 -0400)]
Update directory-files{,-recur} argument checking

       * dired.c(Fdirectory_files): Ensure directory is a string.
       (Fdirectory_files_recur): Remove check for match. It is done in
       directory_files_magic, which also will allow for a predicate.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoRemove unused #ifdef USE_MATCH_ARG
Nelson Ferreira [Thu, 2 Apr 2020 17:17:04 +0000 (13:17 -0400)]
Remove unused #ifdef USE_MATCH_ARG

       * src/dired.c: USE_MATCH_ARG is always 1. No sense in keeping
         the #ifdef

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoAllow pathname_matches_p to be called if match is predicate
Nelson Ferreira [Thu, 2 Apr 2020 15:58:33 +0000 (11:58 -0400)]
Allow pathname_matches_p to be called if match is predicate

      * src/dired.c(dfr_inner): Rely on caller of dfr_inner to
        guarantee that match is a predicate if the bufp is NULL.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
4 years agoGNU Compat -- Add WHEN and DOC args to #'define-obsolete-(var|fun)-alias
Steve Youngs [Thu, 2 Apr 2020 05:23:20 +0000 (15:23 +1000)]
GNU Compat -- Add WHEN and DOC args to #'define-obsolete-(var|fun)-alias

* lisp/obsolete.el (define-obsolete-variable-alias): Add optional
WHEN and DOC arguments.  They don't do anything, they exist purely
for GNU Emacs compatibility.
(define-obsolete-function-alias): Ditto.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoFix issue with find-file-magic-files-alist and TRAMP
Steve Youngs [Fri, 27 Mar 2020 11:53:46 +0000 (21:53 +1000)]
Fix issue with find-file-magic-files-alist and TRAMP

This prevents #'find-file-find-magic from trying to feed #'magic:file a
TRAMP filename.  In the past this wasn't an issue because #'magic:file did
not report errors from the shell or libmagic, it just silently returned
nil.  Not so anymore.

* lisp/files.el (find-file-find-magic): Return 'nil' if it is a
TRAMP filename.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoTexinfo 6.7 fixes
Steve Youngs [Mon, 23 Mar 2020 03:43:59 +0000 (13:43 +1000)]
Texinfo 6.7 fixes

This makes our docs compatible with texinfo-6.7.  There was one file,
sxemacs-faq.texi, that I ended up converting to UTF-8.  Please be
aware and take care when editing that one from now on.

I did the conversion outside of SXEmacs with iconv and sed, so as to
eliminate any risk of corruption.  Here is how...

,----
| iconv -f ISO-8859-1 -t UTF-8//TRANSLIT -o utf-sxemacs-faq.texi
|   sxemacs-faq.texi &&
|
| sed -i -e 's/iso-2022-8/utf-8/' -e '3i@documentencoding UTF-8' \
|   utf-sxemacs-faq.texi &&
| mv -v {utf-,}sxemacs-faq.texi
`----

I did attempt to find any occurances of chars it couldn't convert, but
I'm sure you'll agree that searching for the odd out of place `?' in
a large FAQ... well, "needle in a hay-stack" comes to mind.

* info/sxemacs-faq.texi: Convert file t UTF-8.
Set @documentencoding UTF-8
(Q1.3.8): Fix a @ref

* info/sppm.texi (Sending a patch from a git repo): Remove
@indent from within `@code' sections. It's frowned upon in
texinfo 6.7.

* info/lispref/ldap.texi (LDAP Variables): Fix file
        corruption.
Reported-by: Andrés Ramírez <rrandresf@gmail.com>
Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoEnsure #'magic:find-file-noselect creates unique buffers
Steve Youngs [Tue, 17 Mar 2020 04:08:18 +0000 (14:08 +1000)]
Ensure #'magic:find-file-noselect creates unique buffers

Having `magic:find-file-magic-alist-enable' features turned on, the
following scenario could eventuate...

  C-x C-f /path/one/to/a/file/called/Wanda

  C-x C-f /path/two/to/another/file/called/Wanda

would result in the *same* buffer being used for *both* files.
Imagine the fun, especially when both paths are writable for you.

This change fixes that.

* lisp/ffi/ffi-magic.el (magic:find-file-noselect): Use
#'create-file-buffer, not #'get-buffer-create. Gah! What was I
thinking?!

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoUpdate alist.el -- Use the newer version from APEL.
Steve Youngs [Sun, 15 Mar 2020 07:20:17 +0000 (17:20 +1000)]
Update alist.el -- Use the newer version from APEL.

Ever since our inception the copy of alist.el in the APEL package has
shadowed the one we have in core.  As the one in APEL is slightly
newer, I am replacing the core alist.el with that version.  The one in
the APEL package will be marked as "suppressed".

* lisp/alist.el: Updated from the copy of this lib in the APEL
package.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoUpdates from Nelson
Steve Youngs [Sun, 15 Mar 2020 01:30:46 +0000 (11:30 +1000)]
Updates from Nelson

* merges:
  Spawn new process with ADDR_NO_RANDOMIZE personality if not already set
  Add raw_execvp, to use with already converted strings
  Detect sys/personality
  Rename __alloc_size to __sxe_alloc_size to avoid clash with clang internals

4 years agoSpawn new process with ADDR_NO_RANDOMIZE personality if not already set
Nelson Ferreira [Sat, 14 Mar 2020 23:39:12 +0000 (19:39 -0400)]
Spawn new process with ADDR_NO_RANDOMIZE personality if not already set

4 years agoAdd raw_execvp, to use with already converted strings
Nelson Ferreira [Sat, 14 Mar 2020 23:29:24 +0000 (19:29 -0400)]
Add raw_execvp, to use with already converted strings

4 years agoDetect sys/personality
Nelson Ferreira [Sat, 14 Mar 2020 23:28:35 +0000 (19:28 -0400)]
Detect sys/personality

4 years agoRename __alloc_size to __sxe_alloc_size to avoid clash with clang internals
Nelson Ferreira [Sat, 14 Mar 2020 17:10:04 +0000 (13:10 -0400)]
Rename __alloc_size to __sxe_alloc_size to avoid clash with clang internals

4 years agoImprove #'magic:file interactive use + misc fixes
Steve Youngs [Mon, 9 Mar 2020 22:11:20 +0000 (08:11 +1000)]
Improve #'magic:file interactive use + misc fixes

In the scenario where ffi-magic had been enabled for
`find-file-magic-files-alist', prefix args could leak through to
 #'magic:file from outside callers (C-u C-x C-f, for example).  This
changeset guards against that.

Somewhat related to that, #'magic:file-coding-system-p will return
nil if 'coding-system-for-read' had been explicitly set prior.  IOW
ffi-magic won't try to set the coding-system if something else is
already trying to.

The flags completion requires `crm' from the edit-utils package so
we error if that isn't installed, pointing the user in the right
direction.

It is now possible to load ffi-magic more than once without any
warnings.

* lisp/ffi/ffi-magic.el (ffi-magic-persistent-flags): Set risky
via inline autoload cookie.
(ffi-magic-no-safety): Ditto.
(magic_t): Define only if not already defined.
(magic-options): Ditto.
(magic:file): Put prefix arg and flags completion _inside_ the
#'interactive so we're not affected by prefix args leaking in from
outside callers.
Error if 'crm' isn't available, mentioning "edit-utils" pkg.
(magic:file-coding-system-p): Return nil if
`coding-system-for-read' had been explicitly set beforehand.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoType fix
Steve Youngs [Sat, 29 Feb 2020 03:19:40 +0000 (13:19 +1000)]
Type fix

4 years agoTypo fix
Steve Youngs [Sat, 29 Feb 2020 03:17:03 +0000 (13:17 +1000)]
Typo fix

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoSet modes and run appropriate hooks when visiting a file via magic
Steve Youngs [Fri, 28 Feb 2020 08:34:48 +0000 (18:34 +1000)]
Set modes and run appropriate hooks when visiting a file via magic

This little change makes a big difference and now it should be quite
safe to add `(magic:find-file-magic-files-alist)' into your init.el.

* lisp/ffi/ffi-magic.el (magic:find-file-noselect):
  Call #'after-find-file to ensure modes and hooks are done
  right.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoImprove git-for-steve.sh script
Steve Youngs [Fri, 28 Feb 2020 05:58:24 +0000 (15:58 +1000)]
Improve git-for-steve.sh script

* .gitattributes: New.

* contrib/git-for-steve.sh (set_diff): Try to get the function
name onto the diff hunk header. Set the git config to do the
magic.
(set_fsck): Set 'transfer.fsckObjects' in the config.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoMake Info-mode usable with UTF-8 info docs.
Steve Youngs [Wed, 26 Feb 2020 05:24:19 +0000 (15:24 +1000)]
Make Info-mode usable with UTF-8 info docs.

This changeset, which I fully admit, is an ugly hack.  Sorry, not
sorry. But it means that UTF-8 info documents are now both readable
and navigable.  Finally I can read info docs again!!

* lisp/info.el (Info-find-file-node): Add a horrible ugly hack to
the horrible ugly hack so that this won't lose when searching a
UTF-8 info file.
(Info-insert-file-contents): Cater for info files that have a
'Local variables' section.
Replace the funky chars throughout the file with their octal
numeric to keep things cleaner.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoUpdate sqlite, taglib, and wand for new 'magic:*' defuns.
Steve Youngs [Mon, 24 Feb 2020 20:50:08 +0000 (06:50 +1000)]
Update sqlite, taglib, and wand for new 'magic:*' defuns.

This updates a few things to use the new and improved ffi-magic.

* lisp/ffi/ffi-sqlite.el (sqlite-file-p): Use #'magic:file to get
the job done.

* lisp/ffi/ffi-wand.el (Wand-file-supported-for-read-p):
Use #'magic:file-image-p to test file type.

* lisp/ffi/ffi-taglib.el (taglib:mimetypes): New, replaces
`taglib:extensions'
(taglib:extensions): Removed.
(taglib:get-tag): Use #'magic:file to test for supported file
formats.
(taglib:list-all-tags): Ditto.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoA major update / rewrite of ffi-magic.el
Steve Youngs [Sun, 23 Feb 2020 13:33:39 +0000 (23:33 +1000)]
A major update / rewrite of ffi-magic.el

This changeset brings a good deal of file(1)'s capabilities.  The
file(1) options that are now supported in some fashion are:

  --apple, -d, -E, -e, --extension, -i, --mime-type,
  --mime-encoding, -k, -L, -p, -r, -s, -v, -z, -Z

Missing is: -P, but hopefully I'll nut that out soon.

The old #'magic:file-type has been made obsolete and has been replaced
with #'magic:file. See its doc for option flags that can be set and
example usage.

A form of error checking is on by default which comes in two waves:

  1) Option flags given are parsed through a sanitiser to help prevent
     causing unknown or unwanted results.  See
     `ffi-magic-sanitise-flags' and `ffi-magic-no-safety' to turn it
     off.

  2) Errors from libmagic and the shell are captured and reported as
     actual errors in SXEmacs.  This can be turned off if required.
     See `ffi-magic-persistent-flags'.

A few convenience functions have also been added:

  o #'magic:file-audio-p
  o #'magic:file-video-p
  o #'magic:file-image-p
  o #'magic:file-text-p

They all do what you'd imagine they would.

There is also the availability of using ffi-magic with
`find-file-magic-files-alist' to auto-detect coding system.  Use it at
your own risk, YMMV, don't blame me if it kicks your dog and eats your
children.  It is not enabled by default because of the mixed results
that I've gotten.  For example, see what file(1) says about any .info
file you have, or indeed even etags.el or info.el.  A single #o177
character in a file will cause it to be reported as binary.

* lisp/ffi/ffi-magic.el (ffi-magic-persistent-flags): New.
(magic-options, ffi-magic-options-list, magic-list): New.
(magic-errno, magic-getflags, magic-setflags): New.
(magic-version, magic:version, magic-descriptor): New.
(magic:getflags, ffi-magic-no-safety): New.
(ffi-magic-sanitise-flags, ffi-magic-flag-value): New.
(magic:setflags, magic:cleanup, magic:error): New.
(magic:file-audio-p, magic:file-video-p): New.
(magic:file-image-p, magic:file-text-p): New.
(magic:file-coding-system-p, magic:find-file-noselect): New.
(magic:find-file-magic-alist-enable): New.
(magic:file-type): Made obsolete, alias to #'magic:file.
(magic:file): Now accepts a 2nd FLAGS arg for setting libmagic
flags. It is interactively accessible via prefix arg, with
completion.
Output can optionally be inserted into the current buffer with a
2nd prefix arg.

* lisp/cl-macs.el (load-time-value): Synced up with XE 21.5's
version as their's doesn't cause byte-compiler warnings.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoAmazing the difference a paren can make, including fix my last commit.
Steve Youngs [Tue, 28 May 2019 12:27:24 +0000 (22:27 +1000)]
Amazing the difference a paren can make, including fix my last commit.

* m4/sxe-libc.m4 (SXE_CHECK_LIBC_VERSION): Add missing paren.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoGet glibc version with a distro-agnostic check.
Steve Youngs [Tue, 28 May 2019 11:34:27 +0000 (21:34 +1000)]
Get glibc version with a distro-agnostic check.

This replaces all the distro specific little tests we had to determine the
glibc version.  It's guaranteed to work on any version of glibc running on
any platform.  It simply calls gnu_get_libc_version().

* m4/sxe-libc.m4 (SXE_CHECK_LIBC_VERSION): Simplify for Linux
glibc.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoAlways use the system malloc (removes gmalloc.c malloc.c).
Steve Youngs [Sun, 26 May 2019 06:15:34 +0000 (16:15 +1000)]
Always use the system malloc (removes gmalloc.c malloc.c).

This changeset removes our in-house malloc.c and gmalloc.c and switches to
always using the system provided malloc.

* src/mem/gmalloc.c: Removed.

* src/mem/malloc.c: Removed.

* info/internals/internals.texi (Low-Level Modules): Nuke
descriptions for gmalloc.c and malloc.c, update description for
free-hook.c

* src/ui/X11/device-x.c (x_delete_device): 'FREE_CHECKING' is
never defined and __free_hook is never used so remove crusty bits
of code conditional to it.

* src/mem/Makefile.am (EXTRA_libmemalloc_a_SOURCES): Remove
gmalloc.c and malloc.c.

* src/mem/free-hook.c: Remove all of the old gmalloc debugging
stuff.

* src/mem/ralloc.c: Use HAVE_GLIBC instead of DOUG_LEA_MALLOC.
(Free_Addr_Block): Use void because caddr_t hasn't been a thing
for at least a hundred years.

* src/regex.c: Use HAVE_GLIBC instead of DOUG_LEA_MALLOC.

* src/alloc.c: Use HAVE_GLIBC instead of DOUG_LEA_MALLOC.
Ditto for GNU_MALLOC.
(malloced_storage_size): Because it's always system malloc, update
this to use GNU malloc accounting when on a glibc system.

* m4/sxe-summary.m4 (SXE_SUMMARY): It's always system malloc now
so no need to say if GNU malloc is used.

* src/emacs.c (main): Use HAVE_MALLOC_WARNING instead of
_NO_MALLOC_WARNING_
Use HAVE_GLIBC instead of DOUG_LEA_MALLOC.
(Fdump_emacs): Don't use disable_free_hook().

* src/mem/vm-limit.c: Use HAVE_MALLOC_WARNING instead of
_NO_MALLOC_WARNING_ and reverse the condition sense.

* m4/sxe-libc.m4 (SXE_CHECK_LIBC): Define HAVE_GLIBC.

* configure.ac: Removed  --with-dlmalloc, --with-system-malloc
Define HAVE_MALLOC_WARNING instead of _NO_MALLOC_WARNING_.
Remove check for malloc_set_state() it's not used anywhere.
Don't give reasons why or not GNU malloc is used because it's
not.
Don't define DOUG_LEA_MALLOC.
Don't add gmalloc.o or malloc.o to MEMALLOC_OBJS.
Define HAVE_LIBMCHECK.
Add -lmcheck to MEMALLOC_LIBS.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoBuild fixes for recent libc versions (post glibc 2.19)
Steve Youngs [Fri, 17 May 2019 15:00:07 +0000 (01:00 +1000)]
Build fixes for recent libc versions (post glibc 2.19)

This fixes two 'undefined reference' errors when building with a recent
glibc.  One in effi.c for 'dlsym', and the other in emacs.c for
'memory_warnings'.

* configure.ac: Fix mmap detection.
Include -ldl in FFI_LIBS.
Ensure that vm-limit.o is added to the objects when using the
system malloc.
Default to using the system malloc.

* m4/sxe-emodffi.m4 (SXE_CHECK_FFI): Include -ldl in FFI_LIBS.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoMake #'require's NOERROR arg do its job properly.
Steve Youngs [Wed, 26 Oct 2016 05:29:27 +0000 (15:29 +1000)]
Make #'require's NOERROR arg do its job properly.

* src/fns.c (Frequire): Don't throw an invalid-state error if the
'noerror' arg is non-nil.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoAdd the 'noerror' argument to #'require.
Steve Youngs [Tue, 25 Oct 2016 02:36:50 +0000 (12:36 +1000)]
Add the 'noerror' argument to #'require.

* src/fns.c (Frequire): Synched from XE 21.5, adds 'noerror' arg.
From: Andrés Ramírez <sunshavi@fastmail.fm>

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoEMchat is https as well
Steve Youngs [Sat, 1 Oct 2016 12:53:26 +0000 (22:53 +1000)]
EMchat is https as well

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoAll of SXEmacs' http URLs are now https. WooHoo!
Steve Youngs [Sat, 1 Oct 2016 12:32:46 +0000 (22:32 +1000)]
All of SXEmacs' http URLs are now https.  WooHoo!

I used this shell snippet  to create this changeset...

for sub in www git issues downloads; do
    git grep -l http://$sub.sxemacs|grep -v ChangeLog.d|
       xargs sed -i "s@\(http\)\(://$sub.sxemacs.org\)@\1s\2@"
done

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoFix font-lock-add-keywords (Closes bug 184)
Steve Youngs [Thu, 15 Sep 2016 01:24:41 +0000 (11:24 +1000)]
Fix font-lock-add-keywords (Closes bug 184)

* lisp/font-lock.el (font-lock-add-keywords): When compiled, the
keywords are the cdr of font-lock-keywords, not the cadr.
From: Jonathan Martin <jjm@keelhaul.me.uk>

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoTake care of fallout from updating/fixing #'eval-after-load
Steve Youngs [Sat, 18 Jun 2016 12:08:28 +0000 (22:08 +1000)]
Take care of fallout from updating/fixing #'eval-after-load

* lisp/info.el (Info-file-list-for-emacs): New, just to keep some
FSF/pkgs happy.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoLet #'eval-after-load accept symbol for FILE arg
Steve Youngs [Sat, 18 Jun 2016 09:53:23 +0000 (19:53 +1000)]
Let #'eval-after-load accept symbol for FILE arg

While looking into bug 183 I noticed that FSF's #'eval-after-load also
accepts a feature (i.e, a symbol) for the FILE arg.  I personally don't
think that's a wonderful idea, but I did see that a few things in
GNU/Emacs are using it (Tramp, for example).  This change adds rudimentary
support in our #'eval-after-load.  Basically, if FILE is a symbol, look up
a filename from #'feature-file, or use #'symbol-name if that fails.

The doc string was amended accordingly, and a note about the futility of
using #'eval-after-load with dumped lisp was also added.

* lisp/subr.el (eval-after-load): Also accept symbols for FILE
arg.
Add a note to doc string about the futility of using this on
dumped lisp.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoMake #'eval-after-load DTRT for dumped lisp (Closes bug 183)
Steve Youngs [Sat, 18 Jun 2016 07:59:37 +0000 (17:59 +1000)]
Make #'eval-after-load DTRT for dumped lisp (Closes bug 183)

* lisp/subr.el (eval-after-load): Make sure FORM is eval'd
immediately if FILE is a dumped lib.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoLet's not do "Pre-Release" packages.
Steve Youngs [Sun, 5 Jun 2016 12:13:11 +0000 (22:13 +1000)]
Let's not do "Pre-Release" packages.

Having "Pre-Release" packages and "Official Release" packages was a good
idea back in the early part of 2003 when I added that to XEmacs.  There
was an incredible amount of activity happening in the packages in those
days and bugs were frequently slipping into the packages releases.  Today,
things are different.  The amount of activity in packages, and the number
of users/devs we have it should be easily possible to keep everything in
check without the need for a separate "testing" package hierarchy.

We can always reimplement something along the lines of pre-release
packages at a later date if things get out of hand.

* lisp/menubar-items.el (default-menubar): Remove "Pre-Release"
package menu.

* lisp/package-ui.el (package-ui-pre-release-download-menu):
Remove.

* lisp/package-get.el (package-get-download-sites): Add our FTP,
remove everyone else.
(package-get-pre-release-download-sites): Remove.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoAutomake/Libtool warning fix/suppression
Steve Youngs [Wed, 1 Jun 2016 03:18:10 +0000 (13:18 +1000)]
Automake/Libtool warning fix/suppression

This changeset cleans up all of the warnings that our autogen.sh spits
out.  At least on my system with automake 1.15, and libtool 2.4.6.

A possibly controversial change here (read: ugly as hell) is that I've
symlinked a couple of files from `src' into `lib-src'.  The
lib-src/Makefile.am referenced regex.c, regex.h, and alloca.c in 'src'.
That caused automake to freak out and warn that we were using source files
in subdirectories which would become incompatible in the future.  Automake
does have a "subdir-objects" option for this type of thing, but it causes
problems elsewhere in our build chain.

The symlink "fix" is quick, dirty, and easy, however I'm happy to have it
reverted if a neater solution can be found.

* m4/sxe-libtool.m4 (_SXE_CHECK_LT2): Pull in `_LT_COMPILER_PIC'
to fix a swag of warnings about macros being expanded before being
required.

* lib-src/Makefile.am (REGEX_C, ALLOCA_C): Point to files in the
current directory which are symlinks to the originals in `src'.
This prevents a scary warning from automake about files in
subdirectories and future incompatibities.  Automake does have a
"subdir-objects" option, but because we have a specialised build
that causes more problems than it fixes.

* configure.ac (AM_INIT_AUTOMAKE): Use `-Wno-override' and
`-Wno-portability' to suppress harmless and irrelevant, at least
to us, warnings.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoDisplay a better version of the truth in the configure summary.
Steve Youngs [Tue, 31 May 2016 04:58:27 +0000 (14:58 +1000)]
Display a better version of the truth in the configure summary.

* configure.ac: Set $with_module_path to something closer to the
truth.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoImprove the configure summary output.
Steve Youngs [Mon, 30 May 2016 23:31:51 +0000 (09:31 +1000)]
Improve the configure summary output.

* m4/sxe-summary.m4 (SXE_SUMMARY): Add short caveat about package
paths may be different at runtime.

* configure.ac: Set $with_package_path to something closer to the
truth.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoFIX: missing paren
Steve Youngs [Sun, 29 May 2016 01:38:48 +0000 (11:38 +1000)]
FIX: missing paren

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoDon't use 'make-temp-file', fixes FFI/PUI.
Steve Youngs [Sun, 29 May 2016 01:03:24 +0000 (11:03 +1000)]
Don't use 'make-temp-file', fixes FFI/PUI.

* lisp/ffi/ffi-curl.el (curl:file-exists-p): Use 'make-temp-name'
instead of 'make-temp-file' which may not be available.
(curl:insert-file-contents-literally): Ditto.
(curl:download): #'expand-file-name on the PREFIX arg of
'make-temp-name' so it attempts to avoid name collision.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoSeemless integration of ffi-curl based packages install.
Steve Youngs [Sat, 28 May 2016 23:50:59 +0000 (09:50 +1000)]
Seemless integration of ffi-curl based packages install.

With this changeset, PUI uses the same code for retrieving remote package
files for both EFS backed PUI and ffi-curl backed PUI.  As a bonus
to this, the following forms are now available for use when ffi-curl is
loaded...

  (file-exists-p "http://example.com/filename")
  (file-readable-p "http://example.com/filename")
  (insert-file-contents-literally "http://example.com/filename")
  (copy-file "http://example.com/filename" "/local/file")
  (expand-file-name "http://example.com/filename")
  (file-name-directory "http://example.com/filename")
  (file-name-nondirectory "http://example.com/filename")

* lisp/package-get.el (package-get-update-base): Set the
MUST-MATCH arg in the call to #'read-file-name to nil when dealing
with URI style package sites so it more or less does a
#'read-string in those cases.
Maybe save index from URI style package sites as well.
(package-get): Remove the #'curl:download retrieval.  Package
downloading is now seemless regardless of the transport used.
(package-get-remote-filename): Immediately return FILENAME when
that is a URI style path as well.

* lisp/ffi/ffi-curl.el (curl:file-exists-p): New
(curl:file-readable-p): New
(curl:insert-file-contents-literally): New
(curl:copy-file): New
(curl:expand-file-name): New
(curl:file-name-directory): New
(curl:file-name-nondirectory): New
(curl:file-handler-regexp): New
(curl:file-handler): New

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoSupport http package mirror sites
Steve Youngs [Sat, 21 May 2016 12:22:43 +0000 (22:22 +1000)]
Support http package mirror sites

* curlpui:
  Fix an autoloads problem.
  Update PUI to use #'curl:download when available.

7 years agoFix an autoloads problem.
Steve Youngs [Sat, 21 May 2016 11:37:43 +0000 (21:37 +1000)]
Fix an autoloads problem.

* lisp/package-get.el (package-get-have-curl): Autoload it and set
its value via requiring ffi-curl instead of a featurep test.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoUpdate PUI to use ffi-curl
Steve Youngs [Sat, 21 May 2016 03:04:36 +0000 (13:04 +1000)]
Update PUI to use ffi-curl

* pui:
  Update PUI to use #'curl:download when available.

7 years agoImplement a blacklist for problem OpenSSL ciphers.
Steve Youngs [Mon, 16 May 2016 00:08:44 +0000 (10:08 +1000)]
Implement a blacklist for problem OpenSSL ciphers.

Since OpenSSL v1.0.0 was released, a number of ciphers have caused
problems for SXEmacs' ossl, up to and including data corruption.  This
changeset prevents these ciphers from being used.

See: `ossl-cipher-blacklist'

The blacklisted ciphers can still be used if they are first removed from
`ossl-cipher-blacklist', but obviously this is not recommended.

* src/openssl.c (ossl_check_cipher): New. Returns 0 if cipher is
NOT on our blacklist.
(Fossl_available_ciphers): Check cipher with ossl_check_cipher().
(ossl_cipher_fun): Ditto.
(Fossl_bytes_to_key): Ditto.
(Fossl_encrypt): Ditto.
(Fossl_encrypt_file): Ditto.
(Fossl_decrypt): Ditto.
(Fossl_decrypt_file): Ditto.
(Fossl_seal): Ditto.
(Fossl_open): Ditto.
(Fossl_pem_write_key): Ditto.
(Fossl_pem_key): Ditto.
(Fossl_digest_size): Typo fix "cipher" -> "digest".
(vars_of_openssl): New var, Vossl_cipher_blacklist. A list of
ciphers we don't want to use.
(syms_of_openssl): Define all of the blacklisted cipher names.

* tests/automated/openssl-tests.el: Run tests on all available
ciphers and digests.
Make sure use of blacklisted ciphers results in an error.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoPrevent Unexpected errors in OpenSSL Testsuite.
Steve Youngs [Tue, 10 May 2016 06:15:17 +0000 (16:15 +1000)]
Prevent Unexpected errors in OpenSSL Testsuite.

For some years now we've been seeing a couple of unexpected errors
cropping up in the OpenSSL tests.  It turns out that certain ciphers
disagree with how we do things, or perhaps OpenSSL itself is buggy.
Either way, what this changeset does is stop those ciphers being used in
the testsuite.

Yes, this is very much a case of sticking our fingers in our ears and
screaming "LA LA LA I'm NOT LISTENING!!".  Expect a real fix in openssl.c
to come in the future.  Hopefully sooner, rather than later.

* tests/automated/openssl-tests.el: Prevent known-bad ciphers from
ruining our testsuite.
Open up the tests to also include ciphers smaller than 128bits,
and all digests. This effectively increases the number of tests
run to more than 200,000.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoLast release's ChangeLog
Steve Youngs [Fri, 6 May 2016 11:01:30 +0000 (21:01 +1000)]
Last release's ChangeLog

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoSXEmacs v22.1.16 is released! v22.1.16
Steve Youngs [Fri, 6 May 2016 08:30:51 +0000 (18:30 +1000)]
SXEmacs v22.1.16 is released!

What can I say, I got tired of waiting and just, well, released.

* info/sxemacs/sxemacs.texi (Top): Update version.

* info/sppm.texi: Update versioning macros.

* autogen.sh (EXPECTED_TREE_VERSION): 22.1.16
(sxemacs_codename): "Hillman Hunter"

* etc/NEWS: Add the news for v22.1.16

Signed-off-by: Steve Youngs <steve@sxemacs.org>
8 years agoFix the fix to really close 181
Steve Youngs [Tue, 15 Mar 2016 00:41:53 +0000 (10:41 +1000)]
Fix the fix to really close 181

* merges:
  Fix MPFR Flog implementation

8 years agoFix MPFR Flog implementation
Nelson Ferreira [Mon, 14 Mar 2016 23:05:46 +0000 (19:05 -0400)]
Fix MPFR Flog implementation

* src/ent/floatfns.c (Flog10): Use RETURN_WHEN_INDEF to check
before dividing by log 10.
(Flog2): Use RETURN_WHEN_INDEF to check before dividing by log 2.
(Flog): Properly add parameters to Flog.  Use
the common RETURN_WHEN_INDEF when Flog return indefinite.
Plus some whitespace fixes.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoClose 181
Steve Youngs [Mon, 14 Mar 2016 07:58:53 +0000 (17:58 +1000)]
Close 181

* merges:
  Fix bug 181: log does not take base into account without mpfr

8 years agoFix bug 181: log does not take base into account without mpfr
Nelson Ferreira [Sat, 12 Mar 2016 17:33:46 +0000 (12:33 -0500)]
Fix bug 181: log does not take base into account without mpfr

* src/ent/floatfns.c (RETURN_WHEN_INDEF): New macro for the common
handling of indefinites in logarithmic functions.
(Flog10): Always define, but throw invalid operation if no
logarithmic primitive is available.
(Flog2): Ditto.
(Flog): Try to use Flog10 or Flog2 if the bases match.  In case of
float operation try to use Flog2 since it is usually more
efficient.

* configure.ac: Check for availability of all the logarithmic
functions.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoError instead of crashing on OGG/MP3 streams
Steve Youngs [Sat, 16 Jan 2016 23:16:54 +0000 (09:16 +1000)]
Error instead of crashing on OGG/MP3 streams

* merges:
  Debug message fix
  Fix crash when using ffmpeg to play mp3 and ogg

8 years agoDebug message fix
Nelson Ferreira [Sat, 16 Jan 2016 22:18:36 +0000 (17:18 -0500)]
Debug message fix

* src/media/media.c (sxe_msf_DBL_down): Minor fix on debug
message, it is DBL not FLT.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoFix crash when using ffmpeg to play mp3 and ogg
Nelson Ferreira [Sat, 16 Jan 2016 22:14:03 +0000 (17:14 -0500)]
Fix crash when using ffmpeg to play mp3 and ogg

* src/media/media-ffmpeg.c (media_ffmpeg_analyse_audio): Refactor
detection of sample size using av_get_bytes_per_sample. Error when
format is not supported instead of silently go ahead and possibly
crash later.

* src/media/media.c (sxe_msf_DBL_up): Implement conversion to
internal format from double.
(sxe_msf_DBL_down): Implement from internal format to double.

* src/media/media.h: Declare double encoded samples.

* m4/sxe-mm.m4 (SXE_CHECK_FFMPEG_LIBS): Detect
av_get_bytes_per_sample and av_get_sample_fmt_string.
(SXE_MM_CHECK_FFMPEG): Enforce presenc of av_get_bytes_per_sample
and av_get_sample_fmt_string.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoFfile_basename(), Ffile_dirname() updates, POSIX compliance
Steve Youngs [Sun, 10 Jan 2016 06:57:31 +0000 (16:57 +1000)]
Ffile_basename(), Ffile_dirname() updates, POSIX compliance

* merges:
  Properly determine the name of preceeding directory
  Expand file name before dirname
  Use xrealpath
  Make basename and dirname POSIX compliant
  Add tests for file-name-directory, etc
  Add file name joiner
  Improve documentation

8 years agoProperly determine the name of preceeding directory
Nelson Ferreira [Sat, 9 Jan 2016 22:54:36 +0000 (17:54 -0500)]
Properly determine the name of preceeding directory

* lisp/build-autoloads.el (find-emod-directories): Use basename of
dirname to determine name of preceeding directory.  Now that
basename and dirname are POSIX compliant this works and is much
more bullet proof than the split of dirname by /.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoExpand file name before dirname
Nelson Ferreira [Sat, 9 Jan 2016 22:52:44 +0000 (17:52 -0500)]
Expand file name before dirname

* lisp/packages.el (package-suppress): Expand file name before
call to file-dirname

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoUse xrealpath
Nelson Ferreira [Sat, 9 Jan 2016 22:51:27 +0000 (17:51 -0500)]
Use xrealpath

* src/dired.c (dired_realpath): Use xrealpath for safety

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoMake basename and dirname POSIX compliant
Nelson Ferreira [Sat, 9 Jan 2016 22:49:05 +0000 (17:49 -0500)]
Make basename and dirname POSIX compliant

* src/fileio.c (Ffile_basename): Improve documentation and make
POSIX compliant by returning full string when there is no slashes.

* src/fileio.c (Ffile_dirname): Improve documentation and make
POSIX compliant by using xdirname.

8 years agoAdd tests for file-name-directory, etc
Nelson Ferreira [Sat, 9 Jan 2016 20:18:26 +0000 (15:18 -0500)]
Add tests for file-name-directory, etc

* tests/automated/lisp-tests.el: Add tests for
file-name-directory, file-name-nondirectory, file-dirname,
file-basename, file-name-join.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoAdd file name joiner
Nelson Ferreira [Sat, 9 Jan 2016 20:16:59 +0000 (15:16 -0500)]
Add file name joiner

* lisp/files.el (file-name-join): Add file-name-join to safely
join directory and filename components.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoImprove documentation
Nelson Ferreira [Sun, 3 Jan 2016 22:19:34 +0000 (17:19 -0500)]
Improve documentation

* src/fileio.c (Ffile_name_directory): Add samples to
documentation, so it is clearer what the outcome would be.
(Ffile_name_nondirectory): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoDocument text corruption issue with Xorg ATI driver
Nelson Ferreira [Sun, 3 Jan 2016 21:02:01 +0000 (16:02 -0500)]
Document text corruption issue with Xorg ATI driver

* PROBLEMS: Document text corruption issue with Xorg ATI driver

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoLadies and Gentlement, FFmpeg is back!
Steve Youngs [Fri, 1 Jan 2016 00:19:46 +0000 (10:19 +1000)]
Ladies and Gentlement, FFmpeg is back!

* merges:
  Final set of changes for a working ffmpeg.
  More update to newer ffmpeg API
  Use new virtual IO api
  Cleanup global video state.
  Additional usage of the new api
  Update ffmpeg codec and media constants
  Fix metadata usage
  Sync up FFmpeg -- autoconf

8 years agoFinal set of changes for a working ffmpeg.
Nelson Ferreira [Thu, 31 Dec 2015 19:39:54 +0000 (14:39 -0500)]
Final set of changes for a working ffmpeg.

There are a couple of edges to polish but "works for me" now.

* src/media/media-ffmpeg.c (media_ffmpeg_read): Use
avcodec_decode_audio3 if available. More work is needed to use
avcodec_decod_audio4 because it uses frames which would need to
then be copied to the output buffer.
(my_get_buffer): Use avcodec_default_get_buffer2.
(my_release_buffer): No longer needed.
(stream_component_open): Properly set the thread count and use
avcodec_open2. Set get_buffer2 to my_get_buffer since we
are using the new interface.
(media_ffmpeg_available_formats): Use av_iformat_next.
(stream_open): Defer setting codec options to a later better
understanding of ffmpeg (keep #if 0 the old).
(new_media_ffmpeg_open): Use only the most recent AVIOContext access
method to set eof_reached. If we get issues reported we'll
revisit.
(new_media_ffmpeg_read): Use avio_eof and the most error field of
AVIOContext instead of furl_feof.  Do not unset the interrupt
callback for now.  We may need to revisit the reset of the
callback later.

* m4/sxe-mm.m4 (SXE_CHECK_FFMPEG_LIBS): Properly check for the
avcodec_decode_audio* and define corresponding
HAVE_AVCODEC_AUDIO*.  Also check for av_iformat_next.
(SXE_MM_CHECK_FFMPEG): Check at least one avcodec_decode_audio is
available and av_iformat_next.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoMore update to newer ffmpeg API
Nelson Ferreira [Thu, 31 Dec 2015 19:15:14 +0000 (14:15 -0500)]
More update to newer ffmpeg API

* src/media/media-ffmpeg.h: Add include of avutil/time.h

* src/media/media-ffmpeg.c (AVCODEC_MAX_AUDIO_FRAME_SIZE): Add
define if missing to last known legacy value.
(media_ffmpeg_open): Properly use avcodec_open2
(media_ffmpeg_read): Fix warnings.

* m4/sxe-mm.m4 (SXE_CHECK_FFMPEG_HEADERS): Check also avutil/time.h.
(SXE_CHECK_FFMPEG_LIBS): Check for avformat_free_context and avio_feof.
(SXE_MM_CHECK_FFMPEG): Refactor header check for ease of adding
additional ones.  Verify avformat_free_context and avio_feof are
available.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoUse new virtual IO api
Nelson Ferreira [Thu, 31 Dec 2015 16:58:19 +0000 (11:58 -0500)]
Use new virtual IO api

* src/media/media-ffmpeg.c: Remove the no-longer used
media_ffmpeg_vio_open, media_ffmpeg_vio_close,
media_ffmpeg_vio_write.
(media_ffmpeg_vio_read): Use the new opaque pointer interface of
AVIOContext, which points to our media_data struct directly.
(media_ffmpeg_vio_seek): Ditto.
(media_ffmpeg_open_data): Use the new AVIOContext and allocate one
pointing to media_ffmpeg_vio_read, media_ffmpeg_vio_seek and with
opaque data as our media_data.  Use the context to open the input.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoCleanup global video state.
Nelson Ferreira [Thu, 31 Dec 2015 16:39:44 +0000 (11:39 -0500)]
Cleanup global video state.

* src/media/media-ffmpeg.c: Remove global video state since it is
not used, except to set to NULL.
 (new_media_ffmpeg_read): No need to reset global_video_state, as it is not used.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoAdditional usage of the new api
Nelson Ferreira [Thu, 31 Dec 2015 16:37:06 +0000 (11:37 -0500)]
Additional usage of the new api

* src/media/media-ffmpeg.c (media_ffmpeg_open_file): Use
avformat_open_input and avformat_find_stream_info,
avformat_close_input.
(stream_open): Use avformat_open_input.
(media_ffmpeg_close): Use avformat_close_input.
(media_ffmpeg_open): Use avio_size, avformat_find_stream_info,
av_dump_format and avoid warning.
(new_media_ffmpeg_read): Use avformat_close_input.

* src/media/media-ffmpeg.h: Include avcodec.h

* m4/sxe-mm.m4 (SXE_MM_CHECK_FFMPEG): Verify availability of all
the included ffmpeg headers. And additional functions,
avio_alloc_context, avio_size, av_dump_format.
(SXE_CHECK_FFMPEG_HEADERS): Check also for avcodec.h
(SXE_CHECK_FFMPEG_LIBS): Check for av_dump_format,
avio_alloc_context, avio_size.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoUpdate ffmpeg codec and media constants
Nelson Ferreira [Sun, 27 Dec 2015 22:44:04 +0000 (17:44 -0500)]
Update ffmpeg codec and media constants

* src/media/media-ffmpeg.c (media_ffmpeg_analyse_audio): Use
AV_SAMPLE_* instead of SAMPLE_*.
(media_ffmpeg_open): Use AVMEDIA_TYPE_* instead of CODEC_TYPE_*.
(stream_component_open): Ditto.
(stream_component_close): Ditto.
(new_media_ffmpeg_open): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoFix metadata usage
Nelson Ferreira [Sun, 27 Dec 2015 22:33:42 +0000 (17:33 -0500)]
Fix metadata usage

* src/media/media-ffmpeg.h: Add include for dict.h

* src/media/media-ffmpeg.c (media_ffmpeg_streaminfo): Use
AVDictionary.
(dump_stream_info): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoSync up FFmpeg -- autoconf
Steve Youngs [Mon, 2 Jul 2012 14:05:57 +0000 (00:05 +1000)]
Sync up FFmpeg -- autoconf

This changeset is the first in a series to sync up our FFmpeg code with a
much more modern and up to date FFmpeg.  This one takes care of the
autoconf side of things.  It is cherry-picked from an earlier ffmpeg-fix
branch, squashing all the configuration related changes.

This changeset also introduces new minimum versions of libavformat and
libavcodec required by SXEmacs:

  libavformat -- 55.12.100
  libavcodec  -- 55.18.102

* configure.ac: Need libs for avcodec as well as avformat. Add
          in libavutil libs.

* m4/sxe-mm.m4 (SXE_MM_CHECK_FFMPEG): Rework it for modern
ffmpeg. Check for av_dict_get() in libavutil.

* m4/sxe-mm.m4 (SXE_CHECK_FFMPEG_HEADERS): Check for avcodec.h
and dict.h as well.

* m4/sxe-mm.m4 (SXE_CHECK_FFMPEG_LIBS): Check for libavutil.

* m4/sxe-mm.m4 (SXE_MM_CHECK_FFMPEG):

8 years agoA place to keep aliases to built-in constants when needed
Steve Youngs [Sat, 26 Dec 2015 02:12:26 +0000 (12:12 +1000)]
A place to keep aliases to built-in constants when needed

* merges:
  Add logged, but missing change from previous commit.
  Segregate aliases to DEFVAR_CONST
  Revert "Fix the fix, make pi a normal lisp var (Closes bug #176)"

8 years agoAdd logged, but missing change from previous commit.
Steve Youngs [Sat, 26 Dec 2015 02:04:53 +0000 (12:04 +1000)]
Add logged, but missing change from previous commit.

* lisp/Makefile.am (corelispels): Add const-aliases.el.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
8 years agoSegregate aliases to DEFVAR_CONST
Nelson Ferreira [Fri, 25 Dec 2015 21:40:24 +0000 (16:40 -0500)]
Segregate aliases to DEFVAR_CONST

* lisp/float-sup.el: Remove alias for pi and e when bigfr is
available. These should now be defined in const-aliases, loaded
by startup.

* lisp/const-aliases.el (pi): Define const as bigfr-pi when bigfr
is available.
(e): Define as euler when bigfr is available.

* lisp/Makefile.am (corelispels): Add const-aliases.el to list of
files.

* lisp/startup.el (load-init-file): Require new const-aliases to
load the consts that cannot be dumped.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
8 years agoRevert "Fix the fix, make pi a normal lisp var (Closes bug #176)"
Nelson Ferreira [Fri, 25 Dec 2015 21:34:17 +0000 (16:34 -0500)]
Revert "Fix the fix, make pi a normal lisp var (Closes bug #176)"

This reverts commit 528ced5b22b7681234d5228d0a2a02d9a2305312.

8 years agoFix the fix, make pi a normal lisp var (Closes bug #176)
Steve Youngs [Wed, 23 Dec 2015 08:20:22 +0000 (18:20 +1000)]
Fix the fix, make pi a normal lisp var (Closes bug #176)

This change reverts the previous one, and then goes about closing bug 176
in a different way.  Namely, by changing Vpi from being a
DEFVAR_CONST_LISP to a DEFVAR_LISP. IOW, a plain ordinary variable.

* src/ent/ent-mpfr.c (vars_of_ent_mpfr): Set Vpi to be a normal
lisp variable instead of a constant so packages like Calc can
let-bind them for their own evil and misguided purposes. :-)
Vbigfr_pi -> Vpi

* src/ent/ent-mpfr.h: Vbigfr_pi -> Vpi

* lisp/float-sup.el: Revert previous change.

Signed-off-by: Steve Youngs <steve@sxemacs.org>