bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux

Utkarsh Singh
Hi,

Can we add support for PKGBUILD(1) files for Emacs which are used to
install packages from AUR(Arch User Repository).

PKGBUILD are just normal shell script files, so we just have to add
sh mode to it:
diff --git a/lisp/files.el b/lisp/files.el
index 68e883513c..7d01938144 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2723,6 +2723,7 @@ auto-mode-alist
      ("\\.scm\\.[0-9]*\\'" . scheme-mode)
      ("\\.[ckz]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
      ("\\.bash\\'" . sh-mode)
+     ("PKGBUILD$" . sh-mode)
      ("\\(/\\|\\`\\)\\.\\(bash_\\(profile\\|history\\|log\\(in\\|out\\)\\)\\|z?log\\(in\\|out\\)\\)\\'" . sh-mode)
      ("\\(/\\|\\`\\)\\.\\(shrc\\|zshrc\\|m?kshrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode)
      ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode)

There is also a special pkgbuild-mode(2) for editing these files which
is also an derivation of sh-mode.

[1]: https://wiki.archlinux.org/index.php/PKGBUILD
[2]: https://github.com/juergenhoetzel/pkgbuild-mode
--
Utkarsh Singh

signature.asc (529 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#46660: [Utkarsh Singh] Re: bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux

Utkarsh Singh
> Thanks, but this will still match "fooPKGBUILD".  Is that the intention,
> or are these files called only "PKGBUILD" without any prefix?

Yes, these file are only called PKGBUILD without any post-fix.

For prefix shouldn't they match the file path for ex:
'/home/user/emacs/PKGBUILD' or is file path ignored in this case?
--
Utkarsh Singh