unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux
@ 2021-02-20  5:36 ` Utkarsh Singh
  2021-02-20  8:42   ` Andreas Schwab
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Utkarsh Singh @ 2021-02-20  5:36 UTC (permalink / raw)
  To: 46660

[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 519 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux
  2021-02-20  5:36 ` bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux Utkarsh Singh
@ 2021-02-20  8:42   ` Andreas Schwab
  2021-02-20 12:16   ` bug#46660: [Andreas Schwab] " Utkarsh Singh
  2021-02-23  4:31   ` bug#46660: [Utkarsh Singh] " Utkarsh Singh
  2 siblings, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2021-02-20  8:42 UTC (permalink / raw)
  To: Utkarsh Singh; +Cc: 46660

On Feb 20 2021, Utkarsh Singh wrote:

> 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)

Use "\\'" instead of "$".  Is this supposed to match "fooPKGBUILD"?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#46660: [Andreas Schwab] Re: bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux
  2021-02-20  5:36 ` bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux Utkarsh Singh
  2021-02-20  8:42   ` Andreas Schwab
@ 2021-02-20 12:16   ` Utkarsh Singh
  2021-02-22 15:08     ` Lars Ingebrigtsen
  2021-02-23  4:31   ` bug#46660: [Utkarsh Singh] " Utkarsh Singh
  2 siblings, 1 reply; 6+ messages in thread
From: Utkarsh Singh @ 2021-02-20 12:16 UTC (permalink / raw)
  To: 46660

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

Andreas Schwab <schwab@linux-m68k.org> writes:

> Use "\\'" instead of "$".  Is this supposed to match "fooPKGBUILD"?

Thanks I was unaware of this particular regex!

diff --git a/lisp/files.el b/lisp/files.el
index 68e883513c..393b3472f7 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)
-- 
Utkarsh Singh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 519 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux
  2021-02-20 12:16   ` bug#46660: [Andreas Schwab] " Utkarsh Singh
@ 2021-02-22 15:08     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-22 15:08 UTC (permalink / raw)
  To: Utkarsh Singh; +Cc: 46660

Utkarsh Singh <utkarsh190601@gmail.com> writes:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Use "\\'" instead of "$".  Is this supposed to match "fooPKGBUILD"?
>
> Thanks I was unaware of this particular regex!

[...]

> +     ("PKGBUILD\\'" . sh-mode)

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

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#46660: [Utkarsh Singh] Re: bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux
  2021-02-20  5:36 ` bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux Utkarsh Singh
  2021-02-20  8:42   ` Andreas Schwab
  2021-02-20 12:16   ` bug#46660: [Andreas Schwab] " Utkarsh Singh
@ 2021-02-23  4:31   ` Utkarsh Singh
  2021-02-23 15:43     ` Lars Ingebrigtsen
  2 siblings, 1 reply; 6+ messages in thread
From: Utkarsh Singh @ 2021-02-23  4:31 UTC (permalink / raw)
  To: 46660

> 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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#46660: [Utkarsh Singh] Re: bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux
  2021-02-23  4:31   ` bug#46660: [Utkarsh Singh] " Utkarsh Singh
@ 2021-02-23 15:43     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-23 15:43 UTC (permalink / raw)
  To: Utkarsh Singh; +Cc: 46660

Utkarsh Singh <utkarsh190601@gmail.com> writes:

>> 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?

I interpret this to mean that the files are called "PKGBUILD", with no
prefix, and I've committed your patch (with a change to match exactly
that) to Emacs 28.  (The fix is to add a "/" to the start of the regexp,
since we're matching on the entire file name.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-23 15:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87r1l74dfg.fsf@gmail.com>
2021-02-20  5:36 ` bug#46660: [PATCH] 28.0.50; Support for PKGBUILD files on Arch Linux Utkarsh Singh
2021-02-20  8:42   ` Andreas Schwab
2021-02-20 12:16   ` bug#46660: [Andreas Schwab] " Utkarsh Singh
2021-02-22 15:08     ` Lars Ingebrigtsen
2021-02-23  4:31   ` bug#46660: [Utkarsh Singh] " Utkarsh Singh
2021-02-23 15:43     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).